ref-manual, dev-manual: Review comments applied to package repository

Changes are the review comments from Paul Eggleton regarding
setting up the optional package repository on the host that
can be used by Smart.  These changes reflect the fact that
the task is not package-type dependent or host web server
dependent.

(From yocto-docs rev: 779989878bcc9501ddc4570519d93325442a8493)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Scott Rifenbark 2013-04-03 08:04:31 -07:00 committed by Richard Purdie
parent c683dfb38f
commit 9a98f403bd
2 changed files with 100 additions and 108 deletions

View File

@ -606,27 +606,27 @@
<filename>EXTRA_IMAGE_FEATURES</filename></title> <filename>EXTRA_IMAGE_FEATURES</filename></title>
<para> <para>
Ultimately, you might want to add extra image features to the Ultimately, you might want to add extra image features to the
set by using the set by using the
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'>IMAGE_FEATURES</ulink></filename> <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'>IMAGE_FEATURES</ulink></filename>
variable. variable.
To create these features, the best reference is To create these features, the best reference is
<filename>meta/classes/core-image.bbclass</filename>, which <filename>meta/classes/core-image.bbclass</filename>, which
shows how you can add features. shows how you can add features.
In summary, the file looks at the contents of the In summary, the file looks at the contents of the
<filename>IMAGE_FEATURES</filename> variable and then maps those <filename>IMAGE_FEATURES</filename> variable and then maps those
contents into a set of tasks or packages. contents into a set of tasks or packages.
Based on this information, the build system automatically Based on this information, the build system automatically
generates the generates the
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'> IMAGE_INSTALL</ulink></filename> <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'> IMAGE_INSTALL</ulink></filename>
variable. variable.
You can add extra features by extending the class or creating a You can add extra features by extending the class or creating a
custom class for use with specialized image custom class for use with specialized image
<filename>.bb</filename> files. <filename>.bb</filename> files.
You can also add more features by configuring the You can also add more features by configuring the
<filename><ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'>EXTRA_IMAGE_FEATURES</ulink></filename> <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'>EXTRA_IMAGE_FEATURES</ulink></filename>
variable in the <filename>local.conf</filename> file found in variable in the <filename>local.conf</filename> file found in
the <filename>local.conf</filename> file, which is located in the <filename>local.conf</filename> file, which is located in
the <link linkend='build-directory'>Build Directory</link>. the <link linkend='build-directory'>Build Directory</link>.
</para> </para>
@ -634,25 +634,25 @@
<title>Choosing the SSH Server</title> <title>Choosing the SSH Server</title>
<para> <para>
The Yocto Project ships with two SSH servers you can use The Yocto Project ships with two SSH servers you can use
with your images: Dropbear and OpenSSH. with your images: Dropbear and OpenSSH.
Dropbear is a minimal SSH server appropriate for Dropbear is a minimal SSH server appropriate for
resource-constrained environments, while OpenSSH is a resource-constrained environments, while OpenSSH is a
well-known standard SSH server implementation. well-known standard SSH server implementation.
By default, the <filename>core-image-sato</filename> image By default, the <filename>core-image-sato</filename> image
is configured to use Dropbear. is configured to use Dropbear.
The <filename>core-image-basic</filename> and The <filename>core-image-basic</filename> and
<filename>core-image-lsb</filename> images both <filename>core-image-lsb</filename> images both
include OpenSSH. include OpenSSH.
The <filename>core-image-minimal</filename> image does not The <filename>core-image-minimal</filename> image does not
contain an SSH server. contain an SSH server.
</para> </para>
<para> <para>
You can customize your image and change these defaults. You can customize your image and change these defaults.
Edit <filename>IMAGE_FEATURES</filename> variable Edit <filename>IMAGE_FEATURES</filename> variable
so that it configures the image you are working with to so that it configures the image you are working with to
include <filename>ssh-server-dropbear</filename> or include <filename>ssh-server-dropbear</filename> or
<filename>ssh-server-openssh</filename>. <filename>ssh-server-openssh</filename>.
</para> </para>
</section> </section>
@ -661,24 +661,24 @@
<title>Creating a Read-Only Root Filesystem</title> <title>Creating a Read-Only Root Filesystem</title>
<para> <para>
Another example of customizing your image could be setting Another example of customizing your image could be setting
up a read-only filesystem. up a read-only filesystem.
Suppose, for security reasons, you need to disable the Suppose, for security reasons, you need to disable the
your target device's root filesystem's write permisions your target device's root filesystem's write permisions
(i.e. you need a read-only root filesystem). (i.e. you need a read-only root filesystem).
Or, perhaps you are running the device's operating system Or, perhaps you are running the device's operating system
from a read-only storage device. from a read-only storage device.
For either case, you can customize your image for For either case, you can customize your image for
that behavior. that behavior.
</para> </para>
<para> <para>
To create a read-only root filesystem, simply add the To create a read-only root filesystem, simply add the
"read-only-rootfs" feature to your image. "read-only-rootfs" feature to your image.
Using either of the following statements in your Using either of the following statements in your
image recipe or from within the image recipe or from within the
<filename>local.conf</filename> file found in the Build <filename>local.conf</filename> file found in the Build
Directory causes the build system to create a Directory causes the build system to create a
read-only root filesystem: read-only root filesystem:
<literallayout class='monospaced'> <literallayout class='monospaced'>
IMAGE_FEATURES = "read-only-rootfs" IMAGE_FEATURES = "read-only-rootfs"
@ -2320,16 +2320,16 @@
<para> <para>
It is easiest to have something to start with when creating It is easiest to have something to start with when creating
your own distribution. your own distribution.
You can use the Yocto Project out-of-the-box to create the You can use the Yocto Project out-of-the-box to create the
<filename>poky-tiny</filename> distribution. <filename>poky-tiny</filename> distribution.
Ulitmately, you will want to make changes in your own Ulitmately, you will want to make changes in your own
distribution that are likely modeled after distribution that are likely modeled after
<filename>poky-tiny</filename>. <filename>poky-tiny</filename>.
<note> <note>
To use <filename>poky-tiny</filename> in your build, To use <filename>poky-tiny</filename> in your build,
set the <filename>DISTRO</filename> variable in your set the <filename>DISTRO</filename> variable in your
<filename>local.conf</filename> file to "poky-tiny" <filename>local.conf</filename> file to "poky-tiny"
as described in the as described in the
"<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>" "<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>"
section. section.
</note> </note>
@ -2344,7 +2344,7 @@
Dynamic memory contains memory that is allocated at runtime, Dynamic memory contains memory that is allocated at runtime,
stacks, hash tables, and so forth. stacks, hash tables, and so forth.
Temporary memory is recovered after the boot process. Temporary memory is recovered after the boot process.
This memory consists of memory used for decompressing This memory consists of memory used for decompressing
the kernel and for the <filename>__init__</filename> the kernel and for the <filename>__init__</filename>
functions. functions.
</para> </para>
@ -2560,7 +2560,7 @@
<title>Look for Other Ways to Minimize Size</title> <title>Look for Other Ways to Minimize Size</title>
<para> <para>
Depending on your particular circumstances, other areas that you Depending on your particular circumstances, other areas that you
can trim likely exist. can trim likely exist.
The key to finding these areas is through tools and methods The key to finding these areas is through tools and methods
described here combined with experimentation and iteration. described here combined with experimentation and iteration.
@ -2570,35 +2570,35 @@
In general, follow this process: In general, follow this process:
<orderedlist> <orderedlist>
<listitem><para>Remove <filename>eglibc</filename> <listitem><para>Remove <filename>eglibc</filename>
features from features from
<ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></ulink> <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></ulink>
that you think you don't need.</para></listitem> that you think you don't need.</para></listitem>
<listitem><para>Build your distribution. <listitem><para>Build your distribution.
</para></listitem> </para></listitem>
<listitem><para>If the build fails due to missing <listitem><para>If the build fails due to missing
symbols in a package, determine if you can symbols in a package, determine if you can
reconfigure the package to not need those reconfigure the package to not need those
features. features.
For example, change the configuration to not For example, change the configuration to not
support wide character support as is done for support wide character support as is done for
<filename>ncurses</filename>. <filename>ncurses</filename>.
Or, if support for those characters is needed, Or, if support for those characters is needed,
determine what <filename>eglibc</filename> determine what <filename>eglibc</filename>
features provide the support and restore the features provide the support and restore the
configuration. configuration.
</para></listitem> </para></listitem>
<listitem><para>Rebuild and repeat the process. <listitem><para>Rebuild and repeat the process.
</para></listitem> </para></listitem>
</orderedlist></para></listitem> </orderedlist></para></listitem>
<listitem><para><filename>busybox</filename>: <listitem><para><filename>busybox</filename>:
For BusyBox, use a process similar as described for For BusyBox, use a process similar as described for
<filename>eglibc</filename>. <filename>eglibc</filename>.
A difference is you will need to boot the resulting A difference is you will need to boot the resulting
system to see if you are able to do everything you system to see if you are able to do everything you
expect from the running system. expect from the running system.
You need to be sure to integrate configuration fragments You need to be sure to integrate configuration fragments
into Busybox because BusyBox handles its own core into Busybox because BusyBox handles its own core
features and then allows you to add configuration features and then allows you to add configuration
fragments on top. fragments on top.
</para></listitem> </para></listitem>
</itemizedlist> </itemizedlist>
@ -3126,8 +3126,9 @@
<title>Setting Up Runtime Package Management</title> <title>Setting Up Runtime Package Management</title>
<para> <para>
It is possible to set up a repository that is a host-based For RPM, IPK, and DEB package formats, it is possible to set
package feed from which you can install packages on the up a repository that is a host-based
package feed from which you can install packages on the
target system during runtime. target system during runtime.
Doing so is optional and depends on the following: Doing so is optional and depends on the following:
<itemizedlist> <itemizedlist>
@ -3135,14 +3136,14 @@
You take specific steps to set up the feed. You take specific steps to set up the feed.
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
When you build your image, you select to use the When you build your image, you select to use the
RPM package manager by setting the appropriate package manager by setting 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. variable.
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
You have Apache 2 installed and configured on the You have a supported web server, such as Apache 2,
development host. installed and configured on the development host.
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
You have <filename>createrepo</filename> installed on You have <filename>createrepo</filename> installed on
@ -3152,14 +3153,16 @@
</para> </para>
<para> <para>
Here are the steps to set up this optional package feed: Following are the steps to set up the optional repository.
This examples assumes you are using RPM and the Apache 2
server:
<orderedlist> <orderedlist>
<listitem><para> <listitem><para>
Add the directory to your Apache configuration, which Add the directory to your Apache configuration, which
you can find at 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 development system. Use commands similar to these on the 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>
named <filename>poky</filename> in your home directory: named <filename>poky</filename> in your home directory:
<literallayout class='monospaced'> <literallayout class='monospaced'>
@ -3169,7 +3172,7 @@
&lt;Directory "~/poky/build/tmp/deploy/rpm"&gt; &lt;Directory "~/poky/build/tmp/deploy/rpm"&gt;
Options +Indexes Options +Indexes
&lt;/Directory&gt; &lt;/Directory&gt;
&lt;/VirtualHost&gt; &lt;/VirtualHost&gt;
</literallayout> </literallayout>
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
@ -3177,35 +3180,23 @@
For all commands, be sure you have root privileges. For all commands, be sure you have root privileges.
</para> </para>
<para> <para>
If your development system is using Fedora or If your development system is using Fedora or
CentOS, use the following: CentOS, use the following:
</para> <literallayout class='monospaced'>
<note> service httpd reload
<emphasis>Note to Self:</emphasis> Paul says that </literallayout>
some of the distros (Fedora and CentOS in For Ubuntu, use the following:
particular) might have different commands based <literallayout class='monospaced'>
on the distro version.
We need links for the reader to follow for the
specifics.
We don't want to have to document all this
distro-specific stuff.
</note>
<para>
<literallayout class='monospaced'>
service httpd reload
</literallayout>
For Ubuntu, use the following:
<literallayout class='monospaced'>
/etc/init.d/apache2 reload /etc/init.d/apache2 reload
</literallayout> </literallayout>
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> </literallayout>
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
Change your working directory to Change your working directory to
<filename>tmp/deploy/rpm</filename> in the <filename>tmp/deploy/rpm</filename> in the
<link linkend='build-directory'>Build Directory</link>. <link linkend='build-directory'>Build Directory</link>.
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
@ -3217,13 +3208,13 @@
</para> </para>
<para> <para>
<note> <note>
If you're updating, add If you're updating, add
<filename>&dash;&dash;update</filename> to save some time. <filename>&dash;&dash;update</filename> to save some time.
</note> </note>
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
If you are using Security-Enhanced Linux (SELinux), If you are using Security-Enhanced Linux (SELinux),
you need to label the files as being accessible you need to label the files as being accessible
through Apache. through Apache.
Use the following command from the development host: Use the following command from the development host:
<literallayout class='monospaced'> <literallayout class='monospaced'>
@ -3232,14 +3223,14 @@
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
On the target machine, add the repository to Smart. On the target machine, add the repository to Smart.
For <filename>somealias</filename>, provide a local For <filename>somealias</filename>, provide a local
alias for the repository: alias for the repository:
<literallayout class='monospaced'> <literallayout class='monospaced'>
smart channel &dash;&dash;add &lt;somealias&gt; type=rpm-md baseurl=http://server.name/rpm smart channel &dash;&dash;add &lt;somealias&gt; type=rpm-md baseurl=http://server.name/rpm
</literallayout> </literallayout>
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
Also from the target machine, fetch the repository Also from the target machine, fetch the repository
information using this command: information using this command:
<literallayout class='monospaced'> <literallayout class='monospaced'>
smart update smart update
@ -3249,9 +3240,9 @@
</para> </para>
<para> <para>
After taking these steps and making sure that the other After taking these steps and making sure that the other
requirements mentioned at the beginning of the section are met, requirements mentioned at the beginning of the section are met,
reboot the target device to take advantage of runtime package reboot the target device to take advantage of runtime package
installations. installations.
</para> </para>
</section> </section>

