[CentOS] Building a new 2.6 kernel

Fri Jul 21 22:12:49 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: Thursday, July 20, 2006 4:30 PM
> To: CentOS mailing list
> Subject: Re: [CentOS] Building a new 2.6 kernel
> 
> 
> > [buildcentos at quark SPECS]$ rpmbuild -bp kernel-2.6.spec
> > error: Architecture is not included: i386
> 
> Woops, my fault. That should be  rpmbuild -bp --target=i686 (or x86_64
> depending on what you're using) kernel-2.6.spec

No problem, at least I'm not going crazy. I kept thinking, "what am I doing
wrong" and "do I really want to post again, there going to think I stupid":) 

I'm now doing the build but I'm seeing many errors and warnings may I assume
that these are normal?

You also said something about keeping my own release numbers. I think the line
is:

%define release 34.0.2.EL

So I should change it to something like:

%define release 34.0.2.EL.PRX.01

I'll rebuild it again and make that change before I make it the default boot
kernel.

> 
> Cascading problem set. Redo everything again (sorry) with that command
> instead, and it should work. You'll also have to pass in the
> --target=i686  when you do the final rpmbuild --rebuild
> buildroot/SRPMS/kernel-foo.src.rpm also.


Speaking of making it the new boot kernel just how do I move the kernel so I
can select it during boot and still be able to return to the "standard" kernel
incase of problems? I think grub?

I'm writing all of this up so I can post it back over on the hylafax.org site
in their wiki. Should help the next person that has to do this. Sure wish that
the standard hylafax release would contain about 40 tty ports. They can't take
up much space and it would solve this problem. 

Better yet this should be a configurable parameter without having to rebuild
the kernel. Hey kernel developers, how about that?

This is fun, but it sure can drive one crazy until you get the hang of it.

Thanks again for all the help.

John


PS: Build just finished and got these errors. I was in the following directory
when I started the build. 

/home/buildcentos/rpmbuild/BUILD/kernel-2.6.9/linux-2.6.9

And used the command:

rpmbuild --rebuild --target=i686
/home/buildcentos/rpmbuild/SRPMS/kernel-2.6.9-34.0.2.EL.src.rpm

The errors I got.

shell-init: error retrieving current directory: getcwd: cannot access parent
directories: No such file or directory
Finding  Provides: /usr/lib/rpm/redhat/find-kmod-provides.sh
Requires(rpmlib): rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files
/var/tmp/kernel-2.6.9-34.0.2.EL-root
shell-init: error retrieving current directory: getcwd: cannot access parent
directories: No such file or directory
Wrote: /home/buildcentos/rpmbuild/RPMS/i686/kernel-2.6.9-34.0.2.EL.i686.rpm
Wrote:
/home/buildcentos/rpmbuild/RPMS/i686/kernel-devel-2.6.9-34.0.2.EL.i686.rpm
Wrote:
/home/buildcentos/rpmbuild/RPMS/i686/kernel-smp-2.6.9-34.0.2.EL.i686.rpm
Wrote:
/home/buildcentos/rpmbuild/RPMS/i686/kernel-smp-devel-2.6.9-34.0.2.EL.i686.rpm
Wrote:
/home/buildcentos/rpmbuild/RPMS/i686/kernel-hugemem-2.6.9-34.0.2.EL.i686.rpm
Wrote:
/home/buildcentos/rpmbuild/RPMS/i686/kernel-hugemem-devel-2.6.9-34.0.2.EL.i686
.rpm
Wrote:
/home/buildcentos/rpmbuild/RPMS/i686/kernel-debuginfo-2.6.9-34.0.2.EL.i686.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.23183
shell-init: error retrieving current directory: getcwd: cannot access parent
directories: No such file or directory
+ umask 022
+ cd /home/buildcentos/rpmbuild/BUILD
chdir: error retrieving current directory: getcwd: cannot access parent
directories: No such file or directory
+ cd kernel-2.6.9
+ rm -rf /var/tmp/kernel-2.6.9-34.0.2.EL-root
+ exit 0
Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.42450
shell-init: error retrieving current directory: getcwd: cannot access parent
directories: No such file or directory
+ umask 022
+ cd /home/buildcentos/rpmbuild/BUILD
chdir: error retrieving current directory: getcwd: cannot access parent
directories: No such file or directory
+ rm -rf kernel-2.6.9
+ exit 0

Are these normal or do I still have something wrong?


It also looks like all of the files and directories are deleted during the
build. That included the kernel.2.6.spec file. Not a problem but it just
caught me off guard when they disapeared. It looks like a new copy of the
sources with the changes I made was created in the SRPMS directory. Is that
correct? If so I guess I just install it and rebuild. Nice touch if that's
correct.