BuildYourOwnKernel

Differences between revisions 10 and 12 (spanning 2 versions)
Revision 10 as of 2010-06-13 01:06:21
Size: 657
Editor: pool-98-108-129-180
Comment:
Revision 12 as of 2010-07-14 17:30:38
Size: 2536
Editor: pool-173-50-146-9
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:

Line 3: Line 5:
The majority of users that are interested in building their own kernel are doing so because they
have installed Ubuntu on their system and they wish to make a small change to the kernel for
that system. In many cases the user just wants to make a kernel configuration change.
The majority of users that are interested in building their own kernel are
doing so because they have installed Ubuntu on their system and they wish to
make a small change to the kernel for that system. In many cases the user just
wants to make a kernel configuration change.
Line 7: Line 10:
The purpose of this page is to give that user a minimum amount of information for them to meet
the goal of making a simple change to the kernel, building it and installing their kernel. It
is not intended to be the definitive guide to doing Ubuntu kernel development.
The purpose of this page is to give that user a minimum amount of information
for them to meet the goal of making a simple change to the kernel, building it
and installing their kernel. It is not intended to be the definitive guide to
doing Ubuntu kernel development.
Line 11: Line 15:
<<Include(Kernel/Action/ObtainTheSource)>> == Obtaining the source for an Ubuntu release ==

There are a number of different ways of getting the kernel sources. The two
main ways will be documented here.

If you have installed a version of Ubuntu and you want to make changes to the
kernel that is installed on your system, use the '''apt-get''' method (described
below) to obtain the sources.

However, if you wish to get the most up to date sources for the Ubuntu release
you are running and make changes to that, use the '''git''' method (described
below) to obtain the sources.

=== apt-get ===

The source code which generated a specific binary package may be obtained using
the {{{apt-get source <package>}}} command. For example to obtain the source
for the currently running kernel you can use the command:

    {{{
apt-get source linux-image-$(uname -r)
}}}

=== git ===

All of the Ubuntu Kernel source is maintained under {{{git}}}. The source for
each release is maintained in its own git repository on {{{kernel.ubuntu.com}}}.
To obtain a local copy you can simply git clone the repository for the release
you are interested in as shown below.

    {{{
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-<release>.git
}}}

For example to obtain the maverick tree:

    {{{
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-maverick.git
}}}


== Building the kernel ==

Building the kernel is quite easy. Change your working directory to the root
of the kernel source tree and then type the following commands:

    {{{
fakeroot debian/rules clean
fakeroot debian/rules binary-generic
}}}

== See also ==

The above instructions provide a very simple recepie for obtaining the sources
and then building them. If you are going to be doing more kernel development
than simple configuration changes you may want to look at:

[[https://wiki.ubuntu.com/Kernel/Action/GitTheSource|Git the source]]

This page will describe how to easily build the kernel.

The majority of users that are interested in building their own kernel are doing so because they have installed Ubuntu on their system and they wish to make a small change to the kernel for that system. In many cases the user just wants to make a kernel configuration change.

The purpose of this page is to give that user a minimum amount of information for them to meet the goal of making a simple change to the kernel, building it and installing their kernel. It is not intended to be the definitive guide to doing Ubuntu kernel development.

Obtaining the source for an Ubuntu release

There are a number of different ways of getting the kernel sources. The two main ways will be documented here.

If you have installed a version of Ubuntu and you want to make changes to the kernel that is installed on your system, use the apt-get method (described below) to obtain the sources.

However, if you wish to get the most up to date sources for the Ubuntu release you are running and make changes to that, use the git method (described below) to obtain the sources.

apt-get

The source code which generated a specific binary package may be obtained using the apt-get source <package> command. For example to obtain the source for the currently running kernel you can use the command:

  • apt-get source linux-image-$(uname -r)

git

All of the Ubuntu Kernel source is maintained under git. The source for each release is maintained in its own git repository on kernel.ubuntu.com. To obtain a local copy you can simply git clone the repository for the release you are interested in as shown below.

  • git clone git://kernel.ubuntu.com/ubuntu/ubuntu-<release>.git

For example to obtain the maverick tree:

  • git clone git://kernel.ubuntu.com/ubuntu/ubuntu-maverick.git

Building the kernel

Building the kernel is quite easy. Change your working directory to the root of the kernel source tree and then type the following commands:

  • fakeroot debian/rules clean
    fakeroot debian/rules binary-generic

See also

The above instructions provide a very simple recepie for obtaining the sources and then building them. If you are going to be doing more kernel development than simple configuration changes you may want to look at:

Git the source

Kernel/BuildYourOwnKernel (last edited 2024-01-25 18:52:39 by mhcerri)