Blame SOURCES/0054-Make-installkernel-to-use-kernel-install-scripts-on-.patch

cca0c4
From f8482113065878c0ace605fbca296fc7601c47cc Mon Sep 17 00:00:00 2001
cca0c4
From: Javier Martinez Canillas <javierm@redhat.com>
cca0c4
Date: Tue, 31 Jul 2018 17:43:53 +0200
cca0c4
Subject: [PATCH 54/55] Make installkernel to use kernel-install scripts on BLS
cca0c4
 configuration
cca0c4
cca0c4
The kernel make install target executes the arch/$ARCH/boot/install.sh
cca0c4
that in turns executes the distro specific installkernel script. This
cca0c4
script always uses new-kernel-pkg to install the kernel images.
cca0c4
cca0c4
But on a BootLoaderSpec setup, the kernel-install scripts must be used
cca0c4
instead. Check if the system uses a BLS setup, and call kernel-install
cca0c4
add in that case instead of new-kernel-pkg.
cca0c4
cca0c4
Reported-by: Hans de Goede <hdegoede@redhat.com>
cca0c4
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
cca0c4
---
cca0c4
 installkernel | 7 +++++++
cca0c4
 1 file changed, 7 insertions(+)
cca0c4
cca0c4
diff --git a/installkernel b/installkernel
cca0c4
index b887929c179..68dcfac16d2 100755
cca0c4
--- a/installkernel
cca0c4
+++ b/installkernel
cca0c4
@@ -20,6 +20,8 @@
cca0c4
 # Author(s): tyson@rwii.com
cca0c4
 #
cca0c4
 
cca0c4
+[[ -f /etc/default/grub ]] && . /etc/default/grub
cca0c4
+
cca0c4
 usage() {
cca0c4
     echo "Usage: `basename $0` <kernel_version> <bootimage> <mapfile>" >&2
cca0c4
     exit 1
cca0c4
@@ -77,6 +79,11 @@ cp $MAPFILE $INSTALL_PATH/System.map-$KERNEL_VERSION
cca0c4
 ln -fs ${RELATIVE_PATH}$INSTALL_PATH/$KERNEL_NAME-$KERNEL_VERSION $LINK_PATH/$KERNEL_NAME
cca0c4
 ln -fs ${RELATIVE_PATH}$INSTALL_PATH/System.map-$KERNEL_VERSION $LINK_PATH/System.map
cca0c4
 
cca0c4
+if [ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ] || [ ! -f /sbin/new-kernel-pkg ]; then
cca0c4
+	kernel-install add $KERNEL_VERSION $INSTALL_PATH/$KERNEL_NAME-$KERNEL_VERSION
cca0c4
+	exit $?
cca0c4
+fi
cca0c4
+
cca0c4
 if [ -n "$cfgLoader" ] && [ -x /sbin/new-kernel-pkg ]; then
cca0c4
 	if [ -n "$(which dracut 2>/dev/null)" ]; then
cca0c4
 		new-kernel-pkg --mkinitrd --dracut --host-only --depmod --install --kernel-name $KERNEL_NAME $KERNEL_VERSION
cca0c4
-- 
cca0c4
2.17.1
cca0c4