chiark / gitweb /
[PATCH] respect prefix= setting in built udev.conf (updated)
authorkpfleming@backtobasicsmgmt.com <kpfleming@backtobasicsmgmt.com>
Wed, 6 Oct 2004 05:15:16 +0000 (22:15 -0700)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:37:02 +0000 (21:37 -0700)
Here is a revised version of the patch. Again, it modifies the Makefile
to respect the prefix= setting when putting paths to
/etc/udev/{rules.s,permissions.d} into the built /etc/udev/udev.conf
file. It also changes the Makefile to create this file at "make" time,
not "make install" time. This allows for udevdir to be specified at
"make" time (thus putting the correct path into udev.conf), but not
specified at "make install" time (thus allowing the installation to
proceed without trying to use the wrong directory).

 Submitted By: Kevin P. Fleming <kpfleming@linuxfromscratch.org>
 Date: 2004-09-16
 Initial Package Version: 032
 Origin: David Jensen
 Description: correct udev's Makefile and template config file
 to respect the "prefix=" setting supplied when it is built; also
 build etc/udev/udev.conf at "make" time, not "make install" time

Makefile
etc/udev/udev.conf.in

index 67a7d465255585dd6f1f5dea566ba32b41e4a11d..24677d4194aa9364e86a4f3c746c1a0c538a99c7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -172,7 +172,10 @@ endif
 
 CFLAGS += -I$(PWD)/libsysfs
 
-all: $(ROOT) $(SENDER) $(DAEMON) $(INFO) $(TESTER) $(WAIT)
+# config files automatically generated
+GEN_CONFIGS =  $(LOCAL_CFG_DIR)/udev.conf
+
+all: $(ROOT) $(SENDER) $(DAEMON) $(INFO) $(TESTER) $(WAIT) $(GEN_CONFIGS)
        @extras="$(EXTRAS)" ; for target in $$extras ; do \
                echo $$target ; \
                $(MAKE) prefix=$(prefix) \
@@ -242,12 +245,9 @@ udev_version.h:
        @echo \#define UDEV_BIN                 \"$(DESTDIR)$(sbindir)/udev\" >> $@
        @echo \#define UDEVD_BIN                \"$(DESTDIR)$(sbindir)/udevd\" >> $@
 
-# config files automatically generated
-GEN_CONFIGS =  $(LOCAL_CFG_DIR)/udev.conf
-
 # Rules on how to create the generated config files
 $(LOCAL_CFG_DIR)/udev.conf:
-       sed -e "s:@udevdir@:$(udevdir):" < $(LOCAL_CFG_DIR)/udev.conf.in > $@
+       sed -e "s:@udevdir@:$(udevdir):" -e "s:@configdir@:$(configdir):" < $(LOCAL_CFG_DIR)/udev.conf.in > $@
 
 GEN_MANPAGES   = udev.8
 GEN_MANPAGESIN = udev.8.in
@@ -346,7 +346,7 @@ install-initscript: etc/init.d/udev etc/init.d/udev.debian etc/init.d/udev.init.
                $(INSTALL_DATA) -D etc/init.d/udev.debian $(DESTDIR)$(initdir)/udev; \
        fi
 
-install-config: $(GEN_CONFIGS)
+install-config:
        $(INSTALL) -d $(DESTDIR)$(configdir)/rules.d
        $(INSTALL) -d $(DESTDIR)$(configdir)/permissions.d
        @if [ ! -r $(DESTDIR)$(configdir)/udev.conf ]; then \
index 9b6b9c7ee23166d5cea97870ca0e72fe54db6d2f..4c71b1dfec3f5f83d76d0209aa752aa873e35980 100644 (file)
@@ -12,10 +12,10 @@ udev_root="@udevdir@/"
 udev_db="@udevdir@/.udev.tdb"
 
 # udev_rules - The name and location of the udev rules file
-udev_rules="/etc/udev/rules.d/"
+udev_rules="@configdir@/rules.d/"
 
 # udev_permissions - The name and location of the udev permission file
-udev_permissions="/etc/udev/permissions.d/"
+udev_permissions="@configdir@/permissions.d/"
 
 # default_mode - set the default mode for all nodes that have no
 #                explicit match in the permissions file