All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <foss+uboot@0leil.net>
Cc: bharat.gooty@broadcom.com, rayagonda.kokatanur@broadcom.com,
	sjg@chromium.org, philipp.tomsich@vrull.eu,
	kever.yang@rock-chips.com, jagan@amarulasolutions.com,
	alpernebiyasak@gmail.com, xypron.glpk@gmx.de,
	heiko.thiery@gmail.com, u-boot@lists.denx.de,
	Quentin Schulz <quentin.schulz@theobroma-systems.com>,
	Quentin Schulz <foss+uboot@0leil.net>
Subject: [PATCH v3 2/8] binman: allow user-defined filenames for mkimage entry
Date: Mon,  1 Aug 2022 18:06:04 +0200	[thread overview]
Message-ID: <20220801160610.2330151-3-foss+uboot@0leil.net> (raw)
In-Reply-To: <20220801160610.2330151-1-foss+uboot@0leil.net>

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

mkimage entry currently creates a file whose name is derived from the
section name containing said entry.

Let's allow the user to define a filename for the mkimage-generated
binary by using the 'filename' DT property.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---

added in v3

 tools/binman/etype/mkimage.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py
index 52297c23ea..902c254425 100644
--- a/tools/binman/etype/mkimage.py
+++ b/tools/binman/etype/mkimage.py
@@ -20,11 +20,13 @@ class Entry_mkimage(Entry):
           datafiles to mkimage instead of creating a temporary file the result
           of datafiles concatenation
         - args: Other arguments to pass
+        - filename: filename of output binary generated by mkimage
 
     The data passed to mkimage is collected from subnodes of the mkimage node,
     e.g.::
 
         mkimage {
+            filename = "imximage.bin";
             args = "-n test -T imximage";
 
             u-boot-spl {
@@ -33,7 +35,7 @@ class Entry_mkimage(Entry):
 
     This calls mkimage to create an imximage with u-boot-spl.bin as the input
     file. The output from mkimage then becomes part of the image produced by
-    binman.
+    binman but also is written into imximage.bin file.
 
 	To pass all datafiles untouched to mkimage::
 
@@ -70,6 +72,7 @@ class Entry_mkimage(Entry):
         self._args = fdt_util.GetArgs(self._node, 'args')
         self._multiple_data_files = fdt_util.GetBool(self._node, 'multiple-data-files')
         self._mkimage_entries = OrderedDict()
+        self._filename = fdt_util.GetString(self._node, 'filename')
         self.align_default = None
         self.ReadEntries()
 
@@ -89,7 +92,7 @@ class Entry_mkimage(Entry):
                 self._mkimage_entries.values(), 'mkimage', fake_size)
             if data is None:
                 return False
-        output_fname = tools.get_output_filename('mkimage-out.%s' % uniq)
+        output_fname = tools.get_output_filename(self._filename if self._filename else 'mkimage-out.%s' % uniq)
         if self.mkimage.run_cmd('-d', input_fname, *self._args,
                                 output_fname) is not None:
             self.SetContents(tools.read_file(output_fname))
-- 
2.37.1


  parent reply	other threads:[~2022-08-01 16:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-01 16:06 [PATCH v3 0/8] migrate u-boot-rockchip.bin to binman and generate an image for SPI Quentin Schulz
2022-08-01 16:06 ` [PATCH v3 1/8] binman: add support for skipping file concatenation for mkimage Quentin Schulz
2022-08-01 16:06 ` Quentin Schulz [this message]
2022-08-01 19:13   ` [PATCH v3 2/8] binman: allow user-defined filenames for mkimage entry Simon Glass
2022-08-01 16:06 ` [PATCH v3 3/8] rockchip: remove binman temporary files when cleaning Quentin Schulz
2022-08-01 18:59   ` Johan Jonker
2022-08-01 19:13     ` Simon Glass
2022-08-01 16:06 ` [PATCH v3 4/8] rockchip: generate idbloader.img content for u-boot-rockchip.bin with binman for ARM Quentin Schulz
2022-08-01 19:13   ` Simon Glass
2022-08-01 16:06 ` [PATCH v3 5/8] rockchip: generate u-boot-rockchip.bin with binman for ARM64 boards Quentin Schulz
2022-08-01 19:13   ` Simon Glass
2022-08-01 16:06 ` [PATCH v3 6/8] rockchip: simplify binman image dependencies addition to INPUTS Quentin Schulz
2022-08-01 16:24   ` Quentin Schulz
2022-08-01 16:06 ` [PATCH v3 7/8] rockchip: allow to build SPI images even without HAS_ROM option Quentin Schulz
2022-08-01 16:06 ` [PATCH v3 8/8] rockchip: add u-boot-rockchip-spi.bin image for booting from SPI-NOR flash Quentin Schulz

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=20220801160610.2330151-3-foss+uboot@0leil.net \
    --to=foss+uboot@0leil.net \
    --cc=alpernebiyasak@gmail.com \
    --cc=bharat.gooty@broadcom.com \
    --cc=heiko.thiery@gmail.com \
    --cc=jagan@amarulasolutions.com \
    --cc=kever.yang@rock-chips.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=quentin.schulz@theobroma-systems.com \
    --cc=rayagonda.kokatanur@broadcom.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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 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.