hotplug scritps calling my app
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Hi,
Quoted 8 lines
for some smartcard/token i wrote a user space application as driver. It could be installed as
/sbin/hotplugon 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.
Quoted 3 lines
of course debian (as always) needs a special handling:
add entries to/etc/hotplug/usb.usermap.localand 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.
Quoted 3 lines
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.
Quoted 1 line
- 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.
Quoted 1 line
- 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.
Quoted 2 lines
- not called with any parameter (kernel and init.d script, but
/sbin/hotplugis called with "usb" as parameter).
Right, /sbin/hotplug strips off the first parameter when it calls /etc/hotplug/$1.agent ... it'd be superfluous!
Quoted 2 lines
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel