From 0bee6e9f95d36250e6df3a705c0142b216079104 Mon Sep 17 00:00:00 2001 From: zsdc Date: Thu, 27 Oct 2022 19:43:07 +0300 Subject: nvme: T4776: Fixed installation to NVME * fixed NVME drive names parser * replaced partition parser to take into account `p` suffixes on NVME partitions --- scripts/install/install-get-partition | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts/install/install-get-partition') diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition index c5c7c268..138088e6 100755 --- a/scripts/install/install-get-partition +++ b/scripts/install/install-get-partition @@ -571,9 +571,7 @@ delete_partitions () { # get the partitions on the drive # in the first grep below we add the optional [p] in order to # accomdate cciss drives - partitions=$(cat /proc/partitions | grep $ldrive[p]*[0-9] \ - | awk '{ print $4 }' | sed 's/\(.*\)\([0-9]$\)/\2/g' \ - | grep -v "^$") + partitions=$(awk '/'$ldrive'p?[0-9]+$/ { sub(/'$ldrive'/, "") ; print $NF }' /proc/partitions) mkdir -p /mnt/tmp # now for each part, blow it away @@ -592,6 +590,9 @@ delete_partitions () { umount /mnt/tmp fi + # we must remove possible suffixes from a partition number before passing it to parted + lpart="$(echo $lpart | sed 's/[^0-9]//')" + lecho "Removing partition $lpart on /dev/$ldrive" output=$(parted -s /dev/$ldrive rm $lpart) status=$? -- cgit v1.2.3