2015-10-08 14:13:16 +00:00
|
|
|
From 0762c0681b00288ef2735a31c6d2478e45f0532c Mon Sep 17 00:00:00 2001
|
2013-03-13 07:31:41 +00:00
|
|
|
From: Harald Hoyer <harald@redhat.com>
|
2014-01-15 00:04:08 +00:00
|
|
|
Date: Tue, 14 Jan 2014 17:48:08 -0500
|
2013-03-13 07:31:41 +00:00
|
|
|
Subject: [PATCH] kernel-install: add fedora specific callouts to
|
|
|
|
new-kernel-pkg
|
|
|
|
|
|
|
|
---
|
2015-10-08 14:13:16 +00:00
|
|
|
src/kernel-install/kernel-install | 38 ++++++++++++++++++++++++++++++++++++++
|
|
|
|
1 file changed, 38 insertions(+)
|
2014-08-15 13:44:04 +00:00
|
|
|
mode change 100644 => 100755 src/kernel-install/kernel-install
|
2013-03-13 07:31:41 +00:00
|
|
|
|
|
|
|
diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install
|
2014-08-15 13:44:04 +00:00
|
|
|
old mode 100644
|
|
|
|
new mode 100755
|
2015-10-08 14:13:16 +00:00
|
|
|
index 3ae1d77..5925329
|
2013-03-13 07:31:41 +00:00
|
|
|
--- a/src/kernel-install/kernel-install
|
|
|
|
+++ b/src/kernel-install/kernel-install
|
2015-10-08 14:13:16 +00:00
|
|
|
@@ -71,6 +71,44 @@ fi
|
2014-08-15 13:44:04 +00:00
|
|
|
KERNEL_VERSION="$1"
|
|
|
|
KERNEL_IMAGE="$2"
|
2013-03-13 07:31:41 +00:00
|
|
|
|
|
|
|
+if [[ -x /sbin/new-kernel-pkg ]]; then
|
2014-08-15 13:44:04 +00:00
|
|
|
+ KERNEL_DIR="${KERNEL_IMAGE%/*}"
|
|
|
|
+ if [[ "${KERNEL_DIR}" != "/boot" ]]; then
|
|
|
|
+ for i in \
|
|
|
|
+ "$KERNEL_IMAGE" \
|
|
|
|
+ "$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac" \
|
|
|
|
+ "$KERNEL_DIR"/System.map \
|
|
|
|
+ "$KERNEL_DIR"/config \
|
|
|
|
+ "$KERNEL_DIR"/zImage.stub \
|
|
|
|
+ "$KERNEL_DIR"/dtb \
|
|
|
|
+ ; do
|
|
|
|
+ [[ -e "$i" ]] || continue
|
|
|
|
+ cp -a "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
|
2015-10-08 14:13:16 +00:00
|
|
|
+ command -v restorecon &>/dev/null && \
|
|
|
|
+ restorecon "/boot/${i##*/}-${KERNEL_VERSION}"
|
2014-08-15 13:44:04 +00:00
|
|
|
+ done
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
+ [[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
|
|
|
|
+ case "$COMMAND" in
|
2013-03-13 07:31:41 +00:00
|
|
|
+ add)
|
2014-08-15 13:44:04 +00:00
|
|
|
+ /sbin/new-kernel-pkg --package "kernel${flavor}" --install "$KERNEL_VERSION" || exit $?
|
|
|
|
+ /sbin/new-kernel-pkg --package "kernel${flavor}" --mkinitrd --dracut --depmod --update "$KERNEL_VERSION" || exit $?
|
|
|
|
+ /sbin/new-kernel-pkg --package "kernel${flavor}" --rpmposttrans "$KERNEL_VERSION" || exit $?
|
2013-03-13 07:31:41 +00:00
|
|
|
+ ;;
|
|
|
|
+ remove)
|
2014-08-15 13:44:04 +00:00
|
|
|
+ /sbin/new-kernel-pkg --package "kernel${flavor+-$flavor}" --rminitrd --rmmoddep --remove "$KERNEL_VERSION" || exit $?
|
2013-03-13 07:31:41 +00:00
|
|
|
+ ;;
|
|
|
|
+ *)
|
|
|
|
+ ;;
|
|
|
|
+ esac
|
|
|
|
+
|
|
|
|
+ # exit, if we can't find a boot loader spec conforming setup
|
|
|
|
+ if ! [[ -d /boot/loader/entries || -L /boot/loader/entries ]]; then
|
|
|
|
+ exit 0
|
|
|
|
+ fi
|
|
|
|
+fi
|
|
|
|
+
|
2014-08-15 13:44:04 +00:00
|
|
|
if [[ -f /etc/machine-id ]]; then
|
|
|
|
read MACHINE_ID < /etc/machine-id
|
|
|
|
fi
|
|
|
|
--
|
2015-10-08 14:13:16 +00:00
|
|
|
2.6.0
|
2014-08-15 13:44:04 +00:00
|
|
|
|