From 6d549c1fdd2910e8642dfc45c3875be5a16c4b1a Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 4 Apr 2019 17:13:59 +0800 Subject: [PATCH] Get disk size of install disk --- .../share/xcat/install/scripts/pre.rhels8 | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index 66abd34db..11a9ee9d7 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -206,6 +206,26 @@ base64decode() done } +getdisksize() +{ + local disk="$1" + + local blah + local blocks + local name + + while read -r blah blah blocks name + do + if [ "${name}" = "${disk}" ] + then + echo "${blocks}" + break + fi + done >/tmp/partitionfile fi +DISKSIZE="$(getdisksize "${instdisk}")" + # TODO: Ondisk detection, /dev/disk/by-id/edd-int13_dev80 for legacy maybe, and no idea about efi. At least maybe blacklist SAN if mptsas/mpt2sas/megaraid_sas seen... echo "part /boot --fstype=$BOOTFSTYPE --asprimary --ondisk=$instdisk --size=512" >>/tmp/partitionfile echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=18432" >>/tmp/partitionfile