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