From patchwork Thu Jan 7 04:21:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1423136 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=f42GtH3E; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4DBCkb1B7jz9sVt for ; Thu, 7 Jan 2021 15:22:31 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EE347827A7; Thu, 7 Jan 2021 05:22:18 +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="f42GtH3E"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6D02B82753; 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-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (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 7C1B082753 for ; Thu, 7 Jan 2021 05:22:13 +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-io1-xd30.google.com with SMTP id p187so4971126iod.4 for ; Wed, 06 Jan 2021 20:22:13 -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=rtjKtKZJ46fWrtWy1wmtE+DmQ3kzMusoSe3znPsyQBk=; b=f42GtH3En7tchuix5sdCIxPayeqSeMMkwdTfM9knwJjJPowRYXVEDCGIBoZOKJDekY FbZPS75f/aBfHqVJK62t/cQ91Q/hao1iHA6Ya1uNi13OZ8ljiP4u0CYstopu/2JkUSaZ 2qgusjlARkZV0QJe63KzBpVxNSUp5gQgpHuwE= 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=rtjKtKZJ46fWrtWy1wmtE+DmQ3kzMusoSe3znPsyQBk=; b=mQb/SA7/TfZC+jLd6vLLFuQXnK8wvi0U4PLztXWIlDNUtel28hiPWyYGhCgo2Kuv5g ddajXAaol3JEZCDqDkJEFKsMH92mqxixfL3kepDAJsVr+yDiwi0hjGO99lkUGZINwryW V/E37teH2hFiKxMYzbkhVZZKN9QFl3UnQOyZUt5DTNRDkCeBseuux5lYo4VucmGISwb+ JhJus5msM/Gmh2Aegsxq4URSfMSFevlJ1oeQtsWtE29ZYbP8xdRdWVYK5WD/Kz1JvH64 0vz4+0z3TIT3x5pWeTdooW8DLCYlMv09gYYOUi/mpXS5dQXsRT8L0mmHChIlE8qJQ6bb VqLA== X-Gm-Message-State: AOAM531wC5qdK6ULRPPFA064V7C/xDkJ1kK7fU7J2gCm9FL9kE3lxvt2 ytK/MpDGBCBt6yI/0Fqt8MFxtRw6TlJY0V0H X-Google-Smtp-Source: ABdhPJwYEYmfIcSYzfiCizb0Zp7cPn8ptQ0fcwBQv+7MnxDbdJrSyyKbfZtNebVfFd0slKQ3xrze4w== X-Received: by 2002:a02:8791:: with SMTP id t17mr6525521jai.28.1609993331857; Wed, 06 Jan 2021 20:22:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jan 2021 20:22:11 -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 , Marek Vasut , Naoki Hayama , Patrick Delaunay Subject: [PATCH 01/10] README: Add doumentation for version information Date: Wed, 6 Jan 2021 21:21:53 -0700 Message-Id: <20210106212153.1.I2ac81b51676077a69e5198108cdb3d0525a0f65d@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 There are quite a few available version options in U-Boot. Add a list of the available Makefile variables and #defines, along with examples. Signed-off-by: Simon Glass Reviewed-by: Patrick Delaunay --- README | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/README b/README index 5ca11f25ee5..02ed0504455 100644 --- a/README +++ b/README @@ -1830,6 +1830,90 @@ The following options need to be configured: Time to wait after FPGA configuration. The default is 200 ms. +- Version identification: + + U-Boot releases are named by year and patch level, for example + 2020.10 means the release that came out in October 2020. + Release candidates are tagged every few weeks as the project + heads to the next release. So 2020.10-rc1 was the first + release candidate (RC), tagged soon after 2020.07 was released. + + See here for full details: + https://www.denx.de/wiki/view/U-Boot/ReleaseCycle + + Within the build system, various Makefile variables are created, + making use of VERSION, PATCHLEVEL and EXTRAVERSION defined at + the top of 'Makefile'. There is also SUBLEVEL available for + downstream use. See also CONFIG_IDENT_STRING. + + Some variables end up in a generated header file at + include/generated/version_autogenerated.h and can be accessed + from C source by including + + The following are available: + + UBOOTRELEASE (Makefile) + Full release version as a string. If this is not a + tagged release, it also includes the number of commits + since the last tag as well as the the git hash. If + there are uncommitted changes a '-dirty' suffix is + added too. + This is written by scripts/setlocalversion + (maintained by Linux) to include/config/uboot.release + and ends up in the UBOOTRELEASE Makefile variable. + + Examples: + 2020.10-rc3 + 2021.01-rc5-00248-g60dd854f3ba-dirty + + PLAIN_VERSION (string #define) + This is UBOOTRELEASE but available in C source. + + Examples: + 2020.10 + 2021.01-rc5-00248-g60dd854f3ba-dirty + + UBOOTVERSION (Makefile) + This holds just the first three components of + UBOOTRELEASE (i.e. not the git hash, etc.) + + Examples: + 2020.10 + 2021.01-rc5 + + U_BOOT_VERSION (string #define) + "U-Boot " followed by UBOOTRELEASE, for example: + + U-Boot 2020.10 + U-Boot 2021.01-rc5 + + This is used as part of the banner string when U-Boot + starts. + + U_BOOT_VERSION_STRING (string #define) + U_BOOT_VERSION followed by build-time information + and CONFIG_IDENT_STRING. + + Examples: + 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 + + Build date/time is also included. See the generated file + include/generated/timestamp_autogenerated.h for the available + fields. For example: + + #define U_BOOT_DATE "Jan 06 2021" (US format only) + #define U_BOOT_TIME "08:50:36" (24-hour clock) + #define U_BOOT_TZ "-0700" (Time zone in hours) + #define U_BOOT_DMI_DATE "01/06/2021" (US format only) + #define U_BOOT_BUILD_DATE 0x20210106 (hex yyyymmdd format) + #define U_BOOT_EPOCH 1609948236 + + The Epoch is the number of seconds since midnight on 1/1/70. + Every time you build U-Boot this will update based on the time + on your build machine. See 'Reproducible builds' if you want to + avoid that. + - Configuration Management: CONFIG_IDENT_STRING