From: Jim Gifford <maillist@jg555.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: CD Symlinks Solution Idea
Date: Mon, 15 May 2006 00:52:14 +0000 [thread overview]
Message-ID: <4467D0BE.1080407@jg555.com> (raw)
In-Reply-To: <44677DD3.80801@jg555.com>
After some feedback received from this list and my peers, a small issue
now has been fixed. Thank you all for your ideas.
The solution will be persistent on the IDE side, but not sure on the
SCSI side of the house.
Here is the complete solution.
Udev Rules
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
ide", SYMLINK+="cdrom%c"
BUS="ide", ENV{ID_CDROM_CD_R}="?*", PROGRAM="cdsymlink_helper.sh %k
ide", SYMLINK+="cdr%c"
BUS="ide", ENV{ID_CDROM_CD_RW}="?*", PROGRAM="cdsymlink_helper.sh %k
ide", SYMLINK+="cdrw%c"
BUS="ide", ENV{ID_CDROM_DVD}="?*", PROGRAM="cdsymlink_helper.sh %k
ide", SYMLINK+="dvd%c"
BUS="ide", ENV{ID_CDROM_DVD_R}="?*", PROGRAM="cdsymlink_helper.sh %k
ide", SYMLINK+="dvdrw%c"
BUS="scsi", ENV{ID_CDROM}="?*", PROGRAM="cdsymlink_helper.sh %n
scsi", SYMLINK+="cdrom%c"
BUS="scsi", ENV{ID_CDROM_CD_R}="?*", PROGRAM="cdsymlink_helper.sh %n
scsi", SYMLINK+="cdr%c"
BUS="scsi", ENV{ID_CDROM_CD_RW}="?*", PROGRAM="cdsymlink_helper.sh %n
scsi", SYMLINK+="cdrw%c"
BUS="scsi", ENV{ID_CDROM_DVD}="?*", PROGRAM="cdsymlink_helper.sh %n
scsi", SYMLINK+="dvd%c"
BUS="scsi", ENV{ID_CDROM_DVD_R}="?*", PROGRAM="cdsymlink_helper.sh %n
scsi", SYMLINK+="dvdrw%c"
cdsymlink_helper.sh
#!/bin/sh
KERN_NAME="$1"
BUS="$2"
test=0
if [ "$KERN_NAME" = "" ]; then
mesg Bad invocation: \$1 is not set
exit 1
fi
if [ "$BUS" = "ide" ]; then
FILES="`ls /sys/bus/ide/drivers/ide-cdrom | grep '\.' `"
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.`"
while [ $test -lt 1 ] ; do
if [ -e /dev/cdrom$link ]; then
link=$[$link+1]
else
test=1
echo $link
fi
done
fi
done
fi
if [ "$BUS" = "SCSI" ]; then
link=$KERN_NAME
while [ $test -lt 1 ] ; do
if [ -e /dev/cdrom$link ]; then
link=$[$link+1]
else
test=1
echo $link
fi
done
fi
-------------------------------------------------------
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
next prev parent reply other threads:[~2006-05-15 0:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=4467D0BE.1080407@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 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).