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