From d289f49cfb5b957c9372c332e189fa10305e30cb Mon Sep 17 00:00:00 2001 From: Laborratte5 Date: Wed, 25 Mar 2026 14:39:41 +0100 Subject: [PATCH] feat: mount main partition for cloud-init configuration --- provision-pi.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/provision-pi.sh b/provision-pi.sh index e4a78ab..c32a18a 100755 --- a/provision-pi.sh +++ b/provision-pi.sh @@ -20,8 +20,25 @@ EOF resize2fs -p "$device"p$partnr } +mount_temporary () { + partnr=$1 + temp_mnt_point=$(mktemp -d) + mount "$SD_CARD"p"$partnr" $temp_mnt_point + echo $temp_mnt_point +} + +unmount_temporary () { + handle=$1 + umount $1 + rmdir $1 +} + read -e -p "Compressed Image file: " IMG_FILE read -e -p "SD Card: " SD_CARD flash_sd "$IMG_FILE" "$SD_CARD" enlarge_partition "$SD_CARD" +mnt_handle=$(mount_temporary "1") + + +unmount_temporary $mnt_handle