diff mbox

[2/7] system: add selection of a default localtime

Message ID ad568cb0d78ad63dc99ef3cf45ee0722527295db.1393884458.git.yann.morin.1998@free.fr
State Changes Requested
Headers show

Commit Message

Yann E. MORIN March 3, 2014, 10:10 p.m. UTC
From: "Yann E. MORIN" <yann.morin.1998@free.fr>

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[alexandre.belloni: move from "tzdata" to "system configuration"]
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
[yann.morin.1998@free.fr: move into the BR2_TARGET_TZ_INFO conditionnal block]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/tzdata/tzdata.mk |  7 ++++++-
 system/Config.in         | 14 ++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/package/tzdata/tzdata.mk b/package/tzdata/tzdata.mk
index b6f07e2..c23b3df 100644
--- a/package/tzdata/tzdata.mk
+++ b/package/tzdata/tzdata.mk
@@ -39,8 +39,13 @@  define TZDATA_INSTALL_TARGET_CMDS
 	cp -a $(@D)/_output/* $(TARGET_DIR)/usr/share/zoneinfo
 	cd $(TARGET_DIR)/usr/share/zoneinfo;    \
 	for zone in posix/*; do                 \
-	    ln -sfn "$${zone}" "$${zone##*/}";    \
+	    ln -sfn "$${zone}" "$${zone##*/}";  \
 	done
+	if [ -n "$(BR2_TARGET_LOCALTIME)" ]; then                           \
+	    cd $(TARGET_DIR)/etc;                                           \
+	    ln -sf ../usr/share/zoneinfo/$(BR2_TARGET_LOCALTIME) localtime; \
+	    echo "$(BR2_TARGET_LOCALTIME)" >timezone;                       \
+	fi
 endef
 
 $(eval $(generic-package))
diff --git a/system/Config.in b/system/Config.in
index 7ea0208..008369f 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -285,6 +285,20 @@  config BR2_TARGET_TZ_ZONELIST
 	  The full list is the list of files in the time zone database source,
 	  not including the build and .tab files.
 
+config BR2_TARGET_LOCALTIME
+	string "default local time"
+	help
+	  The time zone to install as the default local time, expressed as a
+	  tzdata location, such as:
+	    GMT
+	    Europe/Paris
+	    America/New_York
+	    Pacific/Wallis
+	    ...
+
+	  If empty, no local time will be set, and the dates will be
+	  expressed in UTC.
+
 endif # BR2_TARGET_TZ_INFO
 
 config BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW