linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH, v2] kbuild: doc: improve KBUILD_BUILD_TIMESTAMP documentation
@ 2025-10-17  2:12 Gang Yan
  2025-10-17 19:54 ` Nicolas Schier
  2025-10-22 21:20 ` Nicolas Schier
  0 siblings, 2 replies; 4+ messages in thread
From: Gang Yan @ 2025-10-17  2:12 UTC (permalink / raw)
  To: Nathan Chancellor, Nicolas Schier, Jonathan Corbet,
	David Disseldorp, linux-kbuild, linux-doc
  Cc: Gang Yan

From: Gang Yan <yangang@kylinos.cn>

This patch adds an example of how to set KBUILD_BUILD_TIMESTAMP to a
specific date. Also, note that the provided timestamp is used for
initramfs mtime fields, which are 32-bit and thus limited to dates
between the Unix epoch and 2106-02-07 06:28:15 UTC. Dates outside this
range will cause errors.

Suggested-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Gang Yan <yangang@kylinos.cn>
Reviewed-by: David Disseldorp <ddiss@suse.de>
---
Changelog:
 v2:
  - Replace the invalid example with a valid one.
  - Apply David's suggestions.
---
 Documentation/kbuild/kbuild.rst | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst
index 3388a10f2dcc..881189ecd0ca 100644
--- a/Documentation/kbuild/kbuild.rst
+++ b/Documentation/kbuild/kbuild.rst
@@ -328,8 +328,14 @@ KBUILD_BUILD_TIMESTAMP
 ----------------------
 Setting this to a date string overrides the timestamp used in the
 UTS_VERSION definition (uname -v in the running kernel). The value has to
-be a string that can be passed to date -d. The default value
-is the output of the date command at one point during build.
+be a string that can be passed to date -d. E.g.::
+
+$ KBUILD_BUILD_TIMESTAMP="Mon Oct 13 00:00:00 UTC 2025" make
+
+The default value is the output of the date command at one point during
+build. If provided, this timestamp will also be used for mtime fields
+within any initramfs archive. Initramfs mtimes are 32-bit, so dates before
+the 1970 Unix epoch, or after 2106-02-07 06:28:15 UTC will fail.
 
 KBUILD_BUILD_USER, KBUILD_BUILD_HOST
 ------------------------------------
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-22 21:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17  2:12 [PATCH, v2] kbuild: doc: improve KBUILD_BUILD_TIMESTAMP documentation Gang Yan
2025-10-17 19:54 ` Nicolas Schier
2025-10-17 23:16   ` GangYan
2025-10-22 21:20 ` Nicolas Schier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).