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