Only let grubby manipulate machine-id entries

On various clouds, systems may be built from snapshots from different
machines. The result is BLS entries from the old system that do not
correspond to anything on the new system. When grubby is used to sort
or update or set a particular entry as the default, it may set too
high an index for the entry, which then fails to boot.

Use the machine-id to only list and manipulate entries that correspond
to the machine.
This commit is contained in:
Marta Lewandowska 2026-07-03 15:30:34 +02:00
parent 693ac2964d
commit dda97ca5d7
2 changed files with 6 additions and 2 deletions

View File

@ -85,7 +85,7 @@ get_bls_values() {
count=0
local -a files
local IFS=$'\n'
files=($(for bls in ${blsdir}/*.conf ; do
files=($(for bls in ${blsdir}/${MACHINE_ID}*.conf ; do
if ! [[ -e "${bls}" ]] ; then
continue
fi

View File

@ -1,6 +1,6 @@
Name: grubby
Version: 8.40
Release: 49%{?dist}
Release: 50%{?dist}
Summary: Command line tool for updating BootLoaderSpec files
License: GPLv2+
URL: https://github.com/rhinstaller/grubby
@ -169,6 +169,10 @@ current boot environment.
%{_mandir}/man8/*.8*
%changelog
* Fri Jul 03 2026 Marta Lewandowska <mlewando@redhat.com> - 8.40-50
- Have grubby only manipulate and display relevant entries
- Resolves: #RHEL-132931
* Wed Jan 10 2024 Marta Lewandowska <mlewando@redhat.com> - 8.40-49
- Do not overwrite all vars that start with GRUB_CMDLINE_LINUX
- Resolves: #RHEL-12853