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 90176C433F5 for ; Sun, 6 Feb 2022 21:03:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1651483BF8; Sun, 6 Feb 2022 22:03:16 +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="CB9FyqMu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 372CA83BF5; Sun, 6 Feb 2022 22:03:14 +0100 (CET) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (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 65A5F83BEE for ; Sun, 6 Feb 2022 22:03:10 +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-x631.google.com with SMTP id j14so12938971ejy.6 for ; Sun, 06 Feb 2022 13:03:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JSEVWS7EBkVi1jvaN29IHfEyG03v3Us8bbv4vSVzlNU=; b=CB9FyqMuofyUclKcQAt5OaMKbQgfXgLj7WA7XPsfhrGh+GLGI+Fpmisgd9R6XGn4ha qu/FeUysceGlOhkqRvYmsn8/mTDrZ1UvgQSbUX6zFzBCy0Q4oG6ODLejBujJI+RPSuiW DD9YKWO7RSF+IyfhUuuZZgtlgQhsRsz0uEC+4LXyOw++2QOR7M8LZCNWrkPf0kYHsUUj x6vQ/2tJd6UsQ3+1QEHfe4g4f/U6oJFOP4ZK8WnWm72NOOebq6SX4+GYGWRy1XmHzH9q ngjs+z2nA69emunC/v686C3qquxzHjphqE6UNxRf8J0SEHcFKqyxmHeq2rb359rsYiz0 oH1A== 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=JSEVWS7EBkVi1jvaN29IHfEyG03v3Us8bbv4vSVzlNU=; b=AHABNNlBhzoAxyPndEy4AMnFEoGlrCs2cd4XmQ8h258VYfK+XKP6AyAyd5VABzDINe C2bpV4gNE+FdnNoD8ooqYx6CVoetYom6xmXuwNPubwv4N0+9xPss09zKQjW5Lyj9zSXR To2aqJsfwGu/CMQKrqEqa+5R3c2rIcWUNfICyRM2eQcmhcXreO5MwA/e6CFzFUU0r6Tp NBkyyyjLFcv2QX9N01XJIKW8oHbhoctRt6jBcbAg6nw9M1YGg1mOzDvxI3BiY5kMiy+p WSyjLJOk6TxbG74TObSLHFdVd6wNNNK0ec62odve9vb4iYehK+fT2InGPRHuzxFAsARX M/wQ== X-Gm-Message-State: AOAM532Dzbi9KSjA7dev8ueRS9pKOXDxW3mBrH4os9t3De1/XrSwgtZ2 Xr96k/skQZg2L4Yt+8kAbIrsjaU9bNw= X-Google-Smtp-Source: ABdhPJyXL9SbLpN45X5Fhq2Pzl4uiF+ktud/kTJUmtHvIMXBWRdh1AS/1P1NSO1M4nL5jfQ4KXeFMg== X-Received: by 2002:a17:906:99c3:: with SMTP id s3mr7648334ejn.696.1644181389510; Sun, 06 Feb 2022 13:03:09 -0800 (PST) Received: from localhost.localdomain ([178.233.26.119]) by smtp.gmail.com with ESMTPSA id u4sm2168405ejn.216.2022.02.06.13.03.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Feb 2022 13:03:09 -0800 (PST) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: Simon Glass , Jan Kiszka , Heiko Thiery , Alper Nebi Yasak Subject: [PATCH 2/5] binman: Register and check bintools from FIT subentries Date: Mon, 7 Feb 2022 00:02:46 +0300 Message-Id: <20220206210250.90406-3-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220206210250.90406-1-alpernebiyasak@gmail.com> References: <20220206210250.90406-1-alpernebiyasak@gmail.com> 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 Binman keeps track of binary tools each entry wants to use. The implementation of this for the FIT entry only adds "mkimage", but not the tools that would be used by its subentries. Register the binary tools that FIT subentries will use in addition to the one FIT itself uses, and check their existence by copying the appropriate method from Section entry type. Also add tests that check if these subentries can use and warn about binary tools. Signed-off-by: Alper Nebi Yasak --- tools/binman/etype/fit.py | 14 +++++++ tools/binman/ftest.py | 25 ++++++++++++ .../binman/test/220_fit_subentry_bintool.dts | 39 +++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 tools/binman/test/220_fit_subentry_bintool.dts diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py index 38bc2a2d784e..9dffcd5adbd6 100644 --- a/tools/binman/etype/fit.py +++ b/tools/binman/etype/fit.py @@ -311,4 +311,18 @@ def SetAllowMissing(self, allow_missing): section.SetAllowMissing(allow_missing) def AddBintools(self, tools): + for section in self._fit_sections.values(): + section.AddBintools(tools) self.mkimage = self.AddBintool(tools, 'mkimage') + + def check_missing_bintools(self, missing_list): + """Check if any entries in this section have missing bintools + + If there are missing bintools, these are added to the list + + Args: + missing_list: List of Bintool objects to be added to + """ + super().check_missing_bintools(missing_list) + for entry in self._fit_sections.values(): + entry.check_missing_bintools(missing_list) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index b0f548057980..ce0dcf7c3e02 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -5163,6 +5163,31 @@ def testListWithGenNode(self): finally: shutil.rmtree(tmpdir) + def testFitSubentryUsesBintool(self): + """Test that binman FIT subentries can use bintools""" + command.test_result = self._HandleGbbCommand + entry_args = { + 'keydir': 'devkeys', + 'bmpblk': 'bmpblk.bin', + } + data, _, _, _ = self._DoReadFileDtb('220_fit_subentry_bintool.dts', + entry_args=entry_args) + + expected = (GBB_DATA + GBB_DATA + tools.GetBytes(0, 8) + + tools.GetBytes(0, 0x2180 - 16)) + self.assertIn(expected, data) + + def testFitSubentryMissingBintool(self): + """Test that binman reports missing bintools for FIT subentries""" + entry_args = { + 'keydir': 'devkeys', + } + with test_util.capture_sys_output() as (_, stderr): + self._DoTestFile('220_fit_subentry_bintool.dts', + force_missing_bintools='futility', entry_args=entry_args) + err = stderr.getvalue() + self.assertRegex(err, + "Image 'main-section'.*missing bintools.*: futility") if __name__ == "__main__": unittest.main() diff --git a/tools/binman/test/220_fit_subentry_bintool.dts b/tools/binman/test/220_fit_subentry_bintool.dts new file mode 100644 index 000000000000..6e29d41eeb33 --- /dev/null +++ b/tools/binman/test/220_fit_subentry_bintool.dts @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + fit { + description = "test-desc"; + #address-cells = <1>; + + images { + test { + description = "Something using a bintool"; + type = "kernel"; + arch = "arm"; + os = "linux"; + compression = "gzip"; + load = <00000000>; + entry = <00000000>; + + gbb { + size = <0x2180>; + }; + }; + }; + + configurations { + default = "conf-1"; + conf-1 { + description = "Boot bintool output"; + kernel = "kernel"; + }; + }; + }; + }; +}; -- 2.34.1