From patchwork Thu Jan 7 04:21:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1423137 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=L/PDDc/9; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DBCkp1G09z9sW0 for ; Thu, 7 Jan 2021 15:22:42 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6CD5D827AE; Thu, 7 Jan 2021 05:22:21 +0100 (CET) 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="L/PDDc/9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A07A4827AE; Thu, 7 Jan 2021 05:22:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (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 72D108279C for ; Thu, 7 Jan 2021 05:22:14 +0100 (CET) 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-il1-x130.google.com with SMTP id q5so5488526ilc.10 for ; Wed, 06 Jan 2021 20:22:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TXrf5x/Kv8lZXB2cdShc7q6XyCG/4jywNCrKEokS72U=; b=L/PDDc/9ivMuAMwXDo1VZ9eVf1YJE1fnJUGmHQ3EIYgqDuH46NfxjoAwqotFu60emX YWmCFove3HJrfdRjfDlL/MD/nifKQNXTYDraA35nhLrrkwe3vf9XedVvZ7SgYby8frhV 8vzyNfxCBlKRGedHwk8fmIRcraiLtCpZozxCM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TXrf5x/Kv8lZXB2cdShc7q6XyCG/4jywNCrKEokS72U=; b=hYgQspd8sPui2vXESU6h4S2+MCh6HXaxvoApKE9F2BbsuunUvLhhE9gz2C1hjXFUxz +t2ZTw7tAWDFnYZwsvJOWBQqoIrWLagmqgkd21NfiLy9Xt0kuTfv5b1qdzyh9kUlhhGQ RSiI1aC9xYHcjLTecxKty7KOYRn1Y3HiwWavtKGt6iDyB/D6p1zaWWNDyp63PknnLJf+ tJVxgMNsmLkxne1tF8gBKJ4lNSZleX9QDDZ9Zu6971CVRqcQXW/gfvBTwFn5o3CN4z4s EbHlXSwJRsITeSYGNfanxlrXTP8QEeRU5AY/VMEp/Tn3hwDDpFZph06lesrcCytwSckk LbLg== X-Gm-Message-State: AOAM533cCGqV9M+Q7UDFp5H22IoXSDw7ZjZYt6/xARzmMVH1hlWVND6K 56b2AB7vRFd/X2IZ3FTZD0xF36K+rT3+A8WH X-Google-Smtp-Source: ABdhPJzJMMlRtBdvxvkTlW7rkdv3tndF8I/6iRn5rd6K9Yy1ibYTFZHOM1qaJTFZNPyftueHp4FSpA== X-Received: by 2002:a92:dc11:: with SMTP id t17mr7333393iln.307.1609993333055; Wed, 06 Jan 2021 20:22:13 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id s1sm2793419iot.0.2021.01.06.20.22.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jan 2021 20:22:12 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Adam Ford , Bin Meng , Jagan Teki , Kever Yang , Marek Vasut , Masahiro Yamada , Naoki Hayama , Patrick Delaunay Subject: [PATCH 02/10] Makefile: Provide numeric versions Date: Wed, 6 Jan 2021 21:21:54 -0700 Message-Id: <20210106212153.2.I9efe8832e785f28cb7c4bb98d6df6322fc756150@changeid> X-Mailer: git-send-email 2.29.2.729.g45daf8777d-goog In-Reply-To: <20210107042202.2600568-1-sjg@chromium.org> References: <20210107042202.2600568-1-sjg@chromium.org> MIME-Version: 1.0 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.102.3 at phobos.denx.de X-Virus-Status: Clean For SMBIOS we want to store the numeric version numbers in the tables. It does not make sense to parse the strings. Instead, add new #defines with the version and patchlevel. Signed-off-by: Simon Glass Reviewed-by: Patrick Delaunay --- Makefile | 4 ++++ README | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 110296be82f..c2b7046ce3b 100644 --- a/Makefile +++ b/Makefile @@ -1846,9 +1846,13 @@ prepare: prepare0 # Generate some files # --------------------------------------------------------------------------- +# Use sed to remove leading zeros from PATCHLEVEL to avoid using octal numbers define filechk_version.h (echo \#define PLAIN_VERSION \"$(UBOOTRELEASE)\"; \ echo \#define U_BOOT_VERSION \"U-Boot \" PLAIN_VERSION; \ + echo \#define U_BOOT_VERSION_NUM $(VERSION); \ + echo \#define U_BOOT_VERSION_NUM_PATCH $$(echo $(PATCHLEVEL) | \ + sed -e "s/^0*//"); \ echo \#define CC_VERSION_STRING \"$$(LC_ALL=C $(CC) --version | head -n 1)\"; \ echo \#define LD_VERSION_STRING \"$$(LC_ALL=C $(LD) --version | head -n 1)\"; ) endef diff --git a/README b/README index 02ed0504455..afa33dc7f30 100644 --- a/README +++ b/README @@ -1898,6 +1898,14 @@ The following options need to be configured: U-Boot 2020.10 (Jan 06 2021 - 08:50:36 -0700) U-Boot 2021.01-rc5-00248-g60dd854f3ba-dirty (Jan 06 2021 - 08:50:36 -0700) for spring + U_BOOT_VERSION_NUM (integer #define) + Release year, e.g. 2021 for release 2021.01. Note + this is an integer, not a string. + + U_BOOT_VERSION_NUM_PATCH (integer #define) + Patch number, e.g. 1 for release 2020.01. Note + this is an integer, not a string. + Build date/time is also included. See the generated file include/generated/timestamp_autogenerated.h for the available fields. For example: