[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bringing up PCMCIA wireless interface



Dan Christensen wrote:
I've got a PCMCIA wireless card in my laptop, and I'd like to figure
out the Debian way of arranging that it be brought up when the card is
inserted (including on boot).  I only use the card on my home network,
which uses WEP.

[...]

Now, I've upgraded to udev 0.079-1, which conflicts with hotplug,
and ifup doesn't seem to get called anymore.  I also tried moving
from pcmcia-cs to pcmciautils (version 012-1), and that didn't help.
I'm running a self-compiled 2.6.13.3 kernel.

I also tried ifplugd, but it doesn't run ifup until WEP has been
configured, but I have set things up so that ifup does my WEP
configuration!

Hi Dan,

First of all, just to make sure you did not miss this, it might be
necessary that you include the module for your PCMCIA wireless in
/etc/modules if you have not done so already, as pointed out in
/usr/share/doc/udev/README.Debian.gz. Then you should see a node created
in /dev whenever the card is plugged in, and removed again when you pull
out the card.

If this works you can use udev to run ifup/down when appropriate. (I
have not used this with PCMCIA cards myself, the following is only my
best guess.)

Create a new file in /etc/udev called "local.rules". This file can
contain all your own customizations to udev. Add a line to match your
PCMCIA card, it should probably look something like this:

KERNEL=="eth*", SYSFS{address}=="xx:xx:xx:xx:xx:xx", NAME="wlan0", PROGRAM="/path/to/your/script"

This has to be on one line, the xx's should be the MAC address of your
PCMCIA card, use only lowercase letters in the hex numbers. This line
matches a device with the kernel name "eth1" or "eth2", etc. and the
specific MAC address. (If the normal device name of the card is not eth*
you have to change the first key accordingly, as described in
/usr/share/doc/udev/writing_udev_rules/index.html) This device is then
assigned the name "wlan0" (or whatever you put there) and you should use
only this identifier at all other places, e.g. in /etc/network/interfaces.

To activate this rule, symlink it in the /etc/udev/rules.d directory.
This symlink should be called "010_local.rules" to make sure it has
priority over the other rules which are already there. (The files are
parsed in lexcial order and the first matching rule "wins".)

/path/to/your/script should point to a short script, for example in
/usr/local/bin/ which gets called whenever the card is plugged in or
pulled out. In the script you can use the $ACTION environmental variable
("add" or "remove") to decide if you do "ifup wlan0" or "ifdown wlan0".
The manpage of udev has more details.

I hope this helps.

Regards,
           Florian



Reply to: