diff --git a/grubby-bls b/grubby-bls index 2c6cb3d..01ba96b 100755 --- a/grubby-bls +++ b/grubby-bls @@ -492,7 +492,12 @@ update_bls_fragment() { fi if [[ $param = "ALL" && $bootloader = grub2 ]] && [[ -n $remove_args || -n $add_args ]]; then - local old_args="$(grub2-editenv "${env}" list | grep kernelopts | sed -e "s/kernelopts=//")" + local old_args="$(source ${grub_etc_default}; echo ${GRUB_CMDLINE_LINUX})" + 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}" + + old_args="$(grub2-editenv "${env}" list | grep kernelopts | sed -e "s/kernelopts=//")" opts="$(update_args "${old_args}" "${remove_args}" "${add_args}")" grub2-editenv "${env}" set kernelopts="${opts}" elif [[ $bootloader = grub2 ]]; then @@ -754,6 +759,10 @@ if [[ -z $grub_config ]]; then grub_config="/boot/grub2/grub.cfg" fi +if [[ -z $grub_etc_default ]]; then + grub_etc_default="/etc/default/grub" +fi + get_bls_values default_index="$(get_default_index)" diff --git a/grubby.spec b/grubby.spec index 5011e98..1141389 100644 --- a/grubby.spec +++ b/grubby.spec @@ -1,6 +1,6 @@ Name: grubby Version: 8.40 -Release: 40%{?dist} +Release: 41%{?dist} Summary: Command line tool for updating bootloader configs License: GPLv2+ URL: https://github.com/rhinstaller/grubby @@ -133,6 +133,10 @@ current boot environment. %{_mandir}/man8/*.8* %changelog +* Mon Mar 30 2020 Javier Martinez Canillas - 8.40-41 +- Make grubby to also update GRUB_CMDLINE_LINUX in /etc/default/grub + Related: rhbz#1287854 + * Mon Feb 10 2020 Javier Martinez Canillas - 8.40-40 - Fix FTBFS Resolves: rhbz#1799496