Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Aug 2011 11:56:36 +0200
From:      Robert Millan <rmh@debian.org>
To:        freebsd-hackers@freebsd.org, Ed Maste <emaste@freebsd.org>
Subject:   [PATCH] replace hardcoded /usr/local with a variable in devd.conf to make it easier to override
Message-ID:  <CAOfDtXM1V%2BLX-fLvs2AzDHao%2BWUYbpPPdvnuamMy_0WV9_DUDw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hi,

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.

-- 
Robert Millan

[-- Attachment #2 --]
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"
 };
 
 */

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOfDtXM1V%2BLX-fLvs2AzDHao%2BWUYbpPPdvnuamMy_0WV9_DUDw>