load ndiswrapper at boot


Forum: Networking
Topic: load ndiswrapper at boot
started by: andrei_r

Posted by andrei_r on Dec. 06 2005,16:38
Hi,

I was able to configure my DWL-G650 B2 card using ndiswrapper. The instructions for ndiswrapper say that to modprobe it at boot one needs to run "ndiswrapper -m". But when I do that in DSL-2.0 (hard drive install) it says:
root@box:/home/dsl# ndiswrapper -m
modprobe config already contains alias directive

and ndiswrapper still does not get modprobe'd at boot.

I tried to figure out a way to load ndiswrapper by cardmgr at boot and modified my modules.pcimap to include an pci id of DWL-G650 B2, but modules.pcimap gets rewritten at boot :(. I can't find a place in boot sequence where it happens.

Maybe someone can help me to understand how to make ndiswrapper module load at boot so my card is configured the correct way (not by manually running modprobe after the system booted). Please note that I plan to remaster my DSL on cdrom from HD install after customizing, so I would like to accomplish this in a most generic way possible.

Thanks!

         Andrei

Posted by andrei_r on Dec. 07 2005,18:36
Well, I guess there is no clean way to do it, so if you need to identify and pre-load your ndiswrapper-supported wireless PCMCIA card, you can modify the following script and insert in into your /opt/bootlocal.sh

Code Sample

# load ndiswrapper if D-link DWL-G650 B2 detected
card_id="Atheros Communications, Inc. AR5212 802.11abg NIC"
result=`lspci | grep "$card_id"`

if [ -n "$result" ]; then
       echo
       echo "Found $card_id"

       # card found, check for a driver now
       driver_present=`ndiswrapper -l | grep net5211`
       if [ -z "$driver_present" ]; then
               echo "net5211 driver not found... download a correct driver from:"
               echo "http://ndiswrapper.sourceforge.net/mediawiki/index.php/List";
       else
               echo "...loading ndiswrapper"
               modprobe ndiswrapper
               echo "...re-sending dhcp request"
               sleep 5
               pump -i wlan0&
       fi
fi

Posted by roberts on Dec. 07 2005,18:44
Thanks for sharing.  But I do have a question for you.

Did the ndiswrapper gui from the control panel, not work for you?
The reason I ask is that using that gui creates a myndiswrapper.sh script in /opt that contains all the input required for a particular card. Then you can easily add to /opt/bootlocal.sh to achieve automatic bootup and connection. It has been tested and known to work with some Microsoft wireless cards.

Posted by andrei_r on Dec. 07 2005,19:22
Thanks, roberts!

I did not use the ndiswrapper gui tool (prefer CLI :) ). I've tried it now and it works just fine - it generated the /opt/myndis.sh script.

I guess the "correct DSL way" is to use ndiswrapper gui and source myndis.sh from bootlocal.sh, although I would argue that /usr/local/bin/ndiswrapper.sh does not need to load the .inf file all the time and can just check if the driver is present :). But I'd leave it to DSL developers :p.

Cudos to DSL developers for the great Linux distro!

Posted by Cahms26 on Jan. 13 2006,23:29
The following entry which I found @ < http://ndiswrapper.sourceforge.net/mediawi....module: >  might be helpful to you.

Running at Startup:
Create module alias: Once everything works fine you can write the correct modprobe settings to load ndiswrapper automatically when wlan0 interface is used, by running

ndiswrapper -m

Note that this doesn't automatically load ndiswrapper module at boot time. If you want the module to be loaded automatically at boot time, you should configure your module setup, which depends on the distrbution. Most distributions will load all modules listed in /etc/modules at boot time. Mandrake 10.x uses /etc/modprobe.preload. For them, you can add a line

ndiswrapper

in /etc/modules.

Once I added it all worked wonderfully.  Hope that's helpful.

John

Posted by RoGuE_StreaK on Jan. 14 2006,05:43
Was just writing a long note about how I still couldn't get my auto-install to work, when I figured out how to get it working.
Running frugal with a persistent /opt, myndis.sh is in /opt at boot.  I had a desktop icon set up to call this script, but it never worked.  Just figured out you need to be root, so link is now "sudo /opt/myndis.sh", and all is sweet.  Boot up, and if I want to connect to my wlan, just hit the desktop icon.

I guess if you have multiple places you visit, you could copy and rename myndis.sh, change the SSID and WEP, and have multiple desktop icons.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.