Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2245162ybv; Fri, 21 Feb 2020 11:39:09 -0800 (PST) X-Google-Smtp-Source: APXvYqxO+I0Y/1dP+2IS+/wslS1nkGMWoWyvnB9QhEaC9W7O0PnqZM/c33wDJDyG1DiXIKIbw6BN X-Received: by 2002:aca:3114:: with SMTP id x20mr3357209oix.121.1582313949008; Fri, 21 Feb 2020 11:39:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582313948; cv=none; d=google.com; s=arc-20160816; b=PbJCUe3unMMgVfEhvL3DrYpEytoWv3x5i5RGhks7/hnMwAhc8S0MSuiNNHI1O0k9SX XKjBNw4zi/iMn6VzAaguLbSbIG3bVDMtnICoALLoDvcsA8AYcmnkLwT3WeuQ0EwhSHjU TbwGLAeXs4VuVdp/Y8Fc7m4bARZnm4gLiXs1iT8o9GRhUXu2Jk99HDW7aunjVroYYTgx 2hnfAOOBu5Lj9rWZRGNrfLqca7bxVXz3Hi6F268rkm0JN9c8O/X6IQQ333uHy2a3Whfw zIZDyWL1DRn7x2PqITxZFf0IfOv/nfCQ2a/oLnn5Iu6kSdg46FGTf968hkyoJukrrMJb DKnA== 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; bh=T21Yt+MC0EbdfVqXx6ysOz+j3jlMH4DjsqX+LX5auS0=; b=Xtn2WOpy/ACqzpKRaIM16rrn2ITyNez2ohdBe/GFhNEjhaNV4S9iwc/0Svv0Qh4D9u ofJP2J/TxVoQ4DZtkzrfhG9Gxrv2PjAszlyasUCV4Wcg/nZSJSHpTHnKqIuhbdlTZ1Kg G7ZOaApOwQZa2Wb7p7N/IJFxjHwzWAlRPv281a5C+mFEWb4lrPJpncOlNEFDgNg7K2XD MYB/zTG2R7Pzd/k6SAPyf5YUeE2G47i5sOAOSMX7K9VIWOhPrk21yTgLhpgNraP8Vv/2 wMOVtGoXOiXrOXRFGlEHHXPf2MYy1dX+OMA5VHAQqdoBUnlXpyuc0I2piE4hmcdu1Hab zbqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lSKHq40h; 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=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 h18si1825433otj.114.2020.02.21.11.38.55; Fri, 21 Feb 2020 11:39:08 -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=@kernel.org header.s=default header.b=lSKHq40h; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726725AbgBUTis (ORCPT + 99 others); Fri, 21 Feb 2020 14:38:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:35392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726160AbgBUTis (ORCPT ); Fri, 21 Feb 2020 14:38:48 -0500 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 10D46208C4; Fri, 21 Feb 2020 19:38:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582313927; bh=EEkZlC+I38fRKP6ziqRCvYvuuIeevZ+KKVHywn56mIo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=lSKHq40hs1M19YD7sOxUNFDFS+a1h50X64VxCq+PakYXlJeADg7DcA3iat/R3ND5r NBztjxKxeObSrBRP4eJlhb0YrH7+D/OcTKGrGIy7dztPBMg6aZiG1IXmiSeXHFAeET 5OkECh3IMxLo2OqHs0+kHkRN6c2239scLdmpYumc= Received: by mail-qk1-f181.google.com with SMTP id t83so2939496qke.3; Fri, 21 Feb 2020 11:38:47 -0800 (PST) X-Gm-Message-State: APjAAAUImARs3TZpXprIcHG9kaPw6o7AGPIUQAG1kg4y6YRLdBbw9jPK JBnJhdIZRQulqyK8g6CQi4A+NMBopdT9L3tXzA== X-Received: by 2002:a37:6457:: with SMTP id y84mr36111932qkb.254.1582313926194; Fri, 21 Feb 2020 11:38:46 -0800 (PST) MIME-Version: 1.0 References: <20200221161418.20225-1-alexandre.torgue@st.com> <20200221161418.20225-2-alexandre.torgue@st.com> <592e41a4-6115-474e-b6ce-eeb82f858a78@gmail.com> In-Reply-To: <592e41a4-6115-474e-b6ce-eeb82f858a78@gmail.com> From: Rob Herring Date: Fri, 21 Feb 2020 13:38:34 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v2 1/4] scripts: Add script to generate dtb build information To: Frank Rowand Cc: Alexandre Torgue , Masahiro Yamada , Michal Marek , David Gibson , Simon Glass , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , 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 On Fri, Feb 21, 2020 at 11:52 AM Frank Rowand wrote: > > On 2/21/20 10:14 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"); > > s/.txt/.dtsi/ > > and same wherever the file name is used. > > > > ... > > }; > > > > 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" > > I would remove the filler words "From", "by", "the", and the trailing > period ('.'). > > > You might consider using a format more like the Linux > kernel version line, which puts parenthesis around the > compiled by info. IMO, we should use exactly the Linux kernel version line. Or exactly the u-boot version line when built in u-boot. Rob