Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2692700ybv; Mon, 24 Feb 2020 09:46:13 -0800 (PST) X-Google-Smtp-Source: APXvYqwq2LNrXHc6eRWohQ2HR+WX9BXfdEowETAgawqx69C2iJ8HlUu0ckQx7xejGMUhEdnM+bWA X-Received: by 2002:a05:6808:1:: with SMTP id u1mr202218oic.74.1582566373444; Mon, 24 Feb 2020 09:46:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582566373; cv=none; d=google.com; s=arc-20160816; b=rFFBR9T0Xa9D1womO+QYy+hnmSg8nIU9Eegp3Dnmx2fL3xPcaagkzgT6Z9Ulj5lFrB EKyAkpNYpEMKEHdabKiBNEq9rCDmZZuTJzAUe3AYdwGqcjuk3y55XRHP17rqQHI7piVL LXeL7Lc/A3vK0MIUaUV0DCGHL3Vj/MV/ZXq+yMOsfgTQmfpEP8AAoTWfPNIp6xG2ScSd zUiWusjuJ52fcPbB0xAM5JVQlctCDpXTbVZPa5sRdSXbMx3LrurlISSua1b99cRbixgf dQGmlFCX5YbdAnD19WTZ4rDrg2+dvvy05d+g6jEo4TfwKbO7mTQh0ygU/y9MchYyXGbh wHew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=KVRS2dbwL2EdiX0y9rPIxU4NY6nXK8pE6d2zwnmUmHo=; b=si0Jf4MoSGrn7sWlMBU3J5FVd4SnZ6o5T1zIopGNHrKEg/n9ygW+Oo+ziZ3c6KRZiS JY/GcQ0jgmgeT4hGK3HnvMOeMDH1b58J0llhQZqkMNsQorKVxut+8o40V5f2Js3j87nk kznya/ofEeEJzpjdqszgsiX+bjasFW2ONtkfk8z0Fyp90dVIHfZU4UotyQs4XhLnxMFz jDA1EA7CTWlsxy7hlumQx5KWDEfLhUnMYowD/j2ydC+D+SRjmA+ZxuOae5TRidC3d8uc 2xyaZkIClgQNTeMv7wxmlB+/n5OhjUByLhQyP9Vu52ICvlVlHNHVbV0ZGmDAJl+Hb10e 4Sog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=utcxfWn0; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15si9165193ots.99.2020.02.24.09.46.00; Mon, 24 Feb 2020 09:46:13 -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=@nifty.com header.s=dec2015msa header.b=utcxfWn0; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727889AbgBXRpx (ORCPT + 99 others); Mon, 24 Feb 2020 12:45:53 -0500 Received: from conssluserg-02.nifty.com ([210.131.2.81]:58605 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727474AbgBXRpv (ORCPT ); Mon, 24 Feb 2020 12:45:51 -0500 Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 01OHjfA3000853; Tue, 25 Feb 2020 02:45:42 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 01OHjfA3000853 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1582566342; bh=KVRS2dbwL2EdiX0y9rPIxU4NY6nXK8pE6d2zwnmUmHo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=utcxfWn0yW1TR7HUPR4KiWV58Gaubm+IlmcbfFTvs7khTCv3+srqLqWUigTxwOMAW fQ0sxGGEmtUcYcUZtodqHN+aG8U/OtYFpSUP/4Yy3AUQxwp3luUh8HPG4b8rIFfeVd JTsE5jPczaCQjzjiQKfPIki7yfWKJyaGU17Qk1ToIJmAWizk1EPl3nNf4CIoTFfMb1 VCRzVY771EG7It1BDHnSS3QGd71I0mvzHhJPKG8KJo5JqKNOZqZ1fwAEjCpeFkND+V RcZ4+0QscM2VCECR4xlVFmPjksoPKbCu28UcjPd7pRNlM6gK6tZlTWXTR4VByIMj5H 04VV/MV6EEQYw== X-Nifty-SrcIP: [209.85.222.43] Received: by mail-ua1-f43.google.com with SMTP id f7so3526417uaa.8; Mon, 24 Feb 2020 09:45:42 -0800 (PST) X-Gm-Message-State: APjAAAWWHvhBHE9FwEc46IABL2xs0Hn32hpVpuh7eF7yUlTUnJMWf7Nw dHIFPCnlY4czSaeRvCgxVSXTIGlluvAW7zyC/F8= X-Received: by 2002:ab0:2ea6:: with SMTP id y6mr26088960uay.25.1582566341032; Mon, 24 Feb 2020 09:45:41 -0800 (PST) MIME-Version: 1.0 References: <20200221161217.20069-1-alexandre.torgue@st.com> <20200221161217.20069-2-alexandre.torgue@st.com> In-Reply-To: <20200221161217.20069-2-alexandre.torgue@st.com> From: Masahiro Yamada Date: Tue, 25 Feb 2020 02:45:05 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v2 1/4] scripts: Add script to generate dtb build information To: Alexandre Torgue Cc: Rob Herring , Frank Rowand , Michal Marek , David Gibson , Simon Glass , DTML , Linux Kernel Mailing List , Linux Kbuild mailing list , Devicetree Compiler , Ian Lepore Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- Best Regards Masahiro Yamada