diff options
-rwxr-xr-x | qemu/run_qemu.sh | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/qemu/run_qemu.sh b/qemu/run_qemu.sh index 5d718c1..d3d24df 100755 --- a/qemu/run_qemu.sh +++ b/qemu/run_qemu.sh @@ -1,5 +1,8 @@ #!/bin/bash +# This script can be run inside docker container to run on supported version of qemu: +# docker run -v `pwd`:/mnt -w/mnt -ti linaro/ci-amd64-ledge:stable /mnt/run_qemu.sh aarch64 ledge-iot-ledge-qemuarm64-.rootfs.wic + arch="$1" disk_image="$2" firmware="$3" @@ -9,6 +12,7 @@ common_args='' qemu_prefix='qemu-system-' efi_keys='ledge-kernel-uefi-certs.ext4.img' ovmf_file='firmware.uefi-edk2.bin' +ovmf_vars='LEDGE_AARCH64_QEMU_VARS.bin' firmware_file='firmware.uefi.uboot.bin' print_help () { @@ -22,14 +26,15 @@ print_help () { [ $# -lt 2 ] && print_help # common args -common_args+=' -m 1024 -smp 2 -show-cursor' +common_args+=' -m 2048 -smp 2 -show-cursor' common_args+=' -serial stdio ' common_args+=' -monitor null -nographic ' # setup RNG common_args+=' -device virtio-rng-pci ' # setup common network -common_args+=' -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:02 ' -common_args+=' -netdev tap,id=net0,ifname=tap0,script=no,downscript=no ' +# common_args+=' -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:02 ' +# common_args+=' -netdev tap,id=net0,ifname=tap0,script=no,downscript=no ' +common_args+=' -net nic,model=virtio,macaddr=DE:AD:BE:EF:36:03 -net user ' case "$arch" in x86_64) @@ -49,9 +54,9 @@ case "$arch" in if [ "$firmware" = 'ovmf' ]; then extra_args+=' -machine virt' - extra_args+=" -bios $ovmf_file" + extra_args+=" -pflash $ovmf_file -pflash $ovmf_vars" else - extra_args+=" -bios $firmware_file " + extra_args+=" -pflash $firmware_file" extra_args+=' -machine virt,secure=on ' extra_args+=' -d unimp ' extra_args+=" -drive id=disk1,file=$efi_keys,if=none,format=raw" @@ -85,7 +90,7 @@ qemu_bin="$qemu_prefix""$arch" # echo "Binary: $qemu_bin" echo "Run: $qemu_bin $common_args $extra_args " -eval "sudo $qemu_bin" "$common_args" "$extra_args" +eval "$qemu_bin" "$common_args" "$extra_args" # OVMF #qemu-system-aarch64 \ |