naccyde / rpms / systemd

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