adt-package.rst 3.0 KB

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