Moblin SDK Tools and Toolchain

We recommend that you use the Moblin toolchain to build your project code. This is particularly vital in two situations:

  1. You develop on Linux, but your Linux distribution uses libraries which don't align with those found on the Moblin Library List. In this case, there is a possibility that your application won't run correctly when deployed to a Moblin machine, due to library incompatibilities.
  2. You're building software on a machine whose hardware architecture is different from a Moblin machine's. For example, you're developing on a 64bit machine while the Moblin machine is a 32bit one.

In both these situations, the Moblin toolchain enables you to compile code against the right libraries and versions of those libraries, and for the right hardware architecture. But even in normal situations, using a toolchain means you can be reasonably certain your application will run once on a Moblin machine.

Installation

Download the Moblin SDK

  • Host OS: Linux 32bit
  • Uncompressed size: ~2.3 GB
  • MD5SUM: 2fbd43c1c04d025585a7bb054fd959dd

This is a large file because it contains a complete set of Moblin libraries and header files.

Unpack the SDK

The following commands assume you are the user moblin and the SDK archive file was downloaded to /home/moblin (your home directory).

$ cd /home/moblin
$ tar jvxf moblin-sdk-0.10.tar.bz2

Configure the toolchain

A script called envsetup.sh, located in the root of the SDK, sets environment variables for use during Moblin development. After extracting the SDK, edit envsetup.sh and set the value of $MOBLIN_TOOLCHAIN to the directory containing the toolchain. This will depend on where you unzipped the SDK. For example, if it was unzipped in /home/moblin/ and the version was moblin-sdk-0.10, then you would set:

$ export MOBLIN_TOOLCHAIN=/home/moblin/moblin-sdk-0.10/moblin-cross-toolchain

Add new packages to the sysroot directory

There is a sysroot directory located in /home/moblin/moblin-sdk-0.10/moblin-cross-toolchain/i586-moblin-linux/sys-root, with packages from Moblin 2.1 installed.

You can use the following command to download new packages from Moblin 2.1 repos and install them to the sysroot directory.

$ sudo yum --nogpgcheck --installroot=/home/moblin/moblin-sdk-0.10/moblin-cross-toolchain/i586-moblin-linux/sys-root install package_name

If you change the name of the SDK directory or move it to a new location in the file system after invoking yum command on it, you will meet the following errors if you run yum again:

$ sudo yum --installroot=/home/moblin/moblin-sdk-0.10/moblin-cross-toolchain/i586-moblin-linux/sys-root/ --nogpgcheck install clutter
/usr/lib/python2.6/dist-packages/iniparse/ini.py:46: DeprecationWarning: the sets module is deprecated
from sets import Set
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /home/moblin/moblin-sdk-0.10/moblin-cross-toolchain/i586-moblin-linux/sys-root/var/lib/rpm
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 309, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 157, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 189, in getOptionsConfig
self.conf
File "/usr/lib/pymodules/python2.6/yum/__init__.py", line 649, in
conf = property(fget=lambda self: self._getConfig(),
File "/usr/lib/pymodules/python2.6/yum/__init__.py", line 239, in _getConfig
self._conf = config.readMainConfig(startupconf)
File "/usr/lib/pymodules/python2.6/yum/config.py", line 792, in readMainConfig
yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
File "/usr/lib/pymodules/python2.6/yum/config.py", line 865, in _getsysver
idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed

This is a known issue for yum. Use the following command to work around this issue:

$ rm /home/moblin/moblin-sdk-0.10/moblin-cross-toolchain/i586-moblin-linux/sys-root/var/lib/rpm/__db.*
Syndicate content
Syndicate content