summaryrefslogtreecommitdiffstats
path: root/rules/timezone.make
diff options
context:
space:
mode:
authorAlexander Dahl <post@lespocky.de>2012-03-27 18:25:24 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2012-04-03 21:12:01 +0200
commitcdfd09248b4455087580c95a9bfa1efd8dc6bccb (patch)
tree7648fc035dcd893a216b28fad7655d27eb106590 /rules/timezone.make
parent715ed909af46f032eec697e259c93df62b5cc661 (diff)
downloadptxdist-cdfd09248b4455087580c95a9bfa1efd8dc6bccb.tar.gz
ptxdist-cdfd09248b4455087580c95a9bfa1efd8dc6bccb.tar.xz
add /etc/timezone and replace content according to /etc/localtime
Additionally to /etc/localtime which points to one zoneinfo file in /usr/share/zoneinfo there is /etc/timezone containing the system wide zone. Debian updates both in parallel and systemd uses this too. It's an easy way to find out about the current system time zone. Rules are extended in a way you only have to put e.g. 'Europe/Berlin' to ptxdist menuconfig and symlink /etc/localtime and file /etc/timezone are created at build time. This patch is a suggestion which works for me, open for discussion. Signed-off-by: Alexander Dahl <post@lespocky.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'rules/timezone.make')
-rw-r--r--rules/timezone.make10
1 files changed, 8 insertions, 2 deletions
diff --git a/rules/timezone.make b/rules/timezone.make
index d208f14d5..28ed35e1b 100644
--- a/rules/timezone.make
+++ b/rules/timezone.make
@@ -19,6 +19,8 @@ PACKAGES-$(PTXCONF_TIMEZONE) += timezone
TIMEZONE_VERSION := 1.0
TIMEZONE := timezone-$(TIMEZONE_VERSION)
+TIMEZONE_LOCALTIME_FILE := /usr/share/zoneinfo/$(PTXCONF_GLIBC_LOCALTIME)
+
TIMEZONE-$(PTXCONF_TIMEZONE_AFRICA) := "Africa"
TIMEZONE-$(PTXCONF_TIMEZONE_ATLANTIC) += "Atlantic"
TIMEZONE-$(PTXCONF_TIMEZONE_EUROPE) += "Europe"
@@ -117,8 +119,12 @@ $(STATEDIR)/timezone.targetinstall:
$(call install_copy, timezone, 0, 0, 0655, -, /usr/share/zoneinfo/$$f,n); \
done
-ifdef PTXCONF_GLIBC_LOCALTIME_LINK
- @$(call install_link, timezone, ..$(PTXCONF_GLIBC_LOCALTIME_LINK), /etc/localtime)
+ifdef PTXCONF_GLIBC_LOCALTIME
+ @$(call install_link, timezone, ..$(TIMEZONE_LOCALTIME_FILE), \
+ /etc/localtime)
+ @$(call install_alternative, timezone, 0, 0, 0644, /etc/timezone)
+ @$(call install_replace, timezone, /etc/timezone, @TIMEZONE@, \
+ $(PTXCONF_GLIBC_LOCALTIME))
endif
@$(call install_finish, timezone)