#!/bin/sh -e if test -n "$CONSOLE" ; then consoleoption="console=$CONSOLE" fi case "$QEMU_ARCH" in arm) cpuoption="-machine virt,highmem=off -cpu cortex-a15" ;; aarch64) cpuoption="-M virt -cpu cortex-a57" ;; x86_64) cpuoption="-M pc -cpu qemu64" esac exec qemu-system-${QEMU_ARCH} -nographic $cpuoption -smp 4 -m 2G -nodefaults -display none -serial mon:stdio \ -kernel "$OUTPUT/kernel" \ -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=::2222-10.0.2.1:22 \ -device virtio-net-pci,netdev=eth0