From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mediacenter.hi.pengutronix.de ([2001:6f8:1178:2::65]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1SFJbr-0007hJ-8n for ptxdist@pengutronix.de; Wed, 04 Apr 2012 08:22:23 +0200 Received: from mol by mediacenter.hi.pengutronix.de with local (Exim 4.72) (envelope-from ) id 1SFJbr-0004Gs-7J for ptxdist@pengutronix.de; Wed, 04 Apr 2012 08:22:23 +0200 Date: Wed, 4 Apr 2012 08:22:23 +0200 From: Michael Olbrich Message-ID: <20120404062223.GM28453@pengutronix.de> References: <1332865524-6288-1-git-send-email-post@lespocky.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1332865524-6288-1-git-send-email-post@lespocky.de> Subject: Re: [ptxdist] [PATCH] add /etc/timezone and replace content according to /etc/localtime Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Tue, Mar 27, 2012 at 06:25:24PM +0200, Alexander Dahl wrote: > Additionally to /etc/localtime which points to one zoneinfo file in > /usr/share/zoneinfo there is /etc/timezone containing the system wide > zone. Debian updates both in parallel and systemd uses this too. It's > an easy way to find out about the current system time zone. Rules are > extended in a way you only have to put e.g. 'Europe/Berlin' to ptxdist > menuconfig and symlink /etc/localtime and file /etc/timezone are > created at build time. > > This patch is a suggestion which works for me, open for discussion. And I liked it. Applied. Michael > Signed-off-by: Alexander Dahl > --- > generic/etc/timezone | 1 + > rules/timezone.in | 12 +++++++----- > rules/timezone.make | 10 ++++++++-- > 3 files changed, 16 insertions(+), 7 deletions(-) > create mode 100644 generic/etc/timezone > > diff --git a/generic/etc/timezone b/generic/etc/timezone > new file mode 100644 > index 0000000..f743783 > --- /dev/null > +++ b/generic/etc/timezone > @@ -0,0 +1 @@ > +@TIMEZONE@ > diff --git a/rules/timezone.in b/rules/timezone.in > index a1ed5b1..33a05eb 100644 > --- a/rules/timezone.in > +++ b/rules/timezone.in > @@ -14,14 +14,16 @@ menuconfig TIMEZONE > comment "Timezone support" > depends on TIMEZONE > > -config GLIBC_LOCALTIME_LINK > - prompt "Link of /etc/localtime" > +config GLIBC_LOCALTIME > + prompt "Timezone for /etc/localtime and /etc/timezone" > depends on TIMEZONE > - default "/usr/share/zoneinfo/Europe/Berlin" > + default "Europe/Berlin" > string > help > - Where should /etc/localtime point to. > - (e.g. /usr/share/zoneinfo/Europe/Berlin) > + Where should /etc/localtime point to? (e.g. put in "Europe/Berlin" > + here to let it point to /usr/share/zoneinfo/Europe/Berlin) > + Additionally this value is written to /etc/timezone like on Debian > + or for systemd. > > config TIMEZONE_LOCAL_DATABASE > bool > diff --git a/rules/timezone.make b/rules/timezone.make > index d208f14..28ed35e 100644 > --- a/rules/timezone.make > +++ b/rules/timezone.make > @@ -19,6 +19,8 @@ PACKAGES-$(PTXCONF_TIMEZONE) += timezone > TIMEZONE_VERSION := 1.0 > TIMEZONE := timezone-$(TIMEZONE_VERSION) > > +TIMEZONE_LOCALTIME_FILE := /usr/share/zoneinfo/$(PTXCONF_GLIBC_LOCALTIME) > + > TIMEZONE-$(PTXCONF_TIMEZONE_AFRICA) := "Africa" > TIMEZONE-$(PTXCONF_TIMEZONE_ATLANTIC) += "Atlantic" > TIMEZONE-$(PTXCONF_TIMEZONE_EUROPE) += "Europe" > @@ -117,8 +119,12 @@ $(STATEDIR)/timezone.targetinstall: > $(call install_copy, timezone, 0, 0, 0655, -, /usr/share/zoneinfo/$$f,n); \ > done > > -ifdef PTXCONF_GLIBC_LOCALTIME_LINK > - @$(call install_link, timezone, ..$(PTXCONF_GLIBC_LOCALTIME_LINK), /etc/localtime) > +ifdef PTXCONF_GLIBC_LOCALTIME > + @$(call install_link, timezone, ..$(TIMEZONE_LOCALTIME_FILE), \ > + /etc/localtime) > + @$(call install_alternative, timezone, 0, 0, 0644, /etc/timezone) > + @$(call install_replace, timezone, /etc/timezone, @TIMEZONE@, \ > + $(PTXCONF_GLIBC_LOCALTIME)) > endif > > @$(call install_finish, timezone) > -- > 1.7.2.5 > > > -- > ptxdist mailing list > ptxdist@pengutronix.de > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- ptxdist mailing list ptxdist@pengutronix.de