VAR-SOM-OM37 Linux Building Linux Images

From Variscite Wiki
Revision as of 12:42, 19 January 2014 by Admin (talk | contribs)

VAR-SOM-OM35/7 /AM35 Building Linux Images


Note: Page has been updated to support Linux Release no.9

Instructions for Linux release no.8 can be found here: http://www.variwiki.com/index.php?title=VAR-SOM-OM37_-_Building_Linux_Images&oldid=721

Building Linux images

This section describes how to rebuild the different software images.
Ensure that the toolchain installation has been completed (see section “Installing the Toolchain”).
Some of the makefiles build development host utilities in the process of building the target content. For these steps to complete correctly, the Linux host must be capable of compiling host programs.
Install the following libraries:

# sudo apt-get install build-essential libncurses5-dev mtd-tools

Installing the toolchain

This guide assumes the use of the LITE version of the CodeSourcery toolchain. This version is an unrestricted command line toolchain available free of charge.
The tool chain is included in the VAR-DVK-3x.
The installation file resides at Software/host_tools/linux/arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2[1]
To install the toolchain, follow the sequence below:

# sudo mkdir –p /opt/toolchain
# sudo cp arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 /opt/toolchain
# cd /opt/toolchain
# sudo tar –jxvf arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
# sudo rm arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

Add the /opt/toolchain/arm-2009q1/bin folder to your path. This is typically done by adding an additional line to your shell resource file (~/.bashrc). For the path given above, add the following line to your .bashrc file:

# export PATH=/opt/toolchain/arm-2009q1/bin:$PATH

This adds the CodeSourcery tools to your path and allows you to execute the tools using
arm-nonelinux-gnueabi-gcc (or other tools in the tool chain) from any directory.

Building kernel

Note: building the kernel requires using mkimage, a host side utility built by the u-boot makefile. You will need to build U-boot and place mkimage in your Path. If you are using a bash shell, add the following in the .bashrc file in your user account.

export PATH=<path to U-boot>/tools:$PATH


After making the modifications to the .bashrc file, make sure you perform the following step for the change to take effect in the current session.

# source ~/.bashrc


Download variscite_2_6_37.patch from Variscite's FTP

\VAR-SOM-OM35_VAR-SOM-OM37_VAR-SOM-AM35\Software\2_6_37-Release2\sources

To build the kernel, follow the following commands:

git clone git://arago-project.org/git/projects/linux-omap3.git
cd linux-omap3
git checkout 4d640ae8cb8bb3a51675208caaf45142e7348b08
git apply /path/to/variscite_kernel_2_6_37.patch
make ARCH=arm var-som-om3x_defconfig
make ARCH=arm menuconfig
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage


The resulting kernel image uImage will be placed under arch/arm/boot and is ready to be loaded to target.

Building the U-boot

Untar the U-Boot source archive from \VAR-SOM-OM35_VAR-SOM-OM37_VAR-SOM-AM35\Software\Linux\sources folder:

tar xjvf u-boot-2009.11-psp03.00.01.06.sdk.tar.bz2

To build the U-Boot, follow the following commands:

# cd u-boot-2009.11-psp03.00.01.06.sdk
# make distclean
# make var-om3xxx_config

# make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

Resulting U-Boot image named u-boot.bin will be in the current directory.

Building the X-Loader

Untar the X-Loader source archive from \VAR-SOM-OM35_VAR-SOM-OM37_VAR-SOM-AM35\Software\Linux\sources folder:

tar xjvf x-load-1.46-psp03.00.01.06.sdk.tar.bz2

To build the X-Loader, follow the following commands:

# cd x-load-1.46-psp03.00.01.06.sdk
# make distclean
# make var-om35xx_config

# make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- PLATFORM_RELFLAGS+='-DFOUR_BIT_ERROR_CORRECT'

Resulting X-Loader image named x-load.bin will be in created the current directory.
Sign image with TI signGP tool (included in CD)

Open Embedded

VAR-SOM-OM37 uses the Openembedded build system. The "Getting started" set of pages will show you how to set up cross development build environment on your Linux desktop or laptop. It will teach you how to check out the most recent source code , and how to use the build system to create standard images for X-Loader, U-Boot, Kernel and Root filesystem.
The steps for the entire process are summarized in Quick start, but it is recommended that you read through the detailed instructions in Setting up a Build Environment and the following sections for a better understanding of the process

OpenEmbedded setup

Getting Started section of OpenEmbedded User Manual describes the framework installation process.

