daandemeyer / rpms / systemd

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