Since my article on rolling a vanilla kernel on Kubuntu (HOWTO – Vanilla Kernel 188.8.131.52 on Gutsy Gibbon…) has gotten most of the visits lately, I thought I would report it updated for kernel 184.108.40.206, with a couple minor changes, and I included some VMware steps as well. Hopefully, this is a little easier to read…
- Download the latest full kernel (220.127.116.11 at the time of this writing).
- sudo -i
- apt-get install build-essential kernel-package (I did not get the linux-source package, because that is what was downloaded in step 1.)
- cd /usr/src
- mv (path/to/)linux-18.104.22.168.tar.bz ./
- tar xvfj linux-22.214.171.124.tar.bz
- rm -f linux (if it exists)
- ln -s linux-126.96.36.199 linux
- cd linux
- cp /boot/config-2.6.22-14-generic (or your latest config-2.6.2x.x file) .config (this step copies the current running kernel config into place for building the new kernel)
- make oldconfig – this steps you through all the changes from your current kernel version, and skips everything that has not changed.
- make menuconfig (you need to have ncurses packages installed for this to work) – I prefer this to make xconfig, for no good reason
- VMWARE MUST DO – General setup –> change from SLUB to SLAB – Choose SLAB allocator (SLAB).
- VMWARE MUST DO – Processor 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).
- OPTIONAL – Kernel hacking –> check Use 4Kb for kernel stacks instead of 8Kb. This is a performance setting.
- 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.
- 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-188.8.131.52.config, for example)
make-kpkg clean– refer to man make-kpkg to see what this does
make-kpkg kernel_image --initrd binary– 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
- cd .. (go up one directory to where the new files are after compiling is completed)
ln -s /lib/firmware/2.6.22-14-generic /lib/firmware/184.108.40.206(to preclude any firmware issues that might pop up)
dpkg -i linux-image-220.127.116.11*.deb linux-headers-18.104.22.168*.deb(installs the kernel and modules)
Before you reboot, look at /boot/grub/menu.1st. You should see two entries for the new 22.214.171.124 kernel there (one is a recovery entry). Next, 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:
- sudo -i
- vi /etc/X11/xorg.conf
- In Section “Device”, add in the line Driver “vesa” and comment out (#) the previous driver line.
- In Section “Modules”, comment out the line that says Load”glx”.
- 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. After you reboot and restore your video driver, follow these steps from Peter Velichkov’s Blog:
How-to Install Vmware Player / Workstation on 2.6.24 Kernel – Assuming you already have VMware Player/Workstation/Server loaded, follow from Step 5. Although it does not mention Server, these steps work for installing VMware Server as well. This article also has the link to vmware-any-any-update116.
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). I always keep the previous version available, and remove the older versions after a week or two of smooth computing.