
Linux From Scratch - Version 7.0
205
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.
Kommentare zu diesen Handbüchern