Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Khem Raj <raj.khem@gmail.com>, Jan Remmet <J.Remmet@phytec.de>
Cc: "openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] rootfs-postcommands: generate	/var/lib/systemd/clock
Date: Thu, 16 Jun 2016 14:57:12 +0000	[thread overview]
Message-ID: <3aa678e40c764504b9cdce828c1d236c@XBOX02.axis.com> (raw)
In-Reply-To: <693FEC68-8F39-42E1-AF73-D709F9EAD441@gmail.com>

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Khem Raj
> Sent: den 16 juni 2016 16:38
> To: Jan Remmet
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] rootfs-postcommands: generate
> /var/lib/systemd/clock
> 
> 
> > On Jun 16, 2016, at 7:17 AM, Jan Remmet <J.Remmet@phytec.de> wrote:
> >
> > On Wed, Jun 15, 2016 at 12:14:17PM -0700, Khem Raj wrote:
> >>
> >>> On Jun 15, 2016, at 6:36 AM, Jan Remmet <J.Remmet@phytec.de> wrote:
> >>>
> >>> systemd timesyncd check /var/lib/systemd/clock instead of
> >>> /etc/timestamp.
> >>> If this file is missing it defaults to TIME_EPOCH. It's set while
> >>> configuring systemd.
> >>>
> >>> Signed-off-by: Jan Remmet <j.remmet@phytec.de>
> >>> ---
> >>> meta/classes/rootfs-postcommands.bbclass | 6 ++++++
> >>> 1 file changed, 6 insertions(+)
> >>>
> >>> diff --git a/meta/classes/rootfs-postcommands.bbclass
> b/meta/classes/rootfs-postcommands.bbclass
> >>> index db8b551..0c7b764 100644
> >>> --- a/meta/classes/rootfs-postcommands.bbclass
> >>> +++ b/meta/classes/rootfs-postcommands.bbclass
> >>> @@ -234,6 +234,12 @@ python write_image_manifest () {
> >>> # sane default time setting
> >>> rootfs_update_timestamp () {
> >>> 	date -u +%4Y%2m%2d%2H%2M%2S >${IMAGE_ROOTFS}/etc/timestamp
> >>> +
> >>> +	if ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "true",
> "false", d)}; then
> >>> +		# touch needs timestamp as [[CC]YY]MMDDhhmm[.ss]
> >>> +		TS=$(sed 's/[.]*/&./13' ${IMAGE_ROOTFS}/etc/timestamp)
> >>> +		touch -t $TS ${IMAGE_ROOTFS}/var/lib/systemd/clock
> >>> +	fi
> >>> }
> >>
> >> i wonder if this will work with read only rootfs.
> > I found no special handling for systemd and /var/lib if
> > IMAGE_FEATURES read-only-rootfs is used.

If read-only-rootfs is used, then /var/lib is a bind mount to 
/var/volatile/lib (which is a tmpfs). This is handled by the
volatile-binds recipe.

> > If timesyncd didn't find /var/lib/systemd/clock it defaults to the
> > configure time value und try to write /var/lib/systemd/clock. On 
> > read-only it will silently fail.
> > So I don't see a problem here.
> 
> It fixes one case when rootfs is r/w but create another behavior when
> its r/o in r/o case /var/lib/systemd must be mounted r/w during boot.
> So the timesyncd service should check for that directory to exist I 
> have a hunch if thats checked then this patch may not be needed
> 
> >
> > Jan

//Peter



      reply	other threads:[~2016-06-16 14:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15 13:36 [PATCH] rootfs-postcommands: generate /var/lib/systemd/clock Jan Remmet
2016-06-15 19:14 ` Khem Raj
2016-06-16 14:17   ` Jan Remmet
     [not found]   ` <5762b536.ea7ec20a.4591c.ffffbfc2SMTPIN_ADDED_BROKEN@mx.google.com>
2016-06-16 14:38     ` Khem Raj
2016-06-16 14:57       ` Peter Kjellerstedt [this message]

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=3aa678e40c764504b9cdce828c1d236c@XBOX02.axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=J.Remmet@phytec.de \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=raj.khem@gmail.com \
    /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