On 2/19/21 10:58 PM, Ilias Apalodimas wrote:
Hi Grant,
On Fri, Feb 19, 2021 at 05:28:59PM +0000, Grant Likely wrote:
On 18/02/2021 11:15, Heinrich Schuchardt wrote:
[...]
1. Prepend a VenMedia Device Path in every initrd Device Path. In that case
FilePathList[] would look like this:
Loaded Image device path - end node - VenMedia - Initrd DP - end node
- VenMedia - Initrd DP - end node - repeat
2. Prepend a VenMedia Device Path once. In that case FilePathList[] would look
like this:
Loaded Image device path - end node - VenMedia - Initrd DP - end
instance - (repeat) - Initrd DP - end node - other DPs
In this case we could use the VenMedia Vendor Defined Data to indicate
the number
of device paths that follow, although it's redundant, since each instance would
terminate on the Device Path End Structure.
3. Use Vendor Defined Data of the VenMedia device path and copy the initrd
device path(s) in there. In that case the Vendor Defined Data will it self
be in a device path format with all the initrds we want.
Loaded Image device path - end node - VenMedia - end node - other DPs
When passing the device path of the boot option to the EDK2
implementation of
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL.ConvertDevicePathToText(), it will
print out all array elements as comma separated list like
HD(1,GPT,..,0x2000,0x200000)/File(\EFI\debian\shimaa64.efi),/VenMedia(00000001-0000-0000-0000-000000000000)/HD(2,GPT,..,0x2000,0x200000)/File(\initrd1),/VenMedia(00000001-0000-0000-0000-000000000000)/HD(2,GPT,..,0x2000,0x200000)/File(\initrd2)
>
The device path end nodes of sub-type 0x01 are rendered as commas.
With 1 and 2 this would show a readable output like above.
With 3 you will just see a hex-string.
This excludes 3 for me.
If 2 does not add the number of initrds, it cannot be determined if a
following array element starting with a VenMedia() node is an initrd or
has a completely different meaning.
With 1 you can individually determine for each element its meaning by
looking at the first node.
Attempting to paraphrase; does this mean the VenMedia component would be
used to identify the file type? i.e., use one GUID for initrd, and
another for DTB? Or is that worked out another way?
Yea exactly (in all 3 implementations). The difference in the 3 different
proposals is how to interpret that VenMedia device path to identify all the
device paths that refer to that specific GUID.
Regards
/Ilias
The UEFI spec knows two types of separators for device paths. Both have
type 0x7F (End of Hardware Device Path) but differ by the sub-type:
Sub-Type 0xff – End Entire Device Path
Sub-Type 0x01 – End Instance of a Device Path
Field EFI_LOAD_OPTION.FilePathList[] is described in the UEFI spec as
follows:
"A packed array of UEFI device paths. The first element of the array is
a device path that describes the device and location of the Image for
this load option."
It is not immediately clear if the separators between the array elements
are of sub-type 0xff or 0x01. The description in the UEFI spec should be
reworked for more clarity.
The current EDK II coding requires that the device path identifying the
UEFI binary (i.e. FilePathList[0] is terminated by a sub-type 0xff end node.
The UEFI variable ConDev is decribed as "The device path of all possible
console input devices". The spec does not refer to it as an array of
device paths.
So it seems that the UEFI spec editors mean by array of device paths
that an element of the array is separated by sub-type 0xff. Each
individual array element may be a collection of device paths instances
separated by 0x01 sub-type end nodes.
In the device path spec a sentence could be added as follows:
"A packed array of UEFI device paths. The first element of the array is
a device path that describes the device and location of the Image for
this load option.
*Each array element is terminated by a sub-type 0xff, End Entire Device
Path node.*"
Adding initrd or device tree device paths could be implemented as follows:
Array element [0]:
device path of the binary (e.g. the Linux kernel) terminated by 0xff.
Array element [i], i > 0:
device paths of the different initial RAM disks separated by 0x01
instance end nodes and terminated by an 0xff entire path node.
To identify the device paths with all its instances as initrds we can
prepend a VenMedia() device path node with a specific GUID to the entire
path.
Array element [j], j > 0:
device path of the device-tree possibly followed by instances of device
paths of device-tree overlays separated by 0x01 instance end nodes and
terminated by an 0xff entire path node.
To identify the device paths with all its instances as device trees and
device tree overlays we can prepend a VenMedia() device path node with a
specific GUID to the entire path.
Best regards
Heinrich
_______________________________________________
boot-architecture mailing list
boot-architecture@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/boot-architecture