teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0002-kernel-install-add-fedora-specific-callouts-to-new-k.patch

a4b143
From b81d902a8ec4e81c6ddda0208307ee77d4e0858b 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
a4b143
index fb2ee57..f491947 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
 {
a4b143
     echo "Usage:" >&2