www.mamboteam.com
Home arrow Blog arrow Adding packages to OpenEmbedded bootstrap-image images
 
 
Main Menu
Home
Company
Services
Resources
News
Blog
Contact Us
RSS Feed
Embedded Perspective

Subscribe to our Newsletter for insights into Embedded Systems development.






Latest News
Adding packages to OpenEmbedded bootstrap-image images Print E-mail

NOTICE: the information in this article is obsolete and is no longer correct -- see http://bec-systems.com/web/content/view/79/9/ instead.

When using OpenEmbedded to build a Linux distribution for a new machine, there is often a need to add a few packages to images created.  In this article, we look at how OpenEmbedded generates images, how to add packages to a standard image, and a few tips to make this work well.

When bringing up a Linux distribution on an embedded device using OpenEmbedded, you typically start by building a standard distribution and image.  The generic distribution and the bootstrap-image bitbake target are commonly used.  The following assumes you are using a machine and distro configuration that uses the new task-base task provider. 

When you type "bitbake bootstrap-image", the following steps occur:

  • all dependencies as specified by the DEPENDS and RDEPENDS variables in the task-base.bb files are built.  When packages are built, corresponding ipk files are generated and placed in the tmp/deploy/ipk directory.
  • ipkg-make-index is run to generate an index of all packages located in the tmp/deploy/ipk directory.
  • The following command is then run: ipkg-cl -f /build/oe/x86/tmp/work/x86-linux/bootstrap-image-1.0-r0/temp/ipkg.conf -o /build/oe/x86/tmp/rootfs install task-base ipkg ipkg-collateral.  This command installs the task-base, ipkg, and ipkg-collateral packages and their dependencies to the /build/oe/x86/rootfs directory.
  • There are additional processes that then take the contents of the /build/oe/x86/rootfs directory and package it up in the tar.gz, jffs2, ext2, etc image formats.















The critical part in understanding what ends up in your rootfs image is observing that the task-base ipk file is what drives what goes in the rootfs image.  If you unpack the task-base ipk file from the tmp/deploy/ipk directory, the control files looks something like this:

Package: task-base
Version: 1.0-r15
Description: Merge machine and distro options to create a basic machine task/package
Section: base
Priority: optional
Maintainer: OpenEmbedded Team < This email address is being protected from spam bots, you need Javascript enabled to view it >
Architecture: x86
OE: task-base-1.0
Homepage: unknown
Depends: task-base-core-default, kernel, udev, sysfsutils, module-init-tools
Recommends: kernel-module-input, kernel-module-uinput
Source: file:///build/oe/x86/openembedded/packages/tasks/task-base.bb

There are several variables that can be defined in the conf files to force additional packages to be built and included in a rootfs image:  MACHINE_EXTRA_RDEPENDS, and DISTRO_EXTRA_RDEPENDS.

We will now go through an example of adding gkt+ to a bootstrap-image build.  The first step is to add the following line to your local.conf file:

DISTRO_EXTRA_RDEPENDS = "gtk+"

At this point you must manually regenerate the task-base ipk file as the system has no way of knowing the contents for task-base have changed as the task-base bb file did not actually change.  The best way to do this is to run "bitbake task-base -crebuild".  Do not run "bitbake task-base -cclean" as this seems to start cleaning packages that are already built.  At this point, if you look at the control file in the task-base ipk file, it will look like:

Package: task-base
Version: 1.0-r15
Description: Merge machine and distro options to create a basic machine task/package
Section: base
Priority: optional
Maintainer: OpenEmbedded Team < This email address is being protected from spam bots, you need Javascript enabled to view it >
Architecture: x86
OE: task-base-1.0
Homepage: unknown
Depends: task-base-core-default, kernel, udev, sysfsutils, module-init-tools, gtk+
Recommends: kernel-module-input, kernel-module-uinput
Source: file:///build/oe/x86/openembedded/packages/tasks/task-base.bb

Note the Depends line in the control file now includes "gtk+".  The images build now include gtk+ and a number of gtk dependencies like libcairo2, pango, glib, etc.

As with many development tasks, it always helps to understand how things work.  Adding packages to an existing build is easy provided you understand a few the nuances such as rebuilding the task-base package when modifying the MACHINE_EXTRA_RDEPENDS or DISTRO_EXTRA_RDEPENDS variables.


LIST OF COMMENTS


1/2. Thanks
Written by Robert Schuster
Tuesday, August 07 2007
Website
This was a very helpful hint. Please continue to spread OE knowledge. :)

2/2. Thanks
Written by Chrigi
Wednesday, December 12 2007
Website
Just what I was looking for. Thanks:

Add Comments
 
Last Updated ( Friday, 14 September 2007 )
 
< Prev   Next >