Skip to content

Commit bfb046f

Browse files
Dwyane-YanNicolas Schier
authored andcommitted
kbuild: doc: improve KBUILD_BUILD_TIMESTAMP documentation
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> Reviewed-by: Nicolas Schier <nsc@kernel.org> Link: https://patch.msgid.link/20251017021209.6586-1-gang.yan@linux.dev Signed-off-by: Nicolas Schier <nsc@kernel.org>
1 parent af61da2 commit bfb046f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

Documentation/kbuild/kbuild.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,14 @@ KBUILD_BUILD_TIMESTAMP
328328
----------------------
329329
Setting this to a date string overrides the timestamp used in the
330330
UTS_VERSION definition (uname -v in the running kernel). The value has to
331-
be a string that can be passed to date -d. The default value
332-
is the output of the date command at one point during build.
331+
be a string that can be passed to date -d. E.g.::
332+
333+
$ KBUILD_BUILD_TIMESTAMP="Mon Oct 13 00:00:00 UTC 2025" make
334+
335+
The default value is the output of the date command at one point during
336+
build. If provided, this timestamp will also be used for mtime fields
337+
within any initramfs archive. Initramfs mtimes are 32-bit, so dates before
338+
the 1970 Unix epoch, or after 2106-02-07 06:28:15 UTC will fail.
333339

334340
KBUILD_BUILD_USER, KBUILD_BUILD_HOST
335341
------------------------------------

0 commit comments

Comments
 (0)