udpate kernel-install-grubby.patch

Copy over the kernel and other files, if the kernel is not in /boot.
This commit is contained in:
Harald Hoyer 2014-08-15 15:44:04 +02:00
parent a7ae5e1ba8
commit bd236f8773

View File

@ -1,31 +1,49 @@
From 0fe97bc02e3108efdb844feb1b367a89ba995d83 Mon Sep 17 00:00:00 2001
From 0256bbe384f243dbbcfbe87200c9d8613a992ecb Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 14 Jan 2014 17:48:08 -0500
Subject: [PATCH] kernel-install: add fedora specific callouts to
new-kernel-pkg
---
src/kernel-install/kernel-install | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
src/kernel-install/kernel-install | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
mode change 100644 => 100755 src/kernel-install/kernel-install
diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install
index 3ae1d77..3a2ac56 100644
old mode 100644
new mode 100755
index 3ae1d77..f1c74de
--- a/src/kernel-install/kernel-install
+++ b/src/kernel-install/kernel-install
@@ -19,6 +19,27 @@
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
@@ -71,6 +71,42 @@ fi
KERNEL_VERSION="$1"
KERNEL_IMAGE="$2"
+if [[ -x /sbin/new-kernel-pkg ]]; then
+ [[ "$2" == *\+* ]] && flavor=-"${2##*+}"
+ case "$1" in
+ 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}"
+ done
+ fi
+
+ [[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
+ case "$COMMAND" in
+ add)
+ /sbin/new-kernel-pkg --package "kernel${flavor}" --install "$2" || exit $?
+ /sbin/new-kernel-pkg --package "kernel${flavor}" --mkinitrd --dracut --depmod --update "$2" || exit $?
+ /sbin/new-kernel-pkg --package "kernel${flavor}" --rpmposttrans "$2" || exit $?
+ /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 $?
+ ;;
+ remove)
+ /sbin/new-kernel-pkg --package "kernel${flavor+-$flavor}" --rminitrd --rmmoddep --remove "$2" || exit $?
+ /sbin/new-kernel-pkg --package "kernel${flavor+-$flavor}" --rminitrd --rmmoddep --remove "$KERNEL_VERSION" || exit $?
+ ;;
+ *)
+ ;;
@ -37,6 +55,9 @@ index 3ae1d77..3a2ac56 100644
+ fi
+fi
+
usage()
{
echo "Usage:"
if [[ -f /etc/machine-id ]]; then
read MACHINE_ID < /etc/machine-id
fi
--
2.0.4