View File

@ -327,52 +327,53 @@
The first class listed in this variable is used for image generation. The first class listed in this variable is used for image generation.
</para> </para>
<para>
If you take the optional step to set up a repository (package feed)
on the development host that can be used by Smart, you can
install packages from the feed while you are running the image
on the target (i.e. runtime installation of packages).
For information on how to set up this repository, see the
"<ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-runtime-package-management'>Setting Up Runtime Package Management</ulink>"
in the Yocto Project Development Manual.
</para>
<para> <para>
The package class you choose can affect build-time performance and has space The package class you choose can affect build-time performance and has space
ramifications. ramifications.
In general, building a package with IPK takes about thirty percent less In general, building a package with IPK takes about thirty percent less
time as compared to using RPM to build the same or similar package. time as compared to using RPM to build the same or similar package.
This comparison takes into account a complete build of the package with This comparison takes into account a complete build of the package with
all dependencies previously built. all dependencies previously built.
The reason for this discrepancy is because the RPM package manager The reason for this discrepancy is because the RPM package manager
creates and processes more creates and processes more
<ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> than the <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> than the
IPK package manager. IPK package manager.
Consequently, you might consider setting <filename>PACKAGE_CLASSES</filename> Consequently, you might consider setting <filename>PACKAGE_CLASSES</filename>
to "package_ipk" if you are building smaller systems. to "package_ipk" if you are building smaller systems.
</para> </para>
<para> <para>
Before making your decision on package manager, however, you should Before making your decision on package manager, however, you should
consider some further things about using RPM: consider some further things about using RPM:
<itemizedlist> <itemizedlist>
<listitem><para> <listitem><para>
RPM starts to provide more abilities than IPK due to RPM starts to provide more abilities than IPK due to
the fact that it processes more metadata. the fact that it processes more metadata.
For example, this information includes individual file types, For example, this information includes individual file types,
file checksum generation and evaluation on install, sparse file file checksum generation and evaluation on install, sparse file
support, conflict detection and resolution for Multilib systems, support, conflict detection and resolution for Multilib systems,
ACID style upgrade, and repackaging abilities for rollbacks. ACID style upgrade, and repackaging abilities for rollbacks.
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
For smaller systems, the extra space used for the Berkley For smaller systems, the extra space used for the Berkley
Database and the amount of metadata when using RPM can affect Database and the amount of metadata when using RPM can affect
your ability to perform on-device upgrades. your ability to perform on-device upgrades.
</para></listitem> </para></listitem>
<listitem><para> </itemizedlist>
If you take the steps to set up a repository (package feed)
on the development host that can be used by Smart, you can
install packages from the feed while you are running the image
on the target (i.e. runtime installation of packages).
For information on how to set up this repository, see the
"<ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-runtime-package-management'>Setting Up Runtime Package Management</ulink>"
in the Yocto Project Development Manual.
</para></listitem>
</itemizedlist>
</para> </para>
<para> <para>
You can find additional information on the effects of the package You can find additional information on the effects of the package
class at these two Yocto Project mailing list links: class at these two Yocto Project mailing list links:
<itemizedlist> <itemizedlist>
<listitem><para><ulink url='&YOCTO_LISTS_URL;/pipermail/poky/2011-May/006362.html'> <listitem><para><ulink url='&YOCTO_LISTS_URL;/pipermail/poky/2011-May/006362.html'>