* udev and usb.agent
@ 2005-10-15 6:14 Greg Bell
2005-10-15 18:27 ` Kay Sievers
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Greg Bell @ 2005-10-15 6:14 UTC (permalink / raw)
To: linux-hotplug
Hi Developers,
On my FC4 system, hotplug calls /etc/hotplug/usb.agent (and therefore my
/etc/hotplug/usb/camera script). However, it doesn't run udev until
AFTER, so my /dev/sd?1 mapping to /dev/camera hasn't happened yet when my
camera script is running.
What am I doing wrong? Is there a way to get hotplug to call udev to do
the device mapping BEFORE usb.agent gets called?
Thanks,
~greg bell
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: udev and usb.agent
2005-10-15 6:14 udev and usb.agent Greg Bell
@ 2005-10-15 18:27 ` Kay Sievers
2005-10-15 23:33 ` Greg Bell
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Kay Sievers @ 2005-10-15 18:27 UTC (permalink / raw)
To: linux-hotplug
On Sat, Oct 15, 2005 at 04:14:29PM +1000, Greg Bell wrote:
>
> Hi Developers,
>
> On my FC4 system, hotplug calls /etc/hotplug/usb.agent (and therefore my
> /etc/hotplug/usb/camera script). However, it doesn't run udev until
> AFTER, so my /dev/sd?1 mapping to /dev/camera hasn't happened yet when my
> camera script is running.
>
> What am I doing wrong? Is there a way to get hotplug to call udev to do
> the device mapping BEFORE usb.agent gets called?
The "camera script" is probably triggered by the usb device event, not the
block device event. Use an explicit udev rule that matches the block device
and the usb properties of the camera. The old agent crap should no longer
be used.
Btw: HAL which should be running on your box is expected to manage that
in conjunction with your desktop session. Modern desktop setups don't
need to fiddle around with device id's and scripts to make your camera
just work.
Kay
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: udev and usb.agent
2005-10-15 6:14 udev and usb.agent Greg Bell
2005-10-15 18:27 ` Kay Sievers
@ 2005-10-15 23:33 ` Greg Bell
2005-10-16 11:57 ` Kay Sievers
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Greg Bell @ 2005-10-15 23:33 UTC (permalink / raw)
To: linux-hotplug
>> What am I doing wrong? Is there a way to get hotplug to call udev to do
>> the device mapping BEFORE usb.agent gets called?
>
> The "camera script" is probably triggered by the usb device event, not the
> block device event. Use an explicit udev rule that matches the block device
> and the usb properties of the camera.
But the udev, whether the rule is for USB or SCSI, is getting run after
the usb.agent stuff...
> The old agent crap should no longer
> be used.
But udev only does device creation, not scripts.
> Modern desktop setups don't
> need to fiddle around with device id's and scripts to make your camera
> just work.
Sure, they 'just work', but they don't do the fun stuff I'm hoping to
script up...
So, again, why does hotplug call udev *after* it calls usb.agent?
usb.agent can't do much since it doesn't have a nice static name for the
newly inserted usb device until after udev runs...
~gb
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: udev and usb.agent
2005-10-15 6:14 udev and usb.agent Greg Bell
2005-10-15 18:27 ` Kay Sievers
2005-10-15 23:33 ` Greg Bell
@ 2005-10-16 11:57 ` Kay Sievers
2005-10-17 0:42 ` Greg Bell
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Kay Sievers @ 2005-10-16 11:57 UTC (permalink / raw)
To: linux-hotplug
On Sun, Oct 16, 2005 at 09:33:39AM +1000, Greg Bell wrote:
> >>What am I doing wrong? Is there a way to get hotplug to call udev to do
> >>the device mapping BEFORE usb.agent gets called?
> >
> >The "camera script" is probably triggered by the usb device event, not the
> >block device event. Use an explicit udev rule that matches the block device
> >and the usb properties of the camera.
>
> But the udev, whether the rule is for USB or SCSI, is getting run after
> the usb.agent stuff...
Probably, but usb.agent has nothing to do with the block device event!
These are completely different events...
> >The old agent crap should no longer
> >be used.
>
> But udev only does device creation, not scripts.
Catch up! udev does _all_ hotplug today. Everything that runs on hotplug
events is managed by udev. You can plug into any stage of the event
processing with udev rules and run an unlimited number of scripts...
> >Modern desktop setups don't
> >need to fiddle around with device id's and scripts to make your camera
> >just work.
>
> Sure, they 'just work', but they don't do the fun stuff I'm hoping to
> script up...
>
> So, again, why does hotplug call udev *after* it calls usb.agent?
Again, udev calls _everything_, also the agent stuff. Use the right
event, and everything will work!
> usb.agent can't do much since it doesn't have a nice static name for the
> newly inserted usb device until after udev runs...
Matching on the right event will carry DEVNAME in the environment, which
is the name of the node.
Good luck,
Kay
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: udev and usb.agent
2005-10-15 6:14 udev and usb.agent Greg Bell
` (2 preceding siblings ...)
2005-10-16 11:57 ` Kay Sievers
@ 2005-10-17 0:42 ` Greg Bell
2005-10-17 1:44 ` Kay Sievers
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Greg Bell @ 2005-10-17 0:42 UTC (permalink / raw)
To: linux-hotplug
> Catch up! udev does _all_ hotplug today.
Oh, oops. OK I've done some more reading. However the FAQ at
http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ
...says/implies that udev is for creating the /dev nodes and not much else
because that's where devfs went wrong (trying to do too much). They even
refer the reader to HAL for the fancier more desktopy stuff.
I see the PROGRAM= feature, but it seems that's run before the dev node
gets created, and is intended for using a script to figure out what the
node should be named, rather than reacting after the node's been created.
Maybe I'm looking at a multiple line udev.rules entry. I'm used to the
main part of the event matching being a BUS= or KERNEL=.
My understanding of what goes on is:
1) device is plugged in
2) USB event occurs
3) udev or usb.agent inserts SCSI module (sr_mod)
4) SCSI event occurs
5) udev creates /dev/camera (my rule)
6) ??? reacts and runs script to automatically slurp pictures off, etc.
Its step 6 I'm having trouble with.
~gb
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: udev and usb.agent
2005-10-15 6:14 udev and usb.agent Greg Bell
` (3 preceding siblings ...)
2005-10-17 0:42 ` Greg Bell
@ 2005-10-17 1:44 ` Kay Sievers
2005-10-27 10:36 ` Olivier Blin
2005-10-28 1:09 ` Kay Sievers
6 siblings, 0 replies; 8+ messages in thread
From: Kay Sievers @ 2005-10-17 1:44 UTC (permalink / raw)
To: linux-hotplug
On Mon, Oct 17, 2005 at 10:42:20AM +1000, Greg Bell wrote:
>
> >Catch up! udev does _all_ hotplug today.
>
> Oh, oops. OK I've done some more reading. However the FAQ at
> http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ
>
> ...says/implies that udev is for creating the /dev nodes and not much else
> because that's where devfs went wrong (trying to do too much). They even
> refer the reader to HAL for the fancier more desktopy stuff.
>
> I see the PROGRAM= feature, but it seems that's run before the dev node
> gets created, and is intended for using a script to figure out what the
> node should be named, rather than reacting after the node's been created.
PROGRAM is for naming the node and therefore runs before the node is
created. RUN is for postprocessing.
> Maybe I'm looking at a multiple line udev.rules entry. I'm used to the
> main part of the event matching being a BUS= or KERNEL=.
>
> My understanding of what goes on is:
>
> 1) device is plugged in
> 2) USB event occurs
> 3) udev or usb.agent inserts SCSI module (sr_mod)
> 4) SCSI event occurs
> 5) udev creates /dev/camera (my rule)
> 6) ??? reacts and runs script to automatically slurp pictures off, etc.
>
> Its step 6 I'm having trouble with.
Yeah, 6 runs along with 3, that's your trouble. :)
2 and 4 are different events, 2 will have finished before 4 even starts.
What you are looking for is 7, the block device event, which creates the
node.
Kay
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: udev and usb.agent
2005-10-15 6:14 udev and usb.agent Greg Bell
` (4 preceding siblings ...)
2005-10-17 1:44 ` Kay Sievers
@ 2005-10-27 10:36 ` Olivier Blin
2005-10-28 1:09 ` Kay Sievers
6 siblings, 0 replies; 8+ messages in thread
From: Olivier Blin @ 2005-10-27 10:36 UTC (permalink / raw)
To: linux-hotplug
Greg Bell <gregbell@znet.com> writes:
>> Catch up! udev does _all_ hotplug today.
>
> Oh, oops. OK I've done some more reading. However the FAQ at
> http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ
>
> ...says/implies that udev is for creating the /dev nodes and not much else
> because that's where devfs went wrong (trying to do too much). They even
> refer the reader to HAL for the fancier more desktopy stuff.
Maybe the udev FAQ should be updated then.
It's quite confusing to read this:
"udev is for managing /dev, not loading kernel drivers."
--
Olivier Blin
Mandriva
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: udev and usb.agent
2005-10-15 6:14 udev and usb.agent Greg Bell
` (5 preceding siblings ...)
2005-10-27 10:36 ` Olivier Blin
@ 2005-10-28 1:09 ` Kay Sievers
6 siblings, 0 replies; 8+ messages in thread
From: Kay Sievers @ 2005-10-28 1:09 UTC (permalink / raw)
To: linux-hotplug
On Thu, Oct 27, 2005 at 12:36:27PM +0200, Olivier Blin wrote:
> Greg Bell <gregbell@znet.com> writes:
>
> >> Catch up! udev does _all_ hotplug today.
> >
> > Oh, oops. OK I've done some more reading. However the FAQ at
> > http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ
> >
> > ...says/implies that udev is for creating the /dev nodes and not much else
> > because that's where devfs went wrong (trying to do too much). They even
> > refer the reader to HAL for the fancier more desktopy stuff.
>
> Maybe the udev FAQ should be updated then.
> It's quite confusing to read this:
> "udev is for managing /dev, not loading kernel drivers."
Done.
Thanks,
Kay
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
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
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-10-28 1:09 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-15 6:14 udev and usb.agent Greg Bell
2005-10-15 18:27 ` Kay Sievers
2005-10-15 23:33 ` Greg Bell
2005-10-16 11:57 ` Kay Sievers
2005-10-17 0:42 ` Greg Bell
2005-10-17 1:44 ` Kay Sievers
2005-10-27 10:36 ` Olivier Blin
2005-10-28 1:09 ` Kay Sievers
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).