* Re: Make an un-device?
2010-03-24 16:43 Make an un-device? Tom Horsley
@ 2010-03-24 17:07 ` David Zeuthen
2010-03-24 17:16 ` Kay Sievers
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: David Zeuthen @ 2010-03-24 17:07 UTC (permalink / raw)
To: linux-hotplug
On Wed, 2010-03-24 at 12:43 -0400, Tom Horsley wrote:
> Usually people want to know how to make udev recognize
> devices. I have a device that is recognized just fine, but
> I'd really like to declare it an un-device. I don't
> want any /dev/ files created for it, I don't want the
> driver loaded unless something else needs it. I want
> it to disappear from creation completely.
>
> Can custom udev rules do this?
Not specifically - ignore_device used to do something like this but we
removed that directive from udev... and even if we still had the
ignore_device directive, suppressing events at the udev level is wrong..
and that's why we removed ignore_device.
> Specifically, the device is the incredibly annoying fake CD
> drive that appears along side my usb hard disk
> when I plug it in.
One way to make such annoying drives disappear in GNOME and some other
desktop environments is to set the UDISKS_PRESENTATION_HIDE (or if you
are on an older distro than F13 vintage, it's called
DKD_PRESENTATION_HIDE) udev property like e.g. this
http://cgit.freedesktop.org/udisks/tree/data/80-udisks.rules#n188
Another way to solve this is adding an entry to something like one of
the unusual_* files under drivers/usb/storage in the kernel... but that
includes recompiling the kernel.
HTH,
David
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Make an un-device?
2010-03-24 16:43 Make an un-device? Tom Horsley
2010-03-24 17:07 ` David Zeuthen
@ 2010-03-24 17:16 ` Kay Sievers
2010-03-24 17:23 ` Tom Horsley
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Kay Sievers @ 2010-03-24 17:16 UTC (permalink / raw)
To: linux-hotplug
On Wed, Mar 24, 2010 at 17:43, Tom Horsley <horsley1953@gmail.com> wrote:
> Usually people want to know how to make udev recognize
> devices. I have a device that is recognized just fine, but
> I'd really like to declare it an un-device. I don't
> want any /dev/ files created for it, I don't want the
> driver loaded unless something else needs it. I want
> it to disappear from creation completely.
>
> Can custom udev rules do this?
>
> Specifically, the device is the incredibly annoying fake CD
> drive that appears along side my usb hard disk
> when I plug it in.
Udev can't really do anything here.
In many cases there are tools available from the disk vendor to
disable the fake cd drive.
Kay
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Make an un-device?
2010-03-24 16:43 Make an un-device? Tom Horsley
2010-03-24 17:07 ` David Zeuthen
2010-03-24 17:16 ` Kay Sievers
@ 2010-03-24 17:23 ` Tom Horsley
2010-03-24 17:52 ` Paul Fox
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Tom Horsley @ 2010-03-24 17:23 UTC (permalink / raw)
To: linux-hotplug
On Wed, 24 Mar 2010 13:07:52 -0400
David Zeuthen wrote:
> One way to make such annoying drives disappear in GNOME and some other
> desktop environments is to set the UDISKS_PRESENTATION_HIDE (or if you
> are on an older distro than F13 vintage, it's called
> DKD_PRESENTATION_HIDE) udev property like e.g. this
Yea, I found that, but it has already changed three times now
(first you used hal, then you used DKD, now you use UDISK).
I figured a lower level eradication might stick through
more changes :-).
Having some user configurable way to utterly hide devices
does seem useful. I recall having a "helpful" operating
system "upgrade" all the partitions on a disk once, thus
rendering it utterly useless in the multi-boot environment
that could boot older kernels.
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Make an un-device?
2010-03-24 16:43 Make an un-device? Tom Horsley
` (2 preceding siblings ...)
2010-03-24 17:23 ` Tom Horsley
@ 2010-03-24 17:52 ` Paul Fox
2010-03-24 22:08 ` David Zeuthen
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Paul Fox @ 2010-03-24 17:52 UTC (permalink / raw)
To: linux-hotplug
tom wrote:
> On Wed, 24 Mar 2010 13:07:52 -0400
> David Zeuthen wrote:
>
> > One way to make such annoying drives disappear in GNOME and some other
> > desktop environments is to set the UDISKS_PRESENTATION_HIDE (or if you
> > are on an older distro than F13 vintage, it's called
> > DKD_PRESENTATION_HIDE) udev property like e.g. this
>
> Yea, I found that, but it has already changed three times now
> (first you used hal, then you used DKD, now you use UDISK).
> I figured a lower level eradication might stick through
> more changes :-).
in addition, the wouldn't the solution then apply to "all" desktops,
instead of "GNOME and some other" desktops?
given how often this comes up, i think it would be very useful
for there to be a page fully describing the reasons that the udev
project thinks the feature is a bad idea. when i asked in
november for the reasons behind not being able to hide devices, i
got somewhat vague reasons. (and i'm clearly still not
convinced. :-) simply stating "suppressing events at the udev
level is wrong" isn't terribly compelling.
paul
>
> Having some user configurable way to utterly hide devices
> does seem useful. I recall having a "helpful" operating
> system "upgrade" all the partitions on a disk once, thus
> rendering it utterly useless in the multi-boot environment
> that could boot older kernels.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
=---------------------
paul fox, pgf@laptop.org
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Make an un-device?
2010-03-24 16:43 Make an un-device? Tom Horsley
` (3 preceding siblings ...)
2010-03-24 17:52 ` Paul Fox
@ 2010-03-24 22:08 ` David Zeuthen
2010-03-25 13:48 ` Dan Nicholson
2010-03-25 15:03 ` Kay Sievers
6 siblings, 0 replies; 8+ messages in thread
From: David Zeuthen @ 2010-03-24 22:08 UTC (permalink / raw)
To: linux-hotplug
On Wed, 2010-03-24 at 13:52 -0400, Paul Fox wrote:
> given how often this comes up, i think it would be very useful
> for there to be a page fully describing the reasons that the udev
> project thinks the feature is a bad idea. when i asked in
> november for the reasons behind not being able to hide devices, i
> got somewhat vague reasons. (and i'm clearly still not
> convinced. :-) simply stating "suppressing events at the udev
> level is wrong" isn't terribly compelling.
I'm sorry that you don't find this compelling but it came directly from
both myself and the udev maintainer (Kay Sievers) - you are free to
check the archives for better explanations. Or if you examine, in
detail, how uevents and libudev work, you will eventually understand why
ignore_device was a terrible idea to begin with [1].
> in addition, the wouldn't the solution then apply to "all" desktops,
> instead of "GNOME and some other" desktops?
FYI, the desktops that are covered by e.g. UDISKS_PRESENTATION_HIDE
includes desktops for which the following statements are true
- they are using GVolumeMonitor to draw icons
- they are shipping gvfs with the udisks (or DeviceKit-disks) volume
monitor backend
which includes GNOME and, I think, XFCE, on most modern distros.
IMNSHO, it is rather naive to demand that "all" desktops need to
implement some feature (such as configuring what drives to ignore). It's
not like desktops share a lot of code or specs.
Good luck,
David
[1] : Hint: ignore_device only suppressed invocation of rules - the
uevent was still emitted and the device would still be part of any
enumeration either via libudev or sysfs.
<ramble>
What most people don't understand is that udev is just one tiny piece in
the *middle* of the stack... a stack where elements in the stack are
free to bypass layers - e.g. it is perfectly fine for a desktop app to
look in sysfs, thereby bypassing, say, udev and udisks.
So even if we still had ignore_device and things on top (like udisks ->
gvfs -> nautilus) actually respected it, it wouldn't work for the app
looking directly in sysfs (or /proc/scsi/scsi or whatever).
</ramble>.
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Make an un-device?
2010-03-24 16:43 Make an un-device? Tom Horsley
` (4 preceding siblings ...)
2010-03-24 22:08 ` David Zeuthen
@ 2010-03-25 13:48 ` Dan Nicholson
2010-03-25 15:03 ` Kay Sievers
6 siblings, 0 replies; 8+ messages in thread
From: Dan Nicholson @ 2010-03-25 13:48 UTC (permalink / raw)
To: linux-hotplug
On Wed, Mar 24, 2010 at 3:08 PM, David Zeuthen <david@fubar.dk> wrote:
>
> IMNSHO, it is rather naive to demand that "all" desktops need to
> implement some feature (such as configuring what drives to ignore). It's
> not like desktops share a lot of code or specs.
I think that's why he was suggesting that this be handled at the udev
level so that it _applied_ to all desktops.
--
Dan
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Make an un-device?
2010-03-24 16:43 Make an un-device? Tom Horsley
` (5 preceding siblings ...)
2010-03-25 13:48 ` Dan Nicholson
@ 2010-03-25 15:03 ` Kay Sievers
6 siblings, 0 replies; 8+ messages in thread
From: Kay Sievers @ 2010-03-25 15:03 UTC (permalink / raw)
To: linux-hotplug
On Wed, Mar 24, 2010 at 23:08, David Zeuthen <david@fubar.dk> wrote:
> On Wed, 2010-03-24 at 13:52 -0400, Paul Fox wrote:
>> given how often this comes up, i think it would be very useful
>> for there to be a page fully describing the reasons that the udev
>> project thinks the feature is a bad idea. when i asked in
>> november for the reasons behind not being able to hide devices, i
>> got somewhat vague reasons. (and i'm clearly still not
>> convinced. :-) simply stating "suppressing events at the udev
>> level is wrong" isn't terribly compelling.
>
> I'm sorry that you don't find this compelling but it came directly from
> both myself and the udev maintainer (Kay Sievers) - you are free to
> check the archives for better explanations. Or if you examine, in
> detail, how uevents and libudev work, you will eventually understand why
> ignore_device was a terrible idea to begin with [1].
Right, there is nothing we could "ignore" properly that way. "Hiding"
devices should probably be done by just unbinding the driver.
Kay
^ permalink raw reply [flat|nested] 8+ messages in thread