OpenEmbedded

OpenEmbedded - What is it?

From the OpenEmbedded website:

OpenEmbedded is a full-featured development environment allowing users to target a wide variety of devices....OpenEmbedded is a tool which allows developers to create a fully usable Linux base for various embedded systems. It has been designed to be able to handle different hardware architectures, support multiple releases for those architectures, and utilize tools for speeding up the process of recreating the base after changes have been made. Currently it can run on any Linux distribution, and plans are in place to allow it to work under Windows.

OpenEmbedded is an amazing tool for creating the distribution of your choice for your device. It includes configuration files for multiple different Linux distributions and different handheld devices.

If you are a software developer and want to help port an application to an embedded device then this is the tool you want to use for distributing the software.

With OpenEmbedded you can start one command and it will compile your kernel, all the packages you need, create a file system for the device to use, and create HaRET startup.txt files for you to use. Basically all the software you need to run Linux can be built using this tool. All that is needed to get it to work is to edit some configuration files and that is it.

When you are building an entire distribution there are lots of intricacies involved. If anything goes wrong in the middle of a build you have to start the process over again and wait for a long time once again and hope nothing goes wrong. OpenEmbedded saves you a lot of time. If something goes wrong you can look at the log files and change what you need to in any configuration files. When you start the process again, OpenEmbedded will begin right where it left off so no time is wasted building packages that have already completed.

OpenEmbedded - Where do I get it?

OpenEmbedded has very specific and easy to follow documentation on their website for getting and using their tools. Have a look at the OpenEmbedded main Wiki page: http://oe.linuxtogo.org/wiki/MainPage. There is a section labeled "Getting started with OE and BitBake." You should read through at least the first two pages listed there.

OpenEmbedded uses a public version control system to store all of its files (http://en.wikipedia.org/wiki/Version_control). The version control system they use is called Monotone (http://en.wikipedia.org/wiki/Monotone_%28software%29, http://monotone.ca/).

In order to get all the files you will need to have a version of Monotone installed. Please see the Monotone section for getting and installing Monotone.

Once you have monotone installed then you can just follow the directions on the OpenEmbedded page http://oe.linuxtogo.org/wiki/GettingStarted under "Obtaining OpenEmbedded"

OpenEmbedded - How do I install it?

OpenEmbedded is another tool that you cannot really install. You just have to download the files from their servers and build what you need using other tools. As it says on the front page of the OpenEmbedded website, OpenEmbedded is not a build system on its own but is just a repository of metadata that other tools use to build a final product.

There are several other tools that OpenEmbedded depends on. The current list of software required can be found on this page: http://oe.linuxtogo.org/wiki/RequiredSoftware. So in order for the files you download from their servers to have any meaning you must install all the required software on that page.

For more specific instructions on setting up and configuring the required dependencies see this page: http://oe.linuxtogo.org/wiki/OEandYourDistro. Please note that the instructions on this page can be a little out-dated and should not be taken verbatim as there may be some changes you need to make to be compatible with your version of your distribution.

OpenEmbedded - How do I use it?

The following is a very simple listing of steps needed to get you running OpenEmbedded. For a more complete tutorial see the OpenEmbedded website http://oe.linuxtogo.org/wiki/GettingStarted.

To start you need to have OpenEmbedded downloaded and all the prerequisite software installed. For more information see the other sections on this page. I will assume that you have followed the steps on the OpenEmbedded documentation page and that you have downloaded OpenEmbedded to the /stuff/ directory.

  1. Make sure your files are up to date
    • mtn --db=/stuff/OE.mtn pull monotone.openembedded.org org.openembedded.dev
    • cd /stuff/org.openembedded.dev && mtn update
  2. The most important step is creating and specializing your own local.conf file. You will need to copy the example local.conf to your own build directory and edit that copy.
    • cp org.openembedded.dev/conf/local.conf.sample build/conf/local.conf
  3. Now use your favorite text editor and go through and read the entire file. Understand what each part is meant for. Remove anything that you do not need. OpenEmbedded will NOT build anything until you have modified this file. If you read the sample local.conf file you will know what I am referring to (this is not meant to be a smart-alek remark but is meant to get you to actually read and understand the file).
    • Here is a list of some of the settings you will want to pay special attention to in your local.conf
      • BBFILES - This is the location of your *.bb files. The give bitbake the information it needs to compile the packages. This will look something like /stuff/org.openembedded.dev/packages/*/*.bb
      • DISTRO - The actual distribution you want to build. This will be the name of a folder inside the conf/distros folder.
      • MACHINE - This should be set to the name of a file inside the conf/machine folder
  4. You need to have the proper environment variables set in order to build anything. The following is an example of a text file you can create and just use the command source thisfile.txt to set up all your environment variables.
    • BBPATH=/stuff/:/stuff/build/:/stuff/org.openembedded.stable/
      PKGDIR=/stuff/build/
      DL_DIR=/stuff/downloads
      if [ -z ${ORG_PATH} ]
      then
      ORG_PATH=${PATH}
      export ORG_PATH
      fi

      if [ -z ${ORG_LD_LIBRARY_PATH} ]
      then
      ORG_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
      export ORG_LD_LIBRARY_PATH
      fi
      PATH=/stuff/bitbake-1.8.8/bin:${ORG_PATH}
      cd $PKGDIR
      LD_LIBRARY_PATH=
      export PATH LD_LIBRARY_PATH BBPATH
      export LANG=C
      echo "Altered environment for OE Development"
  5. After following these steps you can try and build a package by typing bitbake nano. This will build the nano package for your specific device.