powerpc-utils/SOURCES/powerpc-utils-c44313686e691...

42 lines
1.5 KiB
Diff

commit c44313686e69123c00406727ea44e52873a1e2c4
Author: Tyrel Datwyler <tyreld@linux.ibm.com>
Date: Sat Mar 5 15:31:25 2022 -0600
bootlist: fix passing -l flag to kpartx as -p delimiter value
When $delim is empty in dm_to_part() the kpartx command will wrongly use
the -l option flag as the delimiter input for the -p flag. Fix this be
quoting $delim.
The variable delim is NULL (empty) in this case and it shows wrong
partitions.
kpartx -p -l /dev/mapper/mpatha
mpatha-l1 : 0 8192 /dev/mapper/mpatha 8192
mpatha-l2 : 0 2097152 /dev/mapper/mpatha 16384
mpatha-l3 : 0 14663680 /dev/mapper/mpatha 2113536
With quotation it shows correct correct.
kpartx -p "" -l /dev/mapper/mpatha
mpatha1 : 0 8192 /dev/mapper/mpatha 8192
mpatha2 : 0 2097152 /dev/mapper/mpatha 16384
mpatha3 : 0 14663680 /dev/mapper/mpatha 2113536
Suggested-by: Than Ngo <than@redhat.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
diff --git a/scripts/bootlist b/scripts/bootlist
index e36f062..6187d6f 100755
--- a/scripts/bootlist
+++ b/scripts/bootlist
@@ -270,7 +270,7 @@ dm_to_part()
done
- kpartx -p $delim -l $dmmapper | while read kp ; do
+ kpartx -p "$delim" -l "$dmmapper" | while read kp ; do
kpname=${kp%% *}
tmajor=$(stat -L --format="%t" /dev/mapper/$kpname 2>/dev/null)
tminor=$(stat -L --format="%T" /dev/mapper/$kpname 2>/dev/null)