Difference between revisions of "MAS kernel patch compilation"

From MCEWiki
Line 57: Line 57:
 
To generate a patch from a successful hack/patch/wobble-job, use, e.g.:
 
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
 
  diff -urN linux-source-2.6.22 linux-source-2.6.22-bigphys > ~/bigphysarea-2.6.22-server.patch
 +
 +
 +
= Ubuntu 8.04 =
 +
 +
Note to self: always wait for version X.XX.01 before trying anything hard.  Ubuntu 8.04 packaged kernel wouldn't compile using make-kpkg, there were script errors of some kind.  Vanilla kernel did patch/compile/package/install/boot, but when building the MAS driver there was a weird Makefile missing and include/asm is linked to include/asm-i386 when it should probably be linked to include/asm-x86.  This helps a bit but the driver compile still chokes on a lot of *_32.h files.
 +
 +
Ultimate solution was to link the original source tree into /lib/modules/2.6.24.5-bigphys/build.  Also, adjust Makefile to use EXTRA_CFLAGS and not modify CFLAGS.

Revision as of 23:03, 28 April 2008

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


Ubuntu 8.04

Note to self: always wait for version X.XX.01 before trying anything hard. Ubuntu 8.04 packaged kernel wouldn't compile using make-kpkg, there were script errors of some kind. Vanilla kernel did patch/compile/package/install/boot, but when building the MAS driver there was a weird Makefile missing and include/asm is linked to include/asm-i386 when it should probably be linked to include/asm-x86. This helps a bit but the driver compile still chokes on a lot of *_32.h files.

Ultimate solution was to link the original source tree into /lib/modules/2.6.24.5-bigphys/build. Also, adjust Makefile to use EXTRA_CFLAGS and not modify CFLAGS.