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