Re: [PATCH v9 2/2] arm64: boot: Support Flat Image Tree

Ahmad Fatoum
2024-01-02T15:53:26Z

Hello Yamada-san,

On 14.12.23 08:33, Masahiro Yamada wrote:
>> The FIT spec allows the "fdt" property to list
>> multiple image nodes.
>>
>>
>> o config-1
>> |- description = "configuration description"
>> |- kernel = "kernel sub-node unit name"
>> |- fdt = "fdt sub-node unit-name" [, "fdt overlay sub-node unit-name", ...]
>> |- loadables = "loadables sub-node unit-name"
>> |- script = "
>> |- compatible = "vendor
>
>
>
>
>
> This is a question for U-Boot (and barebox).
>
>
>
>
> images {
> base {
> ...
> };
>
> addon1 {
> ...
> };
>
> addon2 {
> ...
> };
> };
>
> configurations {
> ...
> fdt = "base", "addon1", "addon2";
> };
>
>
>
>
> Is U-Boot's "bootm" command able to dynamically construct
> the full DTB from "base" + "addon1" + "addon2"
> and pass to the kernel?

barebox can apply overlays to the DT, but doesn't do so yet from
the extra entries in configuration fdt properties.

This should be straight-forward to add though, if the need arises.

> Is U-Boot able to handle FIT (includes kernel + DTs)
> and a separate initrd?
>
> # bootm <fit-address>:<conf-name> <ramdisk-address>

This is possible in barebox, provided that the FIT image doesn't
already have a ramdisk and that CONFIG_BOOTM_FORCE_SIGNED_IMAGES=n:

bootm -r /mnt/nfs/ramdisk.gz /mnt/nfs/image.fit

(Or the equivalent variables if not wanting to use the shell.)

> Presumably, it would be difficult to inject initramdisk
> into image.fit later, so I am hoping bootm would work like that,
> but I did not delve into U-Boot code.
>
>
>
> If it works, is it possible to verify the integrity of initrd?
> The kernel and DTs inside FIT will be verified, but not sure
> if it is possible for ramdisk.

If one wants to preclude mix & match attacks, the configuration needs
to be verified fully, so if signing is required, it's probably better to
amend the FIT later on with the new configuration instead of signing
the initrd separately and combining them at runtime.

Cheers,
Ahmad

>
>
>
>
>

--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |