public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/grubby] rawhide: grubby-bls: fix matching by kernel name
@ 2026-06-02 16:10 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-06-02 16:10 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/grubby
            Branch : rawhide
            Commit : 8b355fde2411bdb667662ee2653e54e6cc59e448
            Author : Ondrej Mosnáček <omosnacek@gmail.com>
            Date   : 2026-05-18T15:54:09+02:00
            Stats  : +5/-2 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/grubby/c/8b355fde2411bdb667662ee2653e54e6cc59e448?branch=rawhide

            Log:
            grubby-bls: fix matching by kernel name

Modifying bootloader configuration based on full kernel path
(/boot/vmlinuz-...) is currently broken when /boot is on a BTRFS
subvolume (see https://bugzilla.redhat.com/show_bug.cgi?id=2422116).
Make at least using just the kernel name (vmlinuz-...) work in this
situation, so that e.g. grubby --update-kernel vmlinuz-... ... works.

The fix is to strip everything before the last slash on both sides of
the comparison instead of stripping just $param and expecting that the
value in the BLS config will always be just "/vmlinuz-...".

Signed-off-by: Ondrej Mosnáček <omosnacek@gmail.com>

---
diff --git a/grubby-bls b/grubby-bls
index 11b69b1..bdd7b18 100755
--- a/grubby-bls
+++ b/grubby-bls
@@ -175,7 +175,7 @@ param_to_indexes() {
     fi
 
     for i in ${!bls_file[@]}; do
-        if [[ $param = "${bls_linux[$i]}" || "/${param##*/}" = "${bls_linux[$i]}" ]]; then
+        if [[ $param = "${bls_linux[$i]}" || "${param##*/}" = "${bls_linux[$i]##*/}" ]]; then
             indexes="$indexes $i"
         fi
 

diff --git a/grubby.spec b/grubby.spec
index b7bd054..84c5da6 100644
--- a/grubby.spec
+++ b/grubby.spec
@@ -3,7 +3,7 @@
 
 Name: grubby
 Version: 8.40
-Release: 88%{?dist}
+Release: 89%{?dist}
 Summary: Command line tool for updating bootloader configs
 License: GPL-2.0-or-later
 Source1: grubby-bls
@@ -79,6 +79,9 @@ fi
 %config(noreplace) %{_sysconfdir}/sysconfig/kernel
 
 %changelog
+* Mon May 18 2026 Ondrej Mosnáček <omosnacek@gmail.com> - 8.40-89
+- Fix matching by kernel name
+
 * Thu Mar  5 2026 Hans de Goede <johannes.goede@oss.qualcomm.com> - 8.40-88
 - Fix 10-devicetree.install failure when /boot is fat
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-02 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-02 16:10 [rpms/grubby] rawhide: grubby-bls: fix matching by kernel name 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox