From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D87F8C00144 for ; Mon, 1 Aug 2022 19:15:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 98E3F84516; Mon, 1 Aug 2022 21:14:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="DAmmyAZL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2B3AA84516; Mon, 1 Aug 2022 21:14:25 +0200 (CEST) Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 689D5844BC for ; Mon, 1 Aug 2022 21:14:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-ot1-x333.google.com with SMTP id y10-20020a9d634a000000b006167f7ce0c5so8914781otk.0 for ; Mon, 01 Aug 2022 12:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0QLycOXzcnmvvklkTfGPN3GlhTgECQB20+FZEid8lnY=; b=DAmmyAZLv9crh7BFSk8cnKN/NT5wZ/bZHpAc94ht3AuZ4scQ/HK0wRFVptumL7aBaf +BiPldWODwYKFZ44+JMXScVF4PnaN53pitpK4vsM7ZHk9CT0McY96x28vTtfY8C7ocaI nQpReBkb+JsxxzZ+ZK+q72WQBiSszcYV7752Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0QLycOXzcnmvvklkTfGPN3GlhTgECQB20+FZEid8lnY=; b=jz1ooG7SrrIOsOUyHkzQ0bligG4MZWuNUhq8nOsEyub8xrEpKRiGycVDidkfpaeO0E r6/CbOQQagK/lyRaHkqOd4b8ZpRF82XLO1CTq82aRvBNW5F/f0Bq3DEiZYZaEvbAfn/s 52WBbpJA9u+juhRX9HTB9/XzmCSowIjyiXVn+a90xxxjIS3ER+3NoxYcGPYCVhNR++fC owVFY6SuwXdOjqFAxsZdJ4k0tjQ4zFjLHdAOJAZuseMXTngl/8zI1i3XaFgCa+/IWkxD Wgox1Rqw8fIzd8mnHHraS+J1wUeeySVWabo1wldpNi09P/vVvZw79vZv34SuhzPLAihR 222w== X-Gm-Message-State: AJIora/3YbfJT7Q7nowe152NDj4v0FLMEhD7cDHaHbYuvIApVOx4GU4f oOqaX7UBdm+F381LaWADwP6Z4cZVAT7FKVorxZHWFQ== X-Google-Smtp-Source: AGRyM1s/5QenTOi9yt0kbGiNpQTBZu+1uI9IDlZqGtk0DQ0n+j1aJAb1IHplcOgcEq6fPCW0nFdjci00DDDF5EG4VR0= X-Received: by 2002:a05:6830:1c3:b0:61c:aca3:c57f with SMTP id r3-20020a05683001c300b0061caca3c57fmr6129854ota.269.1659381259482; Mon, 01 Aug 2022 12:14:19 -0700 (PDT) MIME-Version: 1.0 References: <20220801160610.2330151-1-foss+uboot@0leil.net> <20220801160610.2330151-3-foss+uboot@0leil.net> In-Reply-To: <20220801160610.2330151-3-foss+uboot@0leil.net> From: Simon Glass Date: Mon, 1 Aug 2022 13:13:24 -0600 Message-ID: Subject: Re: [PATCH v3 2/8] binman: allow user-defined filenames for mkimage entry To: Quentin Schulz Cc: Bharat Gooty , Rayagonda Kokatanur , Philipp Tomsich , Kever Yang , Jagan Teki , Alper Nebi Yasak , Heinrich Schuchardt , Heiko Thiery , U-Boot Mailing List , Quentin Schulz Content-Type: text/plain; charset="UTF-8" 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 Hi Quentin, On Mon, 1 Aug 2022 at 10:06, Quentin Schulz wrote: > > 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(-) This does need a test (should be able to update the mkimage one). > > 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) Check <80cols? > 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 > Regards, SImon