[e73e361] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[e73e361] | 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 |
|
---|
[9f12e36] | 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
|
---|
[e73e361] | 37 | drivers are compiled into the kernel, control is via kernel command line
|
---|
[baf47952] | 38 | parameters in <filename>/boot/grub/menu.lst</filename>. For example,
|
---|
[9f12e36] | 39 | if a system has both an FM801 card and a SoundBlaster PCI card, the
|
---|
[e73e361] | 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>
|
---|
[826bacb5] | 54 | <title>Udev Device Attributes</title>
|
---|
[9f12e36] | 55 |
|
---|
[e73e361] | 56 | <para>Fine-tuning of device attributes such as group name and permissions
|
---|
| 57 | is possible by creating extra <application>udev</application> rules,
|
---|
[5e9adc53] | 58 | matching on something like this. The vendor and product can be found by
|
---|
| 59 | searching the <filename class='directory'>/sys/devices</filename> directory
|
---|
| 60 | entries or using <command>udevadm info</command> after the device has been
|
---|
| 61 | attached. See the documentation in the current
|
---|
| 62 | <application>udev</application> directory of
|
---|
[e73e361] | 63 | <filename class='directory'>/usr/share/doc</filename> for details.</para>
|
---|
[9f12e36] | 64 |
|
---|
[fdf8b6d0] | 65 | <screen><literal>SUBSYSTEM=="usb_device", SYSFS{idVendor}=="05d8", SYSFS{idProduct}=="4002", \
|
---|
| 66 | GROUP:="scanner", MODE:="0660"</literal></screen>
|
---|
| 67 |
|
---|
| 68 | <note><para>The above line is used for descriptive purposes only. The
|
---|
| 69 | scanner <application>udev</application> rules are put into place when
|
---|
| 70 | installing <xref linkend='sane'/>.</para></note>
|
---|
[9f12e36] | 71 |
|
---|
[e73e361] | 72 | </sect2>
|
---|
| 73 |
|
---|
| 74 | <sect2>
|
---|
| 75 | <title>USB Device Issues</title>
|
---|
[9f12e36] | 76 |
|
---|
[e73e361] | 77 | <para>Some older applications, such as <application>VMware</application>,
|
---|
| 78 | need the following deprecated entry in the <filename>/etc/fstab</filename>
|
---|
| 79 | file. This is not normally needed.</para>
|
---|
| 80 |
|
---|
| 81 | <screen><literal>usbfs /proc/bus/usb usbfs devgid=14,devmode=0660 0 0</literal></screen>
|
---|
| 82 |
|
---|
| 83 | </sect2>
|
---|
| 84 |
|
---|
| 85 | <!--
|
---|
| 86 | <sect2>
|
---|
| 87 | <title>Multiple Network Interfaces</title>
|
---|
| 88 |
|
---|
| 89 |
|
---|
| 90 | </sect2>
|
---|
| 91 | -->
|
---|
| 92 |
|
---|
| 93 | <sect2>
|
---|
| 94 | <title>Devices for Servers</title>
|
---|
| 95 |
|
---|
| 96 | <para>In some cases, it makes sense to disable
|
---|
| 97 | <application>udev</application> completely and create static devices.
|
---|
| 98 | Servers are one example of this situation. Does a server need the
|
---|
| 99 | capability of handling dynamic devices? Only the system administrator can
|
---|
| 100 | answer that question, but in many cases the answer will be no.</para>
|
---|
| 101 |
|
---|
| 102 | <para>If dynamic devices are not desired, then static devices must be
|
---|
| 103 | created on the system. In the default configuration, the
|
---|
| 104 | <filename>/etc/rc.d/rcsysinit.d/S10udev</filename> boot script mounts a
|
---|
| 105 | <systemitem class="filesystem">tmpfs</systemitem> partition over the
|
---|
| 106 | <filename class="directory">/dev</filename> directory. This problem can be
|
---|
| 107 | overcome by mounting the root partition temporarily:</para>
|
---|
| 108 |
|
---|
| 109 | <warning><para>If the instructions below are not followed carefully, your
|
---|
| 110 | system could become unbootable.</para></warning>
|
---|
[9f12e36] | 111 |
|
---|
[e73e361] | 112 |
|
---|
| 113 | <screen><userinput>mount --bind / /mnt
|
---|
| 114 | cp -a /dev/* /mnt/dev
|
---|
| 115 | rm /etc/rc.d/rcsysinit.d/{S10udev,S45udev_retry}
|
---|
| 116 | umount /mnt</userinput></screen>
|
---|
| 117 |
|
---|
| 118 | <para>At this point, the system will use static devices upon the next
|
---|
| 119 | reboot. Create any desired additional devices using
|
---|
| 120 | <command>mknod</command>.</para>
|
---|
[9f12e36] | 121 |
|
---|
[e73e361] | 122 | <para>If you want to restore the dynamic devices, recreate the
|
---|
| 123 | <filename>/etc/rc.d/rcsysinit.d/{S10udev,S45udev_retry}</filename> symbolic
|
---|
| 124 | links and reboot again. Static devices do not need to be removed (console
|
---|
| 125 | and null are always needed) because they are covered by the <systemitem
|
---|
| 126 | class="filesystem">tmpfs</systemitem> partition. Disk usage for devices is
|
---|
| 127 | negligible (about 20–30 bytes per entry.)</para>
|
---|
| 128 |
|
---|
| 129 | </sect2>
|
---|
| 130 |
|
---|
| 131 | </sect1>
|
---|