diff options
| author | Yann E. MORIN <yann.morin.1998@free.fr> | 2017-07-04 08:56:39 +0200 |
|---|---|---|
| committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-07-04 09:00:05 +0200 |
| commit | e7e526e910632fdff6aa0652c9d252bbdcf3d7c8 (patch) | |
| tree | b981749f9c3769bbf929c67ad6ffe28bc088af28 /package/tz | |
| parent | 9e057861cb8314e1ce6e710f584a68a40eabc39b (diff) | |
| download | buildroot-e7e526e910632fdff6aa0652c9d252bbdcf3d7c8.tar.gz buildroot-e7e526e910632fdff6aa0652c9d252bbdcf3d7c8.zip | |
system: require a timezone to be set
Even though no timezone implicitly means UTC, systemd is not all that
happy when it does not have a timezone set. This is all fine on a RW
filesystem because systemd will create a symlink on its own (to
Etc/UTC), but not so much on a RO filesystem, causing all kind of
issues at boot time (up to the point that the system is unusable).
We fix that by requiring that the timezone is actually set. The check is
done by verifying that the timezone file is an actual file; if not set,
the test would find a directory and would thus fail.
Update the help entry accordingly.
Also fix indentation in tzdata.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Richard Braun <rbraun@sceen.net>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Martin Bark <martin@barkynet.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/tz')
| -rw-r--r-- | package/tz/tz.mk | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/package/tz/tz.mk b/package/tz/tz.mk index 6b1f9f4d24..7386361088 100644 --- a/package/tz/tz.mk +++ b/package/tz/tz.mk @@ -25,15 +25,12 @@ define TZ_INSTALL_TARGET_CMDS $(TARGET_DIR)/usr/share/zoneinfo/iso3166.tab mkdir -p $(TARGET_DIR)/usr/share/zoneinfo/uclibc cp -a $(@D)/output/* $(TARGET_DIR)/usr/share/zoneinfo/uclibc - if [ -n "$(TZ_LOCALTIME)" ]; then \ - if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/uclibc/$(TZ_LOCALTIME) ]; then \ - printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \ - "$(TZ_LOCALTIME)"; \ - exit 1; \ - fi; \ - cd $(TARGET_DIR)/etc; \ - ln -sf ../usr/share/zoneinfo/uclibc/$(TZ_LOCALTIME) TZ; \ + if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/uclibc/$(TZ_LOCALTIME) ]; then \ + printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \ + "$(TZ_LOCALTIME)"; \ + exit 1; \ fi + ln -sf ../usr/share/zoneinfo/uclibc/$(TZ_LOCALTIME) $(TARGET_DIR)/etc/TZ endef $(eval $(generic-package)) |

