From 1118b1757d67c5e7deb4c9e4b864b00f9d8a8b0c Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Tue, 24 May 2016 21:24:59 +0000 Subject: Create branches/merge in svn repo fo rtesting of merged LFS books git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/merge@11073 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter07/symlinksd.xml | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 chapter07/symlinksd.xml (limited to 'chapter07/symlinksd.xml') diff --git a/chapter07/symlinksd.xml b/chapter07/symlinksd.xml new file mode 100644 index 000000000..354ae319a --- /dev/null +++ b/chapter07/symlinksd.xml @@ -0,0 +1,63 @@ + + + %general-entities; +]> + + + + + Creating Custom Symlinks to Devices + + + Dealing with duplicate devices + + As explained in , the order in + which devices with the same function appear in + /dev is essentially random. + E.g., if you have a USB web camera and a TV tuner, sometimes + /dev/video0 refers to the camera and + /dev/video1 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 + , and sound card configuration can + be found in BLFS. + + 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 + /sys/class or + /sys/block. + For video devices, this may be + /sys/class/video4linux/videoX. + Figure out the attributes that identify the device uniquely (usually, + vendor and product IDs and/or serial numbers work): + +udevadm info -a -p /sys/class/video4linux/video0 + + Then write rules that create the symlinks, e.g.: + +cat > /etc/udev/rules.d/83-duplicate_devs.rules << "EOF" + +# 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" + +EOF + + The result is that /dev/video0 and + /dev/video1 devices still refer randomly to the tuner + and the web camera (and thus should never be used directly), but there are + symlinks /dev/tvtuner and + /dev/webcam that always point to the correct + device. + + + + -- cgit v1.2.3-54-g00ecf