diff options
author | Scott Rifenbark <srifenbark@gmail.com> | 2016-06-07 10:24:21 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-21 12:59:06 +0100 |
commit | 7ef4a6593e2c58259a8f34fbe6d633c9d12cf1c6 (patch) | |
tree | 3a10500a66a715d144f457f7335352522f19142d /documentation/dev-manual/dev-manual-common-tasks.xml | |
parent | 44f29bf89aed57178dd00d8123d85c4e181241bd (diff) | |
download | poky-7ef4a6593e2c58259a8f34fbe6d633c9d12cf1c6.tar.gz |
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 <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/dev-manual/dev-manual-common-tasks.xml')
-rw-r--r-- | documentation/dev-manual/dev-manual-common-tasks.xml | 278 |
1 files changed, 187 insertions, 91 deletions
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 @@ | |||
7528 | <title>Build Considerations</title> | 7528 | <title>Build Considerations</title> |
7529 | 7529 | ||
7530 | <para> | 7530 | <para> |
7531 | This section describes build considerations that you need | 7531 | This section describes build considerations of which you |
7532 | to be aware of in order to provide support for runtime | 7532 | need to be aware in order to provide support for runtime |
7533 | package management. | 7533 | package management. |
7534 | </para> | 7534 | </para> |
7535 | 7535 | ||
7536 | <para> | 7536 | <para> |
7537 | When BitBake generates packages it needs to know | 7537 | When BitBake generates packages, it needs to know |
7538 | what format or formats to use. | 7538 | what format or formats to use. |
7539 | In your configuration, you use the | 7539 | In your configuration, you use the |
7540 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink> | 7540 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink> |
7541 | variable to specify the format. | 7541 | variable to specify the format: |
7542 | <note> | 7542 | <orderedlist> |
7543 | You can choose to have more than one format but you must | 7543 | <listitem><para> |
7544 | provide at least one. | 7544 | Open the <filename>local.conf</filename> file |
7545 | </note> | 7545 | inside your |
7546 | <link linkend='build-directory'>Build Directory</link> | ||
7547 | (e.g. <filename>~/poky/build/conf/local.conf</filename>). | ||
7548 | </para></listitem> | ||
7549 | <listitem><para> | ||
7550 | Select the desired package format as follows: | ||
7551 | <literallayout class='monospaced'> | ||
7552 | PACKAGE_CLASSES ?= “package_<replaceable>packageformat</replaceable>” | ||
7553 | </literallayout> | ||
7554 | where <replaceable>packageformat</replaceable> | ||
7555 | can be "ipk", "rpm", and "deb", which are the | ||
7556 | supported package formats. | ||
7557 | <note> | ||
7558 | Because the Yocto Project supports three | ||
7559 | different package formats, you can set the | ||
7560 | variable with more than one argument. | ||
7561 | However, the OpenEmbedded build system only | ||
7562 | uses the first argument when creating an image | ||
7563 | or Software Development Kit (SDK). | ||
7564 | </note> | ||
7565 | </para></listitem> | ||
7566 | </orderedlist> | ||
7546 | </para> | 7567 | </para> |
7547 | 7568 | ||
7548 | <para> | 7569 | <para> |
7549 | If you would like your image to start off with a basic | 7570 | If you would like your image to start off with a basic |
7550 | package database of the packages in your current build | 7571 | package database containing the packages in your current |
7551 | as well as have the relevant tools available on the | 7572 | build as well as to have the relevant tools available on the |
7552 | target for runtime package management, you can include | 7573 | target for runtime package management, you can include |
7553 | "package-management" in the | 7574 | "package-management" in the |
7554 | <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink> | 7575 | <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink> |
@@ -7583,9 +7604,9 @@ | |||
7583 | <literallayout class='monospaced'> | 7604 | <literallayout class='monospaced'> |
7584 | $ bitbake <replaceable>some-package</replaceable> package-index | 7605 | $ bitbake <replaceable>some-package</replaceable> package-index |
7585 | </literallayout> | 7606 | </literallayout> |
7586 | This is because BitBake does not properly schedule the | 7607 | The reason for this restriction is because BitBake does not |
7587 | <filename>package-index</filename> target fully after any | 7608 | properly schedule the <filename>package-index</filename> |
7588 | other target has completed. | 7609 | target fully after any other target has completed. |
7589 | Thus, be sure to run the package update step separately. | 7610 | Thus, be sure to run the package update step separately. |
7590 | </para> | 7611 | </para> |
7591 | 7612 | ||
@@ -7601,9 +7622,10 @@ | |||
7601 | 7622 | ||
7602 | <para> | 7623 | <para> |
7603 | When your build is complete, your packages reside in the | 7624 | When your build is complete, your packages reside in the |
7604 | <filename>${TMPDIR}/deploy/<replaceable>package-format</replaceable></filename> | 7625 | <filename>${TMPDIR}/deploy/<replaceable>packageformat</replaceable></filename> |
7605 | directory. | 7626 | directory. |
7606 | For example, if <filename>${TMPDIR}</filename> | 7627 | For example, if |
7628 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink><filename>}</filename> | ||
7607 | is <filename>tmp</filename> and your selected package type | 7629 | is <filename>tmp</filename> and your selected package type |
7608 | is IPK, then your IPK packages are available in | 7630 | is IPK, then your IPK packages are available in |
7609 | <filename>tmp/deploy/ipk</filename>. | 7631 | <filename>tmp/deploy/ipk</filename>. |
@@ -7614,10 +7636,9 @@ | |||
7614 | <title>Host or Server Machine Setup</title> | 7636 | <title>Host or Server Machine Setup</title> |
7615 | 7637 | ||
7616 | <para> | 7638 | <para> |
7617 | Typically, packages are served from a server using | 7639 | Although other protocols are possible, a server using HTTP |
7618 | HTTP. | 7640 | typically serves packages. |
7619 | However, other protocols are possible. | 7641 | If you want to use HTTP, then set up and configure a |
7620 | If you want to use HTTP, then setup and configure a | ||
7621 | web server, such as Apache 2 or lighttpd, on the machine | 7642 | web server, such as Apache 2 or lighttpd, on the machine |
7622 | serving the packages. | 7643 | serving the packages. |
7623 | </para> | 7644 | </para> |
@@ -7640,7 +7661,7 @@ | |||
7640 | Add the directory to your Apache | 7661 | Add the directory to your Apache |
7641 | configuration, which you can find at | 7662 | configuration, which you can find at |
7642 | <filename>/etc/httpd/conf/httpd.conf</filename>. | 7663 | <filename>/etc/httpd/conf/httpd.conf</filename>. |
7643 | Use commands similar to these on the | 7664 | Use commands similar to the following on the |
7644 | development system. | 7665 | development system. |
7645 | These example commands assume a top-level | 7666 | These example commands assume a top-level |
7646 | <link linkend='source-directory'>Source Directory</link> | 7667 | <link linkend='source-directory'>Source Directory</link> |
@@ -7651,13 +7672,14 @@ | |||
7651 | as IPK, use "ipk" in the pathnames: | 7672 | as IPK, use "ipk" in the pathnames: |
7652 | <literallayout class='monospaced'> | 7673 | <literallayout class='monospaced'> |
7653 | <VirtualHost *:80> | 7674 | <VirtualHost *:80> |
7654 | .... | 7675 | ... |
7655 | Alias /rpm ~/poky/build/tmp/deploy/rpm | 7676 | Alias /rpm ~/poky/build/tmp/deploy/rpm |
7656 | <Directory "~/poky/build/tmp/deploy/rpm"> | 7677 | <Directory "~/poky/build/tmp/deploy/rpm"> |
7657 | Options +Indexes | 7678 | Options +Indexes |
7658 | </Directory> | 7679 | </Directory> |
7659 | </VirtualHost> | 7680 | </VirtualHost> |
7660 | </literallayout></para></listitem> | 7681 | </literallayout> |
7682 | </para></listitem> | ||
7661 | <listitem><para> | 7683 | <listitem><para> |
7662 | Reload the Apache configuration as described | 7684 | Reload the Apache configuration as described |
7663 | in this step. | 7685 | in this step. |
@@ -7678,7 +7700,8 @@ | |||
7678 | For OpenSUSE, use the following: | 7700 | For OpenSUSE, use the following: |
7679 | <literallayout class='monospaced'> | 7701 | <literallayout class='monospaced'> |
7680 | # /etc/init.d/apache2 reload | 7702 | # /etc/init.d/apache2 reload |
7681 | </literallayout></para></listitem> | 7703 | </literallayout> |
7704 | </para></listitem> | ||
7682 | <listitem><para> | 7705 | <listitem><para> |
7683 | If you are using Security-Enhanced Linux | 7706 | If you are using Security-Enhanced Linux |
7684 | (SELinux), you need to label the files as | 7707 | (SELinux), you need to label the files as |
@@ -7688,26 +7711,24 @@ | |||
7688 | This example assumes RPM package types: | 7711 | This example assumes RPM package types: |
7689 | <literallayout class='monospaced'> | 7712 | <literallayout class='monospaced'> |
7690 | # chcon -R -h -t httpd_sys_content_t tmp/deploy/rpm | 7713 | # chcon -R -h -t httpd_sys_content_t tmp/deploy/rpm |
7691 | </literallayout></para></listitem> | 7714 | </literallayout> |
7715 | </para></listitem> | ||
7692 | </orderedlist> | 7716 | </orderedlist> |
7693 | </para> | 7717 | </para> |
7694 | </section> | 7718 | </section> |
7695 | 7719 | ||
7696 | <section id='package-server-lighttpd'> | 7720 | <section id='package-server-lighttpd'> |
7697 | <title>Serving Packages via lighttpd</title> | 7721 | <title>Serving Packages Through lighttpd</title> |
7698 | 7722 | ||
7699 | <para> | 7723 | <para> |
7700 | If you are using lighttpd, all you need | 7724 | If you are using lighttpd, all you need |
7701 | to do is to provide a link from your | 7725 | to do is to provide a link from your |
7702 | <filename>${TMPDIR}/deploy/<replaceable>package-format</replaceable></filename> | 7726 | <filename>${TMPDIR}/deploy/<replaceable>packageformat</replaceable></filename> |
7703 | directory to lighttpd's document-root. | 7727 | directory to lighttpd's document-root. |
7704 | You can determine the specifics of your lighttpd | 7728 | You can determine the specifics of your lighttpd |
7705 | installation by looking through its configuration file, | 7729 | installation by looking through its configuration file, |
7706 | which is usually found at: | 7730 | which is usually found at: |
7707 | <filename>/etc/lighttpd/lighttpd.conf</filename>. | 7731 | <filename>/etc/lighttpd/lighttpd.conf</filename>. |
7708 | </para> | ||
7709 | |||
7710 | <para> | ||
7711 | For example, if you are using IPK, lighttpd's | 7732 | For example, if you are using IPK, lighttpd's |
7712 | document-root is set to | 7733 | document-root is set to |
7713 | <filename>/var/www/lighttpd</filename>, and you had | 7734 | <filename>/var/www/lighttpd</filename>, and you had |
@@ -7729,6 +7750,38 @@ | |||
7729 | </literallayout> | 7750 | </literallayout> |
7730 | </para> | 7751 | </para> |
7731 | </section> | 7752 | </section> |
7753 | |||
7754 | <section id='package-server-python-simplehttpserver'> | ||
7755 | <title>Serving Packages Through Python SimpleHTTPServer</title> | ||
7756 | |||
7757 | <para> | ||
7758 | It is possible to serve packages hosted by a build | ||
7759 | machine through an HTTP server created with a simple | ||
7760 | Python command. | ||
7761 | </para> | ||
7762 | |||
7763 | <para> | ||
7764 | The first thing you do is to create a directory that | ||
7765 | contains the packages to host. | ||
7766 | Be sure you have root privileges and place the directory | ||
7767 | inside <filename>var/www/</filename> | ||
7768 | (e.g. <filename>/var/www/my_repo/</filename>). | ||
7769 | To ensure the directory contains the packages you want | ||
7770 | to serve, you need to create a symlink from the | ||
7771 | package feed area to the directory that hosts the | ||
7772 | packages you want to provide: | ||
7773 | <literallayout class='monospaced'> | ||
7774 | my_repo # ln -s ~{TMPDIR}/deploy/<replaceable>packageformat</replaceable> ./ | ||
7775 | </literallayout> | ||
7776 | You can start the server by running the following | ||
7777 | command from the recently created directory: | ||
7778 | <literallayout class='monospaced'> | ||
7779 | # python -m SimpleHTTPServer | ||
7780 | |||
7781 | Serving HTTP on 0.0.0 port 8000 ... | ||
7782 | </literallayout> | ||
7783 | </para> | ||
7784 | </section> | ||
7732 | </section> | 7785 | </section> |
7733 | 7786 | ||
7734 | <section id='runtime-package-management-target'> | 7787 | <section id='runtime-package-management-target'> |
@@ -7744,35 +7797,35 @@ | |||
7744 | <title>Using RPM</title> | 7797 | <title>Using RPM</title> |
7745 | 7798 | ||
7746 | <para> | 7799 | <para> |
7747 | The application for performing runtime package | 7800 | The <filename>smart</filename> application performs |
7748 | management of RPM packages on the target is called | 7801 | runtime package management of RPM packages. |
7749 | <filename>smart</filename>. | 7802 | This application is aware of every package database |
7803 | you want to use. | ||
7804 | You must perform an initial setup for | ||
7805 | <filename>smart</filename> on the target machine. | ||
7750 | </para> | 7806 | </para> |
7751 | 7807 | ||
7752 | <para> | 7808 | <para> |
7753 | On the target machine, you need to inform | 7809 | As an example, assume the target is able to use the |
7754 | <filename>smart</filename> of every package database | 7810 | following package databases: |
7755 | you want to use. | ||
7756 | As an example, suppose your target device can use the | ||
7757 | following three package databases from a server named | ||
7758 | <filename>server.name</filename>: | ||
7759 | <filename>all</filename>, <filename>i586</filename>, | 7811 | <filename>all</filename>, <filename>i586</filename>, |
7760 | and <filename>qemux86</filename>. | 7812 | and <filename>qemux86</filename> from a server named |
7761 | Given this example, issue the following commands on the | 7813 | <filename>my.server</filename>. |
7762 | target: | 7814 | You must inform <filename>smart</filename> of the |
7815 | availability of these databases by issuing the | ||
7816 | following commands on the target: | ||
7763 | <literallayout class='monospaced'> | 7817 | <literallayout class='monospaced'> |
7764 | # smart channel --add all type=rpm-md baseurl=http://server.name/rpm/all | 7818 | # smart channel --add i585 type=rpm-md baseurl=http://my.server/rpm/i586 |
7765 | # smart channel --add i585 type=rpm-md baseurl=http://server.name/rpm/i586 | 7819 | # smart channel --add qemux86 type=rpm-md baseurl=http://my.server/rpm/qemux86 |
7766 | # smart channel --add qemux86 type=rpm-md baseurl=http://server.name/rpm/qemux86 | 7820 | # smart channel --add all type=rpm-md baseurl=http://my.server/rpm/all |
7767 | </literallayout> | 7821 | </literallayout> |
7768 | Also from the target machine, fetch the repository | 7822 | From the target machine, fetch the repository: |
7769 | information using this command: | ||
7770 | <literallayout class='monospaced'> | 7823 | <literallayout class='monospaced'> |
7771 | # smart update | 7824 | # smart update |
7772 | </literallayout> | 7825 | </literallayout> |
7773 | You can now use the <filename>smart query</filename> | 7826 | After everything is set up, <filename>smart</filename> |
7774 | and <filename>smart install</filename> commands to | 7827 | is able to find, install, and upgrade packages from |
7775 | find and install packages from the repositories. | 7828 | the specified repository. |
7776 | </para> | 7829 | </para> |
7777 | </section> | 7830 | </section> |
7778 | 7831 | ||
@@ -7780,61 +7833,104 @@ | |||
7780 | <title>Using IPK</title> | 7833 | <title>Using IPK</title> |
7781 | 7834 | ||
7782 | <para> | 7835 | <para> |
7783 | The application for performing runtime package | 7836 | The <filename>opkg</filename> application performs |
7784 | management of IPK packages on the target is called | 7837 | runtime package management of IPK packages. |
7785 | <filename>opkg</filename>. | 7838 | This application is aware of every package database |
7839 | you want to use. | ||
7840 | You must perform an initial setup for | ||
7841 | <filename>opkg</filename> on the target machine. | ||
7786 | </para> | 7842 | </para> |
7787 | 7843 | ||
7788 | <para> | 7844 | <para> |
7789 | In order to inform <filename>opkg</filename> of the | 7845 | The <filename>opkg</filename> application uses |
7790 | package databases you want to use, simply create one | 7846 | configuration files to find available package |
7791 | or more <filename>*.conf</filename> files in the | 7847 | databases. |
7792 | <filename>/etc/opkg</filename> directory on the target. | 7848 | Thus, you need to create a configuration file inside |
7793 | The <filename>opkg</filename> application uses them | 7849 | the <filename>/etc/opkg/</filename> direction, which |
7794 | to find its available package databases. | 7850 | informs <filename>opkg</filename> of any repository |
7795 | As an example, suppose you configured your HTTP server | 7851 | you want to use. |
7796 | on your machine named | 7852 | </para> |
7797 | <filename>www.mysite.com</filename> to serve files | 7853 | |
7798 | from a <filename>BOARD-dir</filename> directory under | 7854 | <para> |
7799 | its document-root. | 7855 | For example, assume the following: |
7800 | In this case, you might create a configuration | 7856 | <itemizedlist> |
7801 | file on the target called | 7857 | <listitem><para> |
7802 | <filename>/etc/opkg/base-feeds.conf</filename> that | 7858 | An HTTP server named |
7803 | contains: | 7859 | <filename>my.server</filename> exists on your |
7860 | build machine. | ||
7861 | </para></listitem> | ||
7862 | <listitem><para> | ||
7863 | The server is serving packages from a directory | ||
7864 | named <filename>ipk/</filename>. | ||
7865 | </para></listitem> | ||
7866 | <listitem><para> | ||
7867 | The target machine is able to use the | ||
7868 | <filename>i586</filename>, | ||
7869 | <filename>all</filename>, and | ||
7870 | <filename>qemux86</filename> package | ||
7871 | databases. | ||
7872 | </para></listitem> | ||
7873 | </itemizedlist> | ||
7874 | On the target, create a configuration file | ||
7875 | (e.g. <filename>my_repo.conf</filename>) inside the | ||
7876 | <filename>/etc/opkg/</filename> directory containing | ||
7877 | the following: | ||
7878 | <literallayout class='monospaced'> | ||
7879 | src/gz all http://my.server/ipk/all | ||
7880 | src/gz i586 http://my.server/ipk/i586 | ||
7881 | src/gz qemux86 http://my.server/ipk/qemux86 | ||
7882 | </literallayout> | ||
7883 | Next, instruct <filename>opkg</filename> to fetch | ||
7884 | the repository information: | ||
7804 | <literallayout class='monospaced'> | 7885 | <literallayout class='monospaced'> |
7805 | src/gz all http://www.mysite.com/BOARD-dir/all | 7886 | #opkg update |
7806 | src/gz armv7a http://www.mysite.com/BOARD-dir/armv7a | ||
7807 | src/gz beaglebone http://www.mysite.com/BOARD-dir/beaglebone | ||
7808 | </literallayout> | 7887 | </literallayout> |
7888 | The <filename>opkg</filename> application is now able | ||
7889 | to find, install, and upgrade packages from the | ||
7890 | specified repository. | ||
7809 | </para> | 7891 | </para> |
7892 | </section> | ||
7893 | |||
7894 | <section id='runtime-package-management-target-deb'> | ||
7895 | <title>Using DEB</title> | ||
7810 | 7896 | ||
7811 | <para> | 7897 | <para> |
7812 | As a way of making it easier to generate and make | 7898 | The <filename>apt</filename> application performs |
7813 | these IPK configuration files available on your | 7899 | runtime package management of DEB packages. |
7814 | target, simply define | 7900 | This application uses a source list file to find |
7815 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FEED_DEPLOYDIR_BASE_URI'><filename>FEED_DEPLOYDIR_BASE_URI</filename></ulink> | 7901 | available package databases. |
7816 | to point to your server and the location within the | 7902 | The application is aware of every package database |
7817 | document-root which contains the databases. | 7903 | you want to use. |
7818 | For example: if you are serving your packages over | 7904 | You must perform an initial setup for |
7819 | HTTP, your server's IP address is 192.168.7.1, and | 7905 | <filename>opkg</filename> on the target machine. |
7820 | your databases are located in a directory called | ||
7821 | <filename>BOARD-dir</filename> underneath your HTTP | ||
7822 | server's document-root, you need to set | ||
7823 | <filename>FEED_DEPLOYDIR_BASE_URI</filename> to | ||
7824 | <filename>http://192.168.7.1/BOARD-dir</filename> and | ||
7825 | a set of configuration files will be generated for you | ||
7826 | in your target to work with this feed. | ||
7827 | </para> | 7906 | </para> |
7828 | 7907 | ||
7829 | <para> | 7908 | <para> |
7830 | On the target machine, fetch (or refresh) the | 7909 | To inform <filename>apt</filename> of the repository |
7831 | repository information using this command: | 7910 | you want to use, you might create a list file (e.g. |
7911 | <filename>my_repo.list</filename>) inside the | ||
7912 | <filename>/etc/apt/sources.list.d/</filename> | ||
7913 | directory. | ||
7914 | As an example, suppose you are serving packages from a | ||
7915 | <filename>deb/</filename> directory containing the | ||
7916 | <filename>i586</filename>, | ||
7917 | <filename>all</filename>, and | ||
7918 | <filename>qemux86</filename> databases through an | ||
7919 | HTTP server named <filename>my.server</filename>. | ||
7920 | The list file should contain: | ||
7921 | <literallayout class='monospaced'> | ||
7922 | deb http://my.server/deb/all ./ | ||
7923 | deb http://my.server/deb/i586 ./ | ||
7924 | deb http://my.server/deb/qemux86 ./ | ||
7925 | </literallayout> | ||
7926 | Next, instruct the <filename>apt</filename> | ||
7927 | application to fetch the repository information: | ||
7832 | <literallayout class='monospaced'> | 7928 | <literallayout class='monospaced'> |
7833 | # opkg update | 7929 | #apt-get update |
7834 | </literallayout> | 7930 | </literallayout> |
7835 | You can now use the <filename>opkg list</filename> and | 7931 | After this step, <filename>apt</filename> is able |
7836 | <filename>opkg install</filename> commands to find and | 7932 | to find, install, and upgrade packages from the |
7837 | install packages from the repositories. | 7933 | specified repository. |
7838 | </para> | 7934 | </para> |
7839 | </section> | 7935 | </section> |
7840 | </section> | 7936 | </section> |