Andrew Geissler | f034379 | 2020-11-18 10:42:21 -0600 | [diff] [blame^] | 1 | .. SPDX-License-Identifier: CC-BY-SA-2.0-UK |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2 | |
| 3 | ************************************************************ |
| 4 | Optionally Customizing the Development Packages Installation |
| 5 | ************************************************************ |
| 6 | |
| 7 | Because the Yocto Project is suited for embedded Linux development, it |
| 8 | is likely that you will need to customize your development packages |
| 9 | installation. For example, if you are developing a minimal image, then |
| 10 | you might not need certain packages (e.g. graphics support packages). |
| 11 | Thus, you would like to be able to remove those packages from your |
| 12 | target sysroot. |
| 13 | |
| 14 | Package Management Systems |
| 15 | ========================== |
| 16 | |
| 17 | The OpenEmbedded build system supports the generation of sysroot files |
| 18 | using three different Package Management Systems (PMS): |
| 19 | |
| 20 | - *OPKG:* A less well known PMS whose use originated in the |
| 21 | OpenEmbedded and OpenWrt embedded Linux projects. This PMS works with |
| 22 | files packaged in an ``.ipk`` format. See |
| 23 | http://en.wikipedia.org/wiki/Opkg for more information about |
| 24 | OPKG. |
| 25 | |
| 26 | - *RPM:* A more widely known PMS intended for GNU/Linux distributions. |
| 27 | This PMS works with files packaged in an ``.rpm`` format. The build |
| 28 | system currently installs through this PMS by default. See |
| 29 | http://en.wikipedia.org/wiki/RPM_Package_Manager for more |
| 30 | information about RPM. |
| 31 | |
| 32 | - *Debian:* The PMS for Debian-based systems is built on many PMS |
| 33 | tools. The lower-level PMS tool ``dpkg`` forms the base of the Debian |
| 34 | PMS. For information on dpkg see |
| 35 | http://en.wikipedia.org/wiki/Dpkg. |
| 36 | |
| 37 | Configuring the PMS |
| 38 | =================== |
| 39 | |
| 40 | Whichever PMS you are using, you need to be sure that the |
| 41 | :term:`PACKAGE_CLASSES` |
| 42 | variable in the ``conf/local.conf`` file is set to reflect that system. |
| 43 | The first value you choose for the variable specifies the package file |
| 44 | format for the root filesystem at sysroot. Additional values specify |
| 45 | additional formats for convenience or testing. See the |
| 46 | ``conf/local.conf`` configuration file for details. |
| 47 | |
| 48 | .. note:: |
| 49 | |
| 50 | For build performance information related to the PMS, see the " |
| 51 | package.bbclass |
| 52 | " section in the Yocto Project Reference Manual. |
| 53 | |
| 54 | As an example, consider a scenario where you are using OPKG and you want |
| 55 | to add the ``libglade`` package to the target sysroot. |
| 56 | |
| 57 | First, you should generate the IPK file for the ``libglade`` package and |
| 58 | add it into a working ``opkg`` repository. Use these commands: $ bitbake |
| 59 | libglade $ bitbake package-index |
| 60 | |
| 61 | Next, source the cross-toolchain environment setup script found in the |
| 62 | :term:`Source Directory`. Follow |
| 63 | that by setting up the installation destination to point to your sysroot |
| 64 | as sysroot_dir. Finally, have an OPKG configuration file conf_file that |
| 65 | corresponds to the ``opkg`` repository you have just created. The |
| 66 | following command forms should now work: $ opkg-cl –f conf_file -o |
| 67 | sysroot_dir update $ opkg-cl –f cconf_file -o sysroot_dir \\ |
| 68 | --force-overwrite install libglade $ opkg-cl –f cconf_file -o |
| 69 | sysroot_dir \\ --force-overwrite install libglade-dbg $ opkg-cl –f |
| 70 | conf_file> -osysroot_dir> \\ --force-overwrite install libglade-dev |