HOWTO – Vanilla Kernel 2.6.23.1 on Gutsy Gibbon…


Well, I finally went ahead and rolled a custom kernel on Kubuntu 7.10. I was having performance issues with VMware-Server 1.0.4, and researching pointed at the tickless kernel and SLUB options used in the Ubuntu 2.6.22-14 kernel. I used Sean’s Blog extensively and tried both the easy way and then the harder way. The easy way is just rolling back to the 2.6.20 Ubuntu kernel with the proper files from the Ubuntu archives. This worked, but I wanted more.

The harder way really wasn’t that hard at all. I followed his steps and got the 2.6.22-9 Ubuntu kernel installed fine. Then I decided to try a vanilla kernel from www.kernel.org. Here is a summary of the steps I took on a different computer:

  1. Download the latest full kernel (2.6.23.1 at the time of this writing).
  2. sudo -i
  3. apt-get install build-essential kernel-package (I did not get the linux-source package, because that is what was downloaded in step 1.)
  4. cd /usr/src
  5. mv (path/to/)linux-2.6.23.1.tar.bz ./
  6. tar xvfj linux-2.6.23.1.tar.bz
  7. rm -f linux (if it exists)
  8. ln -s linux-2.6.23.1 linux
  9. cd linux
  10. cp /boot/config-2.6.22-14-generic .config (this step copies the current running kernel config into place for building the new kernel)
  11. make menuconfig (you need to have ncurses packages installed for this to work) – I prefer this to make xconfig, for no good reason
  12. MUST DOGeneral setup –> change from SLUB to SLAB – Choose SLAB allocator (SLAB).
  13. MUST DOProcessor type and features –> uncheck Tickless System (Dynamic Ticks). OPTIONAL performance settings I like – select the Processor family (mine is Opteron/Athlon64/Hammer/K8), set Preemption model to Preemptable kernel (Low Latency desktop), set Timer frequency (1000 Hz).
  14. OPTIONALKernel hacking –> check Use 4Kb for kernel stacks instead of 8Kb. This is a performance setting.
  15. OPTIONAL – Device Drivers –> Sound –> Advanced Linux Sound Architecture –> PCI Devices –> set Intel HD Audio to M (module) -this was in Sean’s Blog, and I did not get sound working until I set this. YMMV.
  16. Exit and save the new .config file – I also like to save a copy of this file under a descriptive name somewhere else as a backup (cp .config /home/gutsy-2.6.23.1-slab.config, for example)
  17. make-kpkg clean – refer to man make-kpkg to see what this does
  18. make-kpkg --append-to-version=-with-slab kernel_image --initrd binary (“-with-slab” is descriptive text only, so you can change it if you like, or leave it out entirely) – this step rolls up the old “make, make modules” steps into one, so it could take a while before it is finished, depending on how much horsepower your computer has
  19. cd .. (go up one directory to where the new files are after compiling is completed)
  20. dpkg -i linux-image-2.6.23.1*.deb linux-headers-2.6.23.1*.deb (installs the kernel and modules)
  21. ln -s /lib/firmware/2.6.22-14-generic /lib/firmware/2.6.23.1-with-slab (to preclude any firmware issues that might pop up)
  22. update-initramfs -u

Now, you might want to sanity check before rebooting, so have a look at /boot/grub/menu.1st. You should see two entries for the new 2.6.23.1 kernel there (one is a recovery entry). The default number to boot should be the non-recovery entry. The count starts with 0, so if you have two kernels installed, you will typically have five entries (last is memtest), so the count runs from 0 to 4. Your new kernel will likely be 2 in such case.

