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 343D2C433F5 for ; Wed, 23 Feb 2022 23:04:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F13A083D50; Thu, 24 Feb 2022 00:03:09 +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="kWZ/Q76n"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1CE4383CDA; Thu, 24 Feb 2022 00:01:20 +0100 (CET) Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) (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 994FE83D03 for ; Thu, 24 Feb 2022 00:01:06 +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@chromium.org Received: by mail-oo1-xc32.google.com with SMTP id x6-20020a4a4106000000b003193022319cso845666ooa.4 for ; Wed, 23 Feb 2022 15:01:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ntgM2ldDsuBjXQYkIJ0lUd/JRs+D5iFzGgKijOByHAI=; b=kWZ/Q76nuOyULRXUU1XTBYSalIWBZ1LJ0iAIC/HQ4ou3eCnvvkGo8SkQolcF3cjnOb oQOMNTLxLZ3XoN10G1Op6D97sOW+sCy21DBSfHya6NYUajWgZSBdL5J2r/e9KCGLoIH3 MxFi5k0XrFeOQp7Ra6GBX7l0yXSk3o0U7Vz8M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ntgM2ldDsuBjXQYkIJ0lUd/JRs+D5iFzGgKijOByHAI=; b=IcHHACTvpAK9zf0uHEEivot5RmijamTEo4fyO7BmxLw12VlYDiizVs28CMxYFtdN/e WdM8985+6xONeaqvDUEbcZVWcAewwRBNB+vNY3t4oRU0q1NPrnYrOCLF855KRdn5ApOj L0bIB7cM6xsWrFLKpxXFr9rWC5+oHJ7/Hx/q7VX9dlkZDk1mIFEtdcvpuhVffCJGMKFu 7BMpT6fugZ98SBgseTaX5Ybs75i7EDfzPRfVy4r5KAHoitNQayed5DdQO4xO8r2oYnqF xeE8cuCkdT3nT5GCJOuicamP5UC19IvBqIxzt0K3dAfJh4jTyZeVjMel+UlyusOm7JIS KEBA== X-Gm-Message-State: AOAM5310dX5/AG8gdWxG1iUHflN3TwZiMGtdr2PuSixMCvMFENTtFfyt WUFvRS5BHubL/GwSvBsPlLHJlDVpttPLMw== X-Google-Smtp-Source: ABdhPJyRzVNFtIW5atkuiR4ZRH54PSUON80e/81OfUI65KFGcZHJ4mvCvK88DYHtQ33UCkETl+uxQA== X-Received: by 2002:a05:6870:f80d:b0:d3:12c8:d6bf with SMTP id fr13-20020a056870f80d00b000d312c8d6bfmr925627oab.270.1645657265062; Wed, 23 Feb 2022 15:01:05 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id o2sm427507otl.9.2022.02.23.15.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 15:01:04 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Ivan Mikhaylov , Tom Rini , Philippe Reynes , Roger Quadros , Alper Nebi Yasak , huang lin , Jeffy Chen , Simon Glass , Kever Yang , Philipp Tomsich Subject: [PATCH v2 13/25] binman: Make fake blobs zero-sized by default Date: Wed, 23 Feb 2022 16:00:28 -0700 Message-Id: <20220223230040.159317-14-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.574.g5d30c73bfb-goog In-Reply-To: <20220223230040.159317-1-sjg@chromium.org> References: <20220223230040.159317-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 x86 devices having even a small amount of data can cause an overlap between regions. For example, bayleybay complains when the intel-vga region overlaps with u-boot-ucode: ImagePos Offset Size Name 00000000 00800000 main-section ff800000 00000080 intel-descriptor ff800400 00000080 intel-me fff00000 00098f24 u-boot-with-ucode-ptr fff98f24 00001aa0 u-boot-dtb-with-ucode fff9a9d0 0002a000 u-boot-ucode fffb0000 00000080 intel-vga ... It is safer to use an empty file in most cases. Add an option to set the size for those uses that need it. Signed-off-by: Simon Glass --- Changes in v2: - Add a patch to make fake blobs zero-sized by default tools/binman/entry.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/binman/entry.py b/tools/binman/entry.py index 2fb0050da5..e4c0fbe23d 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -988,13 +988,14 @@ features to produce new behaviours. if self.missing: missing_list.append(self) - def check_fake_fname(self, fname): + def check_fake_fname(self, fname, size=0): """If the file is missing and the entry allows fake blobs, fake it Sets self.faked to True if faked Args: fname (str): Filename to check + size (int): Size of fake file to create Returns: tuple: @@ -1004,7 +1005,7 @@ features to produce new behaviours. if self.allow_fake and not pathlib.Path(fname).is_file(): outfname = tools.get_output_filename(os.path.basename(fname)) with open(outfname, "wb") as out: - out.truncate(1024) + out.truncate(size) self.faked = True tout.info(f"Entry '{self._node.path}': Faked file '{outfname}'") return outfname, True -- 2.35.1.574.g5d30c73bfb-goog