teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

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

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