linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ENV{MODALIAS}=="?*"->ONLY modprobe????,how to trap kernel events
@ 2006-02-16 13:29 janusz borowski
  2006-02-17  3:40 ` ENV{MODALIAS}=="?*"->ONLY modprobe????,how to trap kernel events during boot Greg KH
  2006-02-17  9:12 ` ENV{MODALIAS}=="?*"->ONLY modprobe????,how to trap kernel events janusz borowski
  0 siblings, 2 replies; 3+ messages in thread
From: janusz borowski @ 2006-02-16 13:29 UTC (permalink / raw)
  To: linux-hotplug

Hi,
I have changed the original line (in z55_hotplug.rules):
ENV{MODALIAS}="?*",    RUN+="/sbin/modprobe $env{MODALIAS}"
to "my line":
ENV{MODALIAS}="?*", RUN+="/usr/local/lib/udev/t52.sh"
and  the t52.sh is:
#!/bin/sh
echo "********t2********">>/usr/local/lib/udev/wyn52
set>>/usr/local/lib/udev/wyn52
echo "********end t2********">>/usr/local/lib/udev/wyn52
However,
1)after booting with "my line" the wyn52 is empty (and of course 
modules are not loaded)
2)after booting with "original line" modules are loaded (so the rule 
ENV{MODALIAS}="?*" "detects" events)
3)when the boot process is ended "my rule" works ok (eg.: I have 
information in wyn52 after plugging a usb-modem).
My question is:
WHY MY "DIAGNOSTIC TOOL" DOES NOT WORK DURING BOOT?
I have tried similar "trap":
KERNEL="?*" -> "log %k". This time my diagnostic file is not empty 
after booting,
however it contains mostly information about /dev/vcs*,
usb buses  and almost nothing about pci devices - I do not believe
that ALL kernel events were registered.
Why?

What kind of rule could give information about pci devices (during boot 
time)?I would like to know how to log to a file ALL %k, %b considering 
by udevd during boot time
(to take appropriate action for my device like d-link pci wifi card or 
usb modem,... - I do not want to do this by configuring modprobe).

I am using udev 0.084-4 (not 0.085 yet), kernel 2.6.15, debian unstable.
(udev_log="info or debug" gives only messages to console, one cannot 
read them, and system crash after a few minutes - I must start another 
linux and change back to udev_log="err"....)
Thanks in advance
janusz




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642
_______________________________________________
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] 3+ messages in thread

* Re: ENV{MODALIAS}=="?*"->ONLY modprobe????,how to trap kernel events during boot
  2006-02-16 13:29 ENV{MODALIAS}=="?*"->ONLY modprobe????,how to trap kernel events janusz borowski
@ 2006-02-17  3:40 ` Greg KH
  2006-02-17  9:12 ` ENV{MODALIAS}=="?*"->ONLY modprobe????,how to trap kernel events janusz borowski
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2006-02-17  3:40 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Feb 16, 2006 at 08:29:58AM -0500, janusz borowski wrote:
> Hi,
> I have changed the original line (in z55_hotplug.rules):
> ENV{MODALIAS}="?*",    RUN+="/sbin/modprobe $env{MODALIAS}"
> to "my line":
> ENV{MODALIAS}="?*", RUN+="/usr/local/lib/udev/t52.sh"
> and  the t52.sh is:
> #!/bin/sh
> echo "********t2********">>/usr/local/lib/udev/wyn52
> set>>/usr/local/lib/udev/wyn52
> echo "********end t2********">>/usr/local/lib/udev/wyn52
> However,
> 1)after booting with "my line" the wyn52 is empty (and of course 
> modules are not loaded)
> 2)after booting with "original line" modules are loaded (so the rule 
> ENV{MODALIAS}="?*" "detects" events)
> 3)when the boot process is ended "my rule" works ok (eg.: I have 
> information in wyn52 after plugging a usb-modem).
> My question is:
> WHY MY "DIAGNOSTIC TOOL" DOES NOT WORK DURING BOOT?

Is /usr/local/lib/udev mounted at this time?

thanks,

greg k-h


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642
_______________________________________________
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] 3+ messages in thread

* Re: ENV{MODALIAS}=="?*"->ONLY modprobe????,how to trap kernel events
  2006-02-16 13:29 ENV{MODALIAS}=="?*"->ONLY modprobe????,how to trap kernel events janusz borowski
  2006-02-17  3:40 ` ENV{MODALIAS}=="?*"->ONLY modprobe????,how to trap kernel events during boot Greg KH
@ 2006-02-17  9:12 ` janusz borowski
  1 sibling, 0 replies; 3+ messages in thread
From: janusz borowski @ 2006-02-17  9:12 UTC (permalink / raw)
  To: linux-hotplug

Greg KH wrote:

> Is /usr/local/lib/udev mounted at this time?
> 
> thanks,
> 
> greg k-h
> 
> 
Thanks for your remark.
Yes, it is mounted (/usr/local/lib/udev is a part of the partition
where the whole debian was installed and my rule starts working after 
booting).

I have tried much more rough test (because I thought that in this moment
the writing to disk is not starting yet).
I have changed RUN+=... to:
RUN+="/bin/sh -c 'K=%k; K=$$; printf $${K} '"
(and this line was taken and carefully changed from the "original 
working rule"
- at this moment I knew that is not so easy with udev....).
Nothing (and original rule in my computer loads about 15 modules,
like pci-bttv, snd *1394,...so should be more than 15 "printf's").
Next I have changed to:
RUN+="/bin/sh -c 'K=%k; printf YYYYYaaaaaa'" (easy seen string)
Nothing.

(At this time I did not believe in syslog, which should log everything,
so I have added in 3 scripts in /etc/init.d:
/sbin/lsmod
echo "name of script"
read bleble
Now, the boot process was stopping 3 times, and very easy I could read
all messages using Shift PgUp.
I am sure that my rule did not give any messages to console).

The only succeses in my "investigations" were as follows:
I have looked at /sys for ID connected with modules loaded by original rule
(not so clear for me but possible)
I have applied rules:
ID="something", OPTIONS+="last_rule".
Success - udev did not load any modules (so udev see all pci-events!!; 
eg. bttv).
But when I try:
ID="something",RUN+="a test", OPTIONS+="last_rule"
the polite udev ignores any test (>>file, printf, echo, ...).

I have tried:
RUN <-> PROGRAM
test rules on the beginning of rules list, on the end, near original 
(z55) - z52, z57
changing original rule or adding new
NOTHING         -   udev keep his secrets .....

Maybe I try to catch too much events?
Maybe it was possible to divide "trap procedure" into parts (but I do 
not know
the names of all events (eg. SUBSYTEM's) and I do not know  which set of 
rules
could give full information).

Maybe my problems are caused by "some time-like" effects?

Maybe someone has a source of "a test demon", which could be started
before udev and catch everything in his large buffer a
nd when the system is started it could save this buffer to a file ?

Thanks in advance
janusz









> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642
_______________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2006-02-17  9:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-16 13:29 ENV{MODALIAS}=="?*"->ONLY modprobe????,how to trap kernel events janusz borowski
2006-02-17  3:40 ` ENV{MODALIAS}=="?*"->ONLY modprobe????,how to trap kernel events during boot Greg KH
2006-02-17  9:12 ` ENV{MODALIAS}=="?*"->ONLY modprobe????,how to trap kernel events janusz borowski

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