TS-47xx Kernel Compile Guide: Difference between revisions

From embeddedTS Manuals
No edit summary
No edit summary
Line 41: Line 41:
</source>
</source>


This will bring up a graphical menu where you can edit the configuration to include support for new devicesFor Example, to include support for a Prolific USB to serial adapter you would go to 'Device Drivers -> USB Support-> USB Serial Support' and then select 'USB Prolific 2303 Single Port Serial Driver'.  Since the kernel only has a limited space, build drivers as modules whenever possible.
Once you have the configuration ready you can make your changes to the kernelCommonly a reason for recompiling is to add support that was not built into the standard image's kernelYou can get a menu to browse available options by running:
 
<source lang=bash>
<source lang=bash>
make menuconfig
make menuconfig
</source>
</source>
You can use the "/" key to search for specific terms through the kernel.


'''Build the kernel'''
'''Build the kernel'''


Once you have it configured, start building.  This usually takes about 5-10 minutes.
Once you have it configured you can begin building the kernel.  This usually takes about 5-10 minutes.
<source lang=bash>
<source lang=bash>
make
make

Revision as of 17:18, 22 February 2013

For adding new support to the kernel, or recompiling with more specific options you will need to have an X86 compatible linux host available that can handle the cross compiling. Compiling the kernel on the board is not supported or recommended. Before building the kernel you will need to install a few support libraries on your workstation:

Prerequisites

RHEL/Fedora/CentOS:

yum install ncurses-devel ncurses
yum groupinstall "Development Tools" "Development Libraries"

Ubuntu/Debian:

apt-get install build-essential libncurses5-dev libncursesw5-dev git

For other distributions, please refer to their documentation to find equivalent tools.

Set up the Sources and Toolchain

# Download the cross compile toolchain (EABI)from Technologic Systems:
wget ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4700-linux/cross-toolchains/arm-2008q3.tar.gz

# Extract the toolchain
tar xvf arm-2008q3.tar.gz

# Move arm-2008q3 to a permanent location, eg /opt/toolchains/
mkdir /opt/toolchains/
mv arm-2008q3 /opt/toolchains/

# Download the Kernel sources
git clone https://github.com/embeddedarm/linux-2.6.34-ts471x.git

cd linux-2.6.34-ts471x

# Set the CROSS_COMPILE variable to the absolute path to the toolchain.
export CROSS_COMPILE=/opt/toolchains/arm-2008q3/bin/arm-none-linux-gnueabi-
export ARCH=arm

# This sets up the default configuration that we ship with for the TS-471x
make ts471x_defconfig

Once you have the configuration ready you can make your changes to the kernel. Commonly a reason for recompiling is to add support that was not built into the standard image's kernel. You can get a menu to browse available options by running:

make menuconfig

You can use the "/" key to search for specific terms through the kernel.

Build the kernel

Once you have it configured you can begin building the kernel. This usually takes about 5-10 minutes.

make

The new kernel will be at "arch/arm/boot/Image".

Install the Kernel and Modules

Install the target SD card in your workstation, and mount the Debian partition. For example, if your workstation's SD card is /dev/mmcblk0:

mkdir /mnt/sd/
mount /dev/mmcblk0p2 /mnt/sd/
INSTALL_MOD_PATH=/mnt/sd/ make modules_install

## If you use sudo, you can use -E to retain your environment flags.
#INSTALL_MOD_PATH=/mnt/sd/ sudo -E make modules_install

# To install the updated kernel:
dd if=arch/arm/boot/Image of=/dev/mmcblk0p1