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> From: Harald Hoyer <harald@redhat.com>
Date: Tue, 14 Jan 2014 17:48:08 -0500 Date: Tue, 14 Jan 2014 17:48:08 -0500
Subject: [PATCH] kernel-install: add fedora specific callouts to Subject: [PATCH] kernel-install: add fedora specific callouts to
new-kernel-pkg new-kernel-pkg
--- ---
src/kernel-install/kernel-install | 21 +++++++++++++++++++++ src/kernel-install/kernel-install | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 21 insertions(+) 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 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 --- a/src/kernel-install/kernel-install
+++ b/src/kernel-install/kernel-install +++ b/src/kernel-install/kernel-install
@@ -19,6 +19,27 @@ @@ -71,6 +71,42 @@ fi
# You should have received a copy of the GNU Lesser General Public License KERNEL_VERSION="$1"
# along with systemd; If not, see <http://www.gnu.org/licenses/>. KERNEL_IMAGE="$2"
+if [[ -x /sbin/new-kernel-pkg ]]; then +if [[ -x /sbin/new-kernel-pkg ]]; then
+ [[ "$2" == *\+* ]] && flavor=-"${2##*+}" + KERNEL_DIR="${KERNEL_IMAGE%/*}"
+ case "$1" in + 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) + add)
+ /sbin/new-kernel-pkg --package "kernel${flavor}" --install "$2" || exit $? + /sbin/new-kernel-pkg --package "kernel${flavor}" --install "$KERNEL_VERSION" || exit $?
+ /sbin/new-kernel-pkg --package "kernel${flavor}" --mkinitrd --dracut --depmod --update "$2" || exit $? + /sbin/new-kernel-pkg --package "kernel${flavor}" --mkinitrd --dracut --depmod --update "$KERNEL_VERSION" || exit $?
+ /sbin/new-kernel-pkg --package "kernel${flavor}" --rpmposttrans "$2" || exit $? + /sbin/new-kernel-pkg --package "kernel${flavor}" --rpmposttrans "$KERNEL_VERSION" || exit $?
+ ;; + ;;
+ remove) + 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
+fi +fi
+ +
usage() if [[ -f /etc/machine-id ]]; then
{ read MACHINE_ID < /etc/machine-id
echo "Usage:" fi
--
2.0.4