From bf2afa33d814a40506f4980a84af1d34183dbb88 Mon Sep 17 00:00:00 2001 From: Willian Galvani Date: Tue, 16 Jan 2024 19:26:22 -0300 Subject: [PATCH] use action to create user --- .github/workflows/test-and-deploy.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index eff8c302fa..8b13300317 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -282,6 +282,23 @@ jobs: --workdir=/files \ --platform ${{ matrix.platforms }} nature40/pimod:latest pimod.sh deploy/pimod/blueos.Pifile + - name: Add /boot additions + run: | + sudo apt-get update && sudo apt-get install -y parted kpartx + # Create mount point if it doesn't exist + sudo mkdir -p /mnt/piboot + # Map the image file + LOOP_DEVICE=$(sudo kpartx -avs deploy/pimod/blueos.img | sed -E 's/.*(loop[0-9]+)p[0-9]+.*/\1/g' | head -1) + # Mount the boot partition + sudo mount "/dev/mapper/${LOOP_DEVICE}p1" /mnt/piboot + # Create ssh and userconf files + sudo touch "${MOUNT_POINT}/ssh" + echo "pi:10l3dqTbjWddriHDxugWq8XXPhblvMKDW6cvct1IywLVtU8vhMcE35Jpq6wF8iMT6L4DSjDDmMD1XhX.yyJJM/" | sudo tee /mnt/piboot/userconf > /dev/null + # Unmount and cleanup + sudo umount /mnt/piboot + sudo kpartx -d deploy/pimod/blueos.img + echo "Boot partition updated successfully." + # TODO: add GITHUB_REF_NAME after https://github.com/actions/upload-artifact/issues/231 is fixed # name: blueos-${{ env.GITHUB_REF_NAME }}.zip - name: Zip image