clfs-1.2
clfs-2.1
clfs-3.0.0-systemd
clfs-3.0.0-sysvinit
systemd
sysvinit
Last change
on this file since 74b8feaa was df6532c, checked in by Jim Gifford <clfs@…>, 18 years ago |
r3505@server: jim | 2006-05-14 17:40:44 -0700
Enhancements to the cdrom symlinks add on
|
-
Property mode
set to
100755
|
File size:
1.0 KB
|
Rev | Line | |
---|
[93a4751] | 1 | #!/bin/sh
|
---|
| 2 | ########################################################################
|
---|
| 3 | #
|
---|
| 4 | # Description : cdsymlink_helper.sh
|
---|
| 5 | #
|
---|
| 6 | # Authors : Jim Gifford
|
---|
| 7 | #
|
---|
| 8 | # Version : 00.00
|
---|
| 9 | #
|
---|
| 10 | # Notes :
|
---|
| 11 | #
|
---|
| 12 | ########################################################################
|
---|
| 13 |
|
---|
| 14 | . /lib/udev/helper.functions
|
---|
| 15 | . /etc/sysconfig/udev_helper
|
---|
| 16 |
|
---|
| 17 | KERN_NAME="$1"
|
---|
[df6532c] | 18 | BUS="$2"
|
---|
| 19 | test=0
|
---|
[93a4751] | 20 |
|
---|
| 21 | if [ "$KERN_NAME" = "" ]; then
|
---|
| 22 | mesg Bad invocation: \$1 is not set
|
---|
| 23 | exit 1
|
---|
| 24 | fi
|
---|
[e6c3117] | 25 |
|
---|
[df6532c] | 26 | if [ "$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
|
---|
| 42 | fi
|
---|
| 43 |
|
---|
| 44 | if [ "$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
|
---|
| 54 | fi
|
---|
| 55 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.