Archaic and all I came around an interesting way to fix the cd-symlink issue, without having to use the script that is in LFS.org repo. Just passing on the information I just learned hopefully it will be useful to someone. These new rules are in the udev-cross-lfs packages as of today, if you want to test them out.

For SCSI

BUS=="scsi", KERNEL=="sr[0-9]*", ACTION=="add", IMPORT="cdrom_id --export $tempnode" BUS=="scsi", KERNEL="scd[a-z]", ACTION=="add", IMPORT="cdrom_id --export $tempnode" BUS=="scsi", KERNEL=="sg[0-9]*", ACTION=="add", DRIVER=="sr", GROUP="cdrom"

BUS=="scsi", ENV{ID_CDROM}=="?*",       SYMLINK+="cdrom%n", GROUP="cdrom"
BUS=="scsi", ENV{ID_CDROM_CD_R}=="?*",  SYMLINK+="cdr%n"
BUS=="scsi", ENV{ID_CDROM_CD_RW}=="?*", SYMLINK+="cdrw%n"
BUS=="scsi", ENV{ID_CDROM_DVD}=="?*",   SYMLINK+="dvd%n"
BUS=="scsi", ENV{ID_CDROM_DVD_R}=="?*", SYMLINK+="dvdrw%n"

For IDE

BUS=="ide", KERNEL=="hd[a-z]", ACTION=="add", IMPORT="cdrom_id --export $tempnode"

BUS=="ide", ENV{ID_CDROM}=="?*", PROGRAM="cdsymlink_helper.sh %k", SYMLINK+="cdrom%c", GROUP="cdrom" BUS=="ide", ENV{ID_CDROM_CD_R}=="?*", PROGRAM="cdsymlink_helper.sh %k", SYMLINK+="cdr%c" BUS=="ide", ENV{ID_CDROM_CD_RW}=="?*", PROGRAM="cdsymlink_helper.sh %k", SYMLINK+="cdrw%c" BUS=="ide", ENV{ID_CDROM_DVD}=="?*", PROGRAM="cdsymlink_helper.sh %k", SYMLINK+="dvd%c" BUS=="ide", ENV{ID_CDROM_DVD_R}=="?*", PROGRAM="cdsymlink_helper.sh %k", SYMLINK+="dvdrw%c"

new file cdsymlink_helper

KERN_NAME="$1"

if [ "$KERN_NAME" = "" ]; then
       mesg Bad invocation: \$1 is not set
       exit 1
fi
FILES="`ls /sys/bus/ide/drivers/ide-cdrom | grep 1.`"
       for file in $FILES; do
TEST="`ls /sys/bus/ide/drivers/ide-cdrom/$file | grep -c $KERN_NAME`"
               if [ "$TEST" = "1" ]; then
                       link="`echo $file | cut -f2 -d.`"
                       echo $link
               fi
       done

--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to