Mike Gerwitz web developer and administrator of GNU/Linux systems, focusing on the development of online communities (e.g. MyCustomBB). Mike is also a freelance web developer and can be found on RentACoder, and is a strong supporter of free software.
Web & Software Developer
15 Oct
Some time ago, while using Gentoo, I modified the kernel to stop a wireless problem I had been having and forgot to make a post about it. Now, I’ve switched by to Ubuntu (didn’t have time to administrate Gentoo and compile everything, and I missed Ubuntu). Luckily, version 8.10 BETA was released just a few days earlier and I was able to upgrade, getting the 2.6.27 kernel (required so my computer wouldn’t randomly shut down (other computers may freeze instead) due to the drivers, while the net was in use).
For settings up RaLink drivers for your wireless device, please see a previous entry: RT61 / RT2×00 RaLink Linux Driver Installation
In many previous kernel versions, including 2.6.27, my wireless would randomly go down. I checked dmesg | tail and found that I received the following error:
[41884.647257] wlan0: authenticate with AP 00:15:e9:76:1a:ee
[41884.658208] wlan0: authenticated
[41884.658208] wlan0: associate with AP 00:15:e9:76:1a:ee
[41884.668257] wlan0: RX ReassocResp from 00:15:e9:76:1a:ee (capab=0×431 status=0 aid=5)
[41884.668257] wlan0: associated
[41892.844239] wlan0: no IPv6 routers present
[68822.729255] wlan0: No ProbeResp from current AP 00:15:e9:76:1a:ee - assume out of range
For more information, please see my posts in the following bug report:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/200500
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/200500/comments/35
Within the bug report, a link was referenced to modify the kernel, increasing the amount of time to wait for a response, so it doesn’t assume it’s out of range and disconnect. The problem is - the file to edit didn’t exist anymore in 2.6.27:
First, you must obtain your kernel source. In gentoo, emerge the vanilla or gentoo sources. In Ubuntu, run the following commands (taken and modified from https://help.ubuntu.com/community/Kernel/Compile):
$ su
(Enter root password - if it's not set, run "sudo su" instead
$ apt-get install linux-source
$ cd /usr/src
$ tar xjvf /usr/src/linux-source-*.tar.bz2
$ cd linux-source-*
$ vi ./net/mac80211/mlme.c #or use your favorite text editor
In the file mlme.c, find the following line:
#define IEEE80211_MONITORING_INTERVAL (2 * HZ)
Modify it so it looks like this (we’re changing the “2″ to “100″):
#define IEEE80211_MONITORING_INTERVAL (100 * HZ)
Save and close the file. Let’s get to building it. With Gentoo, you would simply run “make && make modules_install”, navigate to “arch/your_arch/boot”, find the image, and copy it to /boot. Then modify GRUB/Lilo accordingly. Since Gentoo users probably know what they’re doing, I’ll focus on Ubuntu, which I recently figured out how to do via the above wiki. Ubuntu does it oddly.
Using the commands in the wiki, I had some trouble. It was trying to build using the “xen” archeticture - definatly not what I have. I wanted amd64 (which is x86_64 in the eyes of the kernel). So, I added the –arch option to the below commands. Be sure to specify YOUR architecture (such as i386). Also note the –apend-to-version line. This will append text to the kernel version (which’ll show up in uname -r). Remove it if you don’t want anything. If you do, modify the text in the command.
Multi-core/multiple processors: If you have multiple processors or cores (such as dual-core), type the following command before continuing, replacing the number with 1 + number of processors/cores. This will increase the compiling speed (trust me, you want that) by utilizing all available processors/cores. If you’re busy doing something else, you may wish not to set it, so your computer doesn’t slow down too much.
export CONCURRENCY_LEVEL=3
$ cp -vi /boot/config-`uname -r` .config #copy current configuration to use when building kernel
$ make-kpkg --arch=amd64 clean
$ fakeroot make-kpkg --arch=amd64 --initrd --append-to-version=-some-string-here kernel-image kernel-headers
Go grab something to eat, watch TV, throw pebbles at young children - something to pass the time. It’ll take a while.
After it is complete, in Ubuntu, this will have created *.deb files and placed them in the parent directory (in this case, /usr/src). Let’s install them!
$ echo vesafb | sudo tee -a /etc/initramfs-tools/modules
$ echo fbcon | sudo tee -a /etc/initramfs-tools/modules
$ dpkg -i linux-*.deb
After that, check out the following link for building the restricted modules:
https://help.ubuntu.com/community/CustomRestrictedModules
Then, of course, modify GRUB to boot the new image. Good luck!
Leave a reply