Easy MadWifi (Atheros WLAN) installation script
Latest news:
11th March 2009 - 0.9.8.4: A (hopefully) better --uninstall which reinstalls module packages.
10th March 2009 - 0.9.8.2: thanks to JayD239 the SVN URL is no longer broken. Please update :)
21st October 2008 - 0.9.8.1: madwifi.sh now automatically adds ath_pci to /etc/modules to make Ubuntu load it automatically at boot. It also removes ath_pci from autoload when --uninstalling.
15th October 2008 - 0.9.8: By requests I added an --uninstall option. I didn't test it much so let's hope it works ;)
21st July 2008 - 0.9.7: New option --info and some hardware checking.
16th July 2008 - For AR5007 (AR252x in lspci, found at least on Asus EEE) on 32-bit you will need a special tarball of madwifi-ng or madwifi-hal that can be downloaded from http://snapshots.madwifi-project.org/special/. 64-bit users should check this (ndiswrapper method) or this (madwifi-hal method) out.
--
The new open source ath5k and ath9k drivers included in Ubuntu 8.10 Intrepid Ibex and newer (should) replace MadWifi.
When upgrading to 8.10 or newer version of Ubuntu you might want to --uninstall MadWifi first to avoid conflicts with the new drivers. Since 8.10 Atheros WiFi should work straight out-of-the-box.
--
What is this script all about?
I have been working on an installation script for MadWifi, the best Atheros driver for Linux at the moment, that should work in Ubuntu, Debian and Fedora. I have been using it with my MacBook [AR5418] for some time and found it very useful.
Do I need this script? Will it solve my WiFi problems?
If you're in need of MadWifi, then this script should help you. Please note that MadWifi does not support any USB devices. To find out which cards are supported see http://madwifi-project.org/wiki/Compatibility.
Okay, so how do I use this script to install MadWifi?
Basically, if you have a working Internet connection (no worries if you don't, see below), all you need to do is download the script
Code:
wget http://kolmoskone.homelinux.org/~kaja/kamaa/madwifi.sh -O madwifi.sh
chmod +x madwifi.sh
(you can also upgrade your current madwifi.sh to the latest version with these commands)
And then run it with sudo
What is going to happen when I run the script?
This will install the build dependencies, fetch the latest source code from MadWifi SVN, compile and install the module. After it completes you should be able to connect to an AP with Ubuntu's NetworkManager icon in the notification area. 8) (it might take up to about a minute to pick up a network)
Is there anything I should do after installing?
If it works well enough, do sudo ./madwifi.sh --save to save the working version of sources. If an update breaks the sources you can then do sudo ./madwifi.sh --working to use the saved sources.
You might want to see --help every once in a while to help you remind how the script works.
How about kernel updates?
Note that you have to run the script after every kernel update! For a reinstall you can also use sudo ./madwifi.sh --reinstall which doesn't fetch a new version of MadWifi but uses the one last installed.
Installing without an Internet connection or using a source tarball (not fun)
SVN code does not always compile succesfully and not all of us can access a wired connection to the Internet. That's why I have included a possibility to use a source tarball from madwifi.org.
You need to put madwifi.sh, madwifi-VERSION.tar.gz (from http://madwifi-project.org/ or http://snapshots.madwifi-project.org/madwifi-trunk/) and the following Ubuntu packages (from http://packages.ubuntu.com/): make, gcc, libc6-dev, linux-headers-YOURKERNELVERSION on a removable media (CD, flash memory,...). VERSION is something like 0.9.4 or trunk-r3721-20080613 and can be seen in the tarball filename. You can easily find out YOURKERNELVERSION by running the uname -r command.
Tip: You can download the files to the hard drive in OS X or Windows (or whatever you might be dual booting) and then access the downloaded files in Ubuntu!
If you have a wired connection in Ubuntu the dependencies will be automatically installed, so you don't need to manually install the packages then, just download the tarball and run the script.
Once you have the files, insert the removable media and install the packages by double clicking on them in Nautilus or by running
Code:
sudo dpkg -i /path/to/package.deb
Then run the script like this:
Code:
chmod +x madwifi.sh
sudo ./madwifi.sh --tarball /path/to/madwifi-VERSION.tar.gz
Of course you need to substitute VERSION with the actual MadWifi version. After it completes you should be able to connect to an AP with Ubuntu's NetworkManager icon in the notification area. 8)
Note that you have to run the last command after every kernel update, so keep the source tarball at hand! You can also start using the SVN way now that you have a working connection.
Troubleshooting and different versions of MadWifi
If the driver isn't working, try another version of it (trunk, ng, hal or different revision)!
The script installs trunk by default.
Especially when having this output
Code:
ath_pci: HAL doesn't support MAC revision
it's most likely fixed by trying ng tarball or hal tarball.
There are alternatives to MadWifi called ath5k and ath9k. If the script doesn't work and you get some results by running for example
try running
Code:
sudo modprobe -r ath5k
before running the script. If it helps, blacklist ath5k. If it doesn't, try the same replacing ath5k with atk9k.
Problems?
If the script is broken or sucks in any way, please let me know.
When reporting problems please provide the following information:
* output of command sudo ./madwifi.sh --info
* are you using SVN or a (version?) snapshot
* any interesting lines in dmesg output that the above command does not show
* information on the hardware used, laptop or pci card make/model
Re: Easy MadWifi (Atheros WLAN) installation script
Wow, thanks man. You rock!! :guitar:
That worked like a charm. On the first try too.
Much appreciated.
Re: Easy MadWifi (Atheros WLAN) installation script
Is there a way to go back to the old drivers in case this doesn't work?
I need my wireless. It works fine at home (WPA-PSK) but at university which uses EAP I must use wpa_suplicant from the terminal and it locks up the whole system 1/10 times. So I don't want to make things worse just yet.
Would you recommend that I wait until some more people try it and bugs get fixed before I try it or just go for it?
(I have a USB wireless chip if it doesn't work out.)
Re: Easy MadWifi (Atheros WLAN) installation script
I'd say the script is very reliable at least if you go for the normal SVN installation.
I have had lock ups with the "stable" madwifi release but not with the SVN version. The only problem I've ever had with SVN was the source not compiling on x86_64 once. To be sure you can download a few snapshots from http://madwifi.org/ so at least some of them will work.
For a backup you can take the package that you used to install madwifi before.
Re: Easy MadWifi (Atheros WLAN) installation script
What good is a Linux distro if you don't break things? :)
I'll try it out once I have free time on Wednesday / Tuesday evening after my test.
I'll be sure to post the outcome.
Re: Easy MadWifi (Atheros WLAN) installation script
Needs a bit more error checking
I stopped it prematurely as it couldn't use svn but kept on going.
Code:
You seem to be running Debian/Ubuntu.
Checking build dependencies...
No packages found matching subversion.
Installing subversion...E: Some packages could not be authenticated
OK
...build dependencies OK.
Fetching sources from SVN..../madwifi.sh: line 159: svn: command not found
./madwifi.sh: line 160: cd: madwifi: No such file or directory
OK
Running pre-install scripts../madwifi.sh: line 186: cd: scripts: No such file or directory
../madwifi.sh: line 193: ./find-madwifi-modules.sh: No such file or directory
.OK
Building MadWifi.make: *** No rule to make target `clean'. Stop.
.make: *** No targets specified and no makefile found. Stop.
.OK
Installing MadWifi.make: *** No rule to make target `install'. Stop.
.
If any error happens at all it should quit. (I wish I knew bash scripting so I could actually help.)
Edit: I have installed subversion now. Luckily this stopped it because I forgot to backup.
Re: Easy MadWifi (Atheros WLAN) installation script
Yeah that's totally my bad. I was going to add a check after every command later but didn't think it was critical. Sorry :(
You can always hit ^C (Ctrl and C) to stop a script or a program from running. (or at least in most cases)
I'll start adding checks now.
Re: Easy MadWifi (Atheros WLAN) installation script
Quote:
Originally Posted by
Kajaste
Yeah that's totally my bad. I was going to add a check after every command later but didn't think it was critical. Sorry :(
You can always hit ^C (Ctrl and C) to stop a script or a program from running. (or at least in most cases)
I'll start adding checks now. If I don't have to go and help my parents with something it shouldn't take too long.
That's cool.
"sudo apt-get install subversion" made it work, and I have wireless back up, no problems. Hopefully it will work with the WPA EAP at uni without lockups.
You get a gold star (a Thanks)
Re: Easy MadWifi (Atheros WLAN) installation script
(Just to make sure everyone notices) I'm writing this reply to inform you of a new version with some cool new features such as saving and loading a working backup of the sources in case something goes wrong with svn update.
Re: Easy MadWifi (Atheros WLAN) installation script
YAY! no atheros modules have locked up my system yet.
(It's only the first day at uni with the new modules so too soon to tell if it's stable.)
Survives suspend too.