From: Haris Okanovic <haris.okanovic@ni.com>
To: openembedded-core@lists.openembedded.org
Cc: Haris Okanovic <haris.okanovic@ni.com>
Subject: [PATCH v2] tzdata: Make /etc/timezone optional
Date: Tue, 5 Jan 2016 13:04:29 -0600 [thread overview]
Message-ID: <1452020669-24036-1-git-send-email-haris.okanovic@ni.com> (raw)
In-Reply-To: <CAJTo0LaHTkODDiLfOYDQoFC-VBDD5h4XctAidjzRfyYGgdAfKA@mail.gmail.com>
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
---
meta/recipes-extended/tzdata/tzdata_2015g.bb | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-extended/tzdata/tzdata_2015g.bb b/meta/recipes-extended/tzdata/tzdata_2015g.bb
index 5b2afa6..a6faa1d 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"
--
2.6.2
next prev parent reply other threads:[~2016-01-05 19:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 23:51 [PATCH] tzdata: Make /etc/timezone optional Haris Okanovic
2016-01-05 13:03 ` Burton, Ross
2016-01-05 19:03 ` Haris Okanovic
2016-01-05 19:04 ` Haris Okanovic [this message]
2016-01-12 4:03 ` [PATCH v2] " Andre McCurdy
2016-01-12 10:24 ` Burton, Ross
2016-01-12 16:25 ` Haris Okanovic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1452020669-24036-1-git-send-email-haris.okanovic@ni.com \
--to=haris.okanovic@ni.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox