Skip to content

Commit

Permalink
build-sd-images.yml: Fix qemu-static support for ubuntu-latest runner
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias K <[email protected]>
  • Loading branch information
theCalcaholic committed Jan 26, 2024
1 parent 550724f commit 1c84583
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
37 changes: 17 additions & 20 deletions .github/workflows/build-sd-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ jobs:
artifact_file: ${{ env.ARTIFACT_FILE }}
artifact_name: ${{ github.run_id }}-${{ inputs.board_id }}-image
steps:
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
- name: Setup qemu-user-static
- name: Set up QEMU
run: |
sudo apt-get update
sudo apt-get install -y binfmt-support
curl -L -o /tmp/qemu.sh 'https://raw.githubusercontent.com/qemu/qemu/master/scripts/qemu-binfmt-conf.sh'
bash /tmp/qemu.sh --debian
# docker run --rm --privileged tonistiigi/binfmt:latest --install all
# docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes
# sudo mkdir -p /etc/binfmt
# for conf in qemu-{aarch64,arm}-static.conf
Expand All @@ -64,7 +66,7 @@ jobs:
continue-on-error: true
run: |
set -ex
export IMG="NextCloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
export IMG="NextcloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
[[ "${{ github.ref_protected }}" == true ]] || export DBG=x
./build/build-SD-armbian.sh "${{ inputs.board_id }}" "${{ inputs.board_name }}"
Expand All @@ -82,7 +84,7 @@ jobs:
echo -e "${LOG_CICD} Cleanup armbian build leftovers..."
sudo rm -rf armbian/ tmp/ output/
export IMG="NextCloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
export IMG="NextcloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
[[ "${{ github.ref_protected }}" == true ]] || export DBG=x
./build/build-SD-armbian.sh "${{ inputs.board_id }}" "${{ inputs.board_name }}"
Expand All @@ -104,7 +106,7 @@ jobs:
run: |
set -ex
echo -e "${LOG_CICD} Protected? ${{ github.ref_protected }}"
export IMG="NextCloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
export IMG="NextcloudPi_${{ inputs.board_name }}_${VERSION//\//_}.img"
[[ "${{ github.ref_protected }}" == true ]] || export DBG=x
wget -q https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-aarch64-static -O ./qemu-aarch64-static
./build/build-SD-rpi.sh
Expand Down Expand Up @@ -144,22 +146,17 @@ jobs:
run:
shell: bash
steps:
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
- name: Apt update
- name: Set up QEMU
run: |
sudo apt-get update
# sudo apt-get -y --no-install-recommends install qemu-user-static
# - name: Apply workaround for sudo bug (https://github.com/multiarch/qemu-user-static/issues/17)
# run: |
# sudo apt-get update
# sudo apt-get -y --no-install-recommends install binfmt-support qemu-user-static
# docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes
# sudo mkdir -p /etc/binfmt
# for conf in qemu-{aarch64,arm}-static.conf
# do
# sed 's/:F$/:OC/' /usr/lib/binfmt.d/$conf | sudo tee /etc/binfmt/$conf
# done
sudo apt-get install -y binfmt-support
docker run --rm --privileged tonistiigi/binfmt:latest --install all
docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes
# sudo mkdir -p /etc/binfmt
# for conf in qemu-{aarch64,arm}-static.conf
# do
# sed 's/:F$/:OC/' /usr/lib/binfmt.d/$conf | sudo tee /etc/binfmt/$conf
# done
- name: Checkout code
uses: actions/checkout@v3
with:
Expand Down
1 change: 1 addition & 0 deletions build/build-SD-armbian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ prepare_dirs # tmp cache output
# get latest armbian
[[ -d armbian ]] || {
git clone --depth 100 https://github.com/armbian/build armbian
git checkout c47c9372bf6970d6ca8c32bc5f7ec2a1416ab5bd
}
#( cd armbian && git pull --ff-only --tags && git checkout v23.02 )
#sed -i -e '/export rootfs_size=/s/du -sm/du --apparent-size -sm/' armbian/lib/functions/image/partitioning.sh
Expand Down

0 comments on commit 1c84583

Please sign in to comment.