ryantimwilson / rpms / systemd

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