From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
BAREBOX <barebox@lists.infradead.org>
Subject: Re: [PATCH 2/2] bootm: add generic android image handler
Date: Tue, 20 Jan 2026 16:04:37 +0100 [thread overview]
Message-ID: <758e79dc-56df-491c-919f-906cdb91c56c@pengutronix.de> (raw)
In-Reply-To: <20260120-android-image-v1-2-820595a1b8a4@pengutronix.de>
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 |
next prev parent reply other threads:[~2026-01-20 15:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 14:55 [PATCH 0/2] Android image support Sascha Hauer
2026-01-20 14:55 ` [PATCH 1/2] libfile: copy_fd: add size argument Sascha Hauer
2026-01-20 14:55 ` [PATCH 2/2] bootm: add generic android image handler Sascha Hauer
2026-01-20 15:04 ` Ahmad Fatoum [this message]
2026-01-21 8:09 ` Sascha Hauer
2026-01-21 9:13 ` Ahmad Fatoum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=758e79dc-56df-491c-919f-906cdb91c56c@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox