1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 | ]>
|
---|
7 |
|
---|
8 | <sect1 id="postlfs-devices" xreflabel="About Devices">
|
---|
9 | <?dbhtml filename="devices.html"?>
|
---|
10 |
|
---|
11 | <sect1info>
|
---|
12 | <othername>$LastChangedBy$</othername>
|
---|
13 | <date>$Date$</date>
|
---|
14 | </sect1info>
|
---|
15 |
|
---|
16 | <title>About Devices</title>
|
---|
17 |
|
---|
18 | <indexterm zone="postlfs-devices">
|
---|
19 | <primary sortas="e-etc-udev-rules">/etc/udev/rules.d</primary>
|
---|
20 | </indexterm>
|
---|
21 |
|
---|
22 |
|
---|
23 | <para>Although most devices needed by packages in BLFS and beyond are set up
|
---|
24 | properly by <application>udev</application> using the default rules installed
|
---|
25 | by LFS in <filename class="directory">/etc/udev/rules.d</filename>, there are
|
---|
26 | cases where the rules must be modified or augmented.</para>
|
---|
27 |
|
---|
28 | <para condition="html" role="usernotes">User Notes:
|
---|
29 | <ulink url="&blfs-wiki;/aboutdevices"/></para>
|
---|
30 |
|
---|
31 | <sect2>
|
---|
32 | <title>Multiple Sound Cards</title>
|
---|
33 |
|
---|
34 | <para>If there are multiple sound cards in a system, the "default"
|
---|
35 | sound card becomes random. The method to establish sound card order
|
---|
36 | depends on whether the drivers are modules or not. If the sound card
|
---|
37 | drivers are compiled into the kernel, control is via kernel command line
|
---|
38 | parameters in <filename>/boot/grub/menu.lst</filename>. For example,
|
---|
39 | if a system has both an FM801 card and a SoundBlaster PCI card, the
|
---|
40 | following can be appended to the command line:</para>
|
---|
41 |
|
---|
42 | <screen><literal>snd-fm801.index=0 snd-ens1371.index=1</literal></screen>
|
---|
43 |
|
---|
44 | <para>If the sound card drivers are built as modules, the order can be
|
---|
45 | established in the <filename>/etc/modprobe.conf</filename> file
|
---|
46 | with:</para>
|
---|
47 |
|
---|
48 | <screen><literal>options snd-fm801 index=0
|
---|
49 | options snd-ens1371 index=1</literal></screen>
|
---|
50 |
|
---|
51 | </sect2>
|
---|
52 |
|
---|
53 | <sect2>
|
---|
54 | <title>Udev Device Attributes</title>
|
---|
55 |
|
---|
56 | <para>Fine-tuning of device attributes such as group name and permissions
|
---|
57 | is possible by creating extra <application>udev</application> rules,
|
---|
58 | matching on something like this (on one line). The vendor and product can
|
---|
59 | be found by searching the /sys/devices directory entries or using
|
---|
60 | <command>udevinfo</command> after the device has been attached. See the
|
---|
61 | documentation in the current <application>udev</application> directory of
|
---|
62 | <filename class='directory'>/usr/share/doc</filename> for details.</para>
|
---|
63 |
|
---|
64 | <screen><literal>SUBSYSTEM=="usb_device", SYSFS{idVendor}=="05d8",
|
---|
65 | SYSFS{idProduct}=="4002", GROUP:="scanner", MODE:="0640"</literal></screen>
|
---|
66 |
|
---|
67 | </sect2>
|
---|
68 |
|
---|
69 | <sect2>
|
---|
70 | <title>USB Device Issues</title>
|
---|
71 |
|
---|
72 | <para>Some older applications, such as <application>VMware</application>,
|
---|
73 | need the following deprecated entry in the <filename>/etc/fstab</filename>
|
---|
74 | file. This is not normally needed.</para>
|
---|
75 |
|
---|
76 | <screen><literal>usbfs /proc/bus/usb usbfs devgid=14,devmode=0660 0 0</literal></screen>
|
---|
77 |
|
---|
78 | </sect2>
|
---|
79 |
|
---|
80 | <!--
|
---|
81 | <sect2>
|
---|
82 | <title>Multiple Network Interfaces</title>
|
---|
83 |
|
---|
84 |
|
---|
85 | </sect2>
|
---|
86 | -->
|
---|
87 |
|
---|
88 | <sect2>
|
---|
89 | <title>Devices for Servers</title>
|
---|
90 |
|
---|
91 | <para>In some cases, it makes sense to disable
|
---|
92 | <application>udev</application> completely and create static devices.
|
---|
93 | Servers are one example of this situation. Does a server need the
|
---|
94 | capability of handling dynamic devices? Only the system administrator can
|
---|
95 | answer that question, but in many cases the answer will be no.</para>
|
---|
96 |
|
---|
97 | <para>If dynamic devices are not desired, then static devices must be
|
---|
98 | created on the system. In the default configuration, the
|
---|
99 | <filename>/etc/rc.d/rcsysinit.d/S10udev</filename> boot script mounts a
|
---|
100 | <systemitem class="filesystem">tmpfs</systemitem> partition over the
|
---|
101 | <filename class="directory">/dev</filename> directory. This problem can be
|
---|
102 | overcome by mounting the root partition temporarily:</para>
|
---|
103 |
|
---|
104 | <warning><para>If the instructions below are not followed carefully, your
|
---|
105 | system could become unbootable.</para></warning>
|
---|
106 |
|
---|
107 |
|
---|
108 | <screen><userinput>mount --bind / /mnt
|
---|
109 | cp -a /dev/* /mnt/dev
|
---|
110 | rm /etc/rc.d/rcsysinit.d/{S10udev,S45udev_retry}
|
---|
111 | umount /mnt</userinput></screen>
|
---|
112 |
|
---|
113 | <para>At this point, the system will use static devices upon the next
|
---|
114 | reboot. Create any desired additional devices using
|
---|
115 | <command>mknod</command>.</para>
|
---|
116 |
|
---|
117 | <para>If you want to restore the dynamic devices, recreate the
|
---|
118 | <filename>/etc/rc.d/rcsysinit.d/{S10udev,S45udev_retry}</filename> symbolic
|
---|
119 | links and reboot again. Static devices do not need to be removed (console
|
---|
120 | and null are always needed) because they are covered by the <systemitem
|
---|
121 | class="filesystem">tmpfs</systemitem> partition. Disk usage for devices is
|
---|
122 | negligible (about 20–30 bytes per entry.)</para>
|
---|
123 |
|
---|
124 | </sect2>
|
---|
125 |
|
---|
126 | </sect1>
|
---|