pguyot/arm-runner-action

qemu-aarch64-static0: unable to find CPU model 'cortex-a76'

wrljet opened this issue · 3 comments

Is there a way for this to include a newer (or patched) qemu to support cortex-a76, such as found in Raspberry Pi 5?

++ sudo chroot /home/actions/temp/arm-runner/mnt /bin/sh -c 'command -v /bin/sh'
qemu-aarch64-static0: unable to find CPU model 'cortex-a76'

See: this qemu patch

Thanks for any assistance,
Bill

Going by

- name: Install qemu wrapper
shell: bash
run: |
case ${{ inputs.cpu }} in
"")
cpu="arm1176:cortex-a53"
;;
arm1176)
cpu="arm1176:cortex-a53"
;;
cortex-a7)
cpu="cortex-a7:cortex-a53"
;;
cortex-a8)
cpu="cortex-a8:max"
;;
cortex-a53)
cpu="max:cortex-a53"
;;
*)
cpu=${{ inputs.cpu }}
esac
arm_cpu=${cpu%:*}
aarch64_cpu=${cpu#*:}
sudo gcc -static ${{ github.action_path }}/qemu-wrapper.c -DQEMU_CPU=${arm_cpu} -O3 -s -o /usr/bin/qemu-arm-static0
sudo gcc -static ${{ github.action_path }}/qemu-wrapper.c -DQEMU_CPU=${aarch64_cpu} -O3 -s -o /usr/bin/qemu-aarch64-static0
it seems that you could input this yourself through the cpu parameter for this action, provided that the latest version of QEMU bundled with Ubuntu 22.04 (currently the default image used by this action) supports it.

Exactly. This can be achieved by:

  • using a container or runner that has an apt package with the qemu patch and installing them, so that:
    apt install -y qemu qemu-user-static
    doesn't overwrite the patched qemu version
  • passing cpu parameter.

Question is: what is the use case where exactly emulating the Raspberry Pi 5 CPU makes sense. Is it worth the effort and the longer CI time?

Ubuntu 22.04 indeed features a rather old version of qemu.
You can upgrade to 24.04 once PR #111 is merged, and then you will be able to pass cortex-a76 in cpu option.