From 14f65a14703729ef034bec7ef39727fa284e363a Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Sat, 18 Jan 2025 18:04:14 +0100 Subject: [PATCH] update version Signed-off-by: Toshaan Bharvani --- SOURCES/grubby-bls | 20 ++++++++++++++++++-- SOURCES/grubby.8 | 3 ++- SPECS/grubby.spec | 42 +++++++++++++++++++++++++++++++++++++++--- 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/SOURCES/grubby-bls b/SOURCES/grubby-bls index af0d82d..fef62db 100755 --- a/SOURCES/grubby-bls +++ b/SOURCES/grubby-bls @@ -500,7 +500,7 @@ update_bls_fragment() { if [[ -n $old_args ]]; then opts="$(update_args "${old_args}" "${remove_args}" "${add_args}")" opts="$(echo "$opts" | sed -e 's/\//\\\//g')" - sed -i -e "s/^GRUB_CMDLINE_LINUX.*/GRUB_CMDLINE_LINUX=\\\"${opts}\\\"/" "${grub_etc_default}" + sed -i -e "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\\\"${opts}\\\"/" "${grub_etc_default}" fi fi @@ -528,6 +528,20 @@ update_bls_fragment() { fi done + if [[ $param = "ALL" ]] && [[ -n $remove_args || -n $add_args ]]; then + if [[ ! -f /etc/kernel/cmdline ]]; then + # anaconda could pre-populate this file, but until then, most of + # the time we'll just want the most recent one. This is pretty + # close to the current almost-correct behavior of falling back to + # /proc/cmdline anyhow. + echo "$(get_bls_args -1)" > /etc/kernel/cmdline + fi + + read old_args < /etc/kernel/cmdline + local new_args="$(update_args "${old_args}" "${remove_args}" "${add_args}")" + echo "$new_args" > /etc/kernel/cmdline + fi + update_grubcfg } @@ -819,7 +833,9 @@ if [[ -n $kernel ]]; then opts="${opts} ${args}" fi else - opts="${args}" + opts="${opts} ${args}" + remove_args="$kernelopts" + update_args "${opts}" "${remove_args}" "" fi add_bls_fragment "${kernel}" "${title}" "${opts}" "${initrd}" \ diff --git a/SOURCES/grubby.8 b/SOURCES/grubby.8 index 9bcd247..1c06017 100644 --- a/SOURCES/grubby.8 +++ b/SOURCES/grubby.8 @@ -148,7 +148,8 @@ the only items that can be updated is the kernel argument list, which is modified via the \fB-\-args\fR and \fB-\-remove-args\fR options. If the \fBALL\fR argument is used the variable \fB GRUB_CMDLINE_LINUX\fR in \fB/etc/default/grub\fR is updated with the latest kernel argument list, -unless the \fB-\-no-etc-grub-update\fR option is used. +unless the \fB-\-no-etc-grub-update\fR option is used or the file does not +exist (e.g., on s390x). .TP \fB-\-zipl\fR diff --git a/SPECS/grubby.spec b/SPECS/grubby.spec index dd3b89b..658ec91 100644 --- a/SPECS/grubby.spec +++ b/SPECS/grubby.spec @@ -1,6 +1,6 @@ Name: grubby Version: 8.40 -Release: 55%{?dist} +Release: 64%{?dist} Summary: Command line tool for updating bootloader configs License: GPLv2+ URL: https://github.com/rhinstaller/grubby @@ -94,7 +94,7 @@ fi %package deprecated Summary: Legacy command line tool for updating bootloader configs -Conflicts: %{name} <= 8.40-18 +Conflicts: grubby < %{version}-%{release} %description deprecated This package provides deprecated, legacy grubby. This is for temporary @@ -128,9 +128,45 @@ current boot environment. %attr(0755,root,root) %{_sbindir}/grubby %attr(0755,root,root) %{_sbindir}/installkernel %attr(0755,root,root) %{_sbindir}/new-kernel-pkg - %{_mandir}/man8/*.8* +%{_mandir}/man8/*.8* %changelog +* Wed Jan 10 2024 Marta Lewandowska - 8.40-64 +- Do not overwrite all vars that start with GRUB_CMDLINE_LINUX +- Resolves: #RHEL-21301 + +* Tue Feb 21 2023 Marta Lewandowska - 8.40-63 +- remove root= when not copying default +- Resolves: #2127453 + +* Wed Feb 15 2022 Robbie Harwood - 8.40-62 +- Apply Marta's default args fix +- Resolves: #2127453 + +* Thu Aug 25 2022 Robbie Harwood - 8.40-61 +- Sync args changes with 8.40-66.fc38 +- Resolves: #1969362 + +* Thu Aug 11 2022 Robbie Harwood - 8.40-60 +- Handle updating /etc/kernel/cmdline +- Resolves: #1969362 + +* Wed Jul 20 2022 Robbie Harwood - 8.40-59 +- Appease upgrade tests by keeping deprecated version in lockstep +- Resolves: #2105118 + +* Tue Jul 19 2022 Robbie Harwood - 8.40-58 +- Clarify that grub files aren't used on s390x in man page +- Resolves: #2105118 + +* Wed Jun 22 2022 Robbie Harwood - 8.40-57 +- Revert previous change (fedora sync) +- Resolves: #1969362 + +* Thu Jun 02 2022 Robbie Harwood - 8.40-56 +- Additionally write to /etc/kernel/cmdline (fedora sync) +- Resolves: #1969362 + * Mon Feb 07 2022 Robbie Harwood 8.40-55 - Sync grubby-bls with Fedora - Resolves: #1949904