[CentOS-devel] Building a custom 2.6.9 kernel

Fri Feb 3 17:47:51 UTC 2006
William L. Thomson Jr. <wlt at obsidian-studios.com>

Greetings all,

A little upset because of some very rude people in IRC, on freenode.net.
That accused me of trolling and made it so I can't say anything in the
channel. More on that later.

Here is the deal, I am in the process of installing Gentoo on a AMD64
server. I messed up and bought the wrong SATAII Raid card, Adaptec
142SA. Which only has binary drivers for RH, SuSE, and UL. 32bit and
64bit modules.

Now having tried all kinds of kernels. I started looking for RH kernel
sources. Which is basically what CentOS provides. I started with the


After messing with that for days, patches and all. I decided to give the
kernel-devel rpms a go. So I downloaded 


Used rpm2targz, and converted them into tarballs which I unpacked. I
then moved the sources from usr/lib/kernel, entered the kernel source
dir, configured and compiled fine. With the i686 version.

When I attempt to do the same with the x86_64 one I get 

wlt 2.6.9-22.EL # make bzImage ARCH=x86_64 V=1
if /usr/bin/env test ! /usr/src/2.6.9-22.EL -ef /usr/src/2.6.9-22.EL;
then \
/bin/sh /usr/src/2.6.9-22.EL/scripts/mkmakefile              \
    /usr/src/2.6.9-22.EL /usr/src/2.6.9-22.EL 2 6         \
    > /usr/src/2.6.9-22.EL/Makefile;                                 \
  CHK     include/linux/version.h
  CHK     include/asm-x86_64/offset.h
make -f scripts/Makefile.build obj=scripts/basic
make -f scripts/Makefile.build obj=scripts
make -f scripts/Makefile.build obj=scripts/mod
make -f scripts/Makefile.build obj=init
make[1]: *** No rule to make target `init/main.o', needed by
`init/built-in.o'.  Stop

Now I came across this posting 

And have heard from others that the preferred way to build RH kernels
now is to rebuild an rpm using the src rpm. Which I have never done, but
I have been making custom RH kernels since 6.2 or so. Always using the
kernel-devel package?

Now on IRC my main question was has anyone built a custom x86_64 kernel?
I believe the reason I was booted, because I asked the same person
(kbsingh) that question 3 times. Because they never answered, which
leads me to believe they have not. Instead they called me a troll and
made it so I can't say anything in the channel. Very rude and totally
unprofessional. I thought CentOS was a enterprise community distro.
Amazing to find that kind of attitude.

Furthermore they were questioning what I did with the kernel-devel to
build a custom kernel in the first place. Since they claimed it to be
only headers not a full source? So I provided links and etc.


Now I have been downloading all rpms from 

I really need to build a x86_64 kernel. I have a working
i686 one, links above. But the 

Seems to be missing stuff that is in the i686 one. Like if you do not
properly change dir name from 2.6.9-22.EL.x86_64 to 2.6.9-22.EL you
can't compile asm-offsets.

However that was not a problem with the i686 sources? The asm-offsets
file is provide in i686 kernel-dev rpm and src rpm. The missing x86_64
stuff is not in either kernel-dev or src rpms. Interesting enough, all
the missing stuff exists by default with Gentoo sources.

I am really trying to avoid rebuilding a rpm. That would require me to
install and setup a CentOS or RHEL box. Which seems a bit much just to
build a custom kernel. Considering the kernel will be used for another

Please anyone running CentOS with a custom x86_64 kernel, I would love
to hear the processes. Now reason I am posting to dev list and not
users, is it seems users are discouraged to build their own kernels as
opposed to developers. Who have to make the resulting rpms as it is.

Thoughts, comments, and things of a constructive nature are all greatly
appreciated. Hopefully I will not find the same attitude here as in the
irc channel.

That type of behavior would keep someone like my who does not run or use
CentOS, totally away from it. Gentoo people care less if I ask questions
about building a custom centos kernel for Gentoo. Not sure why CentOS
people would have a problem with my questions. Considering I am not
asking anything about Gentoo, or that aspect of it.

Just how to get a custom x86_64 kernel built using CentOS 2.6.9-22

Thanks a million.

William L. Thomson Jr.
Obsidian-Studios, Inc.