Thursday, May 20, 2010

OpenEmbedded on Ubuntu 10.04

NOTE: In light of the instructions received from Koen, the Angström head developer, you should avoid following the instructions below, since the deb-based OE is appearantly faulty by design and bitbake 1.10.x should be used instead of Ubuntu's one. Use these setup scripts to set-up your dev branch instead. I'm not deleting the post in case the same errors occur in some other way as well.

Now's the time to talk about...setting up OpenEmbedded on Ubuntu 10.04...and...building the Ångström distribution for the BeagleBoard! (I do realize I've created some suspense surrounding this particular subject with my previous posts, but despite the problems one may run into it's not that terrifying really :))

An advantage of setting up OE on Ubuntu (or any other .deb-based system, for that matter) is that one is able to use the apt-get'able OpenEmbedded. Following the instructions on the blog post (that is, get the repository in your sources list - sudo aptitude install openembedded-minimal - oe-setup-minimal the set-up part becomes a breeze - this will take care of all the necessary dependencies.

You may read from several sources that you absolutely shouldn't be using the bitbake that is in Ubuntu's own repositories (ie, things like DON'T sudo apt-get install bitbake) but from what I've seen, they've updated the repository and version 1.8.18 was directly available at the time of my writing this. You may want to check for yourself by executing bitbake --version once you have obtained the packages, anything over 1.8.16 should be fine.

Once you've set up the environment by executing oe-setup-minimal (yes, using the dev branch is appearantly recommended, instead of the stable/2009 branch) you can make an attempt at trying out your new oven...oh, I mean, development environment, by trying out something smaller via giving this command:

MACHINE=beagleboard bitbake nano

While we're at it, we can take a short look at parts of this particular command. Not that it's that complicated but here goes anyway:
  • OpenEmbedded supports a lot of different target platforms, so we should specify the platform we'll be targeting. This is what the MACHINE=beagleboard part is for.
  • bitbake is the central make tool, used extensively in OpenEmbedded, and nano is the name of the "recipe" for the miniscule (but useful!) text editor. For a nice introduction to bitbake and its recipes system, you may want to read this.
Although nano itself isn't all that complicated, the build can take some time since the initial setting up of the toolchain and base libraries will also be done.

During the build process, you may run into several errors. I've documented the ones I've personally ran into and how I got over them.

Error #1: Extraction error while building expat
OE Message: ERROR: '/home/maltanar/oe/' failed
Digging down a bit further reveals 

NOTE: Unpacking ../../sources/expat-2.0.1.tar.gz to ../../tmp/minimal/

gzip: stdin: invalid compressed data--crc error

This is a known bug in the current gzip which appearantly affects several distributions on i386 computers. The workaround I did is as follows:
  1. Install the gzip recovery tools: sudo apt-get install gzrt
  2. cd into the OE sources folder ($OE_ROOT/sources, should be ~/oe/sources if you used the deb setup)
  3. Run gzrecover expat-2.0.1.tar.gz; mv expat-2.0.1.tar.recovered expat-2.0.1.tar; gzip expat-2.0.1.tar and say yes to the overwrite
  4. Generate the md5 and sha256 sums of the new file by running md5sum expat-2.0.1.tar.gz; sha256sum expat-2.0.1.tar.gz and note them somewhere. Edit the expat-2.0.1.tar.gz.md5 file to reflect the new MD5 checksum.
  5. cd into oe/ then edit the file in your favorite text editor - change the MD5 and SHA256 checksums there to reflect the new ones, and save.
  6. Done! You can run MACHINE=beagleboard bitbake nano once again.
I didn't run into any more problems while building nano, and it was eventually successfully built. And now it's the time to try the bit-baking oven on something image of the actual Ångström distribution. Sounds fancy? Well, it starts off as simple as

MACHINE=beagleboard bitbake -v console-image

provided that you want to start out with something simple, that is, the barebones console image. Notice the extra -v passed on the command line - it can be helpful to have a verbose bitbake while building something major.

I've also kept track of what happened during the console-image build process:

Error #2: Trouble with glibc version while building gtk+
OE Message: NOTE: Task failed: /home/maltanar/oe/tmp/minimal/

In more detail: 

| checking for BASE_DEPENDENCIES... configure: error: Package requirements (glib-2.0 >= 2.23.6    atk >= 1.29.2    pango >= 1.20    cairo >= 1.6) were not met:
| Requested 'glib-2.0 >= 2.23.6' but version of GLib is 2.22.1

For some reason, although many newer glib-2.0 recipes are available, OE chooses the older ones. To solve this, I went into the oe/ and deleted all the recipe (*.bb) files with the -native suffix (for example,, and re-started the build process.

I don't understand it completely but I think the old -native suffixed recipes are sort of left-overs, since OE seems to be using the BBCLASSEXTEND = "native" flag for this purpose now (the non-suffixed recipes all have this).

Error #3: Trouble with mtd-utils build
OE error message: NOTE: Task failed: /home/maltanar/oe/tmp/minimal/

crc32.o: could not read symbols: File in wrong format

Not sure why this happened either. I cd'd into the mtd-utils source directory (oe/tmp/minimal/ and ran make clean followed by MACHINE=beagleboard bitbake mtd-utils which did complete successfully this time.

After these (and several hours later) the process was complete, and I ended up with the rootfs, uImage and u-boot images in the oe/tmp/minimal/ directory! The uImage was still causing a kernel panic for me upon boot with a proper USB cable, so one may want to use the uImage from the /boot folder from the last BeagleBoard demo image as I mentioned in my previous post. Or maybe use an USB cable which isn't working :)


  1. Hi Yaman,
    Do you have the steps to setup the development environment using Angstrom setup scripts.I am trying to figure out how to enable DSP on my beagleboard using Angstrom.
    My development environment is Ubuntu 9.10.
    Any help would be really appreciated.
    Thanks in advance.

    Ashwin Raut

  2. Hi there!

    The setup scripts are quite self-documenting, so I didn't want to do one more post on how to set them up, but here's how I did it:

    cd ~
    mkdir oe
    git pull git:// angstrom-setup-scripts
    cd angstrom-setup-scripts
    ./ config beagleboard
    ./ update

    and then you're good to go! You can call bitbake in this manner:
    ./ bitbake nano

    there's also an alternative way without using the script as a wrapper, but the script will tell you that itself anyway :)

  3. Thanks for posting the additional info on getting the scripts from the git repository as I found it helpful. Although, I did find it necessary to use git clone rather than git pull.

    I ended up with BitBake Build Tool Core version 1.10.0, bitbake version 1.10.0

    Running "./ bitbake nano" resulted in the same issue (error 1) with that you had although the files were in different locations the fix was the same.

    Building the console-image "./ bitbake -v console-image" ran to completion without error. The result looks like a rootfs in sysroots/armv7a-angstrom-linux-gnueabi and a uImage in beagleboard-angstrom-linux-gnueabi. I have not yet have a chance to play with trying to get my beagleboard to boot using them.

  4. That was definitely meant to be git clone and not git pull, I must have drifted off :)

    The problem with expat (and possibly other random packages) will keep coming up since it's a gzip issue - you may find my post entitled "getting a working gzip" helpful, it saves some frustration.

  5. Hi, I used the to successfully build the Angstorm image, but I can't find where the script put it.

    Can you plz help ?

    Cheers :)

  6. Hi,

    it should be under something like ~/oe/setup-scripts/build/tmp-angstrom_2008_1/deploy/glibc/images/beagleboard

    a little adventure to find it the first time, yes :) usually, everything that bitbake produces ends up under deploy/glibc

  7. hi maltanar...
    during build procedure, i got the following error

    | /home/adnan/oe/tmp/sysroots/i686-linux/usr/bin/install: writing `/home/adnan/oe/tmp/work/armv7a-angstrom-linux-gnueabi/gettext-0.18-r1/image/usr/share/doc
    NOTE: Task failed: /home/adnan/oe/tmp/work/armv7a-angstrom-linux-gnueabi/gettext-0.18-r1/temp/log.do_install.10649
    ERROR: TaskFailed event exception, aborting
    ERROR: Build of /home/adnan/oe/ do_install failed
    ERROR: Task 607 (/home/adnan/oe/, do_install) failed
    NOTE: Tasks Summary: Attempted 396 tasks of which 396 didn't need to be rerun and 1 failed.
    ERROR: '/home/adnan/oe/' failed

    Can you please help me ?


  8. Does this occur while you're using the setup script, or are you using the apt-get'able OE? If it's the latter you should really prefer the setup scripts instead. I recall running into similar problems while using the apt-get'able OE.

  9. no, i am using the setup script.
    i tried bitbake x-load before it, it did not give error but it keep giving

    Note : missing inherit gettext

    Do you have any idea how could it be overcome ?
    I am just stucked into middle of work :(

  10. Okay. You may want to add the -v (verbose) option while running bitbake to obtain some more information since the log is a bit cryptic now. You should ask in #beagle on, or perhaps in the angstrom/beagleboard mailing lists.

  11. thanks alot maltanar....
    finally atleast this problem is solved........

  12. Hi Maltanar,

    Having followed your blog about open embedded, I got over the problem of failing at expat when building angstrom.

    But, now I always get following message at the end when bitbake nano completes.

    NOTE: Tasks Summary: Attempted 813 tasks of which 794 didn't need to be rerun and 0 failed.

    I just started using beagleboard. could you please help me here? Thanks.

  13. Hmm, that's not very clear, is it? Can you try passing -v (verbose) while running bitbake to get a bit more information as to what might be causing the error?

  14. Hi Maltanar,

    having tried running "bitbake nano -v", I copied following suspicious part from the entire log.

    NOTE: selecting gcc-cross-initial to satisfy virtual/arm-angstrom-linux-gnueabi-gcc-initial due to PREFERRED_PROVIDERS
    staging-nano-armv7a-angstrom-linux-gnueabi - 2.2.5-r1.0
    Removing package staging-nano-armv7a-angstrom-linux-gnueabi from root...
    Installing staging-nano-armv7a-angstrom-linux-gnueabi (2.2.5-r1.0) to root...
    Configuring staging-nano-armv7a-angstrom-linux-gnueabi.
    Installing staging-nano-armv7a-angstrom-linux-gnueabi (2.2.5-r1.0) to root...
    Collected errors:
    * check_data_file_clashes: Package staging-nano-armv7a-angstrom-linux-gnueabi wants to install file /home/louie/stuff/angstrom-setup-scripts/build/tmp-angstrom_2008_1/sysroots/armv7a-angstrom-linux-gnueabi/usr/share/info/dir
    But that file is already provided by package * staging-gnutls-armv7a-angstrom-linux-gnueabi
    * opkg_install_cmd: Cannot install package staging-nano-armv7a-angstrom-linux-gnueabi.
    NOTE: Preparing runqueue
    NOTE: Marking Active Tasks
    NOTE: Pruned 1395 inactive tasks, 813 left
    NOTE: Assign Weightings
    NOTE: Compute totals (have 1 endpoint(s))
    NOTE: Executing runqueue
    NOTE: Removing stamps: /home/louie/stuff/angstrom-setup-scripts/build/tmp-angstrom_2008_1/stamps/armv7a-angstrom-linux-gnueabi/nano-2.2.5-r1.0.*
    NOTE: Running task 795 of 813 (ID: 7, /home/louie/stuff/angstrom-setup-scripts/sources/openembedded/recipes/nano/, do_setscene)
    NOTE: package nano-2.2.5-r1.0: task do_setscene: Started
    NOTE: Staging package found, using it for /home/louie/stuff/angstrom-setup-scripts/sources/openembedded/recipes/nano/
    NOTE: Failure installing prestage package
    NOTE: package nano-2.2.5-r1.0: task do_setscene: Succeeded.

    Can we see any thing wrong from there?

  15. I'm by no means an OE expert but I think this might be caused by an untimely interruption. Have you tried doing doing this with a clean workspace (ie, do bitbake clean first) ? I can't really help otherwise, if the problem persists you may want to try the mailing list instead.

  16. Okay I can now build, that was a bit of a challenge. Now I am trying to figure out how to deploy the results. Is there a decent reference for the current layout of things? I used to do unix systems, but it has been 30 years. Everything is moved, and I don't quite see where I should unpack what.

  17. thank you so much for creating this blog.

  18. Hello, Im trying to build Oe environment on ubuntu 10.04 for beagleborad-xM, following steps from the Oe website

    However I get the following error when executing bitbake x11-image.

    xeon@xeon-laptop:~/oe/build$ bitbake x11-image
    NOTE: Handling BitBake files: | (0001/0001) [100 %]
    Parsing of 1 .bb files complete (0 cached, 1 parsed). 1 targets, 0 skipped, 0 masked, 0 errors.
    ERROR: Nothing PROVIDES 'x11-image'

    Build Configuration:
    BB_VERSION = "1.10.2"
    METADATA_BRANCH = "master"
    METADATA_REVISION = "6148e6f"
    TARGET_ARCH = "arm"
    TARGET_OS = "linux-gnueabi"
    MACHINE = "beagleboard"
    DISTRO = "angstrom"
    DISTRO_VERSION = "v20110419"
    TARGET_FPU = "hard"

    Unknown Event:
    ERROR: Nothing PROVIDES 'x11-image'
    Command execution failed: Traceback (most recent call last):
    File "/home/xeon/oe/bitbake/lib/bb/", line 88, in runAsyncCommand
    commandmethod(self.cmds_async, self, options)
    File "/home/xeon/oe/bitbake/lib/bb/", line 174, in buildTargets
    command.cooker.buildTargets(pkgs_to_build, task)
    File "/home/xeon/oe/bitbake/lib/bb/", line 782, in buildTargets
    taskdata.add_provider(localdata, self.status, k)
    File "/home/xeon/oe/bitbake/lib/bb/", line 354, in add_provider
    self.add_provider_internal(cfgData, dataCache, item)
    File "/home/xeon/oe/bitbake/lib/bb/", line 383, in add_provider_internal
    raise bb.providers.NoProvider(item)
    NoProvider: x11-image


    please help because im new to beagleboard and linux

  19. Hi, I am setting up OE env on Ubuntu 11.10. I am getting following error after doing "MACHINE=beagleboard ./ bitbake virtual/kernel" command :

    DEBUG: BB /home/vinay/BB/Aungstrom/setup-scripts/sources/openembedded-core/meta/classes/package_ipk.bbclass: handle(data, include)
    DEBUG: LOAD /home/vinay/BB/Aungstrom/setup-scripts/sources/openembedded-core/meta/classes/package_ipk.bbclass
    DEBUG: BB configuration INHERITs:0: inheriting classes/image-prelink.bbclass
    DEBUG: BB /home/vinay/BB/Aungstrom/setup-scripts/sources/openembedded-core/meta/classes/image-prelink.bbclass: handle(data, include)
    DEBUG: LOAD /home/vinay/BB/Aungstrom/setup-scripts/sources/openembedded-core/meta/classes/image-prelink.bbclass
    DEBUG: BB configuration INHERITs:0: inheriting classes/license.bbclass
    DEBUG: BB /home/vinay/BB/Aungstrom/setup-scripts/sources/openembedded-core/meta/classes/license.bbclass: handle(data, include)
    DEBUG: LOAD /home/vinay/BB/Aungstrom/setup-scripts/sources/openembedded-core/meta/classes/license.bbclass
    DEBUG: Clearing SRCREV cache due to cache policy of: clear
    ERROR: Error parsing configuration files
    Traceback (most recent call last):
    File "/home/vinay/BB/Aungstrom/setup-scripts/sources/bitbake/lib/bb/", line 197, in BBCooker.loadConfigurationData():
    > self.configuration.postfile)
    except SyntaxError:
    File "/home/vinay/BB/Aungstrom/setup-scripts/sources/bitbake/lib/bb/", line 870, in BBCooker.parseConfigurationFiles(prefiles=[], postfiles=[]):
    if data.getVar("BB_WORKERCONTEXT", False) is None:
    > bb.fetch.fetcher_init(data)
    File "/home/vinay/BB/Aungstrom/setup-scripts/sources/bitbake/lib/bb/fetch2/", line 228, in fetcher_init(d=):
    > revs.clear()
    File "/home/vinay/BB/Aungstrom/setup-scripts/sources/bitbake/lib/bb/", line 142, in SQLTable.clear():
    def clear(self):
    > self._execute("DELETE FROM %s;" % self.table)

    File "/home/vinay/BB/Aungstrom/setup-scripts/sources/bitbake/lib/bb/", line 66, in SQLTable._execute(*query=('DELETE FROM BB_URI_HEADREVS;',)):
    > return self.cursor.execute(*query)
    except sqlite3.OperationalError as exc:
    OperationalError: attempt to write a readonly database