Table of Contents

Building kernel deb with TuxOnIce support

This guide is now replaced by Building Kernel DEB packages.

This is an outline of how to build a TuxOnIce enabled kernel deb package using debian's deb packaging (instead of the kernel's own).

Variables: Example variable values below:

KVER = 2.6.32
REV = 3-amd64+toi
EPOCH = 2

From pristine (upstream) source

FIXME This is to be expanded, for the time being refer to the above instructions to fill the gaps

Source: http://kernel-handbook.alioth.debian.org/ch-common-tasks.html#s-kernel-org-package

With modern kernels it's very simple. Here the version will include the pathlevel (2.6.x.y instead of 2.6.x), and AFAIK you can change the package revision but not install different builds of the same 2.6.x.y version in parallel.

I'm not yet too used to this method so I might be missing something. FIXME I don't yet know if there's a standard way to create a headers deb.

$ wget http://kernel.org/pub/linux/kernel/v2.6/linux-$KVER.tar.bz2
$ tar jxvf linux-$KVER.tar.bz2 && cd linux-$KVER
(patches)
(make config)
$ fakeroot make KDEB_PKGVERSION=$KVER+$REV deb-pkg
(KDEB_PKGVERSION *must* start with a number)

Example:
With KVER=2.6.32.41 and REV=toi-1 this will produce packages linux-image-2.6.32.41_2.6.32.41+toi-1_amd64.deb and linux-firmware-image_2.6.32.41+toi-1_all.deb.
Where kernel package name is linux-image-2.6.32.41 and version 2.6.32.41+toi-1.

Kernel version ($ uname -r) will be 2.6.32.41, modules will go into /lib/modules/2.6.32.41.

Headers

FIXME This notes have not much hand-holding, don't mess with this unless you know what you're doing.

Debian's linux-headers packages (used to build out-of-tree modules) won't be created from a pristine kernel.

To have a viable homebrewed tree to build modules, clean the tree and remove unneeded files:

(Replace $YOURARCH with your architecture, x86_64 users should use x86)

 $ cd /usr/src/.../linux-source-$KVER
 $ make clean prepare # prepare is required for building out-of-tree modules
 $ mkdir /usr/src/linux-headers-$KVER+$REV
 $ tar -c --exclude '*.c' --exclude '*.o' --exclude '*.ko' arch/$YOURARCH include scripts Makefile .config Module.symvers | ( cd /usr/src/linux-headers-$KVER+$REV ; tar xv )

Note this self-baked tree contains much more cruft than a proper linux-headers package, but I'm unsure on what to remove.

You'll have to fix the /lib/modules/$KVER/build link unless you build the package in the correct path (/usr/src/linux-headers-$KVER+$REV).

Fix for Huge package/modules

Beware, if copying the official distribution's config, debugging symbols might be enabled (raising the kernel package to a few hundred megs!).

Quick way to re-configure it:

$ sed -i '/CONFIG_DEBUG_KERNEL/d' .config
1) Replace $KVER with the appropriate kernel version
2) Here my user is in the src group
3) , 8) Replace $REV with the value passed to make-kpkg in –append-to-version
4) From here on run as normal user
5) Accept defaults for any prompted option if you are unsure
6) replace $X with the debian revision (e.g. 2.6.32-3-amd64); replace $ARCH with architecture name (e.g. 2.6.32-3-amd64); replace $EPOCH with 2 to prevent automatic upgrades; replace $NCPUS with the number of CPUs/cores/threads to use for building
7) If on install it errors about missing /boot/bzLinux-$KVER, try adding kimage=vmlinuz to ~/.kernel-pkg.conf, and rebuild. Might be a temporary bug?