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