Difference between revisions of "MAS kernel patch compilation"
(→Ubuntu 8.04) |
(→Ubuntu 8.04) |
||
Line 69: | Line 69: | ||
From fresh 8.04 install: | From fresh 8.04 install: | ||
sudo apt-get update | sudo apt-get update | ||
− | sudo apt-get install build-essential subversion kernel-package linux-kernel-source | + | sudo apt-get install build-essential subversion kernel-package linux-kernel-source libncurses5-dev |
The linux-kernel-source package should put an archive in /usr/src, e.g. linux-source-2.6.24.tar.bz2. Extract it: | The linux-kernel-source package should put an archive in /usr/src, e.g. linux-source-2.6.24.tar.bz2. Extract it: | ||
Line 75: | Line 75: | ||
sudo tar -xjf linux-source-2.6.24.tar.bz2 | sudo tar -xjf linux-source-2.6.24.tar.bz2 | ||
− | Get the bigphys patch for 2.6.24: | + | Get the bigphys patch for 2.6.24, and apply it to the source tree: |
+ | cd ~/install | ||
+ | wget http://cmbr.phas.ubc.ca/~mhasse/mce/bigphysarea-2.6.24.patch | ||
+ | cd /usr/src/linux-source-2.6.24 | ||
+ | patch -p1 --dry-run < ~/install/bigphysarea-2.6.24.patch | ||
+ | sudo patch -p1 < ~/install/bigphysarea-2.6.24.patch | ||
+ | |||
+ | The patch is most likely to fail on the file 'Makefile'. This is probably minor. Simply open the Makefile in an editor and change the 4th line from something like | ||
+ | EXTRAVERSION = .3 | ||
+ | to something like | ||
+ | EXTRAVERSION = .3-bigphys | ||
+ | |||
+ | Copy in your config file into the root of your source tree, and make menuconfig. | ||
+ | sudo cp /boot/config-2.6.24-16-generic config | ||
+ | sudo make menuconfig | ||
+ | |||
+ | Under "Processor Type and Features", turn "Big Physical Area (NEW)" to ON. Then exit, exit, save. | ||
+ | sudo make-kpkg --initrd kernel-image kernel-headers | ||
+ | |||
+ | == Blacklist snd_asihpi! == | ||
+ | |||
+ | The 8.04 kernel has a sound-card driver that lays claim to the Motorola DSP on the PCI card. We have to blacklist this module to prevent it from trying to configure the card as a sound card. Add the following to the bottom of /etc/modprobe.d/blacklist : | ||
+ | # Conflicts with Astro-cam PCI card!! | ||
+ | blacklist snd_asihpi |
Revision as of 19:45, 23 July 2008
This procedure is based on
http://www.howtoforge.com/kernel_compilation_ubuntu
Contents
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
For uncompressed patches (like the bigphysarea patch), just redirect the file to the patch program:
patch -p1 --dry-run < bigphysarea-2.6.22-server.patch patch -p1 < bigphysarea-2.6.22-server.patch
The first line (dry-run) will not make any changes to your source tree. If it says "fuzz" and "offset", that's fine. If you get errors, you have to go in by hand and figure out what's up. It's probably the line in the makefile that specifies the minor version of the kernel release.
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 kernel_image kernel_headers
(At one point there was a "--append-to-version=-bigphys" line, but we don't need that cause it's done in the patch already.)
(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
Bigphys kernel was successfully created for 8.04 x64. I don't know how to package it properly yet, so you just have to do it on each machine.
From fresh 8.04 install:
sudo apt-get update sudo apt-get install build-essential subversion kernel-package linux-kernel-source libncurses5-dev
The linux-kernel-source package should put an archive in /usr/src, e.g. linux-source-2.6.24.tar.bz2. Extract it:
cd /usr/src sudo tar -xjf linux-source-2.6.24.tar.bz2
Get the bigphys patch for 2.6.24, and apply it to the source tree:
cd ~/install wget http://cmbr.phas.ubc.ca/~mhasse/mce/bigphysarea-2.6.24.patch cd /usr/src/linux-source-2.6.24 patch -p1 --dry-run < ~/install/bigphysarea-2.6.24.patch sudo patch -p1 < ~/install/bigphysarea-2.6.24.patch
The patch is most likely to fail on the file 'Makefile'. This is probably minor. Simply open the Makefile in an editor and change the 4th line from something like
EXTRAVERSION = .3
to something like
EXTRAVERSION = .3-bigphys
Copy in your config file into the root of your source tree, and make menuconfig.
sudo cp /boot/config-2.6.24-16-generic config sudo make menuconfig
Under "Processor Type and Features", turn "Big Physical Area (NEW)" to ON. Then exit, exit, save.
sudo make-kpkg --initrd kernel-image kernel-headers
Blacklist snd_asihpi!
The 8.04 kernel has a sound-card driver that lays claim to the Motorola DSP on the PCI card. We have to blacklist this module to prevent it from trying to configure the card as a sound card. Add the following to the bottom of /etc/modprobe.d/blacklist :
# Conflicts with Astro-cam PCI card!! blacklist snd_asihpi