Ndiswrapper kernel oops :(

September 3, 2009 at 16:57 | Posted in Adventures | Leave a comment
Tags: , , , , , ,

My new 64-bit slackware is having internet/ndiswrapper problems. Namely, a kernel oops that kills ndiswrapper and in turn, my internet connection, as quickly as 1-10 minutes after bootup.

However, I read this guy seems to be using my current wireless adapter (WUSB600N) with success using open-source drivers! It seems to be the source inside the tarball, so here’s hoping it will compile correctly as 64-bit and work natively.

Update –

Well, I’ve compiled and configured the driver module, and I have good news and bad.

First, I’d like to note that the driver is hardly user-friendly, and requires manual editting of the makefiles before compiling. The regular `make` compile needs to be done as superuser, or else it fails (because it makes files in the root directory), and then the readme asks you to copy a .dat file to /etc/Wireless/RT-something (which means you have to make those directories first). I don’t see the point in copying that file over there yet, anyways, because I insert the module directly from the make’d source.

The good news, however, is that it works! I’m connected to the neighbor’s internet right now. Why, you ask, my neighbor’s internet? Because I kept getting timeouts on my home encrypted network (WEP as far as I remember). This (unsecure) one connected right away, however, which leads me to believe that I configured the makefile incorrectly before compiling. The readme was a little confusing. But, there were two options, so I suppose I’ll just go back and pick the other one, and recompile (hopefully with WEP support this time).

Static ip address via wireless in Slackware?

August 18, 2009 at 11:26 | Posted in Adventures | 5 Comments
Tags: , ,

Why is this so difficult?

I’ve tried configuring my /etc/rc.d/rc.wireless.conf like this:

# Generic example (decribe all possible settings)
*)
INFO=”Home”
ESSID=”WirelessHomeNet”
MODE=”auto”
CHANNEL=”9″
KEY=”[my encryption key here]“
;;
esac

I’ve editted my /etc/rc.d/rc.inet1.conf like this:

## Example config information for wlan0.  Uncomment the lines you need and fill
## in your info.  (You may not need all of these for your wireless network)
IFNAME[4]=”wlan0″
DHCP_IPADDR[4]=”192.168.0.33″ # I tried using regular IPADDR first to no avail
NETMASK[4]=”255.255.255.0″
USE_DHCP[4]=”no”
WLAN_ESSID[4]=WirelessHomeNet
WLAN_MODE[4]=Managed
WLAN_CHANNEL[4]=”9″
WLAN_KEY[4]=”[my key here]“

If I don’t run `modprobe ndiswrapper` on bootup, my wireless interface won’t show up, so I even added a line in /etc/rc.d/rc.inet1 to do it right before attempting to bring up any interfaces.

However, no matter where I place that line, the wlan0 interface doesn’t show up in ifconfig after bootup, even if I try running the command manually afterwards.

If I don’t put the line in any bootup script, and then do `modprobe ndiswrapper` manually and bring wlan0 up with ifconfig, and set it up with iwconfig, and run dhcpcd, though, it works fine (mostly). It also works if I just execute a handwritten script to do all that inside of /etc/rc.d/rc.local.

So, it’s become apparent that if I attempt to use rc.inet1 and rc.wireless to connect to the internet, it will fail entirely and prevent me from connecting.

What I need to know is:

  1. How to have the ndiswrapper module correctly load on bootup
  2. How to start the process of actually connecting to the router, similar to the dhcpcd command, but without using DHCP?
  3. What I am doing wrong in the /etc/rc.d/ configuration files

the all-encompassing network script

June 26, 2009 at 18:36 | Posted in Scripts | Leave a comment
Tags:

instead of having my computer attempt to connect to the internet whether it’s there or not, which causes it to lag as the dhcpcd times out, I wrote a handy dandy bash script :3

#!/bin/sh

echo “scanning for wireless connections…”

#displaying networks in range
iwlist wlan0 scan|grep ESSID

#assign variables
HOMECHECK=`iwlist wlan0 scan|grep WirelessHomeNet`
HOMENET=” ESSID:\”WirelessHomeNet\”"
LSCHECK=`iwlist wlan0 scan|grep linksys`
LSNET=” ESSID:\”linksys\”"

#check for home network
if [ $HOMECHECK == $HOMENET ]
then
echo “found home network, connecting…”
sh /root/homenet
ping -c 3 google.com
echo “done.”
else
echo “home network not found.”

#check for linksys network
if [ $LSCHECK == $LSNET ]
then
echo “found linksys network, connecting…”
sh /root/linksys
ping -c 3 google.com
echo “done.”
else
echo “linksys not found.”
fi

fi

