From 7beb5ebb5707e7a8dc1f86015930aa7ed674274a Mon Sep 17 00:00:00 2001 From: Marta Lewandowska Date: Wed, 10 Jan 2024 16:40:47 +0200 Subject: [PATCH] Don't overwrite vars that start with GRUB_CMDLINE_LINUX When updating args for ALL kernels, grubby clobbers all variables in /etc/default/grub that start with GRUB_CMDLINE_LINUX and renders that line multiple times, for each variable that exists. This breaks using recovery mode. Fix so this doesn't happen anymore. Signed-off-by: Marta Lewandowska --- grubby-bls | 2 +- grubby.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/grubby-bls b/grubby-bls index cce0579..52fbc76 100755 --- a/grubby-bls +++ b/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 diff --git a/grubby.spec b/grubby.spec index 44b20ad..bc7219f 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 69%{?dist} +Release: 70%{?dist} Summary: Command line tool for updating bootloader configs License: GPLv2+ Source1: grubby-bls @@ -77,6 +77,9 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Wed Jan 10 2024 Marta Lewandowska - 8.40-70 +- Do not overwrite all vars that start with GRUB_CMDLINE_LINUX + * Thu Jan 19 2023 Fedora Release Engineering - 8.40-69 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild