Edit 05.27.08 Updated for latest kernel 2.6.25.4
Edit 02.29.08 Added some tips, small revision.
Edit 01.28.08 Updated for latest kernel 2.6.24
Edit 10.12.07 Updated for latest 2.6.23-rt1 patch.
Added bootsplash patch.
Added downloadable pre-patched kernel source.
A big THANKS to hotlinkfiles.com for free file uploads and direct links.
linux-2.6.25.4-rt3.bz2
linux-2.6.25.4-rt3.md5sum
Execpt for the last step, (dpkg -i) there is no need to do any of this as root.
I prefer to create a simple build directory for all kernels something like KERNEL No need to do it in /usr/src since $USER cannot write there.
- Code: Select all
mkdir KERNEL
cd KERNEL
wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.25.4.tar.bz2
wget http://www.kernel.org/pub/linux/kernel/projects/rt/patch-2.6.25.4-rt3.bz2
wget http://fatcat.ftj.agh.edu.pl/~przyboro/other/bootsplash/bootsplash-3.1.6a-2.6.25.diff
unp linux-2.6.25.4.tar.bz2
mv linux-2.6.25.4 linux-2.6.25.4-rt3
cd linux-2.6.25.4-rt3
bzcat ../patch-2.6.25.4-rt3.bz2 |patch -p1
patch -p1<../bootsplash-3.1.6a-2.6.25.diff
Note the Makefile in your kernel source. It will automatically update the EXTRAVERSION string for you. In this case:
- Code: Select all
EXTRAVERSION = .4-rt3
This will be appended to your kernel name.
- Code: Select all
make menuconfig
OR if you wish to start with the same .config of your current kernel:
- Code: Select all
make oldconfig
Then run
- Code: Select all
make menuconfig
Enable Real-time preemption.
- Code: Select all
Processor type and features> Preemption Mode (Complete Preemption (Real-Time))
Set kernel timer frequency to 1000 HZ
- Code: Select all
Processor type and features>Timer frequency (1000 HZ)
Build a kernel the Debian way:
- Code: Select all
make-kpkg clean
time fakeroot make-kpkg --initrd -rev mz1 kernel_image kernel_headers
Your new kernel & headers now live in ../KERNEL Use dpkg -i to install.
- Code: Select all
$ dpkg -i ../linux-headers-*.deb ../linux-image-*.deb
*TIPS*
Dual core CPU?
Use paralell make processes:
- Code: Select all
export CONCURRENCY_LEVEL=2
Skip the patches.
You can just skip the realtime patch and/or the bootsplash patch(es) all together for a basic kernel build. No need to apply either patch.
Nvidia graphics driver:
You might want to disable Paravirtualization in make menuconfig. The Nvidia driver does not build against kernels with this enabled.
You can build the nvidia-kernel driver (or any other drivers like ndiswrapper or rfswitch) before you even boot into your new kernel if you prefer but it must be done as root. If you use sudo it might work w/ fakeroot. You must be in the same dir as your kernel source.
- Code: Select all
root@finn:/home/glenn/KERNEL#
m-a -t -k linux-2.6.25.4-rt3/ -l linux-2.6.25.4-rt3 a-b nvidia
m-a -t -k linux-2.6.25.4-rt3/ -l linux-2.6.25.4-rt3 a-b ndiswrapper
m-a -t -k linux-2.6.25.4-rt3/ -l linux-2.6.25.4-rt3 a-b rfswitch
OR just build them all at once:
- Code: Select all
m-a -t -k linux-2.6.25.4-rt3/ -l linux-2.6.25.4-rt3 a-b nvidia ndiswrapper rfswitch
Build nvidia driver after booting into your new kernel.
After booting your new kernel, log in as root on a VT and build Nvidia the Debian way via module assistant:
- Code: Select all
m-a a-i nvidia
Restart your login manager:
- Code: Select all
/etc/init.d/gdm restart
You don't need a link to /usr/src/linux.
When you build modules against this kernel your source will automatically be found. No need to link anything to /some/dir/linux. An exceprt from nvidia-kernel-source.buildlog.2.6.23-rt1
- Code: Select all
NVIDIA: calling KBUILD...
make CC=gcc-4.2 -C /lib/modules/2.6.23-rt1/source SUBDIRS=/usr/src/modules/nvidia-kernel/nv modules
make[3]: Entering directory `/home/glenn/Storage/KERNEL/linux-2.6.23-rt1'
Additionally, any debs you build against this kernel using module assistant will live in the same place as your kernel & header debs.
- Code: Select all
KERNEL# ls|grep .deb
linux-headers-2.6.25.4-rt3_mz1_amd64.deb
linux-image-2.6.25.4-rt3_mz1_amd64.deb
nvidia-kernel-2.6.25.4-rt3_169.12-3+mz1_amd64.deb
rfswitch-modules-2.6.25.4-rt3_1.3-1+mz1_amd64.deb
Remove a patch. For example, the bootsplash patch:
- Code: Select all
patch -p1 -R <../bootsplash-3.1.6a-2.6.25.diff
Run make menuconfig after make oldconfig to fine tune, confirm and/or remove items you do not need. If you really want to slim down your kernel be careful w/ what you change. Make small changes and be prepared to build more than 1 kernel. Patience is a virtue!

Make an optional tarball of your patched linux source:
- Code: Select all
tar cjvf linux-2.6.25.4-rt3.bz2 linux-2.6.25.4-rt3
OR
You can make a .deb of your kernel source for easy portability
- Code: Select all
fakeroot make-kpkg -rev mz1 kernel_source
Alternatively, the make-kpkg target kernel_source can be added to the initial make-kpkg command.
- Code: Select all
fakeroot make-kpkg --initrd -rev mz1 kernel_image kernel_headers kernel_source
All done
- Code: Select all
$ uname -r
Linux hestviken 2.6.25.4-rt3