Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
| 2 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" |
| 3 | [<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] > |
| 4 | |
| 5 | <chapter id='adt-package'> |
| 6 | <title>Optionally Customizing the Development Packages Installation</title> |
| 7 | |
| 8 | <para> |
| 9 | Because the Yocto Project is suited for embedded Linux development, it is |
| 10 | likely that you will need to customize your development packages installation. |
| 11 | For example, if you are developing a minimal image, then you might not need |
| 12 | certain packages (e.g. graphics support packages). |
| 13 | Thus, you would like to be able to remove those packages from your target sysroot. |
| 14 | </para> |
| 15 | |
| 16 | <section id='package-management-systems'> |
| 17 | <title>Package Management Systems</title> |
| 18 | |
| 19 | <para> |
| 20 | The OpenEmbedded build system supports the generation of sysroot files using |
| 21 | three different Package Management Systems (PMS): |
| 22 | <itemizedlist> |
| 23 | <listitem><para><emphasis>OPKG:</emphasis> A less well known PMS whose use |
| 24 | originated in the OpenEmbedded and OpenWrt embedded Linux projects. |
| 25 | This PMS works with files packaged in an <filename>.ipk</filename> format. |
| 26 | See <ulink url='http://en.wikipedia.org/wiki/Opkg'></ulink> for more |
| 27 | information about OPKG.</para></listitem> |
| 28 | <listitem><para><emphasis>RPM:</emphasis> A more widely known PMS intended for GNU/Linux |
| 29 | distributions. |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 30 | This PMS works with files packaged in an <filename>.rpm</filename> format. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 31 | The build system currently installs through this PMS by default. |
| 32 | See <ulink url='http://en.wikipedia.org/wiki/RPM_Package_Manager'></ulink> |
| 33 | for more information about RPM.</para></listitem> |
| 34 | <listitem><para><emphasis>Debian:</emphasis> The PMS for Debian-based systems |
| 35 | is built on many PMS tools. |
| 36 | The lower-level PMS tool <filename>dpkg</filename> forms the base of the Debian PMS. |
| 37 | For information on dpkg see |
| 38 | <ulink url='http://en.wikipedia.org/wiki/Dpkg'></ulink>.</para></listitem> |
| 39 | </itemizedlist> |
| 40 | </para> |
| 41 | </section> |
| 42 | |
| 43 | <section id='configuring-the-pms'> |
| 44 | <title>Configuring the PMS</title> |
| 45 | |
| 46 | <para> |
| 47 | Whichever PMS you are using, you need to be sure that the |
| 48 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink> |
| 49 | variable in the <filename>conf/local.conf</filename> |
| 50 | file is set to reflect that system. |
| 51 | The first value you choose for the variable specifies the package file format for the root |
| 52 | filesystem at sysroot. |
| 53 | Additional values specify additional formats for convenience or testing. |
| 54 | See the <filename>conf/local.conf</filename> configuration file for |
| 55 | details. |
| 56 | </para> |
| 57 | |
| 58 | <note> |
| 59 | For build performance information related to the PMS, see the |
| 60 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-package'><filename>package.bbclass</filename></ulink>" |
| 61 | section in the Yocto Project Reference Manual. |
| 62 | </note> |
| 63 | |
| 64 | <para> |
| 65 | As an example, consider a scenario where you are using OPKG and you want to add |
| 66 | the <filename>libglade</filename> package to the target sysroot. |
| 67 | </para> |
| 68 | |
| 69 | <para> |
| 70 | First, you should generate the IPK file for the |
| 71 | <filename>libglade</filename> package and add it |
| 72 | into a working <filename>opkg</filename> repository. |
| 73 | Use these commands: |
| 74 | <literallayout class='monospaced'> |
| 75 | $ bitbake libglade |
| 76 | $ bitbake package-index |
| 77 | </literallayout> |
| 78 | </para> |
| 79 | |
| 80 | <para> |
| 81 | Next, source the cross-toolchain environment setup script found in the |
| 82 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. |
| 83 | Follow that by setting up the installation destination to point to your |
| 84 | sysroot as <replaceable>sysroot_dir</replaceable>. |
| 85 | Finally, have an OPKG configuration file <replaceable>conf_file</replaceable> |
| 86 | that corresponds to the <filename>opkg</filename> repository you have just created. |
| 87 | The following command forms should now work: |
| 88 | <literallayout class='monospaced'> |
| 89 | $ opkg-cl –f <replaceable>conf_file</replaceable> -o <replaceable>sysroot_dir</replaceable> update |
| 90 | $ opkg-cl –f <replaceable>cconf_file</replaceable> -o <replaceable>sysroot_dir</replaceable> \ |
| 91 | --force-overwrite install libglade |
| 92 | $ opkg-cl –f <replaceable>cconf_file</replaceable> -o <replaceable>sysroot_dir</replaceable> \ |
| 93 | --force-overwrite install libglade-dbg |
| 94 | $ opkg-cl –f <replaceable>conf_file> -o </replaceable>sysroot_dir> \ |
| 95 | --force-overwrite install libglade-dev |
| 96 | </literallayout> |
| 97 | </para> |
| 98 | </section> |
| 99 | </chapter> |
| 100 | <!-- |
| 101 | vim: expandtab tw=80 ts=4 |
| 102 | --> |