* [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
* Re: [PATCH, v2] kbuild: doc: improve KBUILD_BUILD_TIMESTAMP documentation
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
1 sibling, 1 reply; 4+ messages in thread
From: Nicolas Schier @ 2025-10-17 19:54 UTC (permalink / raw)
To: Gang Yan
Cc: Nathan Chancellor, Jonathan Corbet, David Disseldorp,
linux-kbuild, linux-doc, Gang Yan
On Fri, Oct 17, 2025 at 10:12:09AM +0800, Gang Yan wrote:
> 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(-)
>
Thanks to both of you!
I have only found a tiny nit-pick, see below.
Reviewed-by: Nicolas Schier <nsc@kernel.org>
> 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
Other code blocks in kbuild.rst are indented by four spaces (and
accidentally five in one line).
I can add these when applying the patch for kbuild-next, if that is ok
for you.
Kind regards
Nicolas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH, v2] kbuild: doc: improve KBUILD_BUILD_TIMESTAMP documentation
2025-10-17 19:54 ` Nicolas Schier
@ 2025-10-17 23:16 ` GangYan
0 siblings, 0 replies; 4+ messages in thread
From: GangYan @ 2025-10-17 23:16 UTC (permalink / raw)
To: Nicolas Schier
Cc: Nathan Chancellor, Jonathan Corbet, David Disseldorp,
linux-kbuild, linux-doc, Gang Yan
> On Fri, Oct 17, 2025 at 09:54:12PM +0200, Nicolas Schier wrote:
> On Fri, Oct 17, 2025 at 10:12:09AM +0800, Gang Yan wrote:
> > 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(-)
> >
>
> Thanks to both of you!
>
> I have only found a tiny nit-pick, see below.
>
> Reviewed-by: Nicolas Schier <nsc@kernel.org>
>
> > 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
>
> Other code blocks in kbuild.rst are indented by four spaces (and
> accidentally five in one line).
>
> I can add these when applying the patch for kbuild-next, if that is ok
> for you.
Sure, Thanks alot.
>
> Kind regards
> Nicolas
Cherrs,
Gang
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH, v2] kbuild: doc: improve KBUILD_BUILD_TIMESTAMP documentation
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-22 21:20 ` Nicolas Schier
1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Schier @ 2025-10-22 21:20 UTC (permalink / raw)
To: Nathan Chancellor, Nicolas Schier, Jonathan Corbet,
David Disseldorp, linux-kbuild, linux-doc, Gang Yan
Cc: Nicolas Schier, Gang Yan
On Fri, 17 Oct 2025 10:12:09 +0800, Gang Yan wrote:
> 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.
>
>
> [...]
Applied to kbuild-next, thanks!
[1/1] kbuild: doc: improve KBUILD_BUILD_TIMESTAMP documentation
(indentation of code example adjusted)
commit: 5cbfb4da7e063cb82b1ab044465aeff4542a436d
Please note that commit hashes might change in case of issues with
kbuild-next branch.
Best regards,
--
Nicolas
^ permalink raw reply [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).