From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D87DFC4332F for ; Wed, 22 Sep 2021 17:34:59 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0E28761168 for ; Wed, 22 Sep 2021 17:34:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0E28761168 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6A33F832DB; Wed, 22 Sep 2021 19:34:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="JT7sRW3k"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1D716832C6; Wed, 22 Sep 2021 19:34:54 +0200 (CEST) Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A3BA6832C6 for ; Wed, 22 Sep 2021 19:34:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd36.google.com with SMTP id q205so4433560iod.8 for ; Wed, 22 Sep 2021 10:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3IhHakKD1v/TAl2Ftb805RWThXeqgiMnyr1GsYtUU4w=; b=JT7sRW3kgsA3eTZK0tFEyASw53lksEjE9Pd9Rc4KvSABUMoO9CJR2dVDQiN/hyIIhe afFAk/CqqqZ1y3clrtzR9Ehmp9tssE7pw1PLMiTRzwNAHsah9//8HGJCD2duJkQCsw3o 5RxyYlAYuQRsiWCBdK6ATgSemKFlubgDVttV0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3IhHakKD1v/TAl2Ftb805RWThXeqgiMnyr1GsYtUU4w=; b=xOYNb9zSfpfZFiiyNSZM4y512vcDrFDUX2f6+hBtq01xBvuQRzsZy2OrWkSBtJd9p4 R3RyuD5q0f/+Gfl5hT8oKD20kBmxd39PB6xKuIxqss7rluuoe3MXVo+BAShAqOtID7Aa GWjXF+pyCvvInuldLOQ73qyaFH0a5iN8qO0211GZC6SPYbojrncEhc4TvmWV5FIZRS70 CSA9cSCX+yUrdHY02T9IhcPOPGoP7SBDG7DdejvBGIQf5A8eDG6SPYmLz1d8jHf8/M1e uB3/A2h7VE46SeSIOsn5eDwKdSjr+qsm3Qc1K67F1Akk01J4dn02cUf6jF72w0Q6c0kq u1bQ== X-Gm-Message-State: AOAM531fz0zOV9fOO3+D72Ikt499cCKRMJXngEsB5qvdOxllFruFoEVA m+9WfrMhkacALG84c1dMl5nmXJYjNwpCHA== X-Google-Smtp-Source: ABdhPJz1Ewm+xA0mGRxRycDyuX+O7c2Z0rvyOg36Mjy7mrqF/oZWbxuzjFZd2YhOftZjYuYHwVSaag== X-Received: by 2002:a6b:4f04:: with SMTP id d4mr140155iob.95.1632332088306; Wed, 22 Sep 2021 10:34:48 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id b2sm1320124ilj.72.2021.09.22.10.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 10:34:47 -0700 (PDT) From: Simon Glass To: Tom Rini Cc: Marek Vasut , Vagrant Cascadian , Masahiro Yamada , Heinrich Schuchardt , Simon Glass , u-boot@lists.denx.de Subject: [PATCH v3 1/2] Revert "kbuild: remove unused dtc-version.sh script" Date: Wed, 22 Sep 2021 11:34:43 -0600 Message-Id: <20210922173444.192256-1-sjg@chromium.org> X-Mailer: git-send-email 2.33.0.685.g46640cef36-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean We need this to make building dtc optional. It makes no sense to build our own dtc if the system one works correctly. This reverts commit ddb87a0b40262ff99d675e946f57427642303938. Signed-off-by: Simon Glass --- Changes in v3: - Add an SPDX header and MAINTAINERS entry MAINTAINERS | 1 + scripts/Kbuild.include | 1 + scripts/dtc-version.sh | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100755 scripts/dtc-version.sh diff --git a/MAINTAINERS b/MAINTAINERS index 67c96a60454..294d78b52e2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -757,6 +757,7 @@ F: include/fdt* F: include/linux/libfdt* F: cmd/fdt.c F: common/fdt_support.c +F: scripts/dtc-version.sh FREEBSD M: Rafal Jaworowski diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index a745cc4fccd..09506cb9a7e 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -148,6 +148,7 @@ cc-ifversion = $(shell [ $(cc-version) $(1) $(2) ] && echo $(3) || echo $(4)) # added for U-Boot binutils-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/binutils-version.sh $(AS)) +dtc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/dtc-version.sh $(DTC)) # cc-ldoption # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) diff --git a/scripts/dtc-version.sh b/scripts/dtc-version.sh new file mode 100755 index 00000000000..bd4e818e92d --- /dev/null +++ b/scripts/dtc-version.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0+ +# +# dtc-version dtc-command +# +# Prints the dtc version of `dtc-command' in a canonical 6-digit form +# such as `010404' for dtc 1.4.4 +# + +dtc="$*" + +if [ ${#dtc} -eq 0 ]; then + echo "Error: No dtc command specified." + printf "Usage:\n\t$0 \n" + exit 1 +fi + +MAJOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 1) +MINOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 2) +PATCH=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 3 | cut -d - -f 1) + +printf "%02d%02d%02d\\n" $MAJOR $MINOR $PATCH -- 2.33.0.685.g46640cef36-goog