copy suggested local.conf file to build dir

cp /path/to/var-som-om37/oe/dir/local.conf ${OEBASE}/build/conf

Applying Patches

  • Create a branch for VAR-SOM-OM37 development. VAR-SOM-OM37 patches are generated vs. commit 9e1aa4d02aed8ade9bbbc60ccab4aa58fe1bd2fd in org.openembedded.dev branch of the OpenEmbedded git tree.
cd {$OEBASE}/oe/openembedded
git branch var-som-om37 9e1aa4d02aed8ade9bbbc60ccab4aa58fe1bd2fd 
git checkout var-som-om37
  • Apply VAR-SOM-OM37 patch
git apply /path/to/var-som-xx.patch

Creating Angstrom Linux images

  • Setup environment variables
export OEBASE=/path/to/oe
cd $OEBASE
export PATH=$OEBASE/bitbake/bin:$PATH
export BBPATH=$OEBASE/build:$OEBASE/openembedded
export BB_ENV_EXTRAWHITE="OEBASE"
  • For building .dev branch, in local.conf file, at least three of the following entries should be present. For building VAR-SOM-OM37:
BBFILES = "/home/oren/oe/openembedded/recipes/*/*.bb"
DISTRO = "angstrom-2010.x"
MACHINE = "var-som-om37"

Start building

For building x-loader :

   $ bitbake -v x-load

For building u-boot for VAR-SOM-OM37:

   $ bitbake -v virtual/bootloader

For building the uImage for VAR-SOM-OM37:

   $ bitbake -v virtual/kernel 

or

Example: For building a file system with GUI support:

   $ bitbake -v x11-gpe-image 

The above command will build X-Loader, U-Boot, Kernel and Root filesystem.

This initial build will take time since it needs to download all the sources. When it completes, you will find the MLO, U-boot, Kernel and root filesystem image in

/stuff/openembedded/tmp/deploy/glibc/images/var-som-om37:

   $ ls /stuff/openembedded/tmp/deploy/glibc/images/var-som-om37
uImage-2.6.37-r103-var-som-om37.bin
modules-2.6.37-r103-var-som-om37.tgz
uImage-var-som-om37.bin -> uImage-2.6.37-r103-var-som-om37.bin
config-2.6.37-r103-var-som-om37.config
modules-var-som-om37.tgz -> modules-2.6.37-r103-var-som-om37.tgz
config-var-som-om37.config -> config-2.6.37-r103-var-som-om37.config
u-boot-var-som-om37.bin -> u-boot-var-som-om37-2009.11+r76+gitr7683ca6af43c17cf8214e9a241cd63c0001a59b1-r76.bin
u-boot-var-som-om37-2009.11+r76+gitr7683ca6af43c17cf8214e9a241cd63c0001a59b1-r76.bin
x-load-var-som-om37-1.46+r24+gitr8aab9f965db7622f89378e7d53b328811dcfd62c-r24.bin.ift
x-load-usb-var-som-om37-1.46+r24+gitr8aab9f965db7622f89378e7d53b328811dcfd62c-r24.bin
MLO-var-som-om37-1.46+r24+gitr8aab9f965db7622f89378e7d53b328811dcfd62c-r24
x-load-var-som-om37.bin.ift -> x-load-var-som-om37-1.46+r24+gitr8aab9f965db7622f89378e7d53b328811dcfd62c-r24.bin.ift
x-load-usb-var-som-om37.bin -> x-load-usb-var-som-om37-1.46+r24+gitr8aab9f965db7622f89378e7d53b328811dcfd62c-r24.bin
MLO-var-som-om37 -> MLO-var-som-om37-1.46+r24+gitr8aab9f965db7622f89378e7d53b328811dcfd62c-r24
x11-gpe-image-var-som-om37.jffs2 -> Angstrom-x11-gpe-image-eglibc-ipk-v2011.09-var-som-om37.rootfs.jffs2
Angstrom-x11-gpe-image-eglibc-ipk-v2011.09-var-som-om37.rootfs.jffs2
x11-gpe-image-var-som-om37.tar.bz2 -> Angstrom-x11-gpe-image-eglibc-ipk-v2011.09-var-som-om37.rootfs.tar.bz2
Angstrom-x11-gpe-image-eglibc-ipk-v2011.09-var-som-om37.rootfs.tar.bz2
Angstrom-x11-gpe-image-eglibc-ipk-v2011.09-var-som-om37-testlab