Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Ni Qingliang <niqingliang@insigma.com.cn>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: how to set time zone
Date: Thu, 3 Nov 2011 08:47:41 +0800	[thread overview]
Message-ID: <1320281261.1504.10.camel@localhost.localdomain> (raw)
In-Reply-To: <4EB196D0.5010005@windriver.com>

maybe we can do the link in system booting, use the variable "TZ" to
create the symlink /etc/localtime, just like archlinux.
e.g. providing one script in /etc/rcS.d/ to create the symlink.

On Thu, 2011-11-03 at 03:15 +0800, Mark Hatle wrote:
> On 11/2/11 12:32 PM, Andrea Adami wrote:
> > On Mon, Oct 31, 2011 at 1:44 AM, Ni Qingliang <niqingliang@insigma.com.cn
> > <mailto:niqingliang@insigma.com.cn>> wrote:
> >
> >     I'd like the 'system level configuration' solution.
> >
> >     the /etc/localtime/ link can be done when packaging rootfs (using the
> >     system level configuration).
> >
> >     On Fri, 2011-10-28 at 22:43 +0800, Mark Hatle wrote:
> >     > Setting the default TZ for the image is something that should be done in a
> >     post
> >     > install script for the tzdata package or something similar.
> >     >
> >     > Since the /etc/localtime is usually a copy/hardlink or symlink to the timezone
> >     > data we don't want to package it up.  Instead we want to perform the actions
> >     > that a program running on the target system itself would use to change the
> >     timezone.
> >     >
> >     > So I think the easiest approach is to add a system level configuration
> >     variable
> >     > (set the default).
> >     >
> >     > Then use this variable to populate the configuration file that specifies the
> >     > system timezone... and then use the post install process to check the contents
> >     > of a text file.
> >     >
> >     > Alternatively do this via an initscript -- but for folks w/ read-only
> >     > filesystems I'm not sure that will work.
> >     >
> >     > --Mark
> >
> > <cut>
> >
> > Maybe I misunderstand "system level configuration" but in the meta-oe recipe we have
> >
> > DEFAULT_TIMEZONE ?= "Europe/London"
> >
> > Maybe UTC would be better?
> 
> To me no timezone (which is UTC) is preferable as the system designer can then
> set the timezone, externally to the package(s).
> 
> > Note how the variable is weak thus can be overridden in local.conf.
> >
> > Secondly, why do it as post-install or at image do_rootfs stage when we have set
> > the variable and are therefore able to provide sane defaults in do_install?
> 
> If it's done within a do_install, then the file (/etc/timezone) itself gets
> placed into the package.  If it's in the package, then if/when someone upgrades
> the package from a feed the timezone gets reset to the previous value.  That's a
> bug IMHO.
> 
> If it's done as a post-install script, then the timezone configuration can be
> evaluated and if one isn't set -- or there is no timezone file -- then we can
> set it to UTC or a similar default timezone.. (the value in the DEFAULT_TIMEZONE
> variable is reasonable in this approach.)
> 
> > Other points before starting to write a patch:
> > -why is the recipe in oe-core doing   chown -R root:root ${D}   ?
> 
> There was an issue with the way the timezone data was extracted/constructed that
> it was have all of the build system's uid/gid preserved in the copy to the final
> install directory -- so when packaging incorrect usernames and groups were fed
> into the process causing issues.
> 
> A simple chown -R root:root ${D} ensured that all of the timezone data was owned
> by the root user (on the target).
> 
> > -the logic around   # libc is removing zoneinfo files from package
> >   Is it only eglibc?
> 
> Timezone info is updated more often then the system libc.  So the zoneinfo files
> are handled externally of the libc.  This allows for easier updates over time..
> (This is my guess, as I'm not familiar with exactly what this comment refers to.)
> 
> > Regards
> >
> > Andrea
> >
> > |
> > |
> >
> >
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

-- 
Yi Qingliang
niqingliang@insigma.com.cn
https://niqingliang2003.wordpress.com




  reply	other threads:[~2011-11-03  0:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28  5:41 how to set time zone Ni Qingliang
2011-10-28  6:32 ` Samuel Stirtzel
2011-10-28  7:05   ` Ni Qingliang
2011-10-28  8:22     ` Andrea Adami
2011-10-28 14:43       ` Mark Hatle
2011-10-31  0:44         ` Ni Qingliang
2011-11-02 17:32           ` Andrea Adami
2011-11-02 19:15             ` Mark Hatle
2011-11-03  0:47               ` Ni Qingliang [this message]
2011-11-03  1:19                 ` Otavio Salvador
2011-11-03  1:35                   ` Ni Qingliang
2011-11-03  1:58                     ` Philip Balister
2011-11-03  2:14                       ` Ni Qingliang
2011-11-03 16:20               ` Andrea Adami
2011-10-28 16:15       ` Saul Wold

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=1320281261.1504.10.camel@localhost.localdomain \
    --to=niqingliang@insigma.com.cn \
    --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