Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Apr 2001 05:52:17 -0700 (PDT)
From:      David Wolfskill <david@catwhisker.org>
To:        freebsd-mobile@FreeBSD.ORG, freebsd@guldan.demon.nl
Subject:   Re: pccard startup scripts
Message-ID:  <200104041252.f34CqHP42603@bunrab.catwhisker.org>
In-Reply-To: <20010404140932.A48567@thorin.guldan.demon.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
>Date: Wed, 4 Apr 2001 14:09:32 +0200
>From: =?iso-8859-1?Q?Robert_Blacqui=E8re?= <freebsd@guldan.demon.nl>

>I made some scripts for pccard as replacement for
>the pccard_ether scripts. It has some of the features
>of the linux-pcmcia-cs software. It supports now different
>network settings (easily switchable). Using a single=20
>config script in which is defined the network settings for
>different locations and different network cards. The config
>depends on the scheme, driver loaded and the mac address of
>the inserted pccard. Before you insert the pccard you tell
>the system which scheme to use. And then you can insert the
>pccard and all settings will be made according to the config.

That sounds as if it is a step toward addressing a problem I had, and 
which I approached in a different way.

The problem was setting my 802.11b PCMCIA card for whatever network I 
happened to be wanting to use at the time -- work, home, a conference...
whatever.

One of my colleagues used a script where he would identify the network
to use; this appears to be similar to the approach you took.  It seemed
to me, though, that this would, at best, be awkward for me:  During
system start-up, I would think it would be difficult to engage in a
dialog; besides, I fire up xdm fairly early.

So I used a hint from another colleague, who had a script that would try
various settings until it found a setting that allowed it to sync up.

I cobbled up a bit of Perl that uses a couple of RDB-style "databases"
-- one to tell it about the characteristics of a given "location" (use
infrastructure or ad-hoc mode; what SSID to use; WEP key...), and the
other to define how to change the settings and examine the results based
on which kind of card (driver) is being used.  (I have subsequently
modified it a bit further to allow for the use of "ifconfig" for these,
using Brooks Davis' recent patches to ifconfig, and I've been using this
successfully both in -STABLE and in -CURRENT.)

But the basic issue was how to pass control to the Perl script.

I found a couple of places to do this, and I'm not very happy with
either one:

* In the card-specific stanza for /etc/pccard.conf, for an "insert"
  action, like this:

  insert  /usr/local/sbin/pccard_hook -i $device

  This works, but using it means that I need to have my own stanza in
  /etc/pccard.conf, rather than just using the one in /etc/defaults.
  Indeed, except for this, I don't even need my own /etc/pccard.conf.

* Hacking /etc/pccard_ether, as the first action in the "start" case:

  if [ -x /usr/local/sbin/pccard_hook ]; then
	/usr/local/sbin/pccard_hook -i ${interface}
  fi

  I don't mind this quite as much, though it seems that the function --
  providing an installation-specific "hook" for doing idiosyncratic
  things -- ought to be integrated rather more cleanly than what I did.

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?200104041252.f34CqHP42603>