Saturday, January 3, 2009

Installing Ath5 Driver on Ubuntu

In this blog iam expailing the steps to install the Open source wireless lan driver Ath5 on Ubuntu.
I have used Ubuntu 8, linux kernel 2.6.26 with 1GB RAM and AMD Semaphrone to install. As a prerequisite you need to a running Ubuntu system that satisfies the system requirements for the driver.



Download the sources
1. Install git. git is a version control system and the source are placed in gits repository.
sudo apt-get install git-core.
2. Get the sources from the repository. You can find the sources at wireless-testing in your pwd.
git clone git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git



Build a customized kernel
1. Refer the to the file mentioned in the README of the kernel sources to check for the softwares required. And install/upgrade as required.
2. Configure the kernel using make menuconfig.
3. The ncurses-devel is not installed by default. If there is trouble in running make menuconfig.
Install the libraries and continue with step-2.
sudo apt-get install libncurses5-dev.
4. In the GUI enable Ath5K support as described in enable ath5K section of http://wireless.kernel.org/en/users/Drivers/ath5k.
5. Run make and make modules_install.
6. Note the kenel image's path in the logs and the modules get stored in /lib/modules/.
Note :-All the commmands need to be run as root.



Configure GRUB to load the new kernel.
1. Copy the new kernel created in the wireless-testing directory to /boot. Do not overwrite the old kernel. If there is a name conflict copy it as mylinux or any other.
2. Create a initrd file for your new kernel using mkinitrd or mkinitramfs with the kernel version of the new kernel.
3. Add an entry for the new kernel in /boot/grub/menu.lst file.
4. You can copy paste your existing kernel configuration and change
title, kernel and initrd.
5. Reboot Ubuntu and select your new kernel to boot.
6. Once booted modprobe Ath5k to verfy. Enjoy!!

Sample:
title Ubuntu 8.10, kernel 2.6.27-7-generic
root ()/ubuntu/disks
kernel /boot/vmlinuz-2.6.27-7-generic
root=UUID=F8B8EED2B8EE8E86 loop=/ubuntu/disks/root.disk ro
ROOTFLAGS=syncio quiet splash
initrd /boot/initrd.img-2.6.27-7-
generic

title Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
root ()/ubuntu/disks
kernel /boot/vmlinuz-2.6.27-7-generic
root=UUID=F8B8EED2B8EE8E86 loop=/ubuntu/disks/root.disk ro
ROOTFLAGS=syncio single
initrd /boot/initrd.img-2.6.27-7-generic

title Ubuntu 8.10, memtest86+
root ()/ubuntu/disks
kernel /boot/memtest86+.bin

title My Ubuntu 8.10, kernel 2.6
root ()/ubuntu/disks
kernel /boot/mylinux root=UUID=F8B8EED2B8EE8E86
loop=/ubuntu/disks/root.disk ro ROOTFLAGS=syncio quiet splash
initrd /boot/initrd.img-2.6.28-rc9-wl



TroubleShooting:
1. On booting the new kernel you get : "Error 13: Invalid or unsupported executable format".
[Reason] The location pointed to the kernel image in menu.lst is not valid executalbe.
Check if you have copied the correct file from wireless-testing directory.
2. On booting the new kernel you get: "kernel panic not syncing ----"
[Reason] the initrd is required check if you have missed in menu.lst
3. On booting the new kernel you get : "Coundln't open directory /lib/modules/".
[Reason] the initrd contains an incompatible intird. Build a new one with the new kernel version.
4. For any installation problem check the disk size. Use df command and confirm / contains free space.



References:
1. http://wireless.kernel.org/en/developers/Documentation/git-guide
2. http://wireless.kernel.org/en/users/Drivers/ath5k