Difference between revisions of "Linux Kernel for CM-X300"

From Compulab Mediawiki
Jump to: navigation, search
Line 26: Line 26:
 
=== Creating Linux kernel JFFS2 image===
 
=== Creating Linux kernel JFFS2 image===
  
The Linux kernel should be stored in the CM-X300 NAND flash as a JFFS2 image.
+
The Linux kernel should be stored in the CM-X300 NAND flash as a JFFS2 image. This image can be created as follows:
  
 
<pre>
 
<pre>

Revision as of 14:31, 18 August 2008

Overview

Linux kernel for CM-X300 modules provides support for on-board peripherals. Current support coverage is specified at O/S support coverage map page. CompuLab provides ready-to-run binary kernel images, and source code of the modifications and additions made to the Linux kernel to work properly with CM-X300 modules.

Building Linux kernel for CM-X300

mkdir /home/development/cm-x300/kernel
cd /home/development/cm-x300/kernel
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.26.tar.bz2
tar xjf linux-2.6.26.tar.bz2
cd linux-2.6.26
cat /path/to/x300-linux/kernel/linux-2.6.26-cm-x300.patch | patch -p1
export ARCH=arm
export CROSS_COMPILE=arm-linux-
make cm_x300_defconfig
make menuconfig
make && make uImage \
     INSTALL_MOD_PATH=/home/development/cm-x300/rootfs make modules_install

In the above example, the Linux kernel image (uImage) will be created in /home/development/cm-x300/kernel/linux-2.6.26/arch/arm/boot, and the loadable kernel modules will be installed into the /home/development/cm-x300/rootfs/lib/modules directory.

Now, if you boot CM-X300 with newly created kernel image and with networked root filesysem at /home/development/cm-x300/rootfs/ the system will be able to properly load kernel modules and you avoid modules versioning problems.

Creating Linux kernel JFFS2 image

The Linux kernel should be stored in the CM-X300 NAND flash as a JFFS2 image. This image can be created as follows:

mkdir /tmp/cm-x300-kernel/
cp /home/development/cm-x300/kernel/linux-2.6.26/arch/arm/boot/uImage
mkfs.jffs2 --no-cleanmarkers --pad --eraseblock=0x20000 --root=/tmp/cm-x300-kernel --output=/path/to/cm-x300-kernel.jffs2

See also