teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

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

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