LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] override build timestamp
@ 2007-02-16 21:52 Olaf Hering
2007-02-17 3:27 ` exporting LANG=C (Re: [PATCH] override build timestamp) Oleg Verych
2007-02-18 2:04 ` [PATCH] override build timestamp Roman Zippel
0 siblings, 2 replies; 10+ messages in thread
From: Olaf Hering @ 2007-02-16 21:52 UTC (permalink / raw)
To: Andrew Morton, Sam Ravnborg, linux-kernel
Pass a timestamp to kbuild via an enviroment variable.
TZ=UTC BUILD_TIMESTAMP=2007-01-01 make -kj O=../O vmlinux
This can be used when the kernel source is in a SCM and uname -v
is supposed to give the commit date and not the package build time.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
scripts/mkcompile_h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Index: linux-2.6/scripts/mkcompile_h
===================================================================
--- linux-2.6.orig/scripts/mkcompile_h
+++ linux-2.6/scripts/mkcompile_h
@@ -30,7 +30,12 @@ UTS_VERSION="#$VERSION"
CONFIG_FLAGS=""
if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
-UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS `LC_ALL=C LANG=C date`"
+if [ -n "$BUILD_TIMESTAMP" ]; then
+ TIMESTAMP="`LC_ALL=C LANG=C date -d "$BUILD_TIMESTAMP"`"
+else
+ TIMESTAMP="`LC_ALL=C LANG=C date`"
+fi
+UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
# Truncate to maximum length
^ permalink raw reply [flat|nested] 10+ messages in thread
* exporting LANG=C (Re: [PATCH] override build timestamp)
2007-02-16 21:52 [PATCH] override build timestamp Olaf Hering
@ 2007-02-17 3:27 ` Oleg Verych
2007-02-17 11:51 ` Olaf Hering
2007-02-18 1:57 ` Roman Zippel
2007-02-18 2:04 ` [PATCH] override build timestamp Roman Zippel
1 sibling, 2 replies; 10+ messages in thread
From: Oleg Verych @ 2007-02-17 3:27 UTC (permalink / raw)
To: Olaf Hering; +Cc: Andrew Morton, Sam Ravnborg, linux-kernel
> From: Olaf Hering
> Newsgroups: gmane.linux.kernel
> Subject: [PATCH] override build timestamp
> Date: Fri, 16 Feb 2007 22:52:13 +0100
Hallo, Olaf.
> Pass a timestamp to kbuild via an enviroment variable.
>
> TZ=UTC BUILD_TIMESTAMP=2007-01-01 make -kj O=../O vmlinux
>
> This can be used when the kernel source is in a SCM and uname -v
> is supposed to give the commit date and not the package build time.
While adding this functionality must be decided by kbuild developers,
could you make separate patch with exporting 'LANG=C' on the very
beginning and delete all other occurrences of it? It's a C header file
generation and afaik, it must be ASCII.
Thanks.
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>
> ---
> scripts/mkcompile_h | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> Index: linux-2.6/scripts/mkcompile_h
>===================================================================
> --- linux-2.6.orig/scripts/mkcompile_h
> +++ linux-2.6/scripts/mkcompile_h
> @@ -30,7 +30,12 @@ UTS_VERSION="#$VERSION"
> CONFIG_FLAGS=""
> if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
> if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
> -UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS `LC_ALL=C LANG=C date`"
> +if [ -n "$BUILD_TIMESTAMP" ]; then
> + TIMESTAMP="`LC_ALL=C LANG=C date -d "$BUILD_TIMESTAMP"`"
> +else
> + TIMESTAMP="`LC_ALL=C LANG=C date`"
> +fi
> +UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP"
>
> # Truncate to maximum length
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: exporting LANG=C (Re: [PATCH] override build timestamp)
2007-02-17 3:27 ` exporting LANG=C (Re: [PATCH] override build timestamp) Oleg Verych
@ 2007-02-17 11:51 ` Olaf Hering
2007-02-17 12:15 ` Andreas Schwab
2007-02-18 1:57 ` Roman Zippel
1 sibling, 1 reply; 10+ messages in thread
From: Olaf Hering @ 2007-02-17 11:51 UTC (permalink / raw)
To: Oleg Verych; +Cc: Andrew Morton, Sam Ravnborg, linux-kernel
On Sat, Feb 17, Oleg Verych wrote:
> While adding this functionality must be decided by kbuild developers,
> could you make separate patch with exporting 'LANG=C' on the very
> beginning and delete all other occurrences of it? It's a C header file
> generation and afaik, it must be ASCII.
That makes sense.
But we better build the whole kernel with LC_ALL=C LANG=C.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: exporting LANG=C (Re: [PATCH] override build timestamp)
2007-02-17 11:51 ` Olaf Hering
@ 2007-02-17 12:15 ` Andreas Schwab
0 siblings, 0 replies; 10+ messages in thread
From: Andreas Schwab @ 2007-02-17 12:15 UTC (permalink / raw)
To: Olaf Hering; +Cc: Oleg Verych, Andrew Morton, Sam Ravnborg, linux-kernel
Olaf Hering <olaf@aepfle.de> writes:
> But we better build the whole kernel with LC_ALL=C LANG=C.
If you have LC_ALL=C you don't need LANG=C.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: exporting LANG=C (Re: [PATCH] override build timestamp)
2007-02-17 3:27 ` exporting LANG=C (Re: [PATCH] override build timestamp) Oleg Verych
2007-02-17 11:51 ` Olaf Hering
@ 2007-02-18 1:57 ` Roman Zippel
2007-02-18 3:57 ` Oleg Verych
1 sibling, 1 reply; 10+ messages in thread
From: Roman Zippel @ 2007-02-18 1:57 UTC (permalink / raw)
To: Oleg Verych; +Cc: Olaf Hering, Andrew Morton, Sam Ravnborg, linux-kernel
Hi,
On Sat, 17 Feb 2007, Oleg Verych wrote:
> could you make separate patch with exporting 'LANG=C' on the very
> beginning and delete all other occurrences of it? It's a C header file
> generation and afaik, it must be ASCII.
Bad idea, most user output should be localized (even if it's only utf-8)
and some kconfig targets have explicit locale support.
bye, Roman
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: exporting LANG=C (Re: [PATCH] override build timestamp)
2007-02-18 1:57 ` Roman Zippel
@ 2007-02-18 3:57 ` Oleg Verych
0 siblings, 0 replies; 10+ messages in thread
From: Oleg Verych @ 2007-02-18 3:57 UTC (permalink / raw)
To: Roman Zippel; +Cc: Olaf Hering, Andrew Morton, Sam Ravnborg, linux-kernel
On Sun, Feb 18, 2007 at 02:57:26AM +0100, Roman Zippel wrote:
> Hi,
Hallo, Roman.
> On Sat, 17 Feb 2007, Oleg Verych wrote:
>
> > could you make separate patch with exporting 'LANG=C' on the very
> > beginning and delete all other occurrences of it? It's a C header file
> > generation and afaik, it must be ASCII.
>
> Bad idea, most user output should be localized (even if it's only utf-8)
> and some kconfig targets have explicit locale support.
Ok, then maybe this one
<http://marc.theaimsgroup.com/?l=linux-mm-commits&m=116720464804613&w=2>
can be fixed as well? I used same reasoning to comment on it (that
particular patch was dropped).
____
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] override build timestamp
2007-02-16 21:52 [PATCH] override build timestamp Olaf Hering
2007-02-17 3:27 ` exporting LANG=C (Re: [PATCH] override build timestamp) Oleg Verych
@ 2007-02-18 2:04 ` Roman Zippel
2007-02-18 8:12 ` Olaf Hering
1 sibling, 1 reply; 10+ messages in thread
From: Roman Zippel @ 2007-02-18 2:04 UTC (permalink / raw)
To: Olaf Hering; +Cc: Andrew Morton, Sam Ravnborg, linux-kernel
Hi,
On Fri, 16 Feb 2007, Olaf Hering wrote:
> Pass a timestamp to kbuild via an enviroment variable.
>
> TZ=UTC BUILD_TIMESTAMP=2007-01-01 make -kj O=../O vmlinux
>
> This can be used when the kernel source is in a SCM and uname -v
> is supposed to give the commit date and not the package build time.
Is this really necessary? I don't really see the point of this.
bye, Roman
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] override build timestamp
2007-02-18 2:04 ` [PATCH] override build timestamp Roman Zippel
@ 2007-02-18 8:12 ` Olaf Hering
2007-02-18 16:24 ` Roman Zippel
0 siblings, 1 reply; 10+ messages in thread
From: Olaf Hering @ 2007-02-18 8:12 UTC (permalink / raw)
To: Roman Zippel; +Cc: Andrew Morton, Sam Ravnborg, linux-kernel
On Sun, Feb 18, Roman Zippel wrote:
> Hi,
>
> On Fri, 16 Feb 2007, Olaf Hering wrote:
>
> > Pass a timestamp to kbuild via an enviroment variable.
> >
> > TZ=UTC BUILD_TIMESTAMP=2007-01-01 make -kj O=../O vmlinux
> >
> > This can be used when the kernel source is in a SCM and uname -v
> > is supposed to give the commit date and not the package build time.
>
> Is this really necessary? I don't really see the point of this.
The package/kernel buildtime does not mean much, but the commit date
gives you a way to restore the source state for a given binary.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] override build timestamp
2007-02-18 8:12 ` Olaf Hering
@ 2007-02-18 16:24 ` Roman Zippel
2007-02-19 13:14 ` Olaf Hering
0 siblings, 1 reply; 10+ messages in thread
From: Roman Zippel @ 2007-02-18 16:24 UTC (permalink / raw)
To: Olaf Hering; +Cc: Andrew Morton, Sam Ravnborg, linux-kernel
Hi,
On Sun, 18 Feb 2007, Olaf Hering wrote:
> > On Fri, 16 Feb 2007, Olaf Hering wrote:
> >
> > > Pass a timestamp to kbuild via an enviroment variable.
> > >
> > > TZ=UTC BUILD_TIMESTAMP=2007-01-01 make -kj O=../O vmlinux
> > >
> > > This can be used when the kernel source is in a SCM and uname -v
> > > is supposed to give the commit date and not the package build time.
> >
> > Is this really necessary? I don't really see the point of this.
>
> The package/kernel buildtime does not mean much, but the commit date
> gives you a way to restore the source state for a given binary.
This information could also be added to the version string like
CONFIG_LOCALVERSION_AUTO does. OTOH rather than abusing the build date
(which may not mean much, but it nevertheless has a meaning), I'd rather
add the possibility to add extra information.
bye, ROman
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] override build timestamp
2007-02-18 16:24 ` Roman Zippel
@ 2007-02-19 13:14 ` Olaf Hering
0 siblings, 0 replies; 10+ messages in thread
From: Olaf Hering @ 2007-02-19 13:14 UTC (permalink / raw)
To: Roman Zippel; +Cc: Andrew Morton, Sam Ravnborg, linux-kernel
On Sun, Feb 18, Roman Zippel wrote:
> This information could also be added to the version string like
> CONFIG_LOCALVERSION_AUTO does. OTOH rather than abusing the build date
> (which may not mean much, but it nevertheless has a meaning), I'd rather
> add the possibility to add extra information.
What exactly do you have in mind, how to provide the extra info?
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-02-19 13:13 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-16 21:52 [PATCH] override build timestamp Olaf Hering
2007-02-17 3:27 ` exporting LANG=C (Re: [PATCH] override build timestamp) Oleg Verych
2007-02-17 11:51 ` Olaf Hering
2007-02-17 12:15 ` Andreas Schwab
2007-02-18 1:57 ` Roman Zippel
2007-02-18 3:57 ` Oleg Verych
2007-02-18 2:04 ` [PATCH] override build timestamp Roman Zippel
2007-02-18 8:12 ` Olaf Hering
2007-02-18 16:24 ` Roman Zippel
2007-02-19 13:14 ` Olaf Hering
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).