All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Gifford <maillist@jg555.com>
To: linux-hotplug@vger.kernel.org
Subject: CD Symlinks Solution Idea
Date: Sun, 14 May 2006 18:58:27 +0000	[thread overview]
Message-ID: <44677DD3.80801@jg555.com> (raw)

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

             reply	other threads:[~2006-05-14 18:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-14 18:58 Jim Gifford [this message]
2006-05-14 19:11 ` CD Symlinks Solution Idea 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44677DD3.80801@jg555.com \
    --to=maillist@jg555.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.