5.10.4. Setting Up Runtime Package Management

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:

Following are the steps to set up the optional repository. This examples assumes you are using RPM and the Apache 2 server:

  1. 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>
                            

  2. 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
                            

  3. Change your working directory to tmp/deploy/rpm in the Build Directory.

  4. Create the repository data on the host using this command:

         createrepo .
                            

    Note

    If you're updating, add ‐‐update to save some time.

  5. 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 .
                            

  6. 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
                            

  7. 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