Bug 1101359 - [UEFI] bls_import /loader/entries not found
Summary: [UEFI] bls_import /loader/entries not found
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1299420
TreeView+ depends on / blocked
 
Reported: 2014-05-27 04:03 UTC by Chris Murphy
Modified: 2022-01-14 20:09 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-08 11:47:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Chris Murphy 2014-05-27 04:03:24 UTC
Description of problem: GRUB2 blscfg.mod on UEFI uses the wrong $BOOT, can't find /loader/entries; ostree on UEFI is basically broken.

Version-Release number of selected component (if applicable):
grub2-2.00-25.fc20.x86_64
grub2-2.02-0.3.fc21.x86_64

How reproducible:
Always

Steps to Reproduce:
1. As work around for bug 1100934, and bug 1101352 I regressed to grub2-2.00-25 and used grub2-install so that blscfg.mod is available.
2. bls_import at grub command prompt


Actual results:

error: file '/EFI/fedora/loader/entries' not found.

Expected results:

It should be looking in /boot/loader/entries, not on the ESP. There is no good reason for bootloader configuration files being in different locations between BIOS and UEFI computers. Ostree puts them in /boot/loader/entries in either case.

Additional info:
# cat /etc/fstab

/dev/mapper/fedora-root /                       xfs     defaults        0 0
UUID=dd80a558-bbfb-4dad-a98f-b4942186d0ba /boot                   ext4    defaults        1 2
UUID=A76E-B314          /boot/efi               vfat    umask=0077,shortname=winnt 0 0
/dev/mapper/fedora-home /home                   xfs     defaults        0 0
/dev/mapper/fedora-var  /var                    xfs     defaults        0 0

Comment 1 Chris Murphy 2014-05-27 04:11:40 UTC
The problem is with lines 83-93 in http://pkgs.fedoraproject.org/cgit/grub2.git/tree/0073-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch

+#ifdef GRUB_MACHINE_EFI
+#define GRUB_LINUX_CMD "linuxefi"
+#define GRUB_INITRD_CMD "initrdefi"
+#define GRUB_BLS_CONFIG_PATH "/EFI/fedora/loader/entries/"
+#define GRUB_BOOT_DEVICE "($boot)"
+#else
+#define GRUB_LINUX_CMD "linux"
+#define GRUB_INITRD_CMD "initrd"
+#define GRUB_BLS_CONFIG_PATH "/loader/entries/"
+#define GRUB_BOOT_DEVICE "($root)"
+#endif

Ostree doesn't distinguish between UEFI and BIOS, nor should it. I don't see the merit in having two locations for bootloader configuration files, but even if there is, the sensible thing to do is for bls_import to look in both locations. Only looking for configuration files on the ESP breaks valid workflows that currently work on BIOS (resilient multiple device booting).

Comment 2 Chris Murphy 2014-05-27 18:17:31 UTC
OK no matter what both of these deviate from the BootLoaderSpec. On UEFI /loader is supposed to go at the root of the fs, not in /EFI. And on BIOS, /loader is supposed to go on an 0xEA FAT16/32 formatted $BOOT, not on the typical ext4 /boot. So if we're going to deviate willy nilly from the BLS, I think we should deviate in a simplifying manner by going with one /loader location regardless of the firmware type, and that would be on an ext4 /boot. 

See bug 1100938 for Btrfs. In that case it might be simpler for /loader to be a Btrfs subvolume in the top level of the file system. That way /loader is in the same location regardless of firmware and filesystems.

