linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* CD Symlinks Solution Idea
@ 2006-05-14 18:58 Jim Gifford
  2006-05-14 19:11 ` Jim Gifford
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Jim Gifford @ 2006-05-14 18:58 UTC (permalink / raw)
  To: linux-hotplug

I know a lot of people have been trying to figure out the cdrom sylinks 
issue. I think I've come up with a simple solution, if anyone see's any 
limitations or issues let me know.

Rules for symlinks

# check cdrom helper
BUS="ide",     KERNEL="hd[a-z]", ACTION="add", IMPORT="cdrom_id 
--export $tempnode"
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="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"

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"

A small program in /lib/udev called cdsymlinks.sh this program is for 
IDE only a different solution

Begin of file----
#!/bin/sh
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
End of file---





-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-06-12  7:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-14 18:58 CD Symlinks Solution Idea Jim Gifford
2006-05-14 19:11 ` Jim Gifford
2006-05-15  0:52 ` Jim Gifford
2006-05-16  8:23 ` juuso.alasuutari
2006-05-16 15:30 ` Marco d'Itri
2006-05-19 16:03 ` Harald Hoyer
2006-05-21  1:00 ` juuso.alasuutari
2006-05-21  4:01 ` Alexander E. Patrakov
2006-05-22 16:20 ` Jim Gifford
2006-05-22 17:21 ` Darren Salt
2006-06-12  0:13 ` juuso.alasuutari
2006-06-12  0:17 ` juuso.alasuutari
2006-06-12  7:18 ` Marco d'Itri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).