Skip navigation.

Building new kernel in Debian

,

Useful Links
Linux Kernel in a Nutshell
Kernel Build HOWTO
Debian-Kernel-Compile-Howto (Kernel 2.6)
Debian Linux Kernel Handbook
Howto: build Linux kernel module against installed kernel w/o full kernel source tree
SystemTap on Debian GNU/Linux
Creating custom kernels with Debian's kernel-package system

The Debian Way
$ apt-get install fakeroot, kernel-package, linux-source-2.6.16
$ tar xjf /usr/src/linux-source-2.6.16.tar.bz2
$ cd linux-source-2.6.16
$ make menuconfig (or xconfig)
$ make-kpkg clean

$ fakeroot make-kpkg --initrd --revision=bob.1.0 
                     kernel_image kernel_headers
or 
$ fakeroot make-kpkg --initrd --append-to-version=-bob-1.0 
                               kernel_image kernel_headers


$ make-kpkg modules_image
or
$ make-kpkg --append-to-version=-bob-1.0 modules_image
//keep giving me the version mismatch error, 
//better put modules_image option together with kernel_image 
//build everything in a single run makes your life much easier
//Another way: change include/linux/utsrelease.h to 
//force the version match,
//still see some warning, however, modules compiled just fine

$ dpkg -i ../linux-image-2.6.16_bob.1.0_i386.deb
$ dpkg -i (any module deb)
$ shutdown -r now

The Traditional Way
make menuconfig (or xconfig)
make
make modules_install (as root)
make install (as root)
update-initramfs -c -k [kernel version]  (for initrd.img)

Tips
Remember to recompile other modules that are not in debian package (outside /usr/src).
For example, Orinico USB driver.

Kernel Korner @ Linux JournalMyths, Lies, and Truths about the Linux kernel

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies