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 8DD61C433EF for ; Thu, 3 Mar 2022 21:18:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C837683D66; Thu, 3 Mar 2022 22:16:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oMjkSAWf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CEB5083D69; Thu, 3 Mar 2022 22:16:28 +0100 (CET) Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) (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 369A183CEE for ; Thu, 3 Mar 2022 22:16:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=alpernebiyasak@gmail.com Received: by mail-ej1-x62c.google.com with SMTP id dr20so13357047ejc.6 for ; Thu, 03 Mar 2022 13:16:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to:cc :references:content-language:in-reply-to:content-transfer-encoding; bh=qhVRKFBA+jdb3XtW9YU0HvbS63xbH0X5t1Ix7CKo8K0=; b=oMjkSAWf9PCwUuaNbpbHpCEaQTJFrME0eM9baNFx+f8uZNyzu6KjubDBWOZxZ11bdb bH+6tYCzGrfAXifh/QQF5FDwWYO3SDw/igek47fTGgqeToZjorEVRPap43iAvU2nbIuN kyAI+H4V8/iAA09VJQv3Vu+mfOKCsAzp7YoXrT9UAJtobDkOjVRiFORHzoIP0rxfTr5w m7BWpl1exzxQZ/RpXCDK0RkgUhPz5C9delVGYo5lVJCJs1xVOJFfCGOlJuBfHqTTmppQ lnpHMV6FEWzWP+lioG2nBE6TjpaiLE5EgotINwTFilCXoMl/oLisVsh+VjJcGT/MxHyc zHKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:cc:references:content-language:in-reply-to :content-transfer-encoding; bh=qhVRKFBA+jdb3XtW9YU0HvbS63xbH0X5t1Ix7CKo8K0=; b=s3JKi7ape6b/t4C4OTqEGFfpodTejzZ9xOt1MUf2NIq1vWzFv5+YWCGZUXFssR4ULh PzTeyo4VtddDHG6CDhKb58rJSEhjAy4niWWc8vsTa88EoxXVrljBE2YhUoORstiZXBqP nEovNikQ0+/u6iCn5zZhJv3k7X9U51rC4li8nMz38u660zTPYrwBDW7WyYfyPLSOXaXq 7XV05Lfvjs29vCkdaeEKKmSHXY9xMkyM01vx9FhZRYzqwIeWSRLrhM0SoC1U6WjNBc71 2HnsIPOzl2pHkFEfxMpldcf1aT8soAyG0vltqsVCmJpthzCD/COOgZ2T5UYN2GphXn/r Izlw== X-Gm-Message-State: AOAM532Uk4oqMX3cwGZ9C8AHnCOkkktLV9jpy57HEsZztpGITt3EYmIU s7wn84NuEUg13zawb+3EW2M= X-Google-Smtp-Source: ABdhPJx6c/AlQ6Z5oorzLG+6TjhWLhTILuvBFQ2qqdu0Hd0v5mdPEPkXlViUbR/q1keZZMJNDBVoYw== X-Received: by 2002:a17:906:dc92:b0:6da:ab9b:7c0f with SMTP id cs18-20020a170906dc9200b006daab9b7c0fmr1214402ejc.436.1646342184788; Thu, 03 Mar 2022 13:16:24 -0800 (PST) Received: from [192.168.0.74] ([178.233.26.119]) by smtp.gmail.com with ESMTPSA id u8-20020a1709063b8800b006ced6c18566sm1101301ejf.218.2022.03.03.13.16.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Mar 2022 13:16:23 -0800 (PST) Message-ID: Date: Fri, 4 Mar 2022 00:09:52 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 From: Alper Nebi Yasak Subject: Re: [PATCH v2 14/25] binman: Allow mkimage to use a non-zero fake-blob size To: Simon Glass Cc: Ivan Mikhaylov , Tom Rini , Philippe Reynes , huang lin , Jeffy Chen , Kever Yang , U-Boot Mailing List References: <20220223230040.159317-1-sjg@chromium.org> <20220223230040.159317-15-sjg@chromium.org> Content-Language: en-US In-Reply-To: <20220223230040.159317-15-sjg@chromium.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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.5 at phobos.denx.de X-Virus-Status: Clean On 24/02/2022 02:00, Simon Glass wrote: > Unfortunately mkimage gets upset with zero-sized files. Update the > ObtainContents() method to support specifying the size, if a fake blob is > created. > > Signed-off-by: Simon Glass > --- > > Changes in v2: > - Add a patch to allow mkimage to use a non-zero fake-blob size > > tools/binman/entry.py | 11 ++++++++--- > tools/binman/etype/_testing.py | 2 +- > tools/binman/etype/blob.py | 5 +++-- > tools/binman/etype/mkimage.py | 13 ++++++++++++- > tools/binman/etype/section.py | 2 +- > tools/binman/ftest.py | 10 ++++++++++ > tools/binman/test/229_mkimage_missing.dts | 18 ++++++++++++++++++ > 7 files changed, 53 insertions(+), 8 deletions(-) > create mode 100644 tools/binman/test/229_mkimage_missing.dts I don't exactly like this, but can't think of a nice alternative either. Reviewed-by: Alper Nebi Yasak > [...] > > diff --git a/tools/binman/etype/mkimage.py b/tools/binman/etype/mkimage.py > index 9f4717e4ea..5f6def2287 100644 > --- a/tools/binman/etype/mkimage.py > +++ b/tools/binman/etype/mkimage.py > @@ -51,8 +51,9 @@ class Entry_mkimage(Entry): > self.ReadEntries() > > def ObtainContents(self): > + # Use a non-zero size for any fake files to keep mkimage happy > data, input_fname, uniq = self.collect_contents_to_file( > - self._mkimage_entries.values(), 'mkimage') > + self._mkimage_entries.values(), 'mkimage', 1024) I kind of want to say that mkimage-the-etype should be able to handle here whatever it gets from subentries (maybe by writing a single-byte file itself), and mkimage-the-executable should be able to handle zero-size files, but I'm not confident in those opinions. > if data is None: > return False > output_fname = tools.get_output_filename('mkimage-out.%s' % uniq) > [...]