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 33966EB64DC for ; Tue, 18 Jul 2023 20:35:27 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B859486719; Tue, 18 Jul 2023 22:34:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="IiX1Us/Q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8D7F88670A; Tue, 18 Jul 2023 22:34:40 +0200 (CEST) Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) (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 D1BD286703 for ; Tue, 18 Jul 2023 22:34:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=xR8+eaF7o6fAtHD7L+nEndge6/Q0+FHlYLyAbQgj0AY=; b=IiX1Us/Qcx3I/A2z7Qg5LiY6pPgEzPSPUefxTavmtheGaYpXzbXeLT6KIYpGkZa9qWWf wyGXN+YlriMC+QyUoHt1oz32ij/ywVLitZjcMLcAIRFexr0PfjhXrs9EqWH5g2V4KxAIdC 3MtR7Eo/GpEjmK50k+Pe9xPL7hNjAPwwybDtCa4pFbuX2E8QADT4pTZkE3+2ZItM5SF3HD sllzvzRheZZ0w6qpX91Z+cHF4DdJb3asZ/zzEd47rrviq7Lb1yHG4+a+u0vrevtFVlS5bH FgqhTX5mO038fKLCnMpGoXFhLy0PB2Kr7cAwxcOoirnRmRC1DCeSlGx7maj4oSmw== Received: by filterdrecv-65f68489c8-k2rl8 with SMTP id filterdrecv-65f68489c8-k2rl8-1-64B6F75C-11 2023-07-18 20:34:36.457139541 +0000 UTC m=+3789271.726894514 Received: from bionic.localdomain (unknown) by geopod-ismtpd-9 (SG) with ESMTP id Zukc8E9PT_CH6UEi7ycaPw Tue, 18 Jul 2023 20:34:36.251 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v2 4/7] binman: Override CheckOptional in fit entry Date: Tue, 18 Jul 2023 20:34:36 +0000 (UTC) Message-ID: <20230718203423.264341-5-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230718203423.264341-1-jonas@kwiboo.se> References: <20230718203423.264341-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0hxmtZYm=2FfziUYhmP1?= =?us-ascii?Q?XlIcMA7tSe6o+RoaATeIsUx=2F6Mv9C+hQP9yfmwt?= =?us-ascii?Q?N7wjEo5+gqiVaFR9vOc14KkXcFCDUv0RbXs6p8q?= =?us-ascii?Q?DZPVfrOCyobVzSOxTv3cjoAcXuvrVxKUkEquXNy?= =?us-ascii?Q?sQZqVBIs2RJa9WpYQuGmZN41FkQmEHQpIXdfHe?= To: Simon Glass , Alper Nebi Yasak Cc: u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii 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.8 at phobos.denx.de X-Virus-Status: Clean Missing optional blobs was not reported for generated entries, e.g. tee-os on rockchip targets. Implement a CheckOptional to fix this. After this the following can be shown: Image 'simple-bin' is missing optional external blobs but is still functional: tee-os /binman/simple-bin/fit/images/@tee-SEQ/tee-os (tee-os): See the documentation for your board. You may need to build Open Portable Trusted Execution Environment (OP-TEE) and build with TEE=/path/to/tee.bin Signed-off-by: Jonas Karlman Reviewed-by: Simon Glass --- v2: - Add test - Collect r-b tag tools/binman/etype/fit.py | 7 +++++++ tools/binman/ftest.py | 7 +++++++ tools/binman/test/264_tee_os_opt_fit.dts | 1 + 3 files changed, 15 insertions(+) diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py index ef4d0667578d..2c14b15b03cd 100644 --- a/tools/binman/etype/fit.py +++ b/tools/binman/etype/fit.py @@ -842,6 +842,13 @@ class Entry_fit(Entry_section): for entry in self._priv_entries.values(): entry.CheckMissing(missing_list) + def CheckOptional(self, optional_list): + # We must use our private entry list for this since generator nodes + # which are removed from self._entries will otherwise not show up as + # optional + for entry in self._priv_entries.values(): + entry.CheckOptional(optional_list) + def CheckEntries(self): pass diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 152f800c676c..40ef6e5dce99 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -6298,6 +6298,13 @@ fdt fdtmap Extract the devicetree blob from the fdtmap fdt_util.fdt32_to_cpu(node.props['entry'].value)) self.assertEqual(U_BOOT_DATA, node.props['data'].bytes) + with test_util.capture_sys_output() as (stdout, stderr): + self.checkFitTee('264_tee_os_opt_fit.dts', '') + err = stderr.getvalue() + self.assertRegex( + err, + "Image '.*' is missing optional external blobs but is still functional: tee-os") + def testFitTeeOsOptionalFitBad(self): """Test an image with a FIT with an optional OP-TEE binary""" with self.assertRaises(ValueError) as exc: diff --git a/tools/binman/test/264_tee_os_opt_fit.dts b/tools/binman/test/264_tee_os_opt_fit.dts index ae44b433edf1..e9634d3ccdcd 100644 --- a/tools/binman/test/264_tee_os_opt_fit.dts +++ b/tools/binman/test/264_tee_os_opt_fit.dts @@ -25,6 +25,7 @@ fit,data; tee-os { + optional; }; }; }; -- 2.41.0