Harald Hoyer 2e2e24
From 5150a366a4771a2a498d4e062482728d1dce94dd Mon Sep 17 00:00:00 2001
Harald Hoyer 2e2e24
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 2e2e24
Date: Wed, 13 Mar 2013 07:57:53 +0100
Harald Hoyer 2e2e24
Subject: [PATCH] kernel-install: add fedora specific callouts to
Harald Hoyer 2e2e24
 new-kernel-pkg
Harald Hoyer 2e2e24
Harald Hoyer 2e2e24
---
Harald Hoyer 2e2e24
 src/kernel-install/kernel-install | 19 +++++++++++++++++++
Harald Hoyer 2e2e24
 1 file changed, 19 insertions(+)
Harald Hoyer 2e2e24
Harald Hoyer 2e2e24
diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install
Harald Hoyer 2e2e24
index 16c06e0..cf9829e 100644
Harald Hoyer 2e2e24
--- a/src/kernel-install/kernel-install
Harald Hoyer 2e2e24
+++ b/src/kernel-install/kernel-install
Harald Hoyer 2e2e24
@@ -25,6 +25,25 @@ COMMAND="$1"
Harald Hoyer 2e2e24
 KERNEL_VERSION="$2"
Harald Hoyer 2e2e24
 KERNEL_IMAGE="$3"
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
+if [[ -x /sbin/new-kernel-pkg ]]; then
Harald Hoyer 2e2e24
+    case "$COMMAND" in
Harald Hoyer 2e2e24
+        add)
Harald Hoyer 2e2e24
+            /sbin/new-kernel-pkg --package kernel --mkinitrd --dracut --depmod --install "$KERNEL_VERSION" || exit $?
Harald Hoyer 2e2e24
+            /sbin/new-kernel-pkg --package kernel --rpmposttrans "$KERNEL_VERSION" || exit $?
Harald Hoyer 2e2e24
+            ;;
Harald Hoyer 2e2e24
+        remove)
Harald Hoyer 2e2e24
+            /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove "$KERNEL_VERSION" || exit $?
Harald Hoyer 2e2e24
+            ;;
Harald Hoyer 2e2e24
+        *)
Harald Hoyer 2e2e24
+            ;;
Harald Hoyer 2e2e24
+    esac
Harald Hoyer 2e2e24
+
Harald Hoyer 2e2e24
+    # exit, if we can't find a boot loader spec conforming setup
Harald Hoyer 2e2e24
+    if ! [[ -d /boot/loader/entries || -L /boot/loader/entries ]]; then
Harald Hoyer 2e2e24
+        exit 0
Harald Hoyer 2e2e24
+    fi
Harald Hoyer 2e2e24
+fi
Harald Hoyer 2e2e24
+
Harald Hoyer 2e2e24
 [[ -f /etc/os-release ]] && . /etc/os-release
Harald Hoyer 2e2e24
 if ! [[ $ID ]]; then
Harald Hoyer 2e2e24
     echo "Can't determine the name of your distribution. Please create /etc/os-release." >&2
Harald Hoyer 2e2e24
-- 
Harald Hoyer 2e2e24
1.8.1
Harald Hoyer 2e2e24