[CentOS-devel] Building a custom 2.6.9 kernel

Jim Perrin jperrin at gmail.com
Fri Feb 3 19:12:07 UTC 2006

On 2/3/06, William L. Thomson Jr. <wlt at obsidian-studios.com> wrote:
> 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.

No. No more on that later. It was deserved. You failed to provide
proper documentation of what you were doing and on what system in
addition to not following the recommendations of the channel
moderators. Also, the irc channel is for centos support, not for
supporting custom kernels on gentoo.

> 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
> kernel-2.6.9-22.EL.src.rpm

Assuming you really want to continue with this monstrosity, this is
where you want to go, but there are literally 700 patches to the
rhel/centos kernel. You'll need these for the kernel to build
properly, at which point it will probably be incompatible with gentoo
because of rhel specific requirements or expectations.

> After messing with that for days, patches and all. I decided to give the
> kernel-devel rpms a go. So I downloaded
> kernel-devel-2.6.9-22.EL.i686.rpm
> kernel-devel-2.6.9-22.EL.x86_64.rpm

These are only the kernel headers. They won't help you.

> 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.

I really doubt this. The devel packages aren't all the source. It's
just what you need to build against the kernel, not to build a new

> 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;                                 \
> fi
>   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

Your gentoo build system isn't what the rhel kernel expects. This
isn't surprising.

> 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?

No. The kernel-devel package is new. It used to be kernel-source

> 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.

I keep logs of the channel activity. What you were asking is typical
of the trolls we get. You're not paying anything for the distribution,
and you're not RUNNING the distribution, you're building its kernel
outside of its environment. I fail to see a driving need for us to
offer help for that.

> 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.

We know what kernel-devel is. You can't build a kernel from it.

> http://dev.obsidian-studios.com/kernel-devel-2.6.9-22.EL.i686.rpm
> http://dev.obsidian-studios.com/kernel-devel-2.6.9-22.EL.i686.tar.gz
> http://dev.obsidian-studios.com/working-2.6.9-11.EL.tar.gz
> http://dev.obsidian-studios.com/2.6.9-11.EL.config.working
> Now I have been downloading all rpms from
> http://www.gtlib.gatech.edu/pub/centos/
> I really need to build a x86_64 kernel. I have a working
> i686 one, links above. But the
> kernel-devel-2.6.9-22.EL.x86_64.rpm

These are two seperate kernel versions. You can't expect to mix and
match between the two. has been updated for security
reasons. Running it means you'll be running a kernel with

> 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.
> http://lists.centos.org/pipermail/centos/2005-April/004499.html

Are you using the same build environment the kernel is expecting? Have
you applied all the patches. Are you using actual kernel source
instead of the -devel packages?

> 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.

Have you applied the patches. It's possible that the patches create
the additional files you need. or that somewhere through this
nightmare of a build process something failed silently or was

> 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
> distro.

You should really be seeking help from within the gentoo community
rather than trying to piece two drastically different distros
together. This will only end badly for you. If it's running on another
distro, why again should we assist your efforts?

> 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.

Our build process won't work for you. Our build environments are
different from yours. Seek your assistance in the proper channels

> 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.
The resistance you encountered via irc was warranted. Why should we
take on supporting other distros?

> 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.
Sure you are. You're asking how to build our kernel on gentoo. You're
not running our distro.
We don't have problems with questions that apply to centos. Yours
applies to gentoo. Asking a gentoo question in #centos is akin to
asking for a mcdonalds happy meal at a pizza shop.

> Just how to get a custom x86_64 kernel built using CentOS 2.6.9-22
> sources.
I doubt this will work for you. Honestly. Trade in your hardware for
something that works with your preferred distro instead of attempting
this travesty. It'll save your sanity.

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety''
Benjamin Franklin 1775

More information about the CentOS-devel mailing list