Blame SOURCES/rear-bz1983013.patch

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