a radical and experimental distribution based on musl libc and busybox http://sabo.xyz
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
853 B

#!/bin/sh
# use: run-emulator.sh [--console --ro]
# runs the rootfs under QEMU using 9P mount
# --console puts QEMU in terminal-only mode (no SDL window)
# --ro mounts the file system read-only
# uses $H/config to detect rootfs location
export H="$PWD"
. ./config
console=
rw=rw
for i ; do
[ "$i" = --console ] && console="console=ttyS0"
[ "$i" = --ro ] && rw=ro
done
nographic=
[ -z "$console" ] || nographic="-nographic"
[ -z "$console" ] && console="vga=ask"
[ -z "$INIT" ] && INIT=/bin/init
[ -z "$KERNEL" ] && KERNEL=$R/boot/vmlinuz
[ -z "$ram" ] && ram=140
qemu-system-$A $nographic -m $ram -no-reboot -kernel $KERNEL -append \
"root=root $rw rootflags=$rw,trans=virtio,version=9p2000.L rootfstype=9p init=$INIT panic=1 HOST=$A $console" \
-fsdev local,id=root,path=$R,security_model=none -device virtio-9p-pci,fsdev=root,mount_tag=root