Comment 3 Colin Walters 2014-05-27 18:34:21 UTC
(In reply to Chris Murphy from comment #2)
> OK no matter what both of these deviate from the BootLoaderSpec. On UEFI
> /loader is supposed to go at the root of the fs, not in /EFI. And on BIOS,
> /loader is supposed to go on an 0xEA FAT16/32 formatted $BOOT, not on the
> typical ext4 /boot. 

For OSTree, /boot can't be FAT because the entire model is atomic updates via swapping a symlink.

See: https://bugzilla.gnome.org/show_bug.cgi?id=724246

I know for EFI I'll need to handle the FAT case, so we could view the current situation as transient - and attempt to converge on /boot being FAT.

> So if we're going to deviate willy nilly from the BLS, I
> think we should deviate in a simplifying manner by going with one /loader
> location regardless of the firmware type, and that would be on an ext4
> /boot. 

Where "ext4" here is a standin for "native Linux fs", or possibly "native Linux fs on LVM", right?

Maybe we need to support the entire matrix, which is UEFI, BIOS + FAT /boot, BIOS + Unix /boot, BIOS + BTRFS subvol /boot.

> See bug 1100938 for Btrfs. In that case it might be simpler for /loader to
> be a Btrfs subvolume in the top level of the file system. That way /loader
> is in the same location regardless of firmware and filesystems.

Hmm...let's discuss that in that bug.

Comment 4 Chris Murphy 2014-05-27 19:08:24 UTC
(In reply to Colin Walters from comment #3)

> I know for EFI I'll need to handle the FAT case, so we could view >the current situation as transient - and attempt to converge on /boot >being FAT.

I'll argue you should instead look at either the bootloader or a single static bootloader configuration file on the ESP, pointing to the actual location for dynamic bootloader configuration files which are not on the ESP; rather than to enhance the bad idea of dynamically changing config files being on the ESP. No other OS does this, and for good reason: fragility, and it breaks a legit workflow that work today on BIOS systems: resilient multiple device booting.

Alternatively a Rube Goldberg method of rsyncing the mounted ESP with the (normally) unmounted ESPs.

I'd rather see all the dynamic configuration files in the same location regardless of firmware. There is a singular argument in favor of configuration files on the ESP, and it merely is to legitimize the world's only bootloader that doesn't understand any file systems, instead relying on what the firmware itself can read.

> Where "ext4" here is a standin for "native Linux fs", or possibly >"native Linux fs on LVM", right?

No I literally mean ext4 since all Linux bootloaders except one can read it. Whereas if you put /boot on ext4 on LVM, only one bootloader supports this, GRUB2, and only if it's conventional LVM LV's, it doesn't yet support thinp LVs, and I don't think it supports multiple device LVs (raid0,1,5,6).

XFS support I think is coming to syslinux or extlinux, I'm not sure where that work is at. Btrfs might be supportable because both GRUB2 and extlinux support it; although only GRUB2 supports multiple devices (btrfs raid0,1,10 and single).


> 
> Maybe we need to support the entire matrix, which is UEFI, BIOS + FAT /boot,
> BIOS + Unix /boot, BIOS + BTRFS subvol /boot.

Or simplify the matrix, and update the BootLoaderSpec to reflect reality, seeing as there's no good reason for this to be so different just because of firmware and file systems. We're already deviating from the spec for good reasons. I think the spec should be changed, rather than neither following it, nor updating it.

Comment 5 Colin Walters 2014-05-27 21:51:24 UTC
(In reply to Chris Murphy from comment #4)
> 
> I'll argue you should instead look at either the bootloader or a single
> static bootloader configuration file on the ESP, pointing to the actual
> location for dynamic bootloader configuration files which are not on the
> ESP; rather than to enhance the bad idea of dynamically changing config
> files being on the ESP. No other OS does this, and for good reason:
> fragility, and it breaks a legit workflow that work today on BIOS systems:
> resilient multiple device booting.

I don't understand your proposal exactly (bear with me due to my limited understanding of EFI) - but when a new kernel appears, I need to update the bootloader configuration for it, right? 

What you're suggesting is basically bridging the UEFI model "backwards" to the BIOS-like world where bootloaders parse filesystems, as I understand it.  I thought a major advantage of UEFI was getting away from this.

I don't have a UEFI machine handy, though I clearly need to get one...

> No I literally mean ext4 since all Linux bootloaders except one can read it.

Ok, I see that argument.  On the other hand, keep in mind RHEL7 will ship with XFS as default for /boot.

> Whereas if you put /boot on ext4 on LVM, only one bootloader supports this,
> GRUB2, and only if it's conventional LVM LV's, it doesn't yet support thinp
> LVs, and I don't think it supports multiple device LVs (raid0,1,5,6).

I think there is a valid use case for having /boot on raid 1, it seems easiest to support as well.  (I'm not an expert in this area though)

> XFS support I think is coming to syslinux or extlinux, I'm not sure where
> that work is at.

extlinux 6.x supports it supposedly.


> Btrfs might be supportable because both GRUB2 and extlinux
> support it; although only GRUB2 supports multiple devices (btrfs raid0,1,10
> and single).
> 
> 
> > 
> > Maybe we need to support the entire matrix, which is UEFI, BIOS + FAT /boot,
> > BIOS + Unix /boot, BIOS + BTRFS subvol /boot.
> 
> Or simplify the matrix, and update the BootLoaderSpec to reflect reality,
> seeing as there's no good reason for this to be so different just because of
> firmware and file systems. We're already deviating from the spec for good
> reasons. I think the spec should be changed, rather than neither following
> it, nor updating it.

Comment 6 Dennis Gilmore 2014-05-28 02:05:57 UTC
all of this discussion is focused on x86, do not forget we need to ensure that we can support many other arches.

Comment 7 Dennis Gilmore 2014-05-28 02:06:40 UTC
(In reply to Dennis Gilmore from comment #6)
> all of this discussion is focused on x86, do not forget we need to ensure
> that we can support many other arches.

that should be that we need to support many other arches.

Comment 8 Chris Murphy 2014-05-28 19:39:39 UTC
(In reply to Colin Walters from comment #5) 
> I don't understand your proposal exactly (bear with me due to my
> limited understanding of EFI) - but when a new kernel appears, I
> need to update the bootloader configuration for it, right? 

Yes. No different than BIOS. And I'm arguing regardless of arch, firmware, and file system used, those conf files should go in one location. At the moment, /boot/loader/entries seems reasonable to me, it's effectively the same location as /boot/grub which has served us reasonably well for what, over a decade? Why move them to the ESP?

> What you're suggesting is basically bridging the UEFI model
> "backwards" to the BIOS-like world where bootloaders parse
> filesystems, as I understand it.

I'm suggesting today we have /boot on ext/xfs/btrfs, and moving /boot to FAT as the BLS proposes is actually moving backwards to 1984. I suggest using the EFI System partition, and FAT, as little as possible.

> I thought a major advantage of UEFI was getting away from this.

I don't know why. Step 1 for the Windows UEFI bootloader is learning to read NTFS, and the rest of the boot process is done from an NTFS volume. Step 0 for Apple was to bake HFS+ support directly in the firmware, so they don't use the EFI System partition for booting at all.

The question is, what's the advantage of /boot on FAT? You have more work to do in order to support that, is what you said in comment 3. 

Because Windows systems come with a 100MB ESP, the BLS mandates the Linux installer create a defacto 2nd ESP, an "Extended Boot Partition" which serves as /boot and is likewise FAT. Imagine explaining this to users. It's more complicated than Windows or OS X booting, for what? Why?

All Fedora supported bootloaders (grub2, yaboot, extlinux) now support at least ext4, if not also xfs and btrfs. Why should that work be discarded on UEFI by mandating /boot on FAT only?


> I don't have a UEFI machine handy, though I clearly need to get one...

*shrug* The same dollar value of Hendricks will have greater efficacy, and far less deletrious effects.


>... RHEL7 will ship with XFS as default for /boot.

Yes, it was a factor in making it default also for Fedora Server. So again, why are we seriously entertaining the BLS when it comes to regressing to /boot on FAT? Change the spec. Or fork it, the conf file format is really the only useful part of it that I can see.


> I think there is a valid use case for having /boot on raid 1,
> it seems easiest to support as well.

I agree there is a valid use case here. On BIOS systems it works today by default, automatically, without user intervention, including degraded boot. Best practices requires a bootloader like GRUB2 that understands mdraid 1.x metadata on the /boot partition. It assembles the array first, and then the /boot file system appears.

However this breaks on Fedora on UEFI because currently we put the dynamic (changing) grub.cfg on the one and only created ESP of a multiple disk install. So it's a single point of failure. The ESP can't be raid1, except hardware raid.

Conversely, a static configuration file installed to each ESP of a multiple disk install, which is then never updated and thus always in sync, would enable this workflow on UEFI systems. The static bootloader files each point to the dynamic configuration files located on /boot on mdraid1 (or btrfs raid1 for that matter), and therefore we have the ability to boot degraded. The BLS is incompatible with this too, not just OSTree.

So we have two valid use cases so far that the BLS is not compatible with. So what's the point of /boot on FAT? And what's the point of /loader/entries going on the ESP?

Comment 9 Chris Murphy 2014-05-29 18:28:17 UTC
The BIOS equivalent is bug 1100938 comment 4.

Comment 10 Jaroslav Reznik 2015-03-03 15:50:46 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 11 Fabian Deutsch 2016-01-08 11:58:56 UTC
The discussion here and in bug 1100938 shows a few distinct issues. For now I'd like to get hands on one of them.

(In reply to Chris Murphy from comment #2)
…
> So if we're going to deviate willy nilly from the BLS, I
> think we should deviate in a simplifying manner by going with one /loader
> location regardless of the firmware type, and that would be on an ext4
> /boot. 

I'm fully for this proposal - let's start with aligning the search paths.
Is there anything blocking us from making this change, and have the same search path for BIOS and EFI?

Currently I don't see a reason which would prevent this change.
We probably do not need to be concerned to much about backwards compatibility, because the EFI search path is quite specific to Fedora - and how many users on Fedora are using EFI with bls?

My goal is to get BLS propperly working with anaconda's autopart logic on BIOS and EFI.

Comment 12 Chris Murphy 2016-01-09 23:02:35 UTC
I'm not thinking of anything that would block this. 

However, it's confusing that upstream bootloaderspec requires FAT, whereas this implementation presumably supports anything the bootloader supports; and it's also confusing that the grub bootloader configuration file will still differ in path grub2/grub.cfg on BIOS and EFI/fedora/grub.cfg on UEFI (bug 1048999).

I don't know why Colin abandoned fixing the GRUB blscfg.module, and instead went with src/boot/grub2-15_ostree and ostree/src/libostree/ostree-bootloader-grub2.c to integrate bls snippets into the grub.cfg.

Comment 13 Colin Walters 2016-01-10 21:59:55 UTC
I think the Anaconda development list would be the best place to discuss high level architecture - then we can return to bugzilla for details.

See https://www.redhat.com/archives/anaconda-devel-list/2014-July/msg00002.html

Comment 14 Jan Kurik 2016-02-24 13:15:18 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 15 Fedora End Of Life 2017-07-25 18:40:18 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 16 Fedora End Of Life 2017-08-08 11:47:03 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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