Skip to content. Skip to navigation

Ian Lawrence

Sections
Personal tools
You are here: Home Blog Mobile Linux Image Creation Made Easy With Moblin

Mobile Linux Image Creation Made Easy With Moblin

This article walks through the process of creating a working image of Ubuntu Mobile & Embedded for your mobile device. Running this image on a device will boot the Linux kernel, load the appropriate drivers, start X, show the UI, and allow you to launch applications.

This is a fast moving project.

As such the canonical url for image creation is on moblin.org

not here.


Moblin-Image-Creator, or
Image-Creator for short, is a tool
aimed at making life easier for the
mobile and embedded developer.

The tools is designed to be extremely
flexible.

Initial focus is on a new class of
devices known as Mobile Internet
Devices (MID's), but the design of
image-creator is not MID specific and
talk is already in progress to
add new platform definitions to build
Consumer Electronics stacks such
as TV set-top boxes.

There are three fundamental
features that moblin provides:

* creation of a platform specific build
environment

* creation of platform specific target
file-systems

* providing user selectable "feature
sets" (or fsets) to install bundles of
packages that provide some high-level
functionality

Install

To install moblin in Ubuntu Feisty
make sure you have the essential
'tools' needed to compile
Moblin and to view the Ubuntu Mobile
User Interface:
vern@N800-hacker:~$ apt-get install build-essential fakeroot debootstrap xserver-xephyr
then check out the Moblin source from moblin.org. Build, install, and run it.
vern@N800-hacker:~$ apt-get install git-core
vern@N800-hacker:~$ mkdir moblin;cd moblin
vern@N800-hacker:~/moblin$ git clone rsync://moblin.org/repos/tools/moblin-image-creator.git
vern@N800-hacker:~/moblin$ cd moblin-image-creator/
vern@N800-hacker:~/moblin/moblin-image-creator$ sudo make install
You must be root in order to run image-creator:
vern@N800-hacker:~/moblin/moblin-image-creator$ sudo image-creator
this will bring up the moblin GUI for us to have a look.
Moblin


















Cool, quit the application and go back to your shell:
vern@N800-hacker:~/moblin/moblin-image-creator$ cd ..
vern@N800-hacker:~/moblin$ mkdir image
this will be your 'Project' folder which you will 'add' in the Moblin GUI, so start the GUI again:
vern@N800-hacker:~/moblin$ sudo image-creator
and in the top area 'Platform Projects' click the Add button. In the dialogue choose a name for your project and a description.
Then for the path choose the folder
'image' we created above.
For the platform choose mccaslin which
is the default. When you click OK this
will create your project (this takes
some time so maybe grab a coffee)

When this has finished we need to add
a target, so again click the Add button
under 'Targets' in the GUI and choose
some name for the target.
(again this takes some time so maybe
grab another coffee or something)

When this has finished we then need
to Add a Functional Set into the target.
If you are interested here is some
more info about fset's.

So what is a Functional Set?

Moblin calls a bundle of packages an fset,
where fsets can have dependencies
on other fsets, and installing an fset
will automatically install dependent
fsets. If you are interested in finding
out more about fset's you can see an
example of an fset configuration file
here



[Core]
DESC=Fundamental fset that provides a root filesystem
PKGS=linux-image-386
DEBUG_PKGS=gdb man-db manpages
DEPS=


[Hildon-Application-Framework]
DESC=Hildon Application Framework for enabling Mobile Applications
PKGS=ubuntu-mobile sdk-default-icons
DEBUG_PKGS=
DEPS=core
From the above snippet you can see
two fsets, the "core" fset that provides
additional packages to make it
possible to boot a target filesystem
and get to a command line prompt,
and a "hildon-application-framework"
fset that will install additional package
(on top of core) to enable running a
Hildon desktop.

Back to using moblin.

Choose the target you just created and
click the 'Add Functional Set' button
and in the drop down click
ubuntu-mobile.
This uses apt-get to install the fset or
fset's so you need internet access.
(again this takes a long time so do something else for a while..drinking another cup of coffee would probably not be so good for your health!)

After this finishes, choose it in the GUI
and then click the button 'Terminal'.
The UI of Ubuntu Mobile currently
uses Flash (this may change
depending on whether Gnash can
handle XML calls to start applications.)
To see the UME User Interface then
we need to add the 'multiverse' and
'restricted' repositories In the terminal
you just opened :
root@N800-hacker:~# echo `cat /etc/apt/sources.list` "multiverse restricted" > /etc/apt/sources.list
root@N800-hacker:~# apt-get update
root@N800-hacker:~# apt-get install flashplugin-nonfree
root@N800-hacker:~# mkdir -p /root/.mozilla/plugins
root@N800-hacker:~# ln -s /usr/lib/flashplugin-nonfree/libflashplayer.so \
/root/.mozilla/plugins/libflashplayer.so
we also need to add a patched xserver too (this is a temporary step and will disappear when some Compiz/Beryl issues have been resolved)
root@N800-hacker:~#  wget http://people.ubuntu.com/~bryce/Testing/xorg-server/xserver-xorg core_1.3.0.0.dfsg-6ubuntu1_i386.deb
root@N800-hacker:~# dpkg -i xserver-xorg-core_1.3.0.0.dfsg-6ubuntu1_i386.deb
we also need to export the DISPLAY variable so that we can have the Ubuntu Mobile UI show in the correct window.
root@N800-hacker:~# export DISPLAY=:2
Now open another terminal shell on your Ubuntu System (Applications->Accessories->Terminal) :
vern@N800-hacker:~$ Xephyr :2 -host-cursor -screen 800x480x32 -dpi 96 -ac -extension Composite
(notice the -extension Composite at the end of the line which makes use of the xserver patch we installed using dpkg above) This will open a new window that is of size 800x480 and has access controls turned off. Back in the other terminal (the one which opened when you clicked the button in the Moblin GUI)
root@N800-hacker:~# ~/.xinitrc 
and this will start the Ubuntu Mobile
User Interface in the window.
UME Flash

You can watch a screencast here:

Ubuntu Mobile .ogg
Ubuntu Mobile .avi

Note: It is often a good idea to
restart d-bus fairly regularly in the
moblin terminal:
root@N800-hacker:~# /etc/init.d/dbus restart
* Stopping system message bus dbus [ OK ]
* Starting system message bus dbus [ OK ]

Creating the image!!


Create the type of image you want
and burn it to your USB Pen
Drive

1. Select the project in the 'Platform
Projects' section

2. Select the target in the 'Targets'
section

3. Click the button in the 'Targets
Images' section to create the image.

For USB images, plug a USB Pen Drive
into your workstation, then click
'Write USB Image' to burn the image
to the pen drive. The contents of the
USB Pen Drive are completely replaced
by the image.
CD Images do not work yet.

Here are some FAQ's from the Moblin
README


Q: Why bother with buildroot
environment? Why can't I just install
Ubuntu Gutsy and build my mobile
apps directly on my workstation?


A: Using a buildroot allows the user to
isolate the build machine
dependencies from that of the host
workstation (or build server.)
Today all MID work is focused on
Gutsy, so using Gutsy on your
workstation and then installing all the
needed build dependencies will work,
but one of the goals of image-creator
is to provide a build environment that
will continue to work for a given
product long after the product's base
distribution has fallen out of fashion.

Q: In order to use image-creator to I
have to install Ubuntu on my
workstation?

A: When run on an Ubuntu (or any
debian derivative distro), it is possible
to generate RPM packages that work
on various RPM based distributions, so
while building image-creator is not
supported on a non-debian system,
there are a few pre-built RPM's
available on the project download
page. The list of available RPM
packages will change over time
(depending on demand).

Q: Why is the image-creator
dependent on debian packaging?
Why not use RPM's?

A: Initial prototyping was actually
based on Fedora RPM's using yum to
auto-resolve dependencies in the same
way we use apt today. From day one
the use of yum has proven itself to be
less then ideal for the way we wanted
to use it, while at the same time the
number of base Fedora package that
we needed to touch were quickly
taking us to the point of maintaining
a full distribution. By moving
image-creator to a debian
package / apt based implementation
and joining the Ubuntu-Mobile team,
we were able to gain advantage from
both the richer set of debian
technologies while at the same time
push all of our distribution
requirements into the upcoming
Ubuntu Gutsy repository.

Q: How does cross compiling work?

A: Since the initial targets for
image-creator are all x86 based,
then we are able to simplify the
build by just using the native compiler
either installed in the buildroot or
installed on the host workstation
(if the workstation is running the
same base as the target.)
Regardless of this, one of the
advantages of making image-creator
debian based is that there is a rich set
of cross-compiling packages for just
about any architecture. There
shouldn't be any problem in creating
a new platform definition that pulls
from an apt database of packages
built for the target architecture, and
that build additional packages using
existing cross-compiling technologies.

Ian Lawrence

The upstream source for all this
goodness is here
_____
tags:
Friday, July 20, 2007 in Code  | Permalink |  Comments (3)
del.icio.us   Digg   Yahoo   Google   Spurl

Terminals and workspaces

Posted by vern at 2007-07-21 13:35
An easy way to keep track of which terminal belongs to the workstation, project, or target, is to add the following lines to the /root/.bashrc file in the project and target (note the comments inside):

alias ll='ls -al --color'
alias ls='ls --color'
alias ai='apt-get install'
alias as='apt-cache search'
alias ap='apt-cache policy'
BLUE='\[\033[01;34m\]'
GREEN='\[\033[01;32m\]'
BLACK='\[\033[00m\]'
YELLOW='\[\033[01;33m\]'
RED='\[\033[01;31m\]'

# IN PROJECT:
PS1=$BLACK'['$BLUE'\u@Project '$BLUE'\W'$BLACK']\$ '
# IN TARGET:
PS1=$BLACK'['$RED'\u@Target '$BLUE'\W'$BLACK']\$ '
export PS1

A few updates

Posted by rustyl at 2007-08-09 19:46
You no longer need to add the multiverse and restricted repository configurations since they are now part of the default configuration.

We also no longer need to install Bryce's patched xserver. The version uploaded to Gutsy has the needed composite patch.

We also fixed the Flash package so that now just installing the package is all that is needed. If you are using a Samsung Q1 Ultra then you can also just install the samsung-full-mobile-stack-with-proprietary and have the flash packaged installed by the tool.

Do you have any Nokia N800 Images to share ?

Posted by kevinverma at 2009-01-10 16:11
Hello,

I was curious to look for N800 images of Moblin, it looks you've been creating for same.

Please let me know if you got an image to share.

Regards,
Kevin Verma
Blog
« January 2018 »
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Categories:
Borala (4)
Bricolabs (12)
Code (57)
Estudiolivre (12)
Life (26)
MetaReciclagem (9)
Thoughts (16)
Work (41)