richardphibel / rpms / systemd

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