From 841b7235aa2c0d12622dff65a3a6c763f6f7493e Mon Sep 17 00:00:00 2001 From: Bryan Kadzban Date: Sat, 4 Feb 2012 23:37:17 +0000 Subject: Change the recipe for wrapper kernel module dependencies to use the explicit soft-dependency support added to kmod. While I'm here, rewrite a bunch of the chapter-7 udev processing documentation, now that we use devtmpfs. Fixes #3010. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9727 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter07/udev.xml | 64 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 26 deletions(-) (limited to 'chapter07') diff --git a/chapter07/udev.xml b/chapter07/udev.xml index 3ceb7704c..33d10c17d 100644 --- a/chapter07/udev.xml +++ b/chapter07/udev.xml @@ -32,9 +32,9 @@ Using the Udev method, only those devices which are detected by the kernel get device nodes created for them. Because these device nodes will be created each time the system boots, they will be stored on a tmpfs file system (a virtual file system that - resides entirely in system memory). Device nodes do not require much space, so - the memory that is used is negligible. + class="filesystem">devtmpfs file system (a virtual file system + that resides entirely in system memory). Device nodes do not require much + space, so the memory that is used is negligible. History @@ -87,8 +87,8 @@ class="filesystem">sysfs filesystem is mounted (on /sys), data which the built-in drivers registered with sysfs are - available to userspace processes and to udevd for device - node creation. + available to userspace processes and to udevd for + processing (including modifications to device nodes). @@ -132,24 +132,31 @@ Device Node Creation - To obtain the right major and minor number for a device, Udev - relies on the information provided by sysfs in /sys. For example, - /sys/class/tty/vcs/dev contains the string - 7:0. This string is used by udevd to - create a device node with major number 7 and minor - 0. The names and permissions of the nodes created - under the /dev directory are - determined by rules specified in the files within the /etc/udev/rules.d/ directory. These are - numbered in a similar fashion to the LFS-Bootscripts package. If - udevd can't find a rule for the device it is creating, - it will default permissions to 660 and ownership to - root:root. Documentation on the syntax of the Udev - rules configuration files are available in - /usr/share/doc/udev-&udev-version;/writing_udev_rules/index.html - + As of Udev-&udev-version;, udevd no longer + creates device files in /dev. + Instead, this must be handled in the kernel, by the devtmpfs filesystem. Any driver that + wishes to register a device node will go through devtmpfs (via the driver core) to do it. + When a devtmpfs instance is + mounted on /dev, the device node + will initially be created with a fixed name, permissions, and owner. + + A short time later, the kernel will send a uevent to + udevd. Based on the rules specified in the files within the + /etc/udev/rules.d, /lib/udev/rules.d, and /run/udev/rules.d directories, + udevd will create additional symlinks to the device node, + or change its permissions, owner, or group, or modify the internal + udevd database entry for that object. + + The rules in these three directories are numbered in a similar + fashion to the LFS-Bootscripts package, and all three directories are + merged together. If udevd can't find a rule for the + device it is creating, it will leave the permissions and ownership at + whatever devtmpfs used + initially. @@ -247,12 +254,17 @@ enhances the functionality of snd-pcm by making the sound cards available to OSS applications), configure modprobe to load the wrapper after Udev loads the - wrapped module. To do this, add an install line in any + wrapped module. To do this, add a softdep line in any /etc/modprobe.d/<filename>.conf file. For example: -install snd-pcm /sbin/modprobe -i snd-pcm ; \ - /sbin/modprobe snd-pcm-oss ; true +softdep snd-pcm post: snd-pcm-oss + + Note that the softdep command also allows + pre: dependencies, or a mixture of both + pre: and post:. See the + modprobe.d(5) manual page for more information + on softdep syntax and capabilities. If the module in question is not a wrapper and is useful by itself, configure the modules bootscript to load this -- cgit v1.2.3-54-g00ecf