[U-Boot] [PATCH 3/7] cmd: bootimg: Add bootimg command

Sam Protsenko semen.protsenko at linaro.org
Tue Sep 24 18:41:45 UTC 2019


Hi Igor,

On Mon, Sep 23, 2019 at 11:36 PM Igor Opaniuk <igor.opaniuk at gmail.com> wrote:
>
> Hi Simon,
>
> On Fri, Sep 20, 2019 at 8:45 PM Simon Glass <sjg at chromium.org> wrote:
> >
> > Hi,
> >
> > On Thu, 19 Sep 2019 at 12:28, Sam Protsenko <semen.protsenko at linaro.org> wrote:
> > >
> > > This command can be used to extract fields and image payloads from
> > > Android Boot Image. It can be used for example to implement boot flow
> > > where dtb is taken from boot.img (as v2 incorporated dtb inside of
> > > boot.img). Using this command, one can obtain needed dtb file from
> > > boot.img in scripting manner, and then apply needed dtbo's (from "dtbo"
> > > partition) on top of that, providing then the resulting image to bootm
> > > command in order to boot the Android.
> > >
> > > Also right now this command has the sub-command to get an address and
> > > size of recovery dtbo from recovery image. It can be further parsed using
> > > 'dtimg' command and merged into dtb file (for non-A/B devices only, see
> > > [1,2] for details).
> > >
> > > [1] https://source.android.com/devices/bootloader/boot-image-header
> > > [2] https://source.android.com/devices/architecture/dto/partitions
> > >
> > > Signed-off-by: Sam Protsenko <semen.protsenko at linaro.org>
> > > ---
> > >  cmd/Kconfig   |   8 +++
> > >  cmd/Makefile  |   1 +
> > >  cmd/bootimg.c | 177 ++++++++++++++++++++++++++++++++++++++++++++++++++
> > >  3 files changed, 186 insertions(+)
> > >  create mode 100644 cmd/bootimg.c
> >
> >
> > Shouldn't this be a subcommand of avb?
>
> I think there is some misunderstanding here, as avb
> is used only for signature verification/roll-back protection, other
> aspects of booting Android (parsing android boot image) are
> handled by other commands (for instance, bootm).
>
> Howewer, I think (IMHO) that `bootimg` isn't a good choice for the
> command name , which major functionality is manipulating
> dtb/dtbos.
>

Actually, 'bootimg' manipulates only Android boot image, but new
Android Boot Image v2 happen to have DTB field. For DTBO files in
Android we already have 'dtimg' command.

Simon,

This command is not connected with AVB. It's only needed to obtain
Android Boot Image payloads. We can't integrate its functionality in
'bootm' command, because we would need to merge some DTBO files (from
'dtbo' partition) into DTB file obtained from boot image. And bootm
command can't possibly know which DTBO files vendor would like to use
(e.g. different DTBOs for different boards). That's why I came up with
'bootimg' command.

Actually I think that we should think about implementing
'boot_android' next. Because the boot script is becoming quite
cluttered. But we should have those tiny commands anyway, as it's
convenient for development and provides a more flexible way to boot
Android.

I'm having presentation today at Linaro Connect, highlighting new
Android boot scheme. Slides will be available at [1]. The Android boot
flow becomes more and more extensive, so I think it's time to start
discussion between community, Google and vendors w.r.t. this topic.
One point we should bring up is the possibility to use FIT image
instead of bunch of Android images. I hope this is discussable.

But for now I think we should stick to established Android boot
architecture, as it was published at [2] and mandatory for new devices
launching with Android 10.

Thanks!

[1] https://connect.linaro.org/resources/san19/san19-217/
[2] https://source.android.com/devices/bootloader

> >
> > Regards,
> > Simon
>
>
>
> --
> Best regards - Freundliche GrĂ¼sse - Meilleures salutations
>
> Igor Opaniuk
>
> mailto: igor.opaniuk at gmail.com
> skype: igor.opanyuk
> +380 (93) 836 40 67
> http://ua.linkedin.com/in/iopaniuk


More information about the U-Boot mailing list