Releases/0.2/PlatformDeveloper

Platform Developer

Abstract

To start building Mamona yourself, hacking the packages and etc you first need to install the Mamona build environment. Mamona is nothing more that a custom OpenEmbedded distribution, so to build it you'll just need the bb files and BitBake to actually build the packages.

Mamona Installer

Mamona installer is a set of scripts and configuration files which will help you to install and to configure your environment in order to have everything you need.

In this section we will use only scripts required by SDK.

You have 4 options to install the Mamona Installer:

NOTE: Read Mamona Installer for further information about how to install it.

Platform Install

To install Mamona Platform just execute mamona-platform-install. It will checkout the Mamona Git repoositories and the Bitbake.

$ mamona-platform-install

This script will create the directory mamona with all Mamona Platform files at your current directory. You can also give the option -d to give the path you want to install Mamona Platform.

At this moment you should have the mamona development git tree under this directory. If you want to use the Mamona-0.2 release you must go into mamona/mamona.git and get mamona-0.2 branch manually:

cd mamona/mamona.git
git checkout origin/mamona-0.2 -b mamona-0.2

Platform Development

There are three basic operations to build a Mamona distribution:

  • Setup your terminal with Mamona configuration.
  • Choose the target device.
  • Run bitbake to start the build.

Setting up you terminal

To setup your terminal instance, you must run the following command

$ source mamonarc

This command will load all the Mamona stored configuration (Mamona directory, target device, etc)

Choosing the target device

To choose the target device run

$ source mamonarc -m nokia770 -s

This example will set Nokia 770 as target device. The -s options means save options. To know more about mamonarc options use source mamonarc -h.

Running Bitbake

To compile any package, you must run bitbake. Bitbake receives as parameter the task to be executed. A task can be a package or a meta package (a set of packages). Bitbake builds all the packages dependencies first. So, after running it, you will have all necessary packages to install and run the required one. To build the whole Mamona distribution run

$ bitbake meta-mamona

Known issue: The gcc 4.3 can't be used as host compiler. See the Ticket #164

For further details about Mamona Platform development check the  OpenEmbedded Documentation and  Bitbake Users Manual.

Repository Generation

Now you are ready to use the generated .deb packages. mamona-gen-utils script will help you to setup a deb repository.

If you have already setup your environment using mamonarc script all that you need is this command that will generate a repository on your deploy directory:

$ mamona-gen-utils repository
# For more details about mamona-gen-utils use $ mamona-gen-utils --help
/where_is_your/mamona/tmp/nokia770/default/deploy/deb-repository or something like this.

CPU Transparency

mamona-cputransp is a start/stop service that enable/disable your mamona-qemu-arm, which is provided by Mamona Installer.

Enable:

$ sudo mamona-cputransp start

Disable:

$ sudo mamona-cputransp stop

NOTE: Read CPU Transparency for further information about how it works.

Debootstrap

Now that you already have your own Mamona repository you probably will want to have a chroot environment. mamona-gen-utils script can help you on this task. It uses cdebootstrap to get all base packages from your repository.

Note: At this point you must have your mamona-qemu-arm working properly. Start mamona-cputransp before go on.

If you have already setup your environment using mamonarc script all that you need is this command that will generate a rootfs on your deploy directory:

$ mamona-gen-utils rootfs
# For more details about mamona-gen-utils use $ mamona-gen-utils --help
/where_is_your/mamona/tmp/nokia770/default/deploy/mamona-rootfs or something like this.

Note:This cdebootstrap example doesn't configure correctly your apt repository (apt/sources.list). Read below instructions to do the correct configuration.

Using your local repository with apt

At this point you must have a debootstrap directory (assuming deploy/deb-repository) and a rootfs (assuming deploy/mamona-rootfs).

In your host machine:

sudo mkdir -p deploy/mamona-rootfs/var/deb-repository
sudo mount --bind deploy/deb-repository deploy/mamona-rootfs/var/deb-repository
sudo mamona-chroot deploy/mamona-rootfs

In your chroot environment:

echo "deb file:/var/deb-repository mamona main" > /etc/apt/sources.list
apt-get update

Now you are ready to use apt-get to install any package.

After leave the chroot remember to umount deploy/mamona-rootfs/var/deb-repository

sudo umount deploy/mamona-rootfs/var/deb-repository

Success

Congratulations. Now you know how to hack Mamona platform.

Read Application Developer to know more about how to use your chroot environment to develop an applicatioin. You can also read Running Mamona to know more about how to use and generate a complete FIASCO image to flash into your device.