Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Cc: Xuanhao Shi <X15000177@gmail.com>, Anand Gadiyar <gadiyar@ti.com>,
	michael@amarulasolutions.com, linux-amarula@amarulasolutions.com,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [RFC PATCH 1/2] support/scripts/genimage.sh: support creating a bmap image
Date: Mon, 15 Jul 2024 16:05:55 +0200	[thread overview]
Message-ID: <20240715160555.6e88961e@windsurf> (raw)
In-Reply-To: <20240421095353.208034-2-dario.binacchi@amarulasolutions.com>

Hello Dario,

On Sun, 21 Apr 2024 11:53:52 +0200
Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote:

> The patch adds an option to create, in addition to the usual image, an
> image of type bmap that drastically reduces the amount of data that
> needs to be written to an SD card, resulting in time savings.
> 
> This makes it possible to activate this option easily and maintain
> backward compatibility for all configurations already using the genimage
> tool for creating the image to be written to the SD card:
> 
> BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT_ARGS="-c board/<manufacturer>/<boardname>/genimage.cfg -b"
> +BR2_PACKAGE_HOST_BMAP_TOOLS=y
> 
> It follows that the script now assumes a broader functionality that
> extends beyond just being an interface for the genimage tool.
> 
> An alternative implementation could have been to create another script,
> such as support/scripts/bmap.sh, capable of creating the bmap image
> using the same parameters passed to support/scripts/genimage.sh (i. e.
> -c board/<manufacturer>/<boardname>/genimage.cfg). However, in this case,
> the script would also need to know that the image is located in the
> ${BINARIES} directory. This could be achieved by adding an additional
> parameter, but it might cause genimage.sh to fail due to an unrecognized
> parameter.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

We took advantage of the on-going Buildroot hackathon to discuss live,
and we pushed your patch, but with some changes:

(1) We don't add an option to script, but rather we look in the
Buildroot .config file is host-bmap-tools has been enabled. If it is
enabled, we assume the user wants bmap images

(2) We generate bmap images for all images, as long as they exist in
$(BINARIES_DIR). Indeed your trick of counting how many times the name
of the image was referenced in the genimage.cfg to try to guess what is
the "final" image (like sdcard.img) would fail badly if the final image
was:

image a {

}

because the image name "a" is probably found more than once in the
genimage.cfg.

However, with that, we are not going to apply your PATCH 2/2, because
we don't want to force everyone to build host-bmap-tools. Now everyone
only has to enable BR2_PACKAGE_HOST_BMAP_TOOLS=y in their configuration
to automagically get bmap-capable images generated. Perhaps what should
be done now is to document this somewhere in the manual. The question
is of course where to document it, and on that I'm not sure.

Note: it might be relevant to also adjust the filesystem generation
code in fs/common.mk to also generate a bmap-capable image of the
rootfs image itself, also based on the availability of host-bmap-tools.

Thanks for your work!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2024-07-15 14:06 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-21  9:53 [Buildroot] [RFC PATCH 0/2] Add support to genimage.sh for creating a bmap image Dario Binacchi
2024-04-21  9:53 ` [Buildroot] [RFC PATCH 1/2] support/scripts/genimage.sh: support " Dario Binacchi
2024-04-23 11:33   ` Gero Schwäricke via buildroot
2024-04-23 12:55     ` Quentin Schulz via buildroot
2024-04-24  7:50       ` Gero Schwäricke via buildroot
2024-04-24  8:06     ` Gero Schwäricke via buildroot
2024-05-10 19:54   ` Thomas Petazzoni via buildroot
2024-05-10 20:17     ` Michael Nazzareno Trimarchi
2024-05-21  5:25       ` Yann E. MORIN
2024-05-21  9:28         ` Michael Nazzareno Trimarchi
2024-05-21 17:44           ` Yann E. MORIN
2024-05-22 15:19             ` Gero Schwäricke via buildroot
2024-05-31  9:47             ` Thomas Petazzoni via buildroot
2024-05-31  9:44         ` Thomas Petazzoni via buildroot
2024-05-20  8:05     ` Dario Binacchi
2024-05-20  9:23       ` Thomas Petazzoni via buildroot
2024-05-21 15:06         ` Dario Binacchi
2024-05-21 20:36         ` Yann E. MORIN
2024-05-22 15:59           ` Gero Schwäricke via buildroot
2024-07-15 14:05   ` Thomas Petazzoni via buildroot [this message]
2024-07-15 14:23     ` Arnout Vandecappelle via buildroot
2024-07-15 14:27       ` Thomas Petazzoni via buildroot
2024-07-16  6:16         ` Dario Binacchi
2024-08-27 18:55     ` Peter Korsgaard
2024-08-28 13:42       ` Thomas Petazzoni via buildroot
2024-08-28 13:58         ` Peter Korsgaard
2024-08-29 21:44           ` Thomas Petazzoni via buildroot
2024-08-30  7:14             ` Peter Korsgaard
2024-08-30 15:29               ` Thomas Petazzoni via buildroot
2024-08-30 15:32                 ` Michael Nazzareno Trimarchi
2024-08-31 13:28                   ` Peter Korsgaard
2024-08-31 13:20                 ` Peter Korsgaard
2024-04-21  9:53 ` [Buildroot] [RFC PATCH 2/2] configs/ti_am62x_sk_defconfig: create the " Dario Binacchi

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=20240715160555.6e88961e@windsurf \
    --to=buildroot@buildroot.org \
    --cc=X15000177@gmail.com \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=gadiyar@ti.com \
    --cc=linux-amarula@amarulasolutions.com \
    --cc=michael@amarulasolutions.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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