[PATCH 1/4] mkimage: also honour -B even without external data
Rasmus Villemoes
rasmus.villemoes at prevas.dk
Mon Sep 25 10:47:17 CEST 2023
On 22/09/2023 17.26, Simon Glass wrote:
>>> Shouldn't this be fdt_open_into()?
>>
>> I honestly just copy-pasted fit_extract_data() and shaved it down to the
>> part that does the "align the FDT part of the file".
>>
>> I don't really understand your question. Are you saying this doesn't
>> work (or maybe doesn't work in some cases), or are you saying that
>> there's a simpler way to do this? For the latter, sure, one doesn't
>> really need to parse the whole FDT; we could just
>>
>> open()
>> pread() length from FDT header, convert to cpu-endianness
>> length = ALIGN(length)
>> pwrite() the new length in fdt-endianness
>> ftruncate()
>> close()
>>
>> but I thought it was better to stay closer to how fit_extract_data() was
>> done.
>
> I mean that fdt_open_into() does more than just set the size (from
> what I can tell). But looking further I see other code which calls
> fdt_set_totalsize() so perhaps it is fine.
Yes, I think it's as it should be - as a I said, this is really just a
trimmed-down copy of the function which moves the data externally, and
also needs to make the size of the base fdt structure aligned.
Since patches 2,3,4 touch binman code, could you take all four?
Thanks,
Rasmus
More information about the U-Boot
mailing list