]> git.pld-linux.org Git - packages/rdate.git/commitdiff
- experimental SYNC_HWCLOCK support
authorTomek Orzechowski <orzech@pld-linux.org>
Mon, 31 Mar 2003 20:43:40 +0000 (20:43 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rdate.cron -> 1.4
    rdate.sysconfig -> 1.2

rdate.cron
rdate.sysconfig

index fca69ae555734d6ab37c15e972efe72cda517e4c..1f47e06937496df3dd8f1215c4afe1054602f427 100644 (file)
@@ -12,6 +12,45 @@ if [ -f /etc/sysconfig/rdate ]; then
 fi
 
 # Check that networking is up.
-if [ "is_yes ${NETWORKING}" -a "is_yes ${SET_TIME}" -a -n "${RDATE_SERVER}" ]; then
-       /usr/bin/rdate -s -l $RDATE_SERVER
+if [ is_yes "${NETWORKING}" -a is_yes "${SET_TIME}" -a -n "${RDATE_SERVERS}" ]; then
+       /usr/bin/rdate -s "${RDATE_SERVERS}"
+       if [ $? -eq 0 -a is_yes "${SYNC_HWCLOCK}" -a -x /sbin/hwclock ]; then
+               # Set the system clock.
+               ARC=0
+               SRM=0
+               UTC=0
+               
+               if [ -f /etc/sysconfig/clock ]; then
+                       . /etc/sysconfig/clock
+               
+                       # convert old style clock config to new values
+                       if [ "${CLOCKMODE}" = "GMT" ]; then
+                               UTC=true
+                       elif [ "${CLOCKMODE}" = "ARC" ]; then
+                               ARC=true
+                       fi
+               fi
+               
+               if grep "system serial" /proc/cpuinfo | grep -q MILO ; then
+                       ARC=true
+               fi
+               
+               CLOCKFLAGS="--systohc"
+               
+               if is_yes "$UTC" ; then
+                       CLOCKFLAGS="$CLOCKFLAGS --utc"
+               else
+                       CLOCKFLAGS="$CLOCKFLAGS --localtime"
+               fi
+               
+               if is_yes "$ARC" ; then
+                       CLOCKFLAGS="$CLOCKFLAGS -A"
+               fi
+               
+               if is_yes "$SRM" ; then
+                       CLOCKFLAGS="$CLOCKFLAGS -S"
+               fi
+               
+               /sbin/hwclock $CLOCKFLAGS
+       fi
 fi
index e9a6fdabf99c0157ad8a38ee1bcda4048ae81812..3b66ab01804650dcb74151b648e9402732c35f9b 100644 (file)
@@ -1,5 +1,8 @@
 # Do you want to set data from remote server at all?
 #SET_TIME="yes"
 
+# Do you want to sync hardware clock with system time?
+#SYNC_HWCLOCK="yes"
+
 # From which server?
-#RDATE_SERVER=""
+#RDATE_SERVERS=""
This page took 0.102375 seconds and 4 git commands to generate.