From acd0af7a8880924f56b1ec2d23e846686fabe075 Mon Sep 17 00:00:00 2001 From: Nicolas Frayer Date: Fri, 24 Nov 2023 10:51:53 +0100 Subject: [PATCH] util: Enable default kernel for updates Resolves: #RHEL-4343 Signed-off-by: Nicolas Frayer --- ...il-Enable-default-kernel-for-updates.patch | 34 +++++++++++++++++++ grub.patches | 1 + grub2.spec | 6 +++- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0581-util-Enable-default-kernel-for-updates.patch diff --git a/0581-util-Enable-default-kernel-for-updates.patch b/0581-util-Enable-default-kernel-for-updates.patch new file mode 100644 index 00000000..64c5def3 --- /dev/null +++ b/0581-util-Enable-default-kernel-for-updates.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nicolas Frayer +Date: Wed, 24 May 2023 11:22:47 +0200 +Subject: [PATCH] util: Enable default kernel for updates + +Several kernel variants can be installed on a system in parallel. +In order to allow the user to choose which kernel will be set to +default after an update, re-enable grub's usage of DEFAULTKERNEL as +set in /etc/sysconfig/kernel + +Signed-off-by: Nicolas Frayer +--- + util/grub-get-kernel-settings.in | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/util/grub-get-kernel-settings.in b/util/grub-get-kernel-settings.in +index 7e87dfccc0e4..f71bc64360b0 100644 +--- a/util/grub-get-kernel-settings.in ++++ b/util/grub-get-kernel-settings.in +@@ -68,6 +68,14 @@ if test -f /etc/sysconfig/kernel ; then + . /etc/sysconfig/kernel + fi + ++GRUB_DEFAULT_KERNEL_TYPE=${DEFAULTKERNEL/-core/} ++if [ "$GRUB_DEFAULT_KERNEL_TYPE" != "kernel" ]; then ++ echo GRUB_NON_STANDARD_KERNEL=true ++ echo export GRUB_NON_STANDARD_KERNEL ++ GRUB_DEFAULT_KERNEL_TYPE=${GRUB_DEFAULT_KERNEL_TYPE/kernel-/} ++fi ++echo GRUB_DEFAULT_KERNEL_TYPE=$GRUB_DEFAULT_KERNEL_TYPE ++echo export GRUB_DEFAULT_KERNEL_TYPE + if [ "$MAKEDEBUG" = "yes" ]; then + echo GRUB_LINUX_MAKE_DEBUG=true + echo export GRUB_LINUX_MAKE_DEBUG diff --git a/grub.patches b/grub.patches index 4dbe3152..91e095fa 100644 --- a/grub.patches +++ b/grub.patches @@ -578,3 +578,4 @@ Patch0577: 0577-ieee1275-Converting-plain-numbers-to-constants-in-Ve.patch Patch0578: 0578-ieee1275-extended-support-in-options-vector5.patch Patch0579: 0579-Regenerate-kernelopts-if-missing-on-ppc.patch Patch0580: 0580-kern-ieee1275-init-ppc64-Restrict-high-memory-in-pre.patch +Patch0581: 0581-util-Enable-default-kernel-for-updates.patch diff --git a/grub2.spec b/grub2.spec index 44a119e7..a45d46ec 100644 --- a/grub2.spec +++ b/grub2.spec @@ -7,7 +7,7 @@ Name: grub2 Epoch: 1 Version: 2.02 -Release: 152%{?dist} +Release: 153%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base License: GPLv3+ @@ -510,6 +510,10 @@ fi %endif %changelog +* Fri Nov 24 2023 Nicolas Frayer - 2.02-153 +- util: Enable default kernel for updates +- Resolves: #RHEL-4343 + * Fri Oct 20 2023 Nicolas Frayer - 2.02-152 - kern/ieee1275/init: ppc64: Restrict high memory in presence of fadump