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 A9D95C433F5 for ; Sun, 6 Mar 2022 03:10:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 422F383D03; Sun, 6 Mar 2022 04:09:37 +0100 (CET) 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="K8NKYGCq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 502B283BDF; Sun, 6 Mar 2022 04:09:11 +0100 (CET) Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) (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 5FD3A83CDF for ; Sun, 6 Mar 2022 04:08:58 +0100 (CET) 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-oi1-x229.google.com with SMTP id j24so11819039oii.11 for ; Sat, 05 Mar 2022 19:08:58 -0800 (PST) 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=IM6AkPCB4doHxcN8bdAwGKpRa2RcKdF+Cd1kS7CA498=; b=K8NKYGCqAGdy64veO68dTIjO/yAhI7aaNurkv+VXxMBRYD2A1c9P500GVfUo4veStb 1ZTzb8wpsKCmgBwJlBhl5FDtmEqxA78l1k/ffHJ3AvInrujEtBSlpiPbJW3qm+MBcPLP /Uc1GoXmx0zQvQZaYY16ewKrZokMEA6vpcuOg= 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=IM6AkPCB4doHxcN8bdAwGKpRa2RcKdF+Cd1kS7CA498=; b=7Z3ORzDgXxdA9sourB5FwNVOvnqrTFl9zRFNip7lRAPKMC/pn879mtYiQmSh/SeUmj 342S0jqUGPCWYR06KVf83pEMZP41rGeb0K6UrvPnmiXwDpycpX/eNGvbNR7rgBFonjCX Sgtp+rYqCSrF/nE3fHtHOTNZHZzUjcvlh5NOmWtpGO0uRAODfk8Hn4MNIcJOLbKMI0af 2mB+zCaSnITxA0FVy/3sAZ0mjNMaLRa5xyhiJbRth3WieHg+lkJ+8q9jwTNQGMk3ci25 4AbwDyySvZstkDYw+jw7x8Jn79pXHxZvyV8SDEBk2D9e2q/9atvk5OxESKy7Xmi9c8X6 rBrg== X-Gm-Message-State: AOAM533h9RHoQL8ZnmzLwjX1Oh7naT9tDpeZvOfFUIumSa+y31LX+TNK X0FIjWH0njRGiAjZPaqDXOyXciArrK68UOahNPzBJw== X-Google-Smtp-Source: ABdhPJxqeOi4LcN+thJyxHQS8AdDEDwr1hvaEoA96HM3Ta2sxabbzS3RFYgBAhJ8O48v1iVguDQjvETjVfUGNdaYM8E= X-Received: by 2002:a05:6808:20a7:b0:2d4:d2f1:9edc with SMTP id s39-20020a05680820a700b002d4d2f19edcmr3633636oiw.64.1646536136764; Sat, 05 Mar 2022 19:08:56 -0800 (PST) MIME-Version: 1.0 References: <20220223230040.159317-1-sjg@chromium.org> <20220223230040.159317-15-sjg@chromium.org> In-Reply-To: From: Simon Glass Date: Sat, 5 Mar 2022 20:08:08 -0700 Message-ID: Subject: Re: [PATCH v2 14/25] binman: Allow mkimage to use a non-zero fake-blob size To: Alper Nebi Yasak Cc: Ivan Mikhaylov , Tom Rini , Philippe Reynes , huang lin , Jeffy Chen , Kever Yang , U-Boot Mailing List 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.5 at phobos.denx.de X-Virus-Status: Clean Hi Alper, On Thu, 3 Mar 2022 at 14:16, Alper Nebi Yasak wrote: > > 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. Well the entry has no problem with missing files, so that should be OK. For mkimage I agree it is a strange restriction. Perhaps we should just change it? I don't see what problem it could create. > > > if data is None: > > return False > > output_fname = tools.get_output_filename('mkimage-out.%s' % uniq) > > [...] Regards, Simon