Blame SOURCES/rear-bz1983013.patch

9fdd73
diff --git a/usr/share/rear/conf/Linux-ppc64.conf b/usr/share/rear/conf/Linux-ppc64.conf
9fdd73
index 71fa8fa3..85924971 100644
9fdd73
--- a/usr/share/rear/conf/Linux-ppc64.conf
9fdd73
+++ b/usr/share/rear/conf/Linux-ppc64.conf
9fdd73
@@ -1,6 +1,7 @@
9fdd73
 REQUIRED_PROGS=(
9fdd73
 "${REQUIRED_PROGS[@]}"
9fdd73
 sfdisk
9fdd73
+ofpathname
9fdd73
 )
9fdd73
 
9fdd73
 PROGS=(
9fdd73
@@ -9,14 +10,22 @@ mkofboot
9fdd73
 ofpath
9fdd73
 ybin
9fdd73
 yabootconfig
9fdd73
-bootlist
9fdd73
 pseries_platform
9fdd73
 nvram
9fdd73
-ofpathname
9fdd73
 bc
9fdd73
 agetty
9fdd73
 )
9fdd73
 
9fdd73
+if grep -q "emulated by qemu" /proc/cpuinfo ; then
9fdd73
+    # Qemu/KVM virtual machines don't need bootlist - don't complain if
9fdd73
+    # it is missing
9fdd73
+    PROGS+=( bootlist )
9fdd73
+else
9fdd73
+    # PowerVM environment, we need to run bootlist, otherwise
9fdd73
+    # we can't make the system bpotable. Be strict about requiring it
9fdd73
+    REQUIRED_PROGS+=( bootlist )
9fdd73
+fi
9fdd73
+
9fdd73
 COPY_AS_IS=(
9fdd73
 "${COPY_AS_IS[@]}"
9fdd73
 /usr/lib/yaboot/yaboot
9fdd73
diff --git a/usr/share/rear/conf/Linux-ppc64le.conf b/usr/share/rear/conf/Linux-ppc64le.conf
9fdd73
index 2ea82b85..52c15e75 100644
9fdd73
--- a/usr/share/rear/conf/Linux-ppc64le.conf
9fdd73
+++ b/usr/share/rear/conf/Linux-ppc64le.conf
9fdd73
@@ -5,10 +5,8 @@ sfdisk
9fdd73
 
9fdd73
 PROGS=(
9fdd73
 "${PROGS[@]}"
9fdd73
-bootlist
9fdd73
 pseries_platform
9fdd73
 nvram
9fdd73
-ofpathname
9fdd73
 bc
9fdd73
 agetty
9fdd73
 )
9fdd73
@@ -21,4 +19,18 @@ agetty
9fdd73
 if [[ $(awk '/platform/ {print $NF}' < /proc/cpuinfo) != PowerNV ]] ; then
9fdd73
     # No firmware files when ppc64le Linux is not run in BareMetal Mode (PowerNV):
9fdd73
     test "${FIRMWARE_FILES[*]}" || FIRMWARE_FILES=( 'no' )
9fdd73
+    # grub2-install for powerpc-ieee1275 calls ofpathname, so without it,
9fdd73
+    # the rescue system can't make the recovered system bootable
9fdd73
+    REQUIRED_PROGS+=( ofpathname )
9fdd73
+    if grep -q "emulated by qemu" /proc/cpuinfo ; then
9fdd73
+        # Qemu/KVM virtual machines don't need bootlist - don't complain if
9fdd73
+        # it is missing
9fdd73
+        PROGS+=( bootlist )
9fdd73
+    else
9fdd73
+        # PowerVM environment, we need to run bootlist, otherwise
9fdd73
+        # we can't make the system bpotable. Be strict about requiring it
9fdd73
+        REQUIRED_PROGS+=( bootlist )
9fdd73
+    fi
9fdd73
+else
9fdd73
+    PROGS+=( ofpathname bootlist )
9fdd73
 fi