summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorBlair Elliott <blair.elliott@ni.com>2014-07-17 16:56:53 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-19 00:08:59 +0100
commit00017b4dd895afff9ff613d511cea373f13a96ea (patch)
tree9f13e26c9f184e88e8bf988a30c1f0b4d5e59b7b /meta
parentb573ae80110bccb5af0857fb3c91ab3812c37f50 (diff)
downloadpoky-00017b4dd895afff9ff613d511cea373f13a96ea.tar.gz
initscripts: save /etc/timestamp with seconds accuracy
Currently, /etc/timestamp is saved with minutes accuracy. To increase the accuracy, modify the save-rtc.sh and bootmisc.sh scripts to save and read /etc/timestamp respectively with seconds accuracy. (From OE-Core rev: 8fed53e4e72230c61f23cb36eda36c228aede1e0) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Ben Shelton <ben.shelton@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/image.bbclass2
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh5
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh2
3 files changed, 5 insertions, 4 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index a03b880402..772c3ed993 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -359,7 +359,7 @@ set_image_autologin () {
359# Can be use to create /etc/timestamp during image construction to give a reasonably 359# Can be use to create /etc/timestamp during image construction to give a reasonably
360# sane default time setting 360# sane default time setting
361rootfs_update_timestamp () { 361rootfs_update_timestamp () {
362 date -u +%4Y%2m%2d%2H%2M >${IMAGE_ROOTFS}/etc/timestamp 362 date -u +%4Y%2m%2d%2H%2M%2S >${IMAGE_ROOTFS}/etc/timestamp
363} 363}
364 364
365# Prevent X from being started 365# Prevent X from being started
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
index 5211824ade..ccc7f9f1f4 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
@@ -66,10 +66,11 @@ fi
66test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start 66test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start
67if test -e /etc/timestamp 67if test -e /etc/timestamp
68then 68then
69 SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M` 69 SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M%2S`
70 read TIMESTAMP < /etc/timestamp 70 read TIMESTAMP < /etc/timestamp
71 if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then 71 if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
72 date -u ${TIMESTAMP#????}${TIMESTAMP%????????} 72 # format the timestamp as date expects it (2m2d2H2M4Y.2S)
73 date -u ${TIMESTAMP:4:8}${TIMESTAMP:0:4}.${TIMESTAMP:(-2)}
73 test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh stop 74 test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh stop
74 fi 75 fi
75fi 76fi
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
index 1f804e2374..b038fc59d4 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
@@ -10,4 +10,4 @@
10### END INIT INFO 10### END INIT INFO
11 11
12# Update the timestamp 12# Update the timestamp
13date -u +%4Y%2m%2d%2H%2M > /etc/timestamp 13date -u +%4Y%2m%2d%2H%2M%2S > /etc/timestamp