Bug 1706117

Summary: grub2-mkconfig writes to wrong grubenv file on UEFI systems
Product: [Fedora] Fedora Reporter: Gregory Lee Bartholomew <gregory.lee.bartholomew+redhat>
Component: grub2Assignee: Peter Jones <pjones>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 30CC: fmartine, goeran, lkundrak, pjones
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-03 17:05:14 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:

Description Gregory Lee Bartholomew 2019-05-03 15:05:35 UTC
Description of problem:

On a system where /boot has been formatted with VFAT (as recommended by the original boot loader specification), the symbolic link /boot/grub2/grubenv does not work. This would not be a problem on UEFI systems except that grub2-mkconfig is writing to the symbolic link instead of writing directly to the grubenv file on the ESP.

In my opinion, grub2-mkconfig should not be looking for or writing to files under /boot/grub2 on UEFI systems. It should write directly to the files in the area designated for UEFI config files -- $ESP/efi/fedora.

Version-Release number of selected component (if applicable):

grub2-efi-x64-2.02-78.fc30.x86_64

How reproducible:

Always

Steps to Reproduce:

1. Format $BOOT with VFAT and use it directly as $ESP

2. sed -i '/^GRUB_CMDLINE_LINUX=/s/"$/ test1"/' /etc/default/grub

3. grub2-mkconfig -o /boot/efi/fedora/grub.cfg

Actual results:

/boot/efi/fedora/grubenv is not updated as can be seen with the following command:

$ grub2-editenv /boot/efi/fedora/grubenv list

Expected results:

/boot/efi/fedora/grubenv should be updated with the new kernel arguments

Additional info:

This was not an issue in previous releases of Fedora. In previous versions, the kernel arguments were stored in the grub.cfg file under the correct directory ($ESP/efi/fedora).

Link to original boot loader specification:

https://systemd.io/BOOT_LOADER_SPECIFICATION#technical-details

Comment 1 Peter Jones 2019-05-03 17:05:14 UTC
We don't support mounting the ESP as /boot, and we're not planning on supporting doing so.

Comment 2 Gregory Lee Bartholomew 2019-05-03 17:25:05 UTC
So how is that going to work when BLS becomes more standardized and the UEFI firmware in PCs start reading the loader/entries files and kernels directly? I believe this *should* be supported. It is the original idea behind the BLS concept -- one common boot/esp for all the OSs to share. Really, the kernel arguments should be in the loader/entries files, not grubenv.