Open Embedded Setup

From Sage Wiki
Jump to: navigation, search

OpenEmbedded is a build framework used to build Linux kernel and root filesystems for embedded devices. The Sage EDK includes support for using OpenEmbedded in conjunction with Coreboot to build an image-on-flash.

Warning: OpenEmbedded uses almost 20GB of disk space to build.


Linux Distribution Dependencies

OpenEmbedded does NOT currently build on Windows environments. Please install a Linux distribution before following these instructions.
BitBake and OpenEmbedded have several operating-specific dependencies. Please review the OEandYourDistro document at OpenEmbedded for a list of updates necessary for your specific Linux distribution.

Import the OpenEmbedded and BitBake Eclipse projects

If your system is connected to the internet, the most current OpenEmbedded and BitBake projects may be imported from a public Git repository. This method is recommended for easy updates.

Alternatively, you may import these projects from the Sage EDK distribution DVD.

Importing from Public Git Repository - Project Set File

To get the latest source from Sage or the community use the Project Set Files that are included in the samples_workspace.

  1. Click on File > Import... and the Import dialog will appear.
  2. Expand the Team category and select Team Project Set, then click on Next
  3. Click on Browse and navigate to the psf directory beneath the Sage EDK installation directory.
  4. Select sage_openembedded_projectSet.psf and click OK.
  5. Click on Finish to import these projects.

Importing from the Sage EDK distribution DVD

Insert the DVD and follow these instructions to import the projects:

  1. Click on File > Import... and the Import dialog will appear.
  2. Expand the General category and select Existing Projects into Workspace, then click on Next
  3. With Select root directory: selected, click on the Browse... button to its right and navigate to your DVD drive and select samples_workspace. Click on OK when you have selected the folder.
  4. The Import Projects window will examine the folder to find all the projects. Select the openembedded and bitbake projects.
    • Check the Copy projects into workspace checkbox.
  5. Click on Finish to import these projects.

Note: There are some parts of the OpenEmbedded build that require that the imported files have write permissions. The Sage EDK does not set these permissions during import. As such, if you are importing from the Sage EDK distribution DVD, an additional step is necessary.

  1. Get a terminal prompt and change to your Sage EDK workspace directory
  2. Execute : chmod +w openembedded -R

Configure OpenEmbedded within the SageEDK

The Sage EDK project default configuration is set to build a small busybox based image for the Persimmon mainboard. This image is defined in the file recipes/images/ If you are building for a Persimmon platform or for demonstration purposes, no configuration changes are necessary. Continue to the Build section.

The following instructions are for building for an alternate platform or to create a different image.

Configure the SageEDK build target

To change the name of the target being built within the Sage EDK:

  • Right click on the OpenEmbedded project and choose Properties.
  • Select C/C++ Build and click the Behaviour tab.
  • Change the name of the Build (Incremental Build) for your target.

The following build targets are provided for demonstration:

  • micro-image-sage - A small image that will fit on a 4MB flash part.
  • minimal-image-sage - A small image that will fit on an 8MB flash part. Contains additional debug tools and Real-Time Linux tests.

Configure OpenEmbedded

The OpenEmbedded DISTRO and MACHINE are set to micro-image and persimmon by default. These and other configuration changes are stored in the conf/local.conf file.

OpenEmbedded is a very complex framework. For full documentation, please visit the OpenEmbedded Documentation Page.

Build OpenEmbbeded Project

Once the OpenEmbedded and BitBake projects have been imported into your Sage EDK workspace, you may build the micro-image-sage image.

Right click on the openembedded project and select Build Project. OpenEmbedded is a large build and will take a while, especially the first time as it downloads all the dependencies.

Check the console tab for build issues.

When the project has built successfully, you will have an image in your Sage EDK workspace under oe_build/deploy/images.

Building from the command line

If you find that you need to build from the command line, create a shell prompt, navigate to the openembedded directory in your Sage EDK workspace, setup the environment, and execute the build:

cd ~/sage_edk/samples_workspace/openembedded
source ./
bitbake micro-image-sage

Configure and Build Coreboot

Configure coreboot for your mainboard as you would normally, as described in the SmartProbe and Sage EDK Users Guide.

The only difference is that your payload should be set to the OpenEmbedded micro-image-sage ELF image file in your Sage EDK workspace. For example: ~/sage_edk/samples_workspace/oe_build/deploy/images/persimmon/micro-micro-image-eglibc-ipk-20110615-persimmon.rootfs.elf

Build and flash Coreboot according to the steps documented in the SmartProbe and Sage EDK Users Guide.

Personal tools

Create a book