Changeset df6532c for udev


Ignore:
Timestamp:
May 14, 2006, 5:41:04 PM (19 years ago)
Author:
Jim Gifford <clfs@…>
Branches:
clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
4631c1c
Parents:
4dd194e2
Message:

r3505@server: jim | 2006-05-14 17:40:44 -0700
Enhancements to the cdrom symlinks add on

Location:
udev
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • udev/35-helper.rules

    r4dd194e2 rdf6532c  
    2424BUS=="scsi",    KERNEL=="sg[0-9]*", ACTION=="add", DRIVER=="sr", GROUP="cdrom"
    2525
    26 BUS=="ide",     ENV{ID_CDROM}=="?*", PROGRAM="cdsymlink_helper.sh %k", SYMLINK+="cdrom%c", GROUP="cdrom"
    27 BUS=="ide",     ENV{ID_CDROM_CD_R}=="?*", PROGRAM="cdsymlink_helper.sh %k", SYMLINK+="cdr%c"
    28 BUS=="ide",     ENV{ID_CDROM_CD_RW}=="?*", PROGRAM="cdsymlink_helper.sh %k", SYMLINK+="cdrw%c"
    29 BUS=="ide",     ENV{ID_CDROM_DVD}=="?*", PROGRAM="cdsymlink_helper.sh %k", SYMLINK+="dvd%c"
    30 BUS=="ide",     ENV{ID_CDROM_DVD_R}=="?*", PROGRAM="cdsymlink_helper.sh %k", SYMLINK+="dvdrw%c"
     26BUS=="ide",     ENV{ID_CDROM}=="?*", PROGRAM="cdsymlink_helper.sh %k ide", SYMLINK+="cdrom%c"
     27BUS=="ide",     ENV{ID_CDROM_CD_R}=="?*", PROGRAM="cdsymlink_helper.sh %k ide", SYMLINK+="cdr%c"
     28BUS=="ide",     ENV{ID_CDROM_CD_RW}=="?*", PROGRAM="cdsymlink_helper.sh %k ide", SYMLINK+="cdrw%c"
     29BUS=="ide",     ENV{ID_CDROM_DVD}=="?*", PROGRAM="cdsymlink_helper.sh %k ide", SYMLINK+="dvd%c"
     30BUS=="ide",     ENV{ID_CDROM_DVD_R}=="?*", PROGRAM="cdsymlink_helper.sh %k ide", SYMLINK+="dvdrw%c"
    3131
    32 BUS=="scsi",    ENV{ID_CDROM}=="?*", SYMLINK+="cdrom%n", GROUP="cdrom"
    33 BUS=="scsi",    ENV{ID_CDROM_CD_R}=="?*", SYMLINK+="cdr%n"
    34 BUS=="scsi",    ENV{ID_CDROM_CD_RW}=="?*", SYMLINK+="cdrw%n"
    35 BUS=="scsi",    ENV{ID_CDROM_DVD}=="?*", SYMLINK+="dvd%n"
    36 BUS=="scsi",    ENV{ID_CDROM_DVD_R}=="?*", SYMLINK+="dvdrw%n"
     32BUS=="scsi",    ENV{ID_CDROM}=="?*", PROGRAM="cdsymlink_helper.sh %k scsi", SYMLINK+="cdrom%c"
     33BUS=="scsi",    ENV{ID_CDROM_CD_R}=="?*", PROGRAM="cdsymlink_helper.sh %k scsi", SYMLINK+="cdr%c"
     34BUS=="scsi",    ENV{ID_CDROM_CD_RW}=="?*", PROGRAM="cdsymlink_helper.sh %k scsi", SYMLINK+="cdrw%c"
     35BUS=="scsi",    ENV{ID_CDROM_DVD}=="?*", PROGRAM="cdsymlink_helper.sh %k scsi", SYMLINK+="dvd%c"
     36BUS=="scsi",    ENV{ID_CDROM_DVD_R}=="?*", PROGRAM="cdsymlink_helper.sh %k scsi", SYMLINK+="dvdrw%c"
    3737
    3838# adds floppy devices
  • udev/cdsymlink_helper.sh

    r4dd194e2 rdf6532c  
    1616
    1717KERN_NAME="$1"
     18BUS="$2"
     19test=0
    1820
    1921if [ "$KERN_NAME" = "" ]; then
     
    2224fi
    2325
    24 FILES="`ls /sys/bus/ide/drivers/ide-cdrom | grep 1.`"
    25         for file in $FILES; do
    26                 TEST="`ls /sys/bus/ide/drivers/ide-cdrom/$file | grep -c $KERN_NAME`"
    27                 if [ "$TEST" = "1" ]; then
    28                         link="`echo $file | cut -f2 -d.`"
    29                         echo $link
    30                 fi
    31         done
     26if [ "$BUS" = "ide" ]; then
     27        FILES="`ls /sys/bus/ide/drivers/ide-cdrom | grep '\.' `"
     28                for file in $FILES; do
     29                        TEST="`ls /sys/bus/ide/drivers/ide-cdrom/$file | grep -c $KERN_NAME`"
     30                        if [ "$TEST" = "1" ]; then
     31                                link="`echo $file | cut -f2 -d.`"
     32                                while [ $test -lt 1 ] ; do
     33                                        if [ -e /dev/cdrom$link ]; then
     34                                                link=$[$link+1]
     35                                        else
     36                                                test=1
     37                                                echo $link
     38                                        fi
     39                                done
     40                        fi
     41                done
     42fi
     43
     44if [ "$BUS" = "scsi" ]; then
     45        link=$KERN_NAME
     46                while [ $test -lt 1 ] ; do
     47                        if [ -e /dev/cdrom$link ]; then
     48                                link=$[$link+1]
     49                        else
     50                                test=1
     51                                echo $link
     52                        fi
     53                done
     54fi
     55
Note: See TracChangeset for help on using the changeset viewer.