* config questions
@ 2002-08-26 5:50 Ian Walters
2002-08-27 14:53 ` David Brownell
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Ian Walters @ 2002-08-26 5:50 UTC (permalink / raw)
To: linux-hotplug
Hi,
Sorry if this sounds like a newbie question, but the search on the archives
kind of suck.
I just finished (successfully after much pain) get hotplug to initialize a
device for me when it was plugged in. But to do this I had to bypass all of
the existing net.agent script.
I am guessing I didn't find the right documentation. I will tell you what I
did and hopefully someone can tell me what I should have done.
Have usbnet loaded as a module.
in /etc/hotplug/net.agent before anything, do
mesg Checking for subscript for $INTERFACE $ACTION
if [ -x "/etc/hotplug/interfaces/$INTERFACE" ] ; then
mesg Calling subscript for $INTERFACE $ACTION
/etc/hotplug/interfaces/$INTERFACE $ACTION
exit 0
fi
and in /etc/hotplug/interfaces reacted to the arguments registered and
derigistered to do what I needed for /dev/usb0
Ideally I would always like to say... for devX put file into interfaces/devX
and in that file do X for plugged in and Y for unplugged. Just like the
init.d scripts.
Information on why my approach is wrong would help, the page
http://linux-hotplug.sourceforge.net/
talked a lot about what hotplug without ever getting to the one question most
people would have...
"I have new device X and I want Y to happen when I plug it in. What do I do?"
Thanks for any information. If it turns out this description isn't in
existence yet (for users who just want an answer to the above question, not
understand how hotplug works) then I might do one up.
Ian.
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
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] 5+ messages in thread
* Re: config questions
2002-08-26 5:50 config questions Ian Walters
@ 2002-08-27 14:53 ` David Brownell
2002-08-27 23:50 ` Ian Walters
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: David Brownell @ 2002-08-27 14:53 UTC (permalink / raw)
To: linux-hotplug
> I just finished (successfully after much pain) get hotplug to initialize a
> device for me when it was plugged in. But to do this I had to bypass all of
> the existing net.agent script.
Hmm, you didn't say what Linux distro you're using. They differ
in how they manage network interfaces ... though there does seem
to be a common failing of requring interfaces to be predefined,
combined with inadequate (or even incorrect) documentation on
how to predefine them.
But then it's complicated by the fact that different network devices
all have different initialization models. At least some of those
issues are already noted in the net.agent script.
> I am guessing I didn't find the right documentation. I will tell you what I
> did and hopefully someone can tell me what I should have done.
>
> Have usbnet loaded as a module.
Not necessary, it'll be modprobed when needed. Did you look at
http://www.linux-usb.org/usbnet/
for information about this driver? Your question made me push out
some pending updates, which should get synced to the mirrors sometime
tonight (document date 28 August). More examples, including zcip,
but not yet a complete "out of the box" config example (except for a
simple laptop/desktop setup).
The configuration I'd like to see work is basically combining the
bridge tools (brctl etc) and zeroconf (zcip, plus ...) so those
interfaces never require preconfiguration. (It'd be an option,
but not the only or preferred one.)
> in /etc/hotplug/net.agent before anything, do
>
>
> mesg Checking for subscript for $INTERFACE $ACTION
> if [ -x "/etc/hotplug/interfaces/$INTERFACE" ] ; then
> mesg Calling subscript for $INTERFACE $ACTION
> /etc/hotplug/interfaces/$INTERFACE $ACTION
> exit 0
> fi
>
> and in /etc/hotplug/interfaces reacted to the arguments registered and
> derigistered to do what I needed for /dev/usb0
There's no such thing as /dev/usb0! :)
But what you're doing there is defining a new network administration
policy, which is something hotplug has so far avoided doing. Though
I'm pretty much convinced it'll be essential for IP-over-USB, since
otherwise distros will continue requiring pre-configuration (yeech)
instead of just making that a (less desirable) policy option.
The /etc/sysconfig/network-scripts/ifcfg-usb0 script is how at least
some distros handle that problem, not that there's good documentation
on how to make them work. Not interfaces/usb0.
> Ideally I would always like to say... for devX put file into interfaces/devX
> and in that file do X for plugged in and Y for unplugged. Just like the
> init.d scripts.
Whereas, the networking scripts currently invoke "ifup" on interfaces
that are known to the distro's network admin tools. They can't often
do anything useful on "unregister", like "ifdown", since the interface
is gone by then. (Though ISTR that either SuSE or Debian had a version
of "ifup" that updated some user mode database, so "ifdown" had to purge
that data...) And sysadmin tools don't often handle "usb0" (etc) yet.
> Information on why my approach is wrong would help, the page
> http://linux-hotplug.sourceforge.net/
> talked a lot about what hotplug without ever getting to the one question most
> people would have...
> "I have new device X and I want Y to happen when I plug it in. What do I do?"
If you're asking as a user, the answer is: "It's probably supposed to happen
automatically, without needing pre-configuration. But not all the tools are
there yet."
If you're asking as a developer, then "UTSL, and good patches always help" is
closer to the answer. Most of those pages are directed towards developers
right now.
And it'd be a big help if someone packaged a general "hotplug event triggers
user dialog" facility, so that when sysadmin attention is needed, the system
can at least initiate a conversation with the user.
- Dave
> Thanks for any information. If it turns out this description isn't in
> existence yet (for users who just want an answer to the above question, not
> understand how hotplug works) then I might do one up.
>
> Ian.
>
>
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
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] 5+ messages in thread
* Re: config questions
2002-08-26 5:50 config questions Ian Walters
2002-08-27 14:53 ` David Brownell
@ 2002-08-27 23:50 ` Ian Walters
2002-08-28 4:13 ` Ajay
2002-08-28 5:21 ` Greg KH
3 siblings, 0 replies; 5+ messages in thread
From: Ian Walters @ 2002-08-27 23:50 UTC (permalink / raw)
To: linux-hotplug
On Wed, 28 Aug 2002 12:53 am, David Brownell wrote:
> > I just finished (successfully after much pain) get hotplug to initialize
> > a device for me when it was plugged in. But to do this I had to bypass
> > all of the existing net.agent script.
>
> Hmm, you didn't say what Linux distro you're using. They differ
> in how they manage network interfaces ... though there does seem
> to be a common failing of requring interfaces to be predefined,
> combined with inadequate (or even incorrect) documentation on
> how to predefine them.
>
Using SuSE 8.0 at the moment.
> But then it's complicated by the fact that different network devices
> all have different initialization models. At least some of those
> issues are already noted in the net.agent script.
>
> > I am guessing I didn't find the right documentation. I will tell you
> > what I did and hopefully someone can tell me what I should have done.
> >
> > Have usbnet loaded as a module.
>
> Not necessary, it'll be modprobed when needed. Did you look at
>
> http://www.linux-usb.org/usbnet/
admittedly not. It was already part of my kernel source code and worked
without me having to do anything, so I didn't do anything :)
>
> for information about this driver? Your question made me push out
> some pending updates, which should get synced to the mirrors sometime
> tonight (document date 28 August). More examples, including zcip,
> but not yet a complete "out of the box" config example (except for a
> simple laptop/desktop setup).
>
> The configuration I'd like to see work is basically combining the
> bridge tools (brctl etc) and zeroconf (zcip, plus ...) so those
> interfaces never require preconfiguration. (It'd be an option,
> but not the only or preferred one.)
>
Pre-configuration will always need to be possible. It might be I want a alert
to go somwhere else when the device is plugged in, or a certain program to
start. But I understand what you mean here, its best if the 'end' guy only
has to tack on something, and then only if he needs to do something out of
the ordinary.
> > in /etc/hotplug/net.agent before anything, do
> >
> >
> > mesg Checking for subscript for $INTERFACE $ACTION
> > if [ -x "/etc/hotplug/interfaces/$INTERFACE" ] ; then
> > mesg Calling subscript for $INTERFACE $ACTION
> > /etc/hotplug/interfaces/$INTERFACE $ACTION
> > exit 0
> > fi
> >
> > and in /etc/hotplug/interfaces reacted to the arguments registered and
> > derigistered to do what I needed for /dev/usb0
>
> There's no such thing as /dev/usb0! :)
Um, yeah. my bad. What I was trying to say was 'unique ident for my device',
which for me is INTERFACE=usb0.
>
> But what you're doing there is defining a new network administration
> policy, which is something hotplug has so far avoided doing. Though
> I'm pretty much convinced it'll be essential for IP-over-USB, since
> otherwise distros will continue requiring pre-configuration (yeech)
> instead of just making that a (less desirable) policy option.
>
> The /etc/sysconfig/network-scripts/ifcfg-usb0 script is how at least
> some distros handle that problem, not that there's good documentation
> on how to make them work. Not interfaces/usb0.
>
> > Ideally I would always like to say... for devX put file into
> > interfaces/devX and in that file do X for plugged in and Y for unplugged.
> > Just like the init.d scripts.
>
> Whereas, the networking scripts currently invoke "ifup" on interfaces
> that are known to the distro's network admin tools. They can't often
> do anything useful on "unregister", like "ifdown", since the interface
> is gone by then. (Though ISTR that either SuSE or Debian had a version
> of "ifup" that updated some user mode database, so "ifdown" had to purge
> that data...) And sysadmin tools don't often handle "usb0" (etc) yet.
>
> > Information on why my approach is wrong would help, the page
> > http://linux-hotplug.sourceforge.net/
> > talked a lot about what hotplug without ever getting to the one question
> > most people would have...
> > "I have new device X and I want Y to happen when I plug it in. What do I
> > do?"
>
> If you're asking as a user, the answer is: "It's probably supposed to
> happen automatically, without needing pre-configuration. But not all the
> tools are there yet."
>
> If you're asking as a developer, then "UTSL, and good patches always help"
> is closer to the answer. Most of those pages are directed towards
> developers right now.
>
> And it'd be a big help if someone packaged a general "hotplug event
> triggers user dialog" facility, so that when sysadmin attention is needed,
> the system can at least initiate a conversation with the user.
This sounds exactly what I am thinking about. Something you could run, plug
in your device, and then tell it what to do on that trigger, after all the
hotplug stuff has been done. Guess its source code that I would be diving
into and not Documentation at this point. Might have a look on the weekend.
> - Dave
Thanks for the information. I definately have a much clear idea of how its
set up now and whats going on.
Ian.
-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing
real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim
_______________________________________________
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] 5+ messages in thread
* Re: config questions
2002-08-26 5:50 config questions Ian Walters
2002-08-27 14:53 ` David Brownell
2002-08-27 23:50 ` Ian Walters
@ 2002-08-28 4:13 ` Ajay
2002-08-28 5:21 ` Greg KH
3 siblings, 0 replies; 5+ messages in thread
From: Ajay @ 2002-08-28 4:13 UTC (permalink / raw)
To: linux-hotplug
> > and in /etc/hotplug/interfaces reacted to the
> arguments registered and
> > derigistered to do what I needed for /dev/usb0
>
> There's no such thing as /dev/usb0! :)
Is this the usb hub? I can't find usb0 in my system
either(RHL 7.3), but /proc/devices lists "180 usb". I
tried
mknod /dev/usb/hub c 180 0
but it didn't seem to point to the hub ('open' failed
: "No such device"). What is the device file for the
USB-UHCI hub?
AFAICS hotplug checks the file /proc/bus/usb/devices.
Why not communicate with the hub directly using ioctl
calls?
Thanks and regards
-Ajay
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing
real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim
_______________________________________________
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] 5+ messages in thread
* Re: config questions
2002-08-26 5:50 config questions Ian Walters
` (2 preceding siblings ...)
2002-08-28 4:13 ` Ajay
@ 2002-08-28 5:21 ` Greg KH
3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2002-08-28 5:21 UTC (permalink / raw)
To: linux-hotplug
On Wed, Aug 28, 2002 at 05:13:04AM +0100, Ajay wrote:
>
> > > and in /etc/hotplug/interfaces reacted to the
> > arguments registered and
> > > derigistered to do what I needed for /dev/usb0
> >
> > There's no such thing as /dev/usb0! :)
>
> Is this the usb hub? I can't find usb0 in my system
> either(RHL 7.3), but /proc/devices lists "180 usb". I
> tried
> mknod /dev/usb/hub c 180 0
> but it didn't seem to point to the hub ('open' failed
> : "No such device"). What is the device file for the
> USB-UHCI hub?
Why do you want to talk to the root uhci hub? Why would you want to
talk to _any_ hub for that matter? You can't really do anything with
them.
And device 180 0 is for a USB printer, not a USB hub. See the list at:
http://www.linux-usb.org/usb.devices.txt
for more info on the reserved USB major:minor numbers.
> AFAICS hotplug checks the file /proc/bus/usb/devices.
> Why not communicate with the hub directly using ioctl
> calls?
If you _really_ want to send an ioctl command to a USB hub, you have to
do it through usbfs, which is mounted at /proc/bus/usb usually. You
need to find the specific file under that directory that matches your
hub.
I really don't like having that ioctl in the kernel, and am looking to
remove it. Why do you want to call it?
Actually, in looking at the kernel code some more, I don't see how
anyone can call hub_ioctl()...
thanks,
greg k-h
-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing
real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim
_______________________________________________
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] 5+ messages in thread
end of thread, other threads:[~2002-08-28 5:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-26 5:50 config questions Ian Walters
2002-08-27 14:53 ` David Brownell
2002-08-27 23:50 ` Ian Walters
2002-08-28 4:13 ` Ajay
2002-08-28 5:21 ` 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).