and what it’s doing here, is:

  1. scans for networks in range and displays them to me, because I like seeing these things for myself
  2. scans for networks in range again, and greps it for the string that indicates that it sees my home network’s ESSID, WirelessHomeNet, and saves that as the variable HOMECHECK
  3. compares the variable HOMECHECK to my preset variable HOMENET (which contains the string that indicates my network is in range), and if they’re the same, it will:
    1. execute the script I wrote to connect to my home internet
    2. ping google to show me the connection is good

    but if they’re not the same, it will go about the same way, checking for a linksys connection, and then if it finds one,

    1. runs the script to connect to linksys
    2. pings google to verify the connection

Amazing, right? So in the end, if neither networks are available, it doesn’t run any of my network-connecting scripts, and therefore does not lag my computer at startup when this is run. :3

fucking ndiswrapper, always giving me shit.

November 27, 2008 at 20:09 | Posted in Adventures | 1 Comment
Tags: , , ,

root:~/ndiswrapper-1.53# make
make -C driver
make[1]: Entering directory `/root/ndiswrapper-1.53/driver’
Makefile:23: *** Kernel tree not found – please set KBUILD to configured kernel. Stop.
make[1]: Leaving directory `/root/ndiswrapper-1.53/driver’
make: *** [all] Error 2

from ~/ndiswrapper-1.53/driver/Makefile:

# By default, we try to compile the modules for the currently running
# kernel. But it’s the first approximation, as we will re-read the
# version from the kernel sources.
KVERS ?= $(shell uname -r)

# KBUILD is the path to the Linux kernel build tree. It is usually the
# same as the kernel source tree, except when the kernel was compiled in
# a separate directory.
KBUILD ?= $(shell readlink -f /lib/modules/$(KVERS)/build)

ifeq (,$(KBUILD))
$(error Kernel tree not found – please set KBUILD to configured kernel)
endif

I’ve tried setting KBUILD as /usr/src/linux-2.6.22.5, which is the directory of my kernel source, and /usr/src/linux which is the symbolic link to the former, and I’ve tried clearing the variable to nothing at all. None work.

uname -r seems to give Slack’s current running kernel version instead of LFS’, so after typing this, the next thing I will try again is rebooting and compiling from the actual LFS environment. Also, /lib/modules/linux-2.6.22.5/build points to /usr/src/linux-2.6.22.5.

edit; okay, that problem doesn’t exist when LFS is actually booted. Instead I get a warning about “kernel lacks wireless extensions” “wireless drivers will not work”, or something. I jotted it down as it scrolled by. So, it looks like I have to recompile the kernel with wireless extensions. I’m not sure what “wireless extensions” it’s looking for, but I can just modularize a few relevant-looking components and see if it suffices.

Broadcom WMIB-184GW + Ndiswrapper + Slackware

June 24, 2008 at 20:32 | Posted in Guides | 3 Comments
Tags: , , , ,

First, install ndiswrapper from source. I suggest the latest version from here. Untar it and do “make” and “sudo make install” from the command line. Or instead of using sudo just “su root” and do everything from there which would be easier because many of the upcoming commands require root privileges as well.

You’ll need the drivers for your chip which you can get here. You can either run this self-extracting exe under wine, which works well for me, or if you dual-boot Windows, run the program there. It will extract into the default folder “C:\cabs\BCM40100″, with another self-extracting exe, BCM_REL_4_100_15_5_WHQL.exe. Run that and it will extract by default to “C:\BCM_REL_4_100_15_5_WHQL”. Copy over the files bcmwl5.inf and bcmwl5.sys to your home folder (if you ran the programs under windows, just mount your windows partition under Slackware to copy them).

Now you can install your drivers under ndiswrapper with:

ndiswrapper -i ~/bcmwl5.inf

This should result in the command “ndiswrapper -l” displaying something similar to:

bcmwl5 : driver installed
device present

To disable the conflicting non-ndiswrapper drivers, edit /etc/modprobe.d/blacklist and add the lines:

blacklist b43
blacklist ssb

(bcm43xx should already be blacklisted in later versions of slackware, but make sure the line “blacklist bcm43xx” is there anyways, and if not, add it)

To configure ndiswrapper for usage on bootup, do:

ndiswrapper -ma
modprobe ndiswrapper

Slackware does not by default save your network settings, so what I did was add what I needed to get the network running to /etc/rc.d/rc.local. There was a /etc/rc.d/rc.wireless, but I found it simpler to do it this way. Here’s the example based on what I used:

ifconfig wlan0 up
iwconfig wlan0 essid "<your network name here>"
iwconfig wlan0 key <your encryption key here>
iwconfig wlan0 rate <optional - set wireless speed, ex: 54M>
iwconfig wlan0 channel <also optional - your channel here>
/sbin/dchpcd wlan0

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.

Follow

Get every new post delivered to your Inbox.