i.MX28 LTIB on UBUNTU 13.04

I tried Ltib installation in Ubuntu 13.04 for i.MX28 board which completed successfully

First install required packages

sudo apt-get update
sudo apt-get install build-essential zlib1g-dev rpm libncurses5-dev m4 bison liblzo2-dev uuid-dev tcl

Configure sudo

The LTIB installation script runs several commands with sudo where the user should not be prompted for a password. sudo without password must be configured for the current user to execute the script correctly.

sudo visudo

the file /etc/sudoers is opened for editing.

The following line should be inserted in the file, where user has to be changed to your user name:

# Allow user to run commands for ltib.
user ALL = NOPASSWD: /usr/bin/rpm, /opt/freescale/ltib/usr/bin/rpm

Save with Ctrl+o, then close with Ctrl+x.

Download BSP source for Ltib for iMX281

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX281&nodeId=018rH3ZrDRA24A&fpsp=1&tab=Design_Tools_Tab#

Extract it

tar -xvf L2.6.35_1.1.0_130130_source.tar.gz

cd L2.6.35_1.1.0_130130_source

./install

The installer will ask you to read and accept a EULA and then ask you for the install directory. For this example, choose your home directory.
After the installation, there will be a new directory named “ltib” under the install directory you specified. This new directory contains the actual
ltib Perl script, config files, package specs, and utilities.

so now change directory to newly created ltib directory

cd ~/ltib

Now we must patch some files of the folder.Note that ,this must be done from ltib folder itself.

wget https://community.freescale.com/servlet/JiveServlet/downloadBody/93455-102-2-2825/patch-ltib-ubuntu12.04.sh

./patch-ltib-ubuntu12.04.sh

It will download ubuntu-ltib-patch.tgz

tar -xzvf ubuntu-ltib-patch.tgz

./install-patches.sh 

You can download the shell script and files from this link

https://github.com/ganeshredcobra/Ltib

Configure and Build

To configure and build your LTIB installation the first time, run this command from the ~/ltib directory:

./ltib

This command invokes LTIB with its default behavior of performing a build. Since the installation has not yet been configured, LTIB will present
the ncurses configuration screen before building. Then, when you exit the configuration screen, LTIB will build the target image.you can see installed host tools in /opt/freescale/ .

When you invoke ./ltib the screen will be like this and a log file will be created inside the ltib folder

01

If there is any dependency problem the the building process may stop like this
02
Here the issue is that zlib is missing then you must install zlib

Then you will get the first time configuration window
04
05
Because the i.MX BSP contains only the i.MX platform, you don’t need to change anything on this screen.
When is selected, you can hit the return key to exit the current screen. On most main screens, exiting will bring up the following dialog
asking if you want to save changes.Here, use the right and left arrow keys to select between and . Press return to activate your selection. Selecting will cause LTIB to not continue to the following step. We must save the configuration when asked. This will bring up another sub-platform screen

06

The first option available on this screen is used to choose the sub-platform type. For the i.MX platform, the sub-platform is the specific chip family combined with the board type. For the i.MX28, this is the EVK board. The second option on this screen, under the Choose the packages profile item, lets you select the default set of packages. Individual packages can be enabled and disabled later, as you need. The default choice is sufficient for now.
If you need to change the sub-platform later, use the command:

./ltib -m selectype

Move the cursor down to the Selection item below the Choose the platform type line and press return to open up a platform selection
menu,
07

Select the imx28 platform, which is near the top of the list, and press return to return to the main screen.Exit the sub-platform selection screen and save the configuration. This will bring you to the main LTIB configuration screen.

Here you can change the settings such as packages kernel version build parameters etc
08

09

10

After modifying the parameters you must exit from configuration menu saving the settings and run ltib again without any arguments

./ltib

Possibly you may get an error like this

Can’t get: gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm at ./ltib line 2560.

CONFIG_TOOLCHAIN forced a full rebuild
Installing: gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm
Testing network connectivity
OK GPP:
 
Try gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm.md5 from the GPP
http://bitshrine.org/gpp/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm.md5:
21:59:11 ERROR 404: Not Found.
Try gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm from the GPP
http://bitshrine.org/gpp/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm:
21:59:11 ERROR 404: Not Found.
Can't get: gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12-1.i386.rpm at ./ltib line 2560.
Died at ./ltib line 2560.
traceback:
main::check_toolchain_setup:2560
  main::pre_build_checks:1465
   main:569
 
 
Started: Sun Mar  3 21:17:48 2013
Ended:   Sun Mar  3 21:59:11 2013
Elapsed: 2483 seconds
 
 
Build Failed
 
Exiting on error or interrupt

11

To fix this error chnage the toolchain configuration

./ltib -m config

in the Toolchain selection choose “ARM, gcc-4.4.4, multilib, neon optimized” instead of default “ARM, gcc-4.6.2, multilib, neon optimized, gnueabi/eglibc2.13”.

12

13

One more serious error that you will encounter is this

Couldn’t link to symbol lroundf@@GLIBC_2.2.5

15

To avoid this error you need to edit makefile.rules of elftosb-2.6.35.3-1.1.0.tar.gz

cp /opt/freescale/pkgs/elftosb-2.6.35.3-1.1.0.tar.gz ~/Desktop
tar -zxvf elftosb-2.6.35.3-1.1.0.tar.gz
cd elftosb-2.6.35.3-1.1.0/
vim makefile.rules

Inside that file there is a line that reads

 LIBS = -lstdc++

change it to

LIBS = -lstdc++ -lm

to add the standard math library to the build.
make
After editing compress the folder back to tar.gz and place it in pkgs folder

tar -zcvf elftosb-2.6.35.3-1.1.0.tar.gz elftosb-2.6.35.3-1.1.0/
cp  ~/Desktop /opt/freescale/pkgs/elftosb-2.6.35.3-1.1.0.tar.gz

Now delete the old file from BUILD folder.Else you will get an error saying delete that file.

rm -rf /opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-2.6.35.3-1.1.0.tar.gz

Now again start building using the command

./ltib

After sucessful build you will be seeing this

17

After you have completed a build by using LTIB, you will have a target root filesystem in the rootfs directory inside the LTIB install directory. For instance, if you installed LTIB in your home directory, there will be a ~/ltib/rootfs directory containing the target rootfs.
Inside the ~/ltib/rootfs/boot directory, you will find a set of .sb files. These are the boot streams that the i.MX28 ROM interprets to boot the system.

18

Happy Hacking 🙂

Advertisements