feat: mount main partition for cloud-init configuration
This commit is contained in:
parent
f1be35cb05
commit
d289f49cfb
1 changed files with 17 additions and 0 deletions
|
|
@ -20,8 +20,25 @@ EOF
|
||||||
resize2fs -p "$device"p$partnr
|
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 "Compressed Image file: " IMG_FILE
|
||||||
read -e -p "SD Card: " SD_CARD
|
read -e -p "SD Card: " SD_CARD
|
||||||
|
|
||||||
flash_sd "$IMG_FILE" "$SD_CARD"
|
flash_sd "$IMG_FILE" "$SD_CARD"
|
||||||
enlarge_partition "$SD_CARD"
|
enlarge_partition "$SD_CARD"
|
||||||
|
mnt_handle=$(mount_temporary "1")
|
||||||
|
|
||||||
|
|
||||||
|
unmount_temporary $mnt_handle
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue