From f6fa4ef39ed57612459d52e914a934547382835a Mon Sep 17 00:00:00 2001 From: EatPrilosec Date: Sat, 24 Aug 2024 12:05:09 -0400 Subject: [PATCH 1/5] fix build libraspberrypi-bin seems to be provided by raspi-utils now Signed-off-by: EatPrilosec --- builder/raspberrypi64.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/raspberrypi64.yml b/builder/raspberrypi64.yml index 4cb36738..31ed132f 100644 --- a/builder/raspberrypi64.yml +++ b/builder/raspberrypi64.yml @@ -83,7 +83,7 @@ - libgmp3-dev - libnetfilter-queue-dev - libpcap-dev - - libraspberrypi-bin + #- libraspberrypi-bin ## seems to be provided by raspi-utils now - libraspberrypi-dev - libraspberrypi-doc - libraspberrypi0 @@ -628,4 +628,4 @@ - name: reload systemd services systemd: daemon_reload: yes - when: enabled.changed \ No newline at end of file + when: enabled.changed From f81f1cedfc067a7532457b3716c2cad7f6d6f463 Mon Sep 17 00:00:00 2001 From: EatPrilosec Date: Sat, 24 Aug 2024 12:05:59 -0400 Subject: [PATCH 2/5] fix build libraspberrypi-bin seems to be provided by raspi-utils now Signed-off-by: EatPrilosec --- builder/raspberrypi32.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/raspberrypi32.yml b/builder/raspberrypi32.yml index c3d0790e..a839bf6b 100644 --- a/builder/raspberrypi32.yml +++ b/builder/raspberrypi32.yml @@ -90,7 +90,7 @@ - libopenblas-dev # https://stackoverflow.com/questions/14570011/explain-why-numpy-should-not-be-imported-from-source-directory - libopenjp2-7 - libpcap-dev - - libraspberrypi-bin + #- libraspberrypi-bin ## seems to be provided by raspi-utils now - libraspberrypi-dev - libraspberrypi-doc - libraspberrypi0 @@ -557,4 +557,4 @@ - name: reload systemd services systemd: daemon_reload: yes - when: enabled.changed \ No newline at end of file + when: enabled.changed From d6bd65333ec290b65a396dd89a58d7be1ad0f855 Mon Sep 17 00:00:00 2001 From: EatPrilosec Date: Sat, 24 Aug 2024 22:44:46 -0400 Subject: [PATCH 3/5] Employ matrix build strategy - workaround for binfmt error - speeds up builds - allows for easier board additions Signed-off-by: EatPrilosec --- .github/workflows/publish.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 798dc6a1..5f828083 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,7 +9,15 @@ on: jobs: build: + name: ${{ matrix.name }} runs-on: ubuntu-latest + strategy: + matrix: + include: + - name: "Raspberry Pi 32-bit" + id: "32bit" + - name: "Raspberry Pi 64-bit" + id: "64bit" steps: - uses: actions/checkout@v4 @@ -23,27 +31,21 @@ jobs: - name: Install qemu dependencies run: sudo apt update && sudo apt install qemu-user-static qemu-utils xz-utils -y - - name: Build img file - run: ls -la .; pwd; make all + - name: Build ${{ matrix.name }} img file + run: ls -la .; pwd; make packer; make ${{ matrix.id }} - - name: Transfer 32bit.img to docker and give permissions - run: sudo chown runner:docker "pwnagotchi-32bit.img" - - - name: Transfer 64bit.img to docker and give permissions - run: sudo chown runner:docker "pwnagotchi-64bit.img" + - name: Transfer ${{ matrix.name }} .img to docker and give permissions + run: sudo chown runner:docker "pwnagotchi-${{ matrix.id }}.img" - name: PiShrink run: | wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh chmod +x pishrink.sh sudo mv pishrink.sh /usr/local/bin - find /home/runner/work/ -type f -name "*.img" -exec sudo pishrink.sh -aZ {} \; + find /home/runner/work/ -type f -name "pwnagotchi-${{ matrix.id }}.img" -exec sudo pishrink.sh -aZ {} \; - - name: Change name of 32.img.xz to add version - run: mv "pwnagotchi-32bit.img.xz" "pwnagotchi-$VERSION-32bit.img.xz" - - - name: Change name of 64.img.xz to add version - run: mv "pwnagotchi-64bit.img.xz" "pwnagotchi-$VERSION-64bit.img.xz" + - name: Change name of .img.xz to add version + run: mv "pwnagotchi-${{ matrix.id }}.img.xz" "pwnagotchi-${{ env.VERSION }}-${{ matrix.id }}.img.xz" - name: Release uses: softprops/action-gh-release@v2 @@ -52,7 +54,5 @@ jobs: make_latest: true tag_name: v${{ env.VERSION }} name: Pwnagotchi v${{ env.VERSION }} - files: | - pwnagotchi-${{ env.VERSION }}-32bit.img.xz - pwnagotchi-${{ env.VERSION }}-64bit.img.xz - generate_release_notes: true \ No newline at end of file + files: pwnagotchi-${{ env.VERSION }}-${{ matrix.id }}.img.xz + generate_release_notes: true From 6b6f5923ee35f300da170ac80daea9591baae72e Mon Sep 17 00:00:00 2001 From: EatPrilosec Date: Sun, 25 Aug 2024 05:29:56 -0400 Subject: [PATCH 4/5] Compensate for ../../../.img i assume this is for local builds, because it outputs the file outside of runner workdir entirely. compensated by making extra directory levels Signed-off-by: EatPrilosec --- .github/workflows/publish.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5f828083..049f07c3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,31 +21,32 @@ jobs: steps: - uses: actions/checkout@v4 + with: + path: publish/build - name: Extract version from file id: get_version run: | - VERSION=$(cut -d "'" -f2 < pwnagotchi/_version.py) + VERSION=$(cut -d "'" -f2 < publish/build/pwnagotchi/_version.py) echo "VERSION=$VERSION" >> $GITHUB_ENV - name: Install qemu dependencies run: sudo apt update && sudo apt install qemu-user-static qemu-utils xz-utils -y - name: Build ${{ matrix.name }} img file - run: ls -la .; pwd; make packer; make ${{ matrix.id }} - - - name: Transfer ${{ matrix.name }} .img to docker and give permissions - run: sudo chown runner:docker "pwnagotchi-${{ matrix.id }}.img" + run: cd publish/build; ls -la .; pwd; make packer; make ${{ matrix.id }} + + - name: Change name of .img.xz to add version + run: | + sudo chown runner:docker "pwnagotchi-${{ matrix.id }}.img" + mv "pwnagotchi-${{ matrix.id }}.img" "pwnagotchi-${{ env.VERSION }}-${{ matrix.id }}.img" - name: PiShrink run: | wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh chmod +x pishrink.sh sudo mv pishrink.sh /usr/local/bin - find /home/runner/work/ -type f -name "pwnagotchi-${{ matrix.id }}.img" -exec sudo pishrink.sh -aZ {} \; - - - name: Change name of .img.xz to add version - run: mv "pwnagotchi-${{ matrix.id }}.img.xz" "pwnagotchi-${{ env.VERSION }}-${{ matrix.id }}.img.xz" + sudo pishrink.sh -aZ "pwnagotchi-${{ env.VERSION }}-${{ matrix.id }}.img" - name: Release uses: softprops/action-gh-release@v2 From 7edaa9040e7ae9b9939495f00c63e52d625995e3 Mon Sep 17 00:00:00 2001 From: EatPrilosec Date: Sun, 25 Aug 2024 07:02:37 -0400 Subject: [PATCH 5/5] remove unnecessary action input Signed-off-by: EatPrilosec --- .github/workflows/publish.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 049f07c3..ed066f4e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,10 +2,6 @@ name: Publish on: workflow_dispatch: - inputs: - version: - description: 'Version number' - required: true jobs: build: