[PLUG] RH 8.0 Kernel Compiling

Karl M. Hegbloom karlheg at pdxlinux.org
Tue Nov 26 02:46:12 UTC 2002


On Mon, 2002-11-25 at 15:55, Richard Steffens wrote:
> "Karl M. Hegbloom" wrote:
> 
> > When you install the Debian kernel-source package, it drops a .tar.bz of
> > the kernel into /usr/src.  That tarball opens up into
> > "kernel-source-<version>/", rather than into "linux/", so that you can
> > have the sources to several kernels installed without conflict.
> > 
> > I would assume that Red Hat does the similar.
> 
> Thanks, Karl. I was hoping to find that to be the case, too. However, in
> /usr/src/linux-2.4.18-14/README, under the section "INSTALLING the
> kernel:" it says:
> 
> ------------
> "If you install the full sources, put the kernel tarball in a directory
> where you have permissions (eg. your home directory) and unpack it..." 
> 
> "Do NOT use the /usr/src/linux area! This area has a usually incomplete)
> set of kernel headers that are used by the library header files. They
> should match the library, and not get messed up by whatever the
> kernel-du-jour happens to be."
> ------------

Oh, wow.  That's really way bogus.  The libc6-dev package ought to ship
the <linux/*> and <asm/*> headers and install them under /usr/include,
rather than symlinking to ones in /usr/src/linux.  (One more reason why
serious developers should not work fromn a Red Hat box. <grin/>)  There
might be some things to read regarding this issue in the debian-devel
mailing list archives, and perhaps also in the /doc/libc6-dev/ readme's
on www.pdxlinux.org.

It's also bogus that Linus ships the kernel sources tarred up so they
open to "linux/" like that.  I wonder how many times people have opened
up a new kernel tarball right over the top of the old, realizing too
late that they forgot to move the old one aside for safe keeping?  That
is why the Debian kernel-source tarballs are repacked so they open into
"kernel-source-<version>/" instead.

That also is somewhat bogus, in light of the potential to install
kernel's other than Linux!  It ought to be "linux-source-<version>", and
perhaps the "<version>" ought to include not only the upstream kernel
version, but also the "-N" Debian package "build" version number as
well.  This way, you could have "hurd-source-<version>" or
"freebsd-source-<version>", for example.

I build kernel's in "/usr/src", which is group owned and writeable by a
group called "ksrc", on my machine.  Actually, by default, on a freshly
installed Debian machine, "/usr/src" is group owned by "src".  Users in
that group have writes there.

I always use the "kernel-package" package's `make-kpkg' utility to build
my kernel and modules as a .deb, since the postinst script in the
resulting "kernel-image-...deb" takes care of ensuring that my initrd is
rebuilt, and that the boot loader is configured for the new kernel.

The "initrd-tools" setup on Debian is pretty good.  It lets you
customize what will end up in the initrd image.  The image is not
generated until after you install the kernel-image.  It's not shipped
inside the kernel-image, since that would eliminate the possiblity to
place custom software inside of it, and would make it need to be a lot
smarter about knowing what device is your "/", etc.  If you want to know
more, I suggest just grabbing the source to it.  (ask for an account on
drizzle.pdxlinux.org if you want access to a Debian box where you can
easily "apt-get source" to have a look.)

> I found kernel-2.4.18-14.src.rpm at the ftp.redhat site. What I don't
> know is if that is the full source, or if, when installed, that will
> simply replace the stuff in /usr/src that I already have.

You should be able to use "mc" (midnight commander) to look inside of
the .rpm package, to see what it will install and where.






More information about the PLUG mailing list