From patchwork Mon Aug 1 16:06:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 1662658 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LxNKq39bnz9sGV for ; Tue, 2 Aug 2022 02:06:55 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 91C6D844D6; Mon, 1 Aug 2022 18:06:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 64D72844B6; Mon, 1 Aug 2022 18:06:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 205EB84007 for ; Mon, 1 Aug 2022 18:06:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=foss+uboot@0leil.net Received: (Authenticated sender: foss@0leil.net) by mail.gandi.net (Postfix) with ESMTPSA id 51D9BC0003; Mon, 1 Aug 2022 16:06:28 +0000 (UTC) From: Quentin Schulz To: 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 Subject: [PATCH v3 2/8] binman: allow user-defined filenames for mkimage entry Date: Mon, 1 Aug 2022 18:06:04 +0200 Message-Id: <20220801160610.2330151-3-foss+uboot@0leil.net> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220801160610.2330151-1-foss+uboot@0leil.net> References: <20220801160610.2330151-1-foss+uboot@0leil.net> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean From: Quentin Schulz 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 Signed-off-by: Quentin Schulz --- 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))