]> code.ossystems Code Review - openembedded-core.git/commitdiff
initscripts: Make /etc/timestamp consistent again.
authorGary Thomas <gary@mlbassoc.com>
Fri, 10 Feb 2012 16:16:05 +0000 (09:16 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 23 Feb 2012 23:59:14 +0000 (23:59 +0000)
Commit cc8695 changed the way timestamps were handled
and added some extra munging to be able to compare them
reliably.  This change makes the timestamp value the same
everywhere and simplifies how the check to set the system
clock based on the timestamp is done.

Also, if the value stored in /etc/timestamp is newer
[at all] than the current system time, set the system clock
from the stored value, down to the minute, not just the day.

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
meta/recipes-core/initscripts/initscripts_1.0.bb

index d9e8ffa37362c1333879126161f4d7b3bff19201..20ec0a025dd66aa591a73267a37a56a76b869312 100755 (executable)
@@ -68,9 +68,9 @@ fi
 /etc/init.d/hwclock.sh start
 if test -e /etc/timestamp
 then
-       SYSTEMDATE=`date -u +%4Y%2m%2d`
+       SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M`
        read TIMESTAMP < /etc/timestamp
-       if [ ${TIMESTAMP#????????}${TIMESTAMP%????????} -gt $SYSTEMDATE ]; then
+       if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
                date -u $TIMESTAMP
                /etc/init.d/hwclock.sh stop
        fi
index 3d8e8507e7eef5e85ecbdbdd2d586f6682997e6d..1f804e23744199c16b2db22d6d5dad9ed9086e81 100644 (file)
@@ -10,4 +10,4 @@
 ### END INIT INFO
 
 # Update the timestamp
-date -u +%2m%2d%2H%2M%4Y > /etc/timestamp
+date -u +%4Y%2m%2d%2H%2M > /etc/timestamp
index 203c60548c2c208204d0b64b597bd4046ac740ee..b56c55c8a56c73559d72c4f6156d7e56d93e3f4b 100644 (file)
@@ -3,7 +3,7 @@ DESCRIPTION = "Initscripts provide the basic system startup initialization scrip
 SECTION = "base"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-PR = "r129"
+PR = "r130"
 
 INHIBIT_DEFAULT_DEPS = "1"