Ath9K Driver
This article describes the steps that a user has to follow in order to use ath9k driver with OMF enabled images in NITOS
- Users that are interested in compilation of ath9k driver on an already precompiled version of ubuntu that support modules for ath9k should go directly to STEP 3 and skip STEP 1 & 2.
- Users that are interested in compilation of a linux kernel to support the modules for the ath9k driver compilation are highly encouraged to read STEP 1 & 2.
Users are encouraged to use the ubuntu_nitos_commell_plain.ndz image based on Ubuntu Maverick 10.10 and OMF 5.3. NITOS also offers a precompiled version of ath9k driver under 2.6.35.13 headers on ubuntu_nitos_commell_ath9k_enabled.ndz file. Those binaries can be found under /var/lib/omf-images-5.3 directory in NITOS console server and can be only loaded to Commell featured nodes in the NITOS grid. For the yellow Orbit nodes you can use the following steps under baseline.ndz image.
STEP 1. Compilation of linux and creation of kernel for supporting the ath9k modules
Lets say that we have already reserved two nodes, node025 and node024. We will use node025 to compile a new kernel version for the modules that we want to enable while also create *.deb packages, and then we will use node024 to install the *.deb that we will provide us the new kernel and the new headers that we will use for the compilation of the compat-wireless. Of course we can use only node025 for the whole process , however, the resulting image will be too large because of the extra packages that we need for the compilation of the kernel.
@nitos:$~> t_reboot 24 25 pxe //reboot node via pxe
@nitos:$~> cd /var/lib/omf-images-5.3
@nitos:$/var/lib/omf-images-5.3> ls
@nitos:$/var/lib/omf-images-5.3> omf load -i ubuntu_nitos_commel_plain.ndz -t omf.nitos.node024,omf.nitos.node025 //load the image
@nitos:$~> ssh root@node025
root@node025:$~> route add default gw 10.0.1.200 //set gateway to access internet
root@node025:$~> apt-get update //update headers
root@node025:$~> apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge //install prerequisites
root@node025:$~> apt-get build-dep linux
root@node025:$~> apt-get install git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev
root@node025:$~>apt-get install kernel-package
root@node025:$~> sudo apt-get install linux-source // This will download on /usr/src/ dir the files linux-source-[version] and linux-source-[version].tar.bz2
root@node025:$~> mkdir src; cd src
root@node025:$~/src> tar -jxvf /usr/src/linux-source-[version].tar.bz2
root@node025:$~/src> cd linux-source-[version]
root@node025:$~/src/linux-source-[version]> cp -vi /boot/config-`uname -r` .config
root@node025:$~/src/linux-source-[version]> make menuconfig // enable modules
Linux Kernel Configuration
-*- Networking support --->
-*- Wireless --->
[M] cfg80211 - wireless configuration API
[*] nl80211 testmode command
[*] enable developer warnings
[*] cfg80211 regulatory debugging
[*] enable powersave by default
[*] cfg80211 DebugFS entries
[*] cfg80211 wireless extensions compatibility
[*] Wireless extensions sysfs files
[M] Common routines for IEEE802.11 drivers
[*] lib80211 debugging messages
[M] Generic IEEE 802.11 Networking Stack (mac80211)
Default rate control algorithm (Minstrel) --->
[*] Enable mac80211 mesh networking (pre-802.11s) support
-*- Enable LED triggers
[*] Export mac80211 internals in DebugFS
[*] Select mac80211 debugging features --->
Linux Kernel Configuration --->
Device Drivers --->
-*- Network Device Dupport --->
[*] Ethernet (10 or 100Mbit)
[*] EISA, VLB, PCI and on board controllers
[*] National Semiconductor DP8381x series PCI Ethernet support
[*] VIA Rhine support
[*] Ethernet (1000 Mbit) --->
[*] Intel(R) PRO/1000 Gigabit Ethernet support
[*] Realtek 8169 gigabit ethernet support
[*] Ethernet (10000 Mbit) --->
[*] Intel(R) PRO/10GbE support
[*] Wireless LAN
[M] Atheros Wireless Cards --->
[*] Atheros wireless debugging
[M] Atheros 5xxx wireless cards support
[*] Atheros 5xxx debugging
[M] Atheros 802.11n wireless cards support
[*] Atheros ath9k debugging
[M] Atheros HTC based wireless cards support
[*] Atheros ath9k_htc debugging
[M] Atheros AR9170 802.11n USB support
Note: The Ethernet drivers are being hooked as built in modules in order to support kernel networking availability on different hardware devices in Testbed during boot time.
root@node025:$~/src/linux-source-[version]> fakeroot make-kpkg --initrd --append-to-version=-my-new-kernel-atheros-enabled-[or some-string-of-yours-here] kernel-image kernel-headers // Compile it. This will be too long (about 2 hours)
root@node025:$~/src/linux-source-[version]> cd .. ; ls
root@node025:$~/src> linux-headers-2.6.35.13-my-new-kernel-atheros-enabled_2.6.35.13-my-new-kernel-atheros-enabled-10.00.Custom_i386.deb linux-source-2.6.35
linux-image-2.6.35.13-my-new-kernel-atheros-enabled_2.6.35.13-my-new-kernel-atheros-enabled-10.00.Custom_i386.deb // Of course yours could be different according to the nomenclature given
root@node025:$~/src> scp *.deb root@node024:~/ // copy .deb files to node024
STEP 2. Install the new kernel on the ubuntu_nitos_commell_plain.ndz image
node024 is already booted with ubuntu_nitos_commell_plain.ndz image
@nitos:~> ssh root@node024;
root@node024:~> route add default gw 10.0.1.200; apt-get update;
root@node024:~> ls // You should see the copied .deb files
root@node024:~> dpkg -i linux-image-2.6.35.13-my-new-kernel-atheros-enabled_2.6.35.13-my-new-kernel-atheros-enabled-10.00.Custom_i386.deb // install deb packages
root@node024:~> dpkg -i linux-headers-2.6.35.13-my-new-kernel-atheros-enabled_2.6.35.13-my-new-kernel-atheros-enabled-10.00.Custom_i386.deb // in /usr/src dir you will see the new linux-headers named linux-headers-[version]. In my case is linux-headers-2.6.35.13-my-new-kernel-atheros-enabled
root@node024:~> ls /usr/src/
root@node024:~> cd /boot
root@node024:/boot$ mkinitramfs -k -o initrd.img-2.6.35.13-my-new-kernel-atheros-enabled 2.6.35.13-my-new-kernel-atheros-enabled
root@node024:/boot$ update-grub2 // update grub entries to boot image with new kernel
root@node024:/boot$ reboot; // Now node024 will reboot and will load the new kernel. Then we can save this image for future use by using om save
@nitos:~> omf save -n omf.nitos.node024
Note. The information described above is for users that want to build extra modules or to try it independently. Because, This process takes too long on time users do not need to repeat it, however they encouraged to use the already precompiled version of ubuntu_images provided by NITOS.
Particularly, You can find a precompiled version named ubuntu_nitos_commell_ath9k_enabled.ndz under /var/lib/omf-images-5.3 directory
STEP 3. Compilation of ath9k driver and use of modules
In STEP 1 & 2 have completed a new kernel compilation and installation with enabled modules for atheros wireless cards. We can use that image that we have created in order to compile the compat-wirelless for ath9k driver or we can use the already precompiled binary image "ubuntu_nitos_commell_ah9k_enabled.ndz"
@nitos:$~> if you are continuing from STEP 2 & 3 you can ssh root@node024; otherwise t_reboot 24 pxe; omf load -i /var/lib/omf-images-5.3/ubuntu_nitos_commell_plain.ndz -t omf.nitos.node024; ssh root@node024;
root@node024:$~> route add default gw 10.0.1.200; apt-get update
root@node024:$~> wget http://www.orbit-lab.org/kernel/compat-wireless-2.6/compat-wireless-2.6.tar.bz2 //Download compat wireless
root@node024:$~> tar -jxvf compat-wireless-2.6.tar.bz2
root@node024:$~> cd compat-wireless-2011-06-01
root@node024:$ compat-wireless-2011-06-01> ./scripts/driver-select ath9k //select ath9k to compile
root@node024:$ compat-wireless-2011-06-01> make KLIB=/usr/src/linux-headers-2.6.35.13-my-new-kernel-atheros-enabled KLIB_BUILD=/usr/src/linux-headers-2.6.35.13-my-new-kernel-atheros-enabled //compile against the respective headers
root@node024:$ compat-wireless-2011-06-01> make KLIB=/usr/src/linux-headers-2.6.35.13-my-new-kernel-atheros-enabled KLIB_BUILD=/usr/src/linux-headers-2.6.35.13-my-new-kernel-atheros-enabled install-modules
or
root@node024:$ compat-wireless-2011-06-01> make KLIB=/usr/src/linux-headers-2.6.35.13-my-new-kernel-atheros-enabled KLIB_BUILD=/usr/src/linux-headers-2.6.35.13-my-new-kernel-atheros-enabled KMODPATH_ARG='INSTALL_MOD_PATH=~/my_ath9k_driver' install-modules //compile and install the modules in the "directory /my_ath9k_driver
root@node024:~>ls; // You will see my_ath9k_driver directory created, and containing the new modules. Now copy them to systems's library
root@node024:~> cp ~/my_ath9k_driver/lib/modules/2.6.35.13-my-new-kernel-atheros-enabled/update /lib/modules/2.6.35.13-my-new-kernel-atheros-enabled/
root@node024$:~>insmod /lib/modules/2.6.35.13-my-new-kernel-atheros-enabled/updates/compat/compat.ko //use of insmod for loading each module seperately
root@node025$:~>insmod /lib/modules/2.6.35-13-my-new-kernel-atheros-enabled/updates/net/wireless/cfg80211.ko
root@node024$:~>insmod /lib/modules/2.6.35.13-my-new-kernel-atheros-enabled/updates/net/mac80211/mac80211.ko
root@node024$:~>insmod /lib/modules/2.6.35.13-my-new-kernel-atheros-enabled/updates/drivers/net/wireless/ath/ath.ko
root@node024$:~>insmod /lib/modules/2.6.35.13-my-new-kernel-atheros-enabled/updates/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
root@node024$:~>insmod /lib/modules/2.6.35.13-my-new-kernel-atheros-enabled/updates/drivers/net/wireless/ath/ath9k/ath9k_common.ko
root@node024$:~>insmod /lib/modules/2.6.35.13-my-new-kernel-atheros-enabled/updates/drivers/net/wireless/ath/ath9k/ath9k.ko
root@node024$:~> iwconfig //Now we can use the configured interface(s)
root@node024$:~> exit
@nitos:~> omf save -n omf.nitos.node024 // when you finish, save the image for future use