Blame SOURCES/rear-rhbz1610647.patch

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