adt-package.xml 4.8 KB

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