naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
9fc0f6
From 4d66c1673654c639a350f784c59b4c613c94edf7 Mon Sep 17 00:00:00 2001
9fc0f6
From: Harald Hoyer <harald@redhat.com>
9fc0f6
Date: Wed, 13 Mar 2013 07:57:53 +0100
9fc0f6
Subject: [PATCH] kernel-install: add fedora specific callouts to
9fc0f6
 new-kernel-pkg
9fc0f6
9fc0f6
---
9fc0f6
 src/kernel-install/kernel-install | 21 +++++++++++++++++++++
9fc0f6
 1 file changed, 21 insertions(+)
9fc0f6
9fc0f6
diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install
9fc0f6
index 3ae1d77..3a2ac56 100644
9fc0f6
--- a/src/kernel-install/kernel-install
9fc0f6
+++ b/src/kernel-install/kernel-install
9fc0f6
@@ -19,6 +19,27 @@
9fc0f6
 # You should have received a copy of the GNU Lesser General Public License
9fc0f6
 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
9fc0f6
 
9fc0f6
+if [[ -x /sbin/new-kernel-pkg ]]; then
9fc0f6
+    [[ "$2" == *\+* ]] && flavor=-"${2##*+}"
9fc0f6
+    case "$1" in
9fc0f6
+        add)
9fc0f6
+            /sbin/new-kernel-pkg --package "kernel${flavor}" --install "$2" || exit $?
9fc0f6
+            /sbin/new-kernel-pkg --package "kernel${flavor}" --mkinitrd --dracut --depmod --update "$2" || exit $?
9fc0f6
+            /sbin/new-kernel-pkg --package "kernel${flavor}" --rpmposttrans "$2" || exit $?
9fc0f6
+            ;;
9fc0f6
+        remove)
9fc0f6
+            /sbin/new-kernel-pkg --package "kernel${flavor+-$flavor}" --rminitrd --rmmoddep --remove "$2" || exit $?
9fc0f6
+            ;;
9fc0f6
+        *)
9fc0f6
+            ;;
9fc0f6
+    esac
9fc0f6
+
9fc0f6
+    # exit, if we can't find a boot loader spec conforming setup
9fc0f6
+    if ! [[ -d /boot/loader/entries || -L /boot/loader/entries ]]; then
9fc0f6
+        exit 0
9fc0f6
+    fi
9fc0f6
+fi
9fc0f6
+
9fc0f6
 usage()
9fc0f6
 {
9fc0f6
     echo "Usage:"