summaryrefslogtreecommitdiff
path: root/meta/recipes-extended/tzdata
diff options
context:
space:
mode:
authorHaris Okanovic <haris.okanovic@ni.com>2016-01-05 13:04:29 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-11 23:23:16 +0000
commit5c535bf45fc324e31b42364c99d6fffa00167995 (patch)
tree7dbdf1f7d49db4c135071815f508e8017e0d363d /meta/recipes-extended/tzdata
parent7f087f161e8942bcd35f88999dfca418f01cd7fa (diff)
downloadopenembedded-core-5c535bf45fc324e31b42364c99d6fffa00167995.tar.gz
openembedded-core-5c535bf45fc324e31b42364c99d6fffa00167995.tar.bz2
openembedded-core-5c535bf45fc324e31b42364c99d6fffa00167995.zip
tzdata: Make /etc/timezone optional
Add INSTALL_TIMEZONE_FILE config variable to enable/disable installation of ${sysconfdir}/timezone (/etc/timezone) by tzdata packages. Defaults to "1" to maintain previous behavior. Most libc implementations can be configured to retrieve system's defaults timezone from /etc/localtime, and don't need a second file (/etc/timezone) to express this configuration. Maintaining this file is an unnecessary burden on sysadmins unless there's software using /etc/timezone directly (I.e. outside of libc). Some distributions may choose not to provide it. Testing: Built tzdata under default config and verified CONFFILES_tzdata still has both /etc/timezone and /etc/localtime and both are in the image. Built with INSTALL_TIMEZONE_FILE = "0" and verified /etc/timezone is removed from CONFFILES_tzdata and the image. Successfully installed package to an x64 target. Signed-off-by: Haris Okanovic <haris.okanovic@ni.com> Reviewed-by: Brad Mouring <brad.mouring@ni.com> Reviewed-by: Rich Tollerton <rich.tollerton@ni.com> Reviewed-by: Ken Sharp <ken.sharp@ni.com> Reviewed-by: Ross Burton <ross.burton@intel.com> Natinst-ReviewBoard-ID: 121628 Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-extended/tzdata')
-rw-r--r--meta/recipes-extended/tzdata/tzdata_2015g.bb8
1 files changed, 6 insertions, 2 deletions
diff --git a/meta/recipes-extended/tzdata/tzdata_2015g.bb b/meta/recipes-extended/tzdata/tzdata_2015g.bb
index 5b2afa6a31..a6faa1d19c 100644
--- a/meta/recipes-extended/tzdata/tzdata_2015g.bb
+++ b/meta/recipes-extended/tzdata/tzdata_2015g.bb
@@ -21,6 +21,7 @@ RCONFLICTS_${PN} = "timezones timezone-africa timezone-america timezone-antarcti
S = "${WORKDIR}"
DEFAULT_TIMEZONE ?= "Universal"
+INSTALL_TIMEZONE_FILE ?= "1"
TZONES= "africa antarctica asia australasia europe northamerica southamerica \
factory etcetera backward systemv \
@@ -48,7 +49,9 @@ do_install () {
# Install default timezone
if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then
install -d ${D}${sysconfdir}
- echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone
+ if [ "${INSTALL_TIMEZONE_FILE}" == "1" ]; then
+ echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone
+ fi
ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime
else
bberror "DEFAULT_TIMEZONE is set to an invalid value."
@@ -205,4 +208,5 @@ FILES_${PN} += "${datadir}/zoneinfo/Pacific/Honolulu \
${datadir}/zoneinfo/iso3166.tab \
${datadir}/zoneinfo/Etc/*"
-CONFFILES_${PN} += "${sysconfdir}/timezone ${sysconfdir}/localtime"
+CONFFILES_${PN} += "${@ "${sysconfdir}/timezone" if bb.utils.to_boolean(d.getVar('INSTALL_TIMEZONE_FILE', True)) else "" }"
+CONFFILES_${PN} += "${sysconfdir}/localtime"