feat: enlarge main partition
This commit is contained in:
parent
949e0e000d
commit
f1be35cb05
1 changed files with 14 additions and 0 deletions
|
|
@ -7,7 +7,21 @@ flash_sd () {
|
||||||
xzcat --stdout $img_file | dd of=$sd_card status=progress
|
xzcat --stdout $img_file | dd of=$sd_card status=progress
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enlarge_partition () {
|
||||||
|
device=$1
|
||||||
|
partnr=2
|
||||||
|
echo "Resize main partition"
|
||||||
|
sfdisk --backup $device -N $partnr << EOF
|
||||||
|
,+
|
||||||
|
print
|
||||||
|
EOF
|
||||||
|
echo "Resize filesystem"
|
||||||
|
e2fsck -f "$device"p$partnr
|
||||||
|
resize2fs -p "$device"p$partnr
|
||||||
|
}
|
||||||
|
|
||||||
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"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue