File aaa_base.boot.clock.patch of Package aaa_base

From: Kurt Garloff <garloff@suse.de>
Subject: Use new hwclock options to speed up boot process
References: bnc441106

hwclock has new options --nowait --preadjust to allow us
calling it without waiting for a clock tick, resulting in
the system time to be set to up to 1s late (but never early!).
Use this to speed up the boot process by ~1.5s.

Run the exact calculation in the background (which will take
~2s to complete if there is a correction to be made, but will
not require significant CPU time).

--- a/etc/init.d/boot.clock
+++ b/etc/init.d/boot.clock
@@ -103,10 +103,14 @@
 		    echo "0"		>> /etc/adjtime
 		    echo "UTC"		>> /etc/adjtime
 		fi
-		/sbin/hwclock --adjust $HWCLOCK
+		/sbin/hwclock --preadjust --hctosys --nowait $HWCLOCK
 		rc_status
-	    fi
-	    /sbin/hwclock --hctosys $HWCLOCK
+		/sbin/hwclock --adjust --hctosys $HWCLOCK >/dev/null 2>&1 &
+	    else
+		/sbin/hwclock --hctosys --nowait $HWCLOCK
+		rc_status
+		/sbin/hwclock --hctosys $HWCLOCK >/dev/null 2>&1 &
+	    fi	
 	    rc_status -v -r
 	fi
 	;;
openSUSE Build Service is sponsored by