diff mbox series

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

Message ID 20201230150722.154663-9-ilias.apalodimas@linaro.org
State New
Headers show
Series Change logic of EFI LoadFile2 protocol for initrd loading | expand

Commit Message

Ilias Apalodimas Dec. 30, 2020, 3:07 p.m. UTC
Add a description of the EFI variables needed to match a Boot####
entry with an initrd.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

---
 doc/uefi/uefi.rst | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

-- 
2.30.0

Comments

Heinrich Schuchardt Dec. 30, 2020, 8:17 p.m. UTC | #1
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@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

>   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>

>
diff mbox series

Patch

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.
+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####'
+and the file path format is '<device> <partition> <filename>'.
+
+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.
+
 Executing the built in hello world application
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~