Hi Sascha,

On 1/21/26 09:09, Sascha Hauer wrote:
> On Tue, Jan 20, 2026 at 04:04:37PM +0100, Ahmad Fatoum wrote:
>> Hello Sascha,
>>
>> On 1/20/26 3:55 PM, Sascha Hauer wrote:
>>> +   if (kernel)
>>> +           bootm_data.os_file = kernel;
>>> +
>>> +   if (initrd)
>>> +           bootm_data.initrd_file = initrd;
>>> +
>>> +   close(fd);
>>> +
>>> +   ret = bootm_boot(&bootm_data);
>>
>> Two quick comments:
>>
>> I think this feature will not be usable when
>> CONFIG_BOOTM_OFTREE_FALLBACK is disabled, which is a shame, because I
>> think normal deployments should disable that option to avoid unexpected
>> fallback behavior.
>>
>> Here the fallback is expected though. Would it be possible to change
>> this, so the barebox oftree is passed along explicitly to avoid falling
>> into the fallback?
> 
> When a user chooses to disable CONFIG_BOOTM_OFTREE_FALLBACK to avoid
> using the internal device tree as a fallback then this decision should
> be universally honoured. Explicitly inserting the internal device tree
> in special cases contradicts this.
> 
> Note that I have used this feature with a FIT image which carries its
> own device tree, so I wasn't affected.
> 
> We currently only support version 1 of the Android image format. Since
> version 2 the image can also embed a device tree which can be passed
> with the --dtb option to the fastboot command, so the solution to
> address your concerns should be adding support for version 2.
> 
> I would consider this a future enhancement though.

Ah, didn't consider that you can just boot FIT images this way.
Then I also think it's ok keeping it as-is.

>> On a related note, this will probably trigger a warning on every boot if
>> the barebox device tree has a state node. Maybe we could mark dupes of
>> the barebox device tree as such (maybe set device_node::dev to a special
>> value?!), so we can skip the warning?
> 
> You mean this warning?
> 
> dev_warn(&state->dev, "Warning: Kernel devicetree contains state node, 
> replacing it\n");
> 
> We could mark it as duplicate as you suggested. Another possibility
> would be to delete state nodes while duplicating the internal device tree.

Oh, I like the second suggestion, thanks.

Cheers,
Ahmad

> 
> Sascha
> 
> 


-- 
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 |

Reply via email to