diff --git a/scripts/firstrun b/scripts/firstrun index 4ac34019fd..6ebf4c5588 100644 --- a/scripts/firstrun +++ b/scripts/firstrun @@ -26,8 +26,8 @@ set -e do_expand_rootfs(){ device="/dev/"$(lsblk -idn -o NAME | grep mmcblk0) PARTITIONS=$(($(fdisk -l $device | grep $device | wc -l)-1)) - PARTSTART=$(parted $LOOP unit s print -sm | tail -1 | cut -d: -f2 | sed 's/s//') # start of first partition - PARTEND=$(parted $LOOP unit s print -sm | head -3 | tail -1 | cut -d: -f3 | sed 's/s//') # end of first partition + PARTSTART=$(parted $device unit s print -sm | tail -1 | cut -d: -f2 | sed 's/s//') # start of first partition + PARTEND=$(parted $device unit s print -sm | head -3 | tail -1 | cut -d: -f3 | sed 's/s//') # end of first partition STARTFROM=$(($PARTEND+1)) [[ $PARTITIONS == 1 ]] && STARTFROM=$PARTSTART ((echo d; echo $PARTITIONS; echo n; echo p; echo ; echo $STARTFROM; echo ; echo w;) | fdisk $device)>/dev/null