musl: read the timezone from /etc/TZ
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 19 Jun 2015 17:48:11 +0000 (17:48 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 19 Jun 2015 17:48:11 +0000 (17:48 +0000)
commitc4b059764bc6ac1e99807269ace219c7642351fa
treed4142aa111d8c1e0c40cdab35e63ef463d78559c
parent2adc113b226da5544f8af9a18d1a08d84536b603
musl: read the timezone from /etc/TZ

Currently the OpenWRT boot scripts write the timezone configuration to
/tmp/TZ, relying on the behaviour of uClibc that the timezone is read
from /etc/TZ if no TZ env variable is found.

This works because /etc/TZ is a symlink to /tmp/TZ.

Musl libc however only reads the timezone from the TZ env variable and
if it doesn't find it or it's empty, it will look for a zoneinfo
file, that doesn't exist.

So in musl builds no timezone is ever set.

This patch fixes the issue by having musl libc behave like uClibc: if no
TZ env variable is found it will try to load it from /etc/TZ.

Signed-off-by: Gianluca Anzolin <gianluca at sottospazio.it>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46069 3c298f89-4303-0410-b956-a3cf2f4a3e73
toolchain/musl/patches/110-read_timezone_from_fs.patch [new file with mode: 0644]