diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2020-01-23 15:49:17 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2020-01-23 15:49:17 +0000 |
commit | 573817bc72b5f3273bcf2bca6e2d98e105c976b5 (patch) | |
tree | 4247f6a199896108f7ce7f8d1a1fb724c15d7ce4 /run-qemu | |
parent | 4afda13f9e30f96932b1d1ab28ef014a9ebaaa29 (diff) | |
download | lh-bootstrap-573817bc72b5f3273bcf2bca6e2d98e105c976b5.tar.xz |
Add run-qemu and disk image creation
Disk image creation depends on libguestfs, which is a huge
dependency, but people will only run it on dev machines already,
and it saves reinventing the wheel.
Diffstat (limited to 'run-qemu')
-rwxr-xr-x | run-qemu | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/run-qemu b/run-qemu new file mode 100755 index 0000000..5434678 --- /dev/null +++ b/run-qemu @@ -0,0 +1,15 @@ +#!/bin/sh -e + +case "$QEMU_ARCH" in + aarch64) + qemucpu=cortex-a57 + qemuconsole=ttyAMA0 ;; +esac + +exec qemu-system-${QEMU_ARCH} -nographic -M virt -cpu $qemucpu -smp 4 -m 2G \ + -kernel "$OUTPUT/kernel" \ + -append "root=/dev/vda1 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 |