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 2AA12C433F5 for ; Mon, 10 Jan 2022 03:16:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DA97281112; Mon, 10 Jan 2022 04:15:45 +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="UL7DXf6T"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6210383093; Mon, 10 Jan 2022 04:15:22 +0100 (CET) Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (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 947EB81E02 for ; Mon, 10 Jan 2022 04:15:15 +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-il1-x12c.google.com with SMTP id c4so10166224iln.7 for ; Sun, 09 Jan 2022 19:15:15 -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=3KZzd3IjbNxP+Hi3vY/GzLxKbLFh958GD52qJbAoIfg=; b=UL7DXf6TsztRZ/+TUIfAmjThg7YM+ieRHs/ab932rtVNGV6a9U//zeWYcBHH0FPCCj Lp4tSZdQR6jBmZI5z4Hb7GvZAn07zG1gnCxdBMmz9RmVOrfSnU5Sl1qUHz8cAnOnbFQY V+gPMrPe0gApvFsSAjapU/PKCOtr+rt7Adfk0= 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=3KZzd3IjbNxP+Hi3vY/GzLxKbLFh958GD52qJbAoIfg=; b=Pi8cWTE5e5xcCb3yYqFi/dNH9Uz0aN/IJxqr/lC0okzO+PDVfsCDN4xJ7zx9obA5j2 J34hOMi4mEaJZEkYHoi653bKMhV9W8cF6oZNCMmBP5EmhPF+n4s2S3wH+9K4x9giJvsd wwsQ0b7HD+nezaLPH+stu0Xw5dvBWir+9ni8+MH2SbbbxVEXpqMKyqMT6DYp1Ashe1ND J7lJvfAM+VUYpD7PbI1Kn/dnvKSIec9lGBtDfiPXLDPY1rgsWS6Lg2qqCjn25KnkWu/P qWkQ1vrqKjVGCqOqf5NkoYoJ0b9gGjvcl3tKoHNiNGt1gF6IXSCJ2Sm9j/c81DBJiOLW kAlg== X-Gm-Message-State: AOAM530OE1G5ccpzqnfHCzSrahOA0MEjARg81Dq4gTKbCKm8BM1hr34h DNuMc1eENR/SIVQSMzQ79so79jU5z7hpZw== X-Google-Smtp-Source: ABdhPJwof2preSo1OHAskEXX+dY11wjt8xBsJbt0KSM+2C49Atm2voJM3cxrgWTRfBc5M5JAA4ntvg== X-Received: by 2002:a92:cda5:: with SMTP id g5mr34732133ild.316.1641784514024; Sun, 09 Jan 2022 19:15:14 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id d16sm3542182ioy.29.2022.01.09.19.15.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jan 2022 19:15:13 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH v2 11/38] binman: Allow faked blobs in blob-ext-list Date: Sun, 9 Jan 2022 20:13:46 -0700 Message-Id: <20220110031413.1970836-12-sjg@chromium.org> X-Mailer: git-send-email 2.34.1.575.g55b058a8bb-goog In-Reply-To: <20220110031413.1970836-1-sjg@chromium.org> References: <20220110031413.1970836-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.2 at phobos.denx.de X-Virus-Status: Clean Since this is a list of blobs, each blob should have the ability to be faked, as with blob-ext. Update the Entry base class to set allow_fake and use the base class in the section code also, so that this propagagtes to blob-ext-list, which is not a section. Signed-off-by: Simon Glass --- (no changes since v1) tools/binman/entry.py | 2 +- tools/binman/etype/blob_ext_list.py | 1 + tools/binman/etype/section.py | 1 + tools/binman/ftest.py | 8 ++++++++ tools/binman/test/218_blob_ext_list_fake.dts | 14 ++++++++++++++ 5 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 tools/binman/test/218_blob_ext_list_fake.dts diff --git a/tools/binman/entry.py b/tools/binman/entry.py index bac90bbbcde..e4a1f2d5d5c 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -960,7 +960,7 @@ features to produce new behaviours. Args: allow_fake: True if allowed, False if not allowed """ - pass + self.allow_fake = allow_fake def CheckMissing(self, missing_list): """Check if any entries in this section have missing external blobs diff --git a/tools/binman/etype/blob_ext_list.py b/tools/binman/etype/blob_ext_list.py index 136ae819946..29c9092dc35 100644 --- a/tools/binman/etype/blob_ext_list.py +++ b/tools/binman/etype/blob_ext_list.py @@ -37,6 +37,7 @@ class Entry_blob_ext_list(Entry_blob): missing = False pathnames = [] for fname in self._filenames: + fname = self.check_fake_fname(fname) pathname = tools.GetInputFilename( fname, self.external and self.section.GetAllowMissing()) # Allow the file to be missing diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index 7a55d032318..fdd4cbb21ad 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -805,6 +805,7 @@ class Entry_section(Entry): Args: allow_fake_blob: True if allowed, False if not allowed """ + super().SetAllowFakeBlob(allow_fake) for entry in self._entries.values(): entry.SetAllowFakeBlob(allow_fake) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 6a7647311ba..ac6aabbf9c3 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -4982,6 +4982,14 @@ fdt fdtmap Extract the devicetree blob from the fdtmap err, "Image '.*' has faked external blobs and is non-functional: .*") + def testExtblobListFaked(self): + """Test an extblob with missing external blob that are faked""" + with test_util.capture_sys_output() as (stdout, stderr): + self._DoTestFile('216_blob_ext_list_missing.dts', + allow_fake_blobs=True) + err = stderr.getvalue() + self.assertRegex(err, "Image 'main-section'.*faked.*: blob-ext-list") + if __name__ == "__main__": unittest.main() diff --git a/tools/binman/test/218_blob_ext_list_fake.dts b/tools/binman/test/218_blob_ext_list_fake.dts new file mode 100644 index 00000000000..54ee54fdaab --- /dev/null +++ b/tools/binman/test/218_blob_ext_list_fake.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + blob-ext-list { + filenames = "refcode.bin", "fake-file"; + }; + }; +}; -- 2.34.1.575.g55b058a8bb-goog