Linux kbuild/kconfig development
 help / color / mirror / Atom feed
* [PATCH] kbuild: doc: describe the error caused by pre-epoch timestamp
@ 2025-10-16  6:08 Gang Yan
  2025-10-16 10:38 ` David Disseldorp
  0 siblings, 1 reply; 2+ messages in thread
From: Gang Yan @ 2025-10-16  6:08 UTC (permalink / raw)
  To: Nathan Chancellor, Nicolas Schier, David Disseldorp, linux-kbuild
  Cc: Gang Yan

From: Gang Yan <yangang@kylinos.cn>

This patch documents the compilation error that occurs with a pre-epoch
KBUILD_BUILD_TIMESTAMP. By providing an example command and the resulting
error, it helps users identify and avoid this issue.

Suggested-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Gang Yan <yangang@kylinos.cn>
---
 Documentation/kbuild/kbuild.rst | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst
index 3388a10f2dcc..1ffc782d2061 100644
--- a/Documentation/kbuild/kbuild.rst
+++ b/Documentation/kbuild/kbuild.rst
@@ -331,6 +331,15 @@ 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.
 
+However, when the date command retrieves a timestamp that falls into
+pre-epoch times (i.e., dates before the Unix epoch, January 1, 1970),
+the kernel will raise an error during the compilation of initramfs. E.g.::
+
+    $ KBUILD_BUILD_TIMESTAMP="Sat Jan 1 00:00:00 UTC 0000" make
+    ...
+    ERROR: Timestamp out of range for cpio format'
+    ...
+
 KBUILD_BUILD_USER, KBUILD_BUILD_HOST
 ------------------------------------
 These two variables allow to override the user@host string displayed during
-- 
2.43.0


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

end of thread, other threads:[~2025-10-16 10:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-16  6:08 [PATCH] kbuild: doc: describe the error caused by pre-epoch timestamp Gang Yan
2025-10-16 10:38 ` David Disseldorp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox