From owner-freebsd-arch@FreeBSD.ORG Sun Apr 6 11:52:17 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6944D37B401 for ; Sun, 6 Apr 2003 11:52:17 -0700 (PDT) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDE0C43FAF for ; Sun, 6 Apr 2003 11:52:16 -0700 (PDT) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 406795308; Sun, 6 Apr 2003 20:52:15 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: arch@freebsd.org From: des@ofug.org (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Sun, 06 Apr 2003 20:52:14 +0200 Message-ID: User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Subject: Add timecounter option to rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2003 18:52:17 -0000 --=-=-= 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" --=-=-=--