Go to project page or browse CVS tree.


KernelLabo

The Kernel Laboratory is a tool for preparing various kernel packages in one place.

See example laboratory and try to do:

for f in pentiumiii pentiumiii+smp; do
  for t in initrd source header; do
    MKINITRD=squashfs FLAVOUR=$f ./kernellabo redhat 2.4.21 $t
  done
done

...and get the RedHat enterprise kernel for Pentium III with and without SMP.

kernel-2.4.22pre1-redhat-20.el is available

The package is almost original RedHat kernel with a little differences in config file and patches. The most important differences are:

Add the following line to your sources.list file:

  deb http://kernellabo.alioth.debian.org/kernellabo/packages/redhat/ ./
  
and install the package with
  apt-get install kernel-image-2.4.22pre1-redhat-20.el-pentium4
  



NAME

kernellabo - Environment for preparing and building kernel packages


SYNOPSIS

kernellabo profile version [target]

kernellabo profile version modules modulename [kernelrevision]


DESCRIPTION

KernelLabo builds Debian package with kernel based on original archive and additional patches. Package version is ``2:${kernel_version}+${profile_name}+${current_date}''.


OPTIONS

profile
Name of kernel profile (i.e. hostname or project name).
version
Version of original kernel archive.
target
KernelLabo action to do.

Target

config
make config and exit
menuconfig
make menuconfig and exit (default)
oldconfig
make oldconfig and exit
check
make oldconfig without saving and exit
image
build kernel-image
initrd
build with initrd
header
build kernel headers
source
build source image
debian
build debian source package
all
build all packages
allrd
build all packages with initrd
modules
build modules package
clean
clean up after build

ENVIRONMENT

Environment variables can contain additional parameters for KernelLabo.

APPEND_TO_VERSION
The additional string included at the end of the kernel version number. The full kernel version number is ``$KERNEL_VERSION$ADDITIONAL_STRING-$PROFILE-$FLAVOUR'', i.e. ``2.4.20-pre2-ac1-desktop'' or ``2.4.18-rc1-ac2-redhat-18.8.0-i386-webserver-pentiumiii-up''.
FLAVOUR
The name of kernel ``flavour''. The flavour is a set of additional configuration options. This set are placed in a file located at ./flavours subdirectory. The name of flavour is included at the end of the kernel version number. If flavour is set then config targets won't save the kernel configuration to the configs directory.
MKINITRD
The command which generated initrd image, passed to mkinitrd utility. It can be also one of the following identificator of initrd filesystem: cramfs, ext2, ext3, minix, romfs, squashfs.
MAKE_KPKG_ARGS
The additional arguments for make-kpkg.

FLAVOURS

One of the features of KernelLabo is kernel flavours. This means that one configuration profile can be produced with a little changes, i.e. depends on CPU model (i386, pentium, pentiumiii-up, etc.). The additional changes are located at ./flavours subdirectory. To append the options from one of the flavours, set the FLAVOUR environment variable. You can use more than one flavour at once by using plus '+' character.

To produce the flavour file:

1. Call KernelLabo for menuconfig target:

 $ kernellabo generic 2.4.18-redhat-18.8.0 menuconfig

2. Save the default kernel configuration:

 Save Configuration to an Alternate File
 Enter a filename to which this configuration
 should be saved as an alternate.  Leave blank to
 abort.
 [../default                                        ]

3. Change configuration options, i.e. CPU model:

 Processor type and features  --->
 (Pentium-Pro/Celeron/Pentium-II) Processor family

4. Save new kernel configuraton:

 Save Configuration to an Alternate File
 Enter a filename to which this configuration
 should be saved as an alternate.  Leave blank to
 abort.
 [../686                                            ]

5. Exit the configuration menu (with saving the profile) or break with Ctrl-C (without saving the profile):

 ^C

6. Find differences between two configuration files, get the new options and save into flavours directory:

 diff -u tmp/default tmp/686 | grep ^+[^+] | sed 's/^+//' > flavours/686

7. Now you can use this flavour with KernelLabo:

 FLAVOUR=686 kernellabo test 2.4.18 image

If you want to use more than one flavour, use plus '+' sign:

 FLAVOUR=pentiumiii+preempt kernellabo test 2.4.18 image

EXAMPLES

The example session is following:

 $ mkdir ~/.kernellabo
 $ cd ~/.kernellabo
 $ mkdir configs kernels logs packages patches
 $ cd kernels
 $ wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.18.tar.gz
 $ cd ..
 $ mkdir patches/pre
 $ cd patches/pre
 $ wget http://www.kernel.org/pub/linux/kernel/v2.4/testing/patch-2.4.19-pre10.gz
 $ gunzip pre/patch-2.4.19-pre10.gz
 $ cd ../..
 $ mkdir configs/test
 $ touch configs/test/config-test-2.4.18
 $ echo pre/patch-2.4.19-pre10 > configs/test/patches-test-2.4.18
 $ kernellabo test 2.4.18 config
 $ FLAVOUR=pentiumiii kernellabo test 2.4.18 initrd
 $ sudo dpkg -i packages/test/2.4.18/kernel-image-2.4.19-pre10-test-pentiumiii_*.deb
 $ FLAVOUR=pentiumiii kernellabo test 2.4.18 modules modules/pcmcia-cs.tar.gz
 $ sudo dpkg -i packages/test/2.4.18/pcmcia-modules-2.4.19-pre10-test-pentiumiii_*.deb
 $ kernellabo test 2.4.18 clean

The example script which builds the same kernel source for each architectures:

 export CONCURRENCY_LEVEL=2
 nice -n 10 script -f -c '
     for f in pentiumiii pentiumiii+smp pentium4 pentium4+smp 686 386; do
         for t in initrd header source; do
             FLAVOUR=$f MKINITRD=squashfs kernellabo redhat 2.4.21 $t
         done
     done
 ' kernellabo.log

FILES

./configs/${profile}/config- ${profile}-${version}
Kernel configuration file. At most times this is the output of `make oldconfig' command. The file would be copied as kernel-${profile}-${version}.config file in the main source directory.
./configs/${profile}/patches- ${profile}-${version}
List of kernel patches. The patches are diff files usually but can be tar archives, shell scripts or plain files. The diff files are patches with -p1 option into the main source directory. The tar archives are unpacked into the main source directory. The shell scripts are executed in the main source directory. The plain files are copied into the main source directory.
./configs/${profile}/arch- ${profile}-${version}
The architecture of prepared kernel. This is used for crosscompiling process.
./configs/${profile}/revision- ${profile}-${version}
The additional string to be included to the version number. Could be usable for the kernel prepared based on vendors version, i.e. RedHat's version.
./configs/${profile}/changelog- ${profile}-${version}
The changelog.Debian file which overrides /usr/share/kernel-package/changelog file.
./kernels/linux-${version}.tar.gz
Original kernel source archive. Usually this is the original archive from kernel.org site.
./logs/${profile}/ ${profile}-${version}-*.log
Logs for last kernellabo session.
./packages/${profile}/ ${version}/kernel-*
Debian packages with kernel prepared by kernellabo.
./patches/*
Patches for kernel.
./flavours/*
Additional configuration options which will be included to the main configuration file. The files would be copied as kernel-${profile}-${version}-${flavour}.config file in the main source directory.
./tmp/*
Temporary files used by kernellabo, cleaned up at the start of kernellabo.

SEE ALSO

make-kpkg(1), kernel-pkg.conf(5), fakeroot(1)


AUTHOR

(c) 2000-2004 Piotr Roszatycki <dexter@debian.org>

All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, the latest version.