Bug 1906191

Summary: new kernels with SUSE_BTRFS_SNAPSHOT_BOOTING=true do not get the right BOOTPREFIX
Product: [Fedora] Fedora Reporter: Eduardo <edward.lara.lara>
Component: grub2Assignee: Javier Martinez Canillas <fmartine>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 33CC: fmartine, lkundrak, pjones
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: grub2-2.06-3.fc35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-06 09:54:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
snapshot booting patch none

Description Eduardo 2020-12-09 21:22:00 UTC
Created attachment 1738054 [details]
snapshot booting patch

Description of problem:
Installing new kernels under the following setup do not get the right path to the kernel:
btrfs as file system
boot as part of root instead of separate partition
snapper configured so the default subvolume of the btrfs is the current root/snapshot
in /etc/default/grub having:
SUSE_BTRFS_SNAPSHOT_BOOTING=true

Version-Release number of selected component (if applicable):
grub2-common-2.04-31.fc33.noarch


How reproducible:
install a new kernel and the path in the generated bls will have a path relative to the root subvolume instead of the default one


Steps to Reproduce:
1. Install a system as described above
2. Install a new kernel

Actual results:
For example, after installing kernel 5.9.12-200
/boot/loader/entries/xxx-5.9.12-200.fc33.x86_64.conf:
linux /root/boot/vmlinuz-5.9.12-200.fc33.x86_64
initrd /root/boot/initramfs-5.9.12-200.fc33.x86_64.img


Expected results:
It should have generated
linux /boot/vmlinuz-5.9.12-200.fc33.x86_64
initrd /boot/initramfs-5.9.12-200.fc33.x86_64.img



Additional info:
/etc/grub.d/10_linux (grub2-tools) seems to be able to handle it. The issue is in /usr/lib/kernel/install.d/20-grub.install (grub2-common). After reviewing how 10_linux works attached patch seems to fix the issue. Note that the check is overly cautious and checks that the FS is actually btrfs and not only the SUSE_BTRFS_SNAPSHOT_BOOTING flag. Since the GRUB_FS variable is not available it is currently expanded

Comment 1 Fedora Admin user for bugzilla script actions 2021-05-07 00:35:39 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 2 Fedora Update System 2021-07-06 09:49:43 UTC
FEDORA-2021-21ed0c951f has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-21ed0c951f

Comment 3 Fedora Update System 2021-07-06 09:54:09 UTC
FEDORA-2021-21ed0c951f has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.