mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
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: 1ebd6a805699fc962a43a8f744194ab6e65b733c) Signed-off-by: Scott Rifenbark <srifenbark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
1931dfc1cb
commit
ffb615a50b
@@ -7528,27 +7528,48 @@
|
|||||||
<title>Build Considerations</title>
|
<title>Build Considerations</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This section describes build considerations that you need
|
This section describes build considerations of which you
|
||||||
to be aware of in order to provide support for runtime
|
need to be aware in order to provide support for runtime
|
||||||
package management.
|
package management.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
When BitBake generates packages it needs to know
|
When BitBake generates packages, it needs to know
|
||||||
what format or formats to use.
|
what format or formats to use.
|
||||||
In your configuration, you use the
|
In your configuration, you use the
|
||||||
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink>
|
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink>
|
||||||
variable to specify the format.
|
variable to specify the format:
|
||||||
|
<orderedlist>
|
||||||
|
<listitem><para>
|
||||||
|
Open the <filename>local.conf</filename> file
|
||||||
|
inside your
|
||||||
|
<link linkend='build-directory'>Build Directory</link>
|
||||||
|
(e.g. <filename>~/poky/build/conf/local.conf</filename>).
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
Select the desired package format as follows:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
PACKAGE_CLASSES ?= “package_<replaceable>packageformat</replaceable>”
|
||||||
|
</literallayout>
|
||||||
|
where <replaceable>packageformat</replaceable>
|
||||||
|
can be "ipk", "rpm", and "deb", which are the
|
||||||
|
supported package formats.
|
||||||
<note>
|
<note>
|
||||||
You can choose to have more than one format but you must
|
Because the Yocto Project supports three
|
||||||
provide at least one.
|
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).
|
||||||
</note>
|
</note>
|
||||||
|
</para></listitem>
|
||||||
|
</orderedlist>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
If you would like your image to start off with a basic
|
If you would like your image to start off with a basic
|
||||||
package database of the packages in your current build
|
package database containing the packages in your current
|
||||||
as well as have the relevant tools available on the
|
build as well as to have the relevant tools available on the
|
||||||
target for runtime package management, you can include
|
target for runtime package management, you can include
|
||||||
"package-management" in the
|
"package-management" in the
|
||||||
<ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>
|
<ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>
|
||||||
@@ -7583,9 +7604,9 @@
|
|||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
$ bitbake <replaceable>some-package</replaceable> package-index
|
$ bitbake <replaceable>some-package</replaceable> package-index
|
||||||
</literallayout>
|
</literallayout>
|
||||||
This is because BitBake does not properly schedule the
|
The reason for this restriction is because BitBake does not
|
||||||
<filename>package-index</filename> target fully after any
|
properly schedule the <filename>package-index</filename>
|
||||||
other target has completed.
|
target fully after any other target has completed.
|
||||||
Thus, be sure to run the package update step separately.
|
Thus, be sure to run the package update step separately.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@@ -7601,9 +7622,10 @@
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
When your build is complete, your packages reside in the
|
When your build is complete, your packages reside in the
|
||||||
<filename>${TMPDIR}/deploy/<replaceable>package-format</replaceable></filename>
|
<filename>${TMPDIR}/deploy/<replaceable>packageformat</replaceable></filename>
|
||||||
directory.
|
directory.
|
||||||
For example, if <filename>${TMPDIR}</filename>
|
For example, if
|
||||||
|
<filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink><filename>}</filename>
|
||||||
is <filename>tmp</filename> and your selected package type
|
is <filename>tmp</filename> and your selected package type
|
||||||
is IPK, then your IPK packages are available in
|
is IPK, then your IPK packages are available in
|
||||||
<filename>tmp/deploy/ipk</filename>.
|
<filename>tmp/deploy/ipk</filename>.
|
||||||
@@ -7614,9 +7636,8 @@
|
|||||||
<title>Host or Server Machine Setup</title>
|
<title>Host or Server Machine Setup</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Typically, packages are served from a server using
|
Although other protocols are possible, a server using HTTP
|
||||||
HTTP.
|
typically serves packages.
|
||||||
However, other protocols are possible.
|
|
||||||
If you want to use HTTP, then set up and configure a
|
If you want to use HTTP, then set up and configure a
|
||||||
web server, such as Apache 2 or lighttpd, on the machine
|
web server, such as Apache 2 or lighttpd, on the machine
|
||||||
serving the packages.
|
serving the packages.
|
||||||
@@ -7640,7 +7661,7 @@
|
|||||||
Add the directory to your Apache
|
Add the directory to your Apache
|
||||||
configuration, which you can find at
|
configuration, which you can find at
|
||||||
<filename>/etc/httpd/conf/httpd.conf</filename>.
|
<filename>/etc/httpd/conf/httpd.conf</filename>.
|
||||||
Use commands similar to these on the
|
Use commands similar to the following on the
|
||||||
development system.
|
development system.
|
||||||
These example commands assume a top-level
|
These example commands assume a top-level
|
||||||
<link linkend='source-directory'>Source Directory</link>
|
<link linkend='source-directory'>Source Directory</link>
|
||||||
@@ -7651,13 +7672,14 @@
|
|||||||
as IPK, use "ipk" in the pathnames:
|
as IPK, use "ipk" in the pathnames:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
....
|
...
|
||||||
Alias /rpm ~/poky/build/tmp/deploy/rpm
|
Alias /rpm ~/poky/build/tmp/deploy/rpm
|
||||||
<Directory "~/poky/build/tmp/deploy/rpm">
|
<Directory "~/poky/build/tmp/deploy/rpm">
|
||||||
Options +Indexes
|
Options +Indexes
|
||||||
</Directory>
|
</Directory>
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
</literallayout></para></listitem>
|
</literallayout>
|
||||||
|
</para></listitem>
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
Reload the Apache configuration as described
|
Reload the Apache configuration as described
|
||||||
in this step.
|
in this step.
|
||||||
@@ -7678,7 +7700,8 @@
|
|||||||
For OpenSUSE, use the following:
|
For OpenSUSE, use the following:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
# /etc/init.d/apache2 reload
|
# /etc/init.d/apache2 reload
|
||||||
</literallayout></para></listitem>
|
</literallayout>
|
||||||
|
</para></listitem>
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
If you are using Security-Enhanced Linux
|
If you are using Security-Enhanced Linux
|
||||||
(SELinux), you need to label the files as
|
(SELinux), you need to label the files as
|
||||||
@@ -7688,26 +7711,24 @@
|
|||||||
This example assumes RPM package types:
|
This example assumes RPM package types:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
# chcon -R -h -t httpd_sys_content_t tmp/deploy/rpm
|
# chcon -R -h -t httpd_sys_content_t tmp/deploy/rpm
|
||||||
</literallayout></para></listitem>
|
</literallayout>
|
||||||
|
</para></listitem>
|
||||||
</orderedlist>
|
</orderedlist>
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id='package-server-lighttpd'>
|
<section id='package-server-lighttpd'>
|
||||||
<title>Serving Packages via lighttpd</title>
|
<title>Serving Packages Through lighttpd</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
If you are using lighttpd, all you need
|
If you are using lighttpd, all you need
|
||||||
to do is to provide a link from your
|
to do is to provide a link from your
|
||||||
<filename>${TMPDIR}/deploy/<replaceable>package-format</replaceable></filename>
|
<filename>${TMPDIR}/deploy/<replaceable>packageformat</replaceable></filename>
|
||||||
directory to lighttpd's document-root.
|
directory to lighttpd's document-root.
|
||||||
You can determine the specifics of your lighttpd
|
You can determine the specifics of your lighttpd
|
||||||
installation by looking through its configuration file,
|
installation by looking through its configuration file,
|
||||||
which is usually found at:
|
which is usually found at:
|
||||||
<filename>/etc/lighttpd/lighttpd.conf</filename>.
|
<filename>/etc/lighttpd/lighttpd.conf</filename>.
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
For example, if you are using IPK, lighttpd's
|
For example, if you are using IPK, lighttpd's
|
||||||
document-root is set to
|
document-root is set to
|
||||||
<filename>/var/www/lighttpd</filename>, and you had
|
<filename>/var/www/lighttpd</filename>, and you had
|
||||||
@@ -7729,6 +7750,38 @@
|
|||||||
</literallayout>
|
</literallayout>
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section id='package-server-python-simplehttpserver'>
|
||||||
|
<title>Serving Packages Through Python SimpleHTTPServer</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
It is possible to serve packages hosted by a build
|
||||||
|
machine through an HTTP server created with a simple
|
||||||
|
Python command.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
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 <filename>var/www/</filename>
|
||||||
|
(e.g. <filename>/var/www/my_repo/</filename>).
|
||||||
|
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:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
my_repo # ln -s ~{TMPDIR}/deploy/<replaceable>packageformat</replaceable> ./
|
||||||
|
</literallayout>
|
||||||
|
You can start the server by running the following
|
||||||
|
command from the recently created directory:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
# python -m SimpleHTTPServer
|
||||||
|
|
||||||
|
Serving HTTP on 0.0.0 port 8000 ...
|
||||||
|
</literallayout>
|
||||||
|
</para>
|
||||||
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id='runtime-package-management-target'>
|
<section id='runtime-package-management-target'>
|
||||||
@@ -7744,35 +7797,35 @@
|
|||||||
<title>Using RPM</title>
|
<title>Using RPM</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The application for performing runtime package
|
The <filename>smart</filename> application performs
|
||||||
management of RPM packages on the target is called
|
runtime package management of RPM packages.
|
||||||
<filename>smart</filename>.
|
This application is aware of every package database
|
||||||
|
you want to use.
|
||||||
|
You must perform an initial setup for
|
||||||
|
<filename>smart</filename> on the target machine.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
On the target machine, you need to inform
|
As an example, assume the target is able to use the
|
||||||
<filename>smart</filename> of every package database
|
following package databases:
|
||||||
you want to use.
|
|
||||||
As an example, suppose your target device can use the
|
|
||||||
following three package databases from a server named
|
|
||||||
<filename>server.name</filename>:
|
|
||||||
<filename>all</filename>, <filename>i586</filename>,
|
<filename>all</filename>, <filename>i586</filename>,
|
||||||
and <filename>qemux86</filename>.
|
and <filename>qemux86</filename> from a server named
|
||||||
Given this example, issue the following commands on the
|
<filename>my.server</filename>.
|
||||||
target:
|
You must inform <filename>smart</filename> of the
|
||||||
|
availability of these databases by issuing the
|
||||||
|
following commands on the target:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
# smart channel --add all type=rpm-md baseurl=http://server.name/rpm/all
|
# smart channel --add i585 type=rpm-md baseurl=http://my.server/rpm/i586
|
||||||
# smart channel --add i585 type=rpm-md baseurl=http://server.name/rpm/i586
|
# smart channel --add qemux86 type=rpm-md baseurl=http://my.server/rpm/qemux86
|
||||||
# smart channel --add qemux86 type=rpm-md baseurl=http://server.name/rpm/qemux86
|
# smart channel --add all type=rpm-md baseurl=http://my.server/rpm/all
|
||||||
</literallayout>
|
</literallayout>
|
||||||
Also from the target machine, fetch the repository
|
From the target machine, fetch the repository:
|
||||||
information using this command:
|
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
# smart update
|
# smart update
|
||||||
</literallayout>
|
</literallayout>
|
||||||
You can now use the <filename>smart query</filename>
|
After everything is set up, <filename>smart</filename>
|
||||||
and <filename>smart install</filename> commands to
|
is able to find, install, and upgrade packages from
|
||||||
find and install packages from the repositories.
|
the specified repository.
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -7780,61 +7833,104 @@
|
|||||||
<title>Using IPK</title>
|
<title>Using IPK</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The application for performing runtime package
|
The <filename>opkg</filename> application performs
|
||||||
management of IPK packages on the target is called
|
runtime package management of IPK packages.
|
||||||
<filename>opkg</filename>.
|
This application is aware of every package database
|
||||||
|
you want to use.
|
||||||
|
You must perform an initial setup for
|
||||||
|
<filename>opkg</filename> on the target machine.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
In order to inform <filename>opkg</filename> of the
|
The <filename>opkg</filename> application uses
|
||||||
package databases you want to use, simply create one
|
configuration files to find available package
|
||||||
or more <filename>*.conf</filename> files in the
|
databases.
|
||||||
<filename>/etc/opkg</filename> directory on the target.
|
Thus, you need to create a configuration file inside
|
||||||
The <filename>opkg</filename> application uses them
|
the <filename>/etc/opkg/</filename> direction, which
|
||||||
to find its available package databases.
|
informs <filename>opkg</filename> of any repository
|
||||||
As an example, suppose you configured your HTTP server
|
you want to use.
|
||||||
on your machine named
|
</para>
|
||||||
<filename>www.mysite.com</filename> to serve files
|
|
||||||
from a <filename>BOARD-dir</filename> directory under
|
<para>
|
||||||
its document-root.
|
For example, assume the following:
|
||||||
In this case, you might create a configuration
|
<itemizedlist>
|
||||||
file on the target called
|
<listitem><para>
|
||||||
<filename>/etc/opkg/base-feeds.conf</filename> that
|
An HTTP server named
|
||||||
contains:
|
<filename>my.server</filename> exists on your
|
||||||
|
build machine.
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
The server is serving packages from a directory
|
||||||
|
named <filename>ipk/</filename>.
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
The target machine is able to use the
|
||||||
|
<filename>i586</filename>,
|
||||||
|
<filename>all</filename>, and
|
||||||
|
<filename>qemux86</filename> package
|
||||||
|
databases.
|
||||||
|
</para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
On the target, create a configuration file
|
||||||
|
(e.g. <filename>my_repo.conf</filename>) inside the
|
||||||
|
<filename>/etc/opkg/</filename> directory containing
|
||||||
|
the following:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
src/gz all http://www.mysite.com/BOARD-dir/all
|
src/gz all http://my.server/ipk/all
|
||||||
src/gz armv7a http://www.mysite.com/BOARD-dir/armv7a
|
src/gz i586 http://my.server/ipk/i586
|
||||||
src/gz beaglebone http://www.mysite.com/BOARD-dir/beaglebone
|
src/gz qemux86 http://my.server/ipk/qemux86
|
||||||
</literallayout>
|
</literallayout>
|
||||||
</para>
|
Next, instruct <filename>opkg</filename> to fetch
|
||||||
|
the repository information:
|
||||||
<para>
|
|
||||||
As a way of making it easier to generate and make
|
|
||||||
these IPK configuration files available on your
|
|
||||||
target, simply define
|
|
||||||
<ulink url='&YOCTO_DOCS_REF_URL;#var-FEED_DEPLOYDIR_BASE_URI'><filename>FEED_DEPLOYDIR_BASE_URI</filename></ulink>
|
|
||||||
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
|
|
||||||
<filename>BOARD-dir</filename> underneath your HTTP
|
|
||||||
server's document-root, you need to set
|
|
||||||
<filename>FEED_DEPLOYDIR_BASE_URI</filename> to
|
|
||||||
<filename>http://192.168.7.1/BOARD-dir</filename> and
|
|
||||||
a set of configuration files will be generated for you
|
|
||||||
in your target to work with this feed.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
On the target machine, fetch (or refresh) the
|
|
||||||
repository information using this command:
|
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
#opkg update
|
#opkg update
|
||||||
</literallayout>
|
</literallayout>
|
||||||
You can now use the <filename>opkg list</filename> and
|
The <filename>opkg</filename> application is now able
|
||||||
<filename>opkg install</filename> commands to find and
|
to find, install, and upgrade packages from the
|
||||||
install packages from the repositories.
|
specified repository.
|
||||||
|
</para>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section id='runtime-package-management-target-deb'>
|
||||||
|
<title>Using DEB</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
The <filename>apt</filename> 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
|
||||||
|
<filename>opkg</filename> on the target machine.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
To inform <filename>apt</filename> of the repository
|
||||||
|
you want to use, you might create a list file (e.g.
|
||||||
|
<filename>my_repo.list</filename>) inside the
|
||||||
|
<filename>/etc/apt/sources.list.d/</filename>
|
||||||
|
directory.
|
||||||
|
As an example, suppose you are serving packages from a
|
||||||
|
<filename>deb/</filename> directory containing the
|
||||||
|
<filename>i586</filename>,
|
||||||
|
<filename>all</filename>, and
|
||||||
|
<filename>qemux86</filename> databases through an
|
||||||
|
HTTP server named <filename>my.server</filename>.
|
||||||
|
The list file should contain:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
deb http://my.server/deb/all ./
|
||||||
|
deb http://my.server/deb/i586 ./
|
||||||
|
deb http://my.server/deb/qemux86 ./
|
||||||
|
</literallayout>
|
||||||
|
Next, instruct the <filename>apt</filename>
|
||||||
|
application to fetch the repository information:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
#apt-get update
|
||||||
|
</literallayout>
|
||||||
|
After this step, <filename>apt</filename> is able
|
||||||
|
to find, install, and upgrade packages from the
|
||||||
|
specified repository.
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Reference in New Issue
Block a user