[PATCH 0/7] efi: Various tidy-ups and drop the default

Heinrich Schuchardt xypron.glpk at gmx.de
Mon Jun 28 16:25:15 CEST 2021


On 6/28/21 3:37 PM, Tom Rini wrote:
> On Mon, Jun 28, 2021 at 10:38:50AM +0200, Mark Kettenis wrote:
>>> From: Simon Glass <sjg at chromium.org>
>>> Date: Sun, 27 Jun 2021 19:48:34 -0600
>>>
>>> It has come to light that EFI_LOADER adds an extraordinary amount of
>>> code to U-Boot. For example, with nokia_rx51 the size delta is about
>>> 90KB. About 170 boards explicitly disable the option, but is is clear
>>> that many more could, thus saving image size and boot time.
>>
>> EFI_LOADER used to be a lot smaller.  It is great to see that over the
>> years UEFI support has become more complete, but a lot of that new
>> code implements features that are not at all essential for just
>> booting an OS from storage.  If that growth leads to the suggestion to
>> disable EFI_LOADER completely by default, we're putting the cart
>> before the horse.
>
> Well, I see I forgot to prefix my patch with RFC, but I hadn't found
> EFI_LOADER being used in the wild on armv7, but wasn't sure about the
> BSD families.  I did see that Debian doesn't use it, and that Armbian
> doesn't even use it on aarch64.

Debian and Ubuntu both offer booting via UEFI and GRUB on armv7 (see
https://packages.ubuntu.com/hirsute/grub-efi-arm). You could use package
flash-kernel instead if you wanted to avoid UEFI. It is just a question
of how you decide to install your system. If you want the installer to
automatically install GRUB, you must invoke it via UEFI.

Armbian uses the Debian repos. That lets you boot Armbian using UEFI and
GRUB if you want to.

SUSE is another distro relying on UEFI and GRUB.

>
>>> The current situation is affecting U-Boot's image as a svelt bootloader.
>>
>> Really?  I know UEFI has a bad reputation in the Open Source world,
>> and some of its Microsoft-isms are really annoying (yay UCS-2).  But
>> it works, it provides a standardized approach across several platforms
>> (ARMv7, AMRv8, RISC-V) and the industry seems to like it.  Personally
>> I'd wish the industry had standardized on Open Firmware instead, but
>> that ship sailed a long time ago...
>>
>> I find it hard to imagine that 90k is a serious amount of storage for
>> something that is going to include a multi-MB Linux kernel.  This
>> isn't code that lives in SPL or TPL where severe size restrictions
>> apply.
>
> In one of those cases where I need to pop back in to the other (Nokia
> N900 specific) thread and see if the big size reduction really was just
> disabling EFI_LOADER, it's perhaps just one of those "fun" things about
> Kconfig and anything other than "make oldconfig" for spotting new config
> options that default to enabled.
>
>>> EFI_LOADER is required by EBBR, a new boot standard which aims to
>>> bring in UEFI protocols to U-Boot. But EBRR is not required for
>>> booting. U-Boot already provides support for FIT, the 'bootm' command
>>> and a suitable hand-off to Linux. EBRR has made the decision to create
>>> a parallel infrastructure, e.g. does not use FIT, nor U-Boot's signing
>>> infrastructure.
>>
>> EFI_LOADER is required to boot FreeBSD and OpenBSD on several
>> platforms as well as generic Linux distros.  For example
>> OpenBSD/armv7, OpenBSD/arm64 and OpenBSD/riscv64 all rely on
>> EFI_LOADER to boot and have done so for the last 4 years.  The fact
>> that ARM has embraced UEFI as an embedded boot standard and branded it
>> EBBR really isn't all that relevant.
>
> To be clear here, I like EFI_LOADER.  I too do wish some other
> technologies had become dominant for technical rather than inertia
> reasons, but here we are.  Having played around with it on aarch64,
> there are some pretty nice comes-along-with parts to it.
>
> What I hadn't seen, and am only a little skeptical of still, is how far
> backwards in generations it's going to be used on.  The general wish is
> that users nor off the shelf OS groups need to rebuild U-Boot for a
> given board, and instead it just works.  The number of new designs for
> 32bit parts is no where near the number of new designs for 64bit parts.
> So what we're seeing in U-Boot now is people updating support on their
> older designs, and not necessarily caring about using EFI_LOADER.
>

The question is not how old your board is. My i.MX6 Wandboard (bought
2013) and my Allwinner A20 Banana Pi (bought 2014) both run fine with
UEFI and GRUB on Debian. The major divide is between systems running a
distribution and IoT devices where you build your image via Yocto,
OpenWRT, or the like.

Best regards

Heinrich



More information about the U-Boot mailing list