Skip to contentSkip to conversation

use udevdir in udev.conf

PATCH Olaf Hering 3 participants 5 messages Dec 7, 2003 – Dec 11, 2003 Kbuild

lore
Share & tools
lore
#0 lore raw

udevdir is a define, but udev.conf has a hardcoded path. Maybe this config file should be generated on the fly, like shown below. The default permissions should be 0600.

udev.conf 2003-12-07 22:40:05.000000000 +0100 renamed from udev.conf 2003-12-03 02:11:15.000000000 +0100 +3 -3
diff -purNx linux udev-008.orig/udev.conf udev-008/udev.conf
@@ -6,10 +6,10 @@
 
 
 # udev_root - where in the filesystem to place the device nodes
-udev_root="/udev/"
+udev_root="@udevdir@/"
 
 # udev_db - The name and location of the udev database.
-udev_db="/udev/.udev.tdb"
+udev_db="@udevdir@/.udev.tdb"
 
 # udev_rules - The name and location of the udev rules file
 udev_rules="/etc/udev/udev.rules"
@@ -19,5 +19,5 @@ udev_permissions="/etc/udev/udev.permiss
   
 # default_mode - set the default mode for all nodes that have no
 #                explicit match in the permissions file
-default_mode="0666"
+default_mode="0600"
 
Makefile 2003-12-07 22:40:05.000000000 +0100 renamed from Makefile 2003-12-07 22:39:52.000000000 +0100 +5 -4
diff -purNx linux udev-008.orig/Makefile udev-008/Makefile
@@ -47,7 +47,7 @@ INSTALL_SCRIPT = ${INSTALL_PROGRAM}
 EXTRAS   
 # place to put our device nodes
-udevdir = ${prefix}/udev/
+udevdir = ${prefix}/udev
 
 # Comment out this line to build with something other
 # than the local version of klibc
@@ -184,8 +184,8 @@ GEN_HEADERS =       udev_version.h
 # Rules on how to create the generated header files
 udev_version.h:
        @echo \#define UDEV_VERSION     \"$(VERSION)\" > $@
-       @echo \#define UDEV_ROOT        \"$(udevdir)\" >> $@
-       @echo \#define UDEV_DB          \"$(udevdir)\.udev.tdb\" >> $@
+       @echo \#define UDEV_ROOT        \"$(udevdir)/\" >> $@
+       @echo \#define UDEV_DB          \"$(udevdir)/\.udev.tdb\" >> $@
        @echo \#define UDEV_CONFIG_DIR  \"$(configdir)\" >> $@
        @echo \#define UDEV_CONFIG_FILE \"$(configdir)\udev.conf\" >> $@
        @echo \#define UDEV_RULES_FILE  \"$(configdir)\udev.rules\" >> $@
@@ -246,7 +246,8 @@ install: all
        $(INSTALL) -d $(DESTDIR)$(hotplugdir)
        $(INSTALL_PROGRAM) -D $(ROOT) $(DESTDIR)$(sbindir)/$(ROOT)
        $(INSTALL_DATA) -D udev.8 $(DESTDIR)$(mandir)/man8/udev.8
-       $(INSTALL_DATA) udev.conf $(DESTDIR)$(configdir)
+       sed -e "s-@udevdir@-$(udevdir)-" < udev.conf > udev.conf.in
+       $(INSTALL_DATA) udev.conf.in $(DESTDIR)$(configdir)
        $(INSTALL_DATA) udev.rules $(DESTDIR)$(configdir)
        $(INSTALL_DATA) udev.permissions $(DESTDIR)$(configdir)
        - rm -f $(DESTDIR)$(hotplugdir)/udev.hotplug
Signature · 14 lines
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#1 lore raw
Quoted 1 line · Olaf Hering

The default permissions should be 0600.

Agreed, I already changed this in the debian package.

Signature · 13 lines
ciao, |
Marco | [3504 reiPsRdxK9aBs]


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#2 lore raw
In reply to Olaf Hering
Quoted 2 lines · Olaf Hering

udevdir is a define, but udev.conf has a hardcoded path. Maybe this config file should be generated on the fly, like shown below.

Yes, something like this should probably be done. But your patch is creating udev.conf.in, not udev.conf, right? Want to switch that around, and then I'll rename the current udev.conf to udev.conf.in.

Quoted 1 line

The default permissions should be 0600.

Good point, I'll go change them.

thanks,

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Olaf Hering
Quoted 7 lines · Greg KH
Quoted 2 lines · Olaf Hering

udevdir is a define, but udev.conf has a hardcoded path. Maybe this config file should be generated on the fly, like shown below.

Yes, something like this should probably be done. But your patch is creating udev.conf.in, not udev.conf, right? Want to switch that around, and then I'll rename the current udev.conf to udev.conf.in.

just to keep the patch small.

