Using i.MX 6 Series LTIB on Host Ubuntu 14.04 Trusty Tahr

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using i.MX 6 Series LTIB on Host Ubuntu 14.04 Trusty Tahr

Using i.MX 6 Series LTIB on Host Ubuntu 14.04 Trusty Tahr

Overview

This document provides some solutions for building i.MX 6 series LTIB on an Ubuntu 14.04 Trusty Tahr host.

A Virtualbox virtual machine was created for the Ubuntu computer which is used for the build host.

 

Linux Target Image Builder (LTIB) is a perl script used for creating images (Bootloader u-boot, Linux uImage, and root file system). The build example shown here was for the i.MX 6Q and minimum root file system.

 

Software Versions

  • L3.0.35_4.1.0_ER_SOURCE_BSP
    • L3.0.35 : Linux version 3.0.35
    • 4.1.0 :  Freescale release number
    • ER_SOURCE_BSP : Engineering Release source Board support package
    • File download URL:  L3.0.35_4.1.0_130816_source.tar.gz. Note this requires a free account registration at freescale.com.
    • md5sum L3.0.35_4.1.0_130816_source.tar.gz

      dec08bb266134b94af0f54356e2e9de9  L3.0.35_4.1.0_130816_source.tar.gz

  • L3.0.35_4.1.0_docs.tar.gz
    • Documentation bundle.
    • File download URL: L3.0.35_4.1.0_docs.tar.gz
    • md5sum L3.0.35_4.1.0_docs.tar.gz

      85f122c72735f3d162a99ae42554e886  L3.0.35_4.1.0_docs.tar.gz

  • Ubuntu 14.04 LTS Trusty Tahr
    • LTS : Long Term Supported
    • 64-bit version
    • File download URL: http://www.ubuntu.com/download/desktop
    • md5sum ubuntu-14.04-desktop-amd64.iso

      dccff28314d9ae4ed262cfc6f35e5153  ubuntu-14.04-desktop-amd64.iso

  • Virtualbox
    • Version 4.3.10
    • File download URL: Oracle VM VirtualBox
    • Machine Setup
      • 4 CPU
      • 4 GB RAM
      • 64 GB Hard disk from USB 3.0 connected drive
  • Host Computer
    • Dell M4600, 8GB RAM,  8 CPU
    • Ubuntu Linux 12.04.02 LTS

 

Ubuntu Host 14.04

Host Packages

Various packages are required to meet build requirements of LTIB.

Please refer to "Setting_Up_LTIB_host.pdf" document found in the L3.0.35_4.1.0_docs.tar.gz download.

See below for the trustyPkgs.txt attachment that shows all the packages that were installed. This was created using

the command: dpkg --list

 

On your host you can run the command "dpkg --list" and compare with the trustyPkgs.txt using your favorite diff tool. (examples, meld, diff). Any package missing can be added using your favorite package manager.  For example to install mkimage which is found in the u-boot-tools package:  sudo apt-get install u-boot-tools

 

Build

LTIB

Host Package M4

Failure

The package m4 fails to build. Paste of the error messages:

 

gcc -std=gnu99  -I.     -g -O2 -MT clean-temp.o -MD -MP -MF .deps/clean-temp.Tpo -c -o clean-temp.o clean-temp.c

In file included from clean-temp.h:22:0,

                 from clean-temp.c:23:

./stdio.h:477:1: error: 'gets' undeclared here (not in a function)

make[3]: *** [clean-temp.o] Error 1

make[3]: Leaving directory `/opt/freescale/ltib/usr/src/rpm/BUILD/m4-1.4.16/lib'

make[2]: *** [all] Error 2

make[2]: Leaving directory `/opt/freescale/ltib/usr/src/rpm/BUILD/m4-1.4.16/lib'

 

Solution

Replace the m4 package with a newer version. The m4 package bundled with LTIB is version 1.4.16. A newer version 1.4.17 is available and does not have build failures.

          md5sum m4-1.4.17.tar.gz > m4-1.4.17.tar.gz.md5

  • Move both files to /opt/freescale/pkgs which is where ltib searches for packages.

          mv m4* /opt/freescale/pkgs

  • Edit the m4.spec file that specifies the version

          cd <ltib>/dist/lfs5.1/m4/

          Edit m4.spec using your favorite editor.  Line 5 is the Version number to change from 16 to 17:

 

Original:

1 %define pfx /opt/freescale/rootfs/%{_target_cpu}
2
3 Summary: The GNU macro processor
4 Name  : m4
5 Version: 1.4.16
6 Release: 1
7 License: GPL

 

Updated:

