teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

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

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