Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2729552ybl; Mon, 20 Jan 2020 08:17:16 -0800 (PST) X-Google-Smtp-Source: APXvYqyh4Aq/Z7MYRtvoIRGBNlZpOK9QMK+caVthiNqToHtuIBMnZbVqJmIzcE6pbmT8uAjEvx5L X-Received: by 2002:aca:1913:: with SMTP id l19mr33460oii.47.1579537036727; Mon, 20 Jan 2020 08:17:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579537036; cv=none; d=google.com; s=arc-20160816; b=ob/MwV0ZldaQaB2IbJ1MWnkDKl9Xo/p/HWXGImcLvVz9cFwRoFlia/zJnJoX11kkPU 9rRjmrXTqW7xD2HXNpEtyux00X8JixOog4FO+3X6k6sI5/iGcWZv91m/2A3xGgCDfvnv zCbnJrapSEl9M1VtnkfoE+UzH3H8++SmpbDyPPsdrYM+CYiqXs4KrFtHw+zv0t7VGceL 8sb9bkglBD+VMb2hYx4LWwrmyApFSjybV8tzj0seWqHLywsiGykV+O09G5BhxDEMM8Gv YY8L+0bZhRRLSvaBQlAUl/ssjRUjULSqcuuIbJLnaXRlBCpmOzRs0qpsy5lzEW62fHb0 tUCQ== 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=dMR2QJBU8mwguXzF24MAtQqBj4xzoWj1UhHfZ6DEbQU=; b=D5Q2OfBaeKZbFIsnfQVgLldYgGsZ0tCIUnJOf0WZW8SvQ2/CDpGl3uTFBdTQnUFW6y v5r1nRSXndnmMUu+OFqESp5pEYGS13Qtr+6G11vBPZ3vbPRHLgYVwGuTx8XQbwErHGjd 7PNlhn3aKcbdVyorzoFFTa8KCZsUz7UxlZ5uGnk4NAZLgxEIwdjhFPSFvTD+zu+AwMQ8 DADvYAKHTfPsYp8ZwP81wu5K2A88uMw5bXxpC5lhBA57ntoKUgwI+gLZ0es/jwkL9D/h t2AfBHQm7wYibvpFh4voR0a7cvS+wVMd9qs7xK3M0ZzkvO9U7Gj28ZL93pUgROmoduuZ LT7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=l6vSuXn0; 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 f17si19708424otq.96.2020.01.20.08.17.02; Mon, 20 Jan 2020 08:17:16 -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=l6vSuXn0; 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 S1728783AbgATQQI (ORCPT + 99 others); Mon, 20 Jan 2020 11:16:08 -0500 Received: from mail-yw1-f66.google.com ([209.85.161.66]:33416 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726876AbgATQQH (ORCPT ); Mon, 20 Jan 2020 11:16:07 -0500 Received: by mail-yw1-f66.google.com with SMTP id 192so74235ywy.0; Mon, 20 Jan 2020 08:16:07 -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=dMR2QJBU8mwguXzF24MAtQqBj4xzoWj1UhHfZ6DEbQU=; b=l6vSuXn0iQNJtBxu529TjmBhwLNJihjMleP6uAWGtww6EEirV0ECyzCD+JyhDY8l/h kgr7jaJqqHkvG7jN8Ry3cAW0p9xmmWnH+PRyvapw0Zzbre3M9luzSErDmil5ltMWqkQj 89lHeyacBjV5dLQ74tP4dU1g/hgOO2zoptyv+6bCoHgv7wXweeMTtwmTy9LTRRj9R4tE /AdvK2RoTJS85dloI5jhYngyrZxKaYdwTQ3RNtH3f9PEWudTFCIke7dafsTBAZR1ZHnJ OOs5ZRZ+3A/c82goic1SvVXZyTZtlm7XawaUj9tePNAaEFmN82GduiaywpJ35hXHlanY JhsQ== 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=dMR2QJBU8mwguXzF24MAtQqBj4xzoWj1UhHfZ6DEbQU=; b=OqmeWCYv+UFt1kVIBcWY3AsbQLNduEvRv/ApYkwEmsNUQzR7XIK44AQWCq25J2f8+9 xZfADq6WeVco2VaJCoPym4czoWQc05cLxhLk7sEWB7fmaqcirqrVrdg+NscgkpzDSMeM 5xm/clxeaDFRnp5d76wp14rMDzYsdTbz2dxPgsUZrBJRVCc35AwUiuIERPutTYgazCvf pPNI1g3Xru52rO182vm7u3g/l8bVvwD8s9GPtPilqThjN9t0EgaKCKhJ5ptAOQLVXvc+ JuvpFGKjONyz4xTV1+5NiRBlGYBKtG1OiTgKPdU4pKiKXck+8XDrSFn24k75FSvpuDci 982w== X-Gm-Message-State: APjAAAXPmt4EdAZ7rwNrk/WkVxrpOT2BBfzefwm/sL0KzGyE1HnTYJHt axDhYnVj5+eO+mxUbiE2OlI= X-Received: by 2002:a0d:fb46:: with SMTP id l67mr42006467ywf.38.1579536966644; Mon, 20 Jan 2020 08:16:06 -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 f138sm16113793ywb.99.2020.01.20.08.16.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jan 2020 08:16:06 -0800 (PST) Subject: Re: [RFC PATCH 3/3] scripts: Use -B dtc option to generate dtb build information. 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> From: Frank Rowand Message-ID: <5b5a40b5-6954-05aa-5c7f-5ae8100aa1ee@gmail.com> Date: Mon, 20 Jan 2020 10:16:05 -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: <20200113181625.3130-4-alexandre.torgue@st.com> 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/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) The indentation should be tabs instead of spaces. -Frank > > $(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). > +} > $DTB_TARGET >