linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udevadm monitor and atapi dvdrw
@ 2012-11-21 15:55 Franco Martelli
  2012-11-22 19:08 ` Kay Sievers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Franco Martelli @ 2012-11-21 15:55 UTC (permalink / raw)
  To: linux-hotplug

Hi everybody,

I'm using Debian Sqeeze 6.0, kernel 2.6.32, udev version 164.
With kernel provided from debian my dvdrw is under scsi subsystem and 
udevadm monitor recognize optical disk change with a lot of info output 
suitable to write rules.
I've recompilated the kernel and things has changed, now my dvdrw is 
under ide/atapi subsystem and the device name is hdc now.
I'd like to write a rule that remove udf and crc_itu_t modules as soon 
as optical disk is left off from dvdrw drive. Example:

SUBSYSTEM="block", KERNEL="hdc", ACTION="change", RUN+="/sbin/rmmod 
udf crc_itu_t"

I look at http://reactivated.net/writing_udev_rules.html but doesn't 
help for ide devices ACTION="change".
Could anybody help me to write such a rule?

bye,

-- 
                                         Franco Martelli.


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

* Re: udevadm monitor and atapi dvdrw
  2012-11-21 15:55 udevadm monitor and atapi dvdrw Franco Martelli
@ 2012-11-22 19:08 ` Kay Sievers
  2012-11-24 16:09 ` Franco Martelli
  2012-11-25 15:44 ` Franco Martelli
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2012-11-22 19:08 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Nov 21, 2012 at 4:55 PM, Franco Martelli <martellif67@gmail.com> wrote:
> Hi everybody,
>
> I'm using Debian Sqeeze 6.0, kernel 2.6.32, udev version 164.
> With kernel provided from debian my dvdrw is under scsi subsystem and
> udevadm monitor recognize optical disk change with a lot of info output
> suitable to write rules.
> I've recompilated the kernel and things has changed, now my dvdrw is under
> ide/atapi subsystem and the device name is hdc now.
> I'd like to write a rule that remove udf and crc_itu_t modules as soon as
> optical disk is left off from dvdrw drive. Example:
>
> SUBSYSTEM="block", KERNEL="hdc", ACTION="change", RUN+="/sbin/rmmod udf
> crc_itu_t"
>
> I look at http://reactivated.net/writing_udev_rules.html but doesn't help
> for ide devices ACTION="change".
> Could anybody help me to write such a rule?

Modern userspace and kernel facilities like media change polling do
not support all the old and deprecated IDE drivers. The IDE drivers
are just not capable to do what you are looking for. Udev does not
support IDE drivers at all, only libata.

You might just want to disable the IDE drivers in the kernel config
and use the libata ones. Ideally the kernel would just delete the IDE
stuff.

Kay

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

