So you’d like to enjoy the new LZO compression support in the Linux kernel? It should ensure a decompression boost: BTW, there are some aspects to pay attention to compile Vanilla sources on Ubuntu.
First of all, even if Karmic Koala still uses mawk by default, you must install gawk instead. Of course, you can’t make use of devtmpfs although it’s supported too: Ubuntu starts with udev right now.
Don’t be scared: compiling the Ubuntu-way isn’t as difficult. Here’s how to resolve dependencies for the purpose:
$ sudo apt-get install fakeroot gawk lzop kernel-package libncurses5-dev
$ sudo apt-get remove --purge mawk
Be sure to remove mawk after installing gawk or your system will simply “die” — lzop is only required if you want to switch on LZO’s compression (that’s what I’m going to explain).
Download the full source of the latest kernel from the official archive and go on configuring: patches aren’t necessary at all (but you could ever use them).
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.33-rc5.tar.bz2
$ sudo mv linux-2.6.33-rc5.tar.bz2 /usr/src/
$ cd /usr/src/
$ sudo tar xjvf linux-2.6.33-rc5.tar.bz2
$ sudo ln -sf linux-2.6.33-rc5 linux
Choose whatever you want to configure the sources: I suggest you to make oldconfig before, skipping all the boring questions it should answer. Below is just an example.
$ cd linux/
$ sudo make oldconfig
$ sudo make menuconfig
In General setup → Kernel compression mode you could now select LZO (I selected it under Built-in initramfs compression mode too) and you’re done.
Warning: before to proceed you may solve a known bug to successfully create valid packages. Without a workaround the compilation will fail.
$ sudo make-kpkg debian
$ sudo gedit debian/ruleset/misc/version_vars.mk
You have to replace these strings:
UTS_RELEASE_HEADER=$(call doit,if [ -f include/linux/utsrelease.h ]; then \
echo include/linux/utsrelease.h; \
else \
echo include/linux/version.h; \
With these (around line 141):
UTS_RELEASE_HEADER=$(call doit,if [ -f include/generated/utsrelease.h ]; then \
echo include/generated/utsrelease.h; \
elif [ -f include/linux/utsrelease.h ]; then \
echo include/linux/utsrelease.h; \
else \
echo include/linux/version.h; \
So you’re ready to compile and install the kernel: I prefer to change the file debian/changelog too — because it’s impossible to append a custom revision now. It’s not mandatory.
$ sudo fakeroot make-kpkg --initrd kernel_headers kernel_image
$ cd ..
$ sudo dpkg -i *.deb
This will also create kernel headers. Remember to maintain a standard Ubuntu kernel installed if something goes wrong and reboot your system to test the new one.