Skip to content

ci: debug why final image does not contain root partition #36

ci: debug why final image does not contain root partition

ci: debug why final image does not contain root partition #36

Workflow file for this run

name: Build Pi-DJ OS
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: pguyot/arm-runner-action@v2
id: build_image
with:
base_image: dietpi:rpi_armv8_bullseye
cpu: cortex-a53
image_additional_mb: 500
commands: |
set +x
echo
echo ">--------------------------------------------------------------------------------------------------<"
echo "> Building Pi-DJ "
echo ">--------------------------------------------------------------------------------------------------<"
echo
./dietpi/build.sh
# TODO: for some reason, the resulting image only has one partition, namely the boot partition.
# TODO: There's no secondary ext4 partition...
loopdev="/dev/loop3"
rootdev="/dev/loop3p2"
rootfs_partnum=2
rootfs_blocksize=$(tune2fs -l ${rootdev} | grep "^Block size" | awk '{print $NF}')
rootfs_blockcount=$(tune2fs -l ${rootdev} | grep "^Block count" | awk '{print $NF}')
rootfs_partstart=$(parted -m --script "${loopdev}" unit B print | grep "^${rootfs_partnum}:" | awk -F ":" '{print $2}' | tr -d 'B')
rootfs_partsize=$((${rootfs_blockcount} * ${rootfs_blocksize}))
rootfs_partend=$((${rootfs_partstart} + ${rootfs_partsize}))
echo "----------------------------"
echo "Full tune2fs output"
echo "----------------------------"
tune2fs -l
echo "----------------------------"
echo "----------------------------"
echo "Rootfs:
echo " block size: ${rootfs_blocksize}"
echo " block count: ${rootfs_blockcount}"
echo " part start: ${rootfs_partstart}"
echo " part size: ${rootfs_partsize}"
echo " part end: ${rootfs_partend}"
echo "----------------------------"
df -h
echo
echo ">--------------------------------------------------------------------------------------------------<"
echo "> Done! "
echo ">--------------------------------------------------------------------------------------------------<"
echo
- name: Compress the release image
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/arm-runner'
run: |
mv ${{ steps.build_image.outputs.image }} pi-dj-${{ github.ref_name }}.img
xz -0 -T 0 -v pi-dj-${{ github.ref_name }}.img
- name: Upload release image
uses: actions/upload-artifact@v2
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/arm-runner'
with:
name: pi-dj-${{ github.ref_name }}.img.xz
path: pi-dj-${{ github.ref_name }}.img.xz
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: true
# body: "" # TODO
files: |
# TODO: update files after building
Release.txt
LICENSE