Skip to content

Commit

Permalink
ci: debug why final image does not contain root partition
Browse files Browse the repository at this point in the history
  • Loading branch information
bvobart committed May 3, 2024
1 parent 833a758 commit 1f29cb9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,37 @@ jobs:
./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=$(ls "${loopdev}"*${rootfs_partnum})
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! "
Expand Down
4 changes: 2 additions & 2 deletions dietpi/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ set_dietpi_config AUTO_SETUP_GLOBAL_PASSWORD pidj
set_dietpi_config CONFIG_CHECK_DIETPI_UPDATES 1 # Enable daily check for DietPi updates. 0=disable | 1=enable
set_dietpi_config CONFIG_CHECK_APT_UPDATES 1 # Enable daily check for APT package updates: 0=disable | 1=check only | 2=check and upgrade automatically
set_dietpi_config CONFIG_CHECK_CONNECTION_IP "127.0.0.1" # Workaround for installing DietPi software on GitHub Actions runners because Ping doesn't work there. Will be reset after build. https://github.com/pguyot/arm-runner-action/issues/91#issuecomment-2088435969
set_dietpi_config CONFIG_NTP_MODE 2 # Network time sync: 0=disabled | 1=boot only | 2=boot + daily | 3=boot + hourly | 4=Daemon + Drift
set_dietpi_config CONFIG_NTP_MODE 0 # Network time sync, disabled during build. Values: 0=disabled | 1=boot only | 2=boot + daily | 3=boot + hourly | 4=Daemon + Drift
set_dietpi_config SOFTWARE_DISABLE_SSH_PASSWORD_LOGINS root # Disable SSH password logins, e.g. when using pubkey authentication
# 0=Allow password logins for all users, including root
# root=Disable password login for root user only
Expand Down Expand Up @@ -103,5 +103,5 @@ log "Configuring desktop environment ..."

log "Finishing up ..."
set_dietpi_config CONFIG_CHECK_CONNECTION_IP "9.9.9.9" # Reset the workaround for installing DietPi software on GitHub Actions runners.

set_dietpi_config CONFIG_NTP_MODE 3 # Network time sync: 0=disabled | 1=boot only | 2=boot + daily | 3=boot + hourly | 4=Daemon + Drift
log "Done!"

0 comments on commit 1f29cb9

Please sign in to comment.