Google Groups

[howto] Adding your own local packages to Angstrom: a simple example

Edouard Lafargue Jan 9, 2012 1:29 PM
Posted in group: BeagleBoard
Ok, the subject is probably a bit ambitious, and I'm sure this is obvious to some, but since it took me a long time to figure it out from various bits of info, I thought this might be useful to a few people.

Why should I do this ?

The cloud9 image on the BeagleBone actually contains a pretty good compilation/development environment, and you should be able to do quite a bit of work directly on the board. Nevertheless, on a modern machine you will go dozens of times faster when compiling, and in the long run you will save lots of time when creating new images if you build your custom pacakges during the overall image building process, rather than recompile your pacakges manually each time.

So, how do I create/add my own packages on the Beaglebone?

This describes what I did to create a ".ipk" for the icecast server which I needed on my beaglebone. Your mileage may vary...
  • Create a local directory - outside of setup-scripts if possible - where you will put your ".bb" recipes. I used ~/Documents/Beaglebone/ed-local/ on my system.
  • In that directory, create subdirs with the name of the package you want to create, and inside those, the BB recipe. Note on the example below how the version number is in the BB recipe, this filename format is used by the BB recipe to download the correct version. For instance:
  • Then, update setup-scripts/conf/local.conf to add your local repository as a package source: in my case, I had to add the following variable definition:
    • # My local Bitbake recipes
    • BBFILES += "${HOME}/Documents/Beaglebone/ed-local/*/*.bb"
  • Now you can start writing bitbake recipes in your local repo. Below is what I had to do for icecast, which follows a typical "./configure;make:make install" installation process:
DESCRIPTION = "Icecast streaming media server"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"

DEPENDS = "libvorbis libogg libtheora libxslt libxslt-native"
PR = "r0"

SRC_URI = "${PN}-${PV}.tar.gz"
SRC_URI[md5sum] = "ff516b3ccd2bcc31e68f460cd316093f"
SRC_URI[sha256sum] = "4742b38fc55b6373895a7c0a35baed49a848fec99f5e8538e3f0157383d0b3f0" 

# Need to disable curl
                --without-curl \
                --without-speex \
                --with-ogg=${STAGING_LIBDIR} \
                --with-vorbis=${STAGING_LIBDIR} \
                --with-theora=${STAGING_LIBDIR} \
inherit autotools pkgconfig

   So what is important there, and what is not? You absolutely have to put the correct MD5SUM variables in your BB recipe, Angstrom insists on it. No worries though, just put wrong values to start with, and do a bitbake your_package_name -c fetch which will fail but will tell you the correct value of the MD5/SHA2 checksums, you will then be able to put the right values in your recipe. You also have to define at least one license file, along with its checksum, otherwise the build process will complain. You will also need to put the correct dependencies in the definitions, and any extra configure options as shown in the example. But it's not that hard, really, at least for most simple packages. 
  • Now that your recipe is ready, bake it! bitbake icecast  in this example. The resulting "IPK" will be located in build/tmp-angstrom_2010_x-eglibc/deploy/ipk/armv7a . Put it on your BeagleBone, and do a opgk install my_package.ipk , everthing should work, hopefully!
Hoping this helps,