naccyde / rpms / systemd

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