1 %define pfx /opt/freescale/rootfs/%{_target_cpu}
2
3 Summary: The GNU macro processor
4 Name  : m4
5 Version: 1.4.17
6 Release: 1
7 License: GPL

 

 

 

busybox

 

Failure

 

/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: cannot find /lib/libc.so.6

/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: cannot find /usr/lib/libc_nonshared.a

/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: cannot find /lib/ld-linux.so.3

collect2: ld returned 1 exit status

make: *** [busybox_unstripped] Error 1

error: Bad exit status from /home/user/imx6/ltib/tmp/rpm-tmp.60711 (%build)

 

 

RPM build errors:

    Bad exit status from /home/user/imx6/ltib/tmp/rpm-tmp.60711 (%build)

Build time for busybox: 93 seconds

 

Failed building busybox

 

Solution:

 

Go into ltib/dist/lfs-5.1/base_libs/base_libs.spec and find these lines:
     # remove absolute paths from text search files (if they exist)
     perl -w -e '
         @ARGV = grep { `file $_` =~ m,ASCII C program text, } @ARGV;
         exit(0) unless @ARGV;


Remove the last two (the lines beginning with "@ARGV" and "exit(0)"

 

Adding the # character removes the lines 299 and 300

297 # remove absolute paths from text search files (if they exist)
298 perl -w -e '
299 #@ARGV = grep { `file $_` =~ m,ASCII C program text, } @ARGV;
300 #exit(0) unless @ARGV;
301$^I = ".bak";

 

 

Success

When the build completes, u-boot.bin and uImage are found in <ltib>/rootfs/boot

 

[user@trusty ltib]$ tree rootfs/boot

rootfs/boot

├── bootable_kernel -> uImage

├── linux.config

├── System.map

├── u-boot

├── u-boot.bin

├── uImage

├── vmlinux

└── zImage

Original Attachment has been moved to: trustyPkgs.txt.zip

Original Attachment has been moved to: lkc-1.4.tar.gz

Tags (2)
Comments

Hi CurtisWald,

Your topic is very useful for me! Thank you very much

I have built LTIB on ubuntu 14.04 for imx233.

I have an issue:

--------------------------------------------------------------------------------------------------------------------------

Processing platform: Freescale iMX233/stmp3780 Based Boards

=============================================================

using config/platform/imx/.config

Processing: fake-provides

===========================

Processing: u-boot-v2009.08

=============================

Processing: kernel-2.6.35

===========================

Build path taken because: no prebuilt rpm,

Testing network connectivity

OK GPP:

Try linux-2.6.35.3-imx_12.02.00.bz2.md5 from the GPP

http://bitshrine.org/gpp/linux-2.6.35.3-imx_12.02.00.bz2.md5:

16:12:20 ERROR 404: Not Found.

Try linux-2.6.35.3-imx_12.02.00.bz2 from the GPP

http://bitshrine.org/gpp/linux-2.6.35.3-imx_12.02.00.bz2:

16:12:21 ERROR 404: Not Found.

Can't get: linux-2.6.35.3-imx_12.02.00.bz2 at ./ltib line 802.

f_buildrpms() returned an error, exiting

traceback:

main:572

Started: Mon Aug  4 16:12:18 2014

Ended:   Mon Aug  4 16:12:21 2014

Elapsed: 3 seconds

These packages failed to build:

kernel-2.6.35

Build Failed

Exiting on error or interrupt

------------------------------------------------------------------------------------------------------------------------------------

Because the link is died, I don't know how to do next?

Could you help me?

Should I download these file from another source? But I don't know how to link to my LTIB.

Thanks,

Phi Nguyen

Hi Phi,

Linux Target Image Builder (LTIB) defines package pools (please see LTIB : LtibFaq), /opt/freescale/pkgs is where you would put linux-2.6.35.3-imx_12.02.00.bz2 and the md5 files if you can find them. Unfortunately sometimes bitshrine.org fails to provide the package to download. I do not know of an alternate site to download the package.

Another option for you to consider for the imx23evk is instead of LTIB BSP, use the FSL Community BSP which is Yocto Project based.There is support for the imx23 providing newer Linux Kernel and bootloader, U-Boot than the ones in LTIB. Please see the http://freescale.github.io for the release notes how to get started.

Thanks,

-Curtis

Hi Curtis,

Thanks for your recommend!

I'm trying to build QT for my imx233 board!

Best Regards,

Phi Nguyen

Does anyone have these files:

linux-2.6.35.3-imx_12.02.00.bz2.md5

linux-2.6.35.3-imx_12.02.00.bz2

It looks as if bitshrine has decided to not have them at all, and I cannot find alternates for them.

As a alternate can I revert to an earlier version or if they are not longer in existence do I have to move to yucto method?

Thanks

Todd

Hi,

We are trying to perform a build of the same version of LTIB on  the same version of Ubuntu 14.04 64-bit environment. We got past the m4 but are not getting a build failure on the texinfo-4.8 package:

config.status: creating po/POTFILES

config.status: creating po/Makefile

+ make

make  all-recursive

make[1]: Entering directory `/opt/freescale/ltib/usr/src/rpm/BUILD/texinfo-4.8'

Making all in tools

make[2]: Entering directory `/opt/freescale/ltib/usr/src/rpm/BUILD/texinfo-4.8/tools'

make[2]: *** No rule to make target `all'.  Stop8

make[2]: Leaving directory `/opt/freescale/ltib/usr/src/rpm/BUILD/texinfo-4.8/tools'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/opt/freescale/ltib/usr/src/rpm/BUILD/texinfo-4.9'

make: *** [all] Error 2

error: Bad exit status from /home/toddh/Q7120/LTIB/ltib/tmp/rpm-tmp.9064 (%build)

RPM build errors:

    Bad exit status from /home/toddh/Q7120/LTIB/ltib/tmp/rpm-tmp.9064 (%build)

Build time for texinfo: 17 seconds

Failed building texinfo

Died at ./ltib line 1392.

We have  the latest version of cache installed.

We also tried patching in texinfo-4.9 into/opt/freescale per another thread but still get the same build error. Can someone help us with this error?

Thanks,

Todd H

Hello Todd,

I tried to reproduce the texinfo failure, but the entire texinfo package correctly worked for all the ltib steps.

Ubuntu host machine:

$ lsb_release -a

No LSB modules are available.

Distributor ID:    Ubuntu

Description:    Ubuntu 14.04.1 LTS

Release:    14.04

Codename:    trusty

Downloaded L3.0.35_4.1.0_130816_source.tar.gz, installed and built the minimum root file system. Then specifically worked with the texinfo package:

./ltib -p texinfo -m prep

./ltib -p texinfo -m scbuild

./ltib -p texinfo -m scinstall

./ltib -p texinfo -m scdeploy

Each of these ltib steps successfully completed.

From the error condition you posted, the 'all' target is not found in the <ltib>/rpm/BUILD/texinfo-4.8/tools/Makefile.

I checked this Makefile and found at line 244 the 'all' target - below is a paste with line numbers before and after the 'all':

    239 # In case TEXINFO_MAINT is set during make distcheck; in this case, the

    240 # simple doc-related files generated in info/ make distcleancheck fail.

    241 distcleancheck_listfiles = \

    242   find -type f -exec sh -c 'test -f $(srcdir)/{} || echo {}' ';'

    243

    244 all: config.h

    245         $(MAKE) $(AM_MAKEFLAGS) all-recursive

    246

    247 .SUFFIXES:

    248 am--refresh:

The tools/Makefile is generated from the ./ltib -m scbuild step.

Since I cannot reproduce your fail scenario, here are suggestions:

1. You mention ccache, maybe clean any cached previous results. The ccache -C command will clean the cache then build just the texinfo package.

$ ccache -C

$ rm -f rpm/BUILD/texinfo-4.8

$ ./ltib -m prep -p texinfo

$ ./ltib -m scbuild -p texinfo

2. Double check that all the host packages are installed - refer to the Host Packages section in the first post of this thread.

3. 11/28/2014 - a newer BSP build offering from Freescale is based on the Yocto Project, you could try this instead of the LTIB based BSP.  See http://www.freescale.com/imx6tools for the links.The latest General Available (GA) at this writing is 3.10.17. This is a newer Linux kernel 3.10.17 than the LTIB 3.0.35 as well as updated u-boot and root file system.

Good luck,

-Curtis

Hi Curtis,

I was able to generate the u-boot.bin and uImage using the above setup.
But u-boot obtained is different from the one available in pre-built Demo Images mentioned in i.MX 6 Q/D/DL/S L3.0.35_4.1.0 GA release .

I am using the i.MX6Q Sabre-SD board and selected the following settings in Menu config:-

1, Freescale i.MX reference boards

2, Platform type as imx6q

3, Package profile of mfg firmware profile

4, Select "Choose your board for U-Boot" as "mx6q_sabresd"

I haven't change anything else in the Menu config but still uboot image is not working while uImage is working fine on my Sabre-SD board.

The profile you selected, mfg firmware is the reason it is not working -change to min profile.

The mfg one is in support of the manufacturing tool which runs on windows and provides a way to program the board. See freescale.com/imx6tools<http://freescale.com/imx6tools> for a link to download if interested.

Sincerely,

Curtis

Hi Curtis,

Thanks for your reply and it was helpful.


Now i am facing another issue that the uImage generated from this build is different from the one available in demo images.

So do i have to apply some patch to add the other features available in Demo Images.
Can you share those patches.

Hi,

You said: “… that the uImage generated from this build is different from the one available in demo images.”

If considering a byte comparison between the demo image and any subsequent generated uImage, you are guaranteed to have a difference found in the uImage for the embedded date/time stamp.

A Freescale General Available (GA) release contains specific version of software packages that comprise the release. You asked about patches for uImage which is created from the Linux Kernel source bundled in the GA release.

The Freescale i.MX Linux source base is available in a GIT repository, visible using your favorite web browser at this link:  Freescale i.MX Linux Tree<http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/> or you can utilize the GIT “clone” feature and make a copy locally:

$ git clone git://git.freescale.com/imx/linux-2.6-imx.git.

NOTE: The repository name is linux-2.6-imx.git, but contains all Linux GA releases, 3.0, 3.10, etc.

Here is a snapshot of the current web view:

snapshot.png

When Freescale issues a Linux GA release, a GIT Tag is applied to snapshot the code. The Linux naming convention:

rel_imx_3.0.35_4.1.0

==================

rel_imx – indicates a release

3.0.35 – the Linux Kernel Version

4.1.0 – Freescale Version

The GIT Branch tree is used for patches. As changes are found and deemed necessary for a release, a GIT commit is pushed to the Branch. The Linux naming convention:

imx_3.0.35_4.1.0

=============

imx – notice only imx and not rel_imx.

3.0.35 – the Linux Kernel Version

4.1.0 – Freescale Version

With each patch commit the Branch name is always found at the most recent commit.

pic1.png

pic2.png

Let’s look at the Web view, you will see the Branch name and also the Tag release name. I have removed some of the commits to show a condensed view here:

From the picture above, the Yellow box: rel_imx_3.0.35_4.1.0 is the commit point that matches what is found in the Board Support Package (BSP) release. The green box imx_3.0.35_4.1.0 is the latest patch available for this release.

I would recommend applying all the patches available on the Branch of your BSP release.

Using git you can use the cherry-pick option, search online for tutorials if additional info needed:

                git cherry-pick

-Curtis

Hi,

I followed your steps for building LTIB for imx6 and it was installing fine until some packages (m4, bison, automake, autoconf, etc) went missing from the URL specified http://bitshrine.org/gpp/ . So downloaded those packages separately and include in the build as mentioned by Curtis.

" /opt/freescale/pkgs is where you would put linux-2.6.35.3-imx_12.02.00.bz2 and the md5 files if you can find them.,Unfortunately sometimes bitshrine.org fails to provide the package to download. I do not know of an alternate site to download the package." (Aug 2014)

In the same lines as Curtis, " I do not know of an alternate site to download the package"

is there any alternative site available currently for all packages to download or any link for downloading "lkc" package, as I have downloaded other packages from other sites but not able to find any src for lkc.

and my installation stops with the below message

Processing: lkc

=================

Build path taken because: no prebuilt rpm,

Testing network connectivity

OK GPP:

Try lkc-1.4-lib.patch.md5 from the GPP

http://bitshrine.org/gpp//lkc-1.4-lib.patch.md5:

2015-10-30 21:51:15 ERROR 404: Not Found.

Try lkc-1.4-lib.patch from the GPP

http://bitshrine.org/gpp//lkc-1.4-lib.patch:

2015-10-30 21:51:15 ERROR 404: Not Found.

Can't get: lkc-1.4-lib.patch at ./ltib line 802.

Died at ./ltib line 1392.

traceback:

main::build_host_rpms:1392

  main::host_checks:1447

   main:554

Also, I have another question related to imx_usb_loader, is imx_usb_loader is only for loading u-boot or can it be used for flashing system.img also.

Regards

I checked /opt/freescale/pkgs on my personal private local machine and am attaching all the lkc* downloads I had previously acquired. (lkc-1.4.tar.gz, please see top first entry of this discussion for the attachment).

As of this writing the latest Freescale Linux BSP's can be found at http://www.freescale.com/imx6tools, which are now Yocto Project based replacing LTIB. It is recommended to use Yocto Project BSP as LTIB BSP's are no longer being updated by Freescale (software updates, newer kernel, etc).

> Also, I have another question related to imx_usb_loader, is imx_usb_loader is only for loading u-boot or can it be used for >flashing system.img also.

Only u-boot.

For your question on imx_usb_loader - it is best to start a new community post for different topic question. And in fact searching http://community.freescale.com you will see others have asked about this. As an example see https://community.freescale.com/docs/DOC-94117 where you can inspect the source code for the app.

-Curtis

No ratings
Version history
Last update:
‎04-21-2014 02:28 PM
Updated by: