diff options
author | Lauri Hintsala <lauri.hintsala@bluegiga.com> | 2011-12-14 08:27:27 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-12-15 14:17:19 +0000 |
commit | cc8695f22bc70ef958f81d0d3da73dece5f4700a (patch) | |
tree | 568ecc32968483bb41b94f1d5406890986400fac /meta/recipes-core | |
parent | 89a839225ccc5c3d831ef5f6e7b4857df8f165cf (diff) | |
download | openembedded-core-cc8695f22bc70ef958f81d0d3da73dece5f4700a.tar.gz openembedded-core-cc8695f22bc70ef958f81d0d3da73dece5f4700a.tar.bz2 openembedded-core-cc8695f22bc70ef958f81d0d3da73dece5f4700a.zip |
initscripts: fix timestamp checking at bootmisc.sh
Timestamp checking has been broken by the commit
2078af333d704fd894a2dedbc19cef5775cdadbb. Currently the RTC time
is always overwritten with the time from /etc/timestmap. Fix timestamp
checking and clean the code.
Signed-off-by: Lauri Hintsala <lauri.hintsala@bluegiga.com>
Diffstat (limited to 'meta/recipes-core')
-rwxr-xr-x | meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh index 03fd67c67e..ab18ad9b4c 100755 --- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh +++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh @@ -62,15 +62,14 @@ then fi # Set the system clock from hardware clock -# If the timestamp is 1 day or more recent than the current time, +# If the timestamp is more recent than the current time, # use the timestamp instead. /etc/init.d/hwclock.sh start if test -e /etc/timestamp then - SYSTEMDATE=`date -u +%2m%2d%2H%2M%4Y` + SYSTEMDATE=`date -u +%4Y%2m%2d` read TIMESTAMP < /etc/timestamp - NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE + 10000 \)` - if [ $NEEDUPDATE -eq 1 ]; then + if [ ${TIMESTAMP#????????}${TIMESTAMP%????????} -gt $SYSTEMDATE ]; then date -u $TIMESTAMP /etc/init.d/hwclock.sh stop fi |