daandemeyer / rpms / systemd

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