Improvement for the previous commit
This commit is contained in:
parent
26ced76614
commit
c075706ccf
@ -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 ))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user