KernelNewbies
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Kernel Hacking

  • Frontpage

  • Kernel Hacking

  • Kernel Documentation

  • Kernel Glossary

  • FAQ

  • Found a bug?

  • Kernel Changelog

  • Upstream Merge Guide

Projects

  • KernelJanitors

  • KernelMentors

  • KernelProjects

Community

  • Why a community?

  • Regional Kernelnewbies

  • Personal Pages

  • Upcoming Events

References

  • Mailing Lists

  • Related Sites

  • Programming Links

Wiki

  • Recent Changes

  • Site Editors

  • Side Bar

  • Tips for Editors

  • Hosted by WikiWall

Navigation

  • RecentChanges
  • FindPage
  • HelpContents
Revision 2 as of 2007-12-26 08:41:45
KernelNewbies:
  • KernelBuild

The following is a true idiot's guide - not for idiots, but written by an idiot - so please correct/extend/update as appropriate.

Download

First of all we need to download the kernel sources.

Get Git

Git is the source code control system used in the kernel. You need to download and install it.

Choose A Repository

The different kernel repositories are listed at [http://git.kernel.org/].

I've no idea how you choose which one to use...

Say, for example, we're using linux/kernel/git/linville/wireless-2.6.git.

Download the Repository

Create a new directory (which can be under your home directory), and cd to it.

Run git clone git://git.kernel.org/pub/scm/ + project path

which in our example would be:

git clone git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git

Compile

Configure the Kernel

You need to update the .config file in the root of your kernel tree. You can edit the text file directly, or more likely run "make xconfig" as thsi will give you the help text for each option as well.

Your running kernel should have a config.version file in /boot which may be a good reference for individual settings, but be wary of using it "as is" as the new kernel may have added new parameters.

If you are running on a system with a SATA interface disk, then the default kernel configuration probably won't build. You'll need to convert some device drivers from modules to being compiled into the kernel.

Build the Kernel

make && sudo make install

Configure the Boot System

You need to configure your boot system to make the new kernel one of the options. You probably don't want it to be the default at this stage.

Grub

The build should have installed the kernel in /boot and told you what it's called. If you're using grub, you now need to edit /boot/grub/menu.lst to add it to the list of possible kernels to boot from.

You need an entry something like: title My development kernel root /dev/sda1 kernel /boot/vmlinuz-2.6.24-rc3 root=/dev/sda1 ro

root=UUID options don't seem to work at this stage.

Test

Run the Kernel

Reboot, and select your development kernel from the list of kernels.

Useful Commands

dmesg will print out the kernel's ring buffer of trace messages.

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01