Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp52447ybf; Wed, 26 Feb 2020 08:40:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzyQthLDZ1HsH0bMWLYiPrptHcCYKErbaIj2DPlINcLjaYbldJfM42h3KFMySQFHvsYo6aA X-Received: by 2002:aca:db41:: with SMTP id s62mr3698145oig.87.1582735227248; Wed, 26 Feb 2020 08:40:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582735227; cv=none; d=google.com; s=arc-20160816; b=citic4Ji3X7UyFL6vh3MO1VB50Y2Ib4oXX69C4Odo2TnLd8gl8S5dzplFA3peB8xUP ISOCdo0hHEC6/OP+FgIZrLN+z0X9KzcVlCbO+o7LtG+Txt6+xdhbwagH2G5YOFCPlK2S +CXRTVk4MinhOciP4n7wUR1JP7gyxTDYByscJ4+Zym15e1kdbq2+P+xURnndMESYcvgg Oph3zbyyAiX2otFgtea7YL8sx7v65N4+PdXaQAXn+1l+qVS8k73fF7f9fMmTa86b6weQ wBaMuQDtB7P+/IdgIQiUswjAVeGcWK+f/Z08tzQX3hxwCuywNUO8pZllaA2axBEF1V7s SNkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=erd2mUrd075M8oO2yPj+tKoxoFziTJnQdLvZCm0QgxY=; b=aNHBrRlU0XSjfcMzzVa6QYIShle6yOKe7+VmZB49VRfgK92/YxiEfek7S5XWG8KhKC gA99Oydtrn+ERE2epo22l7uLd7UeuhmA50Gp9SERECdSzhEJADkcmNrbcVs1AfJxv378 7p1pVE43BUZr6poLMlpc6ktKr+Wo96xCFqKPj6MtqFMhQjb6ZwA+mxRSAfiYKf8+XtG5 opy1x9wulJSngn4bMa3IeUbpgSFx0/zYPycjzrZzWtwWNlJlyMLnfrMb3ycPi6MO/fPf X+Lgb7OhAx0tVPOL//hD56ekcG1LgHQUGoCWkrCqVT4PIF/kL9P8BwicKajSNKPR8ZiH Mndw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=X9eERp8Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9si28425otc.86.2020.02.26.08.40.15; Wed, 26 Feb 2020 08:40:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=X9eERp8Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727910AbgBZQip (ORCPT + 99 others); Wed, 26 Feb 2020 11:38:45 -0500 Received: from mail-yw1-f66.google.com ([209.85.161.66]:39885 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726905AbgBZQio (ORCPT ); Wed, 26 Feb 2020 11:38:44 -0500 Received: by mail-yw1-f66.google.com with SMTP id x184so3652646ywd.6; Wed, 26 Feb 2020 08:38:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=erd2mUrd075M8oO2yPj+tKoxoFziTJnQdLvZCm0QgxY=; b=X9eERp8QG/tuKn6AKY+yJvRNdFHoS9pG+JMlUdxyQYPYSOzXWyPyebgUOFwJQwTnVg 4WNiomgsGWrQ0M0jMCaVVWJs7dlZlXLR/eX/6C+oeoKyGLE+jhdN32JS4BYUFo/TxxkK VBegQxaPBHScmsO2HL1l0CyID+cPVJodQeGAqj5sC/1pZ7I+lkj0InOF6xAJuJ5w4/CQ yuksL+0Y/WfH+iSin0lVK6OjOtzg9JxNw5xV8nsH2FQyD2zTZ7iStRxS+zUfqMg59gED V0q+EO0lQnMJdfUJfvaVZ+f23YaZ4eL1wOFDU0GtLKgB08EKzym3aLaNH4VXUidqgdX6 7vtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=erd2mUrd075M8oO2yPj+tKoxoFziTJnQdLvZCm0QgxY=; b=EGt4nEDOoWLAuG/caYoSDp3At8m0XlT3XFSj0rcwuhaaRJ5wXRsIDMKObrPPhSFRPE evjs7lnZsggmKiDhMfHtgAAkx9sByYp/Aul4BpeVcRdTqtc+dox9YfYqlKExDc2cnTJN 7IZ5oDJS5G6EobkhT5OvzWR0tqdL2kA//pgR/Att/Lz//gJ1KK4dFp5/As5bDSrwAKga 5YM4u+MBhtySafppba5QBHQQj3iqHHZPGErF7O/UMabrSec2mBGBE5W5AQkObvGA1jzu Dkx6RmmVexFIsRuLpPt1rP79twmpWJeP3h2uDGTA7HQ+SwKH54zSfwA+d5ghCJmaA8+j 9gBw== X-Gm-Message-State: APjAAAUEWqeBvdkAeiTmRskfqKHmmRmHxCxkYSJ61XpmUeDV09RZiby4 SuXMLzcoI0jB3PjVdgI6Xyo= X-Received: by 2002:a81:1054:: with SMTP id 81mr35605ywq.57.1582735121692; Wed, 26 Feb 2020 08:38:41 -0800 (PST) Received: from [192.168.1.46] (c-73-88-245-53.hsd1.tn.comcast.net. [73.88.245.53]) by smtp.gmail.com with ESMTPSA id h139sm1127231ywa.35.2020.02.26.08.38.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Feb 2020 08:38:41 -0800 (PST) Subject: Re: [RFC PATCH v2 1/4] scripts: Add script to generate dtb build information To: Masahiro Yamada , Alexandre Torgue Cc: Rob Herring , Michal Marek , David Gibson , Simon Glass , DTML , Linux Kernel Mailing List , Linux Kbuild mailing list , Devicetree Compiler , Ian Lepore References: <20200221161217.20069-1-alexandre.torgue@st.com> <20200221161217.20069-2-alexandre.torgue@st.com> From: Frank Rowand Message-ID: Date: Wed, 26 Feb 2020 10:38:40 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexandre, On 2/24/20 11:45 AM, Masahiro Yamada wrote: > Hi. > > On Sat, Feb 22, 2020 at 1:12 AM Alexandre Torgue > wrote: >> >> This commit adds a new script to create a file (in dts file directory) with >> some information (date, Linux version, user). This file could then be used >> to populate "build-info" property in every dts file that would use this >> build information: >> >> Example: >> >> / { >> ... >> build-info = /incbin/("dtb-build.txt"); >> ... >> }; >> >> Signed-off-by: Alexandre Torgue >> >> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib >> index bae62549e3d2..a5af84ef4ffc 100644 >> --- a/scripts/Makefile.lib >> +++ b/scripts/Makefile.lib >> @@ -246,6 +246,7 @@ quiet_cmd_gzip = GZIP $@ >> # DTC >> # --------------------------------------------------------------------------- >> DTC ?= $(objtree)/scripts/dtc/dtc >> +DTB_GEN_INFO ?= $(objtree)/scripts/gen_dtb_build_info.sh >> >> # Disable noisy checks by default >> ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),) >> @@ -286,6 +287,7 @@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE >> >> quiet_cmd_dtc = DTC $@ >> cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ >> + $(DTB_GEN_INFO) $(src) ; \ >> $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ >> $(DTC) -O $(2) -o $@ -b 0 \ >> $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \ >> diff --git a/scripts/gen_dtb_build_info.sh b/scripts/gen_dtb_build_info.sh >> new file mode 100755 >> index 000000000000..0cd8bd98e410 >> --- /dev/null >> +++ b/scripts/gen_dtb_build_info.sh >> @@ -0,0 +1,10 @@ >> +#!/bin/bash >> +# SPDX-License-Identifier: GPL-2.0 >> + >> +set -o nounset >> + >> +DTB_DIR=$1 >> +DTB_COMPILE_BY=$(whoami | sed 's/\\/\\\\/') >> +DTB_INFO="From Linux $KERNELRELEASE by $DTB_COMPILE_BY the $(date).\0" >> + >> +printf "$DTB_INFO" > "$DTB_DIR/dtb-build.txt" >> -- >> 2.17.1 >> > > > There are more than 1000 *.dts files > in arch/arm/boot/dts/. > > So, with this patch, the build system will creates > arch/arm/boot/dts/dtb-build.txt 1000 times. > > > Does it work with parallel build ? > > Think about what would happen > with 'make -j32 ARCH=arm dtbs' > > > The 32 threads will write to > arch/arm/boot/dts/dtb-build.txt > at the same time. > > Then, some of DTB would very likely to > include the broken dtb-build.txt > > > A list of missing parts in this approach: > > - make it work with parallel build > - clean it up with 'make clean' > - add it .gitignore (and Documentation/dontdiff) > > > You might be able to rework script 'version_dtb_increment_once' from my previous attempt at this concept. I do not know if the build system has changed since 2015 in a way that would make the script incorrect or if it is still valid. https://lore.kernel.org/linux-arm-kernel/550A44A8.9090302@gmail.com/ -Frank