Makefile renamed from olaf/sources/tree/udev.bk/Makefile +5 -4
diff -p -purN /olaf/sources/tree/udev.bk/Makefile udev.bk/Makefile
@@ -52,7 +52,7 @@ INSTALL_SCRIPT = ${INSTALL_PROGRAM}
 EXTRAS 
 # place to put our device nodes
-udevdir = ${prefix}/udev/
+udevdir = ${prefix}/udev
 
 # Comment out this line to build with something other 
 # than the local version of klibc
@@ -196,8 +196,8 @@ GEN_HEADERS =	udev_version.h
 # Rules on how to create the generated header files
 udev_version.h:
 	@echo \#define UDEV_VERSION	\"$(VERSION)\" > $@
-	@echo \#define UDEV_ROOT	\"$(udevdir)\" >> $@
-	@echo \#define UDEV_DB		\"$(udevdir)\.udev.tdb\" >> $@
+	@echo \#define UDEV_ROOT	\"$(udevdir)/\" >> $@
+	@echo \#define UDEV_DB		\"$(udevdir)/\.udev.tdb\" >> $@
 	@echo \#define UDEV_CONFIG_DIR	\"$(configdir)\" >> $@
 	@echo \#define UDEV_CONFIG_FILE	\"$(configdir)\udev.conf\" >> $@
 	@echo \#define UDEV_RULES_FILE	\"$(configdir)\udev.rules\" >> $@
@@ -212,7 +212,7 @@ $(ROOT): $(OBJS)
 clean:
 	-find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \
 	 | xargs rm -f 
-	-rm -f core $(ROOT) $(GEN_HEADERS)
+	-rm -f core $(ROOT) $(GEN_HEADERS) udev.conf
 	$(MAKE) -C klibc clean
 	@for target in $(EXTRAS) ; do \
 		echo $$target ; \
@@ -271,6 +271,7 @@ install: install-dbus-policy all
 	$(INSTALL) -d $(DESTDIR)$(hotplugdir)
 	$(INSTALL_PROGRAM) -D $(ROOT) $(DESTDIR)$(sbindir)/$(ROOT)
 	$(INSTALL_DATA) -D udev.8 $(DESTDIR)$(mandir)/man8/udev.8
+	sed -e "s-@udevdir@-$(udevdir)-" < udev.conf.in > udev.conf
 	$(INSTALL_DATA) udev.conf $(DESTDIR)$(configdir)
 	$(INSTALL_DATA) udev.rules $(DESTDIR)$(configdir)
 	$(INSTALL_DATA) udev.permissions $(DESTDIR)$(configdir)
udev.conf renamed from olaf/sources/tree/udev.bk/udev.conf +0 -23
diff -p -purN /olaf/sources/tree/udev.bk/udev.conf udev.bk/udev.conf
@@ -1,23 +0,0 @@
-# udev.conf
-# The main config file for udev
-#
-# This file can be used to override some of udev's default values
-# for where it looks for files, and where it places device nodes.
-
-
-# udev_root - where in the filesystem to place the device nodes
-udev_root="/udev/"
-
-# udev_db - The name and location of the udev database.
-udev_db="/udev/.udev.tdb"
-
-# udev_rules - The name and location of the udev rules file
-udev_rules="/etc/udev/udev.rules"
-
-# udev_permissions - The name and location of the udev permission file
-udev_permissions="/etc/udev/udev.permissions"
-
-# default_mode - set the default mode for all nodes that have no 
-#                explicit match in the permissions file
-default_mode="0600"
-
udev.conf.in renamed from olaf/sources/tree/udev.bk/udev.conf.in +23 -0
diff -p -purN /olaf/sources/tree/udev.bk/udev.conf.in udev.bk/udev.conf.in
@@ -0,0 +1,23 @@
+# udev.conf
+# The main config file for udev
+#
+# This file can be used to override some of udev's default values
+# for where it looks for files, and where it places device nodes.
+
+
+# udev_root - where in the filesystem to place the device nodes
+udev_root="@udevdir@/"
+
+# udev_db - The name and location of the udev database.
+udev_db="@udevdir@/.udev.tdb"
+
+# udev_rules - The name and location of the udev rules file
+udev_rules="/etc/udev/udev.rules"
+
+# udev_permissions - The name and location of the udev permission file
+udev_permissions="/etc/udev/udev.permissions"
+
+# default_mode - set the default mode for all nodes that have no 
+#                explicit match in the permissions file
+default_mode="0600"
+
Signature · 14 lines
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#4 lore raw
In reply to Olaf Hering
Quoted 11 lines · Olaf Hering
Quoted 7 lines · Greg KH
Quoted 2 lines · Olaf Hering

udevdir is a define, but udev.conf has a hardcoded path. Maybe this config file should be generated on the fly, like shown below.

Yes, something like this should probably be done. But your patch is creating udev.conf.in, not udev.conf, right? Want to switch that around, and then I'll rename the current udev.conf to udev.conf.in.

just to keep the patch small.

Thanks, I've applied this.

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel