All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rootfs-postcommands: generate /var/lib/systemd/clock
@ 2016-06-15 13:36 Jan Remmet
  2016-06-15 19:14 ` Khem Raj
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Remmet @ 2016-06-15 13:36 UTC (permalink / raw)
  To: openembedded-core

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
 }
 
 # Prevent X from being started
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] rootfs-postcommands: generate /var/lib/systemd/clock
  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>
  0 siblings, 2 replies; 8+ messages in thread
From: Khem Raj @ 2016-06-15 19:14 UTC (permalink / raw)
  To: Jan Remmet; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1415 bytes --]


> 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.

> 
> # Prevent X from being started
> --
> 1.9.1
> 
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] rootfs-postcommands: generate /var/lib/systemd/clock
  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>
  1 sibling, 0 replies; 8+ messages in thread
From: Jan Remmet @ 2016-06-16 14:17 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

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 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.

Jan
> 
> > 
> > # Prevent X from being started
> > --
> > 1.9.1
> > 
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] rootfs-postcommands: generate /var/lib/systemd/clock
       [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
  0 siblings, 1 reply; 8+ messages in thread
From: Khem Raj @ 2016-06-16 14:38 UTC (permalink / raw)
  To: Jan Remmet; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2254 bytes --]


> 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 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
>> 
>>> 
>>> # Prevent X from being started
>>> --
>>> 1.9.1
>>> 
>>> --
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>> 
> 
> 


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] rootfs-postcommands: generate /var/lib/systemd/clock
  2016-06-16 14:38     ` Khem Raj
@ 2016-06-16 14:57       ` Peter Kjellerstedt
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Kjellerstedt @ 2016-06-16 14:57 UTC (permalink / raw)
  To: Khem Raj, Jan Remmet; +Cc: openembedded-core

> -----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



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] rootfs-postcommands: generate /var/lib/systemd/clock
  2016-06-15 10:02 ` Martin Jansa
@ 2016-06-15 13:31   ` Jan Remmet
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Remmet @ 2016-06-15 13:31 UTC (permalink / raw)
  To: openembedded-devel

On Wed, Jun 15, 2016 at 12:02:18PM +0200, Martin Jansa wrote:
> On Wed, Jun 15, 2016 at 11:23:32AM +0200, Jan Remmet 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.
> 
> Wrong ML, re-send to openembedded-core
Thanks,

Jan
> > 
> > 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
> >  }
> >  
> >  # Prevent X from being started
> > -- 
> > 1.9.1
> > 
> > -- 
> > _______________________________________________
> > Openembedded-devel mailing list
> > Openembedded-devel@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-devel
> 
> -- 
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com



> -- 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] rootfs-postcommands: generate /var/lib/systemd/clock
  2016-06-15  9:23 Jan Remmet
@ 2016-06-15 10:02 ` Martin Jansa
  2016-06-15 13:31   ` Jan Remmet
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Jansa @ 2016-06-15 10:02 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 1460 bytes --]

On Wed, Jun 15, 2016 at 11:23:32AM +0200, Jan Remmet 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.

Wrong ML, re-send to openembedded-core
> 
> 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
>  }
>  
>  # Prevent X from being started
> -- 
> 1.9.1
> 
> -- 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] rootfs-postcommands: generate /var/lib/systemd/clock
@ 2016-06-15  9:23 Jan Remmet
  2016-06-15 10:02 ` Martin Jansa
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Remmet @ 2016-06-15  9:23 UTC (permalink / raw)
  To: openembedded-devel

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
 }
 
 # Prevent X from being started
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-06-16 14:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2016-06-15  9:23 Jan Remmet
2016-06-15 10:02 ` Martin Jansa
2016-06-15 13:31   ` Jan Remmet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.