Date: Sat, 7 Jul 2001 14:44:32 -0700 (PDT) From: David Wolfskill <david@catwhisker.org> To: freebsd-mobile@FreeBSD.ORG Subject: Re: ifconfig wireless card options and DHCP Message-ID: <200107072144.f67LiWx28122@bunrab.catwhisker.org> In-Reply-To: <20010707160606.B27611@pir.net>
next in thread | previous in thread | raw e-mail | index | archive | help
>Date: Sat, 7 Jul 2001 16:06:07 -0400
>From: Peter Radcliffe <pir@pir.net>
>> * Have you looked at /etc/start_if.* & /etc/stop_if.*?
>Yes, I don't feel they are appropriate to what I'm doing for a number
>of reasons and also I don't want a million files, two for each
>interface (and I use _lots_ of interfaces at different times on my
>laptop), filling up /etc and not having access to the more generalised
>configuration information that is elsewhere (rc.conf*).
Fair enough. I confess I'm not thrilled about them (for various
reasons, not least of which is that the name of the interface isn't
visible to the code that runs there.
>> * First, consider that we're discussing this on -mobile -- implying
>> that a reasonable approach should probably handle a case where the
>> machine in question moves from one environment to another.
>I've have personally dealt with that case by putting site specific
>information into /etc/rc.conf.local. I don't hardcode things like this
>and the reason I want this change is to more easily allow me to deal
>with various interfaces in various different networks in a coherent
>way.
Hmm... sounds as if I'm failing to express myself adequately; sorry.
From my perspective, putting "site specific" stuff in a given (mobile)
machine's /etc/*.local is what I would call "hard coding", and is a
problem to avoid.
For example, I normally use my laptop both at home and at work; in both
cases, I normally use the an0 interface. However, there certainly exist
differences between those environments, and I am averse to trying to use
an approach that requires that I "tweak" something in a file system ini
order to allow the machine to join the network.
That said, such an approach may well be appropriate for other folks.
But I believe that setting things up as dhclient is, where there can be
an (optional) "hooks" script would be a good way to handle both
approaches,
>If I just wanted to hardcode the information I'd put it into
>/etc/pccard.conf. I don't, I want it eaily changable. This is
>trivially changable based on location and I have a couple of small
>scripts to do so.
:-} But you need a way to select which, yes? And an opportunity to do
so....
>> So my approach was closer to the 2nd of the above alternatives: I
>> wrote a (Perl) script that uses a couple of files, one containing
>> information about different kinds of interfaces & how to specify
>I do similar things, but they are sh scripts and don't fill /etc up as
>much.
Well, I've used (essentially) the same Perl script (which I stuffed in
/usr/local/sbin) through 3 iterations of invocation:
* Directly in /etc/pccard.conf
Ugly, in that:
* An entry needs to be added for each stanza corresponding to a device
for which the script is to be invoked, and
* each such stanza would need to be copied to /etc/pccard.conf, and
would thus likely not be be kept up-to-date with
/etc/defaults/pccard.conf.
* A hack to /etc/pccard_ether (as shown on the Web page I mentioned):
--- /usr/src/etc/pccard_ether Sat Feb 3 20:41:34 2001
+++ /etc/pccard_ether Thu Mar 15 11:48:08 2001
@@ -58,6 +58,9 @@
case ${startstop} in
[Ss][Tt][Aa][Rr][Tt] | '')
+ if [ -x /usr/local/sbin/pccard_hook ]; then
+ /usr/local/sbin/pccard_hook -i ${interface}
+ fi
if [ -r /etc/start_if.${interface} ]; then
. /etc/start_if.${interface}
fi
This invokes the named script if it's executable (and doesn't break if
it isn't). The script (whatever its name; that's just what I happened
to use) would be (completely) user-specified. I could do what I want
to do; you could do what you want to do.... :-)
But I was informed that /etc/pccard_ether was viewed as a hack, and
that there was a desire to make it Go Away.
* One of my colleagues pointed out that /etc/st{art,op}_if.* could be
used for interface-specific things, and were completely user-
specified, and were already being sourced from /etc/pccard_ether.
This is apparently as close to a user-specified "hook" as was likely
to show up any time soon.
Unfortunately, this mechanism provides no way for the script (or
whatever) to know on behalf of which interface it was being invoked.
And (as you noted), there needs to be a separate such file (even it's
only a single line long) for each possible interface instantiation,
which is pretty unaesthetic, to put it kindly.
>> What I wrote up about the stuff is at
>> http://www.catwhisker.org/~david/FreeBSD; feel free to take a look....
>I've looked at your stuff before. Two files in /etc for each network
>interface ? No thanks.
As noted, that's not my ideal, by a long shot. :-)
Cheers,
david
--
David H. Wolfskill david@catwhisker.org
As a computing professional, I believe it would be unethical for me to
advise, recommend, or support the use (save possibly for personal
amusement) of any product that is or depends on any Microsoft product.
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107072144.f67LiWx28122>
