aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initscripts/initscripts-1.0
diff options
context:
space:
mode:
authorGary Thomas <gary@mlbassoc.com>2012-02-10 09:16:05 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-23 23:59:14 +0000
commit5aab6653c9afa05e7c1b3ccd6bd34aec05c2a6f8 (patch)
tree55628b37f7426f9a50719e19eb21034f1ff4bd89 /meta/recipes-core/initscripts/initscripts-1.0
parenta101bc85adcc915f151348107e850b8998a395b0 (diff)
downloadopenembedded-core-contrib-5aab6653c9afa05e7c1b3ccd6bd34aec05c2a6f8.tar.gz
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. Signed-off-by: Gary Thomas <gary@mlbassoc.com>
Diffstat (limited to 'meta/recipes-core/initscripts/initscripts-1.0')
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh4
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh2
2 files changed, 3 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 d9e8ffa373..20ec0a025d 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
@@ -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
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 3d8e8507e7..1f804e2374 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 +%2m%2d%2H%2M%4Y > /etc/timestamp
+date -u +%4Y%2m%2d%2H%2M > /etc/timestamp