From 31a9682c98005b4c8f37c37fb7bd50fad21b7115 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 4 Jul 2007 18:11:01 +0000 Subject: Allow syncing of hwlock for BSD and make our config files look fairly similar. --- init.d.BSD/clock | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'init.d.BSD/clock') diff --git a/init.d.BSD/clock b/init.d.BSD/clock index 71d170ee..0baa2884 100755 --- a/init.d.BSD/clock +++ b/init.d.BSD/clock @@ -2,6 +2,8 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +opts="save" + depend() { # BSD adjkerntz needs to be able to write to /etc if [ "${CLOCK}" = "UTC" -a -e /etc/wall_cmos_clock ] || @@ -28,7 +30,18 @@ start() { eend $? } +save() { + local TBLURB="Local Time" + [ "${CLOCK}" = "UTC" ] && TBLURB="UTC" + ebegin "Setting hardware clock using the system clock" "[${TBLURB}]" + adjkerntz -a + eend $? +} + stop() { + # Don't tweak the hardware clock on LiveCD halt. + [ -z "${CDBOOT}" -a "${CLOCK_SYSTOHC}" = "yes" ] && save + ebegin "Stopping the System Clock Adjuster" if start-stop-daemon --test --quiet --stop --exec /sbin/adjkerntz ; then start-stop-daemon --stop --exec /sbin/adjkerntz -- cgit v1.2.3