diff options
author | Richard Purdie <richard@openedhand.com> | 2007-09-02 14:00:52 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-09-02 14:00:52 +0000 |
commit | 1cf731b1e3bb125449c2ef4e1194b6bf69e7b667 (patch) | |
tree | fc305d382d225d9a033fb1678bdc4720f38484e4 /meta/packages/initscripts/initscripts-1.0/bootmisc.sh | |
parent | 3cb6c768efa690f25035351fb7975bca59f94ee2 (diff) | |
download | poky-1cf731b1e3bb125449c2ef4e1194b6bf69e7b667.tar.gz |
initscripts: Sync with OE, primarily for better /etc/timestamp handling
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2650 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/initscripts/initscripts-1.0/bootmisc.sh')
-rwxr-xr-x | meta/packages/initscripts/initscripts-1.0/bootmisc.sh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/meta/packages/initscripts/initscripts-1.0/bootmisc.sh b/meta/packages/initscripts/initscripts-1.0/bootmisc.sh index 814dba676c..2a40e0c410 100755 --- a/meta/packages/initscripts/initscripts-1.0/bootmisc.sh +++ b/meta/packages/initscripts/initscripts-1.0/bootmisc.sh | |||
@@ -61,11 +61,18 @@ fi | |||
61 | # | 61 | # |
62 | /sbin/ldconfig | 62 | /sbin/ldconfig |
63 | 63 | ||
64 | # | 64 | # Set the system clock from hardware clock |
65 | # Recover the time, if there is a time file | 65 | # If the timestamp is 1 day or more recent than the current time, |
66 | # | 66 | # use the timestamp instead. |
67 | /etc/init.d/hwclock.sh start | ||
67 | if test -e /etc/timestamp | 68 | if test -e /etc/timestamp |
68 | then | 69 | then |
69 | date -s `cat /etc/timestamp` | 70 | SYSTEMDATE=`date "+%Y%m%d"` |
71 | TIMESTAMP=`cat /etc/timestamp | awk '{ print substr($0,9,4) substr($0,1,4);}'` | ||
72 | NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE \)` | ||
73 | if [ $NEEDUPDATE -eq 1 ]; then | ||
74 | date `cat /etc/timestamp` | ||
75 | /etc/init.d/hwclock.sh stop | ||
76 | fi | ||
70 | fi | 77 | fi |
71 | : exit 0 | 78 | : exit 0 |