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 9E724C2BA4C for ; Wed, 26 Jan 2022 17:19:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 77DD2830D9; Wed, 26 Jan 2022 18:19:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=siemens.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=siemens.com header.i=@siemens.com header.b="MJnhNXBC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A48F383107; Wed, 26 Jan 2022 18:18:58 +0100 (CET) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0604.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::604]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C783381F6B for ; Wed, 26 Jan 2022 18:18:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=siemens.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jan.kiszka@siemens.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fH//fouHBv5G2gCg+hN1HpkQUzuMeQWwHIleYbw5/ZucCFpscE8WHAx9TFSSqmnLGLV1SrZdU7ZnTnHPCBRXGyDH+iSHhnls3hUu0Oih7MuXgrQGv807hK+bS59nkgUyS4qECmiTg1uG5l6LFxDZZ3ZhSUdOD3KneHHI17U2LMkU3VbcXkgDqUe3hRQfUfoGnxjOYFt9+/yblYkfe3O4EaSEwvhEkAWwbuO4sVmp6NWAyRHQcLlQYd72SwWMAKkUym8vciM5PpiEvpk/61nLtN+1///6i74MAMnNnHJjxG529Vj8NRmgz7QTCMK6ZZhBjHu+lHm8crmrowihV50Glw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3FwUkaEb0ReCG3ESo+oSajejyakXLIQMoPgd/7af0ig=; b=mQHmie7n61ysFT/mwRDcAO2GksL8YGnStGsnP5btVzaQCJu451HZKF4bFlXcPKu8GsE+2tNupI/M+ASYpbltE4uLlxx060jsu+jMrgtR2kzgxOrJuBMFC620pHsC8K6t8zmOUHgKqSdp8N58BPW+VsM7ECAlrAe2ddcTiSwVqjdEDRPOHGneeGVfG1ZMBC+K23SKyc9mmJ+S5LmUaRuAHNp1o5SguNONQfWkv6XbslcEfPZiU65o0yH6W3Z0AnTmblRHpIMfB/VJvpLzIG/iCGKujRP1astota1BasRhNWe8ObVlOq6qD1T9xCajkR2Y8T1Pbin/CWiH2pVWrVM2aA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.73) smtp.rcpttodomain=chromium.org smtp.mailfrom=siemens.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3FwUkaEb0ReCG3ESo+oSajejyakXLIQMoPgd/7af0ig=; b=MJnhNXBCyfPkQUJ4/4s4OHmxB7bW9oki3h64jewWhQaUw4asrJBJ8MzdINf9RH7B/WOcTUCzexNROkVX2nP958QL/Ph064orI/GWzDfWqSB2eRKsk/Nqhg+hgqEA0nCVjaKgi6RIut0Fl8aH8A8n8p0DQDcnwGLw00jZlAAD4VdxJZIHxshC0mFceMUTMvHlkRrWr1iZqlGp9cbm/kdo8cF1L/BhcJlmCV5uHsksRgZv2FwqbP7QJFqj/mJAdAcQ3ulwHbYVJ5B34rGLFHvbkqEX85UAvLxHwbaHM/MmvccreGR1+ly5uaeSU5ZsFN05rABc8hTnruYPdaGmaD7jkg== Received: from AM6PR10CA0099.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:8c::40) by AM6PR10MB2200.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:48::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.12; Wed, 26 Jan 2022 17:18:54 +0000 Received: from VE1EUR01FT038.eop-EUR01.prod.protection.outlook.com (2603:10a6:209:8c:cafe::fb) by AM6PR10CA0099.outlook.office365.com (2603:10a6:209:8c::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15 via Frontend Transport; Wed, 26 Jan 2022 17:18:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.73) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=siemens.com; Received-SPF: Pass (protection.outlook.com: domain of siemens.com designates 194.138.21.73 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.73; helo=hybrid.siemens.com; Received: from hybrid.siemens.com (194.138.21.73) by VE1EUR01FT038.mail.protection.outlook.com (10.152.3.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4930.15 via Frontend Transport; Wed, 26 Jan 2022 17:18:53 +0000 Received: from DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) by DEMCHDC9SNA.ad011.siemens.net (194.138.21.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Wed, 26 Jan 2022 18:18:53 +0100 Received: from [167.87.32.162] (167.87.32.162) by DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 26 Jan 2022 18:18:53 +0100 Message-ID: <82ab48c7-606b-cc89-b4c6-b5e7ed560adb@siemens.com> Date: Wed, 26 Jan 2022 18:18:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2] binman: Skip node generation for images read from files Content-Language: en-US To: Simon Glass CC: U-Boot Mailing List , "Su, Bao Cheng (RC-CN DF FA R&D)" References: From: Jan Kiszka In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [167.87.32.162] X-ClientProxiedBy: DEMCHDC89YA.ad011.siemens.net (139.25.226.104) To DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8dc1f043-6016-4d0a-6da5-08d9e0efedc1 X-MS-TrafficTypeDiagnostic: AM6PR10MB2200:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1388; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZtUgf59cRwDCe0NvLY4xlqH2orEFz0OSWWrcQjQv/Btdw9UtDunDSfQubWu4JoRKeiQlZew0QGJGBEW4B5F+heRBAkPQbZ5adjoQex4O/MzF6qbovsZq3g1KWVBslm7pvMM63Gh82NkqviP35nTmsLO/2OF6SR5TpxagYqC6jpNpydHPr7B/UQ8m4h2vT4Wid0y2LOciV2VIQgNhWGXA/vWROonwThICygzu7nCCTgWN3dkD6TrqnYLPUh7yREImkAFxV+qMYnW2vzITU6UsuhKu4P9o6hWzS1FjMqd0ndPfA7Z7gqdRPJsdA0YeQNQOlN9C6DafhHqk+FwB/TBzKw39fGtdnHsEGOvcfqh0gyiOVr+fc6vsuGzFDr2bqH5/k64z6YLJyTtAbF7DIr3ZAJWa+L0cPmEKQ99nT20luxmG43G4EmFN1O5BkhNivSrE9VPmnHYo7j4VtWXgXQg6RVohi9QbdI2PoBO75Hvyc5IQ0FkaO4h9Omtt9ZBzeExt5QufGavhaLF19Rk7xVb18p7bAWWEv/c7N5lRS8hZcQIRARcoyKFJrcM1mWKMjHDh38gv4rq2cl6aYhVBqP4kHiZ/qrJpBYbCALPldtZ3FhXrKfIKTziAvxkBF4TzuNRfrtBbnouSFbSnllQ550NiMVq7hEoo0uAGVPUo3p3K6lKMe496J6OmyYjlmXKTcnmLXiNNzvO2QK5NGrf1/hUebpaEnDrwd/uuR95+SVE7WfAWwCVEYj5O0ICny/0RAzZylJmeZce0DLyxoYoIQWpAzQD6CHwgBK0CLWvKO/5fcTqQ1Yo9cePtV8ucUvGLgxScs7pNSvuMXXXT19ASPqoSOsDCb4yo/vgU2Xer+LAxiCc= X-Forefront-Antispam-Report: CIP:194.138.21.73; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(40470700004)(36840700001)(46966006)(956004)(107886003)(70206006)(316002)(336012)(31686004)(82310400004)(26005)(508600001)(4326008)(36860700001)(6916009)(83380400001)(6706004)(54906003)(31696002)(40460700003)(53546011)(81166007)(47076005)(44832011)(16576012)(36756003)(186003)(2906002)(70586007)(2616005)(8676002)(5660300002)(82960400001)(86362001)(8936002)(356005)(16526019)(3940600001)(43740500002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 17:18:53.9849 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8dc1f043-6016-4d0a-6da5-08d9e0efedc1 X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; Ip=[194.138.21.73]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR01FT038.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR10MB2200 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 26.01.22 16:57, Simon Glass wrote: > Hi Jan, > > On Mon, 17 Jan 2022 at 00:28, Jan Kiszka wrote: >> >> From: Jan Kiszka >> >> We can and should run the node generator only when creating a new image. >> When we read it back, there is no need to generate nodes - they already >> exits, and binman does not dive that deep into the image - and there is >> no way to provide the required fdt-list. So forward the mode from the >> image to every Entry object it contains so that Entry_fit can simply >> skip generator nodes when reading them from an fdtmap. >> >> This unbreaks all read-backs of images that contain generator nodes in >> their fdtmap. >> >> Signed-off-by: Jan Kiszka >> --- >> >> Changes in v2: >> - more verbose commit log >> >> tools/binman/entry.py | 5 ++++- >> tools/binman/etype/fit.py | 2 +- >> tools/binman/etype/section.py | 4 ++-- >> tools/binman/image.py | 7 ++++--- >> 4 files changed, 11 insertions(+), 7 deletions(-) > > Did you miss my other comments and a test? > Sorry, I indeed the other comments on the code - after ignoring the one about a test case. ENOTIME. Jan >> >> diff --git a/tools/binman/entry.py b/tools/binman/entry.py >> index bac90bbbcd..fdb9746fda 100644 >> --- a/tools/binman/entry.py >> +++ b/tools/binman/entry.py >> @@ -75,7 +75,7 @@ class Entry(object): >> available. This is mainly used for testing. >> external: True if this entry contains an external binary blob >> """ >> - def __init__(self, section, etype, node, name_prefix=''): >> + def __init__(self, section, etype, node, name_prefix='', generate=None): >> # Put this here to allow entry-docs and help to work without libfdt >> global state >> from binman import state >> @@ -105,6 +105,9 @@ class Entry(object): >> self.external = False >> self.allow_missing = False >> self.allow_fake = False >> + if generate == None: >> + generate = section.generate if section else True >> + self.generate = generate >> >> @staticmethod >> def FindEntryClass(etype, expanded): >> diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py >> index b41187df80..4e4d2f9c22 100644 >> --- a/tools/binman/etype/fit.py >> +++ b/tools/binman/etype/fit.py >> @@ -193,7 +193,7 @@ class Entry_fit(Entry): >> # the FIT (e.g. "/images/kernel/u-boot"), so don't call >> # fsw.add_node() or _AddNode() for it. >> pass >> - elif subnode.name.startswith('@'): >> + elif self.generate and subnode.name.startswith('@'): >> if self._fdts: >> # Generate notes for each FDT >> for seq, fdt_fname in enumerate(self._fdts): >> diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py >> index 7a55d03231..319156a09a 100644 >> --- a/tools/binman/etype/section.py >> +++ b/tools/binman/etype/section.py >> @@ -154,9 +154,9 @@ class Entry_section(Entry): >> available. This is set by the `SetAllowMissing()` method, if >> `--allow-missing` is passed to binman. >> """ >> - def __init__(self, section, etype, node, test=False): >> + def __init__(self, section, etype, node, test=False, generate=None): >> if not test: >> - super().__init__(section, etype, node) >> + super().__init__(section, etype, node, generate=generate) >> self._entries = OrderedDict() >> self._pad_byte = 0 >> self._sort = False >> diff --git a/tools/binman/image.py b/tools/binman/image.py >> index f0a7d65299..1ff97e687c 100644 >> --- a/tools/binman/image.py >> +++ b/tools/binman/image.py >> @@ -69,8 +69,9 @@ class Image(section.Entry_section): >> version which does not support all the entry types. >> """ >> def __init__(self, name, node, copy_to_orig=True, test=False, >> - ignore_missing=False, use_expanded=False, missing_etype=False): >> - super().__init__(None, 'section', node, test=test) >> + ignore_missing=False, use_expanded=False, missing_etype=False, >> + generate=True): >> + super().__init__(None, 'section', node, test=test, generate=generate) >> self.copy_to_orig = copy_to_orig >> self.name = 'main-section' >> self.image_name = name >> @@ -130,7 +131,7 @@ class Image(section.Entry_section): >> # Return an Image with the associated nodes >> root = dtb.GetRoot() >> image = Image('image', root, copy_to_orig=False, ignore_missing=True, >> - missing_etype=True) >> + missing_etype=True, generate=False) >> >> image.image_node = fdt_util.GetString(root, 'image-node', 'image') >> image.fdtmap_dtb = dtb >> -- >> 2.31.1 > > Regards, > Simon -- Siemens AG, Technology Competence Center Embedded Linux