Skip to content

Commit 6b06176

Browse files
committed
Add aarch64 QEMU support with UEFI firmware
Adds qemu-system-aarch64 configuration for ARM64 testing with VirtIO devices, Cortex-A72 CPU, and UEFI firmware support. Change-type: minor Signed-off-by: Kyle Harding <[email protected]>
1 parent 3d534cf commit 6b06176

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ RUN install_packages \
7474
minicom \
7575
openssh-client \
7676
ovmf \
77+
qemu-efi-aarch64 \
7778
rsync \
7879
systemd \
7980
zlib1g

resources/qemu.robot

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ Run "${image}" with "${memory}" MB memory "${cpus}" cpus and "${serial_port_path
1616
Process ${result}
1717
Set Test Variable ${image_copy} /tmp/resin${random}.img
1818

19+
# detect host architecture
20+
${result} = Run Buffered Process uname -m shell=yes
21+
Process ${result}
22+
Set Test Variable ${arch} ${result.stdout}
23+
24+
# if host is aarch64/arm64, use aarch64 image
25+
Run Keyword And Return If "${arch}" == "aarch64" or "${arch}" == "arm64" Run aarch64 image
26+
1927
# firmware is 'dos' (legacy x86 DTs) or 'gpt' (generic-amd64 DT)
2028
${result} = Run Buffered Process fdisk -l "${image}" | sed -nE 's/^Disklabel type: (\\w+)$/\\1/p' shell=yes
2129
Process ${result}
@@ -27,6 +35,13 @@ Run "${image}" with "${memory}" MB memory "${cpus}" cpus and "${serial_port_path
2735
Run Keyword And Return If ${result.rc} == 0 Run "${firmware}" image with "kvm" acceleration
2836
Run Keyword And Return If ${result.rc} != 0 Run "${firmware}" image with "tcg" acceleration
2937

38+
Run aarch64 image
39+
# https://www.qemu.org/docs/master/system/qemu-manpage.html
40+
# .. depending on the target architecture: kvm, xen, hvf, nvmm, whpx (default: tcg)
41+
${result} = Run Buffered Process test -r /dev/kvm && test -w /dev/kvm shell=yes
42+
Run Keyword And Return If ${result.rc} == 0 Run "aarch64" image with "kvm" acceleration
43+
Run Keyword And Return If ${result.rc} != 0 Run "aarch64" image with "tcg" acceleration
44+
3045
Run "gpt" image with "${acceleration}" acceleration
3146
# qemu-system-x86_64 defunct process without shell
3247
${handle} = Start Process qemu-system-x86_64 -device ahci,id\=ahci -drive file\=${image_copy},media\=disk,cache\=none,format\=raw,if\=none,id\=disk -device ide-hd,drive\=disk,bus\=ahci.0 -device virtio-net-pci,netdev\=n1 -netdev \"user,id\=n1,dns\=127.0.0.1,guestfwd\=tcp:10.0.2.100:80-cmd:netcat haproxy 80,guestfwd\=tcp:10.0.2.100:443-cmd:netcat haproxy 443\" -m ${memory} -nographic -machine type\=q35 -accel ${acceleration} -smp ${cpus} -chardev socket,id\=serial0,path\=${serial_port_path},server\=on,wait\=off -serial chardev:serial0 -bios /usr/share/ovmf/OVMF.fd -nodefaults shell=yes
@@ -36,3 +51,8 @@ Run "dos" image with "${acceleration}" acceleration
3651
# qemu-system-x86_64 defunct process without shell
3752
${handle} = Start Process qemu-system-x86_64 -device ahci,id\=ahci -drive file\=${image_copy},media\=disk,cache\=none,format\=raw,if\=none,id\=disk -device ide-hd,drive\=disk,bus\=ahci.0 -device virtio-net-pci,netdev\=n1 -netdev \"user,id\=n1,dns\=127.0.0.1,guestfwd\=tcp:10.0.2.100:80-cmd:netcat haproxy 80,guestfwd\=tcp:10.0.2.100:443-cmd:netcat haproxy 443\" -m ${memory} -nographic -machine type\=pc -accel ${acceleration} -smp ${cpus} -chardev socket,id\=serial0,path\=${serial_port_path},server\=on,wait\=off -serial chardev:serial0 shell=yes
3853
Return From Keyword ${handle}
54+
55+
Run "aarch64" image with "${acceleration}" acceleration
56+
# qemu-system-aarch64 defunct process without shell
57+
${handle} = Start Process qemu-system-aarch64 -drive file\=${image_copy},media\=disk,cache\=none,format\=raw,if\=none,id\=disk -device virtio-blk-device,drive\=disk -device virtio-net-device,netdev\=n1 -netdev \"user,id\=n1,dns\=127.0.0.1,guestfwd\=tcp:10.0.2.100:80-cmd:netcat haproxy 80,guestfwd\=tcp:10.0.2.100:443-cmd:netcat haproxy 443\" -m ${memory} -nographic -machine type\=virt -accel ${acceleration} -smp ${cpus} -chardev socket,id\=serial0,path\=${serial_port_path},server\=on,wait\=off -serial chardev:serial0 -cpu cortex-a72 -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nodefaults shell=yes
58+
Return From Keyword ${handle}

0 commit comments

Comments
 (0)