Thursday, October 09, 2008

Compiling 2.6.27 RC9 Vanilla on Hardy - Ubuntu/Debian Way

This article is about compiling a Kernel on Ubuntu systems. It describes how to build a custom kernel using the latest unmodified kernel sources from www.kernel.org (Vanilla Kernel) so that you are independent from the kernels supplied by your distribution.

-rc kernel patches are generated from the base stable release.

For example: to create the 2.6.27-rc9 kernel, you must:

  • download 2.6.26 (not 2.6.26.x)
  • and then apply the 2.6.27-rc9 patch.

Yes, you want 2.6.26 not 2.6.27. Remember, that's an -rc kernel, as in, 2.6.27 doesn't exist yet. :)



seems tha the kernel you want is prepatch , choose B from this area "The latest prepatch for the stable Linux kernel tree is" also choose 2.6.27-rc9 the same area.

cd /usr/src
wget --continue http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.26.tar.bz2
tar jxvf linux-2.6.26.tar.bz2
get the patch
wget http://kernel.org/pub/linux/kernel/v2.6/testing/patch-2.6.27-rc9.bz2
bunzip2 patch-2.6.27-rc9.bz2
cd linux-2.6.26
patch -p1 < ../patch-2.6.27-rc9
cd ..
mv linux-2.6.26 linux-2.6.27-rc9
cd linux-2.6.27-rc9/
cp /boot/config-`uname -r` ./.config
make menuconfig or if you want to compile old config without questions make oldconfig
make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers cd ..
I had to disable the nvidia postinstall scripts

chmod -x /etc/kernel/postinst.d/nvidia-common

dpkg -i linux-image-2.7.27-* in my case
sudo dpkg -i linux-image-2.6.27-rc9-custom_2.6.27-rc9-custom-10.00.Custom_amd64.deb shutdown -r
now you can install the headers too from /usr/src/linux-headers-2.6.27*

If you want to build it Vanilla way without debian tools then consult this page http://kernelnewbies.org/KernelBuild

2 comments:

2wice said...

Nice Blog,
Might have to put you on my Opera speeddial.
Two nights of searches for a howto to compile 2.6.27 on hardy brought me here.
"fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers cd .."
This line is a bit misleading.
It is compiling now, maybe my webcam will work now.
Thanks

Popa Adrian Marius said...

blogger posting was broken on that post

now i created another one with 2.7.28
http://mapopa.blogspot.com/2008/12/compiling-2.html