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