One more useful step before rebooting – you may want to set your video driver to vesa, otherwise you might just get a console login after rebooting instead of KDE, GNOME, etc. Most likely, you will have to reinstall your video driver (NVidia and ATI users), and it’s a heck of a lot easier to troubleshoot if you have console and GUI environments. To do this, just:

  1. sudo -i
  2. vi /etc/X11/xorg.conf
  3. In Section “Device”, add in the line Driver “vesa” and comment out (#) the previous driver line.
  4. In Section “Modules”, comment out the line that says Load”glx”.
  5. Write and quit (:wq), and you are set. Remember, this will get you basic, unaccelerated graphics, so you will want to restore your old driver after rebooting to the new kernel.

If you use VMWare, you will also have to reconfigure it to use the new kernel.
Upon verifying that your new kernel is in the grub boot menu and selected as the default, reboot. As long as you have not removed the old kernel, you can always boot back into it if the new kernel fails to boot for some reason (hit ESC when prompted at bootup to select a non-default kernel entry). If all is well, you should see the *buntu boot progress logo come up and shortly be in your chosen window session. I like that this process builds in the boot logo automagically – nice touch.

Have fun with your new vanilla customized kernel!

Advertisements

27 Responses

  1. Nice HowTo, but not working for me. The custom kernel panics, with the last lines saying

    /scripts/init/bottom
    Mounting /dev on /root/dev failed: invalid argument
    run-init: nuking initramfs contents: directory not empty

    Have you seen something like that, too? Google gives me a lot of hits, but no solution or hints.

    Greetings.

  2. Never seen it, and true enough, Google isn’t yielding much. Same goes for Yahoo. Looks like there is a bug report filed on it with Ubuntu, however.

    Could be the hardware you are using, I suppose. Boot back into your old kernel, and rerun the kernel build from scratch. Be sure you are upgrading from 2.6.22-14. Upgrading from older kernels (like 2.6.18) could cause problems due to config changes made between the versions. If so, you might want to upgrade carefully to intermediate versions first (2.6.20, 2.6.21, etc.), or install an Ubuntu kernel from a repository.

    Sorry – that’s all I got.

  3. Thanks !!! I will try your recipe.
    Did you notice some big improvements when using 2.6.23.1 and these options ? I bought a brand-new HP8710W & found the machine quite unresponsive sometimes.. sad to see no package update for these issues.
    Fedora 8 comes with 2.6.23 but I would prefer staying on Ubuntu if possible

  4. Stephane, I have not seen substantial performance improvements, and in fact benchmark tests at phoronix.com seem to support this. I mainly upgrade for better hardware support, stability and security fixes, etc.

    For unresponsiveness, I would use “top” or another process-monitor – maybe you have a service running you are unaware of after installing some packages – it happens. Often, that’s more to blame than a flaw in the kernel. If it was the kernel was at fault, they usually come out with a revision (.1, .2, .3, …) pretty quick.

    I have applied this method on two different computers (HP and home-built), with the same positive results, so it looks solid so far. Let me know how it works out. Good luck!

  5. Isn’t SLUB the new allocator with better performance? The older SLAB one is going to be phased out in the next 2.6.24 kernel I think.

  6. Thanks for this. I searched for “gutsy rtc lost interrupt vmware” and all sorts of variations, no one is having my problems… so I gave up and was going to compile a new kernel…. I searched for “custom kernel gutsy howto” and the first hit is this page. How ironic?

    I’m running VMware Workstation 6.0.1 and 6.0.2 on x86_64 Ubuntu Gutsy. My machine is a Intel Q6600 (quad). As soon as a start a vmware guest my kernel log (dmesg) starts filling up with “rtc: lost some interrupts at 512Hz.” And I guess your host has to have higher resolution than your guests, and my 32bit guests were trying to get 1024Hz.

    No problem on an older Centrino laptop, I’m guessing it’s a Intel x86_64 problem, bug, or misunderstood feature.

    Thanks…

  7. […] Viewed… HOWTO – Vanilla Kernel 2.6.23.1 on Gutsy Gibbon…HOWTO – VMWare-Server 1.04 and Kernel 2.6.23.1 on Gutsy…Extracting an MP3 From a YouTube Flash […]

  8. Glad it helped, serrs.

  9. […] Viewed… HOWTO – Vanilla Kernel 2.6.23.1 on Gutsy Gibbon…SCM SCR-331 USB Smartcard Reader – Firmware Upgrade HOWTO – VMWare-Server 1.04 and Kernel 2.6.23.1 […]

  10. Thanks for the HOWTO. used it to compile 2.6.23.9 on gutsy.

  11. Glad it helped.

  12. Used to compile 2.6.23.12 worked like a charm 😉

    I left kernel stacks alone and SLUB though

  13. There is a typo in step 20. It should be “dpkg” instead of “dkpg”. Else its an excellent help and load of thanks for that.

  14. Hahaha, rohit. I ALWAYS mistype that in the console (and get an error message, of course)! Thanks for correction, and glad it helped.

    Fir3Chi3f, happy it came in handy for you. I only messed with SLUB for better VMware stability, and stacks for overall system performance.

  15. it seems like using –append-to-version=-with-slab is not a good idea, since dpkg-deb doesn’t like this. (reporting error: “debian revision with-slab doesn’t contain any digits”)
    Using –append-to-version=-1-with-slab for example worked in my case.
    Besides, great howto, thanks 🙂

  16. Glad it worked, sse. I honestly did not have any such issue (no reporting error), but as long as it works….

  17. […] Viewed… HOWTO – Vanilla Kernel 2.6.23.1 on Gutsy Gibbon…HOWTO – VMWare-Server 1.04 and Kernel 2.6.23.1 on Gutsy…Kubuntu 7.10, Kernel 2.6.24.1, and VMware […]

  18. I like your how-to. I will try it tonight, however, there is a few more things i need to modify (mainly keyspans usb converter drivers). Since you did such a good job with that you think you could write one on also adding restricted modules? I mainly have Ubuntu on my laptop and I use the wireless all the time. New compile = no wireless. I just cant figure out the restricted modules stuff. Its confusing and from what I can tell incomplete as far as how-to’s go. If you can write one up I’d sure much appreciate it!

  19. Thanks, Shannon. I haven’t had to dig into the restricted drivers too much, since my wireless worked out of the box with Kubuntu 7.10, and I use the stock NVIDIA installer (so far, it installs without complaint on vanilla kernels not yet supported by Ubuntu). Envy and the restricted driver package want to see the Ubuntu kernel packages for these kernels, which I do not have.

    What wireless do you have? Have you tried searching for the tarball and just installing that way? It may surprise you how often that works…. Let me know; I’m interested.

  20. I just compiled a new kernel today. I’m having trouble editing the stuff I need to get my wireless up (worked out of the box with th install), as I can’t find the bloody config files. Dammit, so much easier to do in Gentoo >_<

  21. Use lspci to determine your wireless vendor/model, and ensure that the correct wireless module is selected (in make menuconfig) under the drivers section of the kernel. Or try selecting them all – the one used will be loaded and the rest ignored. You can always go back later and trim the fat, if you like.

    In rare occasions, you may have to find a driver tarball for your hardware if the kernel doesn’t have a module for it and manually compile it, or use ndiswrapper (need the Windows driver for the WLAN adapter) to get it working.

  22. Thanks for your guide, helped me get 2.6.27.7 kernel going on Gutsy 🙂

  23. Glad it helped, toolman. I have been thinking about doing some refresher posts with the newest kernel, NVidia, and VMware Server lately, but it sounds like the old post still works just fine.

  24. YAA Adding this to my bookmarks. Thank You

  25. This post is in reality the freshest on this valuable topic. I concur with your points of view and will hungrily look forward to your next updates. Just saying thanks will not just be sufficient, for the extraordinary lucidity in your writing. I will instantly grab your rss feed to stay in the loop of any updates. Wonderful work and good luck in your website promotion!

  26. Hello, just wanted to say, I enjoyed this blog post.

    It was helpful. Keep on posting!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: