Skip to contentSkip to conversation

Makefile: Use correct timezone for U_BOOT_TZ

PATCH In review Chris Packham 5 participants 10 messages Aug 13, 2015 – Aug 28, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 Makefile: Use correct timezone for U_BOOT_TZ

When building with SOURCE_DATE_EPOCH the timezone is in UTC. When building normally the timezone is taken from the build machine's locale setting.

---

Changes in v3:
- None

Changes in v2:
- Collect some tested-by tags
- Remove reference to f3f431a71272 in the commit message
- Drop Ccs that were erroneously added when submitting v1, remaining Ccs are from the original mailing list thread

 Makefile | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
Makefile +10 -4
index ad51e60..3ff063a 100644
@@ -1279,10 +1279,16 @@ define filechk_version.h
 endef
 
 define filechk_timestamp.h
-	(SOURCE_DATE="$${SOURCE_DATE_EPOCH:+@$$SOURCE_DATE_EPOCH}"; \
-	LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
-	LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_TIME "%T"'; \
-	LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_TZ "%z"' )
+	(if test -n "$${SOURCE_DATE_EPOCH}"; then \
+		SOURCE_DATE="@$${SOURCE_DATE_EPOCH}"; \
+		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
+		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
+		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
+	else \
+		LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
+		LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
+		LC_ALL=C date +'#define U_BOOT_TZ "%z"'; \
+	fi)
 endef
 
 $(version_h): include/config/uboot.release FORCE
Signature · 1 line
2.5.0.rc0
#1 lore raw

PATCH v3 2/2 Makefile: Add SOURCE_DATE_TZ

Along with SOURCE_DATE_EPOCH SOURCE_DATE_TZ can be used to recreate a build with a specific date timestamp. This allows the verification of source supplied with a pre-compiled binary.

If SOURCE_DATE_EPOCH is supplied SOURCE_DATE_TZ can be used to specify what will appear in the output of the version command. If SOURCE_DATE_TZ is not specified UTC will be used. SOURCE_DATE_TZ on it's own will not have an affect.

---
This is a quick proof of concept that allows some control of how the timezone is displayed. Now you can do something like

make SOURCE_DATE_EPOCH=12345678 SOURCE_DATE_TZ=America/Los_Angeles

Changes in v3:
- Drop RFC

Changes in v2: None

 Makefile | 7 ++++---
 README   | 9 ++++++---
 2 files changed, 10 insertions(+), 6 deletions(-)
