* Re: [Thinstation-developer] Re: udev PROGRAM action
@ 2005-08-24 9:23 Miles Roper
2005-08-24 10:11 ` Kay Sievers
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: Miles Roper @ 2005-08-24 9:23 UTC (permalink / raw)
To: linux-hotplug
Hi Kay,
thanks for replying so quick.
Ok that makes sense. what i've been playing with recently is...
KERNEL="sd*", ACTION="add", NAME="%k", RUN=+"/etc/udev/scripts/usb.sh %k"
KERNEL="sd*", ACTION="remove", NAME="%k", RUN=+"/etc/udev/scripts/usb.sh %k"
what i'm trying to achieve is hotpluging my usbkey. removing the NAME key above still doesn't seem
to work, infact it stops it from even calling the script. the line now is
KERNEL="sd*", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh %k"
if I remove the NAME key, how can I specify the device name I want in /dev? Can I use the %k in
above, as I need to pass this to the script so I know which device to mount/umount?
thanks
Miles
Kay Sievers wrote:
> On Wed, Aug 24, 2005 at 07:47:54PM +1200, Miles Roper wrote:
>
>>Hi,
>>
>>I've been trolling around the net trying to find an answer to why I can't
>>get udev to correctly run a remove event in a script.
>>
>>here is my udev line
>>
>>BUS="usb", KERNEL="sd*", NAME="%k", PROGRAM="/etc/udev/scripts/usb.sh %k"
>>
>>this works fine. it calls the script below...
>
>
> ...
>
>
>>the add event works great. however, the remove event never gets actioned.
>>In fact the script never gets run when the device is removed. any ideas
>>why?
>
>
> PROGRAM is for evaluation of the device name. It is called before the
> device node is created. If you have NAME in a rule, the rule will never
> be called for any ather action than "add". Just remove "NAME="%k".
>
> And better use RUN, it is called after device node handling.
>
> Kay
>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Thinstation-developer mailing list
> Thinstation-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/thinstation-developer
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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] 13+ messages in thread
* Re: [Thinstation-developer] Re: udev PROGRAM action
2005-08-24 9:23 [Thinstation-developer] Re: udev PROGRAM action Miles Roper
@ 2005-08-24 10:11 ` Kay Sievers
2005-08-24 10:17 ` Miles Roper
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Kay Sievers @ 2005-08-24 10:11 UTC (permalink / raw)
To: linux-hotplug
On Wed, Aug 24, 2005 at 09:23:19PM +1200, Miles Roper wrote:
> KERNEL="sd*", ACTION="add", NAME="%k", RUN=+"/etc/udev/scripts/usb.sh %k"
> KERNEL="sd*", ACTION="remove", NAME="%k", RUN=+"/etc/udev/scripts/usb.sh
> %k"
>
> what i'm trying to achieve is hotpluging my usbkey. removing the NAME key
> above still doesn't seem to work, infact it stops it from even calling the
> script. the line now is
>
> KERNEL="sd*", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh %k"
>
> if I remove the NAME key, how can I specify the device name I want in /dev?
It will just get the default name.
> Can I use the %k in above, as I need to pass this to the script so I know
> which device to mount/umount?
Yes, also the environment contains DEVNAME.
Kay
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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] 13+ messages in thread
* Re: [Thinstation-developer] Re: udev PROGRAM action
2005-08-24 9:23 [Thinstation-developer] Re: udev PROGRAM action Miles Roper
2005-08-24 10:11 ` Kay Sievers
@ 2005-08-24 10:17 ` Miles Roper
2005-08-24 10:39 ` Kay Sievers
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Miles Roper @ 2005-08-24 10:17 UTC (permalink / raw)
To: linux-hotplug
this still doesn't work.
is this the way I should be hotplugging? I've spent hours looking on the net and hotplug.d seems
depreciated with udev0.68. From what I see of udev it seems to do everything I need. Not being
able to specify the name when using RUN by design, or will that get added later?
Thanks
Miles
Kay Sievers wrote:
> On Wed, Aug 24, 2005 at 09:23:19PM +1200, Miles Roper wrote:
>
>>KERNEL="sd*", ACTION="add", NAME="%k", RUN=+"/etc/udev/scripts/usb.sh %k"
>>KERNEL="sd*", ACTION="remove", NAME="%k", RUN=+"/etc/udev/scripts/usb.sh
>>%k"
>>
>>what i'm trying to achieve is hotpluging my usbkey. removing the NAME key
>>above still doesn't seem to work, infact it stops it from even calling the
>>script. the line now is
>>
>>KERNEL="sd*", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh %k"
>>
>>if I remove the NAME key, how can I specify the device name I want in /dev?
>
>
> It will just get the default name.
>
>
>>Can I use the %k in above, as I need to pass this to the script so I know
>>which device to mount/umount?
>
>
> Yes, also the environment contains DEVNAME.
>
> Kay
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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] 13+ messages in thread
* Re: [Thinstation-developer] Re: udev PROGRAM action
2005-08-24 9:23 [Thinstation-developer] Re: udev PROGRAM action Miles Roper
2005-08-24 10:11 ` Kay Sievers
2005-08-24 10:17 ` Miles Roper
@ 2005-08-24 10:39 ` Kay Sievers
2005-08-24 11:05 ` Miles Roper
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Kay Sievers @ 2005-08-24 10:39 UTC (permalink / raw)
To: linux-hotplug
On Wed, Aug 24, 2005 at 10:17:57PM +1200, Miles Roper wrote:
> this still doesn't work.
>
> is this the way I should be hotplugging? I've spent hours looking on the
> net and hotplug.d seems depreciated with udev0.68.
A while ago we moved hotplug.d/ handling into udev to be able to plug
HAL into the hotplug process and get rid of the hotplug/sysfs races.
Now we removed that from udev itself again, cause with udev-rules you
can do the same as hotplug.d/ did without all the problems of matching
only on the subsystem.
You can still use the old hotplug multiplexer or put a small helper
from the extras/run_directory/ into a udev rule that runs the hotplug.d/
programs.
> From what I see of udev
> it seems to do everything I need. Not being able to specify the name when
> using RUN by design, or will that get added later?
I'm not sure what you mean. If you specify a NAME rule, RUN will also
be called, but if you use NAME, no other action than "add" can ever
trigger that rule. So if you want to call a script for a specific device
for _all_ actions and rename the device at the same time, just use two rules,
one for the name and one for the "generic" RUN.
I think the best way to do this is to add two rules, one for "add" and
one for "remove".
Kay
> Kay Sievers wrote:
> >On Wed, Aug 24, 2005 at 09:23:19PM +1200, Miles Roper wrote:
> >
> >>KERNEL="sd*", ACTION="add", NAME="%k", RUN=+"/etc/udev/scripts/usb.sh
> >>%k"
> >>KERNEL="sd*", ACTION="remove", NAME="%k",
> >>RUN=+"/etc/udev/scripts/usb.sh %k"
> >>
> >>what i'm trying to achieve is hotpluging my usbkey. removing the NAME
> >>key above still doesn't seem to work, infact it stops it from even
> >>calling the script. the line now is
> >>
> >>KERNEL="sd*", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh %k"
> >>
> >>if I remove the NAME key, how can I specify the device name I want in
> >>/dev?
> >
> >
> >It will just get the default name.
> >
> >
> >>Can I use the %k in above, as I need to pass this to the script so I know
> >>which device to mount/umount?
> >
> >
> >Yes, also the environment contains DEVNAME.
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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] 13+ messages in thread
* Re: [Thinstation-developer] Re: udev PROGRAM action
2005-08-24 9:23 [Thinstation-developer] Re: udev PROGRAM action Miles Roper
` (2 preceding siblings ...)
2005-08-24 10:39 ` Kay Sievers
@ 2005-08-24 11:05 ` Miles Roper
2005-08-24 13:47 ` Bill Nottingham
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Miles Roper @ 2005-08-24 11:05 UTC (permalink / raw)
To: linux-hotplug
Hi Kay,
Thanks very much for your help so far. Its starting to make sense :o)
I still can't get the below rule to work :o(
KERNEL="sd*", ACTION="add", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh"
KERNEL="sd*", ACTION="remove", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh"
neither script gets run (as they create a test file in /tmp if they run)
I can post info from syslog when the device is added if you want?
Thanks
Miles
Kay Sievers wrote:
> On Wed, Aug 24, 2005 at 10:17:57PM +1200, Miles Roper wrote:
>
>>this still doesn't work.
>>
>>is this the way I should be hotplugging? I've spent hours looking on the
>>net and hotplug.d seems depreciated with udev0.68.
>
>
> A while ago we moved hotplug.d/ handling into udev to be able to plug
> HAL into the hotplug process and get rid of the hotplug/sysfs races.
> Now we removed that from udev itself again, cause with udev-rules you
> can do the same as hotplug.d/ did without all the problems of matching
> only on the subsystem.
> You can still use the old hotplug multiplexer or put a small helper
> from the extras/run_directory/ into a udev rule that runs the hotplug.d/
> programs.
>
>
>>From what I see of udev
>>it seems to do everything I need. Not being able to specify the name when
>>using RUN by design, or will that get added later?
>
>
> I'm not sure what you mean. If you specify a NAME rule, RUN will also
> be called, but if you use NAME, no other action than "add" can ever
> trigger that rule. So if you want to call a script for a specific device
> for _all_ actions and rename the device at the same time, just use two rules,
> one for the name and one for the "generic" RUN.
> I think the best way to do this is to add two rules, one for "add" and
> one for "remove".
>
> Kay
>
>
>>Kay Sievers wrote:
>>
>>>On Wed, Aug 24, 2005 at 09:23:19PM +1200, Miles Roper wrote:
>>>
>>>
>>>>KERNEL="sd*", ACTION="add", NAME="%k", RUN=+"/etc/udev/scripts/usb.sh
>>>>%k"
>>>>KERNEL="sd*", ACTION="remove", NAME="%k",
>>>>RUN=+"/etc/udev/scripts/usb.sh %k"
>>>>
>>>>what i'm trying to achieve is hotpluging my usbkey. removing the NAME
>>>>key above still doesn't seem to work, infact it stops it from even
>>>>calling the script. the line now is
>>>>
>>>>KERNEL="sd*", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh %k"
>>>>
>>>>if I remove the NAME key, how can I specify the device name I want in
>>>>/dev?
>>>
>>>
>>>It will just get the default name.
>>>
>>>
>>>
>>>>Can I use the %k in above, as I need to pass this to the script so I know
>>>>which device to mount/umount?
>>>
>>>
>>>Yes, also the environment contains DEVNAME.
>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Thinstation-developer mailing list
> Thinstation-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/thinstation-developer
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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] 13+ messages in thread
* Re: [Thinstation-developer] Re: udev PROGRAM action
2005-08-24 9:23 [Thinstation-developer] Re: udev PROGRAM action Miles Roper
` (3 preceding siblings ...)
2005-08-24 11:05 ` Miles Roper
@ 2005-08-24 13:47 ` Bill Nottingham
2005-08-24 15:30 ` Christian Zoz
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Bill Nottingham @ 2005-08-24 13:47 UTC (permalink / raw)
To: linux-hotplug
Miles Roper (mroper@xtra.co.nz) said:
> Thanks very much for your help so far. Its starting to make sense :o)
>
> I still can't get the below rule to work :o(
>
> KERNEL="sd*", ACTION="add", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh"
> KERNEL="sd*", ACTION="remove", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh"
>
> neither script gets run (as they create a test file in /tmp if they run)
>
> I can post info from syslog when the device is added if you want?
sd* device names are on the SCSI bus, not the USB bus.
Bill
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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] 13+ messages in thread
* Re: [Thinstation-developer] Re: udev PROGRAM action
2005-08-24 9:23 [Thinstation-developer] Re: udev PROGRAM action Miles Roper
` (4 preceding siblings ...)
2005-08-24 13:47 ` Bill Nottingham
@ 2005-08-24 15:30 ` Christian Zoz
2005-08-24 19:06 ` Kay Sievers
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Christian Zoz @ 2005-08-24 15:30 UTC (permalink / raw)
To: linux-hotplug
On Wed, Aug 24, Miles Roper wrote:
> Hi Kay,
>
> Thanks very much for your help so far. Its starting to make sense :o)
>
> I still can't get the below rule to work :o(
>
> KERNEL="sd*", ACTION="add", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh"
> KERNEL="sd*", ACTION="remove", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh"
>
> neither script gets run (as they create a test file in /tmp if they run)
Use udev_logfibug and look in syslog why the rule does not match.
--
ciao, christian
睡眠不足はいい仕事の敵だ。
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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] 13+ messages in thread
* Re: [Thinstation-developer] Re: udev PROGRAM action
2005-08-24 9:23 [Thinstation-developer] Re: udev PROGRAM action Miles Roper
` (5 preceding siblings ...)
2005-08-24 15:30 ` Christian Zoz
@ 2005-08-24 19:06 ` Kay Sievers
2005-08-24 19:27 ` Thierry Vignaud
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Kay Sievers @ 2005-08-24 19:06 UTC (permalink / raw)
To: linux-hotplug
On Wed, Aug 24, 2005 at 09:47:47AM -0400, Bill Nottingham wrote:
> Miles Roper (mroper@xtra.co.nz) said:
> > Thanks very much for your help so far. Its starting to make sense :o)
> >
> > I still can't get the below rule to work :o(
> >
> > KERNEL="sd*", ACTION="add", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh"
> > KERNEL="sd*", ACTION="remove", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh"
> >
> > neither script gets run (as they create a test file in /tmp if they run)
> >
> > I can post info from syslog when the device is added if you want?
>
> sd* device names are on the SCSI bus, not the USB bus.
That should match, cause udev will walk up the chain of devices in
sysfs. Matching on SYSFS, DRIVER and BUS on any of the devices
following the "device" link should work. (But all matches must be true on
the same device directory, you can't match BUS and SYSFS from different
devices at the same time. See "udevinfo -a -p /block/sda".)
It's RUN+="...", not RUN=+"...". :)
And you can't match on BUS with "remove" cause there is no bus anymore,
while the device is removed. Only in the environment of the event you
will find PHYSDEVBUS, cause the kernel knows that, but the sysfs
directory is already gone. ENV{PHYSDEVBUS}="..." should work if really
needed.
Kay
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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] 13+ messages in thread
* Re: [Thinstation-developer] Re: udev PROGRAM action
2005-08-24 9:23 [Thinstation-developer] Re: udev PROGRAM action Miles Roper
` (6 preceding siblings ...)
2005-08-24 19:06 ` Kay Sievers
@ 2005-08-24 19:27 ` Thierry Vignaud
2005-08-25 10:53 ` Miles Roper
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Thierry Vignaud @ 2005-08-24 19:27 UTC (permalink / raw)
To: linux-hotplug
Kay Sievers <kay.sievers@vrfy.org> writes:
> It's RUN+="...", not RUN=+"...". :)
shouldn't we package a rule checker with udev in order to detect such
typos?
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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] 13+ messages in thread
* Re: [Thinstation-developer] Re: udev PROGRAM action
2005-08-24 9:23 [Thinstation-developer] Re: udev PROGRAM action Miles Roper
` (7 preceding siblings ...)
2005-08-24 19:27 ` Thierry Vignaud
@ 2005-08-25 10:53 ` Miles Roper
2005-08-25 11:55 ` Kay Sievers
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: Miles Roper @ 2005-08-25 10:53 UTC (permalink / raw)
To: linux-hotplug
Hi Kay,
Oops missed that. Thanks for your help on this. I've got it working now :o)
Another question for you ;o)
I've noticed that there is a devfs udev rules file, but it says not to use it as devfs compatibalty
isn't really the way to go. I've also noticed mandrake & others all seem to use it. Is there a
standard defined somewhere which lists what device name/symlinks you should use for likes of ide
devices & others? Either I try to get the devfs script file working, or recode several different
scripts. Both is about the same amount of work as the script doesn't work on busybox ash.
Also, I don't want to have to recode things again later on so are trying to work out the best way to
do it now.
Thanks
Miles
Kay Sievers wrote:
> On Wed, Aug 24, 2005 at 09:47:47AM -0400, Bill Nottingham wrote:
>
>>Miles Roper (mroper@xtra.co.nz) said:
>>
>>>Thanks very much for your help so far. Its starting to make sense :o)
>>>
>>>I still can't get the below rule to work :o(
>>>
>>>KERNEL="sd*", ACTION="add", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh"
>>>KERNEL="sd*", ACTION="remove", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh"
>>>
>>>neither script gets run (as they create a test file in /tmp if they run)
>>>
>>>I can post info from syslog when the device is added if you want?
>>
>>sd* device names are on the SCSI bus, not the USB bus.
>
>
> That should match, cause udev will walk up the chain of devices in
> sysfs. Matching on SYSFS, DRIVER and BUS on any of the devices
> following the "device" link should work. (But all matches must be true on
> the same device directory, you can't match BUS and SYSFS from different
> devices at the same time. See "udevinfo -a -p /block/sda".)
>
> It's RUN+="...", not RUN=+"...". :)
> And you can't match on BUS with "remove" cause there is no bus anymore,
> while the device is removed. Only in the environment of the event you
> will find PHYSDEVBUS, cause the kernel knows that, but the sysfs
> directory is already gone. ENV{PHYSDEVBUS}="..." should work if really
> needed.
>
> Kay
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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] 13+ messages in thread
* Re: [Thinstation-developer] Re: udev PROGRAM action
2005-08-24 9:23 [Thinstation-developer] Re: udev PROGRAM action Miles Roper
` (8 preceding siblings ...)
2005-08-25 10:53 ` Miles Roper
@ 2005-08-25 11:55 ` Kay Sievers
2005-08-25 12:03 ` Miles Roper
2005-08-31 7:20 ` Greg KH
11 siblings, 0 replies; 13+ messages in thread
From: Kay Sievers @ 2005-08-25 11:55 UTC (permalink / raw)
To: linux-hotplug
On Thu, Aug 25, 2005 at 10:53:05PM +1200, Miles Roper wrote:
> I've noticed that there is a devfs udev rules file, but it says not to use
> it as devfs compatibalty isn't really the way to go. I've also noticed
> mandrake & others all seem to use it.
SUSE an Red Hat never used it and never will. Gentoo is on the way
getting rid of it (half way done). I can't speak for others, but be sure
that this scheme was already dead before it hit the kernel.
> Is there a standard defined
> somewhere which lists what device name/symlinks you should use for likes of
> ide devices & others?
Yes, the LSB names, which are mostly the kernel names. For some
subsystems there is s subdirectory for the nodes to live in.
Enumerating devices like the devfs approach is a silly idea in a world
where device come and go at any time. It just doesn't make _any_ sense
to give a disk a number depending on the order of recognition.
For persistent disk naming, Hannes Reinecke specified a scheme for
SUSE, which can solve many problems in that area. SUSE uses this scheme
and udev tools also in initramfs for a while. The recent udev has a new
infrastructure with the IMPORT key to make stuff like this very easy.
It also makes the crappy mount-by-label code obsolete. We've had a BOF at
OLS this year and everybody agreed that we want to go this way. See here:
http://www.kroah.com/log/2005/08/18/#2005_08_18-persistent
Everything needed is in the udev tarball. If any other subsystems has a
reqirement of stable device names, just some small binaries or scripts and a
bunch of IMPORT udev rules wold be needed to maintain persistent names
in /dev.
> Either I try to get the devfs script file working,
> or recode several different scripts. Both is about the same amount of work
> as the script doesn't work on busybox ash.
>
> Also, I don't want to have to recode things again later on so are trying to
> work out the best way to do it now.
I suggest looking at the /dev/disk/* rules and start from there to
improve and extend this scheme and let the devfs stuff finally rest
in peace.
Thanks,
Kay
> Kay Sievers wrote:
> >On Wed, Aug 24, 2005 at 09:47:47AM -0400, Bill Nottingham wrote:
> >
> >>Miles Roper (mroper@xtra.co.nz) said:
> >>
> >>>Thanks very much for your help so far. Its starting to make sense :o)
> >>>
> >>>I still can't get the below rule to work :o(
> >>>
> >>>KERNEL="sd*", ACTION="add", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh"
> >>>KERNEL="sd*", ACTION="remove", BUS="usb",
> >>>RUN=+"/etc/udev/scripts/usb.sh"
> >>>
> >>>neither script gets run (as they create a test file in /tmp if they run)
> >>>
> >>>I can post info from syslog when the device is added if you want?
> >>
> >>sd* device names are on the SCSI bus, not the USB bus.
> >
> >That should match, cause udev will walk up the chain of devices in
> >sysfs. Matching on SYSFS, DRIVER and BUS on any of the devices
> >following the "device" link should work. (But all matches must be true on
> >the same device directory, you can't match BUS and SYSFS from different
> >devices at the same time. See "udevinfo -a -p /block/sda".)
> >
> >It's RUN+="...", not RUN=+"...". :)
> >And you can't match on BUS with "remove" cause there is no bus anymore,
> >while the device is removed. Only in the environment of the event you
> >will find PHYSDEVBUS, cause the kernel knows that, but the sysfs
> >directory is already gone. ENV{PHYSDEVBUS}="..." should work if really
> >needed.
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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] 13+ messages in thread
* Re: [Thinstation-developer] Re: udev PROGRAM action
2005-08-24 9:23 [Thinstation-developer] Re: udev PROGRAM action Miles Roper
` (9 preceding siblings ...)
2005-08-25 11:55 ` Kay Sievers
@ 2005-08-25 12:03 ` Miles Roper
2005-08-31 7:20 ` Greg KH
11 siblings, 0 replies; 13+ messages in thread
From: Miles Roper @ 2005-08-25 12:03 UTC (permalink / raw)
To: linux-hotplug
Thanks Kay & Others for all your help :o)
Cheers
Miles
Kay Sievers wrote:
> On Thu, Aug 25, 2005 at 10:53:05PM +1200, Miles Roper wrote:
>
>>I've noticed that there is a devfs udev rules file, but it says not to use
>>it as devfs compatibalty isn't really the way to go. I've also noticed
>>mandrake & others all seem to use it.
>
>
> SUSE an Red Hat never used it and never will. Gentoo is on the way
> getting rid of it (half way done). I can't speak for others, but be sure
> that this scheme was already dead before it hit the kernel.
>
>
>>Is there a standard defined
>>somewhere which lists what device name/symlinks you should use for likes of
>>ide devices & others?
>
>
> Yes, the LSB names, which are mostly the kernel names. For some
> subsystems there is s subdirectory for the nodes to live in.
>
> Enumerating devices like the devfs approach is a silly idea in a world
> where device come and go at any time. It just doesn't make _any_ sense
> to give a disk a number depending on the order of recognition.
>
> For persistent disk naming, Hannes Reinecke specified a scheme for
> SUSE, which can solve many problems in that area. SUSE uses this scheme
> and udev tools also in initramfs for a while. The recent udev has a new
> infrastructure with the IMPORT key to make stuff like this very easy.
> It also makes the crappy mount-by-label code obsolete. We've had a BOF at
> OLS this year and everybody agreed that we want to go this way. See here:
> http://www.kroah.com/log/2005/08/18/#2005_08_18-persistent
>
> Everything needed is in the udev tarball. If any other subsystems has a
> reqirement of stable device names, just some small binaries or scripts and a
> bunch of IMPORT udev rules wold be needed to maintain persistent names
> in /dev.
>
>
>>Either I try to get the devfs script file working,
>>or recode several different scripts. Both is about the same amount of work
>>as the script doesn't work on busybox ash.
>>
>>Also, I don't want to have to recode things again later on so are trying to
>>work out the best way to do it now.
>
>
> I suggest looking at the /dev/disk/* rules and start from there to
> improve and extend this scheme and let the devfs stuff finally rest
> in peace.
>
> Thanks,
> Kay
>
>
>
>>Kay Sievers wrote:
>>
>>>On Wed, Aug 24, 2005 at 09:47:47AM -0400, Bill Nottingham wrote:
>>>
>>>
>>>>Miles Roper (mroper@xtra.co.nz) said:
>>>>
>>>>
>>>>>Thanks very much for your help so far. Its starting to make sense :o)
>>>>>
>>>>>I still can't get the below rule to work :o(
>>>>>
>>>>>KERNEL="sd*", ACTION="add", BUS="usb", RUN=+"/etc/udev/scripts/usb.sh"
>>>>>KERNEL="sd*", ACTION="remove", BUS="usb",
>>>>>RUN=+"/etc/udev/scripts/usb.sh"
>>>>>
>>>>>neither script gets run (as they create a test file in /tmp if they run)
>>>>>
>>>>>I can post info from syslog when the device is added if you want?
>>>>
>>>>sd* device names are on the SCSI bus, not the USB bus.
>>>
>>>That should match, cause udev will walk up the chain of devices in
>>>sysfs. Matching on SYSFS, DRIVER and BUS on any of the devices
>>>following the "device" link should work. (But all matches must be true on
>>>the same device directory, you can't match BUS and SYSFS from different
>>>devices at the same time. See "udevinfo -a -p /block/sda".)
>>>
>>>It's RUN+="...", not RUN=+"...". :)
>>>And you can't match on BUS with "remove" cause there is no bus anymore,
>>>while the device is removed. Only in the environment of the event you
>>>will find PHYSDEVBUS, cause the kernel knows that, but the sysfs
>>>directory is already gone. ENV{PHYSDEVBUS}="..." should work if really
>>>needed.
>
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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] 13+ messages in thread
* Re: [Thinstation-developer] Re: udev PROGRAM action
2005-08-24 9:23 [Thinstation-developer] Re: udev PROGRAM action Miles Roper
` (10 preceding siblings ...)
2005-08-25 12:03 ` Miles Roper
@ 2005-08-31 7:20 ` Greg KH
11 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2005-08-31 7:20 UTC (permalink / raw)
To: linux-hotplug
On Thu, Aug 25, 2005 at 01:55:06PM +0200, Kay Sievers wrote:
> On Thu, Aug 25, 2005 at 10:53:05PM +1200, Miles Roper wrote:
> > I've noticed that there is a devfs udev rules file, but it says not to use
> > it as devfs compatibalty isn't really the way to go. I've also noticed
> > mandrake & others all seem to use it.
>
> SUSE an Red Hat never used it and never will. Gentoo is on the way
> getting rid of it (half way done).
As of a few hours ago, the stable Gentoo tree now has the devfs names
removed from the system if you use udev.
thanks,
greg k-h
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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] 13+ messages in thread
end of thread, other threads:[~2005-08-31 7:20 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-24 9:23 [Thinstation-developer] Re: udev PROGRAM action Miles Roper
2005-08-24 10:11 ` Kay Sievers
2005-08-24 10:17 ` Miles Roper
2005-08-24 10:39 ` Kay Sievers
2005-08-24 11:05 ` Miles Roper
2005-08-24 13:47 ` Bill Nottingham
2005-08-24 15:30 ` Christian Zoz
2005-08-24 19:06 ` Kay Sievers
2005-08-24 19:27 ` Thierry Vignaud
2005-08-25 10:53 ` Miles Roper
2005-08-25 11:55 ` Kay Sievers
2005-08-25 12:03 ` Miles Roper
2005-08-31 7:20 ` Greg KH
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).