388b8a
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
388b8a
From: Javier Martinez Canillas <javierm@redhat.com>
388b8a
Date: Tue, 26 Feb 2019 21:25:39 +0100
388b8a
Subject: [PATCH] grub-switch-to-blscfg: copy increment.mod for legacy BIOS and
388b8a
 ppc64
388b8a
388b8a
This module is also used in newer GRUB config and weren't present in old
388b8a
GRUB installations, so it has to be copied before attempting to generate
388b8a
a BLS configuration.
388b8a
388b8a
Resolves: rhbz#1652806
388b8a
388b8a
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
388b8a
---
388b8a
 util/grub-switch-to-blscfg.in | 14 ++++++++------
388b8a
 1 file changed, 8 insertions(+), 6 deletions(-)
388b8a
388b8a
diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in
388b8a
index eeea1307706..49b3985fadb 100644
388b8a
--- a/util/grub-switch-to-blscfg.in
388b8a
+++ b/util/grub-switch-to-blscfg.in
388b8a
@@ -288,13 +288,15 @@ if [ "${GENERATE}" -eq 1 ] ; then
388b8a
     copy_bls
388b8a
 
388b8a
     if [ $arch = "x86_64" ] && [ ! -d /sys/firmware/efi ]; then
388b8a
-	if ! cp ${prefix}/lib/grub//i386-pc/blscfg.mod ${grubdir}/i386-pc/ ; then
388b8a
-	    exit 1
388b8a
-	fi
388b8a
+	mod_dir="i386-pc"
388b8a
     elif [ $arch = "ppc64" -o $arch = "ppc64le" ] && [ ! -d /sys/firmware/opal ]; then
388b8a
-	if ! cp ${prefix}/lib/grub/powerpc-ieee1275/blscfg.mod ${grubdir}/powerpc-ieee1275/ ; then
388b8a
-	    exit 1
388b8a
-	fi
388b8a
+	mod_dir="powerpc-ieee1275"
388b8a
+    fi
388b8a
+
388b8a
+    if [ -n "${mod_dir}" ]; then
388b8a
+	for mod in blscfg increment; do
388b8a
+	    cp ${prefix}/lib/grub/${mod_dir}/${mod}.mod ${grubdir}/$mod_dir/ || exit 1
388b8a
+	done
388b8a
     fi
388b8a
 
388b8a
     cp -af "${GRUB_CONFIG_FILE}" "${GRUB_CONFIG_FILE}${backupsuffix}"