Makefile +4 -3
index 3ff063a..609b595 100644
@@ -1281,9 +1281,10 @@ endef
 define filechk_timestamp.h
 	(if test -n "$${SOURCE_DATE_EPOCH}"; then \
 		SOURCE_DATE="@$${SOURCE_DATE_EPOCH}"; \
-		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
-		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
-		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
+		SOURCE_TZ="$${SOURCE_DATE_TZ:-UTC}"; \
+		TZ="$${SOURCE_TZ}" LC_ALL=C date -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
+		TZ="$${SOURCE_TZ}" LC_ALL=C date -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
+		TZ="$${SOURCE_TZ}" LC_ALL=C date -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
 	else \
 		LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
 		LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
README +6 -3
index 1bcb63c..d2e3e94 100644
@@ -5087,11 +5087,14 @@ Reproducible builds
 In order to achieve reproducible builds, timestamps used in the U-Boot build
 process have to be set to a fixed value.
 
-This is done using the SOURCE_DATE_EPOCH environment variable.
-SOURCE_DATE_EPOCH is to be set on the build host's shell, not as a configuration
-option for U-Boot or an environment variable in U-Boot.
+This is done using the SOURCE_DATE_EPOCH and SOURCE_DATE_TZ environment
+variables. These are to be set on the build host's shell, not as a
+configuration option for U-Boot or an environment variable in U-Boot.
 
 SOURCE_DATE_EPOCH should be set to a number of seconds since the epoch, in UTC.
+SOURCE_DATE_TZ will default to UTC but can be set to another timezone and is
+used to determine how the date is displayed (tzselect(1) can be used to
+determine an appropriate value).
 
 Building the Software:
 ======================
Signature · 1 line
2.5.0.rc0
#2 lore raw

PATCH v3 2/2 Makefile: Add SOURCE_DATE_TZ

Le jeudi 13 ao?t 2015 ? 18:08 +1200, Chris Packham a ?crit :

Quoted 8 lines

Along with SOURCE_DATE_EPOCH SOURCE_DATE_TZ can be used to recreate a build with a specific date timestamp. This allows the verification of source supplied with a pre-compiled binary.

If SOURCE_DATE_EPOCH is supplied SOURCE_DATE_TZ can be used to specify what will appear in the output of the version command. If SOURCE_DATE_TZ is not specified UTC will be used. SOURCE_DATE_TZ on it's own will not have an affect.

I advise against merging this patch given Ximin Luo's comments on v1, at least until this has been properly discussed with the reproducible team and a precise meaning for it has been agreed on.

Quoted 47 lines

---
This is a quick proof of concept that allows some control of how the timezone is displayed. Now you can do something like

make SOURCE_DATE_EPOCH=12345678 SOURCE_DATE_TZ=America/Los_Angeles

Changes in v3:
- Drop RFC

Changes in v2: None

 Makefile | 7 ++++---
 README   | 9 ++++++---
 2 files changed, 10 insertions(+), 6 deletions(-)
Makefile +4 -3
index 3ff063a..609b595 100644
@@ -1281,9 +1281,10 @@ endef
 define filechk_timestamp.h
 	(if test -n "$${SOURCE_DATE_EPOCH}"; then \
 		SOURCE_DATE="@$${SOURCE_DATE_EPOCH}"; \
-		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
-		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
-		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
+		SOURCE_TZ="$${SOURCE_DATE_TZ:-UTC}"; \
+		TZ="$${SOURCE_TZ}" LC_ALL=C date -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
+		TZ="$${SOURCE_TZ}" LC_ALL=C date -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
+		TZ="$${SOURCE_TZ}" LC_ALL=C date -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
 	else \
 		LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
 		LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
README +1 -3
index 1bcb63c..d2e3e94 100644
@@ -5087,11 +5087,14 @@ Reproducible builds
 In order to achieve reproducible builds, timestamps used in the U-Boot build
 process have to be set to a fixed value.
 
-This is done using the SOURCE_DATE_EPOCH environment variable.
-SOURCE_DATE_EPOCH is to be set on the build host's shell, not as a configuration
-option for U-Boot or an environment variable in U-Boot.
+This is done using the SOURCE_DATE_EPOCH and SOURCE_DATE_TZ environment

README Reproducible builds · line 5100

Quoted 10 lines
README +5 -0
+variables. These are to be set on the build host's shell, not as a
+configuration option for U-Boot or an environment variable in U-Boot.
 
 SOURCE_DATE_EPOCH should be set to a number of seconds since the epoch, in UTC.
+SOURCE_DATE_TZ will default to UTC but can be set to another timezone and is
+used to determine how the date is displayed (tzselect(1) can be used to
+determine an appropriate value).
 
 Building the Software:
 ======================

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150825/e66d5b0a/attachment.sig>

#3 lore raw

PATCH v3 2/2 Makefile: Add SOURCE_DATE_TZ

Quoted 5 lines · Paul Kocialkowski

Le jeudi 13 ao?t 2015 ? 18:08 +1200, Chris Packham a ?crit :

Quoted 4 lines

Along with SOURCE_DATE_EPOCH SOURCE_DATE_TZ can be used to recreate a build with a specific date timestamp. This allows the verification of source supplied with a pre-compiled binary.

Quoted 9 lines
Quoted 4 lines

If SOURCE_DATE_EPOCH is supplied SOURCE_DATE_TZ can be used to specify what will appear in the output of the version command. If SOURCE_DATE_TZ is not specified UTC will be used. SOURCE_DATE_TZ on it's own will not have an affect.

I advise against merging this patch given Ximin Luo's comments on v1, at least until this has been properly discussed with the reproducible team and a precise meaning for it has been agreed on.

I'm happy to go along with that. 1/2 of this series was the "fix". 2/2 just kind of came up as part of the discussion that followed. Tom, can you handle that or do you want me to send a v4 of the series with just the first patch?

Just for my own understanding is the "reproducible team" a u-boot thing or a debian thing? I'm not really active in any of the debian projects so maybe someone there should pick this up if it's a debian thing.

Quoted 58 lines
Quoted 57 lines

---
This is a quick proof of concept that allows some control of how the timezone is displayed. Now you can do something like

make SOURCE_DATE_EPOCH=12345678 SOURCE_DATE_TZ=America/Los_Angeles

Changes in v3:
- Drop RFC

Changes in v2: None

 Makefile | 7 ++++---
 README   | 9 ++++++---
 2 files changed, 10 insertions(+), 6 deletions(-)
Makefile +4 -3
index 3ff063a..609b595 100644
@@ -1281,9 +1281,10 @@ endef
 define filechk_timestamp.h
      (if test -n "$${SOURCE_DATE_EPOCH}"; then \
              SOURCE_DATE="@$${SOURCE_DATE_EPOCH}"; \
-             LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
-             LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
-             LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
+             SOURCE_TZ="$${SOURCE_DATE_TZ:-UTC}"; \
+             TZ="$${SOURCE_TZ}" LC_ALL=C date -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
+             TZ="$${SOURCE_TZ}" LC_ALL=C date -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
+             TZ="$${SOURCE_TZ}" LC_ALL=C date -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
      else \
              LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
              LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
README +6 -3
index 1bcb63c..d2e3e94 100644
@@ -5087,11 +5087,14 @@ Reproducible builds
 In order to achieve reproducible builds, timestamps used in the U-Boot build
 process have to be set to a fixed value.
 
-This is done using the SOURCE_DATE_EPOCH environment variable.
-SOURCE_DATE_EPOCH is to be set on the build host's shell, not as a configuration
-option for U-Boot or an environment variable in U-Boot.
+This is done using the SOURCE_DATE_EPOCH and SOURCE_DATE_TZ environment
+variables. These are to be set on the build host's shell, not as a
+configuration option for U-Boot or an environment variable in U-Boot.
 
 SOURCE_DATE_EPOCH should be set to a number of seconds since the epoch, in UTC.
+SOURCE_DATE_TZ will default to UTC but can be set to another timezone and is
+used to determine how the date is displayed (tzselect(1) can be used to
+determine an appropriate value).
 
 Building the Software:
 ======================
#4 lore raw

[U-Boot] about reproducible builds (was Re: [PATCH v3 2/2] Makefile: Add SOURCE_DATE_TZ)

Hi Chris,

Quoted 4 lines · Chris Packham

Just for my own understanding is the "reproducible team" a u-boot thing or a debian thing? I'm not really active in any of the debian projects so maybe someone there should pick this up if it's a debian thing.

the "reproducible team" so far involved has indeed been the "Debian reproducible builds team", but we care about free software in general and we also think that reproducible builds shall become the norm one day.

very short one paragraph summary:

With free software, anyone can inspect the source code for malicious flaws. But Debian like most distributions provides binary packages to its users. The idea of ?deterministic? or ?reproducible? builds is to empower anyone to verify that no flaws have been introduced during the build process by reproducing byte-for-byte identical binary packages from a given source.

for a longer summary you might want to watch
http://media.ccc.de/browse/conferences/camp2015/camp2015-6657-how_to_make_your_software_build_reproducibly.html
or
http://media.ccc.de/browse/congress/2014/31c3_-_6240_-_en_-_saal_g_-_201412271400_-_reproducible_builds_-_mike_perry_-_seth_schoen_-_hans_steiner.html
- the latter explains the motivation behind our work in greater detail.

Or you can also read about this,
https://wiki.debian.org/ReproducibleBuilds/About (alone, the wiki has much more information on other pages as well) has the following contents:

Why do we want reproducible builds?
Reproducing builds
Recording the environment
Reproduce the build environment
References
Presentations
Publicity
Related projects
Further work

Last but not least, the Debian reproducible builds team has also been investigating other projects, see eg

https://reproducible.debian.net/openwrt/
https://reproducible.debian.net/netbsd/
https://reproducible.debian.net/coreboot/
(and more will be coming.)

cheers,
Holger
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150826/5f3d3002/attachment.sig>

#5 lore raw

PATCH v3 2/2 Makefile: Add SOURCE_DATE_TZ

In reply to Chris Packham

Le mercredi 26 ao?t 2015 ? 21:08 +1200, Chris Packham a ?crit :

Quoted 21 lines · Paul Kocialkowski
Quoted 5 lines

Le jeudi 13 ao?t 2015 ? 18:08 +1200, Chris Packham a ?crit :

Quoted 4 lines

Along with SOURCE_DATE_EPOCH SOURCE_DATE_TZ can be used to recreate a build with a specific date timestamp. This allows the verification of source supplied with a pre-compiled binary.

Quoted 9 lines
Quoted 4 lines

If SOURCE_DATE_EPOCH is supplied SOURCE_DATE_TZ can be used to specify what will appear in the output of the version command. If SOURCE_DATE_TZ is not specified UTC will be used. SOURCE_DATE_TZ on it's own will not have an affect.

I advise against merging this patch given Ximin Luo's comments on v1, at least until this has been properly discussed with the reproducible team and a precise meaning for it has been agreed on.

I'm happy to go along with that. 1/2 of this series was the "fix". 2/2 just kind of came up as part of the discussion that followed. Tom, can you handle that or do you want me to send a v4 of the series with just the first patch?

Quoted 4 lines

Just for my own understanding is the "reproducible team" a u-boot thing or a debian thing? I'm not really active in any of the debian projects so maybe someone there should pick this up if it's a debian thing.

Well, I'm referring to the reproducible team at Debian, but since they're working with upstream (and they're apparently the only group of people to do that work), I think it's fair to say they're the reference when it comes to reproducible builds.

Quoted 50 lines
Quoted 50 lines
Quoted 50 lines

---
This is a quick proof of concept that allows some control of how the timezone is displayed. Now you can do something like

make SOURCE_DATE_EPOCH=12345678 SOURCE_DATE_TZ=America/Los_Angeles

Changes in v3:
- Drop RFC

Changes in v2: None

 Makefile | 7 ++++---
 README   | 9 ++++++---
 2 files changed, 10 insertions(+), 6 deletions(-)
Makefile +4 -3
index 3ff063a..609b595 100644
@@ -1281,9 +1281,10 @@ endef
 define filechk_timestamp.h
      (if test -n "$${SOURCE_DATE_EPOCH}"; then \
              SOURCE_DATE="@$${SOURCE_DATE_EPOCH}"; \
-             LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
-             LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
-             LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
+             SOURCE_TZ="$${SOURCE_DATE_TZ:-UTC}"; \
+             TZ="$${SOURCE_TZ}" LC_ALL=C date -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
+             TZ="$${SOURCE_TZ}" LC_ALL=C date -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
+             TZ="$${SOURCE_TZ}" LC_ALL=C date -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
      else \
              LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
              LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
README +3 -3
index 1bcb63c..d2e3e94 100644
@@ -5087,11 +5087,14 @@ Reproducible builds
 In order to achieve reproducible builds, timestamps used in the U-Boot build
 process have to be set to a fixed value.
 
-This is done using the SOURCE_DATE_EPOCH environment variable.
-SOURCE_DATE_EPOCH is to be set on the build host's shell, not as a configuration
-option for U-Boot or an environment variable in U-Boot.
+This is done using the SOURCE_DATE_EPOCH and SOURCE_DATE_TZ environment
+variables. These are to be set on the build host's shell, not as a
+configuration option for U-Boot or an environment variable in U-Boot.
 
Quoted 8 lines
Quoted 8 lines

README Reproducible builds · line 5100

Quoted 7 lines
README +3 -0
 SOURCE_DATE_EPOCH should be set to a number of seconds since the epoch, in UTC.
+SOURCE_DATE_TZ will default to UTC but can be set to another timezone and is
+used to determine how the date is displayed (tzselect(1) can be used to
+determine an appropriate value).
 
 Building the Software:
 ======================

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150826/39380ba1/attachment.sig>

#6 lore raw

PATCH v3 2/2 Makefile: Add SOURCE_DATE_TZ

In reply to Chris Packham
Quoted 16 lines · Chris Packham
Quoted 5 lines · Paul Kocialkowski

Le jeudi 13 ao?t 2015 ? 18:08 +1200, Chris Packham a ?crit :

Quoted 4 lines

Along with SOURCE_DATE_EPOCH SOURCE_DATE_TZ can be used to recreate a build with a specific date timestamp. This allows the verification of source supplied with a pre-compiled binary.

Quoted 9 lines
Quoted 4 lines

If SOURCE_DATE_EPOCH is supplied SOURCE_DATE_TZ can be used to specify what will appear in the output of the version command. If SOURCE_DATE_TZ is not specified UTC will be used. SOURCE_DATE_TZ on it's own will not have an affect.

I advise against merging this patch given Ximin Luo's comments on v1, at least until this has been properly discussed with the reproducible team and a precise meaning for it has been agreed on.

Quoted 4 lines

I'm happy to go along with that. 1/2 of this series was the "fix". 2/2 just kind of came up as part of the discussion that followed. Tom, can you handle that or do you want me to send a v4 of the series with just the first patch?

I'll pick up just the first patch for now, shortly.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150827/0faa0a61/attachment.sig>
#7 lore raw

PATCH v3 1/2 Makefile: Use correct timezone for U_BOOT_TZ

In reply to Chris Packham
Quoted 7 lines · Chris Packham

When building with SOURCE_DATE_EPOCH the timezone is in UTC. When building normally the timezone is taken from the build machine's locale setting.

This also re-enables normal building on *BSD style hosts.

Quoted 40 lines

---

Changes in v3:
- None

Changes in v2:
- Collect some tested-by tags
- Remove reference to f3f431a71272 in the commit message
- Drop Ccs that were erroneously added when submitting v1, remaining Ccs are from the original mailing list thread

 Makefile | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
Makefile +10 -4
index ad51e60..3ff063a 100644
@@ -1279,10 +1279,16 @@ define filechk_version.h
 endef
 
 define filechk_timestamp.h
-	(SOURCE_DATE="$${SOURCE_DATE_EPOCH:+@$$SOURCE_DATE_EPOCH}"; \
-	LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
-	LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_TIME "%T"'; \
-	LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_TZ "%z"' )
+	(if test -n "$${SOURCE_DATE_EPOCH}"; then \
+		SOURCE_DATE="@$${SOURCE_DATE_EPOCH}"; \
+		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
+		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
+		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
+	else \
+		LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
+		LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
+		LC_ALL=C date +'#define U_BOOT_TZ "%z"'; \
+	fi)
 endef
 
 $(version_h): include/config/uboot.release FORCE
#8 lore raw

PATCH v3 1/2 Makefile: Use correct timezone for U_BOOT_TZ

In reply to Chris Packham

Le jeudi 13 ao?t 2015 ? 18:08 +1200, Chris Packham a ?crit :

Quoted 3 lines

When building with SOURCE_DATE_EPOCH the timezone is in UTC. When building normally the timezone is taken from the build machine's locale setting.

Looks good to me!

Quoted 32 lines

---

Changes in v3:
- None

Changes in v2:
- Collect some tested-by tags
- Remove reference to f3f431a71272 in the commit message
- Drop Ccs that were erroneously added when submitting v1, remaining Ccs are from the original mailing list thread

 Makefile | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
Makefile +3 -4
index ad51e60..3ff063a 100644
@@ -1279,10 +1279,16 @@ define filechk_version.h
 endef
 
 define filechk_timestamp.h
-	(SOURCE_DATE="$${SOURCE_DATE_EPOCH:+@$$SOURCE_DATE_EPOCH}"; \
-	LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_DATE "%b %d %C%y"'; \
-	LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_TIME "%T"'; \
-	LC_ALL=C date -u -d "$${SOURCE_DATE:-now}" +'#define U_BOOT_TZ "%z"' )
+	(if test -n "$${SOURCE_DATE_EPOCH}"; then \
+		SOURCE_DATE="@$${SOURCE_DATE_EPOCH}"; \
+		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DATE "%b %d %C%y"'; \

Makefile define filechk_version.h · line 1294

Quoted 10 lines
Makefile +7 -0
+		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
+		LC_ALL=C date -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
+	else \
+		LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"'; \
+		LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
+		LC_ALL=C date +'#define U_BOOT_TZ "%z"'; \
+	fi)
 endef
 
 $(version_h): include/config/uboot.release FORCE

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150825/ed009170/attachment.sig>

#9 lore raw

PATCH v3 1/2 Makefile: Use correct timezone for U_BOOT_TZ

In reply to Chris Packham
Quoted 8 lines · Chris Packham

When building with SOURCE_DATE_EPOCH the timezone is in UTC. When building normally the timezone is taken from the build machine's locale setting.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150828/0b54cbe3/attachment.sig>