For RPM, IPK, and DEB package formats, it is possible to set up a repository that is a host-based package feed from which you can install packages on the target system during runtime. Doing so is optional and depends on the following:
You take specific steps to set up the feed.
When you build your image, you select to use the
appropriate package manager by setting the
PACKAGE_CLASSES
variable.
You have a web server, such as Apache 2, installed and configured on the development host.
You have createrepo
installed on
the development host.
You enable package management on the target by
listing "package-management" in the
IMAGE_FEATURES
variable.
Following are the steps to set up the optional repository. This examples assumes you are using RPM and the Apache 2 server:
Add the directory to your Apache configuration, which
you can find at
/etc/httpd/conf/httpd.conf
.
Use commands similar to these on the development system.
These example commands assume a top-level
Source Directory
named poky
in your home directory:
<VirtualHost *:80> .... Alias /rpm ~/poky/build/tmp/deploy/rpm <Directory "~/poky/build/tmp/deploy/rpm"> Options +Indexes </Directory> </VirtualHost>
Reload the Apache configuration as follows. For all commands, be sure you have root privileges.
If your development system is using Fedora or CentOS, use the following:
service httpd reload
For Ubuntu, use the following:
/etc/init.d/apache2 reload
For OpenSUSE, use the following:
/etc/init.d/apache2 reload
Change your working directory to
tmp/deploy/rpm
in the
Build Directory.
Create the repository data on the host using this command:
createrepo .
‐‐update
to save some time.
If you are using Security-Enhanced Linux (SELinux), you need to label the files as being accessible through Apache. Use the following command from the development host:
chcon -R -h -t httpd_sys_content_t .
On the target machine, add the repository to Smart.
For somealias
, provide a local
alias for the repository:
smart channel ‐‐add <somealias> type=rpm-md baseurl=http://server.name/rpm
Also from the target machine, fetch the repository information using this command:
smart update
After taking these steps and making sure that the other requirements mentioned at the beginning of the section are met, reboot the target device to take advantage of runtime package installations.
If your packages are IPK, you can install packages onto an
existing running system by first sharing the
tmp/deploy/ipk/
directory
through a web server and then by changing
/etc/opkg/base-feeds.conf
to point at the shared server.
Following is an example:
$ src/gz all http://www.mysite.com/somedir/deploy/ipk/all $ src/gz armv7a http://www.mysite.com/somedir/deploy/ipk/armv7a $ src/gz beagleboard http://www.mysite.com/somedir/deploy/ipk/beagleboard