[CentOS] CentOS cutom kernel compilation

Tue May 8 17:20:06 UTC 2007
Jim Perrin <jperrin at gmail.com>

On 5/8/07, Brijesh Shukla <shukla.brijesh at gmail.com> wrote:
> Could any one let me know how can I compile & build CentOS kernel.
> In redhat Linux the kernel source ia available under /usr/src/linux

This was the case 4 years or so ago with the 2.4 kernel and redhat9.
Times have changed, and this is no longer standard for RHEL/fedora
systems with the 2.6 kernel.

> But in CentOS i am getting two directories named as
> Kernels and redhat under /usr/src
> the directory /usr/src/redhat is having again four subdirectory without any
> contents name as BUILD, RPMS, SPECS, SRPM

Correct. One is root's rpmbuild directory (which should not be used,
because we don't build as root.. RIGHT?) and the other is part of the
kernel-devel package which contains makefiles and headers sufficient
to build modules against the kernel.

> I dig the directory source 2.6.9-42.EL-i686, when I am executing make
> command after make menuconfig,
> I am getting error as "include/asm-i386/asm_offsets.h -- no such file or
> directory..

These directories don't contain source, just headers and makefiles.

>  I am not sure wheather i am doing the right operation?

You're not. Unless you REALLY need to build a custom kernel, I would
very much recommend against doing this. It's nearly always sufficient
to just build a module for what you need and move on from there.

> Could any body suggest me any How to or step by step guide for CentOS kernel
> compilation

See the wiki article in other replies to the thread.

During times of universal deceit, telling the truth becomes a revolutionary act.
George Orwell