Bug 2372973 - GRUB is unable to use bootloader header space for grubenv on btrfs (patch available)
Summary: GRUB is unable to use bootloader header space for grubenv on btrfs (patch ava...
Keywords:
Status: POST
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Nicolas Frayer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-06-16 07:16 UTC by Neal Gompa
Modified: 2025-10-27 18:22 UTC (History)
15 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Pagure fedora-btrfs/project issue 7 0 None None None 2025-06-16 07:18:16 UTC

Description Neal Gompa 2025-06-16 07:16:14 UTC
Currently, if you set up /boot as a btrfs subvolume, you wind up with a situation where the GRUB Hidden Menu feature does not work since grubenv is a file on the volume and cannot be written to since the Btrfs driver is read-only.

The correct fix is to write grubenv in the Btrfs header space allocated specifically for bootloaders. The folks at SUSE have a patch for this that we should import into our grub2 package to resolve this: https://build.opensuse.org/projects/Base:System/packages/grub2/files/grub2-grubenv-in-btrfs-header.patch

Reproducible: Always

Comment 1 Marta Lewandowska 2025-06-16 09:01:55 UTC
Hi Neal,
I can't find this patch upstream... could you please encourage SUSE to send it upstream first?
thanks!

Comment 2 Neal Gompa 2025-06-16 09:13:26 UTC
I will try.

Comment 3 Neal Gompa 2025-06-18 17:24:49 UTC
Michael Chang notified me that he'll be able to look into this within the first two weeks of July.

Comment 4 Marta Lewandowska 2025-06-19 09:43:32 UTC
Great. Thank you for that :)

Comment 5 Hadi Chokr 2025-07-18 08:18:15 UTC
Any Updates from SUSE on upstreaming their patch?

Comment 6 Marta Lewandowska 2025-07-18 09:50:43 UTC
As promised, patch was sent upstream last week: https://lists.gnu.org/archive/html/grub-devel/2025-07/msg00129.html

Comment 7 Neal Gompa 2025-09-16 12:00:26 UTC
There's now a v2 series that needs people to review it: https://lists.gnu.org/archive/html/grub-devel/2025-09/msg00127.html

Comment 8 Neal Gompa 2025-10-07 03:04:17 UTC
The patch series has been revised to version 3: https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00009.html

Comment 9 Neal Gompa 2025-10-10 22:05:11 UTC
The patch series has been revised to version 4: https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00172.html

Comment 10 Marta Lewandowska 2025-10-15 07:24:54 UTC
Thank you for being patient, Neal. I know this is taking a long time, but we've heard from upstream that this patch set is almost there... We hope to be able to get it into fedora for you within the next week.

Comment 11 Neal Gompa 2025-10-16 08:16:46 UTC
The patch series has been revised to version 5: https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00261.html

I believe this is the version that will land upstream.

Comment 12 Neal Gompa 2025-10-17 12:51:33 UTC
The patch series has been revised to version 6: https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00292.html

Comment 13 Marta Lewandowska 2025-10-20 15:28:00 UTC
v6 has been accepted upstream https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00292.html

Comment 14 Marta Lewandowska 2025-10-21 11:53:36 UTC
And this commit is also needed for it to work https://cgit.git.savannah.gnu.org/cgit/grub.git/commit/?id=4f6c4609174d92c8b881bc5adb7fe971dd5cee0b

Comment 15 Neal Gompa 2025-10-23 00:53:58 UTC
(In reply to Marta Lewandowska from comment #13)
> v6 has been accepted upstream
> https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00292.html

Actual link of acceptance: https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00315.html

Comment 16 Leo Sandoval 2025-10-27 18:22:53 UTC
Neal,

I have appended all related patches [1,2] into the dist-git spec file but I would like some testing before merge. 

Can you please test using the scratch build from pull-request [3]? 

Let me know if it works or some other pac

[1] Add support for external environment block on Btrfs
    https://lists.gnu.org/archive/html/grub-devel/2025-10/msg00292.html

[2] kern/fs: Honour file->read_hook() in grub_fs_blocklist_read()
    https://cgit.git.savannah.gnu.org/cgit/grub.git/commit/?id=4f6c4609174d92c8b881bc5adb7fe971dd5cee0b

[3] https://src.fedoraproject.org/rpms/grub2/pull-request/196


Note You need to log in before you can comment on or make changes to this bug.