misc/159625: [PATCH] replace hardcoded /usr/local with a variable in devd.conf to make it easier to override

Robert Millan rmh at debian.org
Tue Aug 9 10:00:23 UTC 2011


>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:


More information about the freebsd-bugs mailing list