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?

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? This also bothered me with EFI
boot, which always passes the barebox DT along and leaves it to grub or
whatever to decide whether it wants to use it or if it wants to use
another DT it finds itself.

Thanks!
Ahmad

> +
> +err_close:
> +     close(fd);
> +
> +     if (kernel)
> +             unlink(kernel);
> +     if (initrd)
> +             unlink(initrd);
> +err:
> +     free(hdr);
> +
> +     return ret;
> +}
> +
> +static struct image_handler aimage_bootm_handler = {
> +     .name = "Android boot image",
> +     .bootm = do_bootm_aimage,
> +     .filetype = filetype_aimage,
> +};
> +
> +static int bootm_aimage_register(void)
> +{
> +     return register_image_handler(&aimage_bootm_handler);
> +}
> +late_initcall(bootm_aimage_register);
> 

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