5.10.5.3.2. Using IPK

The application for performing runtime package management of IPK packages on the target is called opkg.

In order to inform opkg of the package databases you want to use, simply create one or more *.conf files in the /etc/opkg directory on the target. The opkg application uses them to find its available package databases. As an example, suppose you configured your HTTP server on your machine named www.mysite.com to serve files from a BOARD-dir directory under its document-root. In this case, you might create a configuration file on the target called /etc/opkg/base-feeds.conf that contains:

     src/gz all http://www.mysite.com/BOARD-dir/all
     src/gz armv7a http://www.mysite.com/BOARD-dir/armv7a
     src/gz beagleboard http://www.mysite.com/BOARD-dir/beagleboard
                        

As a way of making it easier to generate and make these IPK configuration files available on your target, the meta-oe layer provides a recipe called distro-feed-configs, which provides a package by the same name. When you include this package into your image, it will automatically generate and include a set of *.conf files in the image's /etc/opkg directory that will provide your target's opkg tool with any and all package databases your build will generate. The only catch is that this recipe cannot possibly imagine your server's DNS name/IP address. Consequently, somewhere in your configuration you need to set a variable called DISTRO_FEED_URI to point to your server and the location within the document-root that contains the databases. For example: if you are serving your packages over HTTP, your server's IP address is 192.168.7.1, and your databases are located in a directory called BOARD-dir underneath your HTTP server's document-root, you need to set DISTRO_FEED_URI to http://192.168.7.1/BOARD-dir.

On the target machine, fetch (or refresh) the repository information using this command:

     # opkg update
                        

You can now use the opkg list and opkg install commands to find and install packages from the repositories.