Difference between revisions of "Installing Debian and Xenomai on gumstix Overo"

From Gumstix User Wiki
Jump to: navigation, search
(First edit)
 
(Finished writing how to compile the kernel)
Line 1: Line 1:
First edit
+
This document describes how I (Sagar Behere) installed Debian squeeze and vanilla linux kernel 2.6.38.8 patched with Xenomai 2.6.0 on the gumstix Overo. The contents of this document are probably applicable to other software versions as well.
 +
 
 +
DISCLAIMER: There may be better ways to do this. I am not an expert. This worked for me. Your mileage may vary.
 +
 
 +
The standard method to compile a kernel and rootfs is to use the Open Embedded build system that is described [http://gumstix.org/software-development/open-embedded/61-using-the-open-embedded-build-system.html here]. However, I did not use that method because I couldn't figure out how to build any of the kernel versions for which xenomai patches could be found (at the time of writing, the virtual/kernel pointed to version 3.0). Also, I prefer to use the debian userland, rather than Ångstrom. Therefore, the method described here does NOT use Open Embedded.
 +
 
 +
==Preparing the host==
 +
 
 +
The ''host'' is the computer you will use to build the kernel and rootfs. The ''target'' is the gumstix Overo COM on which the kernel and rootfs will be deployed. My host is an x86 computer running Debian squeeze. The method described here will probably work on a host running Ubuntu, with some modifications
 +
 
 +
Add emdebian to your apt sources and get needed packages
 +
sudo apt-get install emdebian-archive-keyring
 +
sudo apt-get install gcc-4.3-arm-linux-gnueabi binutils-arm-linux-gnueabi
 +
 
 +
This should pull in all the dependencies and you'll now have an arm cross-toolchain installed on your system. For Ubuntu users also, cross tool chains are available. See the http://www.linaro.org/.
 +
 
 +
==Compiling the kernel==
 +
 
 +
* Download and extract xenomai. Let's call the resulting xenomai-2.6.0 dir as {xenomaisourcedir}
 +
wget -c http://download.gna.org/xenomai/stable/xenomai-2.6.0.tar.bz2; tar jxvf xenomai-2.6.0.tar.bz2;
 +
* Supported kernels can be found in {xenomaisourcedir}/ksrc/arch/arm/patches/. I saw the file adeos-ipipe-2.6.38.8-arm-1.18-04.patch and so decided to use that kernel
 +
* Download the kernel and extract it. Let's call the resulting linux-2.6.8.8 directory {kernelsourcedir}
 +
wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.38.8.tar.bz2; tar jxvf linux-2.6.38.8.tar.bz2
 +
* Patch the kernel sources with Xenomai. Go to {xenomaisourcedir} and
 +
scripts/prepare-kernel.sh –arch=arm –linux=/path/where/you/untarred/linux-2.6.38.8.tar.bz2
 +
It'll suggest the right patch to be applied.
 +
* Set the default kernel configuration
 +
cd {kernelsourcedir}; cp arch/arm/configs/omap2plus_defconfig .config
 +
* Configure the kernel with
 +
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig
 +
I removed support for almost all the boards except the Overo and also removed support for everything execpt OMAP3. Configure the xenomai related stuff too.
 +
* Build the kernel with
 +
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage modules
 +
* To deploy the kernel, you'll need the uImage which can be found at {kernelsourcedir}/arch/arm/boot/uImage You'll also need to put the resulting modules into the debian rootfs that we'll create later. For now, I merely put all the modules in some directory {modulesdirectory} with
 +
make ARCH=arm INSTALL_MOD_PATH=/path/to/{modulesdirectory} modules_install;
 +
You can optionally also put the firmware in some directory {firmwaredirectory} with
 +
make ARCH=arm INSTALL_FW_PATH=/path/to/{firmwaredirectory} firmware_install
 +
The {modulesdirectory} will contain a directory lib/modules/kernel-version that we'll copy over to our rootfs later.
 +
 
 +
We still need to compile the xenomai userspace stuff, but we'll do that after setting up the rootfs

Revision as of 11:32, 2 February 2012

This document describes how I (Sagar Behere) installed Debian squeeze and vanilla linux kernel 2.6.38.8 patched with Xenomai 2.6.0 on the gumstix Overo. The contents of this document are probably applicable to other software versions as well.

DISCLAIMER: There may be better ways to do this. I am not an expert. This worked for me. Your mileage may vary.

The standard method to compile a kernel and rootfs is to use the Open Embedded build system that is described here. However, I did not use that method because I couldn't figure out how to build any of the kernel versions for which xenomai patches could be found (at the time of writing, the virtual/kernel pointed to version 3.0). Also, I prefer to use the debian userland, rather than Ångstrom. Therefore, the method described here does NOT use Open Embedded.

Preparing the host

The host is the computer you will use to build the kernel and rootfs. The target is the gumstix Overo COM on which the kernel and rootfs will be deployed. My host is an x86 computer running Debian squeeze. The method described here will probably work on a host running Ubuntu, with some modifications

Add emdebian to your apt sources and get needed packages

sudo apt-get install emdebian-archive-keyring
sudo apt-get install gcc-4.3-arm-linux-gnueabi binutils-arm-linux-gnueabi

This should pull in all the dependencies and you'll now have an arm cross-toolchain installed on your system. For Ubuntu users also, cross tool chains are available. See the http://www.linaro.org/.

Compiling the kernel

  • Download and extract xenomai. Let's call the resulting xenomai-2.6.0 dir as {xenomaisourcedir}
wget -c http://download.gna.org/xenomai/stable/xenomai-2.6.0.tar.bz2; tar jxvf xenomai-2.6.0.tar.bz2; 
  • Supported kernels can be found in {xenomaisourcedir}/ksrc/arch/arm/patches/. I saw the file adeos-ipipe-2.6.38.8-arm-1.18-04.patch and so decided to use that kernel
  • Download the kernel and extract it. Let's call the resulting linux-2.6.8.8 directory {kernelsourcedir}
wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.38.8.tar.bz2; tar jxvf linux-2.6.38.8.tar.bz2
  • Patch the kernel sources with Xenomai. Go to {xenomaisourcedir} and
scripts/prepare-kernel.sh –arch=arm –linux=/path/where/you/untarred/linux-2.6.38.8.tar.bz2

It'll suggest the right patch to be applied.

  • Set the default kernel configuration
cd {kernelsourcedir}; cp arch/arm/configs/omap2plus_defconfig .config
  • Configure the kernel with
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig

I removed support for almost all the boards except the Overo and also removed support for everything execpt OMAP3. Configure the xenomai related stuff too.

  • Build the kernel with
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage modules
  • To deploy the kernel, you'll need the uImage which can be found at {kernelsourcedir}/arch/arm/boot/uImage You'll also need to put the resulting modules into the debian rootfs that we'll create later. For now, I merely put all the modules in some directory {modulesdirectory} with
make ARCH=arm INSTALL_MOD_PATH=/path/to/{modulesdirectory} modules_install; 

You can optionally also put the firmware in some directory {firmwaredirectory} with

make ARCH=arm INSTALL_FW_PATH=/path/to/{firmwaredirectory} firmware_install

The {modulesdirectory} will contain a directory lib/modules/kernel-version that we'll copy over to our rootfs later.

We still need to compile the xenomai userspace stuff, but we'll do that after setting up the rootfs