Search:  
Gentoo Wiki

NDISwrapper

Contents

Introduction

This method uses the Windows drivers and NDISwrapper. You may also wish to look into the native linux drivers available from the rt2x00 project - these are available in portage as the rt2x00-9999 package using the rt73usb USE flag or the rt2570 package.

NDIS drivers

During this installation we're going to be using, obviously net-wireless/ndiswrapper, but also the app-arch/cabextract package. The cabextract tool allows us to extract files from the Windows .cab archive format, which most driver installers use.

Let's start by emerging these tools.

Make sure that the usb USE flag is switched on for ndiswrapper. If it's not, we can add it either globally in make.conf, or specifically to the ndiswrapper package by first running: echo "net-wireless/ndiswrapper usb" >> /etc/portage/package.use

Run emerge -av ndiswrapper cabextract

For more information on the package.use file, see the USE flags section of the Gentoo Handbook.

Obtaining the driver

Manufacturers

Belkin

The Windows drivers are available from the Belkin Website: US Driver or European Driver (Make sure you select the right driver for your country)

Unpacking the driver using cabextract

To extract the drivers, run cabextract <filename> where <filename> is the Windows driver file you downloaded above.

Loading the driver

The next task is to have ndiswrapper extract and install the files it needs. <filename> should be the name of the .inf file you extracted above, for example rt2500.inf. To do this, run ndiswrapper -i <filename>

Check that the driver has loaded by asking ndiswrapper to list the installed drivers with: ndiswrapper -l

Load ndiswrapper now with: modprobe ndiswrapper

If you recieve an error similar to "FATAL:Module ndiswrapper not found", try the following:

depmod -a
modprobe ndiswrapper

If you run ifconfig -a at this point you should see the new wireless device, probably as wlan0. If you don't, run dmesg and see if any error messages have been issued.

Note that on most systems the new device should appear as wlan0. If it doesn't, you'll need to remember what value it is and replace wlan0 below with the actual value every time it occurs.

Setting up the network

Now we need to configure the Gentoo networking scripts. Edit /etc/conf.d/net and add wlan0, replacing the <essid> and <password> values with the correct values for your network:

File: /etc/conf.d/net
modules=("dhcpcd")
modules=("iwconfig")
key_<essid>="[1] s:<password> key [1] enc open"
preferred_aps=( "youressid" )
sleep_scan_wlan0="1"
sleep_associate_wlan0="25"
iface_wlan0=("dhcp")

Setup a symlink for net.wlan0 with: ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0

The reason a symlink is used instead of copying the script is because Portage isn't able to handle updating a number of network scripts the names of which can differ fairly widely. Instead a single script is used, net.lo and by creating symbolic links, every time this file is updated, so are all the symlinks.

To start wlan0 without rebooting run: /etc/init.d/net.wlan0 start

Starting the wireless device automatically on boot

If you want your wireless device to start automatically when your PC boots, we need to first add ndiswrapper to the list of modules to be loaded at boot time by running: echo "ndiswrapper" >> /etc/modules.autoload.d/kernel-2.6

And finally we need to add the network script to the default runlevel with: rc-update add net.wlan0 default

Troubleshooting

The first point of call is to check what your device is and that it's supported by ndiswrapper. To do this, run lsusb (from the usbutils pakage) and look up the entry in the list of cards that work with ndiswapper.

If you need further help, ask on the Gentoo forums or IRC. Please be prepared with the output of the following commands (put it all into a pastebin such as http://rafb.net/paste and go armed with the URL for IRC):

 emerge --info
 uname -a
 lsmod
 lsusb
 ifconfig -a
 cat /etc/conf.d/net

See also

Retrieved from "http://www.gentoo-wiki.info/NDISwrapper"

Last modified: Tue, 19 Aug 2008 05:01:00 +0000 Hits: 17,125