Skip to contentSkip to conversation

Add a time zones repository

RFC PATCH New Alexandre Belloni 3 participants 3 messages Dec 9, 2013 – Dec 12, 2013

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 Add a time zones repository

This adds a time zones repository as /etc/TZ so that uclibc users can have an easy way to select their timezone. This is based on the current list from openwrt which seems up to date.

---
 system/Config.in |   9 +
 system/TZ        | 793 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 system/system.mk |   8 +
 3 files changed, 810 insertions(+)
 create mode 100644 system/TZ
system/Config.in +9 -0
index 54c196c69e9d..9421c36e651b 100644
@@ -332,4 +332,13 @@ config BR2_ROOTFS_POST_SCRIPT_ARGS
 	  directory / images directory. The arguments in this option will be
 	  passed *after* those.
 
+config BR2_TIMEZONE
+	bool "Install timezones"
+	depends on !BR2_TOOLCHAIN_USES_GLIBC
+	help
+	  Install a repository of known timezones in /etc/TZ.
+
+	  Note this only includes current timezones, we don't support past
+	  timezones.
+
 endmenu
system/TZ new file +793 -0

793 lines not on this page · raw message

system/system.mk +8 -0
index 01a6c3a627d8..53884dd63485 100644
@@ -47,6 +47,10 @@ target-generic-do-remount-rw:
 target-generic-dont-remount-rw:
 	$(SED) '/^[^#].*# REMOUNT_ROOTFS_RW$$/s~^~#~' $(TARGET_DIR)/etc/inittab
 
+# Install timezone repository
+target-timezone:
+	install -D -m 644 system/TZ $(TARGET_DIR)/etc
+
 ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
 TARGETS += target-generic-securetty
 endif
@@ -71,4 +75,8 @@ TARGETS += target-generic-do-remount-rw
 else
 TARGETS += target-generic-dont-remount-rw
 endif
+
+ifeq ($(BR2_TIMEZONE),y)
+TARGETS += target-timezone
+endif
 endif
Signature · 1 line
1.8.3.2
#1 lore raw

RFC PATCH 1/1 Add a time zones repository

Quoted 17 lines · Alexandre Belloni

This adds a time zones repository as /etc/TZ so that uclibc users can have an easy way to select their timezone. This is based on the current list from openwrt which seems up to date.

---
 system/Config.in |   9 +
 system/TZ        | 793 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 system/system.mk |   8 +
 3 files changed, 810 insertions(+)
 create mode 100644 system/TZ
system/Config.in +0 -0
index 54c196c69e9d..9421c36e651b 100644

system/Config.in config BR2_ROOTFS_POST_SCRIPT_ARGS · line 337

Quoted 6 lines
system/Config.in +3 -0
@@ -332,4 +332,13 @@ config BR2_ROOTFS_POST_SCRIPT_ARGS
          directory / images directory. The arguments in this option will be
          passed *after* those.
 
+config BR2_TIMEZONE
+       bool "Install timezones"
+       depends on !BR2_TOOLCHAIN_USES_GLIBC

Is this really for all C libraries that are not glibc, or is it rather for uClibc?
In other words: have you checked the situation for the musl C library?

Additionally, maybe you could add a comment (in system/TZ, and maybe also in the Config.in help text) explaining that you should uncomment one of the items to select the timezone?

Best regards,
Thomas

#2 lore raw

RFC PATCH 1/1 Add a time zones repository

In reply to Alexandre Belloni
Quoted 5 lines · Alexandre Belloni

This adds a time zones repository as /etc/TZ so that uclibc users can have an easy way to select their timezone. This is based on the current list from openwrt which seems up to date.

Maybe I don't understand the purpose of this patch, but why do you
install a pretty large file in the target which only contains a single relevant line? If you want to make use of it, you have to copy it to the rootfs-overlay where you can edit it - so there is no longer a need to enable BR2_TIMEZONE.

I would be more inclined to add a string config option that allows the
user to specify the time zone, where the help text e.g. refers to a website that lists all the timezones. This config option would generate the TZ file for uClibc, and the timezone file or whatever else is needed for glibc.

Regards,
Arnout

Quoted 25 lines
---
  system/Config.in |   9 +
  system/TZ        | 793 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
  system/system.mk |   8 +
  3 files changed, 810 insertions(+)

create mode 100644 system/TZ

system/Config.in +9 -0
index 54c196c69e9d..9421c36e651b 100644
@@ -332,4 +332,13 @@ config BR2_ROOTFS_POST_SCRIPT_ARGS
  	  directory / images directory. The arguments in this option will be
  	  passed*after*  those.
 
+config BR2_TIMEZONE
+	bool "Install timezones"
+	depends on !BR2_TOOLCHAIN_USES_GLIBC
+	help
+	  Install a repository of known timezones in /etc/TZ.
+
+	  Note this only includes current timezones, we don't support past
+	  timezones.
+
  endmenu
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F