Skip to content

Draft: Qemu boot cloud image

Jordan Bonser requested to merge qemu_boot_cloud_image into main

Expanding on the Hermetic QEMU Toolchain to ensure that all paths are provided to allow the execution of QEMU from a location other than the standard install location.

Summary of the changes: I've had to modify the SRCS.bzl as some of the 'all' cpu sources were missing which stopped the aarch64 emulator from running. added module_dir and bios_link_dir which are required parameters for the emulator to run in a location other than the usual install location. modified how the LLP was being path escaped and referenced in the script.

Running x86: Resolved:

bazelisk run -- //labgrid/toolchain/qemu-system:resolved -m 2048 -nographic -snapshot -device e1000,netdev=net0 -netdev user,id=net0,hostfwd=tcp::4444-:22 -drive driver=qcow2,file=<qcow image path>

Using specific target:

bazel run -- //debian/amd64/qemu-system-x86:qemu-system-x86_64 -m 2048 -nographic -snapshot -device e1000,netdev=net0 -netdev user,id=net0,hostfwd=tcp::4444-:22 -drive driver=qcow2,file=<qcow image path>

Running aarch64 Generate EFI firmware. Reference guide

apt-get install qemu-efi-aarch64
dd if=/dev/zero of=flash1.img bs=1M count=64
dd if=/dev/zero of=flash0.img bs=1M count=64
dd if=/usr/share/qemu-efi-aarch64/QEMU_EFI.fd of=flash0.img conv=notrunc

Run target:

bazel run -- //debian/amd64/qemu-system-arm:qemu-system-aarch64 -nographic -machine virt,gic-version=max -m 512M -cpu max -smp 4 -netdev user,id=vnet,hostfwd=:127.0.0.1:0-:22 -device virtio-net-pci,netdev=vnet -drive file=<image>,if=none,id=drive0,cache=writeback -device virtio-blk,drive=drive0,bootindex=0 -drive file=<path to flash0.img>,format=raw,if=pflash -drive file=<path to flash1.img>,format=raw,if=pflash
Edited by Luke Hackwell

Merge request reports