May 3, 2008

Ubuntu: Kernel 2.6.25 on Hardy



Well, I've been playing and trying a new kernel stable release of 2.6.25 which is known to be compatible and will work on Ubuntu Hardy or any release. But as i'm using Hardy right now, so this tutorial will be on Hardy Heron environment. Well I strictly not recommend a beginner user to try this because this is not an official kernel for Hardy, so if anything goes wrong, you are the one who cause this(and me cuz writing this tutorial).

So I look on the www.kernel.org for a new stable release of 2.6.25 kernel and wonder if it can work with my new hardy heron. Here is the changes made in the new 2.6.25 kernel:
1. There are deeply invasive performance/scalability/latency fixes for CFS regressions (vs. 2.6.24) in the 2.6.25 tree. These fixes are too invasive to be ported to the 2.6.24 kernel without significant risk.

2. Many of the driver updates/new drivers in the kernel-ubuntu package are merged into upstream as of 2.6.25. (This is always true, but the smaller the delta against upstream the better on release day).

3. Fedora 9 is based on 2.6.25 which means that key RH kernel developers are aggressively working to get the feature and performance/scalability regressions vs. 2.6.18 & 22 fixed.

4. The kgdb patch will probably be merged at the start of the 2.6.26 cycle which means the delta vs. 2.6.25 kernel should be pretty manageable. This would be really valuable from an LTS ongoing perspective.

