diff options
author | Scott Rifenbark <scott.m.rifenbark@intel.com> | 2011-08-19 12:01:54 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-08-23 18:47:05 -0700 |
commit | 95ef8d7a2ea01aa18a19788f175e089e3126d3d4 (patch) | |
tree | 3619fc7c2c434a9352d803850e8758d9829cfaf1 /documentation/poky-ref-manual | |
parent | 32a860851c849edd44328d608376b3c27889a63e (diff) | |
download | poky-95ef8d7a2ea01aa18a19788f175e089e3126d3d4.tar.gz |
documentation/poky-ref-manual/ref-classes.xml: Scrubbed for Poky
I changed the "Poky" references to "the Yocto Project" and performed
general edits where necessary.
(From yocto-docs rev: a7ef3e7d5c792bde5231b9302e614cb7b5db81b7)
Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/poky-ref-manual')
-rw-r--r-- | documentation/poky-ref-manual/ref-classes.xml | 376 |
1 files changed, 191 insertions, 185 deletions
diff --git a/documentation/poky-ref-manual/ref-classes.xml b/documentation/poky-ref-manual/ref-classes.xml index 8eb94c268b..d054df1204 100644 --- a/documentation/poky-ref-manual/ref-classes.xml +++ b/documentation/poky-ref-manual/ref-classes.xml | |||
@@ -6,21 +6,21 @@ | |||
6 | 6 | ||
7 | <para> | 7 | <para> |
8 | Class files are used to abstract common functionality and share it amongst multiple | 8 | Class files are used to abstract common functionality and share it amongst multiple |
9 | <filename>.bb</filename> files. Any metadata usually found in a | 9 | <filename>.bb</filename> files. |
10 | <filename>.bb</filename> file can also be placed in a class | 10 | Any metadata usually found in a <filename>.bb</filename> file can also be placed in a class |
11 | file. Class files are identified by the extension | 11 | file. |
12 | <filename>.bbclass</filename> and are usually placed | 12 | Class files are identified by the extension <filename>.bbclass</filename> and are usually placed |
13 | in a <filename>classes/</filename> directory beneath the | 13 | in a <filename>classes/</filename> directory beneath the |
14 | <filename>meta*/</filename> directory or the directory pointed | 14 | <filename>meta*/</filename> directory found in the Yocto Project file's area |
15 | by BUILDDIR (e.g. <filename>build/</filename>)in the same way as | 15 | Class files can also be pointed to by BUILDDIR (e.g. <filename>build/</filename>)in the same way as |
16 | <filename>.conf</filename> files in the <filename | 16 | <filename>.conf</filename> files in the <filename>conf</filename> directory. |
17 | class="directory">conf</filename> directory. Class files are searched for | 17 | Class files are searched for in <filename>BBPATH</filename> |
18 | in BBPATH in the same was as <filename>.conf</filename> files too. | 18 | using the same method by which <filename>.conf</filename> files are searched. |
19 | </para> | 19 | </para> |
20 | 20 | ||
21 | <para> | 21 | <para> |
22 | In most cases inheriting the class is enough to enable its features, although | 22 | In most cases inheriting the class is enough to enable its features, although |
23 | for some classes you may need to set variables and/or override some of the | 23 | for some classes you might need to set variables or override some of the |
24 | default behaviour. | 24 | default behaviour. |
25 | </para> | 25 | </para> |
26 | 26 | ||
@@ -29,13 +29,14 @@ | |||
29 | 29 | ||
30 | <para> | 30 | <para> |
31 | The base class is special in that every <filename>.bb</filename> | 31 | The base class is special in that every <filename>.bb</filename> |
32 | file inherits it automatically. It contains definitions of standard basic | 32 | file inherits it automatically. |
33 | This class contains definitions for standard basic | ||
33 | tasks such as fetching, unpacking, configuring (empty by default), compiling | 34 | tasks such as fetching, unpacking, configuring (empty by default), compiling |
34 | (runs any Makefile present), installing (empty by default) and packaging | 35 | (runs any <filename>Makefile</filename> present), installing (empty by default) and packaging |
35 | (empty by default). These are often overridden or extended by other classes | 36 | (empty by default). |
36 | such as <filename>autotools.bbclass</filename> or | 37 | These classes are often overridden or extended by other classes |
37 | <filename>package.bbclass</filename>. The class also contains some commonly | 38 | such as <filename>autotools.bbclass</filename> or <filename>package.bbclass</filename>. |
38 | used functions such as <filename>oe_runmake</filename>. | 39 | The class also contains some commonly used functions such as <filename>oe_runmake</filename>. |
39 | </para> | 40 | </para> |
40 | </section> | 41 | </section> |
41 | 42 | ||
@@ -43,84 +44,71 @@ | |||
43 | <title>Autotooled Packages - <filename>autotools.bbclass</filename></title> | 44 | <title>Autotooled Packages - <filename>autotools.bbclass</filename></title> |
44 | 45 | ||
45 | <para> | 46 | <para> |
46 | Autotools (autoconf, automake, libtool) bring standardization. | 47 | Autotools (<filename>autoconf</filename>, <filename>automake</filename>, |
48 | and <filename>libtool</filename>) bring standardization. | ||
47 | This class defines a set of tasks (configure, compile etc.) that | 49 | This class defines a set of tasks (configure, compile etc.) that |
48 | work for all autotooled packages. | 50 | work for all Autotooled packages. |
49 | It should usually be enough to define a few standard variables as documented in the | 51 | It should usually be enough to define a few standard variables as documented in the |
50 | <link linkend='usingpoky-extend-addpkg-autotools'>simple autotools | 52 | <link linkend='usingpoky-extend-addpkg-autotools'>Autotooled Package</link> section |
51 | example</link> section and then simply "inherit autotools". | 53 | and then simply <filename>inherit autotools</filename>. |
52 | This class can also work with software that emulates autotools. | 54 | This class can also work with software that emulates Autotools. |
53 | </para> | 55 | </para> |
54 | 56 | ||
55 | <para> | 57 | <para> |
56 | It's useful to have some idea of how the tasks defined by this class work | 58 | It's useful to have some idea of how the tasks defined by this class work |
57 | and what they do behind the scenes. | 59 | and what they do behind the scenes. |
60 | <itemizedlist> | ||
61 | <listitem><para><filename>do_configure</filename> ‐ regenerates the | ||
62 | configure script (using <filename>autoreconf</filename>) and then launches it | ||
63 | with a standard set of arguments used during cross-compilation. | ||
64 | You can pass additional parameters to <filename>configure</filename> through the | ||
65 | <filename><link linkend='var-EXTRA_OECONF'>EXTRA_OECONF</link></filename> variable. | ||
66 | </para></listitem> | ||
67 | <listitem><para><filename>do_compile</filename> ‐ runs <filename>make</filename> with | ||
68 | arguments that specify the compiler and linker. | ||
69 | You can pass additional arguments through | ||
70 | the <filename><link linkend='var-EXTRA_OEMAKE'>EXTRA_OEMAKE</link></filename> variable. | ||
71 | </para></listitem> | ||
72 | <listitem><para><filename>do_install</filename> ‐ runs <filename>make install</filename> | ||
73 | and passes a DESTDIR option, which takes its value from the standard | ||
74 | <filename><link linkend='var-DESTDIR'>DESTDIR</link></filename> variable. | ||
75 | </para></listitem> | ||
76 | </itemizedlist> | ||
58 | </para> | 77 | </para> |
59 | |||
60 | <itemizedlist> | ||
61 | <listitem> | ||
62 | <para> | ||
63 | <filename>do_configure</filename> ‐ regenerates the configure script (using autoreconf) | ||
64 | and then launches it with a standard set of arguments used during | ||
65 | cross-compilation. | ||
66 | You can pass additional parameters to | ||
67 | <filename>configure</filename> through the | ||
68 | <glossterm><link linkend='var-EXTRA_OECONF'>EXTRA_OECONF</link></glossterm> variable. | ||
69 | </para> | ||
70 | </listitem> | ||
71 | <listitem> | ||
72 | <para> | ||
73 | <filename>do_compile</filename> ‐ runs <filename>make</filename> with | ||
74 | arguments that specify the compiler and linker. | ||
75 | You can pass additional arguments through | ||
76 | the <glossterm><link linkend='var-EXTRA_OEMAKE'>EXTRA_OEMAKE</link> | ||
77 | </glossterm> variable. | ||
78 | </para> | ||
79 | </listitem> | ||
80 | <listitem> | ||
81 | <para> | ||
82 | <filename>do_install</filename> ‐ runs <filename>make install</filename> | ||
83 | and passes a <filename>DESTDIR</filename> | ||
84 | option, which takes its value from the standard | ||
85 | <glossterm><link linkend='var-DESTDIR'>DESTDIR</link></glossterm> variable. | ||
86 | </para> | ||
87 | </listitem> | ||
88 | </itemizedlist> | ||
89 | |||
90 | </section> | 78 | </section> |
91 | 79 | ||
92 | <section id='ref-classes-update-alternatives'> | 80 | <section id='ref-classes-update-alternatives'> |
93 | <title>Alternatives - <filename>update-alternatives.bbclass</filename></title> | 81 | <title>Alternatives - <filename>update-alternatives.bbclass</filename></title> |
94 | 82 | ||
95 | <para> | 83 | <para> |
96 | Several programs can fulfill the same or similar function and | 84 | Several programs can fulfill the same or similar function and be installed with the same name. |
97 | be installed with the same name. | 85 | For example, the <filename>ar</filename> command is available from the |
98 | For example, the <filename>ar</filename> | 86 | <filename>busybox</filename>, <filename>binutils</filename> and |
99 | command is available from the "busybox", "binutils" and "elfutils" packages. | 87 | <filename>elfutils</filename> packages. |
100 | The <filename>update-alternatives.bbclass</filename> class handles renaming the | 88 | The <filename>update-alternatives.bbclass</filename> class handles renaming the |
101 | binaries so that multiple packages can be installed without conflicts. | 89 | binaries so that multiple packages can be installed without conflicts. |
102 | The <filename>ar</filename> command still works regardless of which packages are installed | 90 | The <filename>ar</filename> command still works regardless of which packages are installed |
103 | or subsequently removed. | 91 | or subsequently removed. |
104 | The class renames the conflicting binary in each package | 92 | The class renames the conflicting binary in each package and symlinks the highest |
105 | and symlinks the highest priority binary during installation or removal | 93 | priority binary during installation or removal of packages. |
106 | of packages. | ||
107 | </para> | 94 | </para> |
108 | <para> | 95 | <para> |
109 | Four variables control this class: | 96 | Four variables control this class: |
97 | <itemizedlist> | ||
98 | <listitem><para><filename>ALTERNATIVE_NAME</filename> ‐ The name of the | ||
99 | binary that is replaced (<filename>ar</filename> in this example).</para></listitem> | ||
100 | <listitem><para><filename>ALTERNATIVE_LINK</filename> ‐ The path to | ||
101 | the resulting binary (<filename>/bin/ar</filename> in this example).</para></listitem> | ||
102 | <listitem><para><filename>ALTERNATIVE_PATH</filename> ‐ The path to the | ||
103 | real binary (<filename>/usr/bin/ar.binutils</filename> in this example).</para></listitem> | ||
104 | <listitem><para><filename>ALTERNATIVE_PRIORITY</filename> ‐ The priority of | ||
105 | the binary. | ||
106 | The version with the most features should have the highest priority.</para></listitem> | ||
107 | </itemizedlist> | ||
110 | </para> | 108 | </para> |
111 | <itemizedlist> | 109 | |
112 | <listitem><para><filename>ALTERNATIVE_NAME</filename> ‐ The name of the | ||
113 | binary that is replaced (<filename>ar</filename> in this example).</para></listitem> | ||
114 | <listitem><para><filename>ALTERNATIVE_LINK</filename> ‐ The path to | ||
115 | the resulting binary (<filename>/bin/ar</filename> in this example).</para></listitem> | ||
116 | <listitem><para><filename>ALTERNATIVE_PATH</filename> ‐ The path to the | ||
117 | real binary (<filename>/usr/bin/ar.binutils</filename> in this example).</para></listitem> | ||
118 | <listitem><para><filename>ALTERNATIVE_PRIORITY</filename> ‐ The priority of | ||
119 | the binary. | ||
120 | The version with the most features should have the highest priority.</para></listitem> | ||
121 | </itemizedlist> | ||
122 | <para> | 110 | <para> |
123 | Currently, only one binary per package is supported. | 111 | Currently, the Yocto Project supports only one binary per package. |
124 | </para> | 112 | </para> |
125 | </section> | 113 | </section> |
126 | 114 | ||
@@ -128,14 +116,15 @@ | |||
128 | <title>Initscripts - <filename>update-rc.d.bbclass</filename></title> | 116 | <title>Initscripts - <filename>update-rc.d.bbclass</filename></title> |
129 | 117 | ||
130 | <para> | 118 | <para> |
131 | This class uses update-rc.d to safely install an initscript on behalf of | 119 | This class uses <filename>update-rc.d</filename> to safely install an |
132 | the package. Details such as making sure the initscript is stopped before | 120 | initialization script on behalf of the package. |
133 | a package is removed and started when the package is installed are taken | 121 | The Yocto Project takes care of details such as making sure the script is stopped before |
134 | care of. Three variables control this class, | 122 | a package is removed and started when the package is installed. |
135 | <link linkend='var-INITSCRIPT_PACKAGES'>INITSCRIPT_PACKAGES</link>, | 123 | Three variables control this class: |
136 | <link linkend='var-INITSCRIPT_NAME'>INITSCRIPT_NAME</link> and | 124 | <filename><link linkend='var-INITSCRIPT_PACKAGES'>INITSCRIPT_PACKAGES</link></filename>, |
137 | <link linkend='var-INITSCRIPT_PARAMS'>INITSCRIPT_PARAMS</link>. See the | 125 | <filename><link linkend='var-INITSCRIPT_NAME'>INITSCRIPT_NAME</link></filename> and |
138 | links for details. | 126 | <filename><link linkend='var-INITSCRIPT_PARAMS'>INITSCRIPT_PARAMS</link></filename>. |
127 | See the variable links for details. | ||
139 | </para> | 128 | </para> |
140 | </section> | 129 | </section> |
141 | 130 | ||
@@ -143,17 +132,17 @@ | |||
143 | <title>Binary config scripts - <filename>binconfig.bbclass</filename></title> | 132 | <title>Binary config scripts - <filename>binconfig.bbclass</filename></title> |
144 | 133 | ||
145 | <para> | 134 | <para> |
146 | Before pkg-config had become widespread, libraries shipped shell | 135 | Before <filename>pkg-config</filename> had become widespread, libraries shipped shell |
147 | scripts to give information about the libraries and include paths needed | 136 | scripts to give information about the libraries and include paths needed |
148 | to build software (usually named 'LIBNAME-config'). This class assists | 137 | to build software (usually named <filename>LIBNAME-config</filename>). |
149 | any recipe using such scripts. | 138 | This class assists any recipe using such scripts. |
150 | </para> | 139 | </para> |
151 | 140 | ||
152 | <para> | 141 | <para> |
153 | During staging Bitbake installs such scripts into the <filename | 142 | During staging, Bitbake installs such scripts into the |
154 | class="directory">sysroots/</filename> directory. It also changes all | 143 | <filename>sysroots/</filename> directory. |
155 | paths to point into the <filename>sysroots/</filename> | 144 | BitBake also changes all paths to point into the <filename>sysroots/</filename> |
156 | directory so all builds which use the script will use the correct | 145 | directory so all builds that use the script will use the correct |
157 | directories for the cross compiling layout. | 146 | directories for the cross compiling layout. |
158 | </para> | 147 | </para> |
159 | </section> | 148 | </section> |
@@ -163,8 +152,8 @@ | |||
163 | 152 | ||
164 | <para> | 153 | <para> |
165 | This class renames packages so that they follow the Debian naming | 154 | This class renames packages so that they follow the Debian naming |
166 | policy, i.e. 'glibc' becomes 'libc6' and 'glibc-devel' becomes | 155 | policy (i.e. <filename>glibc</filename> becomes <filename>libc6</filename> |
167 | 'libc6-dev'. | 156 | and <filename>glibc-devel</filename> becomes <filename>libc6-dev</filename>. |
168 | </para> | 157 | </para> |
169 | </section> | 158 | </section> |
170 | 159 | ||
@@ -172,15 +161,15 @@ | |||
172 | <title>Pkg-config - <filename>pkgconfig.bbclass</filename></title> | 161 | <title>Pkg-config - <filename>pkgconfig.bbclass</filename></title> |
173 | 162 | ||
174 | <para> | 163 | <para> |
175 | Pkg-config brought standardisation and this class aims to make its | 164 | <filename>pkg-config</filename> brought standardization and this class aims to make its |
176 | integration smooth for all libraries which make use of it. | 165 | integration smooth for all libraries that make use of it. |
177 | </para> | 166 | </para> |
178 | 167 | ||
179 | <para> | 168 | <para> |
180 | During staging Bitbake installs pkg-config data into the <filename | 169 | During staging, Bitbake installs <filename>pkg-config</filename> data into the |
181 | class="directory">sysroots/</filename> directory. By making use of | 170 | <filename>sysroots/</filename> directory. |
182 | sysroot functionality within pkgconfig this class no longer has to | 171 | By making use of sysroot functionality within <filename>pkg-config</filename>, |
183 | manipulate the files. | 172 | this class no longer has to manipulate the files. |
184 | </para> | 173 | </para> |
185 | </section> | 174 | </section> |
186 | 175 | ||
@@ -188,126 +177,131 @@ | |||
188 | <title>Distribution of sources - <filename>src_distribute_local.bbclass</filename></title> | 177 | <title>Distribution of sources - <filename>src_distribute_local.bbclass</filename></title> |
189 | 178 | ||
190 | <para> | 179 | <para> |
191 | Many software licenses require providing the sources for compiled | 180 | Many software licenses require that source files be provided along with the binaries. |
192 | binaries. To simplify this process two classes were created: | 181 | To simplify this process, two classes were created: |
193 | <filename>src_distribute.bbclass</filename> and | 182 | <filename>src_distribute.bbclass</filename> and |
194 | <filename>src_distribute_local.bbclass</filename>. | 183 | <filename>src_distribute_local.bbclass</filename>. |
195 | </para> | 184 | </para> |
196 | 185 | ||
197 | <para> | 186 | <para> |
198 | Result of their work are <filename>tmp/deploy/source/</filename> | 187 | The results of these classes are <filename>tmp/deploy/source/</filename> |
199 | subdirs with sources sorted by <glossterm><link linkend='var-LICENSE'>LICENSE</link> | 188 | subdirs with sources sorted by |
200 | </glossterm> field. If recipe lists few licenses (or has entries like "Bitstream Vera") source archive is put in each | 189 | <filename><link linkend='var-LICENSE'>LICENSE</link></filename> field. |
201 | license dir. | 190 | If recipes list few licenses (or have entries like "Bitstream Vera"), |
191 | the source archive is placed in each license directory. | ||
202 | </para> | 192 | </para> |
203 | 193 | ||
204 | <para> | 194 | <para> |
205 | Src_distribute_local class has three modes of operating: | 195 | This class operates using three modes: |
196 | <itemizedlist> | ||
197 | <listitem><para><emphasis>copy:</emphasis> Copies the files to the | ||
198 | distribute directory.</para></listitem> | ||
199 | <listitem><para><emphasis>symlink:</emphasis> Symlinks the files to the | ||
200 | distribute directory.</para></listitem> | ||
201 | <listitem><para><emphasis>move+symlink:</emphasis> Moves the files into | ||
202 | the distribute directory and then symlinks them back.</para></listitem> | ||
203 | </itemizedlist> | ||
206 | </para> | 204 | </para> |
207 | |||
208 | <itemizedlist> | ||
209 | <listitem><para>copy - copies the files to the distribute dir</para></listitem> | ||
210 | <listitem><para>symlink - symlinks the files to the distribute dir</para></listitem> | ||
211 | <listitem><para>move+symlink - moves the files into distribute dir, and symlinks them back</para></listitem> | ||
212 | </itemizedlist> | ||
213 | </section> | 205 | </section> |
214 | 206 | ||
215 | <section id='ref-classes-perl'> | 207 | <section id='ref-classes-perl'> |
216 | <title>Perl modules - <filename>cpan.bbclass</filename></title> | 208 | <title>Perl modules - <filename>cpan.bbclass</filename></title> |
217 | 209 | ||
218 | <para> | 210 | <para> |
219 | Recipes for Perl modules are simple - usually needs only | 211 | Recipes for Perl modules are simple. |
220 | pointing to source archive and inheriting of proper bbclass. | 212 | These recipes usually only need to point to the source's archive and then inherit the |
221 | Building is split into two methods dependly on method used by | 213 | proper <filename>.bbclass</filename> file. |
222 | module authors. | 214 | Building is split into two methods dependling on which method the module authors used. |
223 | </para> | 215 | </para> |
224 | 216 | ||
225 | <para> | 217 | <para> |
226 | Modules which use old Makefile.PL based build system require | 218 | Modules that use old <filename>Makefile.PL</filename>-based build system require |
227 | using of <filename>cpan.bbclass</filename> in their recipes. | 219 | <filename>cpan.bbclass</filename> in their recipes. |
228 | </para> | 220 | </para> |
229 | 221 | ||
230 | <para> | 222 | <para> |
231 | Modules which use Build.PL based build system require | 223 | Modules that use <filename>Build.PL</filename>-based build system require |
232 | using of <filename>cpan_build.bbclass</filename> in their recipes. | 224 | using <filename>cpan_build.bbclass</filename> in their recipes. |
233 | </para> | 225 | </para> |
234 | |||
235 | </section> | 226 | </section> |
236 | 227 | ||
237 | <section id='ref-classes-distutils'> | 228 | <section id='ref-classes-distutils'> |
238 | <title>Python extensions - <filename>distutils.bbclass</filename></title> | 229 | <title>Python extensions - <filename>distutils.bbclass</filename></title> |
239 | 230 | ||
240 | <para> | 231 | <para> |
241 | Recipes for Python extensions are simple - they usually only | 232 | Recipes for Python extensions are simple. |
242 | require pointing to the source archive and inheriting the proper | 233 | These recipes usually only need to point to the source's archive and then inherit |
243 | bbclasses. | 234 | the proper <filename>.bbclass</filename> file. |
244 | Building is split into two methods depending on the build method | 235 | Building is split into two methods dependling on which method the module authors used. |
245 | used by the module authors. | ||
246 | </para> | 236 | </para> |
247 | 237 | ||
248 | <para> | 238 | <para> |
249 | Extensions which use autotools based build system require use | 239 | Extensions that use an Autotools-based build system require Autotools and |
250 | of autotools and distutils-base bbclasses in their recipes. | 240 | <filename>distutils</filename>-based <filename>.bbclasse</filename> files in their recipes. |
251 | </para> | 241 | </para> |
252 | 242 | ||
253 | <para> | 243 | <para> |
254 | Extensions which use distutils build system require use | 244 | Extensions that use <filename>distutils</filename>-based build systems require |
255 | of <filename>distutils.bbclass</filename> in their recipes. | 245 | <filename>distutils.bbclass</filename> in their recipes. |
256 | </para> | 246 | </para> |
257 | |||
258 | </section> | 247 | </section> |
259 | 248 | ||
260 | <section id='ref-classes-devshell'> | 249 | <section id='ref-classes-devshell'> |
261 | <title>Developer Shell - <filename>devshell.bbclass</filename></title> | 250 | <title>Developer Shell - <filename>devshell.bbclass</filename></title> |
262 | 251 | ||
263 | <para> | 252 | <para> |
264 | This class adds the devshell task. Its usually up to distribution policy | 253 | This class adds the <filename>devshell</filename> task. |
265 | to include this class (Poky does). See the <link | 254 | Distribution policy dictates whether to include this class as the Yocto Project does. |
266 | linkend='platdev-appdev-devshell'>developing with 'devshell' section</link> | 255 | See the <link |
256 | linkend='platdev-appdev-devshell'>Development Within a Development Shell</link> section | ||
267 | for more information about using devshell. | 257 | for more information about using devshell. |
268 | </para> | 258 | </para> |
269 | |||
270 | </section> | 259 | </section> |
271 | 260 | ||
272 | <section id='ref-classes-package'> | 261 | <section id='ref-classes-package'> |
273 | <title>Packaging - <filename>package*.bbclass</filename></title> | 262 | <title>Packaging - <filename>package*.bbclass</filename></title> |
274 | 263 | ||
275 | <para> | 264 | <para> |
276 | The packaging classes add support for generating packages from a builds | 265 | The packaging classes add support for generating packages from a build's |
277 | output. The core generic functionality is in | 266 | output. |
278 | <filename>package.bbclass</filename>, code specific to particular package | 267 | The core generic functionality is in <filename>package.bbclass</filename>. |
279 | types is contained in various sub classes such as | 268 | The code specific |
280 | <filename>package_deb.bbclass</filename>, <filename>package_ipk.bbclass</filename> | 269 | to particular package types is contained in various sub-classes such as |
281 | and <filename>package_rpm.bbclass</filename>. Most users will | 270 | <filename>package_deb.bbclass</filename>, <filename>package_ipk.bbclass</filename>, |
282 | want one or more of these classes and this is controlled by the <glossterm> | 271 | and <filename>package_rpm.bbclass</filename>. |
283 | <link linkend='var-PACKAGE_CLASSES'>PACKAGE_CLASSES</link></glossterm> | 272 | Most users will want one or more of these classes. |
284 | variable. The first class listed in this variable will be used for image | 273 | You can control the list of resulting package formats by using the |
285 | generation. Since images are generated from packages a packaging class is | 274 | <filename><link linkend='var-PACKAGE_CLASSES'>PACKAGE_CLASSES</link></filename> |
275 | variable. | ||
276 | The first class listed in this variable is be used for image generation. | ||
277 | Since images are generated from packages, a packaging class is | ||
286 | needed to enable image generation. | 278 | needed to enable image generation. |
287 | </para> | 279 | </para> |
288 | |||
289 | </section> | 280 | </section> |
290 | 281 | ||
291 | <section id='ref-classes-kernel'> | 282 | <section id='ref-classes-kernel'> |
292 | <title>Building kernels - <filename>kernel.bbclass</filename></title> | 283 | <title>Building kernels - <filename>kernel.bbclass</filename></title> |
293 | 284 | ||
294 | <para> | 285 | <para> |
295 | This class handles building of Linux kernels and the class contains code to know how to build both 2.4 and 2.6 kernel trees. All needed headers are | 286 | This class handles building Linux kernels. |
296 | staged into <glossterm><link | 287 | The class contains code to build all kernel trees. |
297 | linkend='var-STAGING_KERNEL_DIR'>STAGING_KERNEL_DIR</link></glossterm> | 288 | All needed headers are staged into the |
298 | directory to allow building of out-of-tree modules using <filename>module.bbclass</filename>. | 289 | <filename><link linkend='var-STAGING_KERNEL_DIR'>STAGING_KERNEL_DIR</link></filename> |
290 | directory to allow out-of-tree module builds using <filename>module.bbclass</filename>. | ||
299 | </para> | 291 | </para> |
292 | |||
300 | <para> | 293 | <para> |
301 | This means that each kernel module built is packaged separately and inter-module dependencies are | 294 | This means that each built kernel module is packaged separately and inter-module |
302 | created by parsing the <filename>modinfo</filename> output. If all modules are | 295 | dependencies are created by parsing the <filename>modinfo</filename> output. |
303 | required then installing the "kernel-modules" package will install all | 296 | If all modules are required, then installing the <filename>kernel-modules</filename> |
304 | packages with modules and various other kernel packages such as "kernel-vmlinux". | 297 | package installs all packages with modules and various other kernel packages |
298 | such as <filename>kernel-vmlinux</filename>. | ||
305 | </para> | 299 | </para> |
306 | 300 | ||
307 | <para> | 301 | <para> |
308 | Various other classes are used by the kernel and module classes internally including | 302 | Various other classes are used by the kernel and module classes internally including |
309 | <filename>kernel-arch.bbclass</filename>, <filename>module_strip.bbclass</filename>, | 303 | <filename>kernel-arch.bbclass</filename>, <filename>module_strip.bbclass</filename>, |
310 | <filename>module-base.bbclass</filename> and <filename>linux-kernel-base.bbclass</filename>. | 304 | <filename>module-base.bbclass</filename>, and <filename>linux-kernel-base.bbclass</filename>. |
311 | </para> | 305 | </para> |
312 | </section> | 306 | </section> |
313 | 307 | ||
@@ -315,18 +309,20 @@ | |||
315 | <title>Creating images - <filename>image.bbclass</filename> and <filename>rootfs*.bbclass</filename></title> | 309 | <title>Creating images - <filename>image.bbclass</filename> and <filename>rootfs*.bbclass</filename></title> |
316 | 310 | ||
317 | <para> | 311 | <para> |
318 | Those classes add support for creating images in many formats. First the | 312 | These classes add support for creating images in several formats. |
319 | rootfs is created from packages by one of the <filename>rootfs_*.bbclass</filename> | 313 | First, the root filesystem is created from packages using |
320 | files (depending on package format used) and then image is created. | 314 | one of the <filename>rootfs_*.bbclass</filename> |
315 | files (depending on the package format used) and then the image is created. | ||
316 | </para> | ||
321 | 317 | ||
322 | The <glossterm><link | 318 | <para> |
323 | linkend='var-IMAGE_FSTYPES'>IMAGE_FSTYPES</link></glossterm> | 319 | The <filename><link linkend='var-IMAGE_FSTYPES'>IMAGE_FSTYPES</link></filename> |
324 | variable controls which types of image to generate. | 320 | variable controls the types of images to generate. |
325 | 321 | </para> | |
326 | The list of packages to install into the image is controlled by the | 322 | |
327 | <glossterm><link | 323 | <para> |
328 | linkend='var-IMAGE_INSTALL'>IMAGE_INSTALL</link></glossterm> | 324 | The <filename><link linkend='var-IMAGE_INSTALL'>IMAGE_INSTALL</link></filename> |
329 | variable. | 325 | variable controls the list of packages to install into the image. |
330 | </para> | 326 | </para> |
331 | </section> | 327 | </section> |
332 | 328 | ||
@@ -334,11 +330,12 @@ | |||
334 | <title>Host System sanity checks - <filename>sanity.bbclass</filename></title> | 330 | <title>Host System sanity checks - <filename>sanity.bbclass</filename></title> |
335 | 331 | ||
336 | <para> | 332 | <para> |
337 | This class checks prerequisite software is present to | 333 | This class checks to see if prerequisite software is present so that |
338 | notify the users of potential problems that will affect their build. It | 334 | users can be notified of potential problems that might affect their build. |
339 | also performs basic checks of the user configuration from local.conf to | 335 | The class also performs basic user configuration checks from |
340 | prevent common mistakes resulting in build failures. It's usually up to | 336 | the <filename>local.conf</filename> configuration file to |
341 | distribution policy whether to include this class (Poky does). | 337 | prevent common mistakes that cause build failures. |
338 | Distribution policy usually whether to include this class as the Yocto Project does. | ||
342 | </para> | 339 | </para> |
343 | </section> | 340 | </section> |
344 | 341 | ||
@@ -346,11 +343,11 @@ | |||
346 | <title>Generated output quality assurance checks - <filename>insane.bbclass</filename></title> | 343 | <title>Generated output quality assurance checks - <filename>insane.bbclass</filename></title> |
347 | 344 | ||
348 | <para> | 345 | <para> |
349 | This class adds a step to package generation which sanity checks the | 346 | This class adds a step to the package generation process that sanity checks the |
350 | packages generated by Poky. There are an ever increasing range of checks | 347 | packages generated by the Yocto Project. |
351 | it performs, checking for common problems which break builds/packages/images, | 348 | An ever-increasing range of checks are performed that check for |
352 | see the bbclass file for more information. It's usually up to distribution | 349 | common problems that break builds. |
353 | policy whether to include this class (Poky does). | 350 | Distribution policy usually dictates whether to include this class as the Yocto Project does. |
354 | </para> | 351 | </para> |
355 | </section> | 352 | </section> |
356 | 353 | ||
@@ -358,23 +355,28 @@ | |||
358 | <title>Autotools configuration data cache - <filename>siteinfo.bbclass</filename></title> | 355 | <title>Autotools configuration data cache - <filename>siteinfo.bbclass</filename></title> |
359 | 356 | ||
360 | <para> | 357 | <para> |
361 | Autotools can require tests which have to execute on the target hardware. | 358 | Autotools can require tests that must execute on the target hardware. |
362 | Since this isn't possible in general when cross compiling, siteinfo is | 359 | Since this is not possible in general when cross compiling, site information is |
363 | used to provide cached test results so these tests can be skipped over but | 360 | used to provide cached test results so these tests can be skipped over but |
364 | the correct values used. The <link linkend='structure-meta-site'>meta/site directory</link> | 361 | still make the correct values available. |
365 | contains test results sorted into different categories like architecture, endianess and | 362 | The <filename><link linkend='structure-meta-site'>meta/site directory</link></filename> |
366 | the libc used. Siteinfo provides a list of files containing data relevant to | 363 | contains test results sorted into different categories such as architecture, endianess, and |
367 | the current build in the <glossterm><link linkend='var-CONFIG_SITE'>CONFIG_SITE | 364 | the libc used. |
368 | </link></glossterm> variable which autotools will automatically pick up. | 365 | Site information provides a list of files containing data relevant to |
366 | the current build in the | ||
367 | <filename><link linkend='var-CONFIG_SITE'>CONFIG_SITE</link></filename> variable | ||
368 | that Autotools automatically picks up. | ||
369 | </para> | 369 | </para> |
370 | |||
370 | <para> | 371 | <para> |
371 | The class also provides variables like <glossterm><link | 372 | The class also provides variables like |
372 | linkend='var-SITEINFO_ENDIANESS'>SITEINFO_ENDIANESS</link></glossterm> | 373 | <filename><link linkend='var-SITEINFO_ENDIANESS'>SITEINFO_ENDIANESS</link></filename> |
373 | and <glossterm><link linkend='var-SITEINFO_BITS'>SITEINFO_BITS</link> | 374 | and <filename><link linkend='var-SITEINFO_BITS'>SITEINFO_BITS</link></filename> |
374 | </glossterm> which can be used elsewhere in the metadata. | 375 | that can be used elsewhere in the metadata. |
375 | </para> | 376 | </para> |
377 | |||
376 | <para> | 378 | <para> |
377 | This class is included from <filename>base.bbclass</filename> and is hence always active. | 379 | Because this class is included from <filename>base.bbclass</filename>, it is always active. |
378 | </para> | 380 | </para> |
379 | </section> | 381 | </section> |
380 | 382 | ||
@@ -382,8 +384,12 @@ | |||
382 | <title>Other Classes</title> | 384 | <title>Other Classes</title> |
383 | 385 | ||
384 | <para> | 386 | <para> |
385 | Only the most useful/important classes are covered here but there are | 387 | Thus far, this appendix has discussed only the most useful and important |
386 | others, see the <filename>meta/classes</filename> directory for the rest. | 388 | classes. |
389 | However, other classes exist within the <filename>meta/classes</filename> directory | ||
390 | in the Yocto Project file's directory structure. | ||
391 | You can examine the <filename>.bbclass</filename> files directly for more | ||
392 | information. | ||
387 | </para> | 393 | </para> |
388 | </section> | 394 | </section> |
389 | 395 | ||