import grubby-8.40-47.el8

This commit is contained in:
CentOS Sources 2023-03-28 08:37:58 +00:00 committed by Stepan Oksanichenko
parent ec27133b7d
commit 5fea635577
2 changed files with 23 additions and 19 deletions

View File

@ -511,24 +511,6 @@ update_bls_fragment() {
fi
elif [[ $bootloader = grub2 ]]; then
opts="$(grub2-editenv "${env}" list | grep kernelopts | sed -e "s/kernelopts=//")"
elif [[ $bootloader = zipl ]]; then
if [[ ! -f /etc/kernel/cmdline ]]; then
# anaconda could create this, but we'd just end up in the same
# place.
sed 's/BOOT_IMAGE=[^ ]*//' /proc/cmdline > /etc/kernel/cmdline
fi
if [[ $param = "ALL" ]] && [[ -n $remove_args || -n $add_args ]]; then
read old_args < /etc/kernel/cmdline
opts="$(update_args "${old_args}" "${remove_args}" "${add_args}")"
echo "$opts" > /etc/kernel/cmdline
fi
fi
if [[ $bootloader = grub2 ]] && [[ ! -f /etc/kernel/cmdline ]]; then
opts=$(grub2-editenv "${env}" list | grep kernelopts | sed 's/kernelopts=//')
if [[ -n $opts ]]; then
echo "opts" > /etc/kernel/cmdline
fi
fi
for i in ${indexes[*]}; do
@ -550,6 +532,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
}

View File

@ -1,6 +1,6 @@
Name: grubby
Version: 8.40
Release: 45%{?dist}
Release: 47%{?dist}
Summary: Command line tool for updating BootLoaderSpec files
License: GPLv2+
URL: https://github.com/rhinstaller/grubby
@ -169,6 +169,14 @@ current boot environment.
%{_mandir}/man8/*.8*
%changelog
* Mon Oct 10 2022 Robbie Harwood <rharwood@redhat.com> - 8.40-47
- Backport fedora/rhel9 initial cmdline population
- Resolves: #2129740
* Thu Oct 06 2022 Robbie Harwood <rharwood@redhat.com> - 8.40-46
- Fix quoting of opts in grubby-bls
- Resolves: #2129740
* Thu Aug 11 2022 Robbie Harwood <rharwood@redhat.com> - 8.40-44
- Write to /etc/kernel/cmdline on non-s390x also
- Resolves: #1978226