Blame SOURCES/rear-rhbz1610647.patch

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