Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5185539ybl; Wed, 22 Jan 2020 11:56:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzl39cTO8osUPkPUJ8bbIa7J6qspQVjywOMUwmJVsulPilkJSodKIBNIfO5ufjzlQStThxw X-Received: by 2002:aca:e084:: with SMTP id x126mr7856457oig.97.1579722960369; Wed, 22 Jan 2020 11:56:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579722960; cv=none; d=google.com; s=arc-20160816; b=mEyy4Lgt5o+WjmoEKGRo5T27RumM2RCu8daobQJgzQRQm6ODmdzZfeboBa/eH0KgRC jhCXo+xiyONteAAc35SLGhfja8P6sZmNEw17w2yDlcnuVh3DQU2zO4Uqy6WUkK3OjNcE k43eCII7m3qx+vTHPVXkhgolw+K1NeY8fEa+/r6vLc5BD/NkY+e3NXvDVICDxAf5R4jk QbzKUQ6xmLxexZACfiTtqn56KjaossF4ZXwXokTuZQyAWyHKjm4kNawbyyJpsaCdmcg8 RLoYAmUnEp7gLmDokY8DDA+GE+0ZJVNLO2FYlVL6V4LXQjlt3ZCiPf/XBCB5X+qQ6Ku/ ZuIQ== 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:references:cc:to:from:subject:dkim-signature; bh=EZR9vaas7bAWCxVDL5nyN/PGL7NvMxgw0YZinV/QQGA=; b=e1nRTUDNLzT37fW1+syvCHrF++E9vte66H6lvpv1KsM+5mu4GEOQFuPaolvuM1G4a/ Z9IzZvFKNSGt+keJZ2/Yw6P234RGi4YoqVHqqdTwsdB/R8LSHDjkzPMGLTFSm7IaJnuQ ilFZehpOWW6WD4Ng7St4KzelJ31qpjo8cVn2JIdtoY+7lA/HGVbOTStyxUXZvEd5xCpS S4e1gM1OCwCn/zWQcMbm4XZgOa341ePsmpQIv2P3W8i0f51xlN4PH2wnV3WjNE9db2xo ZoPzkC4fSMz4Pef2mOTe0RVNlMEXftmwwcwElz5ytQ/78W5DLDiFOAsKf5AgrTd60oT2 hEBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=STDrf55Y; 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 b9si21585733oie.20.2020.01.22.11.55.47; Wed, 22 Jan 2020 11:56:00 -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=STDrf55Y; 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 S1726099AbgAVTyv (ORCPT + 99 others); Wed, 22 Jan 2020 14:54:51 -0500 Received: from mail-yb1-f193.google.com ([209.85.219.193]:45114 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbgAVTyu (ORCPT ); Wed, 22 Jan 2020 14:54:50 -0500 Received: by mail-yb1-f193.google.com with SMTP id x191so406910ybg.12; Wed, 22 Jan 2020 11:54:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=EZR9vaas7bAWCxVDL5nyN/PGL7NvMxgw0YZinV/QQGA=; b=STDrf55YeSKcIvivvP9GGXphgttIjmMcsAq2dtZZNykIhI21PqqNwooXhESYh0ISYU VQR3IQ3xG1EFqOObWcXw9roFCfhG8zaKOiF62htrLmZJr/sF+klLScqOCSOAwTklDjXS YMRK9/oNYZuaVk5eiHTEERYe7GnWsSV2oeF1S5HKqlSJoFTaEGxX12I4Yb7/vShf3tGe wndIO1zgFdEOqu/DiVL+gbMopirtVAeDB1XBSIKblqmEroqjTxLMKfUVglR8pY1mOp2c JlDidRGNJVapaK4qS43h38sq5te/d1CoeKzix+kK4N1S02smKfs3hIVSRYMxEVhq42n7 K61w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EZR9vaas7bAWCxVDL5nyN/PGL7NvMxgw0YZinV/QQGA=; b=qY9LRbG+TM/Vt8Uou/MvWjm5JE17ykjbEzHsJyAnVgMcF5WsLZFQi2pZC7G4SSRSZC 2qRGHCv0TApiUdNMdm/T1/iR+yYEvXTFLvS1/JuF3Uaz7Z3w714kDfkRMnqsP/F1BYJz +ffGBI4Rks7SS6tnj+D1lrQ3MsB2SKnzCrqkQg5iFFzGbFql2z8Ef+GBbKPjuCW251Kv ZSsDrW8UVz4W5QdE9Cua6BfTfvQ/2N4ncLLbmY8H83i4i6U2e8nS6sbxI8ScMK6F/C7S YsjSs7kJF5I25bSeJvspfsqHBHUGB9o3ekQnruspE0FTmH+gjDttv5g+zDj4hKjBeuwS aohA== X-Gm-Message-State: APjAAAWIQawJozanw6vY8bbWVtmHFormP11k+aHPabOXthZ0l6AtvrEy 8MBGumSfAH9swM6s2N1aBtg= X-Received: by 2002:a25:d9d3:: with SMTP id q202mr8847541ybg.276.1579722889490; Wed, 22 Jan 2020 11:54:49 -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 p62sm18690989ywc.44.2020.01.22.11.54.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jan 2020 11:54:49 -0800 (PST) Subject: Re: [RFC PATCH 3/3] scripts: Use -B dtc option to generate dtb build information. From: Frank Rowand To: Alexandre Torgue , robh+dt@kernel.org, Masahiro Yamada , Michal Marek , david@gibson.dropbear.id.au, sjg@chromium.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, devicetree-compiler@vger.kernel.org References: <20200113181625.3130-1-alexandre.torgue@st.com> <20200113181625.3130-4-alexandre.torgue@st.com> Message-ID: <0b2fbafb-0de0-ae1c-08c7-95e52f46ca43@gmail.com> Date: Wed, 22 Jan 2020 13:54:48 -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 On 1/17/20 1:20 PM, Frank Rowand wrote: > On 1/13/20 12:16 PM, Alexandre Torgue wrote: >> This commit adds a new script to create a string in tmp file with >> some information (date, linux version, user). This file is then used by >> dtc with -B option to append dts file with a new property. >> During kernel boot it will then be possible to printout DTB build >> information (date, linux version used, user). >> >> Signed-off-by: Alexandre Torgue >> >> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib >> index 3fa32f83b2d7..6a98eac1e56d 100644 >> --- a/scripts/Makefile.lib >> +++ b/scripts/Makefile.lib >> @@ -235,6 +235,7 @@ quiet_cmd_gzip = GZIP $@ >> # DTC >> # --------------------------------------------------------------------------- >> DTC ?= $(objtree)/scripts/dtc/dtc >> +DTB_GEN_INFO ?= $(objtree)/scripts/gen_dtb_build_info >> >> # Disable noisy checks by default >> ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),) >> @@ -275,11 +276,13 @@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE >> >> quiet_cmd_dtc = DTC $@ >> cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ >> - $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ >> - $(DTC) -O $(2) -o $@ -b 0 \ >> + $(DTB_GEN_INFO) $(@).info ;\ >> + $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ >> + $(DTC) -O $(2) -o $@ -b 0 -B $(@).info\ >> $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \ >> - -d $(depfile).dtc.tmp $(dtc-tmp) ; \ >> - cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) >> + -d $(depfile).dtc.tmp $(dtc-tmp) ; \ >> + rm $(@).info ; \ >> + cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) >> >> $(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE >> $(call if_changed_dep,dtc,dtb) >> diff --git a/scripts/gen_dtb_build_info b/scripts/gen_dtb_build_info >> new file mode 100755 >> index 000000000000..30cf7506b9d5 >> --- /dev/null >> +++ b/scripts/gen_dtb_build_info >> @@ -0,0 +1,11 @@ >> +#!/bin/sh >> +# SPDX-License-Identifier: GPL-2.0 >> + >> +DTB_TARGET=$@ >> +COMPILE_BY=$(whoami | sed 's/\\/\\\\/') >> + >> +touch $DTB_TARGET >> + >> +{ >> + echo From Linux $KERNELRELEASE by $COMPILE_BY the $(date). A nit, the trailing period is not needed. Not a big deal one way or the other. >> +} > $DTB_TARGET >> > > This specific set of information does not seem to me to be sufficient > to be of much use. In my previous attempt to capture build time > information into the DTB I included more information that this, > which I felt provided more of the information that would be valuable > to a developer (or testing person) in a development environment, > test environment, or on an end user system. The exact set of > information is easy to bike shed over, but one could explain what > information might be useful and why (I did not provide that explanation > in my patch series, but in retrospect should have). On reflection, this information is sufficient. My concern was that a unique version number was not provided. But the unique version number _is_ provided by the date, which is hh:mm:ss, so sufficient if the dtb is not compiled more often than once per second. So good enough for the debugging environment.