Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp275957ybf; Wed, 26 Feb 2020 12:56:38 -0800 (PST) X-Google-Smtp-Source: APXvYqzkF/oz1iRESHcyLIdY1bXTg7Ekgg/Am35epO4cYjz+ehGuRczqo9gEpeVSgYT5xKkqTpSp X-Received: by 2002:a9d:2028:: with SMTP id n37mr550460ota.127.1582750597858; Wed, 26 Feb 2020 12:56:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582750597; cv=none; d=google.com; s=arc-20160816; b=uH1sRNiX/ZqnVytmj5XdpqIHQG/ROmiDpLyj179boAOvC16V4UaNj8E3W3QqNqTr8e liWM7JUC9+2ypZmhYA2eOQVhYXyBmSiMbP6uQbGpDTAE8XIcrtyDlJv+8d17lmVigzim jhJY7PfaityOHoonp5460WtFGiLBNym6NQnY68I6eCo5uHZS+ybbOrq0KgwP8AM/d4tS 7y8J+FNIPf54WIzB3B8dtiQEIvzXt/wKaISnlOM0GRS/bzJxcGdhd/NMzpjEKpNq3EHL 793LQoxY5zWAFwS3RiYjKEJPhqrV4y6TZfVmbho4hQOariPE2hdwu6LxwN1Bl9TsTiBR UObQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=J9qgrozapssERsonDJI4GpvhEeaddHXMd1Trv7tVEP0=; b=mXpWm5e2qn/+FnQwlImCLIfFm2dJNjK/6v+JthT0d5u5bIXYoyIvr4xXpd7PitqEap 2DC3akZuuq2OVB7hGzr9PMJTJu1DLcJIq3kL7D8fNZGW2OlQZhAarM7Dsl55Gb4FD6UB RdVZ1hhFeDffXnrrBxemmQC3cCli7ahewTEHtpc+EeD5yERTmgs7JPesahAMz56YFYCT OyDXA6+qJ8ga9leX6LIqLCmmQoCFY3r+1SqWhL9OaaR9PMTR0hosVH9KDmoTlHPJHlQK k37bWMiRjSvmua1A96ST2GLUm0f6FizD9u0yz+T/aZ0cgeyZWNHHhPUjwDP7HEdXLVja Z+yA== ARC-Authentication-Results: i=1; mx.google.com; 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 j15si194415oie.15.2020.02.26.12.56.24; Wed, 26 Feb 2020 12:56:37 -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; 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 S1727479AbgBZU4R (ORCPT + 99 others); Wed, 26 Feb 2020 15:56:17 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:40978 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727387AbgBZU4R (ORCPT ); Wed, 26 Feb 2020 15:56:17 -0500 Received: by mail-oi1-f194.google.com with SMTP id i1so958277oie.8; Wed, 26 Feb 2020 12:56:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=J9qgrozapssERsonDJI4GpvhEeaddHXMd1Trv7tVEP0=; b=pWe/NpDccvchiIL49k2Tms7Y/65YFrGUcfNxnHkQzWU00QO/w4sjdPkS8xUsn+joDH GWyNu3NZJjf5LM7z/nvbbEZU4NNniGopzwUHrE3e/Z653n8C0lb58BGv9JMZVPGMw2ai bFUD3/V/3mZeym9+VDdT5wXVSnFeQAedAUO6RVSdoVqLjZRwdmUbMnK+Z8vLZlE6L4x/ XVBqHz9Xq7sqccGHtpwwzKSGtMIEybr0+/5/NooSexhn/vZ/YQAgqR0u67uha6t+rx9v 4Cqlic9bJ2jtX5CGkrzjU7yjpGXLQ5UgvyDbjzmb3I0a1MdWFYmINplDdRa1Jn7R1RCm IyQQ== X-Gm-Message-State: APjAAAUaQr16w/Xr548xU6EcED5ox0N6RLxGY1a6xR0fhEaySyI1cehX FtzotSt1h8/+x44/H2SWYA== X-Received: by 2002:aca:190a:: with SMTP id l10mr773765oii.56.1582750576567; Wed, 26 Feb 2020 12:56:16 -0800 (PST) Received: from rob-hp-laptop (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id m185sm1187716oia.26.2020.02.26.12.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 12:56:15 -0800 (PST) Received: (nullmailer pid 10421 invoked by uid 1000); Wed, 26 Feb 2020 20:56:14 -0000 Date: Wed, 26 Feb 2020 14:56:14 -0600 From: Rob Herring To: Alexandre Torgue Cc: Frank Rowand , Masahiro Yamada , Michal Marek , david@gibson.dropbear.id.au, sjg@chromium.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, devicetree-compiler@vger.kernel.org, Ian Lepore Subject: Re: [RFC PATCH v2 4/4] script: make automatic dtb build info generation Message-ID: <20200226205614.GA15331@bogus> References: <20200221161418.20225-1-alexandre.torgue@st.com> <20200221161418.20225-5-alexandre.torgue@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200221161418.20225-5-alexandre.torgue@st.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 21, 2020 at 05:14:18PM +0100, Alexandre Torgue wrote: > Append each "xxx.dtb.dts.tmp" file with "build-info" entry during dtb > build. It allows to get build information (date, source version, ...) > for each device tree without modify them manually. > > Signed-off-by: Alexandre Torgue > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > index a5af84ef4ffc..f084e78267b2 100644 > --- a/scripts/Makefile.lib > +++ b/scripts/Makefile.lib > @@ -289,6 +289,7 @@ quiet_cmd_dtc = DTC $@ > cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ > $(DTB_GEN_INFO) $(src) ; \ We regenerate this for every dtb? > $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ > + $(DTB_GEN_INFO) $(src) $(dtc-tmp) ; \ > $(DTC) -O $(2) -o $@ -b 0 \ > $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \ > -d $(depfile).dtc.tmp $(dtc-tmp) ; \ > diff --git a/scripts/gen_dtb_build_info.sh b/scripts/gen_dtb_build_info.sh > index 0cd8bd98e410..72f31e386787 100755 > --- a/scripts/gen_dtb_build_info.sh > +++ b/scripts/gen_dtb_build_info.sh > @@ -6,5 +6,7 @@ set -o nounset > DTB_DIR=$1 > DTB_COMPILE_BY=$(whoami | sed 's/\\/\\\\/') Use LINUX_COMPILE_BY #define > DTB_INFO="From Linux $KERNELRELEASE by $DTB_COMPILE_BY the $(date).\0" I'd use UTS_RELEASE and UTS_VERSION defines here. > +DTS_FILE=$2 > > -printf "$DTB_INFO" > "$DTB_DIR/dtb-build.txt" > +printf "$DTB_INFO" > "arch/arm/boot/dts/dtb-build.txt" Obviously, hardcoding this is not right. You probably need to prepend with $(obj) so this works for out of tree builds too. > +echo "&{/} {build-info = /incbin/(\"dtb-build.txt\");};" >> $DTS_FILE You could commit the .dtsi file using the above defines and then just add a #include of it here. Then we'd get dependency tracking for free. Rob