[PATCH v2 00/41] Initial implementation of standard boot
Mark Kettenis
mark.kettenis at xs4all.nl
Thu Oct 28 23:40:34 CEST 2021
> Date: Thu, 28 Oct 2021 13:47:21 -0400
> From: Tom Rini <trini at konsulko.com>
>
> On Thu, Oct 28, 2021 at 06:37:42PM +0100, Peter Robinson wrote:
> > On Wed, Oct 27, 2021 at 3:11 PM Simon Glass <sjg at chromium.org> wrote:
> > >
> > > Hi Heinrich,
> > >
> > > On Wed, 27 Oct 2021 at 05:38, Heinrich Schuchardt
> > > <heinrich.schuchardt at canonical.com> wrote:
> > > >
> > > >
> > > >
> > > > On 10/24/21 01:25, Simon Glass wrote:
> > > > >
> > > > > The bootflow feature provide a built-in way for U-Boot to automatically
> > > > > boot an Operating System without custom scripting and other customisation.
> > > > > This is called 'standard boot' since it provides a standard way for
> > > > > U-Boot to boot a distro, without scripting.
> > > > >
> > > > > It introduces the following concepts:
> > > > >
> > > > > - bootdev - a device which can hold a distro
> > > > > - bootmeth - a method to scan a bootdev to find bootflows (owned by
> > > > > U-Boot)
> > > > > - bootflow - a description of how to boot (owned by the distro)
> > > >
> > > > Please, describe why you are suggesting this change.
> > > >
> > > > Replacing a script by a devicetree chunk is just decreasing flexibility
> > > > and increasing complexity. Where is the benefit?
> > > >
> > > > I am missing a description here of where and how a boot flow shall be
> > > > defined. Describing some device-tree binding in patch 40/41 does not
> > > > replace describing the development and usage workflow. Who will provide
> > > > which bootflow information when?
> > > >
> > > > You still have an open discussion with Linaro about the source of
> > > > devicetrees. This discussion needs to be finalized before considering
> > > > this series.
> > > >
> > > > In my view bootflows cannot be defined in the devicetree because prior
> > > > firmware providing a devicetree is completely independent of any distro
> > > > and therefore cannot provide a distro specific bootflow.
> > >
> > > There is actually no need to use devicetree here. I think you might
> > > have the wrong end of the stick. It is certainly possible to add nodes
> > > to configure things, if needed, but it works find without any changes
> > > to the devicetree, as you can see from the rpi_3 patch.
> > >
> > > There are several aims with this effort:
> > >
> > > - Provide a standard way to boot anything on U-Boot, that everyone can
> > > plug into (distros, board vendors, people using a custom flow)
> >
> > I as a distro maintainer don't want this, we already get the "standard
> > way to boot" from UEFI, this just feels like another unnecessary
> > abstraction to that.
>
> Right. But part of the problem is "How do I find UEFI". Something
> somewhere needs to be configurable to say where to look, yes?
Before we had "bootefi bootmgr", this was done using "setenv
boot_targets ...", where you would specify a list of devices to try
and boot from. This is effectively a command line version of the menu
that most x86 BIOS (and UEFI) implementations offer to specify the
order of devices to boot from. We document this in the OpenBSD/arm64
installtion instructions and it wouldn't surprise me of some of the
Linux distro's do this as well. This still works fine, unless you set
the UEFI variables that "bootefi bootmgr" looks at. But I fear
Simon's patch series breaks this. I didn't try the patch series yet
though, so I might be mistaken.
When "bootefi bootmgr" is used, the device/OS to boot is specified by
the Boot#### and BootOrder UEFI variables. I believe these can be set
from the U-Boot command line, but doing so in the right way isn't
trivial. The way this is supposed to work I think is that the OS
installer defines an appropriate Boot#### variable and adds it to tje
BootOrder variable. But that pretty much relies on on the ability to
set those variables at OS runtime using EFI runtime services. And as
was pointed out that doesn't really work for most U-Boot targets. To
be honest, I don't really understand how "bootefi bootmgr" is used in
the real world right now.
There is a lot of good work done in this area in U-Boot. But I get
the feeling that too much of it is driven by meeting requirements of
specs and that there is too little thought put into the practicalities
of actually booting a general purpose OS (e.g. a mainstrain Linux
distro) on a board with U-Boot support.
More information about the U-Boot
mailing list