Monday, February 4, 2008

Upgrading from kernel 2.6.22.15 to 2.6.24

It's been a while I'm using Linux Slackware 12 with kernel 2.6.22.15. This was the most stable kernel version for my aging Compaq Presario W2718 laptop. It's also the one with most hardware features working as expected. Kernel 2.6.23 and its stable point releases (2.6.23.x) were not up to my expectation as they have problems in the sound drivers. I cannot get my laptop sound working reliably when using audacious, even though xine audio works just fine. I've upgraded my audacious to its latest version when using kernel 2.6.22.15 but it's still problematic and I found that quite a lot of people have the same problem with kernel 2.6.23.x releases. With the release of kernel 2.6.24 a few days ago, I have a chance to try upgrading my kernel once more. With a few hours testing as of now, it seems to be better than 2.6.22.15 that I use previously. Now, I have my Broadcom BCM4318 Wifi chip up and supposed to be working. I couldn't get it to work with the linux-wireless patch to kernel 2.6.22.15 -- Too bad I have no Wifi access point to test it against as of now :(. As for the Bluetooth, it seems to be working better than before.


To cut it short, here's how I upgraded from kernel 2.6.22.15 to 2.6.24:



  1. Download the needed patches from www.kernel.org or its ftp:

    • patch-2.6.22.15.bz2

    • patch-2.6.23.bz2

    • patch-2.6.24.bz2


  2. Decompress the patches:

    bzip2 -d -k [patch_file_name]



  3. Apply the patches to the kernel 2.6.22.15 source code by using the following commands in the root directory of the source code:

    patch -R -p1 < /path/to/patch/dir/patch-2.6.22.15
    patch -p1 < /path/to/patch/dir/patch-2.6.23
    patch -p1 < /path/to/patch/dir/patch-2.6.24

    Take a very close look that we are "reverse-patching" from 2.6.22.15 to 2.6.22 prior to "forward-patching" to kernel version 2.6.23. This is because the base kernel patch i.e., 2.6.x only applies to other 2.6.y kernel version. That's why you have to revert back to 2.6.22 before moving up to 2.6.23 and then to 2.6.24. Also note that the 2.6.x.y patches only applies to 2.6.x base kernel not to 2.6.x.w.

  4. Bake the new kernel

    make silentoldconfig
    make -j4

    Because I compiled on a faster machine, I do the following to pack the result and
    scp the result back to my laptop:

    make tarbz2-pkg
    [..scp the packed result to my laptop..]



  5. Test the new kernel.Hmmm... yummy.. >:). I've carried-out preliminary test on the kernel. Here's the result:
    • The bluetooth support is working better than ever

    • The wireless LAN support is still problematic, iwlist can display available network but dhclient or dhcpcd always fail. I'm using ndiswrapper and the Windows version of the WLAN driver instead. It works flawlessly but with the caveat that I have to disable all of the Broadcom BCM43xx related drivers in the kernel modules. I'll talk about it in the next point.



  6. Replace the native Linux 2.6.24 Broadcom BCM43xx driver with ndiswrapper and the Broadcom BCM43xx Windows XP driver. Here's how to do it:

    • Disable the BCM43xx native Linux driver by adding it into blacklist driver. To do so, edit /etc/modprobe.d/blacklist, add the following lines:

      # because we are using ndiswrapper driver for the network card, default
      # Broadcom BCM43xx and its corresponding drivers should not be loaded
      blacklist b43
      blacklist bcm43xx
      blacklist ssb


    • Compile and install ndiswrapper.

    • Install the Windows driver. I'm using the Broadcom BCM4318 driver that comes with my Compaq Presario W2718. The driver file is bcmwl5.sys and driver installation file is bcmwl5.inf.Place these files in one directory and run:

      bash-3$ ndiswrapper -i bcmwl5.inf

      Once the driver installation has been completed. Reboot the machine and then configure the interface with iwconfig. You scan the available accesspoints with
      iwlist wlan0 scanning

      and then to connect to one of the access point, set the essid with
      iwconfig wlan0 essid the_access_point_name

      and then obtain the ipaddress with
      dhcpcd wlan0
      or
      dhclient wlan0

      That's it, you should be online by now ;-).



  7. At this point, I'm stripping out every unneeded things from the kernel.
    To do that, trace sysfs for every used modules in the huge kernel and note
    them. Then look for them during kernel configuration, make sure to enable them.
    I'll talk about it later.



That's all for now. I'll keep posting my test results and other kernel works.
Post a Comment

No comments: