richardphibel / rpms / systemd

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