From c226182dc5ff37f733c895ab16483ebd37c02bcc Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Thu, 3 Aug 2006 19:29:29 +0000 Subject: Ported updates from 6.2 branch. Small tags fixes. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7758 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter07/symlinks.xml | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'chapter07/symlinks.xml') diff --git a/chapter07/symlinks.xml b/chapter07/symlinks.xml index c3e799867..5538aed27 100644 --- a/chapter07/symlinks.xml +++ b/chapter07/symlinks.xml @@ -32,14 +32,23 @@ location of the device on the bus. If you are going to use the first approach, create a file similar to the following: -cat >/etc/udev/rules.d/82-cdrom.rules <<"EOF" +cat >/etc/udev/rules.d/82-cdrom.rules << EOF # Custom CD-ROM symlinks -SUBSYSTEM=="block", ENV{ID_MODEL}=="SAMSUNG_CD-ROM_SC-148F", ENV{ID_REVISION}=="PS05", SYMLINK+="cdrom" -SUBSYSTEM=="block", ENV{ID_MODEL}=="PHILIPS_CDD5301", ENV{ID_SERIAL}=="5VO1306DM00190", SYMLINK+="cdrom1 dvd" +SUBSYSTEM=="block", ENV{ID_MODEL}=="SAMSUNG_CD-ROM_SC-148F", \ + ENV{ID_REVISION}=="PS05", SYMLINK+="cdrom" +SUBSYSTEM=="block", ENV{ID_MODEL}=="PHILIPS_CDD5301", \ + ENV{ID_SERIAL}=="5VO1306DM00190", SYMLINK+="cdrom1 dvd" EOF + + Although the examples in this book work properly, be aware + that Udev does not recognize the backslash for line continuation. + If modifying Udev rules with an editor, be sure to leave each rule + on one physical line. + + This way, the symlinks will stay correct even if you move the drives to different positions on the IDE bus, but the /dev/cdrom symlink won't be created if you replace @@ -49,17 +58,19 @@ EOF The SUBSYSTEM=="block" key is needed in order to avoid matching SCSI generic devices. Without it, in the case with SCSI - CD-ROMs, the symlinks will sometimes point to the correct + CD-ROMs, the symlinks will sometimes point to the correct /dev/srX devices, and sometimes to /dev/sgX, which is wrong. - + The second approach yields: -cat >/etc/udev/rules.d/82-cdrom.rules <<"EOF" +cat >/etc/udev/rules.d/82-cdrom.rules << EOF # Custom CD-ROM symlinks -SUBSYSTEM=="block", ENV{ID_TYPE}=="cd", ENV{ID_PATH}=="pci-0000:00:07.1-ide-0:1", SYMLINK+="cdrom" -SUBSYSTEM=="block", ENV{ID_TYPE}=="cd", ENV{ID_PATH}=="pci-0000:00:07.1-ide-1:1", SYMLINK+="cdrom1 dvd" +SUBSYSTEM=="block", ENV{ID_TYPE}=="cd", \ + ENV{ID_PATH}=="pci-0000:00:07.1-ide-0:1", SYMLINK+="cdrom" +SUBSYSTEM=="block", ENV{ID_TYPE}=="cd", \ + ENV{ID_PATH}=="pci-0000:00:07.1-ide-1:1", SYMLINK+="cdrom1 dvd" EOF @@ -105,11 +116,13 @@ EOF Then write rules that create the symlinks, e.g.: -cat >/etc/udev/rules.d/83-duplicate_devs.rules <<"EOF" +cat >/etc/udev/rules.d/83-duplicate_devs.rules << EOF # Persistent symlinks for webcam and tuner -KERNEL=="video*", SYSFS{idProduct}=="1910", SYSFS{idVendor}=="0d81", SYMLINK+="webcam" -KERNEL=="video*", SYSFS{device}=="0x036f", SYSFS{vendor}=="0x109e", SYMLINK+="tvtuner" +KERNEL=="video*", SYSFS{idProduct}=="1910", SYSFS{idVendor}=="0d81", \ + SYMLINK+="webcam" +KERNEL=="video*", SYSFS{device}=="0x036f", SYSFS{vendor}=="0x109e", \ + SYMLINK+="tvtuner" EOF -- cgit v1.2.3-54-g00ecf