[PATCH v2 1/2] cmd: source: Use script from default config

Sven Schwermer sven at svenschwermer.de
Sat Jan 22 21:36:58 CET 2022


Hi Tom,

I didn't think this would result in a size increase. Could you elaborate?

When generating FIT images with Yocto, you won't get a /images/default 
property which is inconsistent with the FIT spec. This is an example of 
how Yocto spits out FIT images which I believe is consistent with the spec:

/dts-v1/;
// magic:		0xd00dfeed
// totalsize:		0x17a334 (1549108)
// off_dt_struct:	0x38
// off_dt_strings:	0x179f64
// off_mem_rsvmap:	0x28
// version:		17
// last_comp_version:	16
// boot_cpuid_phys:	0x0
// size_dt_strings:	0x74
// size_dt_struct:	0x179f2c

/ {
     timestamp = <0x61a42a3c>;
     description = "Kernel fitImage for Poky (Yocto Project Reference 
Distro)/5.14.21+gitAUTOINC+4f4ad2c808_9d5572038e/mys-6ulx";
     #address-cells = <0x00000001>;
     images {
         kernel-1 {
             description = "Linux kernel";
             data = ...
             type = "kernel";
             arch = "arm";
             os = "linux";
             compression = "none";
             load = <0x82000000>;
             entry = <0x82000000>;
             hash-1 {
                 value = <0x582363ee 0x6f47a5c6 0xd55b5ae8 0xaf9d6057 
0xc5f4281b 0x2ee22850 0x859691cd 0xdb09e38d>;
                 algo = "sha256";
             };
         };
         fdt-imx6ull-myir-mys-6ulx-eval.dtb {
             description = "Flattened Device Tree blob";
             data = ...
             type = "flat_dt";
             arch = "arm";
             compression = "none";
             hash-1 {
                 value = <0x5e8b26d4 0xda4bf28c 0x8683bd81 0xaa5fce3c 
0x15cf569a 0xb6c66ccf 0xe65f56e1 0x38392bfb>;
                 algo = "sha256";
             };
         };
         bootscr-boot.sh {
             description = "U-boot script";
             data = ...
             type = "script";
             arch = "arm";
             compression = "none";
             hash-1 {
                 value = <0xf5b7edab 0x6567bce5 0x349c3f10 0xbab82b14 
0x062a25e3 0x1dd37bdd 0x83dc2744 0x3326d252>;
                 algo = "sha256";
             };
         };
     };
     configurations {
         default = "conf-imx6ull-myir-mys-6ulx-eval.dtb";
         conf-imx6ull-myir-mys-6ulx-eval.dtb {
             description = "1 Linux kernel, FDT blob, u-boot script";
             kernel = "kernel-1";
             fdt = "fdt-imx6ull-myir-mys-6ulx-eval.dtb";
             bootscr = "bootscr-boot.sh";
             hash-1 {
                 algo = "sha256";
             };
         };
     };
};

Best regards,
Sven

On 1/18/22 14:29, Tom Rini wrote:
> On Sat, Jan 01, 2022 at 07:45:39PM +0100, Sven Schwermer wrote:
> 
>> When sourcing FIT images, source the script node from the "bootscr"
>> property within the default configuration. If
>> board_fit_config_name_match is overridden, this will determine the
>> selected configuration rather than the default one.
>>
>> The old behaviour is inconsistent with the FIT image specification which
>> does not mention a "default" property in the "/images" node.
>>
>> Signed-off-by: Sven Schwermer <sven at svenschwermer.de>
> 
> This ends up being a noticeable size growth on a large number of
> platforms.  Can you please elaborate on the use case here, with some
> links to the OE layers in question that generate these images?  Thanks!
> 


More information about the U-Boot mailing list