teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/9999-Update-kernel-install-script-by-backporting-fedora-p.patch

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