dcavalca / rpms / systemd

Forked from rpms/systemd 4 months ago
Clone
Harald Hoyer c3aabf
From dd33348393551411885397ff7d88a3a908eeb018 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 c3aabf
 src/kernel-install/kernel-install | 21 +++++++++++++++++++++
Harald Hoyer c3aabf
 1 file changed, 21 insertions(+)
Harald Hoyer 2e2e24
Harald Hoyer 2e2e24
diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install
Harald Hoyer c3aabf
index fb2ee57..31e988a 100644
Harald Hoyer 2e2e24
--- a/src/kernel-install/kernel-install
Harald Hoyer 2e2e24
+++ b/src/kernel-install/kernel-install
Harald Hoyer c3aabf
@@ -19,6 +19,27 @@
Harald Hoyer fad8ba
 # You should have received a copy of the GNU Lesser General Public License
Harald Hoyer fad8ba
 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
+if [[ -x /sbin/new-kernel-pkg ]]; then
Harald Hoyer c3aabf
+    [[ "$2" == *\+* ]] && flavor=-"${2##*+}"
Harald Hoyer fad8ba
+    case "$1" in
Harald Hoyer 2e2e24
+        add)
Harald Hoyer c3aabf
+            /sbin/new-kernel-pkg --package "kernel${flavor}" --install "$2" || exit $?
Harald Hoyer c3aabf
+            /sbin/new-kernel-pkg --package "kernel${flavor}" --mkinitrd --dracut --depmod --update "$2" || exit $?
Harald Hoyer c3aabf
+            /sbin/new-kernel-pkg --package "kernel${flavor}" --rpmposttrans "$2" || exit $?
Harald Hoyer 2e2e24
+            ;;
Harald Hoyer 2e2e24
+        remove)
Harald Hoyer c3aabf
+            /sbin/new-kernel-pkg --package "kernel${flavor+-$flavor}" --rminitrd --rmmoddep --remove "$2" || 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 fad8ba
 usage()
Harald Hoyer fad8ba
 {
Harald Hoyer fad8ba
     echo "Usage:" >&2
Harald Hoyer 2e2e24
-- 
Harald Hoyer c3aabf
1.8.3.1
Harald Hoyer 2e2e24