Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 06 Apr 2003 20:52:14 +0200
From:      des@ofug.org (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=)
To:        arch@freebsd.org
Subject:   Add timecounter option to rc.conf
Message-ID:  <xzp1y0fmpb5.fsf@flood.ping.uio.no>

next in thread | raw e-mail | index | archive | help
--=-=-=
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

The attached patch adds a timecounter option to rc.conf and an rc.d
script to handle it.

DES
--=20
Dag-Erling Sm=F8rgrav - des@ofug.org


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=timecounter.diff

Index: defaults/rc.conf
===================================================================
RCS file: /home/ncvs/src/etc/defaults/rc.conf,v
retrieving revision 1.171
diff -u -u -r1.171 rc.conf
--- defaults/rc.conf	17 Mar 2003 23:15:53 -0000	1.171
+++ defaults/rc.conf	6 Apr 2003 18:35:48 -0000
@@ -426,6 +426,7 @@
 harvest_ethernet="YES"	# Entropy device harvests ethernet randomness
 harvest_p_to_p="YES"	# Entropy device harvests point-to-point randomness
 dmesg_enable="YES"	# Save dmesg(8) to /var/run/dmesg.boot
+timecounter="NO"	# Timecounter hardware to use (NO for default).
 
 ##############################################################
 ### Define source_rc_confs, the mechanism used by /etc/rc.* ##
Index: rc.d/Makefile
===================================================================
RCS file: /home/ncvs/src/etc/rc.d/Makefile,v
retrieving revision 1.11
diff -u -u -r1.11 Makefile
--- rc.d/Makefile	17 Mar 2003 23:20:48 -0000	1.11
+++ rc.d/Makefile	6 Apr 2003 18:36:28 -0000
@@ -14,8 +14,8 @@
 	ntpdate othermta pccard pcvt ppp-user pppoed pwcheck quota random \
 	rarpd rcconf.sh root route6d routed rpcbind rtadvd rwho savecore \
 	securelevel sendmail serial sppp sshd swap1 syscons sysctl \
-	syslogd timed ttys usbd vinum virecover ypbind yppasswdd ypserv \
-	ypset ypupdated ypxfrd
+	syslogd timecounter timed ttys usbd vinum virecover ypbind yppasswdd \
+	ypserv ypset ypupdated ypxfrd
 FILESDIR=	/etc/rc.d
 FILESMODE=	${BINMODE}
 
Index: rc.d/timecounter
===================================================================
RCS file: rc.d/timecounter
diff -N rc.d/timecounter
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ rc.d/timecounter	6 Apr 2003 18:35:00 -0000
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: timecounter
+# BEFORE: securelevel
+# KEYWORD: FreeBSD
+
+. /etc/rc.subr
+
+name="timecounter"
+start_cmd="timecounter_start"
+stop_cmd=":"
+
+dumpon_start()
+{
+	# Select a timecounter
+	#
+	case ${timecounter} in
+	[Nn][Oo] | '')
+		;;
+	*)
+		sysctl kern.timecounter.hardware="${timecounter}"
+		;;
+	esac
+}
+
+load_rc_config $name
+run_rc_command "$1"

--=-=-=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzp1y0fmpb5.fsf>