Skip to content

Commit

Permalink
Support ubuntu 24.04 image
Browse files Browse the repository at this point in the history
Package qemu no longer exists, but only qemu-user-static was required.
Also add support for RaspberryPi 5 emulation with cpu_info and cortex-a76 which
is supported by qemu version available with ubuntu 24.04.

Signed-off-by: Paul Guyot <[email protected]>
  • Loading branch information
pguyot committed May 30, 2024
1 parent a9ec464 commit fcebd46
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/test-cpu_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,19 @@ jobs:
run: |
grep -c "CPU architecture: 8" cpuinfo.txt
grep -c 676974687562004b cpuinfo.txt
test_5:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: ./ # pguyot/arm-runner-action@HEAD
with:
cpu_info: cpuinfo/raspberrypi_5
bind_mount_repository: true
cpu: cortex-a76
commands: |
cat /proc/cpuinfo > cpuinfo.txt
- name: Test content of cpuinfo
run: |
cat cpuinfo.txt
grep -c "CPU architecture: 8" cpuinfo.txt
grep -c 6769746875620050 cpuinfo.txt
22 changes: 22 additions & 0 deletions .github/workflows/test-runner-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test runner images
on:
push:
branches:
- 'main'
- 'releases/**'
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner: ["ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04", "ubuntu-latest"]
steps:
- uses: actions/checkout@v4
- uses: ./ # pguyot/arm-runner-action@HEAD
with:
commands: |
test `uname -m` = 'armv6l'
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ The following values are specially processed:
models (Pi 3/Pi 4 and Pi Zero 2). Not suitable for Pi 1/Pi 2/Pi Zero.
- `cortex-a8` equivalent to `cortex-a8:max`.
- `cortex-a53` equivalent to `max:cortex-a53`.
- `cortex-a76` equivalent to `max:cortex-a76`. Note that this requires a newer
version of qemu, for example with runner ubuntu 24.04. See `test_5` in
[cpu_info test](.github/workflows/test-cpu_info.yml).

Some software uses the output of `uname -m` or equivalent. This command is
directly driven by this `cpu` option. You might want to compile 32 bits
Expand Down
13 changes: 8 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ runs:
steps:
- name: Install dependencies
run:
sudo apt-get update && sudo apt-get install -y qemu qemu-user-static binfmt-support parted wget dosfstools zip
sudo apt-get update && sudo apt-get install -y qemu-user-static binfmt-support parted wget dosfstools zip
shell: bash
- name: Install qemu wrapper
shell: bash
Expand All @@ -118,15 +118,18 @@ runs:
cortex-a53)
cpu="max:cortex-a53"
;;
cortex-a76)
cpu="max:cortex-a76"
;;
*)
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
sudo update-binfmts --unimport qemu-arm
sudo update-binfmts --unimport qemu-aarch64
sudo update-binfmts --unimport qemu-arm || echo "warning: could not unimport qemu-arm"
sudo update-binfmts --unimport qemu-aarch64 || echo "warning: could not unimport qemu-aarch64"
sudo update-binfmts --package arm-runner-action --install arm-runner-action-qemu-arm /usr/bin/qemu-arm-static0 --magic '\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' --credentials yes --fix-binary yes
sudo update-binfmts --package arm-runner-action --install arm-runner-action-qemu-aarch64 /usr/bin/qemu-aarch64-static0 --magic '\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' --credentials yes --fix-binary yes
Expand Down Expand Up @@ -302,8 +305,8 @@ runs:
sudo update-binfmts --package arm-runner-action --remove arm-runner-action-qemu-aarch64 /usr/bin/qemu-aarch64-static0
sudo rm /usr/bin/qemu-arm-static0
sudo rm /usr/bin/qemu-aarch64-static0
sudo update-binfmts --import qemu-arm
sudo update-binfmts --import qemu-aarch64
sudo update-binfmts --import qemu-arm || echo "warning: could not import qemu-arm"
sudo update-binfmts --import qemu-aarch64 || echo "warning: could not import qemu-aarch64"
branding:
icon: 'cpu'
color: 'purple'
40 changes: 40 additions & 0 deletions cpuinfo/raspberrypi_5
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
processor : 0
BogoMIPS : 108.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x4
CPU part : 0xd0b
CPU revision : 1

processor : 1
BogoMIPS : 108.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x4
CPU part : 0xd0b
CPU revision : 1

processor : 2
BogoMIPS : 108.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x4
CPU part : 0xd0b
CPU revision : 1

processor : 3
BogoMIPS : 108.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x4
CPU part : 0xd0b
CPU revision : 1

Hardware : BCM2835
Revision : d04170
Serial : 6769746875620050
Model : Raspberry Pi 5 Model B Rev 1.0

0 comments on commit fcebd46

Please sign in to comment.