teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

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

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