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:36:23 +0000 |
commit | 91367de75575e79a94b2f90b6b7aa8740a039fc5 (patch) | |
tree | 8183f98d49a0800a937da03130010f546c70c551 /meta | |
parent | fe2d3c0916a463a7c2bb2e228d7d4f547cbbb5dd (diff) | |
download | poky-91367de75575e79a94b2f90b6b7aa8740a039fc5.tar.gz |
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.
(From OE-Core rev: cc8695f22bc70ef958f81d0d3da73dece5f4700a)
Signed-off-by: Lauri Hintsala <lauri.hintsala@bluegiga.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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 | |||
62 | fi | 62 | fi |
63 | 63 | ||
64 | # Set the system clock from hardware clock | 64 | # Set the system clock from hardware clock |
65 | # If the timestamp is 1 day or more recent than the current time, | 65 | # If the timestamp is more recent than the current time, |
66 | # use the timestamp instead. | 66 | # use the timestamp instead. |
67 | /etc/init.d/hwclock.sh start | 67 | /etc/init.d/hwclock.sh start |
68 | if test -e /etc/timestamp | 68 | if test -e /etc/timestamp |
69 | then | 69 | then |
70 | SYSTEMDATE=`date -u +%2m%2d%2H%2M%4Y` | 70 | SYSTEMDATE=`date -u +%4Y%2m%2d` |
71 | read TIMESTAMP < /etc/timestamp | 71 | read TIMESTAMP < /etc/timestamp |
72 | NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE + 10000 \)` | 72 | if [ ${TIMESTAMP#????????}${TIMESTAMP%????????} -gt $SYSTEMDATE ]; then |
73 | if [ $NEEDUPDATE -eq 1 ]; then | ||
74 | date -u $TIMESTAMP | 73 | date -u $TIMESTAMP |
75 | /etc/init.d/hwclock.sh stop | 74 | /etc/init.d/hwclock.sh stop |
76 | fi | 75 | fi |