All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: BAREBOX <barebox@lists.infradead.org>
Subject: Re: [PATCH 2/2] bootm: add generic android image handler
Date: Wed, 21 Jan 2026 09:09:37 +0100	[thread overview]
Message-ID: <aXCJwR366e11cIMM@pengutronix.de> (raw)
In-Reply-To: <758e79dc-56df-491c-919f-906cdb91c56c@pengutronix.de>

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.

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

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	other threads:[~2026-01-21  8:10 UTC|newest]

Thread overview: 7+ 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
2026-01-21  8:09     ` Sascha Hauer [this message]
2026-01-21  9:13       ` Ahmad Fatoum
2026-01-23  8:06 ` [PATCH 0/2] Android image support Sascha Hauer

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=aXCJwR366e11cIMM@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.