5. The RT patch will be better maintained (and smaller) against 2.6.25. (see #3)

6. Better virtualization and SELinux support (see #3).

Given the life-cycle of an LTS release (especially this one which will finally have a meaningful chance to enter the data center) these considerations are especially important.

Obviously 2.6.25 would have to be in addition to 2.6.24 for the Hardy 8.04 LTS release time-frame, but it does allow the aforementioned benefits to be propagated forward.

Taken from Ubuntu Brainstorm
So, if you are interested to try this new kernel on your ubuntu, please take note that if anything goes wrong, dont blame me or anyone as this is your decision to try this. By the way, take precautious step by not removing the standard hardy kernel which is 2.6.24 version to turn back if anything goes wrong.

Here we go~

  • First of all, make sure your system has everything that a system need in order to compile a kernel. Please sudo apt-get the dependencies:
sudo apt-get install build-essential bin86 kernel-package libqt3-headers libqt3-mt-dev wget libncurses5 libncurses5-dev
  • Then go into /usr/src directory
cd /usr/src
  • Make yourself a root:
sudo -s
  • Download the kernel from kernel.org and extract:
wget -c http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.25.tar.bz2 && tar -xvjf linux-2.6.25.tar.bz2
  • Remove the link to linux directory, and make a new link to the new kernel:
rm -rf linux && ln -s /usr/src/linux-2.6.25 linux && cd /usr/src/linux
  • NOTE: If you need to patch your kernel, please patch it now before we proceed to the next step.
  • Now import the current kernel config:
cp /boot/config-`uname -r` .config && make oldconfig
  • Configure the kernel (I will only cover my way of compiling, there is several ways to do this, but this is how i do it)
make menuconfig
  • Now it's time for us to build our kernel.
make-kpkg clean
  • And continue with:
make-kpkg --initrd --revision=386 kernel_image kernel_headers modules_image
  • Note that you can chage *386 with any name you like such as "k7" or "686"... Now It will take about 2-3 hours to compile the kernel, and maybe longer time for a slow cpu. Meanwhile waiting for the kernel to compile, you can enjoy watching movie or anything else.
-------------------------------------------------------------------------------------------------------
  • Now we need to install the .deb package to our Ubuntu:
cd .. && dpkg -i linux*2.6.25*.deb
  • And after installed, you need to reboot (if you are using nvidia, you will probably need to reinstall the driver again in order to make it work)
You can always revert back to the old kernel if you think the 2.6.25 is buggy by selecting your old kernel from the GRUB after POST. Now we will have a faster system after reboot. Hopefully you wont get any trouble when compiling the kernel. So enjoy using a new 2.6.25 kernel on Ubuntu Hardy Heron.

PS:- Some people will have trouble with no soud when first booting the kernel. You have to enable alsa on the 'make menuconfig' step and also enable Intel HDA Sound even if your card isnt Intel. This will make your sound work.


Thank you for your unbelievable support on Negative Zero - Permission to read and write blog for nearly 4 years. Don't forget to like Negative Zero on Facebook.
Blogirific.com Blog Directory





Post(s) you might like to read :

20 comments:

  1. Hi,

    Do you know what patches are applied to the Ubuntu kernel. I am assuming that Ubuntu doesn't ship with the stock kernel you get from kernel.org.

    Nirudha

    ReplyDelete
  2. nirudha,

    nope, as far as i know, the patches isnt a must.
    But if only you have trouble with the driver, then maybe there is some patches need to be done before compile the kernel. As far as i know, the tricky part is the "make xconfig" part only.
    You will need to really look at one by one to make sure non of your driver miss the compilation or else, some of your hardware wont work.

    ReplyDelete
  3. you could also try
    https://launchpad.net/~kernel-ppa/+archive
    or just add
    deb http://ppa.launchpad.net/kernel-ppa/ubuntu hardy main
    deb-src http://ppa.launchpad.net/kernel-ppa/ubuntu hardy main
    to your synaptic sources...

    acidicX

    ReplyDelete
  4. The kernel 2.6.25 package doesn't look to be available anymore on launchpad/kernel-ppa. Am I missing something here?

    ReplyDelete
  5. Yup,
    The kernel package isnt available for now on launchpad. So the only way to have this kernel working on your ubuntu is by self compile the kernel using the manual way like I've stated in this post.

    :)
    More over, the kernel will be much faster if it is compile on it's machine itself.

    ReplyDelete
  6. Hey man,

    Thanks for the tutorial! My homebrewed 2.6.25 kernel has been running only 30 minutes, but it *is* running! It is a little early for me to be yelling "woot" and "mission accomplished", but the freezing seems to be a lot less. I can tell because VirtualBox with WinXP guest was taking 3-6 reboots after as many crashes to get running. It is steady as can be, first time. And its cpu load is much lighter, around 10% instead of 99% all of the time. There is something just plain good about 2.6.25.

    One question though. Somehow I'm getting no sound. I'll google a bunch more, but if anyone has any hints I'd be grateful.

    ReplyDelete
  7. Oh, how ridiculous, I didn't see your note (in red) about configuring the ALSA.

    So I'm chugging through the compile again. No doubt it will work this time!

    Thank you so much, no freezes for about 5 hours.

    ReplyDelete
  8. Glad to hear that you manage to have self-compiled kernel working. Yeah sound have to do some adjustment. By the way, I still havent found on how to enable ATI driver on the kernel. But other than ATI Driver, I dont have any problem. All working fine.

    ReplyDelete
  9. I downloaded and installed the ATI driver as described here, and it worked.

    ReplyDelete
  10. About the revision, 383/686/k7, etc.

    Should there be something specific for smp, or do they all include it anyway?

    By the way, thanks for this tutorial, it really helped.

    ReplyDelete
  11. don q:

    smp? i dont think there should be a specific revision. But I'm not sure myself. I'll let you know if I found something about it.

    Great if this post help you out~

    ReplyDelete
  12. Howdy,
    Thanks for this informations. Really appreciated.
    Working just fine.

    ReplyDelete
  13. Hi, I followed this through, enabled ALSA and the intel HDA, but I still don't have sound. I m on a compaq presario laptop, about 5 years old, with a ac'97 card for audio (i think, i don't really, truly know)

    ReplyDelete
  14. also, lspci says it doesn't see the sound card at all

    ReplyDelete
  15. have you tried to do grep? copy and paste all the output for "lspci" here.. i think i might help.

    ReplyDelete
  16. Gunblade, here is my lspci (which now see does indeed list the ac97 card):

    00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)
    00:02.0 VGA compatible controller: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller (rev 03)
    00:02.1 Display controller: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller (rev 03)
    00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 04)
    00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 04)
    00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 04)
    00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 04)
    00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 04)
    00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 04)
    00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d4)
    00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 04)
    00:1e.3 Modem: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Modem Controller (rev 04)
    00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 04)
    00:1f.1 IDE interface: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 04)
    00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 04)
    06:05.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03)
    06:06.0 CardBus bridge: Texas Instruments PCI1510 PC card Cardbus Controller
    06:07.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

    thank you for your offer of help

    ReplyDelete
  17. or i am confusing ac97 with something else, i think i dunno, sorry for the double post.

    ReplyDelete
  18. sorry for the late late reply due to no connection to internet for a few months. Anyway, after i took a look at your lspci, i found out that you are using AC97 with rev04 . maybe that might help. try googling on the card name for ubuntu.

    ReplyDelete
  19. I have been fighting an issue for over a month now.
    I was told to install the kernel 2.25 over my kubuntu to get my pinnacle 800i card to work with sound.

    I did everything and now I get no video or sound on mythtv. I have been searching for this and have found no issues. could it be that the firmware now isn't loading? also I can't play DVD's, missing codec, but they are all installed. if I stop boot and run the 2.14 kernel I get DVD play back just fine.

    still trying to get TV card working as main goal though so any help would be appreciated.

    Let me know if you need additional info.

    thanks

    ReplyDelete