Blame SOURCES/rear-bz1983013.patch

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