teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame kernel-install-grubby.patch

Zbigniew Jędrzejewski-Szmek 126222
From 0fe97bc02e3108efdb844feb1b367a89ba995d83 Mon Sep 17 00:00:00 2001
Harald Hoyer 2e2e24
From: Harald Hoyer <harald@redhat.com>
Zbigniew Jędrzejewski-Szmek 126222
Date: Tue, 14 Jan 2014 17:48:08 -0500
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
Zbigniew Jędrzejewski-Szmek 126222
index 3ae1d77..3a2ac56 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
 {
Zbigniew Jędrzejewski-Szmek 126222
     echo "Usage:"