MAS kernel patch compilation

From MCEWiki
Revision as of 20:52, 21 April 2008 by 142.103.235.38 (talk)

This procedure is based on

http://www.howtoforge.com/kernel_compilation_ubuntu


Get linux sources

We use vanilla 2.6.15.7, vanilla, from kernel.org.

Get bigphys patch

Patch is available here:

http://e-mode.phas.ubc.ca/~mhasse/mce/bigphysarea-2.6.15.7.patch

Get kernel compilation packages

apt-get update
apt-get install kernel-package libncurses5-dev fakeroot wget bzip2

Make sure bash is your default shell

sudo rm /bin/sh
sudo ln -s /bin/bash /bin/sh

Uncompress and patch

tar xjf linux-2.6.18.1.tar.bz2
ln -s linux-2.6.18.1 linux
cd /usr/src/linux

bzip2 -dc /usr/src/patch-2.6.19-rc4.bz2 | patch -p1 --dry-run
bzip2 -dc /usr/src/patch-2.6.19-rc4.bz2 | patch -p1 

Configure and compile

cp /boot/config-`uname -r` ./.config
make menuconfig

In the kernel configuration menu, go to "Processor type and features" and make sure that "Big Physical Area" is on.

make-kpkg clean
sudo make-kpkg --initrd --append-to-version=-bigphys kernel_image kernel_headers

Ok, ok, actually I think you shouldn't have the --append-to-version, it's already in the patch.

(Can't use fakeroot in this last step, since the .deb are written to /usr/src.)

Binary kernel package installation

See MAS OS configuration .

The .deb's that come out of the compilation above are incomplete, be we install them anyway. They are missing arch/i386/Makefile.cpu, and Modules.symvers. They might be missing other things too, but MAS really misses those ones. These have been put into a patch; which must be applied at the end.


Patch creation

To generate a patch from a successful hack/patch/wobble-job, use, e.g.:

diff -urN linux-source-2.6.22 linux-source-2.6.22-bigphys > ~/bigphysarea-2.6.22-server.patch