summaryrefslogtreecommitdiff
path: root/run-qemu
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-01-29 15:00:01 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-01-29 15:00:01 +0000
commit3dcb6c6a73cd16acc7bcae9e54cda16fed89f35b (patch)
treee2b2b231622470ddc95a74f62b3cebcdcc492914 /run-qemu
parent5809b2dc1536794cff7df2ab4f79d2fe7b6720bc (diff)
downloadlh-bootstrap-3dcb6c6a73cd16acc7bcae9e54cda16fed89f35b.tar.xz
Reimport userfs, rwfs and s6-rc from master
Diffstat (limited to 'run-qemu')
-rwxr-xr-xrun-qemu21
1 files changed, 12 insertions, 9 deletions
diff --git a/run-qemu b/run-qemu
index 77ff3de..eb2208f 100755
--- a/run-qemu
+++ b/run-qemu
@@ -1,15 +1,18 @@
#!/bin/sh -e
+if test -n "$CONSOLE" ; then
+ consoleoption="console=$CONSOLE"
+fi
+
case "$QEMU_ARCH" in
- aarch64)
- qemucpu=cortex-a57
- qemuconsole=ttyAMA0 ;;
+ aarch64) cpuoption="-cpu cortex-a57" ;;
esac
-exec qemu-system-${QEMU_ARCH} -nographic -M virt -cpu $qemucpu -smp 4 -m 2G -nodefaults -display none -serial mon:stdio \
+exec qemu-system-${QEMU_ARCH} -nographic -M virt $cpuoption -smp 4 -m 2G -nodefaults -display none -serial mon:stdio \
-kernel "$OUTPUT/kernel" \
- -append "root=/dev/vda console=$qemuconsole" \
- -drive if=none,file=$OUTPUT/disk-image.qcow2,format=qcow2,id=disk \
- -netdev user,id=network,hostfwd=tcp:127.0.0.1:2222-:22 \
- -device virtio-blk-pci,drive=disk \
- -device virtio-net-device,netdev=network
+ -append "root=/dev/vda $consoleoption" \
+ -drive if=virtio,file=$OUTPUT/rootfs.qcow2,format=qcow2,media=disk,index=1 \
+ -drive if=virtio,file=$OUTPUT/rwfs.qcow2,format=qcow2,media=disk,index=2 \
+ -drive if=virtio,file=$OUTPUT/userfs.qcow2,format=qcow2,media=disk,index=3 \
+ -netdev user,id=eth0,hostfwd=tcp:127.0.0.1:2222-:22 \
+ -device virtio-net-device,netdev=eth0