* Re: udevadm monitor and atapi dvdrw
  2012-11-21 15:55 udevadm monitor and atapi dvdrw Franco Martelli
  2012-11-22 19:08 ` Kay Sievers
@ 2012-11-24 16:09 ` Franco Martelli
  2012-11-25 15:44 ` Franco Martelli
  2 siblings, 0 replies; 4+ messages in thread
From: Franco Martelli @ 2012-11-24 16:09 UTC (permalink / raw)
  To: linux-hotplug

Il 22/11/2012 20:08, Kay Sievers ha scritto:
> On Wed, Nov 21, 2012 at 4:55 PM, Franco Martelli <martellif67@gmail.com> wrote:
>> Hi everybody,
>>
>> I'm using Debian Sqeeze 6.0, kernel 2.6.32, udev version 164.
>> With kernel provided from debian my dvdrw is under scsi subsystem and
>> udevadm monitor recognize optical disk change with a lot of info output
>> suitable to write rules.
>> I've recompilated the kernel and things has changed, now my dvdrw is under
>> ide/atapi subsystem and the device name is hdc now.
>> I'd like to write a rule that remove udf and crc_itu_t modules as soon as
>> optical disk is left off from dvdrw drive. Example:
>>
>> SUBSYSTEM="block", KERNEL="hdc", ACTION="change", RUN+="/sbin/rmmod udf
>> crc_itu_t"
>>
>> I look at http://reactivated.net/writing_udev_rules.html but doesn't help
>> for ide devices ACTION="change".
>> Could anybody help me to write such a rule?
> Modern userspace and kernel facilities like media change polling do
> not support all the old and deprecated IDE drivers. The IDE drivers
> are just not capable to do what you are looking for. Udev does not
> support IDE drivers at all, only libata.
>
> You might just want to disable the IDE drivers in the kernel config
> and use the libata ones. Ideally the kernel would just delete the IDE
> stuff.
>
> Kay
>
Thank you very much Kay,
does libata work as a kernel module only or can be statically included 
into the kernel? My lsmod output is:

# lsmod
Module                  Size  Used by
vboxpci                11426  0
vboxnetadp             17099  0
vboxnetflt             13500  0
vboxdrv              1754521  3 vboxpci,vboxnetadp,vboxnetflt

that are Virtual Box modules. I've included into the kernel usb, sound, 
network, sata, ide, and other devices support. Modules are ppp, usb 
specific drivers, lp ... and others but not libata. Maybe should I 
looking for a more recent, backported to sqeeze linux kernel?

bye,

-- 
                                         Franco Martelli.


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

* Re: udevadm monitor and atapi dvdrw
  2012-11-21 15:55 udevadm monitor and atapi dvdrw Franco Martelli
  2012-11-22 19:08 ` Kay Sievers
  2012-11-24 16:09 ` Franco Martelli
@ 2012-11-25 15:44 ` Franco Martelli
  2 siblings, 0 replies; 4+ messages in thread
From: Franco Martelli @ 2012-11-25 15:44 UTC (permalink / raw)
  To: linux-hotplug

Il 22/11/2012 20:08, Kay Sievers ha scritto:
> On Wed, Nov 21, 2012 at 4:55 PM, Franco Martelli<martellif67@gmail.com>  wrote:
>> Hi everybody,
>>
>> I'm using Debian Sqeeze 6.0, kernel 2.6.32, udev version 164.
>> With kernel provided from debian my dvdrw is under scsi subsystem and
>> udevadm monitor recognize optical disk change with a lot of info output
>> suitable to write rules.
>> I've recompilated the kernel and things has changed, now my dvdrw is under
>> ide/atapi subsystem and the device name is hdc now.
>> I'd like to write a rule that remove udf and crc_itu_t modules as soon as
>> optical disk is left off from dvdrw drive. Example:
>>
>> SUBSYSTEM="block", KERNEL="hdc", ACTION="change", RUN+="/sbin/rmmod udf
>> crc_itu_t"
>>
>> I look athttp://reactivated.net/writing_udev_rules.html  but doesn't help
>> for ide devices ACTION="change".
>> Could anybody help me to write such a rule?
> Modern userspace and kernel facilities like media change polling do
> not support all the old and deprecated IDE drivers. The IDE drivers
> are just not capable to do what you are looking for. Udev does not
> support IDE drivers at all, only libata.
>
> You might just want to disable the IDE drivers in the kernel config
> and use the libata ones. Ideally the kernel would just delete the IDE
> stuff.
>
> Kay
>
solved. :-)
I've build the kernel using /boot/config-2.6.32-5-amd64 as reference, 
that is the .config of the kernel provided from Debian. I checked line 
by line libata and scsi targets and with make menuconfig I excluded "< > 
ATA/ATAPI/MFM/RLL support  --->" and I apply new configuration as you 
suggest.
So the rule that do the work is:

SUBSYSTEM="scsi", ENV{SDEV_MEDIA_CHANGE}="1", ACTION="change", 
RUN+="/sbin/rmmod udf crc_itu_t"

I don't know if it's the right way to unload modules no more needed but 
it works.

bye,

-- 
                                         Franco Martelli.


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

end of thread, other threads:[~2012-11-25 15:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-21 15:55 udevadm monitor and atapi dvdrw Franco Martelli
2012-11-22 19:08 ` Kay Sievers
2012-11-24 16:09 ` Franco Martelli
2012-11-25 15:44 ` Franco Martelli

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).