Blame SOURCES/rear-bz1983013.patch

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