From owner-freebsd-bugs@FreeBSD.ORG Tue Aug 9 10:00:23 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A1A4106566B for ; Tue, 9 Aug 2011 10:00:23 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4BC3D8FC18 for ; Tue, 9 Aug 2011 10:00:23 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p79A0NF2083761 for ; Tue, 9 Aug 2011 10:00:23 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p79A0NlN083760; Tue, 9 Aug 2011 10:00:23 GMT (envelope-from gnats) Resent-Date: Tue, 9 Aug 2011 10:00:23 GMT Resent-Message-Id: <201108091000.p79A0NlN083760@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Robert Millan Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17E95106564A for ; Tue, 9 Aug 2011 09:55:47 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 066A18FC13 for ; Tue, 9 Aug 2011 09:55:47 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p799tk7m081194 for ; Tue, 9 Aug 2011 09:55:46 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p799tkiU081192; Tue, 9 Aug 2011 09:55:46 GMT (envelope-from nobody) Message-Id: <201108090955.p799tkiU081192@red.freebsd.org> Date: Tue, 9 Aug 2011 09:55:46 GMT From: Robert Millan To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/159625: [PATCH] replace hardcoded /usr/local with a variable in devd.conf to make it easier to override X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 10:00:23 -0000 >Number: 159625 >Category: misc >Synopsis: [PATCH] replace hardcoded /usr/local with a variable in devd.conf to make it easier to override >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Aug 09 10:00:22 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Robert Millan >Release: FreeBSD 8.1 >Organization: >Environment: GNU/kFreeBSD thorin 8.1-1-amd64 #0 Mon Feb 21 22:03:13 UTC 2011 x86_64 amd64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ GNU/kFreeBSD >Description: Please could you replace the hardcoded /usr/local with a variable in devd.conf? This will make it easier to override this value (specially useful for downstream distributors of FreeBSD code). Patch attached. >How-To-Repeat: >Fix: Patch attached with submission follows: Index: devd.conf =================================================================== --- devd.conf (revision 224728) +++ devd.conf (working copy) @@ -8,12 +8,14 @@ # NB: device-name is shorthand for 'match device-name' options { + set prefix "/usr/local"; + # Each directory directive adds a directory the list of directories # that we scan for files. Files are read-in in the order that they # are returned from readdir(3). The rule-sets are combined to # create a DFA that's used to match events to actions. directory "/etc/devd"; - directory "/usr/local/etc/devd"; + directory "$prefix/etc/devd"; pid-file "/var/run/devd.pid"; # Setup some shorthand for regex that we use later in the file. @@ -101,7 +103,7 @@ #attach 100 { # match "vendor" "0x0cf3"; # match "product" "0x3000"; -# action "sleep 2 && /usr/sbin/ath3kfw -d $device-name -f /usr/local/etc/ath3k-1.fw"; +# action "sleep 2 && /usr/sbin/ath3kfw -d $device-name -f $prefix/etc/ath3k-1.fw"; #}; # When a USB keyboard arrives, attach it as the console keyboard. @@ -131,7 +133,7 @@ match "vendor" "0x0854"; match "product" "0x0100"; match "release" "0x0000"; - action "/usr/local/bin/ezdownload -f /usr/local/share/usb/firmware/0854.0100.0_01.hex $device-name"; + action "$prefix/bin/ezdownload -f $prefix/share/usb/firmware/0854.0100.0_01.hex $device-name"; }; # Firmware download for Entrega Serial DB25 adapter. @@ -143,8 +145,8 @@ }; # This entry starts the ColdSync tool in daemon mode. Make sure you have an up -# to date /usr/local/etc/palms. We override the 'listen' settings for port and -# type in /usr/local/etc/coldsync.conf. +# to date $prefix/etc/palms. We override the 'listen' settings for port and +# type in $prefix/etc/coldsync.conf. notify 100 { match "system" "USB"; match "subsystem" "DEVICE"; @@ -152,7 +154,7 @@ match "vendor" "0x082d"; match "product" "0x0100"; match "release" "0x0100"; - action "/usr/local/bin/coldsync -md -p /dev/$cdev -t usb"; + action "$prefix/bin/coldsync -md -p /dev/$cdev -t usb"; }; # @@ -267,7 +269,7 @@ # The following might be an example of something that a vendor might # install if you were to add their device. This might reside in -# /usr/local/etc/devd/deqna.conf. A deqna is, in this hypothetical +# $prefix/etc/devd/deqna.conf. A deqna is, in this hypothetical # example, a pccard ethernet-like device. Students of history may # know other devices by this name, and will get the in-jokes in this # entry. @@ -320,7 +322,7 @@ notify 0 { match "system" "RCTL"; match "rule" "user:70:swap:.*"; - action "/usr/local/etc/rc.d/postgresql restart" + action "$prefix/etc/rc.d/postgresql restart" }; */ >Release-Note: >Audit-Trail: >Unformatted: