From 7ef4a6593e2c58259a8f34fbe6d633c9d12cf1c6 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Tue, 7 Jun 2016 10:24:21 -0700 Subject: dev-manual: Updated Package Feed Creation sections Fixes [YOCTO #1882] Edited the sections in the "Working with Packages" section beginning with the "Build Considerations" section with text received from Daniela Placencia. (From yocto-docs rev: 07a55662d6ac98875555f80f766de263b131185f) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 278 ++++++++++++++------- 1 file changed, 187 insertions(+), 91 deletions(-) (limited to 'documentation/dev-manual/dev-manual-common-tasks.xml') diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index a634ef16c7..24a7bdc28a 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -7528,27 +7528,48 @@ Build Considerations - This section describes build considerations that you need - to be aware of in order to provide support for runtime + This section describes build considerations of which you + need to be aware in order to provide support for runtime package management. - When BitBake generates packages it needs to know + When BitBake generates packages, it needs to know what format or formats to use. In your configuration, you use the PACKAGE_CLASSES - variable to specify the format. - - You can choose to have more than one format but you must - provide at least one. - + variable to specify the format: + + + Open the local.conf file + inside your + Build Directory + (e.g. ~/poky/build/conf/local.conf). + + + Select the desired package format as follows: + + PACKAGE_CLASSES ?= “package_packageformat” + + where packageformat + can be "ipk", "rpm", and "deb", which are the + supported package formats. + + Because the Yocto Project supports three + different package formats, you can set the + variable with more than one argument. + However, the OpenEmbedded build system only + uses the first argument when creating an image + or Software Development Kit (SDK). + + + If you would like your image to start off with a basic - package database of the packages in your current build - as well as have the relevant tools available on the + package database containing the packages in your current + build as well as to have the relevant tools available on the target for runtime package management, you can include "package-management" in the IMAGE_FEATURES @@ -7583,9 +7604,9 @@ $ bitbake some-package package-index - This is because BitBake does not properly schedule the - package-index target fully after any - other target has completed. + The reason for this restriction is because BitBake does not + properly schedule the package-index + target fully after any other target has completed. Thus, be sure to run the package update step separately. @@ -7601,9 +7622,10 @@ When your build is complete, your packages reside in the - ${TMPDIR}/deploy/package-format + ${TMPDIR}/deploy/packageformat directory. - For example, if ${TMPDIR} + For example, if + ${TMPDIR} is tmp and your selected package type is IPK, then your IPK packages are available in tmp/deploy/ipk. @@ -7614,10 +7636,9 @@ Host or Server Machine Setup - Typically, packages are served from a server using - HTTP. - However, other protocols are possible. - If you want to use HTTP, then setup and configure a + Although other protocols are possible, a server using HTTP + typically serves packages. + If you want to use HTTP, then set up and configure a web server, such as Apache 2 or lighttpd, on the machine serving the packages. @@ -7640,7 +7661,7 @@ Add the directory to your Apache configuration, which you can find at /etc/httpd/conf/httpd.conf. - Use commands similar to these on the + Use commands similar to the following on the development system. These example commands assume a top-level Source Directory @@ -7651,13 +7672,14 @@ as IPK, use "ipk" in the pathnames: <VirtualHost *:80> - .... + ... Alias /rpm ~/poky/build/tmp/deploy/rpm <Directory "~/poky/build/tmp/deploy/rpm"> Options +Indexes </Directory> </VirtualHost> - + + Reload the Apache configuration as described in this step. @@ -7678,7 +7700,8 @@ For OpenSUSE, use the following: # /etc/init.d/apache2 reload - + + If you are using Security-Enhanced Linux (SELinux), you need to label the files as @@ -7688,26 +7711,24 @@ This example assumes RPM package types: # chcon -R -h -t httpd_sys_content_t tmp/deploy/rpm - + +
- Serving Packages via lighttpd + Serving Packages Through lighttpd If you are using lighttpd, all you need to do is to provide a link from your - ${TMPDIR}/deploy/package-format + ${TMPDIR}/deploy/packageformat directory to lighttpd's document-root. You can determine the specifics of your lighttpd installation by looking through its configuration file, which is usually found at: /etc/lighttpd/lighttpd.conf. - - - For example, if you are using IPK, lighttpd's document-root is set to /var/www/lighttpd, and you had @@ -7729,6 +7750,38 @@
+ +
+ Serving Packages Through Python SimpleHTTPServer + + + It is possible to serve packages hosted by a build + machine through an HTTP server created with a simple + Python command. + + + + The first thing you do is to create a directory that + contains the packages to host. + Be sure you have root privileges and place the directory + inside var/www/ + (e.g. /var/www/my_repo/). + To ensure the directory contains the packages you want + to serve, you need to create a symlink from the + package feed area to the directory that hosts the + packages you want to provide: + + my_repo # ln -s ~{TMPDIR}/deploy/packageformat ./ + + You can start the server by running the following + command from the recently created directory: + + # python -m SimpleHTTPServer + + Serving HTTP on 0.0.0 port 8000 ... + + +
@@ -7744,35 +7797,35 @@ Using RPM - The application for performing runtime package - management of RPM packages on the target is called - smart. + The smart application performs + runtime package management of RPM packages. + This application is aware of every package database + you want to use. + You must perform an initial setup for + smart on the target machine. - On the target machine, you need to inform - smart of every package database - you want to use. - As an example, suppose your target device can use the - following three package databases from a server named - server.name: + As an example, assume the target is able to use the + following package databases: all, i586, - and qemux86. - Given this example, issue the following commands on the - target: + and qemux86 from a server named + my.server. + You must inform smart of the + availability of these databases by issuing the + following commands on the target: - # smart channel --add all type=rpm-md baseurl=http://server.name/rpm/all - # smart channel --add i585 type=rpm-md baseurl=http://server.name/rpm/i586 - # smart channel --add qemux86 type=rpm-md baseurl=http://server.name/rpm/qemux86 + # smart channel --add i585 type=rpm-md baseurl=http://my.server/rpm/i586 + # smart channel --add qemux86 type=rpm-md baseurl=http://my.server/rpm/qemux86 + # smart channel --add all type=rpm-md baseurl=http://my.server/rpm/all - Also from the target machine, fetch the repository - information using this command: + From the target machine, fetch the repository: # smart update - You can now use the smart query - and smart install commands to - find and install packages from the repositories. + After everything is set up, smart + is able to find, install, and upgrade packages from + the specified repository.
@@ -7780,61 +7833,104 @@ Using IPK - The application for performing runtime package - management of IPK packages on the target is called - opkg. + The opkg application performs + runtime package management of IPK packages. + This application is aware of every package database + you want to use. + You must perform an initial setup for + opkg on the target machine. - 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: + The opkg application uses + configuration files to find available package + databases. + Thus, you need to create a configuration file inside + the /etc/opkg/ direction, which + informs opkg of any repository + you want to use. + + + + For example, assume the following: + + + An HTTP server named + my.server exists on your + build machine. + + + The server is serving packages from a directory + named ipk/. + + + The target machine is able to use the + i586, + all, and + qemux86 package + databases. + + + On the target, create a configuration file + (e.g. my_repo.conf) inside the + /etc/opkg/ directory containing + the following: + + src/gz all http://my.server/ipk/all + src/gz i586 http://my.server/ipk/i586 + src/gz qemux86 http://my.server/ipk/qemux86 + + Next, instruct opkg to fetch + the repository information: - src/gz all http://www.mysite.com/BOARD-dir/all - src/gz armv7a http://www.mysite.com/BOARD-dir/armv7a - src/gz beaglebone http://www.mysite.com/BOARD-dir/beaglebone + #opkg update + The opkg application is now able + to find, install, and upgrade packages from the + specified repository. + + +
+ Using DEB - As a way of making it easier to generate and make - these IPK configuration files available on your - target, simply define - FEED_DEPLOYDIR_BASE_URI - to point to your server and the location within the - document-root which 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 - FEED_DEPLOYDIR_BASE_URI to - http://192.168.7.1/BOARD-dir and - a set of configuration files will be generated for you - in your target to work with this feed. + The apt application performs + runtime package management of DEB packages. + This application uses a source list file to find + available package databases. + The application is aware of every package database + you want to use. + You must perform an initial setup for + opkg on the target machine. - On the target machine, fetch (or refresh) the - repository information using this command: + To inform apt of the repository + you want to use, you might create a list file (e.g. + my_repo.list) inside the + /etc/apt/sources.list.d/ + directory. + As an example, suppose you are serving packages from a + deb/ directory containing the + i586, + all, and + qemux86 databases through an + HTTP server named my.server. + The list file should contain: + + deb http://my.server/deb/all ./ + deb http://my.server/deb/i586 ./ + deb http://my.server/deb/qemux86 ./ + + Next, instruct the apt + application to fetch the repository information: - # opkg update + #apt-get update - You can now use the opkg list and - opkg install commands to find and - install packages from the repositories. + After this step, apt is able + to find, install, and upgrade packages from the + specified repository.
-- cgit 1.2.3-korg