All of lore.kernel.org
 help / color / mirror / Atom feed
* [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
* [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

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  9:23 [PATCH] rootfs-postcommands: generate /var/lib/systemd/clock Jan Remmet
2016-06-15 10:02 ` Martin Jansa
2016-06-15 13:31   ` Jan Remmet
  -- strict thread matches above, loose matches on Subject: below --
2016-06-15 13:36 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 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.