From f182a5385a9ebafe1f2a126cca0fc76765ae041e Mon Sep 17 00:00:00 2001 From: SolidHal Date: Tue, 23 Oct 2018 19:23:18 -0500 Subject: [PATCH] Correct MAX_SIXE calc in installToInternal.sh --- scripts/InstallScripts/InstallToInternal.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/InstallScripts/InstallToInternal.sh b/scripts/InstallScripts/InstallToInternal.sh index d01a827..2e1fd35 100755 --- a/scripts/InstallScripts/InstallToInternal.sh +++ b/scripts/InstallScripts/InstallToInternal.sh @@ -31,7 +31,9 @@ then # Make new partition table sgdisk -g /dev/mmcblk2 #Get the last usable sector, cant just take last sector as we depend on the secondary gpt - MAX_SIZE="$(sgdisk -p /dev/mmcblk2 | grep -o 'last usable sector is.*' | awk '{print $5}')" + LUS="$(sgdisk -p /dev/mmcblk2 | grep -o 'last usable sector is.*' | awk '{print $5}')" + #Now use that to find how bit the filesystem partition can be + MAX_SIZE="$(expr $LUS -20480 - 65536)" # Make new entries cgpt add -i 1 -b 20480 -s 65536 -t kernel -l KERNEL -S 1 -T 5 -P 10 /dev/mmcblk2 cgpt add -i 2 -b 86016 -s $MAX_SIZE -t data -l Root /dev/mmcblk2