Package Management
In case you need additional software packages, that are not preinstalled on the Kontron Electronics hardware you have two choices on how to get them running. You can either ...
- ... setup the full Yocto-based build environment and rebuild the image with the needed package included,
- ... or you can use package-files that only need to be installed on the already running hardware.
To obtain a package-file for the software you need, that is compatible with the Kontron Electronics BSP, you can create a package from within the Yocto build environment by using bitbake
.
To build a recipe use:
> bitbake <recipe-name>
To list all available recipes run:
> bitbake -s
A single recipe can create multiple packages, such as -dev, -dbg or such. After the build recreate the package index by running:
> bitbake package-index
In case that a certain package is not available through an existing recipe (check at oe-Index), please contact Kontron Electronics for help.
Install the package manager
In general the package manager opkg
is already installed on the Kontron Electronics hardware. It is included in the exceet-images in Yocto by default.
Set up a local package server
If you have the Yocto environment installed on your development computer and you want to be able to directly fetch the created packages located in tmp/deploy/ipk
in your build directory by your target, you can set up a webserver like Apache, that exports this directory via http.
To install Apache you can run:
> sudo apt-get install apache2
After installing Apache, you need to set up a directory for the package server, e.g /var/www/yocto-packages
and add this path as DocumentRoot
in apache host config file. Afterwards you can use the script scripts/init-remote
to switch the package server between different builds.
To update nfs, tftp and package directories run init-remote
from your yocto base directory run:
> sudo scripts/init-remote build-exceet image-exceet mx6sexceet
This script will update the links /tftproot
, /nfsroot
and /var/www/html
and update the root file system contents for /nfsroot
. Adapt these directories in the script to match your configuration.
Using the package manager 'opkg'
In case you have a local ipk-file (e.g. on the SD-card, on a flash drive, etc.) you want to install, change to the directory the file is located in and run:
> opkg install <name-of-packagefile>.ipk
Please be aware, that opkg tries to resolve all dependencies of the package and those need to be provided as files in the same directory, if they are not already installed.
In case you want to install a package from a local or remote server, the locations of the package directories need to be specified in `/etc/opkg/opkg.conf. If this is the case you can run
> opkg update
to fetch the package index from the server. After that you can use
> opkg install <package-name>
to install a package.
Commands
A list of all opkg commands:
Command | Description |
---|---|
list |
lists all available packages |
list-installed |
lists all installed packages |
update |
updates the package index |
list-upgradeable |
lists all packages that will be upgraded during upgrade |
upgrade |
upgrade all packages that are outdated |
upgrade <package-name> |
upgrade the specified package if possible |
install <package-name> |
install specified package |
install <filename.ipk> |
install the specified local package-file |
Conf-File opkg.conf
To change the opkg settings and to add/remove package repositories, please edit the file /etc/opkg/opkg.conf
> nano /etc/opkg/opkg.conf
Examples
Install the package qtserialport from the remote server:
> opkg update
> opkg install qtserialport