[CentOS] Building a new 2.6 kernel

Thu Jul 20 01:15:30 UTC 2006
John Warren <jwarren at prudentrx.com>

> -----Original Message-----
> From: centos-bounces at centos.org 
> [mailto:centos-bounces at centos.org] On Behalf Of Jim Perrin
> Sent: Tuesday, July 11, 2006 4:58 PM
> To: CentOS mailing list
> Subject: Re: [CentOS] Building a new 2.6 kernel


> What you should do. (Rough steps, but close enough)
> Prerequirement http://www.rpm.org/hintskinks/buildtree/

Done, I setup the user buildcentos and created the tree under that users home

> There are loads of people saying 'do not build as root'. There's good
> reason for this, so either create a user to build as or use your own,
> so long as you're not building as root.
> 1. Get the kernel source rpm from the url above. and make sure you
> have all the deps installed.


> 2. cd to buildroot/SPECS, and do 'rpmbuild -bp kernel.spec'  This will
> create and patch the kernel tree.

> 3. Copy the buildroot/SOURCES/kernel-2.6.9-i686-smp.config to
> buildroot/BUILD/kernel/linux-version/.config


> 4. Configure your kernel how you see fit. make menuconfig etc.

Here is where I'm having problems. The make menuconfig fails:

[buildcentos at quark linux-2.6.9]$ pwd
[buildcentos at quark linux-2.6.9]$ ls -al
total 72
drwxrwxr-x  2 buildcentos buildcentos  4096 Jul 19 17:15 .
drwxrwxr-x  3 buildcentos buildcentos  4096 Jul 19 17:14 ..
-rw-rw-r--  1 buildcentos buildcentos 60982 Jul 19 17:18 .config
[buildcentos at quark linux-2.6.9]$ make menuconfig
make: *** No rule to make target `menuconfig'.  Stop.

At this point I'm stuck. I've done the menuconfig before using the other
procedure but no joy this time. I searched the entire directory tree but can
not find a makeconfig file.

> 5. Copy the .config back to 
> buildroot/SOURCES/kernel-2.6.9-i686-smp.config

> 6. run rpmbuild --target=i686 -bs buildroot/SPECS/kernel.spec

> 7. run rpmbuild --rebuild --target=i686 
> buildroot/SRPMS/kernel-version.src.rpm

> This will build a kernel of the same version and release with your new
> options. I'd recommend incrementing the release value defined in the
> line I mentioned earlier.
> These are rough steps, but should point you in the right direction.