summaryrefslogtreecommitdiff
path: root/packages/initscripts
diff options
context:
space:
mode:
authorOpenmoko anonymizer key <devel@lists.openmoko.org>2007-09-02 22:14:36 +0000
committerOpenmoko anonymizer key <devel@lists.openmoko.org>2007-09-02 22:14:36 +0000
commitc1cfc8256ffcde3d0afd4de42b6f36b715c60dcb (patch)
treedbd86d9a8c2879937d1b40602fc97597470329e6 /packages/initscripts
parent98081bc36be3bb72de6ff3e57bc1a713fb453879 (diff)
parent31d144ff07c336393c2bc55ee5e486e17ee0bcfb (diff)
merge of '761183d571c60b5df965993faf1c23d3f933718b'
and 'd52a54d5f2ae378fe03f9c8d4cfb66d2d6a45d41'
Diffstat (limited to 'packages/initscripts')
-rwxr-xr-xpackages/initscripts/initscripts-1.0/bootmisc.sh20
-rw-r--r--packages/initscripts/initscripts-1.0/save-rtc.sh4
-rw-r--r--packages/initscripts/initscripts_1.0.bb2
3 files changed, 15 insertions, 11 deletions
diff --git a/packages/initscripts/initscripts-1.0/bootmisc.sh b/packages/initscripts/initscripts-1.0/bootmisc.sh
index 799cdca12b..2a40e0c410 100755
--- a/packages/initscripts/initscripts-1.0/bootmisc.sh
+++ b/packages/initscripts/initscripts-1.0/bootmisc.sh
@@ -61,16 +61,18 @@ fi
#
/sbin/ldconfig
-#
-# Recover the time, if there is a time file (first boot only)
-# If not, set system clock from hardware clock
-#
+# Set the system clock from hardware clock
+# If the timestamp is 1 day or more recent than the current time,
+# use the timestamp instead.
+/etc/init.d/hwclock.sh start
if test -e /etc/timestamp
then
- date -s `cat /etc/timestamp`
- mv -f /etc/timestamp /etc/timestamp.done
- /etc/init.d/hwclock.sh stop
-else
- /etc/init.d/hwclock.sh start
+ SYSTEMDATE=`date "+%Y%m%d"`
+ TIMESTAMP=`cat /etc/timestamp | awk '{ print substr($0,9,4) substr($0,1,4);}'`
+ NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE \)`
+ if [ $NEEDUPDATE -eq 1 ]; then
+ date `cat /etc/timestamp`
+ /etc/init.d/hwclock.sh stop
+ fi
fi
: exit 0
diff --git a/packages/initscripts/initscripts-1.0/save-rtc.sh b/packages/initscripts/initscripts-1.0/save-rtc.sh
index 4e0e270701..e786073051 100644
--- a/packages/initscripts/initscripts-1.0/save-rtc.sh
+++ b/packages/initscripts/initscripts-1.0/save-rtc.sh
@@ -1,3 +1,5 @@
#! /bin/sh
-#FIXME read timestamp handling for systems where RTC doesn't survive a reboot
/etc/init.d/hwclock.sh stop
+
+# Update the timestamp
+date +%2m%2d%2H%2M%Y > /etc/timestamp
diff --git a/packages/initscripts/initscripts_1.0.bb b/packages/initscripts/initscripts_1.0.bb
index 3d2f0f50b4..06a12c04a5 100644
--- a/packages/initscripts/initscripts_1.0.bb
+++ b/packages/initscripts/initscripts_1.0.bb
@@ -4,7 +4,7 @@ PRIORITY = "required"
DEPENDS = "makedevs"
RDEPENDS = "makedevs"
LICENSE = "GPL"
-PR = "r99"
+PR = "r100"
SRC_URI = "file://functions \
file://halt \