Skip to contentSkip to conversation

ide-devfs.sh and Gentoo [u]

PATCH Martin Schlemmer [c] 2 participants 4 messages Dec 13, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

We have a problem in Gentoo that we use the group 'cdrw' for burners, but ide-devfs.sh assigns 'cdrom' to them. Below patch is for comments .. it uses cdsymlinks.sh to try and figure out if we have a burner or not ....

-----

udev-048/extras/ide-devfs.sh 2004-12-13 22:29:06.000000000 +0200 renamed from udev-048/extras/ide-devfs.sh 2004-12-13 22:27:17.000000000 +0200 +4 -0
@@ -36,6 +36,10 @@
 if [ -z "$3" ] && [ -f /proc/ide/${1}/media ]; then
        MEDIA=`cat /proc/ide/${1}/media`
        if [ "${MEDIA}" = "cdrom" ]; then
+               if [ -n "`grep '^cdrw:' /etc/group`" ] && \
+                  [ -n "`"${0%/*}/cdsymlinks.sh" "$1" | grep 'rw' 2>/dev/null`" ]; then
+                       MEDIA="cdrw"
+               fi
                echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`get_dev_number $1 cdrom` ${MEDIA}
        elif [ "${MEDIA}" = "floppy" ]; then
                echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/disc floppies/floppy`get_dev_number $1 floppy`/disc ${MEDIA}

-----

More info might be gotten from here:

http://bugs.gentoo.org/show_bug.cgi?id=73660

Thanks,

Signature · 1 line
Martin Schlemmer
#1 lore raw
Quoted 6 lines · Martin Schlemmer [c]

Hi,

We have a problem in Gentoo that we use the group 'cdrw' for burners, but ide-devfs.sh assigns 'cdrom' to them. Below patch is for comments .. it uses cdsymlinks.sh to try and figure out if we have a burner or not ....

I dont think this is a good fix to this. The real right fix might be:

http://bugs.gentoo.org/show_bug.cgi?ids064

I think we should rules.d make match symlinks, what do you think? We should then remove the GROUP= fix from the ide-devfs.sh rule.

I think your patch is not a proper solution because it calls cdsymlinks.sh a second time and has 2 greps in it, will that not make udev slow?

Stefan

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Martin Schlemmer [c]
Quoted 8 lines · Stefan Schweizer
Quoted 6 lines · Martin Schlemmer [c]

Hi,

We have a problem in Gentoo that we use the group 'cdrw' for burners, but ide-devfs.sh assigns 'cdrom' to them. Below patch is for comments .. it uses cdsymlinks.sh to try and figure out if we have a burner or not ....

Quoted 7 lines

I dont think this is a good fix to this. The real right fix might be:

http://bugs.gentoo.org/show_bug.cgi?id=73064

I think we should rules.d make match symlinks, what do you think? We should then remove the GROUP= fix from the ide-devfs.sh rule.

That gives the same as the GROUP= currently does (which in my mind sorda give that that bug is already fixed ....)
We (gentoo) wants GROUP=cdrw, which means that either:
1) Call cdsymlinks.sh in a rule like mentioned bug
2) write a different script to return cdrw if it is a cdrw/dvdrw/whatever. I did not however want to do this, as it would mean maintaining the same code in two places.

Quoted 4 lines

I think your patch is not a proper solution because it calls cdsymlinks.sh a second time and has 2 greps in it, will that not make udev slow?

It only does that if its a cdrom, and you usually do not have that many cdroms, do you ?

Signature · 1 line
Martin Schlemmer
#3 lore raw
In reply to Martin Schlemmer [c]
Quoted 7 lines · Martin Schlemmer [c]

That gives the same as the GROUP= currently does (which in my mind sorda give that that bug is already fixed ....)
We (gentoo) wants GROUPÍrw, which means that either:
1) Call cdsymlinks.sh in a rule like mentioned bug
2) write a different script to return cdrw if it is a cdrw/dvdrw/whatever. I did not however want to do this, as it would mean maintaining the same code in two places.

or if that bug would be solved in the proper way we could add a proper rule like:
cdrw:root:cdrw:0660

That would effectively avoid calling cdsymlinks.sh twice and maybe there is not only this cdrw issue, but also others, then with the symlink-following-patch we could also easier change their permissions without the need for userspace helpers or extra rules.

Stefan

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel