aboutsummaryrefslogtreecommitdiffstats
path: root/chapter07/symlinksd.xml
diff options
context:
space:
mode:
authorDJ Lucas <dj@linuxfromscratch.org>2016-05-30 04:37:33 +0000
committerDJ Lucas <dj@linuxfromscratch.org>2016-05-30 04:37:33 +0000
commitefd5d1f3039242ad62214476c986980eb2ea2957 (patch)
tree93ea30e8baf375c8ee6af06e082dba1daa1f03ea /chapter07/symlinksd.xml
parent9a0d741437c1c371ecff9711a02fe3dd21b3ad9e (diff)
Merge symlinks.xml and symlinksd.xml.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11084 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter07/symlinksd.xml')
-rw-r--r--chapter07/symlinksd.xml63
1 files changed, 0 insertions, 63 deletions
diff --git a/chapter07/symlinksd.xml b/chapter07/symlinksd.xml
deleted file mode 100644
index b0d6460cf..000000000
--- a/chapter07/symlinksd.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?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="ch-scripts-symlinks" revision="systemd">
- <?dbhtml filename="symlinks.html"?>
-
- <title>Creating Custom Symlinks to Devices</title>
-
- <sect2>
- <title>Dealing with duplicate devices</title>
-
- <para>As explained in <xref linkend="ch-scripts-udev"/>, the order in
- which devices with the same function appear in
- <filename class="directory">/dev</filename> is essentially random.
- E.g., if you have a USB web camera and a TV tuner, sometimes
- <filename>/dev/video0</filename> refers to the camera and
- <filename>/dev/video1</filename> refers to the tuner, and sometimes
- after a reboot the order changes to the opposite one.
- For all classes of hardware except sound cards and network cards, this is
- fixable by creating udev rules for custom persistent symlinks.
- The case of network cards is covered separately in
- <xref linkend="ch-scripts-network"/>, and sound card configuration can
- be found in <ulink url="&blfs-book;postlfs/devices.html">BLFS</ulink>.</para>
-
- <para>For each of your devices that is likely to have this problem
- (even if the problem doesn't exist in your current Linux distribution),
- find the corresponding directory under
- <filename class="directory">/sys/class</filename> or
- <filename class="directory">/sys/block</filename>.
- For video devices, this may be
- <filename
- class="directory">/sys/class/video4linux/video<replaceable>X</replaceable></filename>.
- Figure out the attributes that identify the device uniquely (usually,
- vendor and product IDs and/or serial numbers work):</para>
-
-<screen role="nodump"><userinput>udevadm info -a -p /sys/class/video4linux/video0</userinput></screen>
-
- <para>Then write rules that create the symlinks, e.g.:</para>
-
-<screen role="nodump"><userinput>cat &gt; /etc/udev/rules.d/83-duplicate_devs.rules &lt;&lt; "EOF"
-<literal>
-# Persistent symlinks for webcam and tuner
-KERNEL=="video*", ATTRS{idProduct}=="1910", ATTRS{idVendor}=="0d81", \
- SYMLINK+="webcam"
-KERNEL=="video*", ATTRS{device}=="0x036f", ATTRS{vendor}=="0x109e", \
- SYMLINK+="tvtuner"
-</literal>
-EOF</userinput></screen>
-
- <para>The result is that <filename>/dev/video0</filename> and
- <filename>/dev/video1</filename> devices still refer randomly to the tuner
- and the web camera (and thus should never be used directly), but there are
- symlinks <filename>/dev/tvtuner</filename> and
- <filename>/dev/webcam</filename> that always point to the correct
- device.</para>
-
- </sect2>
-
-</sect1>