[PATCH 8/8 v2] doc: uefi: Add instruction for initrd loading

Heinrich Schuchardt xypron.glpk at gmx.de
Wed Dec 30 21:17:23 CET 2020


On 12/30/20 4:07 PM, Ilias Apalodimas wrote:
> Add a description of the EFI variables needed to match a Boot####
> entry with an initrd.
>
> Signed-off-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> ---
>   doc/uefi/uefi.rst | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
>
> diff --git a/doc/uefi/uefi.rst b/doc/uefi/uefi.rst
> index dc930d924022..d8b083ffa708 100644
> --- a/doc/uefi/uefi.rst
> +++ b/doc/uefi/uefi.rst
> @@ -229,6 +229,21 @@ UEFI variables. Booting according to these variables is possible via::
>   As of U-Boot v2020.10 UEFI variables cannot be set at runtime. The U-Boot
>   command 'efidebug' can be used to set the variables.
>
> +Initrd with the boot manager
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +Kernel versions >= 5.6 can use EFI_LOAD_FILE2_PROTOCOL to load an initramfs.

%s/can use EFI_LOAD_FILE2_PROTOCOL/can use the Load File 2 protocol/

> +When U-Boot is configured with CONFIG_EFI_LOAD_FILE2_INITRD=y the boot manager
> +will install the protocol, if an EFI variable matching the BootCurrent value
> +is found and contains a valid file path. The EFI variable name is 'Initrd####'

When booting via the UEFI boot manager (command 'bootefi bootmgr')
BootNext and BootOrder are used to identify a boot option to boot. The
variable BootCurrent is set to the hexadecimal number of the selected
boot option, e.g. to 0x001E if the image specified by Boot001E is selected.

When U-Boot is configured with CONFIG_EFI_LOAD_FILE2_INITRD=y the boot
manager will install the Load File 2 protocol if an EFI variable
Initrd#### (e.g. Initrd001E) is found where #### matches the value of
BootCurrent and Initrd#### contains a valid file path.

> +and the file path format is '<device> <partition> <filename>'.

The fist string is not a device but a class of devices.
The third string is not a filename but a file path.

<interface> <device>[:<partition>] <filepath>.

partition defaults to 0 (whole disk).

The user should be taught that the value of Initrd#### is a UTF8 string.

An example string should be provided.

> +
> +This allows users to pair a kernel with a specific initramfs.
> +
> +Example:
> +Boot0010 will search for Initrd0010 and try to install the protocol with
> +the file path specified in Initrd0010.

"When booting Boot001E U-Boot tries to install the Load File 2 protocol
with the file specified by Initrd001E. If the intird is not found it
will continue without init.

What happens if Initrd#### does not point to a valid file? Shouldn't we
then skip the boot option and continue with the next boot option?

Please, show how to set Initrd0010 from the console, e.g.

setenv -e -nv -bs -rt Initrd001E 'scsi 0:1 initrd'

Best regards

Heinrich

> +
>   Executing the built in hello world application
>   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>



More information about the U-Boot mailing list