From f4357b5853873753fe6e6a2e62e9713d3ac9d480 Mon Sep 17 00:00:00 2001 From: valerius Date: Tue, 16 Jan 2024 18:31:59 +0100 Subject: [PATCH] new version --- .../workflows/rpi-aarch64-image-builder.yml | 42 +++++++++---------- build-archlinux-rpi-aarch64-img.sh | 9 +++- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/.github/workflows/rpi-aarch64-image-builder.yml b/.github/workflows/rpi-aarch64-image-builder.yml index 2f679b2..4a3cab5 100644 --- a/.github/workflows/rpi-aarch64-image-builder.yml +++ b/.github/workflows/rpi-aarch64-image-builder.yml @@ -10,7 +10,7 @@ jobs: LOOP_IMAGE: archlinux-aarch64-rpi.img LOOP_IMAGE_SIZE: 4G DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} - RPI_MODEL: 4 + RPI_MODEL: 5 ARM_VERSION: aarch64 DEFAULT_LOCALE: en_US.UTF-8 TIMEZONE: Europe/Paris @@ -121,23 +121,23 @@ jobs: "$RPI_HOSTNAME" \ "$SSH_PUB_KEY" - # - name: Upload Image and Get URL - # if: success() - # run: | - # ISO_URL=$(curl --upload-file $LOOP_IMAGE_PATH https://pub.strat.zone/) - # echo "ISO_URL=$ISO_URL" >> $GITHUB_ENV + - name: Upload Image and Get URL + if: success() + run: | + ISO_URL=$(curl --upload-file $LOOP_IMAGE_PATH https://pub.strat.zone/) + echo "ISO_URL=$ISO_URL" >> $GITHUB_ENV - # - name: Notify Success - # if: success() - # run: | - # SUCCESS_MESSAGE="🎉 Awesome! The Raspberry Pi image build succeeded 🚀\nAuthor: ${{ github.actor }}\nBranch: ${{ github.ref }}\nCommit Message: ${{ github.event.head_commit.message }}\n[View Last Commit](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) 📜\nThe custom-built Archlinux image for Raspberry Pi Model ${{ env.RPI_MODEL }} with ${{ env.ARM_VERSION }} architecture is now available for download:\n[Download Image]($ISO_URL) 📦\nFilename: archlinux-${{ env.ARM_VERSION }}-rpi-${{ env.RPI_MODEL }}.img" - # curl -X POST -H "Content-Type: application/json" -d "{\"content\": \"$SUCCESS_MESSAGE\"}" $DISCORD_WEBHOOK_URL + - name: Notify Success + if: success() + run: | + SUCCESS_MESSAGE="🎉 Awesome! The Raspberry Pi image build succeeded 🚀\nAuthor: ${{ github.actor }}\nBranch: ${{ github.ref }}\nCommit Message: ${{ github.event.head_commit.message }}\n[View Last Commit](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) 📜\nThe custom-built Archlinux image for Raspberry Pi Model ${{ env.RPI_MODEL }} with ${{ env.ARM_VERSION }} architecture is now available for download:\n[Download Image]($ISO_URL) 📦\nFilename: archlinux-${{ env.ARM_VERSION }}-rpi-${{ env.RPI_MODEL }}.img" + curl -X POST -H "Content-Type: application/json" -d "{\"content\": \"$SUCCESS_MESSAGE\"}" $DISCORD_WEBHOOK_URL - # - name: Notify Failure - # if: failure() - # run: | - # FAILURE_MESSAGE="😞 Oops! The pipeline for **${{ github.repository }}** has failed.\n[Check the logs and troubleshoot here.](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) 🛠️" - # curl -X POST -H "Content-Type: application/json" -d "{\"content\": \"$FAILURE_MESSAGE\"}" $DISCORD_WEBHOOK_URL + - name: Notify Failure + if: failure() + run: | + FAILURE_MESSAGE="😞 Oops! The pipeline for **${{ github.repository }}** has failed.\n[Check the logs and troubleshoot here.](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) 🛠️" + curl -X POST -H "Content-Type: application/json" -d "{\"content\": \"$FAILURE_MESSAGE\"}" $DISCORD_WEBHOOK_URL - name: Umount Loop Device if: always() @@ -147,11 +147,11 @@ jobs: echo "Unmounted $WORKDIR_BASE" sync - # - name: Delete Work Folder - # if: always() - # run: | - # sudo rm -rf $WORKDIR_BASE - # echo "Work folder deleted" + - name: Delete Work Folder + if: always() + run: | + sudo rm -rf $WORKDIR_BASE + echo "Work folder deleted" - name: Release Loop Device if: always() diff --git a/build-archlinux-rpi-aarch64-img.sh b/build-archlinux-rpi-aarch64-img.sh index 2520873..20e46d2 100755 --- a/build-archlinux-rpi-aarch64-img.sh +++ b/build-archlinux-rpi-aarch64-img.sh @@ -68,13 +68,18 @@ echo "Installing packages..." # Install packages arch-chroot $WORKDIR_BASE/root pacman -S --noconfirm $PACKAGES -# Install linux-rpiX kernel and eeprom -# create a if statement to check if variable INSTALL_RPI_KERNEL is true +# Install linux-rpiX kernel and eeprom if variable INSTALL_RPI_KERNEL is true if [ "$INSTALL_RPI_KERNEL" = true ] ; then echo "Installing linux-${$RPI_MODEL} kernel and eeprom..." arch-chroot $WORKDIR_BASE/root pacman -S --noconfirm rpi${RPI_MODEL}-eeprom fi +# Remove linux-aarch64 uboot-raspberrypi +arch-chroot $WORKDIR_BASE/root pacman -R --noconfirm linux-aarch64 uboot-raspberrypi + +# install linux-rpi kernel and linux-rpi-headers +arch-chroot $WORKDIR_BASE/root pacman -S --noconfirm linux-rpi linux-rpi-headers + echo "Setup hostname..." # Set the hostname arch-chroot $WORKDIR_BASE/root /bin/bash -c "echo \"$RPI_HOSTNAME\" | tee /etc/hostname"