I'm interested in compiling a new kernel under Ubuntu 12.04 x86 64 bit.
I found this wiki page which is basically a mirror for this blog and there are a lot of steps (git, etc.) that appear useless to me.
With earlier releases/distros, I used to create a .config
file and modify a Makefile
if I needed to, then just run make
and it's done.
Is there is a simple way to do this under Ubuntu?
Best Answer
1. Use
apt-get source
to download the Ubuntu version of the kernelgives a folder that contains, for example:
The bolded diff includes all the Ubuntu/Debian customizations.
2. To build a stock kernel with your own
.config
, use the "old-fashioned" Debianmake-kpkg
methodThis is the alternate old-fashioned way described in the wiki:
If you are compiling a kernel for the first time:
Then
cd
into the source directory (here,linux-3.2.0
), and either runmake oldconfig
to create.config
file with your running kernel's configuration, or copy a third-part.config
to this directory.Depending on whether you want a text or graphical config, install:
(Text)
(Graphical)
And then run:
(Text)
(Graphical)
When done, just run:
where
N
is how many jobs to run in parallel (usually the number of CPUs you have), andmy-very-own-kernel
is a custom string to identify this build.When done, the kernel image and header files will be ready as debs in the parent directory; you can install them with
sudo dpkg -i
, which will also take care of adding GRUB entries, etc.