Blame SOURCES/rear-rhbz1610647.patch

e8a0f5
diff --git a/usr/share/rear/finalize/Linux-ppc64le/680_install_PPC_bootlist.sh b/usr/share/rear/finalize/Linux-ppc64le/680_install_PPC_bootlist.sh
e8a0f5
index bf1db404..3a07580a 100644
e8a0f5
--- a/usr/share/rear/finalize/Linux-ppc64le/680_install_PPC_bootlist.sh
e8a0f5
+++ b/usr/share/rear/finalize/Linux-ppc64le/680_install_PPC_bootlist.sh
e8a0f5
@@ -9,9 +9,12 @@ if grep -q "PowerNV" /proc/cpuinfo || grep -q "emulated by qemu" /proc/cpuinfo ;
e8a0f5
 fi
e8a0f5
 
e8a0f5
 # Look for the PPC PReP Boot Partition.
e8a0f5
-part=$( awk -F ' ' '/^part / {if ($6 ~ /prep/) {print $7}}' $LAYOUT_FILE )
e8a0f5
+part_list=$( awk -F ' ' '/^part / {if ($6 ~ /prep/) {print $7}}' $LAYOUT_FILE )
e8a0f5
 
e8a0f5
-if [ -n "$part" ]; then
e8a0f5
+# All the possible boot devices
e8a0f5
+boot_list=()
e8a0f5
+
e8a0f5
+for part in $part_list ; do
e8a0f5
     LogPrint "PPC PReP Boot partition found: $part"
e8a0f5
 
e8a0f5
     # Using $LAYOUT_DEPS file to find the disk device containing the partition.
e8a0f5
@@ -29,14 +32,23 @@ if [ -n "$part" ]; then
e8a0f5
     # If yes, get the list of path which are part of the multipath device.
e8a0f5
     # Limit to the first 5 PATH (see #876)
e8a0f5
     if dmsetup ls --target multipath | grep -w ${bootdev#/dev/mapper/} >/dev/null 2>&1; then
e8a0f5
-        LogPrint "Limiting bootlist to 5 entries..."
e8a0f5
-        bootlist_path=$(dmsetup deps $bootdev -o devname | awk -F: '{gsub (" ",""); gsub("\\(","/dev/",$2) ; gsub("\\)"," ",$2) ; print $2}' | cut -d" " -f-5)
e8a0f5
-        LogPrint "Set LPAR bootlist to $bootlist_path"
e8a0f5
-        bootlist -m normal $bootlist_path
e8a0f5
+        LogPrint "Limiting bootlist to 5 entries as a maximum..."
e8a0f5
+        boot_list+=( $(dmsetup deps $bootdev -o devname | awk -F: '{gsub (" ",""); gsub("\\(","/dev/",$2) ; gsub("\\)"," ",$2) ; print $2}' | cut -d" " -f-5) )
e8a0f5
     else
e8a0f5
         # Single Path device found
e8a0f5
-        LogPrint "Set LPAR bootlist to $bootdev"
e8a0f5
-        bootlist -m normal $bootdev
e8a0f5
+        boot_list+=( $bootdev )
e8a0f5
     fi
e8a0f5
-    LogIfError "Unable to set bootlist. You will have to start in SMS to set it up manually."
e8a0f5
+done
e8a0f5
+
e8a0f5
+if [[ ${#boot_list[@]} -gt 5 ]]; then
e8a0f5
+    LogPrint "Too many entries for bootlist command, limiting to first 5 entries..."
e8a0f5
+    boot_list=( ${boot_list[@]:0:5} )
e8a0f5
 fi
e8a0f5
+
e8a0f5
+if [[ ${#boot_list[@]} -gt 0 ]]; then
e8a0f5
+    LogPrint "Set LPAR bootlist to '${boot_list[*]}'"
e8a0f5
+    bootlist -m normal "${boot_list[@]}"
e8a0f5
+    LogPrintIfError "Unable to set bootlist. You will have to start in SMS to set it up manually."
e8a0f5
+fi
e8a0f5
+
e8a0f5
+# vim: set et ts=4 sw=4: