From c075706ccf4e8104bcd4e3e265e81b4d6646885b Mon Sep 17 00:00:00 2001 From: zador-blood-stained Date: Fri, 20 Jan 2017 12:24:55 +0300 Subject: [PATCH] Improvement for the previous commit --- scripts/resize2fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/resize2fs b/scripts/resize2fs index cd43e47743..dba80e1c06 100644 --- a/scripts/resize2fs +++ b/scripts/resize2fs @@ -23,7 +23,7 @@ do_expand_partition() local rootdevice=$(lsblk -n -o PKNAME $rootpart) # i.e. mmcblk0 local rootdevicepath="/dev/$rootdevice" # i.e. /dev/mmcblk0 # get count of partitions and their boundaries - local partitions=$(( $(parted $rootdevicepath print -sm | tee -a $Log | wc -l) - 2 )) + local partitions=$(parted $rootdevicepath print -sm | tee -a $Log | tail -1 | awk -F ':' '{print $1}') local partstart=$(parted $rootdevicepath unit s print -sm | tail -1 | cut -d: -f2 | sed 's/s//') # start of first partition local partend=$(parted $rootdevicepath unit s print -sm | head -3 | tail -1 | cut -d: -f3 | sed 's/s//') # end of first partition local startfrom=$(( $partend + 1 ))