[owl-users] building the kernel (was: IPv6 Support in Owl)

From: Solar Designer <solar_at_private>
Date: Thu, 10 Dec 2009 21:33:46 +0300
On Thu, Dec 10, 2009 at 08:37:03PM +0300, gremlin_at_private wrote:
> gremlin_at_owl-test:~ > zcat /proc/config.gz | grep IPV6
> # CONFIG_IPV6 is not set

I'm quite sure Simon had already rebuilt the kernel, yet it is OK to
have this topic discussed in here indeed.

> Rebuilding the kernel is a quite simple operation.
> First, prepare the build directory:
> 
> cd /usr/src

It is better to do "su - sources" instead.  Building a kernel does not
require root privileges.

> tar -xjf /mnt/cdrom/usr/src/kernel/linux-2.6.18.tar.bz2
> ln -sf linux-2.6.18 linux
> cd linux

You missed one step:

bzcat /mnt/cdrom/usr/src/kernel/patch-*.el*stab*-combined.bz2 | patch -p1

This is the RHEL+OpenVZ patch.

> zcat /mnt/cdrom/usr/src/kernel/linux-2.6.18-*.diff.gz | patch -p1
> zcat /proc/config.gz > .config

Alternatively, there's /mnt/cdrom/boot/config (assuming that an Owl CD
or ISO image is mounted under /mnt/cdrom).

> Now configure and build the kernel:
> 
> make menuconfig
> make

Right.  In practice, most people will want to build with something like:

nice -n 19 make -j2

or with a larger number in place of "2" to match or exceed the number of
CPU cores - for a faster build.

BTW, in our build environment, there's also the "make buildkernel"
target, but it assumes that the source files (the kernel tarball and two
patch files) are already in place (like they are on our CDs) and it will
use the config from the owl-cdrom package (our default config).  This is
what we use for building our default kernels.  "make iso" and "make
iso.gz" assume that a kernel was built in this way.

> Then install it:
> 
> cp arch/****/boot/bzImage /boot/linux-2.6.18-test
> 
> The "****" stands for your architecture name.

It is a good idea to install System.map under /boot as well.

> Configure bootloader (I did it once and always have "stable" and
> "experimental" kernels):
> 
> image=/boot/linux-2.6.18
> 	label=good
> 	root=/dev/sda1
> 	read-only
> 
> image=/boot/linux-2.6.18-test
> 	label=test
> 	root=/dev/sda1
> 	read-only
> 	append="panic=5"

The "root=/dev/sda1" and "read-only" settings may be moved to the global
level to avoid repeating them for each image.  Also, if "append" is
already used at the global level (e.g., to specify software RAIDs), then
the per-image sections will need to use "addappend" unless they want to
replace the global settings.

All of the above (starting with Gremlin's posting) may be turned into a
wiki page.

Alexander

-- 
To unsubscribe, e-mail owl-users-unsubscribe_at_private and reply
to the automated confirmation request that will be sent to you.
Received on Thu Dec 10 2009 - 10:33:46 PST

This archive was generated by hypermail 2.2.0 : Thu Dec 10 2009 - 10:34:17 PST