From 573817bc72b5f3273bcf2bca6e2d98e105c976b5 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 23 Jan 2020 15:49:17 +0000 Subject: 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. --- run-qemu | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 run-qemu (limited to 'run-qemu') 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 -- cgit v1.2.3