Tags:
create new tag
, view all tags

HOW-TO create the 2.6.29.4 kernel for OpenAirEmu on a Ubuntu 10.04

Based on :

  • Ubuntu 10.04 (The Jaunty Jackalope) Operating System, x86 version
  • Default GCC version (4.4.X)
All lines starting by "#" are bash commands that have to be typed in a shell terminal.

Introduction

If the ROOT user is not created yet, log in as another User who can be a SuperUser.

Start a terminal and type ->

# sudo su -
# sudo passwd root

Log out and log in as Root

Update your package repository source file :

# apt-get update 

Some tools are required in order to set up the kernel (You need to be connected to Internet)

# apt-get install sysv-rc-conf qt3-apps-dev build-essential kernel-package vim subversion libblas-dev libxml2 libxml2-dev libforms-bin libforms-dev libatlas-base-dev libatlas-headers 

I - Kernel source download

# cd /usr/src/

Get the 2.6.29.4 vanilla kernel source

# wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.4.tar.bz2

II - Kernel Preparation

# cd /usr/src
# tar xjvf linux-2.6.29.4.tar.bz2
# ln -s /usr/src/linux-2.6.29.4 /usr/src/linux
# cd /usr/src/linux 

III - Kernel Configuration

# cd /usr/src/linux

In order to retrieve your current kernel configuration : (If at this step, questions are asked give the answer by default)

# make oldconfig

Now we will edit kernel configuration and modify it the way we need :

# make xconfig 

Check that your kernel configuration is as follows :

  • General Setup
    • Kernel .config Support -> ENABLE
      • Enable access to .config through /proc/config.gz -> ENABLE
  • Networking Support
    • Networking options
      • Transformation user conf interface -> ENABLE
      • PF_KEY socket -> ENABLE
      • TCP/IP Networking
        • The IPv6 Protocol -> ENABLE recursively all features here
      • Network Packet Filtering Framework (Netfilter)
        • Tick everything here and everything recursively
Save and Quit

Edit the "Makefile" and update the "EXTRAVERSION" field

# vi /usr/src/linux/Makefile

Update the following field -> "EXTRAVERSION = .4.openairemu"

We also need to change the default stack alignment to 16 bytes. In arch/x86/Makefile change the line

# vi /usr/src/linux/arch/x86/Makefile

KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)

to

KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=4)

IV - Kernel Compilation

# cd /usr/src/linux 
# make && make modules_install && make install

(~1 hour) NOTE: The compilation time might be decreased by passing the flags -j4 like make -j4 for a quadcore machine, so that all cores are utilized. This might however cause compilation problems, in such a case ,take out the -j4 switch.

# mkinitramfs -o /boot/initrd.img-2.6.29.4.openairemu 2.6.29.4.openairemu
# update-grub 

If you want to be sure that your new kernel will be the default one

# vi /boot/grub/grub.cfg

Look for "default" number at the beginning of this file and memorize it
Check at the end of the file that your kernel entry matches this "default" number

The kernel entry should look almost like this:

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.29.4.openairemu' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set ffd270bf-dffc-4e17-86eb-XXXXXXXXXXXX
linux /boot/vmlinuz-2.6.29.4.openairemu root=UUID=ffd270bf-dffc-4e17-86eb-XXXXXXXXXXXX ro quiet splash
initrd /boot/initrd.img-2.6.29.4.openairemu
}

No initrd line will cause a Kernel panic during the system boot

Save and quit the file.

You need now to reboot the machine in order to take into account the modifications you just did.

# reboot 

once the machine has rebooted, type :

# uname -r 

You should have "2.6.29.4.openairemu" as result

-- PhilippeFoubert - 21 Oct 2011

Topic revision: r3 - 09 Nov 2011 - PhilippeFoubert
 
Copyright 2004-2010 Institut Eurecom & all contributing authors.