initscripts: first steps towards working together with RTC
authorMichael Lauer <mickey@vanille-media.de>
Tue, 14 Aug 2007 18:13:17 +0000 (18:13 +0000)
committerMichael Lauer <mickey@vanille-media.de>
Tue, 14 Aug 2007 18:13:17 +0000 (18:13 +0000)
TODO: might need more work for systems without a hardware clock

packages/initscripts/initscripts-1.0/bootmisc.sh
packages/initscripts/initscripts-1.0/save-rtc.sh
packages/initscripts/initscripts_1.0.bb

index 814dba6..1c817fa 100755 (executable)
@@ -62,10 +62,15 @@ fi
 /sbin/ldconfig
 
 # 
-# Recover the time, if there is a time file                 
+# Recover the time, if there is a time file (first boot only)
+# If not, set system clock from hardware clock
 #
 if test -e /etc/timestamp
 then
        date -s `cat /etc/timestamp`
+       mv -f /etc/timestamp /etc/timestamp.done
+       /etc/init.d/hwclock.sh start
+else
+       /etc/init.d/hwclock.sh stop
 fi
 : exit 0
index d06aa6d..de7c2b7 100644 (file)
@@ -1,16 +1,3 @@
 #! /bin/sh
-#
-# Copyright Matthias Hentges <devel@hentges.net> (c) 2006
-# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
-#
-# Filename: save-rtc.sh
-# Date: 03-Jul-06
-
-
-# Update the timestamp, if there is already one
-if test -e /etc/timestamp
-then
-       echo "Will restore RCT from /etc/timestamp on next boot"
-       echo "Delete that file to disable this feature."
-        date +%2m%2d%2H%2M%Y > /etc/timestamp
-fi
+#FIXME readd timestamp handling for systems where RTC doesn't survive a reboot
+/etc/init.d/hwclock stop
index 39b1eee..aa30833 100644 (file)
@@ -4,7 +4,7 @@ PRIORITY = "required"
 DEPENDS = "makedevs"
 RDEPENDS = "makedevs"
 LICENSE = "GPL"
-PR = "r96"
+PR = "r97"
 
 SRC_URI = "file://halt \
            file://ramdisk \
@@ -30,7 +30,7 @@ SRC_URI = "file://halt \
            file://device_table.txt \
            file://populate-volatile.sh \
            file://volatiles \
-          file://save-rtc.sh"
+           file://save-rtc.sh"
 
 SRC_URI_append_arm          = " file://alignment.sh"