How to install additional software into your OE generated rootfs

There are few methods of adding software into rootfs. You can copy binaries but you can also go better way by using packages. I know that this can be strange experience for some people (which are used to systems which generates only binaries) but in OpenEmbedded world effect of software build is set of packages which can be used to generate final rootfs image.

First thing to check is which package contains needed binary. It is easier if package name has binary name (like ‘alsa-utils-aplay’ which contains ‘aplay’ command) but it is not always so easy. Hopefully OpenEmbedded generates ‘Packages.filelist’ file in ‘tmp/deploy/glibc/ipk/’ subdirectories. If they are empty (common situation) they need to be recreated.

To generate them user needs to remove ‘Packages*’ files from all directories and call bitbake package-index command. When command finishes ‘Packages.filelist’ files should contain all informations — for example ‘update-inetd’ command line looks like this

update-inetd netbase:armv6:./usr/sbin/update-inetd

The format is simple:

BINARY-NAME PACKAGE:ARCH:PATH-TO-BINARY

So when package name is known we need to transfer package into device. This part depends on device so I will not elaborate on it.

Installing package is simple: opkg install package.ipk. But copying single packages can result in frustration called ‘dependency hell’ (package require another package which require another etc). To check which packages will be required the easiest way is dpkg-deb -I package.ipk (as IPK packages are compatible with DEBs).

Better way is to use repositories of packages — command simplify to opkg update;opkg install package (users of desktop Linux distributions can compare it with apt-get or yum). If you built Ångström distribution then your rootfs already contains all informations needed to use packages from repositories. For other distros user needs to define them by hand.

Repository informations are stored in ‘/etc/opkg/*-feed.conf’ files. Format is simple:

src/gz NAME URL

Example:

src/gz base http://www.angstrom-distribution.org/feeds/2008/ipk/glibc/armv5te/base

Instead of ‘src/gz’ also ‘src’ can be used — it will fetch uncompressed ‘Packages’ file instead of gzipped one.

When repositories are defined installing software is easy: opkg update;opkg install package will fetch package and all it’s dependencies and then will install them into rootfs.

I hope that this will simplify that task for some people.

linux openembedded packages