initscripts: Make /etc/timestamp consistent again.

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.

(From OE-Core rev: 5aab6653c9afa05e7c1b3ccd6bd34aec05c2a6f8)

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Gary Thomas
2012-02-10 09:16:05 -07:00
committed by Richard Purdie
parent 831e0b5cd7
commit daeb5beb8f
3 changed files with 4 additions and 4 deletions

View File

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

View 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

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