glfs/postlfs/config/devices.xml
Chris Staub 5e9adc53a8 Added xml tag for directory
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@8052 af4574ff-66df-0310-9fd7-8a98e5e911e0
2009-10-06 19:14:27 +00:00

132 lines
4.9 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
]>
<sect1 id="postlfs-devices" xreflabel="About Devices">
<?dbhtml filename="devices.html"?>
<sect1info>
<othername>$LastChangedBy$</othername>
<date>$Date$</date>
</sect1info>
<title>About Devices</title>
<indexterm zone="postlfs-devices">
<primary sortas="e-etc-udev-rules">/etc/udev/rules.d</primary>
</indexterm>
<para>Although most devices needed by packages in BLFS and beyond are set up
properly by <application>udev</application> using the default rules installed
by LFS in <filename class="directory">/etc/udev/rules.d</filename>, there are
cases where the rules must be modified or augmented.</para>
<para condition="html" role="usernotes">User Notes:
<ulink url="&blfs-wiki;/aboutdevices"/></para>
<sect2>
<title>Multiple Sound Cards</title>
<para>If there are multiple sound cards in a system, the "default"
sound card becomes random. The method to establish sound card order
depends on whether the drivers are modules or not. If the sound card
drivers are compiled into the kernel, control is via kernel command line
parameters in <filename>/boot/grub/menu.lst</filename>. For example,
if a system has both an FM801 card and a SoundBlaster PCI card, the
following can be appended to the command line:</para>
<screen><literal>snd-fm801.index=0 snd-ens1371.index=1</literal></screen>
<para>If the sound card drivers are built as modules, the order can be
established in the <filename>/etc/modprobe.conf</filename> file
with:</para>
<screen><literal>options snd-fm801 index=0
options snd-ens1371 index=1</literal></screen>
</sect2>
<sect2>
<title>Udev Device Attributes</title>
<para>Fine-tuning of device attributes such as group name and permissions
is possible by creating extra <application>udev</application> rules,
matching on something like this. The vendor and product can be found by
searching the <filename class='directory'>/sys/devices</filename> directory
entries or using <command>udevadm info</command> after the device has been
attached. See the documentation in the current
<application>udev</application> directory of
<filename class='directory'>/usr/share/doc</filename> for details.</para>
<screen><literal>SUBSYSTEM=="usb_device", SYSFS{idVendor}=="05d8", SYSFS{idProduct}=="4002", \
GROUP:="scanner", MODE:="0660"</literal></screen>
<note><para>The above line is used for descriptive purposes only. The
scanner <application>udev</application> rules are put into place when
installing <xref linkend='sane'/>.</para></note>
</sect2>
<sect2>
<title>USB Device Issues</title>
<para>Some older applications, such as <application>VMware</application>,
need the following deprecated entry in the <filename>/etc/fstab</filename>
file. This is not normally needed.</para>
<screen><literal>usbfs /proc/bus/usb usbfs devgid=14,devmode=0660 0 0</literal></screen>
</sect2>
<!--
<sect2>
<title>Multiple Network Interfaces</title>
</sect2>
-->
<sect2>
<title>Devices for Servers</title>
<para>In some cases, it makes sense to disable
<application>udev</application> completely and create static devices.
Servers are one example of this situation. Does a server need the
capability of handling dynamic devices? Only the system administrator can
answer that question, but in many cases the answer will be no.</para>
<para>If dynamic devices are not desired, then static devices must be
created on the system. In the default configuration, the
<filename>/etc/rc.d/rcsysinit.d/S10udev</filename> boot script mounts a
<systemitem class="filesystem">tmpfs</systemitem> partition over the
<filename class="directory">/dev</filename> directory. This problem can be
overcome by mounting the root partition temporarily:</para>
<warning><para>If the instructions below are not followed carefully, your
system could become unbootable.</para></warning>
<screen><userinput>mount --bind / /mnt
cp -a /dev/* /mnt/dev
rm /etc/rc.d/rcsysinit.d/{S10udev,S45udev_retry}
umount /mnt</userinput></screen>
<para>At this point, the system will use static devices upon the next
reboot. Create any desired additional devices using
<command>mknod</command>.</para>
<para>If you want to restore the dynamic devices, recreate the
<filename>/etc/rc.d/rcsysinit.d/{S10udev,S45udev_retry}</filename> symbolic
links and reboot again. Static devices do not need to be removed (console
and null are always needed) because they are covered by the <systemitem
class="filesystem">tmpfs</systemitem> partition. Disk usage for devices is
negligible (about 20&ndash;30 bytes per entry.)</para>
</sect2>
</sect1>