Customizing the Openmoko Distribution

From Openmoko

Revision as of 16:20, 29 July 2007 by Bryce.Leo (Talk | contribs)

Jump to: navigation, search

Contents

What's the goal?

The goal of this page is to teach you how to take an application that you've coded (or the sample app) and properly get it included in your rootfs. This article is a bit of an aggregate page, it's going to take information from MokoMakefile Using_a_local_overlay Building_a_hello_world_application and Create_a_package_from_existing_sources. So as you can see the goal is for it to be a very thorough introduction, and will take you from "Idea to Inclusion" of your application.


Setting Up the OpenMoko Environment

This part of the tutorial is going to be pretty basic. I absolutely love MokoMakefile, it's fantastic, the creator has done and continues to do a fantastic job with this. I see absolutely no reason not to use it. However I cannot for the life of me understand why they create their working directory in /home/moko, the home directory is for home directories for users of your system, not for a development directory. I put my OpenMoko development directory in /home/bryce/mokodev/ and that works great for me, and also makes more sense so that multiple users on my machine could develop with no attempt to overlap.

To get your environment setup please get it setup according to MokoMakefile however if you do have the build environment setup manually and you're sure you know what you're doing then feel free to go forward with this.

Setting Up a Local Overlay

If you're at the point for setting up a local overlay this means a couple things. First: You've had a brilliant idea for an application that you just need to have on the OpenMoko platform. Second: You realize that this killer app of yours needs to be done properly and you're not going to do anything silly like include it in the actual tree for the OpenMoko distro because it would probably end up just getting overwritten eventually, or you just realize taht it's bad practice!


To create a local overlay:

  • Create a "local" directory and its subdirectories
mkdir local local/conf local/classes local/packages
  • Copy site.conf from the openmoko tree to local/conf
cp oe/conf/site.conf local/conf/site.conf
  • Edit the site.conf you copied to add the new tree as a source for bitbake recipes.

Change the current BBFILES to look like this:

BBFILES := "${OMDIR}/openembedded/packages/*/*.bb ${OMDIR}/oe/packages/*/*.bb ${OMDIR}/local/packages/*/*.bb"

Change your BBFILE_COLLECTIONS line to look like this:

BBFILE_COLLECTIONS = "upstream local overlay"

Add this line:

BBFILE_PATTERN_overlay = "^${OMDIR}/local/"

Add this line:

BBFILE_PRIORITY_overlay = "20"

The BBFILE_PRIORITY should be greater than all the other BBFILE_PRIORITY variables on the same file.

  • Change your BBPATH environment variable to add the new tree before the two others for MokoMakefile, the variable is on the setup-env file.
export BBPATH="${OMDIR}/build:${OMDIR}/local:${OMDIR}/oe:${OMDIR}/openembedded"


Using your new Local Overlay

Personal tools

What's the goal?

The goal of this page is to teach you how to take an application that you've coded (or the sample app) and properly get it included in your rootfs. This article is a bit of an aggregate page, it's going to take information from MokoMakefile Using_a_local_overlay Building_a_hello_world_application and Create_a_package_from_existing_sources. So as you can see the goal is for it to be a very thorough introduction, and will take you from "Idea to Inclusion" of your application.


Setting Up the OpenMoko Environment

This part of the tutorial is going to be pretty basic. I absolutely love MokoMakefile, it's fantastic, the creator has done and continues to do a fantastic job with this. I see absolutely no reason not to use it. However I cannot for the life of me understand why they create their working directory in /home/moko, the home directory is for home directories for users of your system, not for a development directory. I put my OpenMoko development directory in /home/bryce/mokodev/ and that works great for me, and also makes more sense so that multiple users on my machine could develop with no attempt to overlap.

To get your environment setup please get it setup according to MokoMakefile however if you do have the build environment setup manually and you're sure you know what you're doing then feel free to go forward with this.

Setting Up a Local Overlay

If you're at the point for setting up a local overlay this means a couple things. First: You've had a brilliant idea for an application that you just need to have on the OpenMoko platform. Second: You realize that this killer app of yours needs to be done properly and you're not going to do anything silly like include it in the actual tree for the OpenMoko distro because it would probably end up just getting overwritten eventually, or you just realize taht it's bad practice!


To create a local overlay:

  • Create a "local" directory and its subdirectories
mkdir local local/conf local/classes local/packages
  • Copy site.conf from the openmoko tree to local/conf
cp oe/conf/site.conf local/conf/site.conf
  • Edit the site.conf you copied to add the new tree as a source for bitbake recipes.

Change the current BBFILES to look like this:

BBFILES := "${OMDIR}/openembedded/packages/*/*.bb ${OMDIR}/oe/packages/*/*.bb ${OMDIR}/local/packages/*/*.bb"

Change your BBFILE_COLLECTIONS line to look like this:

BBFILE_COLLECTIONS = "upstream local overlay"

Add this line:

BBFILE_PATTERN_overlay = "^${OMDIR}/local/"

Add this line:

BBFILE_PRIORITY_overlay = "20"

The BBFILE_PRIORITY should be greater than all the other BBFILE_PRIORITY variables on the same file.

  • Change your BBPATH environment variable to add the new tree before the two others for MokoMakefile, the variable is on the setup-env file.
export BBPATH="${OMDIR}/build:${OMDIR}/local:${OMDIR}/oe:${OMDIR}/openembedded"


Using your new Local Overlay