From: Blair Elliott <blair.elli...@ni.com> 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.
Signed-off-by: Richard Tollerton <rich.toller...@ni.com> Signed-off-by: Ben Shelton <ben.shel...@ni.com> --- meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh | 5 +++-- meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh index 5211824..ccc7f9f 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 test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start if test -e /etc/timestamp then - SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M` + SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M%2S` read TIMESTAMP < /etc/timestamp if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then - date -u ${TIMESTAMP#????}${TIMESTAMP%????????} + # format the timestamp as date expects it (2m2d2H2M4Y.2S) + date -u ${TIMESTAMP:4:8}${TIMESTAMP:0:4}.${TIMESTAMP:(-2)} test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh stop fi fi 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 1f804e2..b038fc5 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 @@ ### END INIT INFO # Update the timestamp -date -u +%4Y%2m%2d%2H%2M > /etc/timestamp +date -u +%4Y%2m%2d%2H%2M%2S > /etc/timestamp -- 2.0.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core