Revisiting LTIB on i.MX5x (this time with Java)
Published on October 28, 2010
We've recently been hearing from customers that they'd like to use the Nitrogen i.MX51 board as a Java platform, and have customers using both Ubuntu and Debian to develop their applications in Java. Each of those userland environments has merit, but also drawbacks. Neither is particularly small.In this post, I'll walk through the LTIB alternative, which is a lighter-weight method of getting Sun's JRE (1.6.0.10) up and running on a Nitrogen board.In our previous post on LTIB we described some of the issues we encountered in our first attempts at using the LTIB package from Freescale. We also glossed over a number of steps. In this post, we'll try to detail each step and will publish the resulting configuration file.
Step 1: Get and install LTIB core package
The current release of the Freescale LTIB package can be found on the Freescale site.You may need to register with Freescale and agree to their licensing provisions.Once downloaded, the file L2.6.31_10.07.11_ER_source_bundle.tar.gz
will contain a couple of packages:
user@host:~/Downloads$ tar ztvf L2.6.31_10.07.11_ER_source_bundle.tar.gz
-rwxrwxrwx 0/0 19184893 2010-08-04 10:25 L2.6.31_10.07.11_ER_docs.tar.gz
-rwxrwxrwx 0/0 600781672 2010-08-02 09:38 L2.6.31_10.07.11_ER_source.tar.gz
You'll want to extract them from the bundle and then extract the contents of the source package:
user@host:~/Downloads$ tar zxvf L2.6.31_10.07.11_ER_source_bundle.tar.gz
L2.6.31_10.07.11_ER_docs.tar.gz
L2.6.31_10.07.11_ER_source.tar.gz
user@host:~/Downloads$ tar zxvf L2.6.31_10.07.11_ER_source.tar.gz
L2.6.31_10.07.11_ER_source/
L2.6.31_10.07.11_ER_source/redboot_201003.zip
L2.6.31_10.07.11_ER_source/package_manifest.txt
L2.6.31_10.07.11_ER_source/pkgs/
L2.6.31_10.07.11_ER_source/pkgs/libXrender-0.9.4.tar.bz2.md5
L2.6.31_10.07.11_ER_source/pkgs/strace-4.5.14-linux-dirent.patch.md5
L2.6.31_10.07.11_ER_source/pkgs/net-tools-1.60.tar.bz2.md5
...
After doing this, you'll find an install
script that will install LTIB onto your machine.
user@host:~/Downloads$ ls L2.6.31_10.07.11_ER_source/
EULA install ltib.tar.gz package_manifest.txt pkgs redboot_201003.zip tftp.zip
Running the install
script will prompt you to agree to some license terms and ask you where you want to install LTIB. Note that the directory name ltib
will be appended to your answer.
user@host:~$ ./L2.6.31_10.07.11_ER_source/install
You are about to install the LTIB (GNU/Linux Target Image Builder)
Before installing LTIB, you must read and accept the EULA
(End User License Agreement) which will be presented next.
Do you want to continue ? Y|n
Y
Hit enter to continue:
IMPORTANT. Read the following Freescale Software License Agreement
("Agreement") completely. By selecting the "I Accept" button at the
end of this page, you indicate that you accept the terms of the
...
I have read and accept the EULA (yes|no):
yes
The LTIB files are extracted from a tar file which includes the
prefix ltib. After installation you will find LTIB in:
/home/user/ltib
Where do you want to install LTIB ? (/home/user)
Making target directory /home/user/ltib
Installing LTIB to /home/user/ltib
ltib/
ltib/hash
ltib/doc/
ltib/doc/LtibFreescaleSpecifics
ltib/doc/LtibReleaseProcess
ltib/doc/LtibCreateNewTarget
ltib/doc/LtibTodo
ltib/doc/LtibFeatures
...
Step 2: Fix up for an Ubuntu host and run ltib for the first time
This is stage where some edits to LTIB are necessary on an Ubuntu 10.04 host. Refer to the previous post for commentary.Edit the ltib script, changing a zero to a one:
user@host:~/ltib$ diff -Naurb ltib.original ltib --- ltib.original 2010-10-27 10:46:14.000000000 -0700 +++ ltib 2010-10-27 10:46:41.000000000 -0700 @@ -192,7 +192,7 @@ hostcf => 0, fullbsp => 0, distmap => 0, - no_sudo_check => 0, # fc9 work-around + no_sudo_check => 1, # fc9 work-around help => 0, };
Add an item to your sudoers
file (replacing user
with your username):
user ALL = NOPASSWD: /usr/bin/rpm, /opt/freescale/ltib/usr/bin/rpm
At this stage, you should be able to run LTIB for the first time. This first run populates /opt/freescale
with LTIB packages from your source bundle and completes the installation of LTIB itself.
user@host:~/ltib$ ./ltib -c
Installing host support packages.
This only needs to be done once per host, but may take up to
an hour to complete ...
If an error occurs, a log file with the full output may be found in:
/home/user/ltib/host_config.log
...
If you have trouble at this stage, it's most likely due to un-met dependencies in your host environment. Check out these links for details:
- https://www.imxdev.org/wiki/index.php?title=All_Boards_LTIB
- https://www.imxdev.org/wiki/index.php?title=ALL_Boards_ltib_config_ubuntu
- https://forums.freescale.com/t5/i-MX-Microprocessors/iMX25-SDK-LTIB-error-with-Ubuntu/td-p/52117
Also note that if you do have problems in this stage, you may need to remove some files from /opt/freescale/ltib/usr/src/rpm/BUILD
because LTIB is Cowardly. As the message above says: refer to host_config.log
for details.Assuming all of it's dependencies are met, LTIB will eventually present you with a series of kconfig
menus asking you to define the type of device and the details of what you'd like it to build.The first iteration will prompt you to select your device type. Choose "Freescale reference platform", save and exit.The second iteration will prompt you for the machine type and release type. Choose
imx5x
and Gnome release
respectively.The system will then allow you to select packages and set various options for userland startup. There are far too many options to discuss in one blog post, so we'll simply take the defaults for now and allow compilation to complete.If you're running on an Ubuntu development machine, you may need to patch the
gtkhtml
package with the following:
diff --exclude CVS --exclude .git -uNr gtkhtml-3.24.2/gtkhtml/Makefile.in gtkhtml-3.24.2.modified/gtkhtml/Makefile.in --- gtkhtml-3.24.2/gtkhtml/Makefile.in 2008-11-19 22:12:29.000000000 -0700 +++ gtkhtml-3.24.2.modified/gtkhtml/Makefile.in 2010-07-05 21:12:13.199920018 -0700 @@ -384,7 +384,6 @@ INCLUDES = -I$(top_srcdir) -I$(srcdir) - -I$(includedir) $(GTKHTML_CFLAGS) $(SOUP_CFLAGS) $(I18N_LIB_CFLAGS)
If you place the contents of this tarball into /opt/freescale/pkgs/
, you can save yourself the steps of hand editing.Full disclosure: you may also have some other difficulties during the build process. As with most other userland cross-compilation toolkits, we've found some issues related to leakage from your host environment into the cross-compile. LTIB does an impressive job of pulling together all of the bits, but there are a lot of details to catch.If all goes according to plan, you should end up with a message like this:
Filesystem stats, including padding:
Total size = 324124k
Total number of files = 18221
Started: Thu Oct 28 05:46:19 2010
Ended: Thu Oct 28 05:51:39 2010
Elapsed: 320 seconds
Build Succeeded
Step 3: Add gstreamer acceleration
In the steps above, we didn't include the Freescale codec package. The reason we omitted this step is that the first build of LTIB will populate /opt/freescale
and the codec package needs to be installed into that directory.At this point you can download the multimedia codec source bundle. The bundle consists of both documents and the packages, so you'll need a couple of unzip steps:
user@host:~/Downloads$ ls MX5X_10.07_SS_MM_Standard_Source_Bundle.zip
MX5X_10.07_SS_MM_Standard_Source_Bundle.zip
user@host:~/Downloads$ unzip -l MX5X_10.07_SS_MM_Standard_Source_Bundle.zip
Archive: MX5X_10.07_SS_MM_Standard_Source_Bundle.zip
Length Date Time Name
--------- ---------- ----- ----
305549 2010-08-04 12:28 Linux_Multimedia_Framework_Docs_MX51Ubuntu_1.9.0.tar.gz
45482112 2010-08-02 15:39 MX5X_10.07_SS_MM_Standard_Source.zip
--------- -------
45787661 2 files
user@host:~/Downloads$ unzip MX5X_10.07_SS_MM_Standard_Source_Bundle.zip Archive: MX5X_10.07_SS_MM_Standard_Source_Bundle.zip
inflating: Linux_Multimedia_Framework_Docs_MX51Ubuntu_1.9.0.tar.gz
inflating: MX5X_10.07_SS_MM_Standard_Source.zip
user@host:~/Downloads$ unzip MX5X_10.07_SS_MM_Standard_Source.zip
Archive: MX5X_10.07_SS_MM_Standard_Source.zip
creating: MX5X_10.07_SS_MM_Standard_Source/
inflating: MX5X_10.07_SS_MM_Standard_Source/fsl-mm-codeclib-1.9.0.tar.gz
...
inflating: MX5X_10.07_SS_MM_Standard_Source/gst-plugins-base0.10_0.10.25-2ubuntu1.2-fslmm3.tar.gz
inflating: MX5X_10.07_SS_MM_Standard_Source/gst-fsl-plugin_1.9.0.orig.tar.gz
extracting: MX5X_10.07_SS_MM_Standard_Source/gst-fsl-plugin_1.9.0-2.diff.gz
extracting: MX5X_10.07_SS_MM_Standard_Source/fsl-mm-codeclib_1.9.0-2.diff.gz
user@host:~/Downloads$ cp -fv MX5X_10.07_SS_MM_Standard_Source/* /opt/freescale/pkgs/
`MX5X_10.07_SS_MM_Standard_Source/fsl-mm-codeclib_1.9.0-2.diff.gz' -> `/opt/freescale/pkgs/fsl-mm-codeclib_1.9.0-2.diff.gz'
`MX5X_10.07_SS_MM_Standard_Source/fsl-mm-codeclib_1.9.0-2.dsc' -> `/opt/freescale/pkgs/fsl-mm-codeclib_1.9.0-2.dsc'
`MX5X_10.07_SS_MM_Standard_Source/fsl-mm-codeclib_1.9.0.orig.tar.gz' -> `/opt/freescale/pkgs/fsl-mm-codeclib_1.9.0.orig.tar.gz'
`MX5X_10.07_SS_MM_Standard_Source/fsl-mm-codeclib-1.9.0.tar.gz' -> `/opt/freescale/pkgs/fsl-mm-codeclib-1.9.0.tar.gz'
`MX5X_10.07_SS_MM_Standard_Source/gst-fsl-plugin_1.9.0-2.diff.gz' -> `/opt/freescale/pkgs/gst-fsl-plugin_1.9.0-2.diff.gz'
`MX5X_10.07_SS_MM_Standard_Source/gst-fsl-plugin_1.9.0-2.dsc' -> `/opt/freescale/pkgs/gst-fsl-plugin_1.9.0-2.dsc'
`MX5X_10.07_SS_MM_Standard_Source/gst-fsl-plugin_1.9.0.orig.tar.gz' -> `/opt/freescale/pkgs/gst-fsl-plugin_1.9.0.orig.tar.gz'
`MX5X_10.07_SS_MM_Standard_Source/gst-fsl-plugin-1.9.0.tar.gz' -> `/opt/freescale/pkgs/gst-fsl-plugin-1.9.0.tar.gz'
`MX5X_10.07_SS_MM_Standard_Source/gst-plugins-base0.10_0.10.25-2ubuntu1.2-fslmm3.dsc' -> `/opt/freescale/pkgs/gst-plugins-base0.10_0.10.25-2ubuntu1.2-fslmm3.dsc'
`MX5X_10.07_SS_MM_Standard_Source/gst-plugins-base0.10_0.10.25-2ubuntu1.2-fslmm3.tar.gz' -> `/opt/freescale/pkgs/gst-plugins-base0.10_0.10.25-2ubuntu1.2-fslmm3.tar.gz'
`MX5X_10.07_SS_MM_Standard_Source/gst-plugins-base0.10_0.10.25.orig.tar.gz' -> `/opt/freescale/pkgs/gst-plugins-base0.10_0.10.25.orig.tar.gz'
`MX5X_10.07_SS_MM_Standard_Source/gstreamer0.10_0.10.25-2-fslmm2.dsc' -> `/opt/freescale/pkgs/gstreamer0.10_0.10.25-2-fslmm2.dsc'
`MX5X_10.07_SS_MM_Standard_Source/gstreamer0.10_0.10.25-2-fslmm2.tar.gz' -> `/opt/freescale/pkgs/gstreamer0.10_0.10.25-2-fslmm2.tar.gz'
`MX5X_10.07_SS_MM_Standard_Source/gstreamer0.10_0.10.25.orig.tar.gz' -> `/opt/freescale/pkgs/gstreamer0.10_0.10.25.orig.tar.gz'
After this, you can configure LTIB to include them using ltib -m config
user@host~/ltib$ ./ltib -m config
You'll want to select the package gst-fsl-plugins
under the menu selections Package List
|Freescale Multimedia Plugins/Codecs
.Finally, you may want to include our color-keying patch. If so, you can apply it now. This will require two steps.The first step patches the
spec
file to include the patch:
user@host~/ltib$ cd dist
user@host~/ltib/dist$ curl https://ezurio.com/gst-fsl-plugin.spec.patch | patch -p1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
105 525 105 525 0 0 1126 0 --:--:-- --:--:-- --:--:-- 7500
patching file lfs-5.1/fsl-mm/gst-fsl-plugin.spec
The second step retrieves the gstreamer patch itself and places it into the pkgs/
directory:
user@host:~/ltib$ cd /opt/freescale/pkgs/
user@host:/opt/freescale/pkgs$ wget https://ezurio.com/gst-fsl-plugin-1.9.0-1285979227.patch && cd ~/ltib
Step 4: Add libXi and libXtst
This step took a while to figure out, and as it so often happens in the software-wrangling business, after you figure out how to do something, you find that someone else has it figured out. In this case, the wonderful community at imxdev.org has a post on how to support Java. In the third note on the page, it has a link to download the spec files for LTIB releases that don't include the libXi
and libXtst
packages that Sun's JVM requires.To install them, you'll need to download these patches and copy them into your ltib/dist/lfs-5.1/
tree:
user@host:~$ wget https://www.imxdev.org/wiki/images/9/91/Libxtst_libxi_specs.tar.gz
--2010-10-28 09:31:45-- https://www.imxdev.org/wiki/images/9/91/Libxtst_libxi_specs.tar.gz
Resolving www.imxdev.org... 74.220.215.56
Connecting to www.imxdev.org|74.220.215.56|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 814 [application/x-gzip]
Saving to: `Libxtst_libxi_specs.tar.gz'
100%[======================================>] 814 --.-K/s in 0s
2010-10-28 09:31:45 (33.5 MB/s) - `Libxtst_libxi_specs.tar.gz' saved [814/814]
user@host:~$ tar zxvf Libxtst_libxi_specs.tar.gz
libXi.spec
libXtst.spec
user@host:~$ mkdir -p ltib/dist/lfs-5.1/libXi && mv libXi.spec ltib/dist/lfs-5.1/libXi/
user@host:~$ mkdir -p ltib/dist/lfs-5.1/libXtst && mv libXtst.spec ltib/dist/lfs-5.1/libXtst/
user@host:~$ rm -f Libxtst_libxi_specs.tar.gz
After this, you still won't be able to select them using LTIB until you've added them to the files ltib/config/userspace/packages.lkc
and ltib/config/userspace/pkg_map
:
diff --git a/packages.lkc b/packages.lkc index 79e2ea4..ab9db91 100755 --- a/packages.lkc +++ b/packages.lkc @@ -3742,6 +3742,22 @@ config PKG_LIBXAW bool "libXaw" help X.Org X11 libXaw runtime library +config PKG_LIBXI + depends CAP_HAS_MMU + select PKG_XORG_SERVER + select PKG_LIBXMU + select PKG_LIBXPM + bool "libXi" + help + X.Org X11 libXi runtime library +config PKG_LIBXTST + depends CAP_HAS_MMU + select PKG_XORG_SERVER + select PKG_LIBXMU + select PKG_LIBXPM + bool "libXtst" + help + X.Org X11 libXtst runtime library config PKG_LIBXXF86DGA depends CAP_HAS_MMU bool "libXxf86dga" diff --git a/pkg_map b/pkg_map index 865bac5..4de6ac7 100755 --- a/pkg_map +++ b/pkg_map @@ -193,6 +193,8 @@ PKG_LIBXPM = libXpm PKG_LIBXT = libXt PKG_LIBXMU = libXmu PKG_LIBXAW = libXaw +PKG_LIBXI = libXi +PKG_LIBXTST = libXtst PKG_DBUS = dbus PKG_DBUS_GLIB = dbus-glib
We've placed this patch on our web-site so you can do this more quickly like so:
user@host:~/ltib/config/userspace$ curl https://ezurio.com/config_userspace_libxtst_libxi.patch | patch -p1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
102 1131 102 1131 0 0 3104 0 --:--:-- --:--:-- --:--:-- 16391
patching file packages.lkc
patching file pkg_map
Once you've installed the spec files and listed them in the package list, you can use ltib -m config
again to select them. They'll be located in the menu under Package List
|X11
:
Step 5: Compile
After all of this, compiling is pretty anti-climactic. It will also run much more quickly than the previous compile because most of the packages haven't changed:
user@host:~/ltib$ ./ltib
...
Processing: pixman
====================
Processing: libXau
====================
Processing: libxcb
====================
Processing: libXfont
...
Started: Thu Oct 28 09:57:11 2010
Ended: Thu Oct 28 10:02:19 2010
Elapsed: 308 seconds
Build Succeeded
Once again, you should see the happy words Build Succeeded
, which this time means that you have all
of the pre-requisites for Java installed.
Step 6: Install Java
Please don't assume that we're experts in Java. We were successful in choosing from the myriad of options on Oracle's site to find a JVM that runs nicely on the Nitrogen board. We chose the ARMv7, Headful, Hard Float, Little-Endian
choice from this page, although the resulting download indicated that the JVM was configured for ARMv6.We extracted it into the ltib/rootfs/root/
directory:
user@host:~/ltib/rootfs/root$ sudo tar zxvf ~/Downloads/ejre-1_6_0_10-fcs-b42-linux-armv6-vfp-eabi-min-10_jun_2010.tar.gz
ejre1.6.0_10/
ejre1.6.0_10/bin/
ejre1.6.0_10/bin/java
ejre1.6.0_10/bin/keytool
ejre1.6.0_10/bin/jcontrol
ejre1.6.0_10/bin/ControlPanel
ejre1.6.0_10/bin/java_vm
...
As you can see, the JVM binaries are loaded into ejre1.6.0_10/bin and you'll want to create a file named .profile
in the /root
directory so that java
can be found.
user@host:~/ltib/rootfs/root$ sudo vi .profile
export PATH=$PATH:/root/ejre1.6.0_10/bin
This is also a good time to grab the example code from the imxdev site and compile it:
user@host:~/ltib/rootfs/root$ sudo vi Example1.java && chmod 777 *.java
import java.awt.*;
public class Example1 extends java.applet.Applet
{
public void init()
{
add(new Button("One"));
add(new Button("Two"));
}
public Dimension preferredSize()
{
return new Dimension(480, 640);
}
public static void main(String [] args)
{
Frame f = new Frame("Example 1");
Example1 ex = new Example1();
ex.init();
f.add("Center", ex);
f.pack();
f.show();
}
}
user@host:~/ltib/rootfs/root$ sudo ecj Example1.java
Step 7: Run via NFS
At this stage, we're ready to run this image over NFS.If you're using the nfs-kernel-server
package, you'll need to add a line into /etc/exports
like the following (replacing 192.168.0.0 with your subnet):
/home/user/ltib/rootfs 192.168.0.0/255.255.255.0(rw,no_root_squash,no_subtree_check,no_all_squash,sync)
Then you'll need to tell the NFS server to load the updated file:
user@host: ~/$ sudo /etc/init.d/nfs-kernel-server reload
If you have an SD card from us, it's likely to have a kernel in the first (FAT)
partition, and you can boot it over NFS by setting your bootargs
environment variable like so:
U-Boot > set bootargs rootwait ip=dhcp root=/dev/nfs nfsroot=192.168.0.254:/home/user/ltib/rootfs
U-Boot > fatload mmc 0 92000000 uImage && bootm 92000000
reading uImage
2300984 bytes read
## Booting kernel from Legacy Image at 92000000 ...
Image Name: Linux-2.6.31-01053-g739d881-dirt
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2300920 Bytes = 2.2 MB
Load Address: 90008000
Entry Point: 90008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux................................................................................................................................................. done, booting the kernel.
Linux version 2.6.31-01053-g739d881-dirty (user@host) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-202) ) #5 PREEMPT Wed Oct 27 14:07:24 MST 2010
CPU: ARMv7 Processor [412fc085] revision 5 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
...
Freescale Semiconductor, Inc.
freescale login:
Note that you'll need to replace 192.168.0.254
with the IP address of your development machine and /home/user/ltib
with your LTIB installation directory.Because you probably haven't (yet) installed xterm
, you may need to test this from the serial console and set the DISPLAY
environment variable:
freescale login: root
BusyBox v1.15.0 () built-in shell (ash)
Enter 'help' for a list of built-in commands.
root@freescale ~$ DISPLAY=:0 java Example1
This is a probably good time to discuss the merits of NFS. I forgot to add any media to the filesystem, but can update the running system on the server side. This command will grab Freescale's 720P video file and place it in the
root
user's home directory:
user@host:~/ltib/rootfs/root$ sudo wget https://ezurio.com/FSL_Mosaic_Video_1280x720_H264_7mbps.mp4
Now that I have a video, I can test the installation of the GStreamer plugins:
root@freescale ~$ gst-launch filesrc location=FSL_Mosaic_Video_1280x720_H264_7mbps.mp4
! decodebin
! mfw_v4lsink x11enable=1
Step 8: Run via SD card
There are a quite a few ways to set your machine up to boot to SD card. In this post, I'll use the simplest by just copying the filesystem to an EXT3
filesystem in the second partition of the SD card. Because I'm using a built-in SD card reader, my physical SD card device shows up as /dev/mmcblk0
and each partition shows up as /dev/mmcblk0p#
. If you're using a USB reader, the device will likely appear as something like /dev/sdb
.
user@host:~/ltib$ sudo fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 3999 MB, 3999268864 bytes
4 heads, 16 sectors/track, 122048 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 1 3201 102424 b W95 FAT32
/dev/mmcblk0p2 3202 122048 3803104 83 Linux
user@host:~/ltib$ sudo mkfs.ext3 -L rootfs /dev/mmcblk0p2
mke2fs 1.41.11 (14-Mar-2010)
warning: 504 blocks unused.
Filesystem label=rootfs
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
238032 inodes, 950272 blocks
47538 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=973078528
29 block groups
32768 blocks per group, 32768 fragments per group
8208 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
user@host:~/ltib$ ls -l /dev/disk/by-label/
total 0
lrwxrwxrwx 1 root root 15 2010-10-28 15:29 boot -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 15 2010-10-28 15:29 rootfs -> ../../mmcblk0p2
user@host:~/ltib$ sudo partprobe /dev/mmcblk0
user@host:~/ltib$ mount | grep mmcblk0
/dev/mmcblk0p1 on /media/BOOT type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,flush)
/dev/mmcblk0p2 on /media/rootfs type ext3 (rw,nosuid,nodev,uhelper=udisks)
Copying the disk should be straightforward:
user@host:~/ltib$ cp -avfr rootfs/* /media/rootfs/
user@host:~/ltib$ sync && sudo umount /media/*
In order to configure U-Boot to boot to the second partition, you'll need to set the root=/dev/mmcblk0p2
and rootwait
command-line arguments:
U-Boot > set bootargs rootwait root=/dev/mmcblk0p2
U-Boot > fatload mmc 0 92000000 uImage && bootm 92000000
reading uImage
2300984 bytes read
## Booting kernel from Legacy Image at 92000000 ...
Image Name: Linux-2.6.31-01053-g739d881-dirt
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2300920 Bytes = 2.2 MB
Load Address: 90008000
Entry Point: 90008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux................................................................................................................................................. done, booting the kernel.
Linux version 2.6.31-01053-g739d881-dirty (user@host) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-202) ) #5 PREEMPT Wed Oct 27 14:07:24 MST 2010
CPU: ARMv7 Processor [412fc085] revision 5 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
...
Freescale Semiconductor, Inc.
freescale login:
Recap
This was a rather long post, but it still only scratches the surface of LTIB and its' usage on a Nitrogen board. There's a lot of power in the toolset, and we encourage you to engage with the LTIB community at , and also the IMX Community and imxdev.org. A lot of talented developers out there are producing some amazing things on the i.MX51 and other Freescale processors.During this build cycle, we tailored a demo image that includes some other useful parts, including mplayer
, ffmpeg
and some other bits. The .config
file is on our web site at https://ezurio.com/ltib_config_20101028.In case you just want to kick the tires on the end-result, we also copied the rootfs tarball to our web-site: https://ezurio.com/ltib_rootfs_20101028.tar.gz.