Kernel

Sources

Required packages installation:

apt-get install build-essential kernel-package libncurses5-dev initrd-tools

Get the desired Linux kernel source from http://www.kernel.org/pub/linux/kernel

Unpack the kernel sources in /usr/src, and (to follow conventions) create the symbolic link /usr/src/linux to it:

cd /usr/src
tar xjf linux-{version}.tar.bz2
ln -s linux-{version} linux

Patch

To apply a patch “linux.patch” to the linux sources:

cd /usr/src/linux
patch -p1 < /path_to/linux.patch

Configuration

cd /usr/src/linux
make menuconfig

In the menuconfig screen the first step, usually, is to load an existing working configuration file. The current kernel configuration is located in the /boot directory with the following name pattern:

/boot/config-{version}

Select Load an Alternate Configuration File and enter the location of the configuration file of your current kernel. The configuration of your current kernel will be loaded, and you can now browse through the menu and change the configuration to suit your needs. When you are finished, hit exit and select yes to save the new kernel configuration.

The kernel configuration will be saved in the file .config.

Compilation

cd /usr/src/linux
make-kpkg clean
make-kpkg --initrd kernel_image kernel_headers

  • –initrd perform any actions necessary for a kernel loaded using initrd
  • kernel_image produces a Debian package of the Linux kernel source image, and any modules configured in the kernel configuration file .config
  • kernel_headers This target produces a Debian package containing the header files included in the Linux kernel

Installation

cd ..
dpkg -i linux-image-{version}.deb
dpkg -i linux-headers-{version}.deb

Reboot the system and check the system information:

uname -a

linux/kernel.txt · Last modified: 2010/08/12 by emilmont
CC Attribution-Noncommercial-Share Alike 3.0 Unported
Valid CSS Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0