* hotplug scritps calling my app
@ 2002-07-07 12:34 Andreas Jellinghaus
2002-07-08 15:46 ` David Brownell
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Jellinghaus @ 2002-07-07 12:34 UTC (permalink / raw)
To: linux-hotplug
Hi.
for some smartcard/token i wrote a user space application
as driver. It could be installed as /sbin/hotplug on systems
without the default hotplug scripts.
with the default scripts, is this the right thing to do?
- add entry to /etc/hotplug/usb.usermap
- create directory /etc/hotplug/usb
- copy my userspace driver to /et/hotplug/usb/etoken
of course debian (as always) needs a special handling:
add entries to /etc/hotplug/usb.usermap.local and call
update-usb.usermap.
i noticed a small difference in the driver called
via the true hotplug <-> the init.d startup script:
- DEBUG="kernel" is only set when called via kernel.
- PRODUCT="0/0/0" (init.d script) versus PRODUCT="529/50c/100" (kernel)
- TYPE="usb" is only set when called from kernel.
- not called with any parameter (kernel and init.d script, but
/sbin/hotplug is called with "usb" as parameter).
are these meant to be that way?
setting PRODUCT environment variable would be good IMO.
I'm using debian/woody. I guess they haven't changed the hotplugs script
(except the update-usb.usermap hack). The version is 0.0.20020114-7.
Best regards, Andreas
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
We have stuff for geeks like you.
http://thinkgeek.com/sf
_______________________________________________
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] 2+ messages in thread
* Re: hotplug scritps calling my app
2002-07-07 12:34 hotplug scritps calling my app Andreas Jellinghaus
@ 2002-07-08 15:46 ` David Brownell
0 siblings, 0 replies; 2+ messages in thread
From: David Brownell @ 2002-07-08 15:46 UTC (permalink / raw)
To: linux-hotplug
Hi,
> for some smartcard/token i wrote a user space application
> as driver. It could be installed as /sbin/hotplug on systems
> without the default hotplug scripts.
>
> with the default scripts, is this the right thing to do?
> - add entry to /etc/hotplug/usb.usermap
> - create directory /etc/hotplug/usb
> - copy my userspace driver to /et/hotplug/usb/etoken
I'd make the /etc/hotplug/usb/etoken a script that invokes
a driver/app that lives someplace else, but otherwise yes.
> of course debian (as always) needs a special handling:
> add entries to /etc/hotplug/usb.usermap.local and call
> update-usb.usermap.
Actually, if I trust the manpage, add to /usr/lib/hotplug
and then the update-usb.usermap regens the /etc/hotplug file.
> i noticed a small difference in the driver called
> via the true hotplug <-> the init.d startup script:
> - DEBUG="kernel" is only set when called via kernel.
And then, only when the kernel sets USB debugging on.
The flag is basically boolean (set to some value, or
otherwise) so far as the hotplug scripts are concerned.
> - PRODUCT="0/0/0" (init.d script) versus PRODUCT="529/50c/100" (kernel)
That is, the synthesized "coldplug" events aren't quite
correct? Right. I'm not sure how to fix that. Not all
of the relevant information is readily available, unless
something is parsing /proc/bus/usb/devices ... which may
be reasonable in Perl, but is not in BASH.
Since that path is only happening when "usbmodules" is
invoked, I suspect the thing to do might be to teach
that program to dump the _right_ values of all the
environment variables it's synthesizing.
> - TYPE="usb" is only set when called from kernel.
??? No kernel I've seen has that. "TYPE=%d/%d/%d" in the
USB hotplug printf strings since 2.4.0-test10 or so.
Ah -- I see what's happening. "hotplug.functions" uses
TYPE as a non-local variable, and it overrides the environment
variable. I'll patch that.
> - not called with any parameter (kernel and init.d script, but
> /sbin/hotplug is called with "usb" as parameter).
Right, /sbin/hotplug strips off the first parameter when it
calls /etc/hotplug/$1.agent ... it'd be superfluous!
> are these meant to be that way?
> setting PRODUCT environment variable would be good IMO.
Yes. A patch would be helpful.
- Dave
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Oh, it's good to be a geek.
http://thinkgeek.com/sf
_______________________________________________
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] 2+ messages in thread
end of thread, other threads:[~2002-07-08 15:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-07 12:34 hotplug scritps calling my app Andreas Jellinghaus
2002-07-08 15:46 ` David Brownell
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).