From: David Brownell <david-b@pacbell.net>
To: linux-hotplug@vger.kernel.org
Subject: Re: hotplug scritps calling my app
Date: Mon, 08 Jul 2002 15:46:21 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-102616935409872@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-102604527812906@msgid-missing>
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
prev parent reply other threads:[~2002-07-08 15:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-07 12:34 hotplug scritps calling my app Andreas Jellinghaus
2002-07-08 15:46 ` David Brownell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-hotplug-102616935409872@msgid-missing \
--to=david-b@pacbell.net \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).