RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

Building Linux kernels the Debian way

Article Index
1. Prerequisites
2. Kernel build and customization
3. Installation of Customized Linux Kernel

This short article describes the quick and easy way on how to customize, build and install Linux kernel under Debian or Ubuntu Linux. First, we will install all prerequisites then download kernel source. Next step will be customization and as a last step we will create and install a Debian package with new Customized Linux kernel.

1. Prerequisites

Let's start with first step which is installation of all prerequisites:

# apt-get install bzip2  build-essential \ 
kernel-package libncurses5-dev

2. Kernel build and customization

Next step is to download kernel source code from kernel.org. Untar and cd inside the kernel's directory tree:

$ tar xvjf linux-2.6.34.tar.bz2
$ cd linux-2.6.34

At this point we will do the most important part of creating new customized kernel and building a Debian package. This is all done with a single make-kpkg command.

NOTE:

Optional step is to apply kernel patches before running a following command:

make-kpkg --rootcmd fakeroot --config menuconfig --initrd --us --uc kernel_image
  • --us do not sign source
  • --uc do not sign changelog
  • --initrd perform any actions necessary for a kernel loaded using initrd
  • -- rootcmd fakeroot command that provides a means of gaining super user access
  • --config menuconfig will use menuconfig as a configuration tool where default is oldconfig

Please note that you can choose different configuration tool instead of menuconfig. For example, if you would like to use xconfig then your command would look like the one below:

make-kpkg --rootcmd fakeroot --config xconfig --initrd --us --uc kernel_image

You have to make sure that all prerequisites for xconfig are installed.
If you already have your .xconfig  Kernel configuration file ready ( for example the one delivered with your current kernel installation which can be found in /boot/config-<kernel-version> ) than simply copy it into kernel directory tree  as .config and execute:

make-kpkg --rootcmd fakeroot  --initrd --us --uc kernel_image

NOTE: If you get a following error message:

echo "The UTS Release version in include/linux/version.h"; echo "         
\"\" "; echo "does not match current version:"; echo "        
\"2.6.34\" "; echo "Please correct this."; exit 2
The UTS Release version in include/linux/version.h
           ""
does not match current version:
           "2.6.34"
Please correct this.
make[1]: *** [debian/stamp/install/linux-image-2.6.34] Error 2
make[1]: Leaving directory `/home/lilo/temp/linux-2.6.34'
make: *** [kernel_image] Error 2

Use a following command to fix this problem and re-run make-kpkg command:

$ cp include/generated/utsrelease.h include/linux/

3. Installation of Customized Linux Kernel

You new customized Linux kernel is now ready to be installed in form of Debian package.

$ cd ..
# dpkg -i linux-image-2.6.34_2.6.34-10.00.Custom_i386.deb

Now you are ready to reboot into new kernel. Good luck !

Share this linux post:

Submit Building Linux kernels the Debian way in Delicious Submit Building Linux kernels the Debian way in Digg Submit Building Linux kernels the Debian way in FaceBook Submit Building Linux kernels the Debian way in Google Bookmarks Submit Building Linux kernels the Debian way in Stumbleupon Submit Building Linux kernels the Debian way in Technorati Submit Building Linux kernels the Debian way in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download