ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
e9482b
From c49c37d5e26bf71a97d5194d390f80d3e71758e1 Mon Sep 17 00:00:00 2001
e9482b
From: systemd team <systemd-maint@redhat.com>
e9482b
Date: Tue, 23 Apr 2019 10:46:19 -0300
e9482b
Subject: [PATCH] Update kernel-install script by backporting fedora patches
e9482b
e9482b
---
e9482b
 src/kernel-install/kernel-install | 30 +++++++++++++++++-------------
e9482b
 1 file changed, 17 insertions(+), 13 deletions(-)
e9482b
e9482b
diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install
e9482b
index f1c74de..d860701 100755
e9482b
--- a/src/kernel-install/kernel-install
e9482b
+++ b/src/kernel-install/kernel-install
e9482b
@@ -73,23 +73,27 @@ KERNEL_IMAGE="$2"
e9482b
 
e9482b
 if [[ -x /sbin/new-kernel-pkg ]]; then
e9482b
     KERNEL_DIR="${KERNEL_IMAGE%/*}"
e9482b
-    if [[ "${KERNEL_DIR}" != "/boot" ]]; then
e9482b
-        for i in \
e9482b
-            "$KERNEL_IMAGE" \
e9482b
-            "$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac" \
e9482b
-            "$KERNEL_DIR"/System.map \
e9482b
-            "$KERNEL_DIR"/config \
e9482b
-            "$KERNEL_DIR"/zImage.stub \
e9482b
-            "$KERNEL_DIR"/dtb \
e9482b
-            ; do
e9482b
-            [[ -e "$i" ]] || continue
e9482b
-            cp -a "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
e9482b
-        done
e9482b
-    fi
e9482b
 
e9482b
     [[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
e9482b
     case "$COMMAND" in
e9482b
         add)
e9482b
+            if [[ "${KERNEL_DIR}" != "/boot" ]]; then
e9482b
+                for i in \
e9482b
+                    "$KERNEL_IMAGE" \
e9482b
+                    "$KERNEL_DIR"/System.map \
e9482b
+                    "$KERNEL_DIR"/config \
e9482b
+                    "$KERNEL_DIR"/zImage.stub \
e9482b
+                    "$KERNEL_DIR"/dtb \
e9482b
+                    ; do
e9482b
+                    [[ -e "$i" ]] || continue
e9482b
+                    cp -aT "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
e9482b
+                done
e9482b
+                # hmac is .vmlinuz-<version>.hmac so needs a special treatment
e9482b
+                i="$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac"
e9482b
+                if [[ -e "$i" ]]; then
e9482b
+                    cp -aT "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
e9482b
+                fi
e9482b
+            fi
e9482b
             /sbin/new-kernel-pkg --package "kernel${flavor}" --install "$KERNEL_VERSION" || exit $?
e9482b
             /sbin/new-kernel-pkg --package "kernel${flavor}" --mkinitrd --dracut --depmod --update "$KERNEL_VERSION" || exit $?
e9482b
             /sbin/new-kernel-pkg --package "kernel${flavor}" --rpmposttrans "$KERNEL_VERSION" || exit $?
e9482b
-- 
e9482b
1.8.3.1
e9482b