Skip to content

Commit

Permalink
Append p2 for mmcblk devices, but just 2 for sd* devices when…
Browse files Browse the repository at this point in the history
… expanding the last partition
  • Loading branch information
civerachb-cpr committed Oct 10, 2024
1 parent 0389298 commit 77ee580
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/sd_flash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ sudo dcfldd if=$1 sizeprobe=if bs=1M$of

for device in $device_names
do
if [[ $device == mmcblk* ]]; then
last_partition="${device}p2"
else
last_partition="${device}2"
fi

sudo growpart /dev/$device 2
sudo resize2fs /dev/${device}p2
sudo resize2fs /dev/${last_partition}
done

0 comments on commit 77ee580

Please sign in to comment.