system/timezone: check localtime exists
When installing a localtime, check it is a valid timezone. [Peter: extend error message to make it clear to the user what to change] Reported-by: Sagaert Johan <sagaert.johan@skynet.be> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
5d231598c2
commit
5f017a8961
@ -27,6 +27,11 @@ define TZ_INSTALL_TARGET_CMDS
|
||||
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/$(TZDATA_LOCALTIME) ]; then \
|
||||
printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \
|
||||
"$(TZDATA_LOCALTIME)"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
cd $(TARGET_DIR)/etc; \
|
||||
ln -sf ../usr/share/zoneinfo/uclibc/$(TZDATA_LOCALTIME) TZ; \
|
||||
fi
|
||||
|
@ -44,6 +44,11 @@ define TZDATA_INSTALL_TARGET_CMDS
|
||||
ln -sfn "$${zone}" "$${zone##*/}"; \
|
||||
done
|
||||
if [ -n "$(TZDATA_LOCALTIME)" ]; then \
|
||||
if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/$(TZDATA_LOCALTIME) ]; then \
|
||||
printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \
|
||||
"$(TZDATA_LOCALTIME)"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
cd $(TARGET_DIR)/etc; \
|
||||
ln -sf ../usr/share/zoneinfo/$(TZDATA_LOCALTIME) localtime; \
|
||||
echo "$(TZDATA_LOCALTIME)" >timezone; \
|
||||
|
Loading…
Reference in New Issue
Block a user