Blame SOURCES/rear-bz1983013.patch

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