richardphibel / rpms / systemd

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