diff options
Diffstat (limited to 'documentation')
239 files changed, 63315 insertions, 0 deletions
diff --git a/documentation/Makefile b/documentation/Makefile new file mode 100644 index 0000000..3bc9a21 --- /dev/null +++ b/documentation/Makefile | |||
@@ -0,0 +1,395 @@ | |||
1 | # This is a single Makefile to handle all generated Yocto Project documents. | ||
2 | # The Makefile needs to live in the documents directory and all figures used | ||
3 | # in any manuals must be .PNG files and live in the individual book's figures | ||
4 | # directory as well as in the figures directory for the mega-manual. | ||
5 | # Note that the figures for the Yocto Project Development Manual | ||
6 | # differ depending on the BRANCH being built. | ||
7 | # | ||
8 | # The Makefile has these targets: | ||
9 | # | ||
10 | # pdf: generates a PDF version of a manual. Not valid for the Quick Start | ||
11 | # or the mega-manual (single, large HTML file comprised of all | ||
12 | # Yocto Project manuals). | ||
13 | # html: generates an HTML version of a manual. | ||
14 | # eclipse: generates an HTML version of a manual that can be used as | ||
15 | # eclipse help (including necessary metadata files). | ||
16 | # tarball: creates a tarball for the doc files. | ||
17 | # validate: validates | ||
18 | # publish: pushes generated files to the Yocto Project website | ||
19 | # clean: removes files | ||
20 | # | ||
21 | # The Makefile generates an HTML and PDF version of every document except the | ||
22 | # Yocto Project Quick Start and the single, HTML mega-manual, which is comprised | ||
23 | # of all the individual Yocto Project manuals. These two manuals are in HTML | ||
24 | # form only. The variable DOC indicates the folder name for a given manual. The | ||
25 | # variable VER represents the distro version of the Yocto Release for which the | ||
26 | # manuals are being generated. The variable BRANCH is used to indicate the | ||
27 | # branch (edison or denzil) and is used only when DOC=dev-manual or | ||
28 | # DOC=mega-manual. If you do not specify a BRANCH, the default branch used | ||
29 | # will be for the latest Yocto Project release. If you build for either | ||
30 | # edison or denzil, you must use BRANCH. You do not need to use BRANCH for | ||
31 | # any release beyond denzil. | ||
32 | # | ||
33 | # To build a manual, you must invoke Makefile with the DOC argument. If you | ||
34 | # are going to publish the manual, then you must invoke Makefile with both the | ||
35 | # DOC and the VER argument. Furthermore, if you are building or publishing | ||
36 | # the edison or denzil versions of the Yocto Poject Development Manual or | ||
37 | # the mega-manual, you must also use the BRANCH argument. | ||
38 | # | ||
39 | # Examples: | ||
40 | # | ||
41 | # make DOC=bsp-guide | ||
42 | # make DOC=yocto-project-qs | ||
43 | # make pdf DOC=ref-manual | ||
44 | # make DOC=dev-manual BRANCH=edison | ||
45 | # make DOC=mega-manual BRANCH=denzil | ||
46 | # | ||
47 | # The first example generates the HTML and PDF versions of the BSP Guide. | ||
48 | # The second example generates the HTML version only of the Quick Start. Note that | ||
49 | # the Quick Start only has an HTML version available. The third example generates | ||
50 | # both the PDF and HTML versions of the Yocto Project Reference Manual. The | ||
51 | # fourth example generates both the PDF and HTML 'edison' versions of the YP | ||
52 | # Development Manual. The last exmample generates the HTML version of the | ||
53 | # mega-manual and uses the 'denzil' branch when choosing figures for the | ||
54 | # tarball of figures. Any example that does not use the BRANCH argument | ||
55 | # builds the current version of the manual set. | ||
56 | # | ||
57 | # Use the publish target to push the generated manuals to the Yocto Project | ||
58 | # website. All files needed for the manual's HTML form are pushed as well as the | ||
59 | # PDF version (if applicable). | ||
60 | # Examples: | ||
61 | # | ||
62 | # make publish DOC=bsp-guide VER=1.3 | ||
63 | # make publish DOC=adt-manual VER=1.3 | ||
64 | # make publish DOC=dev-manual VER=1.1.1 BRANCH=edison | ||
65 | # make publish DOC=dev-manual VER=1.2 BRANCH=denzil | ||
66 | # | ||
67 | # The first example publishes the 1.3 version of both the PDF and HTML versions of | ||
68 | # the BSP Guide. The second example publishes the 1.3 version of both the PDF and | ||
69 | # HTML versions of the ADT Manual. The third example publishes the PDF and HTML | ||
70 | # 'edison' versions of the YP Development Manual. The fourth example publishes | ||
71 | # the PDF and HTML 'denzil' versions of the YP Development Manual. | ||
72 | # | ||
73 | |||
74 | ifeq ($(DOC),bsp-guide) | ||
75 | XSLTOPTS = --xinclude | ||
76 | ALLPREQ = html pdf eclipse tarball | ||
77 | TARFILES = bsp-style.css bsp-guide.html bsp-guide.pdf figures/bsp-title.png \ | ||
78 | eclipse | ||
79 | MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf $(DOC)/eclipse | ||
80 | FIGURES = figures | ||
81 | STYLESHEET = $(DOC)/*.css | ||
82 | |||
83 | endif | ||
84 | |||
85 | ifeq ($(DOC),dev-manual) | ||
86 | XSLTOPTS = --xinclude | ||
87 | ALLPREQ = html pdf eclipse tarball | ||
88 | # | ||
89 | # Note that the tarfile might produce the "Cannot stat: No such file or directory" error | ||
90 | # message for .PNG files that are not present when building a particular branch. The | ||
91 | # list of files is all-inclusive for all branches. Note, if you don't provide a BRANCH | ||
92 | # option, it defaults to the latest stuff. This would be appropriate for "master" branch. | ||
93 | # | ||
94 | |||
95 | ifeq ($(BRANCH),edison) | ||
96 | TARFILES = dev-style.css dev-manual.html dev-manual.pdf \ | ||
97 | figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \ | ||
98 | figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \ | ||
99 | figures/kernel-example-repos-edison.png \ | ||
100 | figures/kernel-overview-1.png figures/kernel-overview-2.png \ | ||
101 | figures/kernel-overview-3-edison.png \ | ||
102 | figures/source-repos.png figures/yp-download.png \ | ||
103 | figures/wip.png | ||
104 | else ifeq ($(BRANCH),denzil) | ||
105 | TARFILES = dev-style.css dev-manual.html dev-manual.pdf \ | ||
106 | figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \ | ||
107 | figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \ | ||
108 | figures/kernel-example-repos-denzil.png \ | ||
109 | figures/kernel-overview-1.png figures/kernel-overview-2.png \ | ||
110 | figures/kernel-overview-3-denzil.png \ | ||
111 | figures/source-repos.png figures/yp-download.png \ | ||
112 | figures/wip.png | ||
113 | else | ||
114 | TARFILES = dev-style.css dev-manual.html dev-manual.pdf \ | ||
115 | figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \ | ||
116 | figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \ | ||
117 | figures/kernel-overview-1.png figures/kernel-overview-2-generic.png \ | ||
118 | figures/source-repos.png figures/yp-download.png figures/recipe-workflow.png \ | ||
119 | eclipse | ||
120 | endif | ||
121 | |||
122 | MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf $(DOC)/eclipse | ||
123 | FIGURES = figures | ||
124 | STYLESHEET = $(DOC)/*.css | ||
125 | |||
126 | endif | ||
127 | |||
128 | ifeq ($(DOC),yocto-project-qs) | ||
129 | XSLTOPTS = --xinclude | ||
130 | ALLPREQ = html eclipse tarball | ||
131 | TARFILES = yocto-project-qs.html qs-style.css figures/yocto-environment.png \ | ||
132 | figures/building-an-image.png figures/using-a-pre-built-image.png \ | ||
133 | figures/yocto-project-transp.png \ | ||
134 | eclipse | ||
135 | MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse | ||
136 | FIGURES = figures | ||
137 | STYLESHEET = $(DOC)/*.css | ||
138 | endif | ||
139 | |||
140 | ifeq ($(DOC),mega-manual) | ||
141 | XSLTOPTS = --stringparam html.stylesheet mega-style.css \ | ||
142 | --stringparam chapter.autolabel 1 \ | ||
143 | --stringparam section.autolabel 1 \ | ||
144 | --stringparam section.label.includes.component.label 1 \ | ||
145 | --xinclude | ||
146 | ALLPREQ = html tarball | ||
147 | |||
148 | ifeq ($(BRANCH),edison) | ||
149 | TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png figures/building-an-image.png \ | ||
150 | figures/using-a-pre-built-image.png \ | ||
151 | figures/poky-title.png \ | ||
152 | figures/adt-title.png figures/bsp-title.png \ | ||
153 | figures/kernel-title.png figures/kernel-architecture-overview.png \ | ||
154 | figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \ | ||
155 | figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \ | ||
156 | figures/kernel-example-repos-edison.png \ | ||
157 | figures/kernel-overview-1.png figures/kernel-overview-2.png \ | ||
158 | figures/kernel-overview-3-edison.png \ | ||
159 | figures/source-repos.png figures/yp-download.png \ | ||
160 | figures/wip.png | ||
161 | else ifeq ($(BRANCH),denzil) | ||
162 | TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png figures/building-an-image.png \ | ||
163 | figures/using-a-pre-built-image.png \ | ||
164 | figures/poky-title.png \ | ||
165 | figures/adt-title.png figures/bsp-title.png \ | ||
166 | figures/kernel-title.png figures/kernel-architecture-overview.png \ | ||
167 | figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \ | ||
168 | figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \ | ||
169 | figures/kernel-example-repos-denzil.png \ | ||
170 | figures/kernel-overview-1.png figures/kernel-overview-2.png \ | ||
171 | figures/kernel-overview-3-denzil.png \ | ||
172 | figures/source-repos.png figures/yp-download.png \ | ||
173 | figures/wip.png | ||
174 | else | ||
175 | TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png figures/building-an-image.png \ | ||
176 | figures/using-a-pre-built-image.png \ | ||
177 | figures/poky-title.png figures/buildhistory.png figures/buildhistory-web.png \ | ||
178 | figures/adt-title.png figures/bsp-title.png \ | ||
179 | figures/kernel-dev-title.png figures/kernel-architecture-overview.png \ | ||
180 | figures/app-dev-flow.png figures/bsp-dev-flow.png figures/dev-title.png \ | ||
181 | figures/git-workflow.png figures/index-downloads.png figures/kernel-dev-flow.png \ | ||
182 | figures/kernel-overview-1.png figures/kernel-overview-2-generic.png \ | ||
183 | figures/source-repos.png figures/yp-download.png \ | ||
184 | figures/profile-title.png figures/kernelshark-all.png \ | ||
185 | figures/kernelshark-choose-events.png figures/kernelshark-i915-display.png \ | ||
186 | figures/kernelshark-output-display.png figures/lttngmain0.png \ | ||
187 | figures/oprofileui-busybox.png figures/oprofileui-copy-to-user.png \ | ||
188 | figures/oprofileui-downloading.png figures/oprofileui-processes.png \ | ||
189 | figures/perf-probe-do_fork-profile.png figures/perf-report-cycles-u.png \ | ||
190 | figures/perf-systemwide.png figures/perf-systemwide-libc.png \ | ||
191 | figures/perf-wget-busybox-annotate-menu.png figures/perf-wget-busybox-annotate-udhcpc.png \ | ||
192 | figures/perf-wget-busybox-debuginfo.png figures/perf-wget-busybox-dso-zoom.png \ | ||
193 | figures/perf-wget-busybox-dso-zoom-menu.png figures/perf-wget-busybox-expanded-stripped.png \ | ||
194 | figures/perf-wget-flat-stripped.png figures/perf-wget-g-copy-from-user-expanded-stripped.png \ | ||
195 | figures/perf-wget-g-copy-to-user-expanded-debuginfo.png figures/perf-wget-g-copy-to-user-expanded-stripped.png \ | ||
196 | figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png figures/pybootchartgui-linux-yocto.png \ | ||
197 | figures/pychart-linux-yocto-rpm.png figures/pychart-linux-yocto-rpm-nostrip.png \ | ||
198 | figures/sched-wakeup-profile.png figures/sysprof-callers.png \ | ||
199 | figures/sysprof-copy-from-user.png figures/sysprof-copy-to-user.png figures/cross-development-toolchains.png \ | ||
200 | figures/yocto-environment-ref.png figures/user-configuration.png figures/source-input.png \ | ||
201 | figures/package-feeds.png figures/layer-input.png figures/images.png figures/sdk.png \ | ||
202 | figures/source-fetching.png figures/patching.png figures/configuration-compile-autoreconf.png \ | ||
203 | figures/analysis-for-package-splitting.png figures/image-generation.png \ | ||
204 | figures/sdk-generation.png figures/recipe-workflow.png | ||
205 | endif | ||
206 | |||
207 | MANUALS = $(DOC)/$(DOC).html | ||
208 | FIGURES = figures | ||
209 | STYLESHEET = $(DOC)/*.css | ||
210 | |||
211 | endif | ||
212 | |||
213 | ifeq ($(DOC),ref-manual) | ||
214 | XSLTOPTS = --xinclude | ||
215 | ALLPREQ = html pdf eclipse tarball | ||
216 | TARFILES = ref-manual.html ref-style.css figures/poky-title.png \ | ||
217 | figures/buildhistory.png figures/buildhistory-web.png eclipse \ | ||
218 | figures/cross-development-toolchains.png figures/layer-input.png \ | ||
219 | figures/package-feeds.png figures/source-input.png \ | ||
220 | figures/user-configuration.png figures/yocto-environment-ref.png \ | ||
221 | figures/images.png figures/sdk.png figures/source-fetching.png \ | ||
222 | figures/patching.png figures/configuration-compile-autoreconf.png \ | ||
223 | figures/analysis-for-package-splitting.png figures/image-generation.png \ | ||
224 | figures/sdk-generation.png | ||
225 | MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf $(DOC)/eclipse | ||
226 | FIGURES = figures | ||
227 | STYLESHEET = $(DOC)/*.css | ||
228 | endif | ||
229 | |||
230 | |||
231 | ifeq ($(DOC),adt-manual) | ||
232 | XSLTOPTS = --xinclude | ||
233 | ALLPREQ = html pdf eclipse tarball | ||
234 | TARFILES = adt-manual.html adt-manual.pdf adt-style.css figures/adt-title.png \ | ||
235 | eclipse | ||
236 | MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf $(DOC)/eclipse | ||
237 | FIGURES = figures | ||
238 | STYLESHEET = $(DOC)/*.css | ||
239 | endif | ||
240 | |||
241 | ifeq ($(DOC),profile-manual) | ||
242 | XSLTOPTS = --xinclude | ||
243 | ALLPREQ = html pdf eclipse tarball | ||
244 | TARFILES = profile-manual.html profile-manual.pdf profile-manual-style.css \ | ||
245 | figures/profile-title.png figures/kernelshark-all.png \ | ||
246 | figures/kernelshark-choose-events.png figures/kernelshark-i915-display.png \ | ||
247 | figures/kernelshark-output-display.png figures/lttngmain0.png \ | ||
248 | figures/oprofileui-busybox.png figures/oprofileui-copy-to-user.png \ | ||
249 | figures/oprofileui-downloading.png figures/oprofileui-processes.png \ | ||
250 | figures/perf-probe-do_fork-profile.png figures/perf-report-cycles-u.png \ | ||
251 | figures/perf-systemwide.png figures/perf-systemwide-libc.png \ | ||
252 | figures/perf-wget-busybox-annotate-menu.png figures/perf-wget-busybox-annotate-udhcpc.png \ | ||
253 | figures/perf-wget-busybox-debuginfo.png figures/perf-wget-busybox-dso-zoom.png \ | ||
254 | figures/perf-wget-busybox-dso-zoom-menu.png figures/perf-wget-busybox-expanded-stripped.png \ | ||
255 | figures/perf-wget-flat-stripped.png figures/perf-wget-g-copy-from-user-expanded-stripped.png \ | ||
256 | figures/perf-wget-g-copy-to-user-expanded-debuginfo.png figures/perf-wget-g-copy-to-user-expanded-stripped.png \ | ||
257 | figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png figures/pybootchartgui-linux-yocto.png \ | ||
258 | figures/pychart-linux-yocto-rpm.png figures/pychart-linux-yocto-rpm-nostrip.png \ | ||
259 | figures/sched-wakeup-profile.png figures/sysprof-callers.png \ | ||
260 | figures/sysprof-copy-from-user.png figures/sysprof-copy-to-user.png \ | ||
261 | eclipse | ||
262 | MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf $(DOC)/eclipse | ||
263 | FIGURES = figures | ||
264 | STYLESHEET = $(DOC)/*.css | ||
265 | endif | ||
266 | |||
267 | ifeq ($(DOC),kernel-dev) | ||
268 | XSLTOPTS = --xinclude | ||
269 | ALLPREQ = html pdf eclipse tarball | ||
270 | TARFILES = kernel-dev.html kernel-dev.pdf kernel-dev-style.css figures/kernel-dev-title.png \ | ||
271 | figures/kernel-architecture-overview.png \ | ||
272 | eclipse | ||
273 | MANUALS = $(DOC)/$(DOC).html $(DOC)/$(DOC).pdf $(DOC)/eclipse | ||
274 | FIGURES = figures | ||
275 | STYLESHEET = $(DOC)/*.css | ||
276 | endif | ||
277 | |||
278 | |||
279 | ## | ||
280 | # These URI should be rewritten by your distribution's xml catalog to | ||
281 | # match your localy installed XSL stylesheets. | ||
282 | XSL_BASE_URI = http://docbook.sourceforge.net/release/xsl/current | ||
283 | XSL_XHTML_URI = $(XSL_BASE_URI)/xhtml/docbook.xsl | ||
284 | |||
285 | all: $(ALLPREQ) | ||
286 | |||
287 | pdf: | ||
288 | ifeq ($(DOC),yocto-project-qs) | ||
289 | @echo " " | ||
290 | @echo "ERROR: You cannot generate a yocto-project-qs PDF file." | ||
291 | @echo " " | ||
292 | |||
293 | else ifeq ($(DOC),mega-manual) | ||
294 | @echo " " | ||
295 | @echo "ERROR: You cannot generate a mega-manual PDF file." | ||
296 | @echo " " | ||
297 | |||
298 | else | ||
299 | |||
300 | cd $(DOC); ../tools/poky-docbook-to-pdf $(DOC).xml ../template; cd .. | ||
301 | endif | ||
302 | |||
303 | html: | ||
304 | ifeq ($(DOC),mega-manual) | ||
305 | # See http://www.sagehill.net/docbookxsl/HtmlOutput.html | ||
306 | @echo " " | ||
307 | @echo "******** Building "$(DOC) | ||
308 | @echo " " | ||
309 | cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd .. | ||
310 | @echo " " | ||
311 | @echo "******** Using mega-manual.sed to process external links" | ||
312 | @echo " " | ||
313 | cd $(DOC); sed -f ../tools/mega-manual.sed < mega-manual.html > mega-output.html; cd .. | ||
314 | @echo " " | ||
315 | @echo "******** Cleaning up transient file mega-output.html" | ||
316 | @echo " " | ||
317 | cd $(DOC); rm mega-manual.html; mv mega-output.html mega-manual.html; cd .. | ||
318 | else | ||
319 | # See http://www.sagehill.net/docbookxsl/HtmlOutput.html | ||
320 | @echo " " | ||
321 | @echo "******** Building "$(DOC) | ||
322 | @echo " " | ||
323 | cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd .. | ||
324 | endif | ||
325 | |||
326 | |||
327 | eclipse: BASE_DIR = html/$(DOC)/ | ||
328 | |||
329 | eclipse: eclipse-generate eclipse-resolve-links | ||
330 | |||
331 | .PHONY : eclipse-generate eclipse-resolve-links | ||
332 | |||
333 | eclipse-generate: | ||
334 | ifeq ($(filter $(DOC), adt-manual bsp-guide dev-manual kernel-dev profile-manual ref-manual yocto-project-qs),) | ||
335 | @echo " " | ||
336 | @echo "ERROR: You can only create eclipse documentation" | ||
337 | @echo " of the following documentation parts:" | ||
338 | @echo " - adt-manual" | ||
339 | @echo " - bsp-guide" | ||
340 | @echo " - dev-manual" | ||
341 | @echo " - kernel-dev" | ||
342 | @echo " - profile-manual" | ||
343 | @echo " - ref-manual" | ||
344 | @echo " - yocto-project-qs" | ||
345 | @echo " " | ||
346 | else | ||
347 | @echo " " | ||
348 | @echo "******** Building eclipse help of "$(DOC) | ||
349 | @echo " " | ||
350 | cd $(DOC) && \ | ||
351 | xsltproc $(XSLTOPTS) \ | ||
352 | --stringparam base.dir '$(BASE_DIR)' \ | ||
353 | -o eclipse/$(DOC).html \ | ||
354 | $(DOC)-eclipse-customization.xsl $(DOC).xml && \ | ||
355 | mv eclipse/toc.xml eclipse/$(DOC)-toc.xml && \ | ||
356 | cp -rf $(FIGURES) eclipse/$(BASE_DIR) && \ | ||
357 | cd ..; | ||
358 | |||
359 | $(call modify-eclipse) | ||
360 | endif | ||
361 | |||
362 | eclipse-resolve-links: | ||
363 | @echo " " | ||
364 | @echo "******** Using eclipse-help.sed to process external links" | ||
365 | @echo " " | ||
366 | $(foreach FILE, \ | ||
367 | $(wildcard $(DOC)/eclipse/html/$(DOC)/*.html), \ | ||
368 | $(shell sed -i -f tools/eclipse-help.sed $(FILE))) | ||
369 | |||
370 | tarball: html | ||
371 | @echo " " | ||
372 | @echo "******** Creating Tarball of document files" | ||
373 | @echo " " | ||
374 | cd $(DOC); tar -cvzf $(DOC).tgz $(TARFILES); cd .. | ||
375 | |||
376 | validate: | ||
377 | cd $(DOC); xmllint --postvalid --xinclude --noout $(DOC).xml; cd .. | ||
378 | |||
379 | |||
380 | publish: | ||
381 | @if test -f $(DOC)/$(DOC).html; \ | ||
382 | then \ | ||
383 | echo " "; \ | ||
384 | echo "******** Publishing "$(DOC)".html"; \ | ||
385 | echo " "; \ | ||
386 | scp -r $(MANUALS) $(STYLESHEET) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \ | ||
387 | cd $(DOC); scp -r $(FIGURES) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \ | ||
388 | else \ | ||
389 | echo " "; \ | ||
390 | echo $(DOC)".html missing. Generate the file first then try again."; \ | ||
391 | echo " "; \ | ||
392 | fi | ||
393 | |||
394 | clean: | ||
395 | rm -rf $(MANUALS); rm $(DOC)/$(DOC).tgz; | ||
diff --git a/documentation/README b/documentation/README new file mode 100644 index 0000000..d01678d --- /dev/null +++ b/documentation/README | |||
@@ -0,0 +1,91 @@ | |||
1 | documentation | ||
2 | ============= | ||
3 | |||
4 | This is the directory that contains the Yocto Project documentation. The Yocto | ||
5 | Project source repositories at http://git.yoctoproject.org/cgit.cgi have two | ||
6 | instances of the "documentation" directory. You should understand each of | ||
7 | these instances. | ||
8 | |||
9 | poky/documentation - The directory within the poky Git repository containing | ||
10 | the set of Yocto Project manuals. When you clone the | ||
11 | poky Git repository, the documentation directory | ||
12 | contains the manuals. The state of the manuals in this | ||
13 | directory is guaranteed to reflect the latest Yocto | ||
14 | Project release. The manuals at the tip of this | ||
15 | directory will also likely contain most manual | ||
16 | development changes. | ||
17 | |||
18 | yocto-docs/documentation - The Git repository for the Yocto Project manuals. | ||
19 | This repository is where manual development | ||
20 | occurs. If you plan on contributing back to the | ||
21 | Yocto Project documentation, you should set up | ||
22 | a local Git repository based on this upstream | ||
23 | repository as follows: | ||
24 | |||
25 | git clone git://git.yoctoproject.org/yocto-docs | ||
26 | |||
27 | Changes and patches are first pushed to the | ||
28 | yocto-docs Git repository. Later, they make it | ||
29 | into the poky Git repository found at | ||
30 | git://git.yoctoproject.org/poky. | ||
31 | |||
32 | Manual Organization | ||
33 | =================== | ||
34 | |||
35 | Folders exist for individual manuals as follows: | ||
36 | |||
37 | * adt-manual - The Yocto Project Application Developer's Guide. | ||
38 | * bsp-guide - The Yocto Project Board Support Package (BSP) Developer's Guide | ||
39 | * dev-manual - The Yocto Project Development Manual | ||
40 | * kernel-dev - The Yocto Project Linux Kernel Development Manual | ||
41 | * ref-manual - The Yocto Project Reference Manual | ||
42 | * yocto-project-qs - The Yocto Project Quick Start | ||
43 | * mega-manual - An aggregated manual comprised of all YP manuals and guides | ||
44 | * profile-manual - The Yocto Project Profile and Tracing Manual | ||
45 | |||
46 | Each folder is self-contained regarding content and figures. Note that there | ||
47 | is a sed file needed to process the links of the mega-manual. The sed file | ||
48 | is located in the tools directory. Also note that the figures folder in the | ||
49 | mega-manual directory contains duplicates of all the figures in the YP folders | ||
50 | directories for all YP manuals and guides. | ||
51 | |||
52 | If you want to find HTML versions of the Yocto Project manuals on the web, | ||
53 | go to http://www.yoctoproject.org and click on the "Documentation" tab. From | ||
54 | there you have access to archived documentation from previous releases, current | ||
55 | documentation for the latest release, and "Docs in Progress" for the release | ||
56 | currently being developed. | ||
57 | |||
58 | In general, the Yocto Project site (http://www.yoctoproject.org) is a great | ||
59 | reference for both information and downloads. | ||
60 | |||
61 | Makefile | ||
62 | ======== | ||
63 | |||
64 | The Makefile processes manual directories to create HTML, PDF, | ||
65 | tarballs, etc. Details on how the Makefile work are documented | ||
66 | inside the Makefile. See that file for more information. | ||
67 | |||
68 | To build a manual, you run the make command and pass it the name | ||
69 | of the folder containing the manual's contents. | ||
70 | For example, the following command run from the documentation directory | ||
71 | creates an HTML and a PDF version of the ADT manual. | ||
72 | The DOC variable specifies the manual you are making: | ||
73 | |||
74 | $ make DOC=adt-manual | ||
75 | |||
76 | poky.ent | ||
77 | ======== | ||
78 | |||
79 | This file defines variables used for documentation production. The variables | ||
80 | are used to define release pathnames, URLs for the published manuals, etc. | ||
81 | |||
82 | template | ||
83 | ======== | ||
84 | Contains various templates, fonts, and some old PNG files. | ||
85 | |||
86 | tools | ||
87 | ===== | ||
88 | Contains a tool to convert the DocBook files to PDF format. This folder also | ||
89 | contains the mega-manual.sed file, which is used by Makefile to process | ||
90 | cross-references from within the manual that normally go to an external | ||
91 | manual. | ||
diff --git a/documentation/adt-manual/adt-command.xml b/documentation/adt-manual/adt-command.xml new file mode 100644 index 0000000..9aa25fa --- /dev/null +++ b/documentation/adt-manual/adt-command.xml | |||
@@ -0,0 +1,224 @@ | |||
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 | |||
5 | <chapter id='using-the-command-line'> | ||
6 | <title>Using the Command Line</title> | ||
7 | |||
8 | <para> | ||
9 | Recall that earlier the manual discussed how to use an existing toolchain | ||
10 | tarball that had been installed into the default installation | ||
11 | directory, <filename>/opt/poky/&DISTRO;</filename>, which is outside of the | ||
12 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
13 | (see the section "<link linkend='using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball)</link>". | ||
14 | And, that sourcing your architecture-specific environment setup script | ||
15 | initializes a suitable cross-toolchain development environment. | ||
16 | </para> | ||
17 | |||
18 | <para> | ||
19 | During this setup, locations for the compiler, QEMU scripts, QEMU binary, | ||
20 | a special version of <filename>pkgconfig</filename> and other useful | ||
21 | utilities are added to the <filename>PATH</filename> variable. | ||
22 | Also, variables to assist | ||
23 | <filename>pkgconfig</filename> and <filename>autotools</filename> | ||
24 | are also defined so that, for example, <filename>configure.sh</filename> | ||
25 | can find pre-generated test results for tests that need target hardware | ||
26 | on which to run. | ||
27 | </para> | ||
28 | |||
29 | <para> | ||
30 | Collectively, these conditions allow you to easily use the toolchain | ||
31 | outside of the OpenEmbedded build environment on both Autotools-based | ||
32 | projects and Makefile-based projects. | ||
33 | This chapter provides information for both these types of projects. | ||
34 | </para> | ||
35 | |||
36 | |||
37 | <section id='autotools-based-projects'> | ||
38 | <title>Autotools-Based Projects</title> | ||
39 | |||
40 | <para> | ||
41 | Once you have a suitable cross-toolchain installed, it is very easy to | ||
42 | develop a project outside of the OpenEmbedded build system. | ||
43 | This section presents a simple "Helloworld" example that shows how | ||
44 | to set up, compile, and run the project. | ||
45 | </para> | ||
46 | |||
47 | <section id='creating-and-running-a-project-based-on-gnu-autotools'> | ||
48 | <title>Creating and Running a Project Based on GNU Autotools</title> | ||
49 | |||
50 | <para> | ||
51 | Follow these steps to create a simple Autotools-based project: | ||
52 | <orderedlist> | ||
53 | <listitem><para><emphasis>Create your directory:</emphasis> | ||
54 | Create a clean directory for your project and then make | ||
55 | that directory your working location: | ||
56 | <literallayout class='monospaced'> | ||
57 | $ mkdir $HOME/helloworld | ||
58 | $ cd $HOME/helloworld | ||
59 | </literallayout></para></listitem> | ||
60 | <listitem><para><emphasis>Populate the directory:</emphasis> | ||
61 | Create <filename>hello.c</filename>, <filename>Makefile.am</filename>, | ||
62 | and <filename>configure.in</filename> files as follows: | ||
63 | <itemizedlist> | ||
64 | <listitem><para>For <filename>hello.c</filename>, include | ||
65 | these lines: | ||
66 | <literallayout class='monospaced'> | ||
67 | #include <stdio.h> | ||
68 | |||
69 | main() | ||
70 | { | ||
71 | printf("Hello World!\n"); | ||
72 | } | ||
73 | </literallayout></para></listitem> | ||
74 | <listitem><para>For <filename>Makefile.am</filename>, | ||
75 | include these lines: | ||
76 | <literallayout class='monospaced'> | ||
77 | bin_PROGRAMS = hello | ||
78 | hello_SOURCES = hello.c | ||
79 | </literallayout></para></listitem> | ||
80 | <listitem><para>For <filename>configure.in</filename>, | ||
81 | include these lines: | ||
82 | <literallayout class='monospaced'> | ||
83 | AC_INIT(hello.c) | ||
84 | AM_INIT_AUTOMAKE(hello,0.1) | ||
85 | AC_PROG_CC | ||
86 | AC_PROG_INSTALL | ||
87 | AC_OUTPUT(Makefile) | ||
88 | </literallayout></para></listitem> | ||
89 | </itemizedlist></para></listitem> | ||
90 | <listitem><para><emphasis>Source the cross-toolchain | ||
91 | environment setup file:</emphasis> | ||
92 | Installation of the cross-toolchain creates a cross-toolchain | ||
93 | environment setup script in the directory that the ADT | ||
94 | was installed. | ||
95 | Before you can use the tools to develop your project, you must | ||
96 | source this setup script. | ||
97 | The script begins with the string "environment-setup" and contains | ||
98 | the machine architecture, which is followed by the string | ||
99 | "poky-linux". | ||
100 | Here is an example that sources a script from the | ||
101 | default ADT installation directory that uses the | ||
102 | 32-bit Intel x86 Architecture and using the | ||
103 | &DISTRO_NAME; Yocto Project release: | ||
104 | <literallayout class='monospaced'> | ||
105 | $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux | ||
106 | </literallayout></para></listitem> | ||
107 | <listitem><para><emphasis>Generate the local aclocal.m4 | ||
108 | files and create the configure script:</emphasis> | ||
109 | The following GNU Autotools generate the local | ||
110 | <filename>aclocal.m4</filename> files and create the | ||
111 | configure script: | ||
112 | <literallayout class='monospaced'> | ||
113 | $ aclocal | ||
114 | $ autoconf | ||
115 | </literallayout></para></listitem> | ||
116 | <listitem><para><emphasis>Generate files needed by GNU | ||
117 | coding standards:</emphasis> | ||
118 | GNU coding standards require certain files in order for the | ||
119 | project to be compliant. | ||
120 | This command creates those files: | ||
121 | <literallayout class='monospaced'> | ||
122 | $ touch NEWS README AUTHORS ChangeLog | ||
123 | </literallayout></para></listitem> | ||
124 | <listitem><para><emphasis>Generate the configure | ||
125 | file:</emphasis> | ||
126 | This command generates the <filename>configure</filename>: | ||
127 | <literallayout class='monospaced'> | ||
128 | $ automake -a | ||
129 | </literallayout></para></listitem> | ||
130 | <listitem><para><emphasis>Cross-compile the project:</emphasis> | ||
131 | This command compiles the project using the cross-compiler: | ||
132 | <literallayout class='monospaced'> | ||
133 | $ ./configure ${CONFIGURE_FLAGS} | ||
134 | </literallayout></para></listitem> | ||
135 | <listitem><para><emphasis>Make and install the project:</emphasis> | ||
136 | These two commands generate and install the project into the | ||
137 | destination directory: | ||
138 | <literallayout class='monospaced'> | ||
139 | $ make | ||
140 | $ make install DESTDIR=./tmp | ||
141 | </literallayout></para></listitem> | ||
142 | <listitem><para><emphasis>Verify the installation:</emphasis> | ||
143 | This command is a simple way to verify the installation | ||
144 | of your project. | ||
145 | Running the command prints the architecture on which | ||
146 | the binary file can run. | ||
147 | This architecture should be the same architecture that | ||
148 | the installed cross-toolchain supports. | ||
149 | <literallayout class='monospaced'> | ||
150 | $ file ./tmp/usr/local/bin/hello | ||
151 | </literallayout></para></listitem> | ||
152 | <listitem><para><emphasis>Execute your project:</emphasis> | ||
153 | To execute the project in the shell, simply enter the name. | ||
154 | You could also copy the binary to the actual target hardware | ||
155 | and run the project there as well: | ||
156 | <literallayout class='monospaced'> | ||
157 | $ ./hello | ||
158 | </literallayout> | ||
159 | As expected, the project displays the "Hello World!" message. | ||
160 | </para></listitem> | ||
161 | </orderedlist> | ||
162 | </para> | ||
163 | </section> | ||
164 | |||
165 | <section id='passing-host-options'> | ||
166 | <title>Passing Host Options</title> | ||
167 | |||
168 | <para> | ||
169 | For an Autotools-based project, you can use the cross-toolchain by just | ||
170 | passing the appropriate host option to <filename>configure.sh</filename>. | ||
171 | The host option you use is derived from the name of the environment setup | ||
172 | script found in the directory in which you installed the cross-toolchain. | ||
173 | For example, the host option for an ARM-based target that uses the GNU EABI | ||
174 | is <filename>armv5te-poky-linux-gnueabi</filename>. | ||
175 | You will notice that the name of the script is | ||
176 | <filename>environment-setup-armv5te-poky-linux-gnueabi</filename>. | ||
177 | Thus, the following command works: | ||
178 | <literallayout class='monospaced'> | ||
179 | $ ./configure --host=armv5te-poky-linux-gnueabi \ | ||
180 | --with-libtool-sysroot=<sysroot-dir> | ||
181 | </literallayout> | ||
182 | </para> | ||
183 | |||
184 | <para> | ||
185 | This single command updates your project and rebuilds it using the appropriate | ||
186 | cross-toolchain tools. | ||
187 | <note> | ||
188 | If the <filename>configure</filename> script results in problems recognizing the | ||
189 | <filename>--with-libtool-sysroot=<sysroot-dir></filename> option, | ||
190 | regenerate the script to enable the support by doing the following and then | ||
191 | run the script again: | ||
192 | <literallayout class='monospaced'> | ||
193 | $ libtoolize --automake | ||
194 | $ aclocal -I ${OECORE_NATIVE_SYSROOT}/usr/share/aclocal \ | ||
195 | [-I <dir_containing_your_project-specific_m4_macros>] | ||
196 | $ autoconf | ||
197 | $ autoheader | ||
198 | $ automake -a | ||
199 | </literallayout> | ||
200 | </note> | ||
201 | </para> | ||
202 | </section> | ||
203 | </section> | ||
204 | |||
205 | <section id='makefile-based-projects'> | ||
206 | <title>Makefile-Based Projects</title> | ||
207 | |||
208 | <para> | ||
209 | For a Makefile-based project, you use the cross-toolchain by making sure | ||
210 | the tools are used. | ||
211 | You can do this as follows: | ||
212 | <literallayout class='monospaced'> | ||
213 | CC=arm-poky-linux-gnueabi-gcc | ||
214 | LD=arm-poky-linux-gnueabi-ld | ||
215 | CFLAGS=”${CFLAGS} --sysroot=<sysroot-dir>” | ||
216 | CXXFLAGS=”${CXXFLAGS} --sysroot=<sysroot-dir>” | ||
217 | </literallayout> | ||
218 | </para> | ||
219 | </section> | ||
220 | |||
221 | </chapter> | ||
222 | <!-- | ||
223 | vim: expandtab tw=80 ts=4 | ||
224 | --> | ||
diff --git a/documentation/adt-manual/adt-intro.xml b/documentation/adt-manual/adt-intro.xml new file mode 100644 index 0000000..ed13a23 --- /dev/null +++ b/documentation/adt-manual/adt-intro.xml | |||
@@ -0,0 +1,179 @@ | |||
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 | |||
5 | <chapter id='adt-intro'> | ||
6 | <title>The Application Development Toolkit (ADT)</title> | ||
7 | |||
8 | <para> | ||
9 | Part of the Yocto Project development solution is an Application Development | ||
10 | Toolkit (ADT). | ||
11 | The ADT provides you with a custom-built, cross-development | ||
12 | platform suited for developing a user-targeted product application. | ||
13 | </para> | ||
14 | |||
15 | <para> | ||
16 | Fundamentally, the ADT consists of the following: | ||
17 | <itemizedlist> | ||
18 | <listitem><para>An architecture-specific cross-toolchain and matching | ||
19 | sysroot both built by the OpenEmbedded build system. | ||
20 | The toolchain and sysroot are based on a | ||
21 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> | ||
22 | configuration and extensions, | ||
23 | which allows you to cross-develop on the host machine for the target hardware. | ||
24 | </para></listitem> | ||
25 | <listitem><para>The Eclipse IDE Yocto Plug-in.</para></listitem> | ||
26 | <listitem><para>The Quick EMUlator (QEMU), which lets you simulate target hardware. | ||
27 | </para></listitem> | ||
28 | <listitem><para>Various user-space tools that greatly enhance your application | ||
29 | development experience.</para></listitem> | ||
30 | </itemizedlist> | ||
31 | </para> | ||
32 | |||
33 | <section id='the-cross-development-toolchain'> | ||
34 | <title>The Cross-Development Toolchain</title> | ||
35 | |||
36 | <para> | ||
37 | The | ||
38 | <ulink url='&YOCTO_DOCS_DEV_URL;#cross-development-toolchain'>Cross-Development Toolchain</ulink> | ||
39 | consists of a cross-compiler, cross-linker, and cross-debugger | ||
40 | that are used to develop user-space applications for targeted | ||
41 | hardware. | ||
42 | This toolchain is created either by running the ADT Installer | ||
43 | script, a toolchain installer script, or through a | ||
44 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
45 | that is based on your Metadata configuration or extension for | ||
46 | your targeted device. | ||
47 | The cross-toolchain works with a matching target sysroot. | ||
48 | </para> | ||
49 | </section> | ||
50 | |||
51 | <section id='sysroot'> | ||
52 | <title>Sysroot</title> | ||
53 | |||
54 | <para> | ||
55 | The matching target sysroot contains needed headers and libraries for generating | ||
56 | binaries that run on the target architecture. | ||
57 | The sysroot is based on the target root filesystem image that is built by | ||
58 | the OpenEmbedded build system and uses the same Metadata configuration | ||
59 | used to build the cross-toolchain. | ||
60 | </para> | ||
61 | </section> | ||
62 | |||
63 | <section id='eclipse-overview'> | ||
64 | <title>Eclipse Yocto Plug-in</title> | ||
65 | |||
66 | <para> | ||
67 | The Eclipse IDE is a popular development environment and it fully supports | ||
68 | development using the Yocto Project. | ||
69 | When you install and configure the Eclipse Yocto Project Plug-in into | ||
70 | the Eclipse IDE, you maximize your Yocto Project experience. | ||
71 | Installing and configuring the Plug-in results in an environment that | ||
72 | has extensions specifically designed to let you more easily develop software. | ||
73 | These extensions allow for cross-compilation, deployment, and execution of | ||
74 | your output into a QEMU emulation session. | ||
75 | You can also perform cross-debugging and profiling. | ||
76 | The environment also supports a suite of tools that allows you to perform | ||
77 | remote profiling, tracing, collection of power data, collection of | ||
78 | latency data, and collection of performance data. | ||
79 | </para> | ||
80 | |||
81 | <para> | ||
82 | For information about the application development workflow that uses the Eclipse | ||
83 | IDE and for a detailed example of how to install and configure the Eclipse | ||
84 | Yocto Project Plug-in, see the | ||
85 | "<ulink url='&YOCTO_DOCS_DEV_URL;#adt-eclipse'>Working Within Eclipse</ulink>" section | ||
86 | of the Yocto Project Development Manual. | ||
87 | </para> | ||
88 | </section> | ||
89 | |||
90 | <section id='the-qemu-emulator'> | ||
91 | <title>The QEMU Emulator</title> | ||
92 | |||
93 | <para> | ||
94 | The QEMU emulator allows you to simulate your hardware while running your | ||
95 | application or image. | ||
96 | QEMU is made available a number of ways: | ||
97 | <itemizedlist> | ||
98 | <listitem><para> | ||
99 | If you use the ADT Installer script to install ADT, you can | ||
100 | specify whether or not to install QEMU. | ||
101 | </para></listitem> | ||
102 | <listitem><para> | ||
103 | If you have cloned the <filename>poky</filename> Git | ||
104 | repository to create a | ||
105 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
106 | and you have sourced the environment setup script, QEMU is | ||
107 | installed and automatically available. | ||
108 | </para></listitem> | ||
109 | <listitem><para> | ||
110 | If you have downloaded a Yocto Project release and unpacked | ||
111 | it to create a | ||
112 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
113 | and you have sourced the environment setup script, QEMU is | ||
114 | installed and automatically available. | ||
115 | </para></listitem> | ||
116 | <listitem><para> | ||
117 | If you have installed the cross-toolchain tarball and you | ||
118 | have sourced the toolchain's setup environment script, QEMU | ||
119 | is also installed and automatically available. | ||
120 | </para></listitem> | ||
121 | </itemizedlist> | ||
122 | </para> | ||
123 | </section> | ||
124 | |||
125 | <section id='user-space-tools'> | ||
126 | <title>User-Space Tools</title> | ||
127 | |||
128 | <para> | ||
129 | User-space tools are included as part of the distribution. | ||
130 | You will find these tools helpful during development. | ||
131 | The tools include LatencyTOP, PowerTOP, OProfile, Perf, SystemTap, and Lttng-ust. | ||
132 | These tools are common development tools for the Linux platform. | ||
133 | <itemizedlist> | ||
134 | <listitem><para><emphasis>LatencyTOP:</emphasis> LatencyTOP focuses on latency | ||
135 | that causes skips in audio, | ||
136 | stutters in your desktop experience, or situations that overload your server | ||
137 | even when you have plenty of CPU power left. | ||
138 | </para></listitem> | ||
139 | <listitem><para><emphasis>PowerTOP:</emphasis> Helps you determine what | ||
140 | software is using the most power. | ||
141 | You can find out more about PowerTOP at | ||
142 | <ulink url='https://01.org/powertop/'></ulink>.</para></listitem> | ||
143 | <listitem><para><emphasis>OProfile:</emphasis> A system-wide profiler for Linux | ||
144 | systems that is capable of profiling all running code at low overhead. | ||
145 | You can find out more about OProfile at | ||
146 | <ulink url='http://oprofile.sourceforge.net/about/'></ulink>. | ||
147 | For examples on how to setup and use this tool, see the | ||
148 | "<ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual-oprofile'>OProfile</ulink>" | ||
149 | section in the Yocto Project Profiling and Tracing Manual. | ||
150 | </para></listitem> | ||
151 | <listitem><para><emphasis>Perf:</emphasis> Performance counters for Linux used | ||
152 | to keep track of certain types of hardware and software events. | ||
153 | For more information on these types of counters see | ||
154 | <ulink url='https://perf.wiki.kernel.org/'></ulink>. | ||
155 | For examples on how to setup and use this tool, see the | ||
156 | "<ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual-perf'>perf</ulink>" | ||
157 | section in the Yocto Project Profiling and Tracing Manual. | ||
158 | </para></listitem> | ||
159 | <listitem><para><emphasis>SystemTap:</emphasis> A free software infrastructure | ||
160 | that simplifies information gathering about a running Linux system. | ||
161 | This information helps you diagnose performance or functional problems. | ||
162 | SystemTap is not available as a user-space tool through the Eclipse IDE Yocto Plug-in. | ||
163 | See <ulink url='http://sourceware.org/systemtap'></ulink> for more information | ||
164 | on SystemTap. | ||
165 | For examples on how to setup and use this tool, see the | ||
166 | "<ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual-systemtap'>SystemTap</ulink>" | ||
167 | section in the Yocto Project Profiling and Tracing Manual.</para></listitem> | ||
168 | <listitem><para><emphasis>Lttng-ust:</emphasis> A User-space Tracer designed to | ||
169 | provide detailed information on user-space activity. | ||
170 | See <ulink url='http://lttng.org/ust'></ulink> for more information on Lttng-ust. | ||
171 | </para></listitem> | ||
172 | </itemizedlist> | ||
173 | </para> | ||
174 | </section> | ||
175 | |||
176 | </chapter> | ||
177 | <!-- | ||
178 | vim: expandtab tw=80 ts=4 | ||
179 | --> | ||
diff --git a/documentation/adt-manual/adt-manual-customization.xsl b/documentation/adt-manual/adt-manual-customization.xsl new file mode 100644 index 0000000..e7892fd --- /dev/null +++ b/documentation/adt-manual/adt-manual-customization.xsl | |||
@@ -0,0 +1,19 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> | ||
3 | |||
4 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" /> | ||
5 | |||
6 | <xsl:include href="../template/permalinks.xsl"/> | ||
7 | <xsl:include href="../template/section.title.xsl"/> | ||
8 | <xsl:include href="../template/component.title.xsl"/> | ||
9 | <xsl:include href="../template/division.title.xsl"/> | ||
10 | <xsl:include href="../template/formal.object.heading.xsl"/> | ||
11 | |||
12 | <xsl:param name="html.stylesheet" select="'adt-style.css'" /> | ||
13 | <xsl:param name="chapter.autolabel" select="1" /> | ||
14 | <xsl:param name="appendix.autolabel" select="A" /> | ||
15 | <xsl:param name="section.autolabel" select="1" /> | ||
16 | <xsl:param name="section.label.includes.component.label" select="1" /> | ||
17 | <xsl:param name="generate.id.attributes" select="1" /> | ||
18 | |||
19 | </xsl:stylesheet> | ||
diff --git a/documentation/adt-manual/adt-manual-eclipse-customization.xsl b/documentation/adt-manual/adt-manual-eclipse-customization.xsl new file mode 100644 index 0000000..d16ffbb --- /dev/null +++ b/documentation/adt-manual/adt-manual-eclipse-customization.xsl | |||
@@ -0,0 +1,27 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet | ||
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
4 | xmlns="http://www.w3.org/1999/xhtml" | ||
5 | xmlns:fo="http://www.w3.org/1999/XSL/Format" | ||
6 | version="1.0"> | ||
7 | |||
8 | <xsl:import | ||
9 | href="http://docbook.sourceforge.net/release/xsl/current/eclipse/eclipse3.xsl" /> | ||
10 | |||
11 | <xsl:param name="chunker.output.indent" select="'yes'"/> | ||
12 | <xsl:param name="chunk.quietly" select="1"/> | ||
13 | <xsl:param name="chunk.first.sections" select="1"/> | ||
14 | <xsl:param name="chunk.section.depth" select="10"/> | ||
15 | <xsl:param name="use.id.as.filename" select="1"/> | ||
16 | <xsl:param name="ulink.target" select="'_self'" /> | ||
17 | <xsl:param name="base.dir" select="'html/adt-manual/'"/> | ||
18 | <xsl:param name="html.stylesheet" select="'../book.css'"/> | ||
19 | <xsl:param name="eclipse.manifest" select="0"/> | ||
20 | <xsl:param name="create.plugin.xml" select="0"/> | ||
21 | <xsl:param name="suppress.navigation" select="1"/> | ||
22 | <xsl:param name="generate.index" select="0"/> | ||
23 | <xsl:param name="chapter.autolabel" select="1" /> | ||
24 | <xsl:param name="appendix.autolabel" select="1" /> | ||
25 | <xsl:param name="section.autolabel" select="1" /> | ||
26 | <xsl:param name="section.label.includes.component.label" select="1" /> | ||
27 | </xsl:stylesheet> | ||
diff --git a/documentation/adt-manual/adt-manual-intro.xml b/documentation/adt-manual/adt-manual-intro.xml new file mode 100644 index 0000000..fccacc4 --- /dev/null +++ b/documentation/adt-manual/adt-manual-intro.xml | |||
@@ -0,0 +1,33 @@ | |||
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 | |||
5 | <chapter id='adt-manual-intro'> | ||
6 | <title>Introduction</title> | ||
7 | |||
8 | <para> | ||
9 | Welcome to the Yocto Project Application Developer's Guide. | ||
10 | This manual provides information that lets you begin developing applications | ||
11 | using the Yocto Project. | ||
12 | </para> | ||
13 | |||
14 | <para> | ||
15 | The Yocto Project provides an application development environment based on | ||
16 | an Application Development Toolkit (ADT) and the availability of stand-alone | ||
17 | cross-development toolchains and other tools. | ||
18 | This manual describes the ADT and how you can configure and install it, | ||
19 | how to access and use the cross-development toolchains, how to | ||
20 | customize the development packages installation, | ||
21 | how to use command line development for both Autotools-based and Makefile-based projects, | ||
22 | and an introduction to the <trademark class='trade'>Eclipse</trademark> IDE | ||
23 | Yocto Plug-in. | ||
24 | <note> | ||
25 | The ADT is distribution-neutral and does not require the Yocto | ||
26 | Project reference distribution, which is called Poky. | ||
27 | This manual, however, uses examples that use the Poky distribution. | ||
28 | </note> | ||
29 | </para> | ||
30 | </chapter> | ||
31 | <!-- | ||
32 | vim: expandtab tw=80 ts=4 | ||
33 | --> | ||
diff --git a/documentation/adt-manual/adt-manual.xml b/documentation/adt-manual/adt-manual.xml new file mode 100644 index 0000000..31695b0 --- /dev/null +++ b/documentation/adt-manual/adt-manual.xml | |||
@@ -0,0 +1,125 @@ | |||
1 | <!DOCTYPE book 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 | |||
5 | <book id='adt-manual' lang='en' | ||
6 | xmlns:xi="http://www.w3.org/2003/XInclude" | ||
7 | xmlns="http://docbook.org/ns/docbook" | ||
8 | > | ||
9 | <bookinfo> | ||
10 | |||
11 | <mediaobject> | ||
12 | <imageobject> | ||
13 | <imagedata fileref='figures/adt-title.png' | ||
14 | format='SVG' | ||
15 | align='left' scalefit='1' width='100%'/> | ||
16 | </imageobject> | ||
17 | </mediaobject> | ||
18 | |||
19 | <title> | ||
20 | Yocto Project Application Developer's Guide | ||
21 | </title> | ||
22 | |||
23 | <authorgroup> | ||
24 | <author> | ||
25 | <firstname>Jessica</firstname> <surname>Zhang</surname> | ||
26 | <affiliation> | ||
27 | <orgname>Intel Corporation</orgname> | ||
28 | </affiliation> | ||
29 | <email>jessica.zhang@intel.com</email> | ||
30 | </author> | ||
31 | </authorgroup> | ||
32 | |||
33 | <revhistory> | ||
34 | <revision> | ||
35 | <revnumber>1.0</revnumber> | ||
36 | <date>6 April 2011</date> | ||
37 | <revremark>Released with the Yocto Project 1.0 Release.</revremark> | ||
38 | </revision> | ||
39 | <revision> | ||
40 | <revnumber>1.0.1</revnumber> | ||
41 | <date>23 May 2011</date> | ||
42 | <revremark>Released with the Yocto Project 1.0.1 Release.</revremark> | ||
43 | </revision> | ||
44 | <revision> | ||
45 | <revnumber>1.1</revnumber> | ||
46 | <date>6 October 2011</date> | ||
47 | <revremark>Released with the Yocto Project 1.1 Release.</revremark> | ||
48 | </revision> | ||
49 | <revision> | ||
50 | <revnumber>1.2</revnumber> | ||
51 | <date>April 2012</date> | ||
52 | <revremark>Released with the Yocto Project 1.2 Release.</revremark> | ||
53 | </revision> | ||
54 | <revision> | ||
55 | <revnumber>1.3</revnumber> | ||
56 | <date>October 2012</date> | ||
57 | <revremark>Released with the Yocto Project 1.3 Release.</revremark> | ||
58 | </revision> | ||
59 | <revision> | ||
60 | <revnumber>1.4</revnumber> | ||
61 | <date>April 2013</date> | ||
62 | <revremark>Released with the Yocto Project 1.4 Release.</revremark> | ||
63 | </revision> | ||
64 | <revision> | ||
65 | <revnumber>1.5</revnumber> | ||
66 | <date>October 2013</date> | ||
67 | <revremark>Released with the Yocto Project 1.5 Release.</revremark> | ||
68 | </revision> | ||
69 | <revision> | ||
70 | <revnumber>1.5.1</revnumber> | ||
71 | <date>January 2014</date> | ||
72 | <revremark>Released with the Yocto Project 1.5.1 Release.</revremark> | ||
73 | </revision> | ||
74 | <revision> | ||
75 | <revnumber>1.6</revnumber> | ||
76 | <date>April 2014</date> | ||
77 | <revremark>Released with the Yocto Project 1.6 Release.</revremark> | ||
78 | </revision> | ||
79 | <revision> | ||
80 | <revnumber>1.7</revnumber> | ||
81 | <date>Fall of 2014</date> | ||
82 | <revremark>Released with the Yocto Project 1.7 Release.</revremark> | ||
83 | </revision> | ||
84 | </revhistory> | ||
85 | |||
86 | <copyright> | ||
87 | <year>©RIGHT_YEAR;</year> | ||
88 | <holder>Linux Foundation</holder> | ||
89 | </copyright> | ||
90 | |||
91 | <legalnotice> | ||
92 | <para> | ||
93 | Permission is granted to copy, distribute and/or modify this document under | ||
94 | the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England & Wales</ulink> as published by Creative Commons. | ||
95 | </para> | ||
96 | <note> | ||
97 | For the latest version of this manual associated with this | ||
98 | Yocto Project release, see the | ||
99 | <ulink url='&YOCTO_DOCS_ADT_URL;'>Yocto Project Application Developer's Guide</ulink> | ||
100 | from the Yocto Project website. | ||
101 | </note> | ||
102 | |||
103 | </legalnotice> | ||
104 | |||
105 | </bookinfo> | ||
106 | |||
107 | <xi:include href="adt-manual-intro.xml"/> | ||
108 | |||
109 | <xi:include href="adt-intro.xml"/> | ||
110 | |||
111 | <xi:include href="adt-prepare.xml"/> | ||
112 | |||
113 | <xi:include href="adt-package.xml"/> | ||
114 | |||
115 | <xi:include href="adt-command.xml"/> | ||
116 | |||
117 | <!-- <index id='index'> | ||
118 | <title>Index</title> | ||
119 | </index> | ||
120 | --> | ||
121 | |||
122 | </book> | ||
123 | <!-- | ||
124 | vim: expandtab tw=80 ts=4 | ||
125 | --> | ||
diff --git a/documentation/adt-manual/adt-package.xml b/documentation/adt-manual/adt-package.xml new file mode 100644 index 0000000..da032ee --- /dev/null +++ b/documentation/adt-manual/adt-package.xml | |||
@@ -0,0 +1,101 @@ | |||
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 | |||
5 | <chapter id='adt-package'> | ||
6 | <title>Optionally Customizing the Development Packages Installation</title> | ||
7 | |||
8 | <para> | ||
9 | Because the Yocto Project is suited for embedded Linux development, it is | ||
10 | likely that you will need to customize your development packages installation. | ||
11 | For example, if you are developing a minimal image, then you might not need | ||
12 | certain packages (e.g. graphics support packages). | ||
13 | Thus, you would like to be able to remove those packages from your target sysroot. | ||
14 | </para> | ||
15 | |||
16 | <section id='package-management-systems'> | ||
17 | <title>Package Management Systems</title> | ||
18 | |||
19 | <para> | ||
20 | The OpenEmbedded build system supports the generation of sysroot files using | ||
21 | three different Package Management Systems (PMS): | ||
22 | <itemizedlist> | ||
23 | <listitem><para><emphasis>OPKG:</emphasis> A less well known PMS whose use | ||
24 | originated in the OpenEmbedded and OpenWrt embedded Linux projects. | ||
25 | This PMS works with files packaged in an <filename>.ipk</filename> format. | ||
26 | See <ulink url='http://en.wikipedia.org/wiki/Opkg'></ulink> for more | ||
27 | information about OPKG.</para></listitem> | ||
28 | <listitem><para><emphasis>RPM:</emphasis> A more widely known PMS intended for GNU/Linux | ||
29 | distributions. | ||
30 | This PMS works with files packaged in an <filename>.rms</filename> format. | ||
31 | The build system currently installs through this PMS by default. | ||
32 | See <ulink url='http://en.wikipedia.org/wiki/RPM_Package_Manager'></ulink> | ||
33 | for more information about RPM.</para></listitem> | ||
34 | <listitem><para><emphasis>Debian:</emphasis> The PMS for Debian-based systems | ||
35 | is built on many PMS tools. | ||
36 | The lower-level PMS tool <filename>dpkg</filename> forms the base of the Debian PMS. | ||
37 | For information on dpkg see | ||
38 | <ulink url='http://en.wikipedia.org/wiki/Dpkg'></ulink>.</para></listitem> | ||
39 | </itemizedlist> | ||
40 | </para> | ||
41 | </section> | ||
42 | |||
43 | <section id='configuring-the-pms'> | ||
44 | <title>Configuring the PMS</title> | ||
45 | |||
46 | <para> | ||
47 | Whichever PMS you are using, you need to be sure that the | ||
48 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink> | ||
49 | variable in the <filename>conf/local.conf</filename> | ||
50 | file is set to reflect that system. | ||
51 | The first value you choose for the variable specifies the package file format for the root | ||
52 | filesystem at sysroot. | ||
53 | Additional values specify additional formats for convenience or testing. | ||
54 | See the configuration file for details. | ||
55 | </para> | ||
56 | |||
57 | <note> | ||
58 | For build performance information related to the PMS, see the | ||
59 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-package'><filename>package.bbclass</filename></ulink>" | ||
60 | section in the Yocto Project Reference Manual. | ||
61 | </note> | ||
62 | |||
63 | <para> | ||
64 | As an example, consider a scenario where you are using OPKG and you want to add | ||
65 | the <filename>libglade</filename> package to the target sysroot. | ||
66 | </para> | ||
67 | |||
68 | <para> | ||
69 | First, you should generate the IPK file for the | ||
70 | <filename>libglade</filename> package and add it | ||
71 | into a working <filename>opkg</filename> repository. | ||
72 | Use these commands: | ||
73 | <literallayout class='monospaced'> | ||
74 | $ bitbake libglade | ||
75 | $ bitbake package-index | ||
76 | </literallayout> | ||
77 | </para> | ||
78 | |||
79 | <para> | ||
80 | Next, source the environment setup script found in the | ||
81 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
82 | Follow that by setting up the installation destination to point to your | ||
83 | sysroot as <filename><sysroot_dir></filename>. | ||
84 | Finally, have an OPKG configuration file <filename><conf_file></filename> | ||
85 | that corresponds to the <filename>opkg</filename> repository you have just created. | ||
86 | The following command forms should now work: | ||
87 | <literallayout class='monospaced'> | ||
88 | $ opkg-cl –f <conf_file> -o <sysroot_dir> update | ||
89 | $ opkg-cl –f <cconf_file> -o <sysroot_dir> \ | ||
90 | --force-overwrite install libglade | ||
91 | $ opkg-cl –f <cconf_file> -o <sysroot_dir> \ | ||
92 | --force-overwrite install libglade-dbg | ||
93 | $ opkg-cl –f <conf_file> -o <sysroot_dir> \ | ||
94 | --force-overwrite install libglade-dev | ||
95 | </literallayout> | ||
96 | </para> | ||
97 | </section> | ||
98 | </chapter> | ||
99 | <!-- | ||
100 | vim: expandtab tw=80 ts=4 | ||
101 | --> | ||
diff --git a/documentation/adt-manual/adt-prepare.xml b/documentation/adt-manual/adt-prepare.xml new file mode 100644 index 0000000..89ef09f --- /dev/null +++ b/documentation/adt-manual/adt-prepare.xml | |||
@@ -0,0 +1,671 @@ | |||
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 | |||
5 | <chapter id='adt-prepare'> | ||
6 | |||
7 | <title>Preparing for Application Development</title> | ||
8 | |||
9 | <para> | ||
10 | In order to develop applications, you need set up your host development system. | ||
11 | Several ways exist that allow you to install cross-development tools, QEMU, the | ||
12 | Eclipse Yocto Plug-in, and other tools. | ||
13 | This chapter describes how to prepare for application development. | ||
14 | </para> | ||
15 | |||
16 | <section id='installing-the-adt'> | ||
17 | <title>Installing the ADT and Toolchains</title> | ||
18 | |||
19 | <para> | ||
20 | The following list describes installation methods that set up varying degrees of tool | ||
21 | availability on your system. | ||
22 | Regardless of the installation method you choose, | ||
23 | you must <filename>source</filename> the cross-toolchain | ||
24 | environment setup script before you use a toolchain. | ||
25 | See the "<link linkend='setting-up-the-cross-development-environment'>Setting Up the | ||
26 | Cross-Development Environment</link>" section for more information. | ||
27 | </para> | ||
28 | |||
29 | <note> | ||
30 | <para>Avoid mixing installation methods when installing toolchains for different architectures. | ||
31 | For example, avoid using the ADT Installer to install some toolchains and then hand-installing | ||
32 | cross-development toolchains by running the toolchain installer for different architectures. | ||
33 | Mixing installation methods can result in situations where the ADT Installer becomes | ||
34 | unreliable and might not install the toolchain.</para> | ||
35 | <para>If you must mix installation methods, you might avoid problems by deleting | ||
36 | <filename>/var/lib/opkg</filename>, thus purging the <filename>opkg</filename> package | ||
37 | metadata</para> | ||
38 | </note> | ||
39 | |||
40 | <para> | ||
41 | <itemizedlist> | ||
42 | <listitem><para><emphasis>Use the ADT installer script:</emphasis> | ||
43 | This method is the recommended way to install the ADT because it | ||
44 | automates much of the process for you. | ||
45 | For example, you can configure the installation to install the QEMU emulator | ||
46 | and the user-space NFS, specify which root filesystem profiles to download, | ||
47 | and define the target sysroot location.</para></listitem> | ||
48 | <listitem><para><emphasis>Use an existing toolchain:</emphasis> | ||
49 | Using this method, you select and download an architecture-specific | ||
50 | toolchain installer and then run the script to hand-install the toolchain. | ||
51 | If you use this method, you just get the cross-toolchain and QEMU - you do not | ||
52 | get any of the other mentioned benefits had you run the ADT Installer script.</para></listitem> | ||
53 | <listitem><para><emphasis>Use the toolchain from within the Build Directory:</emphasis> | ||
54 | If you already have a | ||
55 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>, | ||
56 | you can build the cross-toolchain within the directory. | ||
57 | However, like the previous method mentioned, you only get the cross-toolchain and QEMU - you | ||
58 | do not get any of the other benefits without taking separate steps.</para></listitem> | ||
59 | </itemizedlist> | ||
60 | </para> | ||
61 | |||
62 | <section id='using-the-adt-installer'> | ||
63 | <title>Using the ADT Installer</title> | ||
64 | |||
65 | <para> | ||
66 | To run the ADT Installer, you need to get the ADT Installer tarball, be sure | ||
67 | you have the necessary host development packages that support the ADT Installer, | ||
68 | and then run the ADT Installer Script. | ||
69 | </para> | ||
70 | |||
71 | <para> | ||
72 | For a list of the host packages needed to support ADT installation and use, see the | ||
73 | "ADT Installer Extras" lists in the | ||
74 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>" section | ||
75 | of the Yocto Project Reference Manual. | ||
76 | </para> | ||
77 | |||
78 | <section id='getting-the-adt-installer-tarball'> | ||
79 | <title>Getting the ADT Installer Tarball</title> | ||
80 | |||
81 | <para> | ||
82 | The ADT Installer is contained in the ADT Installer tarball. | ||
83 | You can get the tarball using either of these methods: | ||
84 | <itemizedlist> | ||
85 | <listitem><para><emphasis>Download the Tarball:</emphasis> | ||
86 | You can download the tarball from | ||
87 | <ulink url='&YOCTO_ADTINSTALLER_DL_URL;'></ulink> into | ||
88 | any directory.</para></listitem> | ||
89 | <listitem><para><emphasis>Build the Tarball:</emphasis> | ||
90 | You can use | ||
91 | <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink> | ||
92 | to generate the tarball inside an existing | ||
93 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
94 | </para> | ||
95 | <para>If you use BitBake to generate the ADT Installer | ||
96 | tarball, you must <filename>source</filename> the | ||
97 | environment setup script | ||
98 | (<ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> | ||
99 | or | ||
100 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>) | ||
101 | located in the Source Directory before running the | ||
102 | <filename>bitbake</filename> command that creates the | ||
103 | tarball.</para> | ||
104 | <para>The following example commands establish | ||
105 | the | ||
106 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>, | ||
107 | check out the current release branch, set up the | ||
108 | build environment while also creating the default | ||
109 | Build Directory, and run the | ||
110 | <filename>bitbake</filename> command that results in the | ||
111 | tarball | ||
112 | <filename>poky/build/tmp/deploy/sdk/adt_installer.tar.bz2</filename>: | ||
113 | <note> | ||
114 | Before using BitBake to build the ADT tarball, be | ||
115 | sure to make sure your | ||
116 | <filename>local.conf</filename> file is properly | ||
117 | configured. | ||
118 | </note> | ||
119 | <literallayout class='monospaced'> | ||
120 | $ cd ~ | ||
121 | $ git clone git://git.yoctoproject.org/poky | ||
122 | $ cd poky | ||
123 | $ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME; | ||
124 | $ source &OE_INIT_FILE; | ||
125 | $ bitbake adt-installer | ||
126 | </literallayout></para></listitem> | ||
127 | </itemizedlist> | ||
128 | </para> | ||
129 | </section> | ||
130 | |||
131 | <section id='configuring-and-running-the-adt-installer-script'> | ||
132 | <title>Configuring and Running the ADT Installer Script</title> | ||
133 | |||
134 | <para> | ||
135 | Before running the ADT Installer script, you need to unpack the tarball. | ||
136 | You can unpack the tarball in any directory you wish. | ||
137 | For example, this command copies the ADT Installer tarball from where | ||
138 | it was built into the home directory and then unpacks the tarball into | ||
139 | a top-level directory named <filename>adt-installer</filename>: | ||
140 | <literallayout class='monospaced'> | ||
141 | $ cd ~ | ||
142 | $ cp poky/build/tmp/deploy/sdk/adt_installer.tar.bz2 $HOME | ||
143 | $ tar -xjf adt_installer.tar.bz2 | ||
144 | </literallayout> | ||
145 | Unpacking it creates the directory <filename>adt-installer</filename>, | ||
146 | which contains the ADT Installer script (<filename>adt_installer</filename>) | ||
147 | and its configuration file (<filename>adt_installer.conf</filename>). | ||
148 | </para> | ||
149 | |||
150 | <para> | ||
151 | Before you run the script, however, you should examine the ADT Installer configuration | ||
152 | file and be sure you are going to get what you want. | ||
153 | Your configurations determine which kernel and filesystem image are downloaded. | ||
154 | </para> | ||
155 | |||
156 | <para> | ||
157 | The following list describes the configurations you can define for the ADT Installer. | ||
158 | For configuration values and restrictions, see the comments in | ||
159 | the <filename>adt-installer.conf</filename> file: | ||
160 | |||
161 | <itemizedlist> | ||
162 | <listitem><para><filename>YOCTOADT_REPO</filename>: This area | ||
163 | includes the IPKG-based packages and the root filesystem upon which | ||
164 | the installation is based. | ||
165 | If you want to set up your own IPKG repository pointed to by | ||
166 | <filename>YOCTOADT_REPO</filename>, you need to be sure that the | ||
167 | directory structure follows the same layout as the reference directory | ||
168 | set up at <ulink url='http://adtrepo.yoctoproject.org'></ulink>. | ||
169 | Also, your repository needs to be accessible through HTTP.</para></listitem> | ||
170 | <listitem><para><filename>YOCTOADT_TARGETS</filename>: The machine | ||
171 | target architectures for which you want to set up cross-development | ||
172 | environments.</para></listitem> | ||
173 | <listitem><para><filename>YOCTOADT_QEMU</filename>: Indicates whether | ||
174 | or not to install the emulator QEMU.</para></listitem> | ||
175 | <listitem><para><filename>YOCTOADT_NFS_UTIL</filename>: Indicates whether | ||
176 | or not to install user-mode NFS. | ||
177 | If you plan to use the Eclipse IDE Yocto plug-in against QEMU, | ||
178 | you should install NFS. | ||
179 | <note>To boot QEMU images using our userspace NFS server, you need | ||
180 | to be running <filename>portmap</filename> or <filename>rpcbind</filename>. | ||
181 | If you are running <filename>rpcbind</filename>, you will also need to add the | ||
182 | <filename>-i</filename> option when <filename>rpcbind</filename> starts up. | ||
183 | Please make sure you understand the security implications of doing this. | ||
184 | You might also have to modify your firewall settings to allow | ||
185 | NFS booting to work.</note></para></listitem> | ||
186 | <listitem><para><filename>YOCTOADT_ROOTFS_<arch></filename>: The root | ||
187 | filesystem images you want to download from the | ||
188 | <filename>YOCTOADT_IPKG_REPO</filename> repository.</para></listitem> | ||
189 | <listitem><para><filename>YOCTOADT_TARGET_SYSROOT_IMAGE_<arch></filename>: The | ||
190 | particular root filesystem used to extract and create the target sysroot. | ||
191 | The value of this variable must have been specified with | ||
192 | <filename>YOCTOADT_ROOTFS_<arch></filename>. | ||
193 | For example, if you downloaded both <filename>minimal</filename> and | ||
194 | <filename>sato-sdk</filename> images by setting | ||
195 | <filename>YOCTOADT_ROOTFS_<arch></filename> | ||
196 | to "minimal sato-sdk", then <filename>YOCTOADT_ROOTFS_<arch></filename> | ||
197 | must be set to either "minimal" or "sato-sdk". | ||
198 | </para></listitem> | ||
199 | <listitem><para><filename>YOCTOADT_TARGET_SYSROOT_LOC_<arch></filename>: The | ||
200 | location on the development host where the target sysroot is created. | ||
201 | </para></listitem> | ||
202 | </itemizedlist> | ||
203 | </para> | ||
204 | |||
205 | <para> | ||
206 | After you have configured the <filename>adt_installer.conf</filename> file, | ||
207 | run the installer using the following command: | ||
208 | <literallayout class='monospaced'> | ||
209 | $ cd adt-installer | ||
210 | $ ./adt_installer | ||
211 | </literallayout> | ||
212 | Once the installer begins to run, you are asked to enter the | ||
213 | location for cross-toolchain installation. | ||
214 | The default location is | ||
215 | <filename>/opt/poky/<release></filename>. | ||
216 | After either accepting the default location or selecting your | ||
217 | own location, you are prompted to run the installation script | ||
218 | interactively or in silent mode. | ||
219 | If you want to closely monitor the installation, | ||
220 | choose “I” for interactive mode rather than “S” for silent mode. | ||
221 | Follow the prompts from the script to complete the installation. | ||
222 | </para> | ||
223 | |||
224 | <para> | ||
225 | Once the installation completes, the ADT, which includes the | ||
226 | cross-toolchain, is installed in the selected installation | ||
227 | directory. | ||
228 | You will notice environment setup files for the cross-toolchain | ||
229 | in the installation directory, and image tarballs in the | ||
230 | <filename>adt-installer</filename> directory according to your | ||
231 | installer configurations, and the target sysroot located | ||
232 | according to the | ||
233 | <filename>YOCTOADT_TARGET_SYSROOT_LOC_<arch></filename> | ||
234 | variable also in your configuration file. | ||
235 | </para> | ||
236 | </section> | ||
237 | </section> | ||
238 | |||
239 | <section id='using-an-existing-toolchain-tarball'> | ||
240 | <title>Using a Cross-Toolchain Tarball</title> | ||
241 | |||
242 | <para> | ||
243 | If you want to simply install a cross-toolchain by hand, you can | ||
244 | do so by running the toolchain installer. | ||
245 | The installer includes the pre-built cross-toolchain, the | ||
246 | <filename>runqemu</filename> script, and support files. | ||
247 | If you use this method to install the cross-toolchain, you | ||
248 | might still need to install the target sysroot by installing and | ||
249 | extracting it separately. | ||
250 | For information on how to install the sysroot, see the | ||
251 | "<link linkend='extracting-the-root-filesystem'>Extracting the Root Filesystem</link>" section. | ||
252 | </para> | ||
253 | |||
254 | <para> | ||
255 | Follow these steps: | ||
256 | <orderedlist> | ||
257 | <listitem><para><emphasis>Get your toolchain installer using one of the following methods:</emphasis> | ||
258 | <itemizedlist> | ||
259 | <listitem><para>Go to | ||
260 | <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'></ulink> | ||
261 | and find the folder that matches your host | ||
262 | development system (i.e. <filename>i686</filename> | ||
263 | for 32-bit machines or <filename>x86_64</filename> | ||
264 | for 64-bit machines).</para> | ||
265 | <para>Go into that folder and download the toolchain | ||
266 | installer whose name includes the appropriate target | ||
267 | architecture. | ||
268 | The toolchains provided by the Yocto Project | ||
269 | are based off of the | ||
270 | <filename>core-image-sato</filename> image and | ||
271 | contain libraries appropriate for developing | ||
272 | against that image. | ||
273 | For example, if your host development system is a | ||
274 | 64-bit x86 system and you are going to use | ||
275 | your cross-toolchain for a 32-bit x86 | ||
276 | target, go into the <filename>x86_64</filename> | ||
277 | folder and download the following installer: | ||
278 | <literallayout class='monospaced'> | ||
279 | poky-eglibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh | ||
280 | </literallayout></para></listitem> | ||
281 | <listitem><para>Build your own toolchain installer. | ||
282 | For cases where you cannot use an installer | ||
283 | from the download area, you can build your own as | ||
284 | described in the | ||
285 | "<link linkend='optionally-building-a-toolchain-installer'>Optionally Building a Toolchain Installer</link>" | ||
286 | section.</para></listitem> | ||
287 | </itemizedlist></para></listitem> | ||
288 | <listitem><para><emphasis>Once you have the installer, run it to install the toolchain:</emphasis> | ||
289 | <note> | ||
290 | You must change the permissions on the toolchain | ||
291 | installer script so that it is executable. | ||
292 | </note></para> | ||
293 | <para>The following command shows how to run the installer | ||
294 | given a toolchain tarball for a 64-bit x86 development host | ||
295 | system and a 32-bit x86 target architecture. | ||
296 | The example assumes the toolchain installer is located | ||
297 | in <filename>~/Downloads/</filename>. | ||
298 | <literallayout class='monospaced'> | ||
299 | $ ~/Downloads/poky-eglibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh | ||
300 | </literallayout> | ||
301 | The first thing the installer prompts you for is the | ||
302 | directory into which you want to install the toolchain. | ||
303 | The default directory used is | ||
304 | <filename>/opt/poky/&DISTRO;</filename>. | ||
305 | If you do not have write permissions for the directory | ||
306 | into which you are installing the toolchain, the | ||
307 | toolchain installer notifies you and exits. | ||
308 | Be sure you have write permissions in the directory and | ||
309 | run the installer again.</para> | ||
310 | <para>When the script finishes, the cross-toolchain is | ||
311 | installed. | ||
312 | You will notice environment setup files for the | ||
313 | cross-toolchain in the installation directory. | ||
314 | </para></listitem> | ||
315 | </orderedlist> | ||
316 | </para> | ||
317 | </section> | ||
318 | |||
319 | <section id='using-the-toolchain-from-within-the-build-tree'> | ||
320 | <title>Using BitBake and the Build Directory</title> | ||
321 | |||
322 | <para> | ||
323 | A final way of making the cross-toolchain available is to use BitBake | ||
324 | to generate the toolchain within an existing | ||
325 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
326 | This method does not install the toolchain into the default | ||
327 | <filename>/opt</filename> directory. | ||
328 | As with the previous method, if you need to install the target sysroot, you must | ||
329 | do that separately as well. | ||
330 | </para> | ||
331 | |||
332 | <para> | ||
333 | Follow these steps to generate the toolchain into the Build Directory: | ||
334 | <orderedlist> | ||
335 | <listitem><para><emphasis>Set up the Build Environment:</emphasis> | ||
336 | Source the OpenEmbedded build environment setup | ||
337 | script (i.e. | ||
338 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> | ||
339 | or | ||
340 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>) | ||
341 | located in the | ||
342 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
343 | </para></listitem> | ||
344 | <listitem><para><emphasis>Check your Local Configuration File:</emphasis> | ||
345 | At this point, you should be sure that the | ||
346 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> variable | ||
347 | in the <filename>local.conf</filename> file found in the | ||
348 | <filename>conf</filename> directory of the Build Directory | ||
349 | is set for the target architecture. | ||
350 | Comments within the <filename>local.conf</filename> file | ||
351 | list the values you can use for the | ||
352 | <filename>MACHINE</filename> variable. | ||
353 | <note> | ||
354 | You can populate the Build Directory with the | ||
355 | cross-toolchains for more than a single architecture. | ||
356 | You just need to edit the <filename>MACHINE</filename> | ||
357 | variable in the <filename>local.conf</filename> file and | ||
358 | re-run the <filename>bitbake</filename> command. | ||
359 | </note></para></listitem> | ||
360 | <listitem><para><emphasis>Generate the Cross-Toolchain:</emphasis> | ||
361 | Run <filename>bitbake meta-ide-support</filename> to | ||
362 | complete the cross-toolchain generation. | ||
363 | Once the <filename>bitbake</filename> command finishes, | ||
364 | the cross-toolchain is | ||
365 | generated and populated within the Build Directory. | ||
366 | You will notice environment setup files for the | ||
367 | cross-toolchain that contain the string | ||
368 | "<filename>environment-setup</filename>" in the | ||
369 | Build Directory's <filename>tmp</filename> folder.</para> | ||
370 | <para>Be aware that when you use this method to install the | ||
371 | toolchain, you still need to separately extract and install | ||
372 | the sysroot filesystem. | ||
373 | For information on how to do this, see the | ||
374 | "<link linkend='extracting-the-root-filesystem'>Extracting the Root Filesystem</link>" section. | ||
375 | </para></listitem> | ||
376 | </orderedlist> | ||
377 | </para> | ||
378 | </section> | ||
379 | </section> | ||
380 | |||
381 | <section id='setting-up-the-cross-development-environment'> | ||
382 | <title>Setting Up the Cross-Development Environment</title> | ||
383 | |||
384 | <para> | ||
385 | Before you can develop using the cross-toolchain, you need to set up the | ||
386 | cross-development environment by sourcing the toolchain's environment setup script. | ||
387 | If you used the ADT Installer or hand-installed cross-toolchain, | ||
388 | then you can find this script in the directory you chose for installation. | ||
389 | For this release, the default installation directory is | ||
390 | <filename>&YOCTO_ADTPATH_DIR;</filename>. | ||
391 | If you installed the toolchain in the | ||
392 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>, | ||
393 | you can find the environment setup | ||
394 | script for the toolchain in the Build Directory's <filename>tmp</filename> directory. | ||
395 | </para> | ||
396 | |||
397 | <para> | ||
398 | Be sure to run the environment setup script that matches the | ||
399 | architecture for which you are developing. | ||
400 | Environment setup scripts begin with the string | ||
401 | "<filename>environment-setup</filename>" and include as part of their | ||
402 | name the architecture. | ||
403 | For example, the toolchain environment setup script for a 64-bit | ||
404 | IA-based architecture installed in the default installation directory | ||
405 | would be the following: | ||
406 | <literallayout class='monospaced'> | ||
407 | &YOCTO_ADTPATH_DIR;/environment-setup-x86_64-poky-linux | ||
408 | </literallayout> | ||
409 | </para> | ||
410 | </section> | ||
411 | |||
412 | <section id='securing-kernel-and-filesystem-images'> | ||
413 | <title>Securing Kernel and Filesystem Images</title> | ||
414 | |||
415 | <para> | ||
416 | You will need to have a kernel and filesystem image to boot using your | ||
417 | hardware or the QEMU emulator. | ||
418 | Furthermore, if you plan on booting your image using NFS or you want to use the root filesystem | ||
419 | as the target sysroot, you need to extract the root filesystem. | ||
420 | </para> | ||
421 | |||
422 | <section id='getting-the-images'> | ||
423 | <title>Getting the Images</title> | ||
424 | |||
425 | <para> | ||
426 | To get the kernel and filesystem images, you either have to build them or download | ||
427 | pre-built versions. | ||
428 | You can find examples for both these situations in the | ||
429 | "<ulink url='&YOCTO_DOCS_QS_URL;#test-run'>A Quick Test Run</ulink>" section of | ||
430 | the Yocto Project Quick Start. | ||
431 | </para> | ||
432 | |||
433 | <para> | ||
434 | The Yocto Project ships basic kernel and filesystem images for several | ||
435 | architectures (<filename>x86</filename>, <filename>x86-64</filename>, | ||
436 | <filename>mips</filename>, <filename>powerpc</filename>, and <filename>arm</filename>) | ||
437 | that you can use unaltered in the QEMU emulator. | ||
438 | These kernel images reside in the release | ||
439 | area - <ulink url='&YOCTO_MACHINES_DL_URL;'></ulink> | ||
440 | and are ideal for experimentation using Yocto Project. | ||
441 | For information on the image types you can build using the OpenEmbedded build system, | ||
442 | see the | ||
443 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" chapter in | ||
444 | the Yocto Project Reference Manual. | ||
445 | </para> | ||
446 | |||
447 | <para> | ||
448 | If you are planning on developing against your image and you are not | ||
449 | building or using one of the Yocto Project development images | ||
450 | (e.g. <filename>core-image-*-dev</filename>), you must be sure to | ||
451 | include the development packages as part of your image recipe. | ||
452 | </para> | ||
453 | |||
454 | <para> | ||
455 | Furthermore, if you plan on remotely deploying and debugging your | ||
456 | application from within the | ||
457 | Eclipse IDE, you must have an image that contains the Yocto Target Communication | ||
458 | Framework (TCF) agent (<filename>tcf-agent</filename>). | ||
459 | By default, the Yocto Project provides only one type of pre-built | ||
460 | image that contains the <filename>tcf-agent</filename>. | ||
461 | And, those images are SDK (e.g.<filename>core-image-sato-sdk</filename>). | ||
462 | </para> | ||
463 | |||
464 | <para> | ||
465 | If you want to use a different image type that contains the <filename>tcf-agent</filename>, | ||
466 | you can do so one of two ways: | ||
467 | <itemizedlist> | ||
468 | <listitem><para>Modify the <filename>conf/local.conf</filename> configuration in | ||
469 | the <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
470 | and then rebuild the image. | ||
471 | With this method, you need to modify the | ||
472 | <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink> | ||
473 | variable to have the value of "tools-debug" before rebuilding the image. | ||
474 | Once the image is rebuilt, the <filename>tcf-agent</filename> will be included | ||
475 | in the image and is launched automatically after the boot.</para></listitem> | ||
476 | <listitem><para>Manually build the <filename>tcf-agent</filename>. | ||
477 | To build the agent, follow these steps: | ||
478 | <orderedlist> | ||
479 | <listitem><para>Be sure the ADT is installed as described in the | ||
480 | "<link linkend='installing-the-adt'>Installing the ADT and Toolchains</link>" section. | ||
481 | </para></listitem> | ||
482 | <listitem><para>Set up the cross-development environment as described in the | ||
483 | "<link linkend='setting-up-the-cross-development-environment'>Setting | ||
484 | Up the Cross-Development Environment</link>" section.</para></listitem> | ||
485 | <listitem><para>Get the <filename>tcf-agent</filename> source code using | ||
486 | the following commands: | ||
487 | <literallayout class='monospaced'> | ||
488 | $ git clone http://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git | ||
489 | $ cd org.eclipse.tcf.agent/agent | ||
490 | </literallayout></para></listitem> | ||
491 | <listitem><para>Locate the | ||
492 | <filename>Makefile.inc</filename> file inside the | ||
493 | <filename>agent</filename> folder and modify it | ||
494 | for the cross-compilation environment by setting the | ||
495 | <filename>OPSYS</filename> and | ||
496 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> | ||
497 | variables according to your target. | ||
498 | </para></listitem> | ||
499 | <listitem><para>Use the cross-development tools to build the | ||
500 | <filename>tcf-agent</filename>. | ||
501 | Before you "Make" the file, be sure your cross-tools are set up first. | ||
502 | See the "<link linkend='makefile-based-projects'>Makefile-Based Projects</link>" | ||
503 | section for information on how to make sure the cross-tools are set up | ||
504 | correctly.</para> | ||
505 | <para>If the build is successful, the <filename>tcf-agent</filename> output will | ||
506 | be <filename>obj/$(OPSYS)/$(MACHINE)/Debug/agent</filename>.</para></listitem> | ||
507 | <listitem><para>Deploy the agent into the image's root filesystem.</para></listitem> | ||
508 | </orderedlist> | ||
509 | </para></listitem> | ||
510 | </itemizedlist> | ||
511 | </para> | ||
512 | </section> | ||
513 | |||
514 | <section id='extracting-the-root-filesystem'> | ||
515 | <title>Extracting the Root Filesystem</title> | ||
516 | |||
517 | <para> | ||
518 | If you install your toolchain by hand or build it using BitBake and | ||
519 | you need a root filesystem, you need to extract it separately. | ||
520 | If you use the ADT Installer to install the ADT, the root | ||
521 | filesystem is automatically extracted and installed. | ||
522 | </para> | ||
523 | |||
524 | <para> | ||
525 | Here are some cases where you need to extract the root filesystem: | ||
526 | <itemizedlist> | ||
527 | <listitem><para>You want to boot the image using NFS. | ||
528 | </para></listitem> | ||
529 | <listitem><para>You want to use the root filesystem as the | ||
530 | target sysroot. | ||
531 | For example, the Eclipse IDE environment with the Eclipse | ||
532 | Yocto Plug-in installed allows you to use QEMU to boot | ||
533 | under NFS.</para></listitem> | ||
534 | <listitem><para>You want to develop your target application | ||
535 | using the root filesystem as the target sysroot. | ||
536 | </para></listitem> | ||
537 | </itemizedlist> | ||
538 | </para> | ||
539 | |||
540 | <para> | ||
541 | To extract the root filesystem, first <filename>source</filename> | ||
542 | the cross-development environment setup script. | ||
543 | If you built the toolchain in the Build Directory, you will find | ||
544 | the toolchain environment script in the | ||
545 | <filename>tmp</filename> directory. | ||
546 | If you installed the toolchain by hand, the environment setup | ||
547 | script is located in <filename>/opt/poky/&DISTRO;</filename>. | ||
548 | </para> | ||
549 | |||
550 | <para> | ||
551 | After sourcing the environment script, use the | ||
552 | <filename>runqemu-extract-sdk</filename> command and provide the | ||
553 | filesystem image. | ||
554 | </para> | ||
555 | |||
556 | <para> | ||
557 | Following is an example. | ||
558 | The second command sets up the environment. | ||
559 | In this case, the setup script is located in the | ||
560 | <filename>/opt/poky/&DISTRO;</filename> directory. | ||
561 | The third command extracts the root filesystem from a previously | ||
562 | built filesystem that is located in the | ||
563 | <filename>~/Downloads</filename> directory. | ||
564 | Furthermore, this command extracts the root filesystem into the | ||
565 | <filename>qemux86-sato</filename> directory: | ||
566 | <literallayout class='monospaced'> | ||
567 | $ cd ~ | ||
568 | $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux | ||
569 | $ runqemu-extract-sdk \ | ||
570 | ~/Downloads/core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2 \ | ||
571 | $HOME/qemux86-sato | ||
572 | </literallayout> | ||
573 | You could now point to the target sysroot at | ||
574 | <filename>qemux86-sato</filename>. | ||
575 | </para> | ||
576 | </section> | ||
577 | </section> | ||
578 | |||
579 | <section id='optionally-building-a-toolchain-installer'> | ||
580 | <title>Optionally Building a Toolchain Installer</title> | ||
581 | |||
582 | <para> | ||
583 | As an alternative to locating and downloading a toolchain installer, | ||
584 | you can build the toolchain installer one of two ways if you have a | ||
585 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>: | ||
586 | <itemizedlist> | ||
587 | <listitem><para> | ||
588 | Use <filename>bitbake meta-toolchain</filename>. | ||
589 | This method requires you to still install the target | ||
590 | sysroot by installing and extracting it separately. | ||
591 | For information on how to install the sysroot, see the | ||
592 | "<link linkend='extracting-the-root-filesystem'>Extracting the Root Filesystem</link>" | ||
593 | section. | ||
594 | </para></listitem> | ||
595 | <listitem><para> | ||
596 | Use <filename>bitbake <image> -c populate_sdk</filename>. | ||
597 | This method has significant advantages over the previous method | ||
598 | because it results in a toolchain installer that contains the | ||
599 | sysroot that matches your target root filesystem. | ||
600 | </para> | ||
601 | |||
602 | <para>Another powerful feature is that the toolchain is | ||
603 | completely self-contained. | ||
604 | The binaries are linked against their own copy of | ||
605 | <filename>libc</filename>, which results in no dependencies | ||
606 | on the target system. | ||
607 | To achieve this, the pointer to the dynamic loader is | ||
608 | configured at install time since that path cannot be dynamically | ||
609 | altered. | ||
610 | This is the reason for a wrapper around the | ||
611 | <filename>populate_sdk</filename> archive.</para> | ||
612 | |||
613 | <para>Another feature is that only one set of cross-canadian | ||
614 | toolchain binaries are produced per architecture. | ||
615 | This feature takes advantage of the fact that the target | ||
616 | hardware can be passed to <filename>gcc</filename> as a set of | ||
617 | compiler options. | ||
618 | Those options are set up by the environment script and | ||
619 | contained in variables like CC and LD. | ||
620 | This reduces the space needed for the tools. | ||
621 | Understand, however, that a sysroot is still needed for every | ||
622 | target since those binaries are target-specific. | ||
623 | </para></listitem> | ||
624 | </itemizedlist> | ||
625 | </para> | ||
626 | |||
627 | <para> | ||
628 | Remember, before using any BitBake command, you | ||
629 | must source the build environment setup script | ||
630 | (i.e. | ||
631 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> | ||
632 | or | ||
633 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>) | ||
634 | located in the Source Directory and you must make sure your | ||
635 | <filename>conf/local.conf</filename> variables are correct. | ||
636 | In particular, you need to be sure the | ||
637 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> | ||
638 | variable matches the architecture for which you are building and that | ||
639 | the | ||
640 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink> | ||
641 | variable is correctly set if you are building a toolchain designed to | ||
642 | run on an architecture that differs from your current development host | ||
643 | machine (i.e. the build machine). | ||
644 | </para> | ||
645 | |||
646 | <para> | ||
647 | When the <filename>bitbake</filename> command completes, the toolchain | ||
648 | installer will be in | ||
649 | <filename>tmp/deploy/sdk</filename> in the Build Directory. | ||
650 | <note> | ||
651 | By default, this toolchain does not build static binaries. | ||
652 | If you want to use the toolchain to build these types of libraries, | ||
653 | you need to be sure your image has the appropriate static | ||
654 | development libraries. | ||
655 | Use the | ||
656 | <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink> | ||
657 | variable inside your <filename>local.conf</filename> file to | ||
658 | install the appropriate library packages. | ||
659 | Following is an example using <filename>eglibc</filename> static | ||
660 | development libraries: | ||
661 | <literallayout class='monospaced'> | ||
662 | IMAGE_INSTALL_append = " eglibc-staticdev" | ||
663 | </literallayout> | ||
664 | </note> | ||
665 | </para> | ||
666 | </section> | ||
667 | |||
668 | </chapter> | ||
669 | <!-- | ||
670 | vim: expandtab tw=80 ts=4 | ||
671 | --> | ||
diff --git a/documentation/adt-manual/adt-style.css b/documentation/adt-manual/adt-style.css new file mode 100644 index 0000000..d722ad4 --- /dev/null +++ b/documentation/adt-manual/adt-style.css | |||
@@ -0,0 +1,984 @@ | |||
1 | /* | ||
2 | Generic XHTML / DocBook XHTML CSS Stylesheet. | ||
3 | |||
4 | Browser wrangling and typographic design by | ||
5 | Oyvind Kolas / pippin@gimp.org | ||
6 | |||
7 | Customised for Poky by | ||
8 | Matthew Allum / mallum@o-hand.com | ||
9 | |||
10 | Thanks to: | ||
11 | Liam R. E. Quin | ||
12 | William Skaggs | ||
13 | Jakub Steiner | ||
14 | |||
15 | Structure | ||
16 | --------- | ||
17 | |||
18 | The stylesheet is divided into the following sections: | ||
19 | |||
20 | Positioning | ||
21 | Margins, paddings, width, font-size, clearing. | ||
22 | Decorations | ||
23 | Borders, style | ||
24 | Colors | ||
25 | Colors | ||
26 | Graphics | ||
27 | Graphical backgrounds | ||
28 | Nasty IE tweaks | ||
29 | Workarounds needed to make it work in internet explorer, | ||
30 | currently makes the stylesheet non validating, but up until | ||
31 | this point it is validating. | ||
32 | Mozilla extensions | ||
33 | Transparency for footer | ||
34 | Rounded corners on boxes | ||
35 | |||
36 | */ | ||
37 | |||
38 | |||
39 | /*************** / | ||
40 | / Positioning / | ||
41 | / ***************/ | ||
42 | |||
43 | body { | ||
44 | font-family: Verdana, Sans, sans-serif; | ||
45 | |||
46 | min-width: 640px; | ||
47 | width: 80%; | ||
48 | margin: 0em auto; | ||
49 | padding: 2em 5em 5em 5em; | ||
50 | color: #333; | ||
51 | } | ||
52 | |||
53 | h1,h2,h3,h4,h5,h6,h7 { | ||
54 | font-family: Arial, Sans; | ||
55 | color: #00557D; | ||
56 | clear: both; | ||
57 | } | ||
58 | |||
59 | h1 { | ||
60 | font-size: 2em; | ||
61 | text-align: left; | ||
62 | padding: 0em 0em 0em 0em; | ||
63 | margin: 2em 0em 0em 0em; | ||
64 | } | ||
65 | |||
66 | h2.subtitle { | ||
67 | margin: 0.10em 0em 3.0em 0em; | ||
68 | padding: 0em 0em 0em 0em; | ||
69 | font-size: 1.8em; | ||
70 | padding-left: 20%; | ||
71 | font-weight: normal; | ||
72 | font-style: italic; | ||
73 | } | ||
74 | |||
75 | h2 { | ||
76 | margin: 2em 0em 0.66em 0em; | ||
77 | padding: 0.5em 0em 0em 0em; | ||
78 | font-size: 1.5em; | ||
79 | font-weight: bold; | ||
80 | } | ||
81 | |||
82 | h3.subtitle { | ||
83 | margin: 0em 0em 1em 0em; | ||
84 | padding: 0em 0em 0em 0em; | ||
85 | font-size: 142.14%; | ||
86 | text-align: right; | ||
87 | } | ||
88 | |||
89 | h3 { | ||
90 | margin: 1em 0em 0.5em 0em; | ||
91 | padding: 1em 0em 0em 0em; | ||
92 | font-size: 140%; | ||
93 | font-weight: bold; | ||
94 | } | ||
95 | |||
96 | h4 { | ||
97 | margin: 1em 0em 0.5em 0em; | ||
98 | padding: 1em 0em 0em 0em; | ||
99 | font-size: 120%; | ||
100 | font-weight: bold; | ||
101 | } | ||
102 | |||
103 | h5 { | ||
104 | margin: 1em 0em 0.5em 0em; | ||
105 | padding: 1em 0em 0em 0em; | ||
106 | font-size: 110%; | ||
107 | font-weight: bold; | ||
108 | } | ||
109 | |||
110 | h6 { | ||
111 | margin: 1em 0em 0em 0em; | ||
112 | padding: 1em 0em 0em 0em; | ||
113 | font-size: 110%; | ||
114 | font-weight: bold; | ||
115 | } | ||
116 | |||
117 | .authorgroup { | ||
118 | background-color: transparent; | ||
119 | background-repeat: no-repeat; | ||
120 | padding-top: 256px; | ||
121 | background-image: url("figures/adt-title.png"); | ||
122 | background-position: left top; | ||
123 | margin-top: -256px; | ||
124 | padding-right: 50px; | ||
125 | margin-left: 0px; | ||
126 | text-align: right; | ||
127 | width: 740px; | ||
128 | } | ||
129 | |||
130 | h3.author { | ||
131 | margin: 0em 0me 0em 0em; | ||
132 | padding: 0em 0em 0em 0em; | ||
133 | font-weight: normal; | ||
134 | font-size: 100%; | ||
135 | color: #333; | ||
136 | clear: both; | ||
137 | } | ||
138 | |||
139 | .author tt.email { | ||
140 | font-size: 66%; | ||
141 | } | ||
142 | |||
143 | .titlepage hr { | ||
144 | width: 0em; | ||
145 | clear: both; | ||
146 | } | ||
147 | |||
148 | .revhistory { | ||
149 | padding-top: 2em; | ||
150 | clear: both; | ||
151 | } | ||
152 | |||
153 | .toc, | ||
154 | .list-of-tables, | ||
155 | .list-of-examples, | ||
156 | .list-of-figures { | ||
157 | padding: 1.33em 0em 2.5em 0em; | ||
158 | color: #00557D; | ||
159 | } | ||
160 | |||
161 | .toc p, | ||
162 | .list-of-tables p, | ||
163 | .list-of-figures p, | ||
164 | .list-of-examples p { | ||
165 | padding: 0em 0em 0em 0em; | ||
166 | padding: 0em 0em 0.3em; | ||
167 | margin: 1.5em 0em 0em 0em; | ||
168 | } | ||
169 | |||
170 | .toc p b, | ||
171 | .list-of-tables p b, | ||
172 | .list-of-figures p b, | ||
173 | .list-of-examples p b{ | ||
174 | font-size: 100.0%; | ||
175 | font-weight: bold; | ||
176 | } | ||
177 | |||
178 | .toc dl, | ||
179 | .list-of-tables dl, | ||
180 | .list-of-figures dl, | ||
181 | .list-of-examples dl { | ||
182 | margin: 0em 0em 0.5em 0em; | ||
183 | padding: 0em 0em 0em 0em; | ||
184 | } | ||
185 | |||
186 | .toc dt { | ||
187 | margin: 0em 0em 0em 0em; | ||
188 | padding: 0em 0em 0em 0em; | ||
189 | } | ||
190 | |||
191 | .toc dd { | ||
192 | margin: 0em 0em 0em 2.6em; | ||
193 | padding: 0em 0em 0em 0em; | ||
194 | } | ||
195 | |||
196 | div.glossary dl, | ||
197 | div.variablelist dl { | ||
198 | } | ||
199 | |||
200 | .glossary dl dt, | ||
201 | .variablelist dl dt, | ||
202 | .variablelist dl dt span.term { | ||
203 | font-weight: normal; | ||
204 | width: 20em; | ||
205 | text-align: right; | ||
206 | } | ||
207 | |||
208 | .variablelist dl dt { | ||
209 | margin-top: 0.5em; | ||
210 | } | ||
211 | |||
212 | .glossary dl dd, | ||
213 | .variablelist dl dd { | ||
214 | margin-top: -1em; | ||
215 | margin-left: 25.5em; | ||
216 | } | ||
217 | |||
218 | .glossary dd p, | ||
219 | .variablelist dd p { | ||
220 | margin-top: 0em; | ||
221 | margin-bottom: 1em; | ||
222 | } | ||
223 | |||
224 | |||
225 | div.calloutlist table td { | ||
226 | padding: 0em 0em 0em 0em; | ||
227 | margin: 0em 0em 0em 0em; | ||
228 | } | ||
229 | |||
230 | div.calloutlist table td p { | ||
231 | margin-top: 0em; | ||
232 | margin-bottom: 1em; | ||
233 | } | ||
234 | |||
235 | div p.copyright { | ||
236 | text-align: left; | ||
237 | } | ||
238 | |||
239 | div.legalnotice p.legalnotice-title { | ||
240 | margin-bottom: 0em; | ||
241 | } | ||
242 | |||
243 | p { | ||
244 | line-height: 1.5em; | ||
245 | margin-top: 0em; | ||
246 | |||
247 | } | ||
248 | |||
249 | dl { | ||
250 | padding-top: 0em; | ||
251 | } | ||
252 | |||
253 | hr { | ||
254 | border: solid 1px; | ||
255 | } | ||
256 | |||
257 | |||
258 | .mediaobject, | ||
259 | .mediaobjectco { | ||
260 | text-align: center; | ||
261 | } | ||
262 | |||
263 | img { | ||
264 | border: none; | ||
265 | } | ||
266 | |||
267 | ul { | ||
268 | padding: 0em 0em 0em 1.5em; | ||
269 | } | ||
270 | |||
271 | ul li { | ||
272 | padding: 0em 0em 0em 0em; | ||
273 | } | ||
274 | |||
275 | ul li p { | ||
276 | text-align: left; | ||
277 | } | ||
278 | |||
279 | table { | ||
280 | width :100%; | ||
281 | } | ||
282 | |||
283 | th { | ||
284 | padding: 0.25em; | ||
285 | text-align: left; | ||
286 | font-weight: normal; | ||
287 | vertical-align: top; | ||
288 | } | ||
289 | |||
290 | td { | ||
291 | padding: 0.25em; | ||
292 | vertical-align: top; | ||
293 | } | ||
294 | |||
295 | p a[id] { | ||
296 | margin: 0px; | ||
297 | padding: 0px; | ||
298 | display: inline; | ||
299 | background-image: none; | ||
300 | } | ||
301 | |||
302 | a { | ||
303 | text-decoration: underline; | ||
304 | color: #444; | ||
305 | } | ||
306 | |||
307 | pre { | ||
308 | overflow: auto; | ||
309 | } | ||
310 | |||
311 | a:hover { | ||
312 | text-decoration: underline; | ||
313 | /*font-weight: bold;*/ | ||
314 | } | ||
315 | |||
316 | /* This style defines how the permalink character | ||
317 | appears by itself and when hovered over with | ||
318 | the mouse. */ | ||
319 | |||
320 | [alt='Permalink'] { color: #eee; } | ||
321 | [alt='Permalink']:hover { color: black; } | ||
322 | |||
323 | |||
324 | div.informalfigure, | ||
325 | div.informalexample, | ||
326 | div.informaltable, | ||
327 | div.figure, | ||
328 | div.table, | ||
329 | div.example { | ||
330 | margin: 1em 0em; | ||
331 | padding: 1em; | ||
332 | page-break-inside: avoid; | ||
333 | } | ||
334 | |||
335 | |||
336 | div.informalfigure p.title b, | ||
337 | div.informalexample p.title b, | ||
338 | div.informaltable p.title b, | ||
339 | div.figure p.title b, | ||
340 | div.example p.title b, | ||
341 | div.table p.title b{ | ||
342 | padding-top: 0em; | ||
343 | margin-top: 0em; | ||
344 | font-size: 100%; | ||
345 | font-weight: normal; | ||
346 | } | ||
347 | |||
348 | .mediaobject .caption, | ||
349 | .mediaobject .caption p { | ||
350 | text-align: center; | ||
351 | font-size: 80%; | ||
352 | padding-top: 0.5em; | ||
353 | padding-bottom: 0.5em; | ||
354 | } | ||
355 | |||
356 | .epigraph { | ||
357 | padding-left: 55%; | ||
358 | margin-bottom: 1em; | ||
359 | } | ||
360 | |||
361 | .epigraph p { | ||
362 | text-align: left; | ||
363 | } | ||
364 | |||
365 | .epigraph .quote { | ||
366 | font-style: italic; | ||
367 | } | ||
368 | .epigraph .attribution { | ||
369 | font-style: normal; | ||
370 | text-align: right; | ||
371 | } | ||
372 | |||
373 | span.application { | ||
374 | font-style: italic; | ||
375 | } | ||
376 | |||
377 | .programlisting { | ||
378 | font-family: monospace; | ||
379 | font-size: 80%; | ||
380 | white-space: pre; | ||
381 | margin: 1.33em 0em; | ||
382 | padding: 1.33em; | ||
383 | } | ||
384 | |||
385 | .tip, | ||
386 | .warning, | ||
387 | .caution, | ||
388 | .note { | ||
389 | margin-top: 1em; | ||
390 | margin-bottom: 1em; | ||
391 | |||
392 | } | ||
393 | |||
394 | /* force full width of table within div */ | ||
395 | .tip table, | ||
396 | .warning table, | ||
397 | .caution table, | ||
398 | .note table { | ||
399 | border: none; | ||
400 | width: 100%; | ||
401 | } | ||
402 | |||
403 | |||
404 | .tip table th, | ||
405 | .warning table th, | ||
406 | .caution table th, | ||
407 | .note table th { | ||
408 | padding: 0.8em 0.0em 0.0em 0.0em; | ||
409 | margin : 0em 0em 0em 0em; | ||
410 | } | ||
411 | |||
412 | .tip p, | ||
413 | .warning p, | ||
414 | .caution p, | ||
415 | .note p { | ||
416 | margin-top: 0.5em; | ||
417 | margin-bottom: 0.5em; | ||
418 | padding-right: 1em; | ||
419 | text-align: left; | ||
420 | } | ||
421 | |||
422 | .acronym { | ||
423 | text-transform: uppercase; | ||
424 | } | ||
425 | |||
426 | b.keycap, | ||
427 | .keycap { | ||
428 | padding: 0.09em 0.3em; | ||
429 | margin: 0em; | ||
430 | } | ||
431 | |||
432 | .itemizedlist li { | ||
433 | clear: none; | ||
434 | } | ||
435 | |||
436 | .filename { | ||
437 | font-size: medium; | ||
438 | font-family: Courier, monospace; | ||
439 | } | ||
440 | |||
441 | |||
442 | div.navheader, div.heading{ | ||
443 | position: absolute; | ||
444 | left: 0em; | ||
445 | top: 0em; | ||
446 | width: 100%; | ||
447 | background-color: #cdf; | ||
448 | width: 100%; | ||
449 | } | ||
450 | |||
451 | div.navfooter, div.footing{ | ||
452 | position: fixed; | ||
453 | left: 0em; | ||
454 | bottom: 0em; | ||
455 | background-color: #eee; | ||
456 | width: 100%; | ||
457 | } | ||
458 | |||
459 | |||
460 | div.navheader td, | ||
461 | div.navfooter td { | ||
462 | font-size: 66%; | ||
463 | } | ||
464 | |||
465 | div.navheader table th { | ||
466 | /*font-family: Georgia, Times, serif;*/ | ||
467 | /*font-size: x-large;*/ | ||
468 | font-size: 80%; | ||
469 | } | ||
470 | |||
471 | div.navheader table { | ||
472 | border-left: 0em; | ||
473 | border-right: 0em; | ||
474 | border-top: 0em; | ||
475 | width: 100%; | ||
476 | } | ||
477 | |||
478 | div.navfooter table { | ||
479 | border-left: 0em; | ||
480 | border-right: 0em; | ||
481 | border-bottom: 0em; | ||
482 | width: 100%; | ||
483 | } | ||
484 | |||
485 | div.navheader table td a, | ||
486 | div.navfooter table td a { | ||
487 | color: #777; | ||
488 | text-decoration: none; | ||
489 | } | ||
490 | |||
491 | /* normal text in the footer */ | ||
492 | div.navfooter table td { | ||
493 | color: black; | ||
494 | } | ||
495 | |||
496 | div.navheader table td a:visited, | ||
497 | div.navfooter table td a:visited { | ||
498 | color: #444; | ||
499 | } | ||
500 | |||
501 | |||
502 | /* links in header and footer */ | ||
503 | div.navheader table td a:hover, | ||
504 | div.navfooter table td a:hover { | ||
505 | text-decoration: underline; | ||
506 | background-color: transparent; | ||
507 | color: #33a; | ||
508 | } | ||
509 | |||
510 | div.navheader hr, | ||
511 | div.navfooter hr { | ||
512 | display: none; | ||
513 | } | ||
514 | |||
515 | |||
516 | .qandaset tr.question td p { | ||
517 | margin: 0em 0em 1em 0em; | ||
518 | padding: 0em 0em 0em 0em; | ||
519 | } | ||
520 | |||
521 | .qandaset tr.answer td p { | ||
522 | margin: 0em 0em 1em 0em; | ||
523 | padding: 0em 0em 0em 0em; | ||
524 | } | ||
525 | .answer td { | ||
526 | padding-bottom: 1.5em; | ||
527 | } | ||
528 | |||
529 | .emphasis { | ||
530 | font-weight: bold; | ||
531 | } | ||
532 | |||
533 | |||
534 | /************* / | ||
535 | / decorations / | ||
536 | / *************/ | ||
537 | |||
538 | .titlepage { | ||
539 | } | ||
540 | |||
541 | .part .title { | ||
542 | } | ||
543 | |||
544 | .subtitle { | ||
545 | border: none; | ||
546 | } | ||
547 | |||
548 | /* | ||
549 | h1 { | ||
550 | border: none; | ||
551 | } | ||
552 | |||
553 | h2 { | ||
554 | border-top: solid 0.2em; | ||
555 | border-bottom: solid 0.06em; | ||
556 | } | ||
557 | |||
558 | h3 { | ||
559 | border-top: 0em; | ||
560 | border-bottom: solid 0.06em; | ||
561 | } | ||
562 | |||
563 | h4 { | ||
564 | border: 0em; | ||
565 | border-bottom: solid 0.06em; | ||
566 | } | ||
567 | |||
568 | h5 { | ||
569 | border: 0em; | ||
570 | } | ||
571 | */ | ||
572 | |||
573 | .programlisting { | ||
574 | border: solid 1px; | ||
575 | } | ||
576 | |||
577 | div.figure, | ||
578 | div.table, | ||
579 | div.informalfigure, | ||
580 | div.informaltable, | ||
581 | div.informalexample, | ||
582 | div.example { | ||
583 | border: 1px solid; | ||
584 | } | ||
585 | |||
586 | |||
587 | |||
588 | .tip, | ||
589 | .warning, | ||
590 | .caution, | ||
591 | .note { | ||
592 | border: 1px solid; | ||
593 | } | ||
594 | |||
595 | .tip table th, | ||
596 | .warning table th, | ||
597 | .caution table th, | ||
598 | .note table th { | ||
599 | border-bottom: 1px solid; | ||
600 | } | ||
601 | |||
602 | .question td { | ||
603 | border-top: 1px solid black; | ||
604 | } | ||
605 | |||
606 | .answer { | ||
607 | } | ||
608 | |||
609 | |||
610 | b.keycap, | ||
611 | .keycap { | ||
612 | border: 1px solid; | ||
613 | } | ||
614 | |||
615 | |||
616 | div.navheader, div.heading{ | ||
617 | border-bottom: 1px solid; | ||
618 | } | ||
619 | |||
620 | |||
621 | div.navfooter, div.footing{ | ||
622 | border-top: 1px solid; | ||
623 | } | ||
624 | |||
625 | /********* / | ||
626 | / colors / | ||
627 | / *********/ | ||
628 | |||
629 | body { | ||
630 | color: #333; | ||
631 | background: white; | ||
632 | } | ||
633 | |||
634 | a { | ||
635 | background: transparent; | ||
636 | } | ||
637 | |||
638 | a:hover { | ||
639 | background-color: #dedede; | ||
640 | } | ||
641 | |||
642 | |||
643 | h1, | ||
644 | h2, | ||
645 | h3, | ||
646 | h4, | ||
647 | h5, | ||
648 | h6, | ||
649 | h7, | ||
650 | h8 { | ||
651 | background-color: transparent; | ||
652 | } | ||
653 | |||
654 | hr { | ||
655 | border-color: #aaa; | ||
656 | } | ||
657 | |||
658 | |||
659 | .tip, .warning, .caution, .note { | ||
660 | border-color: #fff; | ||
661 | } | ||
662 | |||
663 | |||
664 | .tip table th, | ||
665 | .warning table th, | ||
666 | .caution table th, | ||
667 | .note table th { | ||
668 | border-bottom-color: #fff; | ||
669 | } | ||
670 | |||
671 | |||
672 | .warning { | ||
673 | background-color: #f0f0f2; | ||
674 | } | ||
675 | |||
676 | .caution { | ||
677 | background-color: #f0f0f2; | ||
678 | } | ||
679 | |||
680 | .tip { | ||
681 | background-color: #f0f0f2; | ||
682 | } | ||
683 | |||
684 | .note { | ||
685 | background-color: #f0f0f2; | ||
686 | } | ||
687 | |||
688 | .glossary dl dt, | ||
689 | .variablelist dl dt, | ||
690 | .variablelist dl dt span.term { | ||
691 | color: #044; | ||
692 | } | ||
693 | |||
694 | div.figure, | ||
695 | div.table, | ||
696 | div.example, | ||
697 | div.informalfigure, | ||
698 | div.informaltable, | ||
699 | div.informalexample { | ||
700 | border-color: #aaa; | ||
701 | } | ||
702 | |||
703 | pre.programlisting { | ||
704 | color: black; | ||
705 | background-color: #fff; | ||
706 | border-color: #aaa; | ||
707 | border-width: 2px; | ||
708 | } | ||
709 | |||
710 | .guimenu, | ||
711 | .guilabel, | ||
712 | .guimenuitem { | ||
713 | background-color: #eee; | ||
714 | } | ||
715 | |||
716 | |||
717 | b.keycap, | ||
718 | .keycap { | ||
719 | background-color: #eee; | ||
720 | border-color: #999; | ||
721 | } | ||
722 | |||
723 | |||
724 | div.navheader { | ||
725 | border-color: black; | ||
726 | } | ||
727 | |||
728 | |||
729 | div.navfooter { | ||
730 | border-color: black; | ||
731 | } | ||
732 | |||
733 | |||
734 | /*********** / | ||
735 | / graphics / | ||
736 | / ***********/ | ||
737 | |||
738 | /* | ||
739 | body { | ||
740 | background-image: url("images/body_bg.jpg"); | ||
741 | background-attachment: fixed; | ||
742 | } | ||
743 | |||
744 | .navheader, | ||
745 | .note, | ||
746 | .tip { | ||
747 | background-image: url("images/note_bg.jpg"); | ||
748 | background-attachment: fixed; | ||
749 | } | ||
750 | |||
751 | .warning, | ||
752 | .caution { | ||
753 | background-image: url("images/warning_bg.jpg"); | ||
754 | background-attachment: fixed; | ||
755 | } | ||
756 | |||
757 | .figure, | ||
758 | .informalfigure, | ||
759 | .example, | ||
760 | .informalexample, | ||
761 | .table, | ||
762 | .informaltable { | ||
763 | background-image: url("images/figure_bg.jpg"); | ||
764 | background-attachment: fixed; | ||
765 | } | ||
766 | |||
767 | */ | ||
768 | h1, | ||
769 | h2, | ||
770 | h3, | ||
771 | h4, | ||
772 | h5, | ||
773 | h6, | ||
774 | h7{ | ||
775 | } | ||
776 | |||
777 | /* | ||
778 | Example of how to stick an image as part of the title. | ||
779 | |||
780 | div.article .titlepage .title | ||
781 | { | ||
782 | background-image: url("figures/white-on-black.png"); | ||
783 | background-position: center; | ||
784 | background-repeat: repeat-x; | ||
785 | } | ||
786 | */ | ||
787 | |||
788 | div.preface .titlepage .title, | ||
789 | div.colophon .title, | ||
790 | div.chapter .titlepage .title, | ||
791 | div.article .titlepage .title | ||
792 | { | ||
793 | } | ||
794 | |||
795 | div.section div.section .titlepage .title, | ||
796 | div.sect2 .titlepage .title { | ||
797 | background: none; | ||
798 | } | ||
799 | |||
800 | |||
801 | h1.title { | ||
802 | background-color: transparent; | ||
803 | background-repeat: no-repeat; | ||
804 | height: 256px; | ||
805 | text-indent: -9000px; | ||
806 | overflow:hidden; | ||
807 | } | ||
808 | |||
809 | h2.subtitle { | ||
810 | background-color: transparent; | ||
811 | text-indent: -9000px; | ||
812 | overflow:hidden; | ||
813 | width: 0px; | ||
814 | display: none; | ||
815 | } | ||
816 | |||
817 | /*************************************** / | ||
818 | / pippin.gimp.org specific alterations / | ||
819 | / ***************************************/ | ||
820 | |||
821 | /* | ||
822 | div.heading, div.navheader { | ||
823 | color: #777; | ||
824 | font-size: 80%; | ||
825 | padding: 0; | ||
826 | margin: 0; | ||
827 | text-align: left; | ||
828 | position: absolute; | ||
829 | top: 0px; | ||
830 | left: 0px; | ||
831 | width: 100%; | ||
832 | height: 50px; | ||
833 | background: url('/gfx/heading_bg.png') transparent; | ||
834 | background-repeat: repeat-x; | ||
835 | background-attachment: fixed; | ||
836 | border: none; | ||
837 | } | ||
838 | |||
839 | div.heading a { | ||
840 | color: #444; | ||
841 | } | ||
842 | |||
843 | div.footing, div.navfooter { | ||
844 | border: none; | ||
845 | color: #ddd; | ||
846 | font-size: 80%; | ||
847 | text-align:right; | ||
848 | |||
849 | width: 100%; | ||
850 | padding-top: 10px; | ||
851 | position: absolute; | ||
852 | bottom: 0px; | ||
853 | left: 0px; | ||
854 | |||
855 | background: url('/gfx/footing_bg.png') transparent; | ||
856 | } | ||
857 | */ | ||
858 | |||
859 | |||
860 | |||
861 | /****************** / | ||
862 | / nasty ie tweaks / | ||
863 | / ******************/ | ||
864 | |||
865 | /* | ||
866 | div.heading, div.navheader { | ||
867 | width:expression(document.body.clientWidth + "px"); | ||
868 | } | ||
869 | |||
870 | div.footing, div.navfooter { | ||
871 | width:expression(document.body.clientWidth + "px"); | ||
872 | margin-left:expression("-5em"); | ||
873 | } | ||
874 | body { | ||
875 | padding:expression("4em 5em 0em 5em"); | ||
876 | } | ||
877 | */ | ||
878 | |||
879 | /**************************************** / | ||
880 | / mozilla vendor specific css extensions / | ||
881 | / ****************************************/ | ||
882 | /* | ||
883 | div.navfooter, div.footing{ | ||
884 | -moz-opacity: 0.8em; | ||
885 | } | ||
886 | |||
887 | div.figure, | ||
888 | div.table, | ||
889 | div.informalfigure, | ||
890 | div.informaltable, | ||
891 | div.informalexample, | ||
892 | div.example, | ||
893 | .tip, | ||
894 | .warning, | ||
895 | .caution, | ||
896 | .note { | ||
897 | -moz-border-radius: 0.5em; | ||
898 | } | ||
899 | |||
900 | b.keycap, | ||
901 | .keycap { | ||
902 | -moz-border-radius: 0.3em; | ||
903 | } | ||
904 | */ | ||
905 | |||
906 | table tr td table tr td { | ||
907 | display: none; | ||
908 | } | ||
909 | |||
910 | |||
911 | hr { | ||
912 | display: none; | ||
913 | } | ||
914 | |||
915 | table { | ||
916 | border: 0em; | ||
917 | } | ||
918 | |||
919 | .photo { | ||
920 | float: right; | ||
921 | margin-left: 1.5em; | ||
922 | margin-bottom: 1.5em; | ||
923 | margin-top: 0em; | ||
924 | max-width: 17em; | ||
925 | border: 1px solid gray; | ||
926 | padding: 3px; | ||
927 | background: white; | ||
928 | } | ||
929 | .seperator { | ||
930 | padding-top: 2em; | ||
931 | clear: both; | ||
932 | } | ||
933 | |||
934 | #validators { | ||
935 | margin-top: 5em; | ||
936 | text-align: right; | ||
937 | color: #777; | ||
938 | } | ||
939 | @media print { | ||
940 | body { | ||
941 | font-size: 8pt; | ||
942 | } | ||
943 | .noprint { | ||
944 | display: none; | ||
945 | } | ||
946 | } | ||
947 | |||
948 | |||
949 | .tip, | ||
950 | .note { | ||
951 | background: #f0f0f2; | ||
952 | color: #333; | ||
953 | padding: 20px; | ||
954 | margin: 20px; | ||
955 | } | ||
956 | |||
957 | .tip h3, | ||
958 | .note h3 { | ||
959 | padding: 0em; | ||
960 | margin: 0em; | ||
961 | font-size: 2em; | ||
962 | font-weight: bold; | ||
963 | color: #333; | ||
964 | } | ||
965 | |||
966 | .tip a, | ||
967 | .note a { | ||
968 | color: #333; | ||
969 | text-decoration: underline; | ||
970 | } | ||
971 | |||
972 | .footnote { | ||
973 | font-size: small; | ||
974 | color: #333; | ||
975 | } | ||
976 | |||
977 | /* Changes the announcement text */ | ||
978 | .tip h3, | ||
979 | .warning h3, | ||
980 | .caution h3, | ||
981 | .note h3 { | ||
982 | font-size:large; | ||
983 | color: #00557D; | ||
984 | } | ||
diff --git a/documentation/adt-manual/figures/adt-title.png b/documentation/adt-manual/figures/adt-title.png new file mode 100644 index 0000000..6e71e41 --- /dev/null +++ b/documentation/adt-manual/figures/adt-title.png | |||
Binary files differ | |||
diff --git a/documentation/bsp-guide/bsp-guide-customization.xsl b/documentation/bsp-guide/bsp-guide-customization.xsl new file mode 100644 index 0000000..53e50b1 --- /dev/null +++ b/documentation/bsp-guide/bsp-guide-customization.xsl | |||
@@ -0,0 +1,19 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> | ||
3 | |||
4 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" /> | ||
5 | |||
6 | <xsl:include href="../template/permalinks.xsl"/> | ||
7 | <xsl:include href="../template/section.title.xsl"/> | ||
8 | <xsl:include href="../template/component.title.xsl"/> | ||
9 | <xsl:include href="../template/division.title.xsl"/> | ||
10 | <xsl:include href="../template/formal.object.heading.xsl"/> | ||
11 | |||
12 | <xsl:param name="html.stylesheet" select="'bsp-style.css'" /> | ||
13 | <xsl:param name="chapter.autolabel" select="1" /> | ||
14 | <xsl:param name="appendix.autolabel" select="A" /> | ||
15 | <xsl:param name="section.autolabel" select="1" /> | ||
16 | <xsl:param name="section.label.includes.component.label" select="1" /> | ||
17 | <xsl:param name="generate.id.attributes" select="1" /> | ||
18 | |||
19 | </xsl:stylesheet> | ||
diff --git a/documentation/bsp-guide/bsp-guide-eclipse-customization.xsl b/documentation/bsp-guide/bsp-guide-eclipse-customization.xsl new file mode 100644 index 0000000..1c80bee --- /dev/null +++ b/documentation/bsp-guide/bsp-guide-eclipse-customization.xsl | |||
@@ -0,0 +1,27 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet | ||
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
4 | xmlns="http://www.w3.org/1999/xhtml" | ||
5 | xmlns:fo="http://www.w3.org/1999/XSL/Format" | ||
6 | version="1.0"> | ||
7 | |||
8 | <xsl:import | ||
9 | href="http://docbook.sourceforge.net/release/xsl/current/eclipse/eclipse3.xsl" /> | ||
10 | |||
11 | <xsl:param name="chunker.output.indent" select="'yes'"/> | ||
12 | <xsl:param name="chunk.quietly" select="1"/> | ||
13 | <xsl:param name="chunk.first.sections" select="1"/> | ||
14 | <xsl:param name="chunk.section.depth" select="10"/> | ||
15 | <xsl:param name="use.id.as.filename" select="1"/> | ||
16 | <xsl:param name="ulink.target" select="'_self'" /> | ||
17 | <xsl:param name="base.dir" select="'html/bsp-guide/'"/> | ||
18 | <xsl:param name="html.stylesheet" select="'../book.css'"/> | ||
19 | <xsl:param name="eclipse.manifest" select="0"/> | ||
20 | <xsl:param name="create.plugin.xml" select="0"/> | ||
21 | <xsl:param name="suppress.navigation" select="1"/> | ||
22 | <xsl:param name="generate.index" select="0"/> | ||
23 | <xsl:param name="chapter.autolabel" select="1" /> | ||
24 | <xsl:param name="appendix.autolabel" select="1" /> | ||
25 | <xsl:param name="section.autolabel" select="1" /> | ||
26 | <xsl:param name="section.label.includes.component.label" select="1" /> | ||
27 | </xsl:stylesheet> | ||
diff --git a/documentation/bsp-guide/bsp-guide.xml b/documentation/bsp-guide/bsp-guide.xml new file mode 100644 index 0000000..af4ea64 --- /dev/null +++ b/documentation/bsp-guide/bsp-guide.xml | |||
@@ -0,0 +1,128 @@ | |||
1 | <!DOCTYPE book 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 | |||
5 | <book id='bsp-guide' lang='en' | ||
6 | xmlns:xi="http://www.w3.org/2003/XInclude" | ||
7 | xmlns="http://docbook.org/ns/docbook" | ||
8 | > | ||
9 | <bookinfo> | ||
10 | |||
11 | <mediaobject> | ||
12 | <imageobject> | ||
13 | <imagedata fileref='figures/bsp-title.png' | ||
14 | format='SVG' | ||
15 | align='center' scalefit='1' width='100%'/> | ||
16 | </imageobject> | ||
17 | </mediaobject> | ||
18 | |||
19 | <title> | ||
20 | Yocto Project Board Support Package Developer's Guide | ||
21 | </title> | ||
22 | |||
23 | <authorgroup> | ||
24 | <author> | ||
25 | <firstname>Tom</firstname> <surname>Zanussi</surname> | ||
26 | <affiliation> | ||
27 | <orgname>Intel Corporation</orgname> | ||
28 | </affiliation> | ||
29 | <email>tom.zanussi@intel.com</email> | ||
30 | </author> | ||
31 | <author> | ||
32 | <firstname>Richard</firstname> <surname>Purdie</surname> | ||
33 | <affiliation> | ||
34 | <orgname>Linux Foundation</orgname> | ||
35 | </affiliation> | ||
36 | <email>richard.purdie@linuxfoundation.org</email> | ||
37 | </author> | ||
38 | </authorgroup> | ||
39 | |||
40 | <revhistory> | ||
41 | <revision> | ||
42 | <revnumber>0.9</revnumber> | ||
43 | <date>24 November 2010</date> | ||
44 | <revremark>The initial document draft released with the Yocto Project 0.9 Release.</revremark> | ||
45 | </revision> | ||
46 | <revision> | ||
47 | <revnumber>1.0</revnumber> | ||
48 | <date>6 April 2011</date> | ||
49 | <revremark>Released with the Yocto Project 1.0 Release.</revremark> | ||
50 | </revision> | ||
51 | <revision> | ||
52 | <revnumber>1.0.1</revnumber> | ||
53 | <date>23 May 2011</date> | ||
54 | <revremark>Released with the Yocto Project 1.0.1 Release.</revremark> | ||
55 | </revision> | ||
56 | <revision> | ||
57 | <revnumber>1.1</revnumber> | ||
58 | <date>6 October 2011</date> | ||
59 | <revremark>Released with the Yocto Project 1.1 Release.</revremark> | ||
60 | </revision> | ||
61 | <revision> | ||
62 | <revnumber>1.2</revnumber> | ||
63 | <date>April 2012</date> | ||
64 | <revremark>Released with the Yocto Project 1.2 Release.</revremark> | ||
65 | </revision> | ||
66 | <revision> | ||
67 | <revnumber>1.3</revnumber> | ||
68 | <date>October 2012</date> | ||
69 | <revremark>Released with the Yocto Project 1.3 Release.</revremark> | ||
70 | </revision> | ||
71 | <revision> | ||
72 | <revnumber>1.4</revnumber> | ||
73 | <date>April 2013</date> | ||
74 | <revremark>Released with the Yocto Project 1.4 Release.</revremark> | ||
75 | </revision> | ||
76 | <revision> | ||
77 | <revnumber>1.5</revnumber> | ||
78 | <date>October 2013</date> | ||
79 | <revremark>Released with the Yocto Project 1.5 Release.</revremark> | ||
80 | </revision> | ||
81 | <revision> | ||
82 | <revnumber>1.5.1</revnumber> | ||
83 | <date>January 2014</date> | ||
84 | <revremark>Released with the Yocto Project 1.5.1 Release.</revremark> | ||
85 | </revision> | ||
86 | <revision> | ||
87 | <revnumber>1.6</revnumber> | ||
88 | <date>April 2014</date> | ||
89 | <revremark>Released with the Yocto Project 1.6 Release.</revremark> | ||
90 | </revision> | ||
91 | <revision> | ||
92 | <revnumber>1.7</revnumber> | ||
93 | <date>Fall of 2014</date> | ||
94 | <revremark>Released with the Yocto Project 1.7 Release.</revremark> | ||
95 | </revision> | ||
96 | </revhistory> | ||
97 | |||
98 | <copyright> | ||
99 | <year>©RIGHT_YEAR;</year> | ||
100 | <holder>Linux Foundation</holder> | ||
101 | </copyright> | ||
102 | |||
103 | <legalnotice> | ||
104 | <para> | ||
105 | Permission is granted to copy, distribute and/or modify this document under | ||
106 | the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/">Creative Commons Attribution-Non-Commercial-Share Alike 2.0 UK: England & Wales</ulink> as published by Creative Commons. | ||
107 | </para> | ||
108 | <note> | ||
109 | For the latest version of this manual associated with this | ||
110 | Yocto Project release, see the | ||
111 | <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink> | ||
112 | from the Yocto Project website. | ||
113 | </note> | ||
114 | </legalnotice> | ||
115 | |||
116 | </bookinfo> | ||
117 | |||
118 | <xi:include href="bsp.xml"/> | ||
119 | |||
120 | <!-- <index id='index'> | ||
121 | <title>Index</title> | ||
122 | </index> | ||
123 | --> | ||
124 | |||
125 | </book> | ||
126 | <!-- | ||
127 | vim: expandtab tw=80 ts=4 | ||
128 | --> | ||
diff --git a/documentation/bsp-guide/bsp-style.css b/documentation/bsp-guide/bsp-style.css new file mode 100644 index 0000000..e407ca4 --- /dev/null +++ b/documentation/bsp-guide/bsp-style.css | |||
@@ -0,0 +1,984 @@ | |||
1 | /* | ||
2 | Generic XHTML / DocBook XHTML CSS Stylesheet. | ||
3 | |||
4 | Browser wrangling and typographic design by | ||
5 | Oyvind Kolas / pippin@gimp.org | ||
6 | |||
7 | Customised for Poky by | ||
8 | Matthew Allum / mallum@o-hand.com | ||
9 | |||
10 | Thanks to: | ||
11 | Liam R. E. Quin | ||
12 | William Skaggs | ||
13 | Jakub Steiner | ||
14 | |||
15 | Structure | ||
16 | --------- | ||
17 | |||
18 | The stylesheet is divided into the following sections: | ||
19 | |||
20 | Positioning | ||
21 | Margins, paddings, width, font-size, clearing. | ||
22 | Decorations | ||
23 | Borders, style | ||
24 | Colors | ||
25 | Colors | ||
26 | Graphics | ||
27 | Graphical backgrounds | ||
28 | Nasty IE tweaks | ||
29 | Workarounds needed to make it work in internet explorer, | ||
30 | currently makes the stylesheet non validating, but up until | ||
31 | this point it is validating. | ||
32 | Mozilla extensions | ||
33 | Transparency for footer | ||
34 | Rounded corners on boxes | ||
35 | |||
36 | */ | ||
37 | |||
38 | |||
39 | /*************** / | ||
40 | / Positioning / | ||
41 | / ***************/ | ||
42 | |||
43 | body { | ||
44 | font-family: Verdana, Sans, sans-serif; | ||
45 | |||
46 | min-width: 640px; | ||
47 | width: 80%; | ||
48 | margin: 0em auto; | ||
49 | padding: 2em 5em 5em 5em; | ||
50 | color: #333; | ||
51 | } | ||
52 | |||
53 | h1,h2,h3,h4,h5,h6,h7 { | ||
54 | font-family: Arial, Sans; | ||
55 | color: #00557D; | ||
56 | clear: both; | ||
57 | } | ||
58 | |||
59 | h1 { | ||
60 | font-size: 2em; | ||
61 | text-align: left; | ||
62 | padding: 0em 0em 0em 0em; | ||
63 | margin: 2em 0em 0em 0em; | ||
64 | } | ||
65 | |||
66 | h2.subtitle { | ||
67 | margin: 0.10em 0em 3.0em 0em; | ||
68 | padding: 0em 0em 0em 0em; | ||
69 | font-size: 1.8em; | ||
70 | padding-left: 20%; | ||
71 | font-weight: normal; | ||
72 | font-style: italic; | ||
73 | } | ||
74 | |||
75 | h2 { | ||
76 | margin: 2em 0em 0.66em 0em; | ||
77 | padding: 0.5em 0em 0em 0em; | ||
78 | font-size: 1.5em; | ||
79 | font-weight: bold; | ||
80 | } | ||
81 | |||
82 | h3.subtitle { | ||
83 | margin: 0em 0em 1em 0em; | ||
84 | padding: 0em 0em 0em 0em; | ||
85 | font-size: 142.14%; | ||
86 | text-align: right; | ||
87 | } | ||
88 | |||
89 | h3 { | ||
90 | margin: 1em 0em 0.5em 0em; | ||
91 | padding: 1em 0em 0em 0em; | ||
92 | font-size: 140%; | ||
93 | font-weight: bold; | ||
94 | } | ||
95 | |||
96 | h4 { | ||
97 | margin: 1em 0em 0.5em 0em; | ||
98 | padding: 1em 0em 0em 0em; | ||
99 | font-size: 120%; | ||
100 | font-weight: bold; | ||
101 | } | ||
102 | |||
103 | h5 { | ||
104 | margin: 1em 0em 0.5em 0em; | ||
105 | padding: 1em 0em 0em 0em; | ||
106 | font-size: 110%; | ||
107 | font-weight: bold; | ||
108 | } | ||
109 | |||
110 | h6 { | ||
111 | margin: 1em 0em 0em 0em; | ||
112 | padding: 1em 0em 0em 0em; | ||
113 | font-size: 110%; | ||
114 | font-weight: bold; | ||
115 | } | ||
116 | |||
117 | .authorgroup { | ||
118 | background-color: transparent; | ||
119 | background-repeat: no-repeat; | ||
120 | padding-top: 256px; | ||
121 | background-image: url("figures/bsp-title.png"); | ||
122 | background-position: left top; | ||
123 | margin-top: -256px; | ||
124 | padding-right: 50px; | ||
125 | margin-left: 0px; | ||
126 | text-align: right; | ||
127 | width: 740px; | ||
128 | } | ||
129 | |||
130 | h3.author { | ||
131 | margin: 0em 0me 0em 0em; | ||
132 | padding: 0em 0em 0em 0em; | ||
133 | font-weight: normal; | ||
134 | font-size: 100%; | ||
135 | color: #333; | ||
136 | clear: both; | ||
137 | } | ||
138 | |||
139 | .author tt.email { | ||
140 | font-size: 66%; | ||
141 | } | ||
142 | |||
143 | .titlepage hr { | ||
144 | width: 0em; | ||
145 | clear: both; | ||
146 | } | ||
147 | |||
148 | .revhistory { | ||
149 | padding-top: 2em; | ||
150 | clear: both; | ||
151 | } | ||
152 | |||
153 | .toc, | ||
154 | .list-of-tables, | ||
155 | .list-of-examples, | ||
156 | .list-of-figures { | ||
157 | padding: 1.33em 0em 2.5em 0em; | ||
158 | color: #00557D; | ||
159 | } | ||
160 | |||
161 | .toc p, | ||
162 | .list-of-tables p, | ||
163 | .list-of-figures p, | ||
164 | .list-of-examples p { | ||
165 | padding: 0em 0em 0em 0em; | ||
166 | padding: 0em 0em 0.3em; | ||
167 | margin: 1.5em 0em 0em 0em; | ||
168 | } | ||
169 | |||
170 | .toc p b, | ||
171 | .list-of-tables p b, | ||
172 | .list-of-figures p b, | ||
173 | .list-of-examples p b{ | ||
174 | font-size: 100.0%; | ||
175 | font-weight: bold; | ||
176 | } | ||
177 | |||
178 | .toc dl, | ||
179 | .list-of-tables dl, | ||
180 | .list-of-figures dl, | ||
181 | .list-of-examples dl { | ||
182 | margin: 0em 0em 0.5em 0em; | ||
183 | padding: 0em 0em 0em 0em; | ||
184 | } | ||
185 | |||
186 | .toc dt { | ||
187 | margin: 0em 0em 0em 0em; | ||
188 | padding: 0em 0em 0em 0em; | ||
189 | } | ||
190 | |||
191 | .toc dd { | ||
192 | margin: 0em 0em 0em 2.6em; | ||
193 | padding: 0em 0em 0em 0em; | ||
194 | } | ||
195 | |||
196 | div.glossary dl, | ||
197 | div.variablelist dl { | ||
198 | } | ||
199 | |||
200 | .glossary dl dt, | ||
201 | .variablelist dl dt, | ||
202 | .variablelist dl dt span.term { | ||
203 | font-weight: normal; | ||
204 | width: 20em; | ||
205 | text-align: right; | ||
206 | } | ||
207 | |||
208 | .variablelist dl dt { | ||
209 | margin-top: 0.5em; | ||
210 | } | ||
211 | |||
212 | .glossary dl dd, | ||
213 | .variablelist dl dd { | ||
214 | margin-top: -1em; | ||
215 | margin-left: 25.5em; | ||
216 | } | ||
217 | |||
218 | .glossary dd p, | ||
219 | .variablelist dd p { | ||
220 | margin-top: 0em; | ||
221 | margin-bottom: 1em; | ||
222 | } | ||
223 | |||
224 | |||
225 | div.calloutlist table td { | ||
226 | padding: 0em 0em 0em 0em; | ||
227 | margin: 0em 0em 0em 0em; | ||
228 | } | ||
229 | |||
230 | div.calloutlist table td p { | ||
231 | margin-top: 0em; | ||
232 | margin-bottom: 1em; | ||
233 | } | ||
234 | |||
235 | div p.copyright { | ||
236 | text-align: left; | ||
237 | } | ||
238 | |||
239 | div.legalnotice p.legalnotice-title { | ||
240 | margin-bottom: 0em; | ||
241 | } | ||
242 | |||
243 | p { | ||
244 | line-height: 1.5em; | ||
245 | margin-top: 0em; | ||
246 | |||
247 | } | ||
248 | |||
249 | dl { | ||
250 | padding-top: 0em; | ||
251 | } | ||
252 | |||
253 | hr { | ||
254 | border: solid 1px; | ||
255 | } | ||
256 | |||
257 | |||
258 | .mediaobject, | ||
259 | .mediaobjectco { | ||
260 | text-align: center; | ||
261 | } | ||
262 | |||
263 | img { | ||
264 | border: none; | ||
265 | } | ||
266 | |||
267 | ul { | ||
268 | padding: 0em 0em 0em 1.5em; | ||
269 | } | ||
270 | |||
271 | ul li { | ||
272 | padding: 0em 0em 0em 0em; | ||
273 | } | ||
274 | |||
275 | ul li p { | ||
276 | text-align: left; | ||
277 | } | ||
278 | |||
279 | table { | ||
280 | width :100%; | ||
281 | } | ||
282 | |||
283 | th { | ||
284 | padding: 0.25em; | ||
285 | text-align: left; | ||
286 | font-weight: normal; | ||
287 | vertical-align: top; | ||
288 | } | ||
289 | |||
290 | td { | ||
291 | padding: 0.25em; | ||
292 | vertical-align: top; | ||
293 | } | ||
294 | |||
295 | p a[id] { | ||
296 | margin: 0px; | ||
297 | padding: 0px; | ||
298 | display: inline; | ||
299 | background-image: none; | ||
300 | } | ||
301 | |||
302 | a { | ||
303 | text-decoration: underline; | ||
304 | color: #444; | ||
305 | } | ||
306 | |||
307 | pre { | ||
308 | overflow: auto; | ||
309 | } | ||
310 | |||
311 | a:hover { | ||
312 | text-decoration: underline; | ||
313 | /*font-weight: bold;*/ | ||
314 | } | ||
315 | |||
316 | /* This style defines how the permalink character | ||
317 | appears by itself and when hovered over with | ||
318 | the mouse. */ | ||
319 | |||
320 | [alt='Permalink'] { color: #eee; } | ||
321 | [alt='Permalink']:hover { color: black; } | ||
322 | |||
323 | |||
324 | div.informalfigure, | ||
325 | div.informalexample, | ||
326 | div.informaltable, | ||
327 | div.figure, | ||
328 | div.table, | ||
329 | div.example { | ||
330 | margin: 1em 0em; | ||
331 | padding: 1em; | ||
332 | page-break-inside: avoid; | ||
333 | } | ||
334 | |||
335 | |||
336 | div.informalfigure p.title b, | ||
337 | div.informalexample p.title b, | ||
338 | div.informaltable p.title b, | ||
339 | div.figure p.title b, | ||
340 | div.example p.title b, | ||
341 | div.table p.title b{ | ||
342 | padding-top: 0em; | ||
343 | margin-top: 0em; | ||
344 | font-size: 100%; | ||
345 | font-weight: normal; | ||
346 | } | ||
347 | |||
348 | .mediaobject .caption, | ||
349 | .mediaobject .caption p { | ||
350 | text-align: center; | ||
351 | font-size: 80%; | ||
352 | padding-top: 0.5em; | ||
353 | padding-bottom: 0.5em; | ||
354 | } | ||
355 | |||
356 | .epigraph { | ||
357 | padding-left: 55%; | ||
358 | margin-bottom: 1em; | ||
359 | } | ||
360 | |||
361 | .epigraph p { | ||
362 | text-align: left; | ||
363 | } | ||
364 | |||
365 | .epigraph .quote { | ||
366 | font-style: italic; | ||
367 | } | ||
368 | .epigraph .attribution { | ||
369 | font-style: normal; | ||
370 | text-align: right; | ||
371 | } | ||
372 | |||
373 | span.application { | ||
374 | font-style: italic; | ||
375 | } | ||
376 | |||
377 | .programlisting { | ||
378 | font-family: monospace; | ||
379 | font-size: 80%; | ||
380 | white-space: pre; | ||
381 | margin: 1.33em 0em; | ||
382 | padding: 1.33em; | ||
383 | } | ||
384 | |||
385 | .tip, | ||
386 | .warning, | ||
387 | .caution, | ||
388 | .note { | ||
389 | margin-top: 1em; | ||
390 | margin-bottom: 1em; | ||
391 | |||
392 | } | ||
393 | |||
394 | /* force full width of table within div */ | ||
395 | .tip table, | ||
396 | .warning table, | ||
397 | .caution table, | ||
398 | .note table { | ||
399 | border: none; | ||
400 | width: 100%; | ||
401 | } | ||
402 | |||
403 | |||
404 | .tip table th, | ||
405 | .warning table th, | ||
406 | .caution table th, | ||
407 | .note table th { | ||
408 | padding: 0.8em 0.0em 0.0em 0.0em; | ||
409 | margin : 0em 0em 0em 0em; | ||
410 | } | ||
411 | |||
412 | .tip p, | ||
413 | .warning p, | ||
414 | .caution p, | ||
415 | .note p { | ||
416 | margin-top: 0.5em; | ||
417 | margin-bottom: 0.5em; | ||
418 | padding-right: 1em; | ||
419 | text-align: left; | ||
420 | } | ||
421 | |||
422 | .acronym { | ||
423 | text-transform: uppercase; | ||
424 | } | ||
425 | |||
426 | b.keycap, | ||
427 | .keycap { | ||
428 | padding: 0.09em 0.3em; | ||
429 | margin: 0em; | ||
430 | } | ||
431 | |||
432 | .itemizedlist li { | ||
433 | clear: none; | ||
434 | } | ||
435 | |||
436 | .filename { | ||
437 | font-size: medium; | ||
438 | font-family: Courier, monospace; | ||
439 | } | ||
440 | |||
441 | |||
442 | div.navheader, div.heading{ | ||
443 | position: absolute; | ||
444 | left: 0em; | ||
445 | top: 0em; | ||
446 | width: 100%; | ||
447 | background-color: #cdf; | ||
448 | width: 100%; | ||
449 | } | ||
450 | |||
451 | div.navfooter, div.footing{ | ||
452 | position: fixed; | ||
453 | left: 0em; | ||
454 | bottom: 0em; | ||
455 | background-color: #eee; | ||
456 | width: 100%; | ||
457 | } | ||
458 | |||
459 | |||
460 | div.navheader td, | ||
461 | div.navfooter td { | ||
462 | font-size: 66%; | ||
463 | } | ||
464 | |||
465 | div.navheader table th { | ||
466 | /*font-family: Georgia, Times, serif;*/ | ||
467 | /*font-size: x-large;*/ | ||
468 | font-size: 80%; | ||
469 | } | ||
470 | |||
471 | div.navheader table { | ||
472 | border-left: 0em; | ||
473 | border-right: 0em; | ||
474 | border-top: 0em; | ||
475 | width: 100%; | ||
476 | } | ||
477 | |||
478 | div.navfooter table { | ||
479 | border-left: 0em; | ||
480 | border-right: 0em; | ||
481 | border-bottom: 0em; | ||
482 | width: 100%; | ||
483 | } | ||
484 | |||
485 | div.navheader table td a, | ||
486 | div.navfooter table td a { | ||
487 | color: #777; | ||
488 | text-decoration: none; | ||
489 | } | ||
490 | |||
491 | /* normal text in the footer */ | ||
492 | div.navfooter table td { | ||
493 | color: black; | ||
494 | } | ||
495 | |||
496 | div.navheader table td a:visited, | ||
497 | div.navfooter table td a:visited { | ||
498 | color: #444; | ||
499 | } | ||
500 | |||
501 | |||
502 | /* links in header and footer */ | ||
503 | div.navheader table td a:hover, | ||
504 | div.navfooter table td a:hover { | ||
505 | text-decoration: underline; | ||
506 | background-color: transparent; | ||
507 | color: #33a; | ||
508 | } | ||
509 | |||
510 | div.navheader hr, | ||
511 | div.navfooter hr { | ||
512 | display: none; | ||
513 | } | ||
514 | |||
515 | |||
516 | .qandaset tr.question td p { | ||
517 | margin: 0em 0em 1em 0em; | ||
518 | padding: 0em 0em 0em 0em; | ||
519 | } | ||
520 | |||
521 | .qandaset tr.answer td p { | ||
522 | margin: 0em 0em 1em 0em; | ||
523 | padding: 0em 0em 0em 0em; | ||
524 | } | ||
525 | .answer td { | ||
526 | padding-bottom: 1.5em; | ||
527 | } | ||
528 | |||
529 | .emphasis { | ||
530 | font-weight: bold; | ||
531 | } | ||
532 | |||
533 | |||
534 | /************* / | ||
535 | / decorations / | ||
536 | / *************/ | ||
537 | |||
538 | .titlepage { | ||
539 | } | ||
540 | |||
541 | .part .title { | ||
542 | } | ||
543 | |||
544 | .subtitle { | ||
545 | border: none; | ||
546 | } | ||
547 | |||
548 | /* | ||
549 | h1 { | ||
550 | border: none; | ||
551 | } | ||
552 | |||
553 | h2 { | ||
554 | border-top: solid 0.2em; | ||
555 | border-bottom: solid 0.06em; | ||
556 | } | ||
557 | |||
558 | h3 { | ||
559 | border-top: 0em; | ||
560 | border-bottom: solid 0.06em; | ||
561 | } | ||
562 | |||
563 | h4 { | ||
564 | border: 0em; | ||
565 | border-bottom: solid 0.06em; | ||
566 | } | ||
567 | |||
568 | h5 { | ||
569 | border: 0em; | ||
570 | } | ||
571 | */ | ||
572 | |||
573 | .programlisting { | ||
574 | border: solid 1px; | ||
575 | } | ||
576 | |||
577 | div.figure, | ||
578 | div.table, | ||
579 | div.informalfigure, | ||
580 | div.informaltable, | ||
581 | div.informalexample, | ||
582 | div.example { | ||
583 | border: 1px solid; | ||
584 | } | ||
585 | |||
586 | |||
587 | |||
588 | .tip, | ||
589 | .warning, | ||
590 | .caution, | ||
591 | .note { | ||
592 | border: 1px solid; | ||
593 | } | ||
594 | |||
595 | .tip table th, | ||
596 | .warning table th, | ||
597 | .caution table th, | ||
598 | .note table th { | ||
599 | border-bottom: 1px solid; | ||
600 | } | ||
601 | |||
602 | .question td { | ||
603 | border-top: 1px solid black; | ||
604 | } | ||
605 | |||
606 | .answer { | ||
607 | } | ||
608 | |||
609 | |||
610 | b.keycap, | ||
611 | .keycap { | ||
612 | border: 1px solid; | ||
613 | } | ||
614 | |||
615 | |||
616 | div.navheader, div.heading{ | ||
617 | border-bottom: 1px solid; | ||
618 | } | ||
619 | |||
620 | |||
621 | div.navfooter, div.footing{ | ||
622 | border-top: 1px solid; | ||
623 | } | ||
624 | |||
625 | /********* / | ||
626 | / colors / | ||
627 | / *********/ | ||
628 | |||
629 | body { | ||
630 | color: #333; | ||
631 | background: white; | ||
632 | } | ||
633 | |||
634 | a { | ||
635 | background: transparent; | ||
636 | } | ||
637 | |||
638 | a:hover { | ||
639 | background-color: #dedede; | ||
640 | } | ||
641 | |||
642 | |||
643 | h1, | ||
644 | h2, | ||
645 | h3, | ||
646 | h4, | ||
647 | h5, | ||
648 | h6, | ||
649 | h7, | ||
650 | h8 { | ||
651 | background-color: transparent; | ||
652 | } | ||
653 | |||
654 | hr { | ||
655 | border-color: #aaa; | ||
656 | } | ||
657 | |||
658 | |||
659 | .tip, .warning, .caution, .note { | ||
660 | border-color: #fff; | ||
661 | } | ||
662 | |||
663 | |||
664 | .tip table th, | ||
665 | .warning table th, | ||
666 | .caution table th, | ||
667 | .note table th { | ||
668 | border-bottom-color: #fff; | ||
669 | } | ||
670 | |||
671 | |||
672 | .warning { | ||
673 | background-color: #f0f0f2; | ||
674 | } | ||
675 | |||
676 | .caution { | ||
677 | background-color: #f0f0f2; | ||
678 | } | ||
679 | |||
680 | .tip { | ||
681 | background-color: #f0f0f2; | ||
682 | } | ||
683 | |||
684 | .note { | ||
685 | background-color: #f0f0f2; | ||
686 | } | ||
687 | |||
688 | .glossary dl dt, | ||
689 | .variablelist dl dt, | ||
690 | .variablelist dl dt span.term { | ||
691 | color: #044; | ||
692 | } | ||
693 | |||
694 | div.figure, | ||
695 | div.table, | ||
696 | div.example, | ||
697 | div.informalfigure, | ||
698 | div.informaltable, | ||
699 | div.informalexample { | ||
700 | border-color: #aaa; | ||
701 | } | ||
702 | |||
703 | pre.programlisting { | ||
704 | color: black; | ||
705 | background-color: #fff; | ||
706 | border-color: #aaa; | ||
707 | border-width: 2px; | ||
708 | } | ||
709 | |||
710 | .guimenu, | ||
711 | .guilabel, | ||
712 | .guimenuitem { | ||
713 | background-color: #eee; | ||
714 | } | ||
715 | |||
716 | |||
717 | b.keycap, | ||
718 | .keycap { | ||
719 | background-color: #eee; | ||
720 | border-color: #999; | ||
721 | } | ||
722 | |||
723 | |||
724 | div.navheader { | ||
725 | border-color: black; | ||
726 | } | ||
727 | |||
728 | |||
729 | div.navfooter { | ||
730 | border-color: black; | ||
731 | } | ||
732 | |||
733 | |||
734 | /*********** / | ||
735 | / graphics / | ||
736 | / ***********/ | ||
737 | |||
738 | /* | ||
739 | body { | ||
740 | background-image: url("images/body_bg.jpg"); | ||
741 | background-attachment: fixed; | ||
742 | } | ||
743 | |||
744 | .navheader, | ||
745 | .note, | ||
746 | .tip { | ||
747 | background-image: url("images/note_bg.jpg"); | ||
748 | background-attachment: fixed; | ||
749 | } | ||
750 | |||
751 | .warning, | ||
752 | .caution { | ||
753 | background-image: url("images/warning_bg.jpg"); | ||
754 | background-attachment: fixed; | ||
755 | } | ||
756 | |||
757 | .figure, | ||
758 | .informalfigure, | ||
759 | .example, | ||
760 | .informalexample, | ||
761 | .table, | ||
762 | .informaltable { | ||
763 | background-image: url("images/figure_bg.jpg"); | ||
764 | background-attachment: fixed; | ||
765 | } | ||
766 | |||
767 | */ | ||
768 | h1, | ||
769 | h2, | ||
770 | h3, | ||
771 | h4, | ||
772 | h5, | ||
773 | h6, | ||
774 | h7{ | ||
775 | } | ||
776 | |||
777 | /* | ||
778 | Example of how to stick an image as part of the title. | ||
779 | |||
780 | div.article .titlepage .title | ||
781 | { | ||
782 | background-image: url("figures/white-on-black.png"); | ||
783 | background-position: center; | ||
784 | background-repeat: repeat-x; | ||
785 | } | ||
786 | */ | ||
787 | |||
788 | div.preface .titlepage .title, | ||
789 | div.colophon .title, | ||
790 | div.chapter .titlepage .title { | ||
791 | background-position: bottom; | ||
792 | background-repeat: repeat-x; | ||
793 | } | ||
794 | |||
795 | div.section div.section .titlepage .title, | ||
796 | div.sect2 .titlepage .title { | ||
797 | background: none; | ||
798 | } | ||
799 | |||
800 | |||
801 | h1.title { | ||
802 | background-color: transparent; | ||
803 | background-repeat: no-repeat; | ||
804 | height: 256px; | ||
805 | text-indent: -9000px; | ||
806 | overflow:hidden; | ||
807 | } | ||
808 | |||
809 | h2.subtitle { | ||
810 | background-color: transparent; | ||
811 | text-indent: -9000px; | ||
812 | overflow:hidden; | ||
813 | width: 0px; | ||
814 | display: none; | ||
815 | } | ||
816 | |||
817 | /*************************************** / | ||
818 | / pippin.gimp.org specific alterations / | ||
819 | / ***************************************/ | ||
820 | |||
821 | /* | ||
822 | div.heading, div.navheader { | ||
823 | color: #777; | ||
824 | font-size: 80%; | ||
825 | padding: 0; | ||
826 | margin: 0; | ||
827 | text-align: left; | ||
828 | position: absolute; | ||
829 | top: 0px; | ||
830 | left: 0px; | ||
831 | width: 100%; | ||
832 | height: 50px; | ||
833 | background: url('/gfx/heading_bg.png') transparent; | ||
834 | background-repeat: repeat-x; | ||
835 | background-attachment: fixed; | ||
836 | border: none; | ||
837 | } | ||
838 | |||
839 | div.heading a { | ||
840 | color: #444; | ||
841 | } | ||
842 | |||
843 | div.footing, div.navfooter { | ||
844 | border: none; | ||
845 | color: #ddd; | ||
846 | font-size: 80%; | ||
847 | text-align:right; | ||
848 | |||
849 | width: 100%; | ||
850 | padding-top: 10px; | ||
851 | position: absolute; | ||
852 | bottom: 0px; | ||
853 | left: 0px; | ||
854 | |||
855 | background: url('/gfx/footing_bg.png') transparent; | ||
856 | } | ||
857 | */ | ||
858 | |||
859 | |||
860 | |||
861 | /****************** / | ||
862 | / nasty ie tweaks / | ||
863 | / ******************/ | ||
864 | |||
865 | /* | ||
866 | div.heading, div.navheader { | ||
867 | width:expression(document.body.clientWidth + "px"); | ||
868 | } | ||
869 | |||
870 | div.footing, div.navfooter { | ||
871 | width:expression(document.body.clientWidth + "px"); | ||
872 | margin-left:expression("-5em"); | ||
873 | } | ||
874 | body { | ||
875 | padding:expression("4em 5em 0em 5em"); | ||
876 | } | ||
877 | */ | ||
878 | |||
879 | /**************************************** / | ||
880 | / mozilla vendor specific css extensions / | ||
881 | / ****************************************/ | ||
882 | /* | ||
883 | div.navfooter, div.footing{ | ||
884 | -moz-opacity: 0.8em; | ||
885 | } | ||
886 | |||
887 | div.figure, | ||
888 | div.table, | ||
889 | div.informalfigure, | ||
890 | div.informaltable, | ||
891 | div.informalexample, | ||
892 | div.example, | ||
893 | .tip, | ||
894 | .warning, | ||
895 | .caution, | ||
896 | .note { | ||
897 | -moz-border-radius: 0.5em; | ||
898 | } | ||
899 | |||
900 | b.keycap, | ||
901 | .keycap { | ||
902 | -moz-border-radius: 0.3em; | ||
903 | } | ||
904 | */ | ||
905 | |||
906 | table tr td table tr td { | ||
907 | display: none; | ||
908 | } | ||
909 | |||
910 | |||
911 | hr { | ||
912 | display: none; | ||
913 | } | ||
914 | |||
915 | table { | ||
916 | border: 0em; | ||
917 | } | ||
918 | |||
919 | .photo { | ||
920 | float: right; | ||
921 | margin-left: 1.5em; | ||
922 | margin-bottom: 1.5em; | ||
923 | margin-top: 0em; | ||
924 | max-width: 17em; | ||
925 | border: 1px solid gray; | ||
926 | padding: 3px; | ||
927 | background: white; | ||
928 | } | ||
929 | .seperator { | ||
930 | padding-top: 2em; | ||
931 | clear: both; | ||
932 | } | ||
933 | |||
934 | #validators { | ||
935 | margin-top: 5em; | ||
936 | text-align: right; | ||
937 | color: #777; | ||
938 | } | ||
939 | @media print { | ||
940 | body { | ||
941 | font-size: 8pt; | ||
942 | } | ||
943 | .noprint { | ||
944 | display: none; | ||
945 | } | ||
946 | } | ||
947 | |||
948 | |||
949 | .tip, | ||
950 | .note { | ||
951 | background: #f0f0f2; | ||
952 | color: #333; | ||
953 | padding: 20px; | ||
954 | margin: 20px; | ||
955 | } | ||
956 | |||
957 | .tip h3, | ||
958 | .note h3 { | ||
959 | padding: 0em; | ||
960 | margin: 0em; | ||
961 | font-size: 2em; | ||
962 | font-weight: bold; | ||
963 | color: #333; | ||
964 | } | ||
965 | |||
966 | .tip a, | ||
967 | .note a { | ||
968 | color: #333; | ||
969 | text-decoration: underline; | ||
970 | } | ||
971 | |||
972 | .footnote { | ||
973 | font-size: small; | ||
974 | color: #333; | ||
975 | } | ||
976 | |||
977 | /* Changes the announcement text */ | ||
978 | .tip h3, | ||
979 | .warning h3, | ||
980 | .caution h3, | ||
981 | .note h3 { | ||
982 | font-size:large; | ||
983 | color: #00557D; | ||
984 | } | ||
diff --git a/documentation/bsp-guide/bsp.xml b/documentation/bsp-guide/bsp.xml new file mode 100644 index 0000000..00d94b2 --- /dev/null +++ b/documentation/bsp-guide/bsp.xml | |||
@@ -0,0 +1,1526 @@ | |||
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 | |||
5 | <chapter id='bsp'> | ||
6 | |||
7 | <title>Board Support Packages (BSP) - Developer's Guide</title> | ||
8 | |||
9 | <para> | ||
10 | A Board Support Package (BSP) is a collection of information that | ||
11 | defines how to support a particular hardware device, set of devices, or | ||
12 | hardware platform. | ||
13 | The BSP includes information about the hardware features | ||
14 | present on the device and kernel configuration information along with any | ||
15 | additional hardware drivers required. | ||
16 | The BSP also lists any additional software | ||
17 | components required in addition to a generic Linux software stack for both | ||
18 | essential and optional platform features. | ||
19 | </para> | ||
20 | |||
21 | <para> | ||
22 | This guide presents information about BSP Layers, defines a structure for components | ||
23 | so that BSPs follow a commonly understood layout, discusses how to customize | ||
24 | a recipe for a BSP, addresses BSP licensing, and provides information that | ||
25 | shows you how to create and manage a | ||
26 | <link linkend='bsp-layers'>BSP Layer</link> using two Yocto Project | ||
27 | <link linkend='using-the-yocto-projects-bsp-tools'>BSP Tools</link>. | ||
28 | </para> | ||
29 | |||
30 | <section id='bsp-layers'> | ||
31 | <title>BSP Layers</title> | ||
32 | |||
33 | <para> | ||
34 | A BSP consists of a file structure inside a base directory. | ||
35 | Collectively, you can think of the base directory, its file structure, | ||
36 | and the contents as a BSP Layer. | ||
37 | Although not a strict requirement, layers in the Yocto Project use the | ||
38 | following well established naming convention: | ||
39 | <literallayout class='monospaced'> | ||
40 | meta-<bsp_name> | ||
41 | </literallayout> | ||
42 | The string "meta-" is prepended to the machine or platform name, which is | ||
43 | "bsp_name" in the above form. | ||
44 | </para> | ||
45 | |||
46 | <para> | ||
47 | To help understand the BSP layer concept, consider the BSPs that the | ||
48 | Yocto Project supports and provides with each release. | ||
49 | You can see the layers in the | ||
50 | <ulink url='&YOCTO_DOCS_DEV_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink> | ||
51 | through a web interface at | ||
52 | <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi'></ulink>. | ||
53 | If you go to that interface you will find near the bottom of the list | ||
54 | under "Yocto Metadata Layers" several BSP layers all of which are | ||
55 | supported by the Yocto Project (e.g. <filename>meta-minnow</filename>, | ||
56 | <filename>meta-raspberrypi</filename>, and | ||
57 | <filename>meta-intel</filename>). | ||
58 | Each of these layers is a repository unto itself and clicking on a | ||
59 | layer reveals information that includes two links from which you can choose | ||
60 | to set up a clone of the layer's repository on your local host system. | ||
61 | Here is an example that clones the Minnow Board BSP layer: | ||
62 | <literallayout class='monospaced'> | ||
63 | $ git clone git://git.yoctoproject.org/meta-minnow | ||
64 | </literallayout> | ||
65 | For information on the BSP development workflow, see the | ||
66 | "<ulink url='&YOCTO_DOCS_DEV_URL;#developing-a-board-support-package-bsp'>Developing a Board Support Package (BSP)</ulink>" | ||
67 | section in the Yocto Project Development Manual. | ||
68 | For more information on how to set up a local copy of source files | ||
69 | from a Git repository, see the | ||
70 | "<ulink url='&YOCTO_DOCS_DEV_URL;#getting-setup'>Getting Set Up</ulink>" | ||
71 | section also in the Yocto Project Development Manual. | ||
72 | </para> | ||
73 | |||
74 | <para> | ||
75 | The layer's base directory (<filename>meta-<bsp_name></filename>) is the root | ||
76 | of the BSP Layer. | ||
77 | This root is what you add to the | ||
78 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink> | ||
79 | variable in the <filename>conf/bblayers.conf</filename> file found in the | ||
80 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>, | ||
81 | which is established after you run one of the OpenEmbedded build environment | ||
82 | setup scripts (i.e. | ||
83 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> | ||
84 | and | ||
85 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>). | ||
86 | Adding the root allows the OpenEmbedded build system to recognize the BSP | ||
87 | definition and from it build an image. | ||
88 | Here is an example: | ||
89 | <literallayout class='monospaced'> | ||
90 | BBLAYERS ?= " \ | ||
91 | /usr/local/src/yocto/meta \ | ||
92 | /usr/local/src/yocto/meta-yocto \ | ||
93 | /usr/local/src/yocto/meta-yocto-bsp \ | ||
94 | /usr/local/src/yocto/meta-mylayer \ | ||
95 | " | ||
96 | |||
97 | BBLAYERS_NON_REMOVABLE ?= " \ | ||
98 | /usr/local/src/yocto/meta \ | ||
99 | /usr/local/src/yocto/meta-yocto \ | ||
100 | " | ||
101 | </literallayout> | ||
102 | </para> | ||
103 | |||
104 | <para> | ||
105 | Some BSPs require additional layers on | ||
106 | top of the BSP's root layer in order to be functional. | ||
107 | For these cases, you also need to add those layers to the | ||
108 | <filename>BBLAYERS</filename> variable in order to build the BSP. | ||
109 | You must also specify in the "Dependencies" section of the BSP's | ||
110 | <filename>README</filename> file any requirements for additional | ||
111 | layers and, preferably, any | ||
112 | build instructions that might be contained elsewhere | ||
113 | in the <filename>README</filename> file. | ||
114 | </para> | ||
115 | |||
116 | <para> | ||
117 | Some layers function as a layer to hold other BSP layers. | ||
118 | An example of this type of layer is the <filename>meta-intel</filename> layer. | ||
119 | The <filename>meta-intel</filename> layer contains many individual BSP layers. | ||
120 | </para> | ||
121 | |||
122 | <para> | ||
123 | For more detailed information on layers, see the | ||
124 | "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>" | ||
125 | section of the Yocto Project Development Manual. | ||
126 | </para> | ||
127 | </section> | ||
128 | |||
129 | |||
130 | <section id="bsp-filelayout"> | ||
131 | <title>Example Filesystem Layout</title> | ||
132 | |||
133 | <para> | ||
134 | Providing a common form allows end-users to understand and become familiar | ||
135 | with the layout. | ||
136 | A common format also encourages standardization of software support of hardware. | ||
137 | </para> | ||
138 | |||
139 | <para> | ||
140 | The proposed form does have elements that are specific to the | ||
141 | OpenEmbedded build system. | ||
142 | It is intended that this information can be | ||
143 | used by other build systems besides the OpenEmbedded build system | ||
144 | and that it will be simple | ||
145 | to extract information and convert it to other formats if required. | ||
146 | The OpenEmbedded build system, through its standard layers mechanism, can directly | ||
147 | accept the format described as a layer. | ||
148 | The BSP captures all | ||
149 | the hardware-specific details in one place in a standard format, which is | ||
150 | useful for any person wishing to use the hardware platform regardless of | ||
151 | the build system they are using. | ||
152 | </para> | ||
153 | |||
154 | <para> | ||
155 | The BSP specification does not include a build system or other tools - | ||
156 | it is concerned with the hardware-specific components only. | ||
157 | At the end-distribution point, you can ship the BSP combined with a build system | ||
158 | and other tools. | ||
159 | However, it is important to maintain the distinction that these | ||
160 | are separate components that happen to be combined in certain end products. | ||
161 | </para> | ||
162 | |||
163 | <para> | ||
164 | Before looking at the common form for the file structure inside a BSP Layer, | ||
165 | you should be aware that some requirements do exist in order for a BSP to | ||
166 | be considered compliant with the Yocto Project. | ||
167 | For that list of requirements, see the | ||
168 | "<link linkend='released-bsp-requirements'>Released BSP Requirements</link>" | ||
169 | section. | ||
170 | </para> | ||
171 | |||
172 | <para> | ||
173 | Below is the common form for the file structure inside a BSP Layer. | ||
174 | While you can use this basic form for the standard, realize that the actual structures | ||
175 | for specific BSPs could differ. | ||
176 | |||
177 | <literallayout class='monospaced'> | ||
178 | meta-<bsp_name>/ | ||
179 | meta-<bsp_name>/<bsp_license_file> | ||
180 | meta-<bsp_name>/README | ||
181 | meta-<bsp_name>/README.sources | ||
182 | meta-<bsp_name>/binary/<bootable_images> | ||
183 | meta-<bsp_name>/conf/layer.conf | ||
184 | meta-<bsp_name>/conf/machine/*.conf | ||
185 | meta-<bsp_name>/recipes-bsp/* | ||
186 | meta-<bsp_name>/recipes-core/* | ||
187 | meta-<bsp_name>/recipes-graphics/* | ||
188 | meta-<bsp_name>/recipes-kernel/linux/linux-yocto_<kernel_rev>.bbappend | ||
189 | </literallayout> | ||
190 | </para> | ||
191 | |||
192 | <para> | ||
193 | Below is an example of the Crown Bay BSP: | ||
194 | |||
195 | <literallayout class='monospaced'> | ||
196 | meta-crownbay/COPYING.MIT | ||
197 | meta-crownbay/README | ||
198 | meta-crownbay/README.sources | ||
199 | meta-crownbay/binary/ | ||
200 | meta-crownbay/conf/ | ||
201 | meta-crownbay/conf/layer.conf | ||
202 | meta-crownbay/conf/machine/ | ||
203 | meta-crownbay/conf/machine/crownbay.conf | ||
204 | meta-crownbay/conf/machine/crownbay-noemgd.conf | ||
205 | meta-crownbay/recipes-bsp/ | ||
206 | meta-crownbay/recipes-bsp/formfactor/ | ||
207 | meta-crownbay/recipes-bsp/formfactor/formfactor_0.0.bbappend | ||
208 | meta-crownbay/recipes-bsp/formfactor/formfactor/ | ||
209 | meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay/ | ||
210 | meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay/machconfig | ||
211 | meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay-noemgd/ | ||
212 | meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay-noemgd/machconfig | ||
213 | meta-crownbay/recipes-graphics/ | ||
214 | meta-crownbay/recipes-graphics/xorg-xserver/ | ||
215 | meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend | ||
216 | meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/ | ||
217 | meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay/ | ||
218 | meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay/xorg.conf | ||
219 | meta-crownbay/recipes-kernel/ | ||
220 | meta-crownbay/recipes-kernel/linux/ | ||
221 | meta-crownbay/recipes-kernel/linux/linux-yocto-dev.bbappend | ||
222 | meta-crownbay/recipes-kernel/linux/linux-yocto-rt_3.10.bbappend | ||
223 | meta-crownbay/recipes-kernel/linux/linux-yocto_3.10.bbappend | ||
224 | meta-crownbay/recipes-kernel/linux/linux-yocto_3.14.bbappend | ||
225 | </literallayout> | ||
226 | </para> | ||
227 | |||
228 | <para> | ||
229 | The following sections describe each part of the proposed BSP format. | ||
230 | </para> | ||
231 | |||
232 | <section id="bsp-filelayout-license"> | ||
233 | <title>License Files</title> | ||
234 | |||
235 | <para> | ||
236 | You can find these files in the BSP Layer at: | ||
237 | <literallayout class='monospaced'> | ||
238 | meta-<bsp_name>/<bsp_license_file> | ||
239 | </literallayout> | ||
240 | </para> | ||
241 | |||
242 | <para> | ||
243 | These optional files satisfy licensing requirements for the BSP. | ||
244 | The type or types of files here can vary depending on the licensing requirements. | ||
245 | For example, in the Crown Bay BSP all licensing requirements are handled with the | ||
246 | <filename>COPYING.MIT</filename> file. | ||
247 | </para> | ||
248 | |||
249 | <para> | ||
250 | Licensing files can be MIT, BSD, GPLv*, and so forth. | ||
251 | These files are recommended for the BSP but are optional and totally up to the BSP developer. | ||
252 | </para> | ||
253 | </section> | ||
254 | |||
255 | <section id="bsp-filelayout-readme"> | ||
256 | <title>README File</title> | ||
257 | <para> | ||
258 | You can find this file in the BSP Layer at: | ||
259 | <literallayout class='monospaced'> | ||
260 | meta-<bsp_name>/README | ||
261 | </literallayout> | ||
262 | </para> | ||
263 | |||
264 | <para> | ||
265 | This file provides information on how to boot the live images that are optionally | ||
266 | included in the <filename>binary/</filename> directory. | ||
267 | The <filename>README</filename> file also provides special information needed for | ||
268 | building the image. | ||
269 | </para> | ||
270 | |||
271 | <para> | ||
272 | At a minimum, the <filename>README</filename> file must | ||
273 | contain a list of dependencies, such as the names of | ||
274 | any other layers on which the BSP depends and the name of | ||
275 | the BSP maintainer with his or her contact information. | ||
276 | </para> | ||
277 | </section> | ||
278 | |||
279 | <section id="bsp-filelayout-readme-sources"> | ||
280 | <title>README.sources File</title> | ||
281 | <para> | ||
282 | You can find this file in the BSP Layer at: | ||
283 | <literallayout class='monospaced'> | ||
284 | meta-<bsp_name>/README.sources | ||
285 | </literallayout> | ||
286 | </para> | ||
287 | |||
288 | <para> | ||
289 | This file provides information on where to locate the BSP source files. | ||
290 | For example, information provides where to find the sources that comprise | ||
291 | the images shipped with the BSP. | ||
292 | Information is also included to help you find the | ||
293 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> | ||
294 | used to generate the images that ship with the BSP. | ||
295 | </para> | ||
296 | </section> | ||
297 | |||
298 | <section id="bsp-filelayout-binary"> | ||
299 | <title>Pre-built User Binaries</title> | ||
300 | <para> | ||
301 | You can find these files in the BSP Layer at: | ||
302 | <literallayout class='monospaced'> | ||
303 | meta-<bsp_name>/binary/<bootable_images> | ||
304 | </literallayout> | ||
305 | </para> | ||
306 | |||
307 | <para> | ||
308 | This optional area contains useful pre-built kernels and user-space filesystem | ||
309 | images appropriate to the target system. | ||
310 | This directory typically contains graphical (e.g. Sato) and minimal live images | ||
311 | when the BSP tarball has been created and made available in the | ||
312 | <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink> website. | ||
313 | You can use these kernels and images to get a system running and quickly get started | ||
314 | on development tasks. | ||
315 | </para> | ||
316 | |||
317 | <para> | ||
318 | The exact types of binaries present are highly hardware-dependent. | ||
319 | However, a README file should be present in the BSP Layer that explains how to use | ||
320 | the kernels and images with the target hardware. | ||
321 | If pre-built binaries are present, source code to meet licensing requirements must also | ||
322 | exist in some form. | ||
323 | </para> | ||
324 | </section> | ||
325 | |||
326 | <section id='bsp-filelayout-layer'> | ||
327 | <title>Layer Configuration File</title> | ||
328 | <para> | ||
329 | You can find this file in the BSP Layer at: | ||
330 | <literallayout class='monospaced'> | ||
331 | meta-<bsp_name>/conf/layer.conf | ||
332 | </literallayout> | ||
333 | </para> | ||
334 | |||
335 | <para> | ||
336 | The <filename>conf/layer.conf</filename> file identifies the file structure as a | ||
337 | layer, identifies the | ||
338 | contents of the layer, and contains information about how the build | ||
339 | system should use it. | ||
340 | Generally, a standard boilerplate file such as the following works. | ||
341 | In the following example, you would replace "<filename>bsp</filename>" and | ||
342 | "<filename>_bsp</filename>" with the actual name | ||
343 | of the BSP (i.e. <filename><bsp_name></filename> from the example template). | ||
344 | </para> | ||
345 | |||
346 | <para> | ||
347 | <literallayout class='monospaced'> | ||
348 | # We have a conf and classes directory, add to BBPATH | ||
349 | BBPATH .= ":${LAYERDIR}" | ||
350 | |||
351 | # We have a recipes directory, add to BBFILES | ||
352 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ | ||
353 | ${LAYERDIR}/recipes-*/*/*.bbappend" | ||
354 | |||
355 | BBFILE_COLLECTIONS += "bsp" | ||
356 | BBFILE_PATTERN_bsp = "^${LAYERDIR}/" | ||
357 | BBFILE_PRIORITY_bsp = "6" | ||
358 | </literallayout> | ||
359 | </para> | ||
360 | |||
361 | <para> | ||
362 | To illustrate the string substitutions, here are the corresponding statements | ||
363 | from the Crown Bay <filename>conf/layer.conf</filename> file: | ||
364 | <literallayout class='monospaced'> | ||
365 | BBFILE_COLLECTIONS += "crownbay" | ||
366 | BBFILE_PATTERN_crownbay = "^${LAYERDIR}/" | ||
367 | BBFILE_PRIORITY_crownbay = "6" | ||
368 | </literallayout> | ||
369 | </para> | ||
370 | |||
371 | <para> | ||
372 | This file simply makes | ||
373 | <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink> | ||
374 | aware of the recipes and configuration directories. | ||
375 | The file must exist so that the OpenEmbedded build system can recognize the BSP. | ||
376 | </para> | ||
377 | </section> | ||
378 | |||
379 | <section id="bsp-filelayout-machine"> | ||
380 | <title>Hardware Configuration Options</title> | ||
381 | <para> | ||
382 | You can find these files in the BSP Layer at: | ||
383 | <literallayout class='monospaced'> | ||
384 | meta-<bsp_name>/conf/machine/*.conf | ||
385 | </literallayout> | ||
386 | </para> | ||
387 | |||
388 | <para> | ||
389 | The machine files bind together all the information contained elsewhere | ||
390 | in the BSP into a format that the build system can understand. | ||
391 | If the BSP supports multiple machines, multiple machine configuration files | ||
392 | can be present. | ||
393 | These filenames correspond to the values to which users have set the | ||
394 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> variable. | ||
395 | </para> | ||
396 | |||
397 | <para> | ||
398 | These files define things such as the kernel package to use | ||
399 | (<ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER</filename></ulink> | ||
400 | of virtual/kernel), the hardware drivers to | ||
401 | include in different types of images, any special software components | ||
402 | that are needed, any bootloader information, and also any special image | ||
403 | format requirements. | ||
404 | </para> | ||
405 | |||
406 | <para> | ||
407 | Each BSP Layer requires at least one machine file. | ||
408 | However, you can supply more than one file. | ||
409 | </para> | ||
410 | |||
411 | <para> | ||
412 | This <filename>crownbay.conf</filename> file could also include | ||
413 | a hardware "tuning" file that is commonly used to | ||
414 | define the package architecture and specify | ||
415 | optimization flags, which are carefully chosen to give best | ||
416 | performance on a given processor. | ||
417 | </para> | ||
418 | |||
419 | <para> | ||
420 | Tuning files are found in the <filename>meta/conf/machine/include</filename> | ||
421 | directory within the | ||
422 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
423 | For example, the <filename>ia32-base.inc</filename> file resides in the | ||
424 | <filename>meta/conf/machine/include</filename> directory. | ||
425 | </para> | ||
426 | |||
427 | <para> | ||
428 | To use an include file, you simply include them in the machine configuration file. | ||
429 | For example, the Crown Bay BSP <filename>crownbay.conf</filename> contains the | ||
430 | following statements: | ||
431 | <literallayout class='monospaced'> | ||
432 | require conf/machine/include/intel-core2-32-common.inc | ||
433 | require conf/machine/include/meta-intel.inc | ||
434 | require conf/machine/include/meta-intel-emgd.inc | ||
435 | </literallayout> | ||
436 | </para> | ||
437 | </section> | ||
438 | |||
439 | <section id='bsp-filelayout-misc-recipes'> | ||
440 | <title>Miscellaneous BSP-Specific Recipe Files</title> | ||
441 | <para> | ||
442 | You can find these files in the BSP Layer at: | ||
443 | <literallayout class='monospaced'> | ||
444 | meta-<bsp_name>/recipes-bsp/* | ||
445 | </literallayout> | ||
446 | </para> | ||
447 | |||
448 | <para> | ||
449 | This optional directory contains miscellaneous recipe files for the BSP. | ||
450 | Most notably would be the formfactor files. | ||
451 | For example, in the Crown Bay BSP there is the | ||
452 | <filename>formfactor_0.0.bbappend</filename> file, which is an | ||
453 | append file used to augment the recipe that starts the build. | ||
454 | Furthermore, there are machine-specific settings used during the | ||
455 | build that are defined by the <filename>machconfig</filename> file. | ||
456 | In the Crown Bay example, two <filename>machconfig</filename> files | ||
457 | exist: one that supports the Intel® Embedded Media and Graphics | ||
458 | Driver (Intel® EMGD) and one that does not: | ||
459 | <literallayout class='monospaced'> | ||
460 | meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay/machconfig | ||
461 | meta-crownbay/recipes-bsp/formfactor/formfactor/crownbay-noemgd/machconfig | ||
462 | meta-crownbay/recipes-bsp/formfactor/formfactor_0.0.bbappend | ||
463 | </literallayout> | ||
464 | </para> | ||
465 | |||
466 | <note><para> | ||
467 | If a BSP does not have a formfactor entry, defaults are established according to | ||
468 | the formfactor configuration file that is installed by the main | ||
469 | formfactor recipe | ||
470 | <filename>meta/recipes-bsp/formfactor/formfactor_0.0.bb</filename>, | ||
471 | which is found in the | ||
472 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
473 | </para></note> | ||
474 | </section> | ||
475 | |||
476 | <section id='bsp-filelayout-recipes-graphics'> | ||
477 | <title>Display Support Files</title> | ||
478 | <para> | ||
479 | You can find these files in the BSP Layer at: | ||
480 | <literallayout class='monospaced'> | ||
481 | meta-<bsp_name>/recipes-graphics/* | ||
482 | </literallayout> | ||
483 | </para> | ||
484 | |||
485 | <para> | ||
486 | This optional directory contains recipes for the BSP if it has | ||
487 | special requirements for graphics support. | ||
488 | All files that are needed for the BSP to support a display are kept here. | ||
489 | For example, the Crown Bay BSP's <filename>xorg.conf</filename> file | ||
490 | detects the graphics support needed (i.e. the Intel® Embedded Media | ||
491 | Graphics Driver (EMGD) or the Video Electronics Standards Association | ||
492 | (VESA) graphics): | ||
493 | <literallayout class='monospaced'> | ||
494 | meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend | ||
495 | meta-crownbay/recipes-graphics/xorg-xserver/xserver-xf86-config/crownbay/xorg.conf | ||
496 | </literallayout> | ||
497 | </para> | ||
498 | </section> | ||
499 | |||
500 | <section id='bsp-filelayout-kernel'> | ||
501 | <title>Linux Kernel Configuration</title> | ||
502 | <para> | ||
503 | You can find these files in the BSP Layer at: | ||
504 | <literallayout class='monospaced'> | ||
505 | meta-<bsp_name>/recipes-kernel/linux/linux-yocto_*.bbappend | ||
506 | </literallayout> | ||
507 | </para> | ||
508 | |||
509 | <para> | ||
510 | These files append your specific changes to the main kernel recipe you are using. | ||
511 | </para> | ||
512 | <para> | ||
513 | For your BSP, you typically want to use an existing Yocto Project kernel recipe found in the | ||
514 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
515 | at <filename>meta/recipes-kernel/linux</filename>. | ||
516 | You can append your specific changes to the kernel recipe by using a | ||
517 | similarly named append file, which is located in the BSP Layer (e.g. | ||
518 | the <filename>meta-<bsp_name>/recipes-kernel/linux</filename> directory). | ||
519 | </para> | ||
520 | <para> | ||
521 | Suppose you are using the <filename>linux-yocto_3.10.bb</filename> recipe to build | ||
522 | the kernel. | ||
523 | In other words, you have selected the kernel in your | ||
524 | <filename><bsp_name>.conf</filename> file by adding these types | ||
525 | of statements: | ||
526 | <literallayout class='monospaced'> | ||
527 | PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto" | ||
528 | PREFERRED_VERSION_linux-yocto ?= "3.10%" | ||
529 | </literallayout> | ||
530 | <note> | ||
531 | When the preferred provider is assumed by default, the | ||
532 | <filename>PREFERRED_PROVIDER</filename> statement does not appear in the | ||
533 | <filename><bsp_name>.conf</filename> file. | ||
534 | </note> | ||
535 | You would use the <filename>linux-yocto_3.10.bbappend</filename> file to append | ||
536 | specific BSP settings to the kernel, thus configuring the kernel for your particular BSP. | ||
537 | </para> | ||
538 | <para> | ||
539 | As an example, look at the existing Crown Bay BSP. | ||
540 | The append file used is: | ||
541 | <literallayout class='monospaced'> | ||
542 | meta-crownbay/recipes-kernel/linux/linux-yocto_3.10.bbappend | ||
543 | </literallayout> | ||
544 | The following listing shows the file. | ||
545 | Be aware that the actual commit ID strings in this example listing might be different | ||
546 | than the actual strings in the file from the <filename>meta-intel</filename> | ||
547 | Git source repository. | ||
548 | <literallayout class='monospaced'> | ||
549 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
550 | |||
551 | |||
552 | COMPATIBLE_MACHINE_crownbay = "crownbay" | ||
553 | KMACHINE_crownbay = "crownbay" | ||
554 | KBRANCH_crownbay = "standard/crownbay" | ||
555 | KERNEL_FEATURES_append_crownbay = " features/drm-emgd/drm-emgd-1.18 cfg/vesafb" | ||
556 | |||
557 | COMPATIBLE_MACHINE_crownbay-noemgd = "crownbay-noemgd" | ||
558 | KMACHINE_crownbay-noemgd = "crownbay" | ||
559 | KBRANCH_crownbay-noemgd = "standard/crownbay" | ||
560 | KERNEL_FEATURES_append_crownbay-noemgd = " cfg/vesafb" | ||
561 | |||
562 | LINUX_VERSION_crownbay = "3.10.35" | ||
563 | SRCREV_meta_crownbay = "b6e58b33dd427fe471f8827c83e311acdf4558a4" | ||
564 | SRCREV_machine_crownbay = "cee957655fe67826b2e827e2db41f156fa8f0cc4" | ||
565 | SRCREV_emgd_crownbay = "42d5e4548e8e79e094fa8697949eed4cf6af00a3" | ||
566 | |||
567 | LINUX_VERSION_crownbay-noemgd = "3.10.35" | ||
568 | SRCREV_meta_crownbay-noemgd = "b6e58b33dd427fe471f8827c83e311acdf4558a4" | ||
569 | SRCREV_machine_crownbay-noemgd = "cee957655fe67826b2e827e2db41f156fa8f0cc4" | ||
570 | |||
571 | SRC_URI_crownbay = "git://git.yoctoproject.org/linux-yocto-3.10.git;protocol=git;nocheckout=1;branch=${KBRANCH},${KMETA},emgd-1.18;name=machine,meta,emgd" | ||
572 | </literallayout> | ||
573 | This append file contains statements used to support the Crown Bay BSP. | ||
574 | The file defines machines using the | ||
575 | <ulink url='&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE'><filename>COMPATIBLE_MACHINE</filename></ulink> | ||
576 | variable and uses the | ||
577 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink> variable to | ||
578 | ensure the machine name used by the OpenEmbedded build system maps to the | ||
579 | machine name used by the Linux Yocto kernel. | ||
580 | The file also uses the optional | ||
581 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink> variable | ||
582 | to ensure the build process uses the <filename>standard/crownbay</filename> | ||
583 | kernel branch. | ||
584 | The | ||
585 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'><filename>KERNEL_FEATURES</filename></ulink> | ||
586 | variable enables features specific to the kernel | ||
587 | (e.g. graphics support in this case). | ||
588 | The append file points to specific commits in the | ||
589 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> Git | ||
590 | repository and the <filename>meta</filename> Git repository branches to identify the | ||
591 | exact kernel needed to build the Crown Bay BSP. | ||
592 | Finally, the file includes the | ||
593 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
594 | statement to locate the source files. | ||
595 | </para> | ||
596 | |||
597 | <para> | ||
598 | One thing missing in this particular BSP, which you will typically need when | ||
599 | developing a BSP, is the kernel configuration file (<filename>.config</filename>) for your BSP. | ||
600 | When developing a BSP, you probably have a kernel configuration file or a set of kernel | ||
601 | configuration files that, when taken together, define the kernel configuration for your BSP. | ||
602 | You can accomplish this definition by putting the configurations in a file or a set of files | ||
603 | inside a directory located at the same level as your kernel's append file and having the same | ||
604 | name as the kernel's main recipe file. | ||
605 | With all these conditions met, simply reference those files in the | ||
606 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
607 | statement in the append file. | ||
608 | </para> | ||
609 | |||
610 | <para> | ||
611 | For example, suppose you had some configuration options in a file called | ||
612 | <filename>network_configs.cfg</filename>. | ||
613 | You can place that file inside a directory named <filename>linux-yocto</filename> and then add | ||
614 | a <filename>SRC_URI</filename> statement such as the following to the append file. | ||
615 | When the OpenEmbedded build system builds the kernel, the configuration options are | ||
616 | picked up and applied. | ||
617 | <literallayout class='monospaced'> | ||
618 | SRC_URI += "file://network_configs.cfg" | ||
619 | </literallayout> | ||
620 | </para> | ||
621 | |||
622 | <para> | ||
623 | To group related configurations into multiple files, you perform a similar procedure. | ||
624 | Here is an example that groups separate configurations specifically for Ethernet and graphics | ||
625 | into their own files and adds the configurations | ||
626 | by using a <filename>SRC_URI</filename> statement like the following in your append file: | ||
627 | <literallayout class='monospaced'> | ||
628 | SRC_URI += "file://myconfig.cfg \ | ||
629 | file://eth.cfg \ | ||
630 | file://gfx.cfg" | ||
631 | </literallayout> | ||
632 | </para> | ||
633 | |||
634 | <para> | ||
635 | The <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink> | ||
636 | variable is in boilerplate form in the | ||
637 | previous example in order to make it easy to do that. | ||
638 | This variable must be in your layer or BitBake will not find the patches or | ||
639 | configurations even if you have them in your <filename>SRC_URI</filename>. | ||
640 | The <filename>FILESEXTRAPATHS</filename> variable enables the build process to | ||
641 | find those configuration files. | ||
642 | </para> | ||
643 | |||
644 | <note> | ||
645 | <para> | ||
646 | Other methods exist to accomplish grouping and defining configuration options. | ||
647 | For example, if you are working with a local clone of the kernel repository, | ||
648 | you could checkout the kernel's <filename>meta</filename> branch, make your changes, | ||
649 | and then push the changes to the local bare clone of the kernel. | ||
650 | The result is that you directly add configuration options to the | ||
651 | <filename>meta</filename> branch for your BSP. | ||
652 | The configuration options will likely end up in that location anyway if the BSP gets | ||
653 | added to the Yocto Project. | ||
654 | </para> | ||
655 | |||
656 | <para> | ||
657 | In general, however, the Yocto Project maintainers take care of moving the | ||
658 | <filename>SRC_URI</filename>-specified | ||
659 | configuration options to the kernel's <filename>meta</filename> branch. | ||
660 | Not only is it easier for BSP developers to not have to worry about putting those | ||
661 | configurations in the branch, but having the maintainers do it allows them to apply | ||
662 | 'global' knowledge about the kinds of common configuration options multiple BSPs in | ||
663 | the tree are typically using. | ||
664 | This allows for promotion of common configurations into common features. | ||
665 | </para> | ||
666 | </note> | ||
667 | </section> | ||
668 | </section> | ||
669 | |||
670 | <section id='requirements-and-recommendations-for-released-bsps'> | ||
671 | <title>Requirements and Recommendations for Released BSPs</title> | ||
672 | |||
673 | <para> | ||
674 | Certain requirements exist for a released BSP to be considered | ||
675 | compliant with the Yocto Project. | ||
676 | Additionally, recommendations also exist. | ||
677 | This section describes the requirements and recommendations for | ||
678 | released BSPs. | ||
679 | </para> | ||
680 | |||
681 | <section id='released-bsp-requirements'> | ||
682 | <title>Released BSP Requirements</title> | ||
683 | |||
684 | <para> | ||
685 | Before looking at BSP requirements, you should consider the following: | ||
686 | <itemizedlist> | ||
687 | <listitem><para>The requirements here assume the BSP layer is a well-formed, "legal" | ||
688 | layer that can be added to the Yocto Project. | ||
689 | For guidelines on creating a layer that meets these base requirements, see the | ||
690 | "<link linkend='bsp-layers'>BSP Layers</link>" and the | ||
691 | "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding | ||
692 | and Creating Layers"</ulink> in the Yocto Project Development Manual.</para></listitem> | ||
693 | <listitem><para>The requirements in this section apply regardless of how you | ||
694 | ultimately package a BSP. | ||
695 | You should consult the packaging and distribution guidelines for your | ||
696 | specific release process. | ||
697 | For an example of packaging and distribution requirements, see the | ||
698 | "<ulink url='https://wiki.yoctoproject.org/wiki/Third_Party_BSP_Release_Process'>Third Party BSP Release Process</ulink>" | ||
699 | wiki page.</para></listitem> | ||
700 | <listitem><para>The requirements for the BSP as it is made available to a developer | ||
701 | are completely independent of the released form of the BSP. | ||
702 | For example, the BSP Metadata can be contained within a Git repository | ||
703 | and could have a directory structure completely different from what appears | ||
704 | in the officially released BSP layer.</para></listitem> | ||
705 | <listitem><para>It is not required that specific packages or package | ||
706 | modifications exist in the BSP layer, beyond the requirements for general | ||
707 | compliance with the Yocto Project. | ||
708 | For example, no requirement exists dictating that a specific kernel or | ||
709 | kernel version be used in a given BSP.</para></listitem> | ||
710 | </itemizedlist> | ||
711 | </para> | ||
712 | |||
713 | <para> | ||
714 | Following are the requirements for a released BSP that conforms to the | ||
715 | Yocto Project: | ||
716 | <itemizedlist> | ||
717 | <listitem><para><emphasis>Layer Name:</emphasis> | ||
718 | The BSP must have a layer name that follows the Yocto | ||
719 | Project standards. | ||
720 | For information on BSP layer names, see the | ||
721 | "<link linkend='bsp-layers'>BSP Layers</link>" section. | ||
722 | </para></listitem> | ||
723 | <listitem><para><emphasis>File System Layout:</emphasis> | ||
724 | When possible, use the same directory names in your | ||
725 | BSP layer as listed in the <filename>recipes.txt</filename> file. | ||
726 | In particular, you should place recipes | ||
727 | (<filename>.bb</filename> files) and recipe | ||
728 | modifications (<filename>.bbappend</filename> files) into | ||
729 | <filename>recipes-*</filename> subdirectories by functional area | ||
730 | as outlined in <filename>recipes.txt</filename>. | ||
731 | If you cannot find a category in <filename>recipes.txt</filename> | ||
732 | to fit a particular recipe, you can make up your own | ||
733 | <filename>recipes-*</filename> subdirectory. | ||
734 | You can find <filename>recipes.txt</filename> in the | ||
735 | <filename>meta</filename> directory of the | ||
736 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>, | ||
737 | or in the OpenEmbedded Core Layer | ||
738 | (<filename>openembedded-core</filename>) found at | ||
739 | <ulink url='http://git.openembedded.org/openembedded-core/tree/meta'></ulink>. | ||
740 | </para> | ||
741 | <para>Within any particular <filename>recipes-*</filename> category, the layout | ||
742 | should match what is found in the OpenEmbedded Core | ||
743 | Git repository (<filename>openembedded-core</filename>) | ||
744 | or the Source Directory (<filename>poky</filename>). | ||
745 | In other words, make sure you place related files in appropriately | ||
746 | related <filename>recipes-*</filename> subdirectories specific to the | ||
747 | recipe's function, or within a subdirectory containing a set of closely-related | ||
748 | recipes. | ||
749 | The recipes themselves should follow the general guidelines | ||
750 | for recipes used in the Yocto Project found in the | ||
751 | "<ulink url='https://wiki.yoctoproject.org/wiki/Recipe_%26_Patch_Style_Guide'>Yocto Recipe and Patch Style Guide</ulink>". | ||
752 | </para></listitem> | ||
753 | <listitem><para><emphasis>License File:</emphasis> | ||
754 | You must include a license file in the | ||
755 | <filename>meta-<bsp_name></filename> directory. | ||
756 | This license covers the BSP Metadata as a whole. | ||
757 | You must specify which license to use since there is no | ||
758 | default license if one is not specified. | ||
759 | See the | ||
760 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi/meta-intel/tree/meta-fri2/COPYING.MIT'><filename>COPYING.MIT</filename></ulink> | ||
761 | file for the Fish River Island 2 BSP in the <filename>meta-fri2</filename> BSP layer | ||
762 | as an example.</para></listitem> | ||
763 | <listitem><para><emphasis>README File:</emphasis> | ||
764 | You must include a <filename>README</filename> file in the | ||
765 | <filename>meta-<bsp_name></filename> directory. | ||
766 | See the | ||
767 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi/meta-intel/tree/meta-fri2/README'><filename>README</filename></ulink> | ||
768 | file for the Fish River Island 2 BSP in the <filename>meta-fri2</filename> BSP layer | ||
769 | as an example.</para> | ||
770 | <para>At a minimum, the <filename>README</filename> file should | ||
771 | contain the following: | ||
772 | <itemizedlist> | ||
773 | <listitem><para>A brief description about the hardware the BSP | ||
774 | targets.</para></listitem> | ||
775 | <listitem><para>A list of all the dependencies | ||
776 | on which a BSP layer depends. | ||
777 | These dependencies are typically a list of required layers needed | ||
778 | to build the BSP. | ||
779 | However, the dependencies should also contain information regarding | ||
780 | any other dependencies the BSP might have.</para></listitem> | ||
781 | <listitem><para>Any required special licensing information. | ||
782 | For example, this information includes information on | ||
783 | special variables needed to satisfy a EULA, | ||
784 | or instructions on information needed to build or distribute | ||
785 | binaries built from the BSP Metadata.</para></listitem> | ||
786 | <listitem><para>The name and contact information for the | ||
787 | BSP layer maintainer. | ||
788 | This is the person to whom patches and questions should | ||
789 | be sent. | ||
790 | For information on how to find the right person, see the | ||
791 | "<ulink url='&YOCTO_DOCS_DEV_URL;#how-to-submit-a-change'>How to Submit a Change</ulink>" | ||
792 | section in the Yocto Project Development Manual. | ||
793 | </para></listitem> | ||
794 | <listitem><para>Instructions on how to build the BSP using the BSP | ||
795 | layer.</para></listitem> | ||
796 | <listitem><para>Instructions on how to boot the BSP build from | ||
797 | the BSP layer.</para></listitem> | ||
798 | <listitem><para>Instructions on how to boot the binary images | ||
799 | contained in the <filename>binary</filename> directory, | ||
800 | if present.</para></listitem> | ||
801 | <listitem><para>Information on any known bugs or issues that users | ||
802 | should know about when either building or booting the BSP | ||
803 | binaries.</para></listitem> | ||
804 | </itemizedlist></para></listitem> | ||
805 | <listitem><para><emphasis>README.sources File:</emphasis> | ||
806 | You must include a <filename>README.sources</filename> in the | ||
807 | <filename>meta-<bsp_name></filename> directory. | ||
808 | This file specifies exactly where you can find the sources used to | ||
809 | generate the binary images contained in the | ||
810 | <filename>binary</filename> directory, if present. | ||
811 | See the | ||
812 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi/meta-intel/tree/meta-fri2/README.sources'><filename>README.sources</filename></ulink> | ||
813 | file for the Fish River Island 2 BSP in the <filename>meta-fri2</filename> BSP layer | ||
814 | as an example.</para></listitem> | ||
815 | <listitem><para><emphasis>Layer Configuration File:</emphasis> | ||
816 | You must include a <filename>conf/layer.conf</filename> in the | ||
817 | <filename>meta-<bsp_name></filename> directory. | ||
818 | This file identifies the <filename>meta-<bsp_name></filename> | ||
819 | BSP layer as a layer to the build system.</para></listitem> | ||
820 | <listitem><para><emphasis>Machine Configuration File:</emphasis> | ||
821 | You must include one or more <filename>conf/machine/<bsp_name>.conf</filename> | ||
822 | files in the <filename>meta-<bsp_name></filename> directory. | ||
823 | These configuration files define machine targets that can be built | ||
824 | using the BSP layer. | ||
825 | Multiple machine configuration files define variations of machine | ||
826 | configurations that are supported by the BSP. | ||
827 | If a BSP supports multiple machine variations, you need to | ||
828 | adequately describe each variation in the BSP | ||
829 | <filename>README</filename> file. | ||
830 | Do not use multiple machine configuration files to describe disparate | ||
831 | hardware. | ||
832 | If you do have very different targets, you should create separate | ||
833 | BSP layers for each target. | ||
834 | <note>It is completely possible for a developer to structure the | ||
835 | working repository as a conglomeration of unrelated BSP | ||
836 | files, and to possibly generate BSPs targeted for release | ||
837 | from that directory using scripts or some other mechanism | ||
838 | (e.g. <filename>meta-yocto-bsp</filename> layer). | ||
839 | Such considerations are outside the scope of this document.</note> | ||
840 | </para></listitem> | ||
841 | </itemizedlist> | ||
842 | </para> | ||
843 | </section> | ||
844 | |||
845 | <section id='released-bsp-recommendations'> | ||
846 | <title>Released BSP Recommendations</title> | ||
847 | |||
848 | <para> | ||
849 | Following are recommendations for a released BSP that conforms to the | ||
850 | Yocto Project: | ||
851 | <itemizedlist> | ||
852 | <listitem><para><emphasis>Bootable Images:</emphasis> | ||
853 | BSP releases | ||
854 | can contain one or more bootable images. | ||
855 | Including bootable images allows users to easily try out the BSP | ||
856 | on their own hardware.</para> | ||
857 | <para>In some cases, it might not be convenient to include a | ||
858 | bootable image. | ||
859 | In this case, you might want to make two versions of the | ||
860 | BSP available: one that contains binary images, and one | ||
861 | that does not. | ||
862 | The version that does not contain bootable images avoids | ||
863 | unnecessary download times for users not interested in the images. | ||
864 | </para> | ||
865 | <para>If you need to distribute a BSP and include bootable images or build kernel and | ||
866 | filesystems meant to allow users to boot the BSP for evaluation | ||
867 | purposes, you should put the images and artifacts within a | ||
868 | <filename>binary/</filename> subdirectory located in the | ||
869 | <filename>meta-<bsp_name></filename> directory. | ||
870 | <note>If you do include a bootable image as part of the BSP and the image | ||
871 | was built by software covered by the GPL or other open source licenses, | ||
872 | it is your responsibility to understand | ||
873 | and meet all licensing requirements, which could include distribution | ||
874 | of source files.</note></para></listitem> | ||
875 | <listitem><para><emphasis>Use a Yocto Linux Kernel:</emphasis> | ||
876 | Kernel recipes in the BSP should be based on a Yocto Linux kernel. | ||
877 | Basing your recipes on these kernels reduces the costs for maintaining | ||
878 | the BSP and increases its scalability. | ||
879 | See the <filename>Yocto Linux Kernel</filename> category in the | ||
880 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi'>Source Repositories</ulink> | ||
881 | for these kernels.</para></listitem> | ||
882 | </itemizedlist> | ||
883 | </para> | ||
884 | </section> | ||
885 | </section> | ||
886 | |||
887 | <section id='customizing-a-recipe-for-a-bsp'> | ||
888 | <title>Customizing a Recipe for a BSP</title> | ||
889 | |||
890 | <para> | ||
891 | If you plan on customizing a recipe for a particular BSP, you need to do the | ||
892 | following: | ||
893 | <itemizedlist> | ||
894 | <listitem><para>Create a <filename>.bbappend</filename> | ||
895 | file for the modified recipe. | ||
896 | For information on using append files, see the | ||
897 | "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files</ulink>" | ||
898 | section in the Yocto Project Development Manual. | ||
899 | </para></listitem> | ||
900 | <listitem><para> | ||
901 | Ensure your directory structure in the BSP layer | ||
902 | that supports your machine is such that it can be found | ||
903 | by the build system. | ||
904 | See the example later in this section for more information. | ||
905 | </para></listitem> | ||
906 | <listitem><para> | ||
907 | Put the append file in a directory whose name matches | ||
908 | the machine's name and is located in an appropriate | ||
909 | sub-directory inside the BSP layer (i.e. | ||
910 | <filename>recipes-bsp</filename>, <filename>recipes-graphics</filename>, | ||
911 | <filename>recipes-core</filename>, and so forth). | ||
912 | </para></listitem> | ||
913 | <listitem><para>Place the BSP-specific files in the directory named for | ||
914 | your machine inside the BSP layer. | ||
915 | </para></listitem> | ||
916 | </itemizedlist> | ||
917 | </para> | ||
918 | |||
919 | <para> | ||
920 | Following is a specific example to help you better understand the process. | ||
921 | Consider an example that customizes a recipe by adding | ||
922 | a BSP-specific configuration file named <filename>interfaces</filename> to the | ||
923 | <filename>init-ifupdown_1.0.bb</filename> recipe for machine "xyz". | ||
924 | Do the following: | ||
925 | <orderedlist> | ||
926 | <listitem><para>Edit the <filename>init-ifupdown_1.0.bbappend</filename> file so that it | ||
927 | contains the following: | ||
928 | <literallayout class='monospaced'> | ||
929 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
930 | </literallayout> | ||
931 | The append file needs to be in the | ||
932 | <filename>meta-xyz/recipes-core/init-ifupdown</filename> directory. | ||
933 | </para></listitem> | ||
934 | <listitem><para>Create and place the new <filename>interfaces</filename> | ||
935 | configuration file in the BSP's layer here: | ||
936 | <literallayout class='monospaced'> | ||
937 | meta-xyz/recipes-core/init-ifupdown/files/xyz/interfaces | ||
938 | </literallayout> | ||
939 | The | ||
940 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink> | ||
941 | variable in the append files extends the search path | ||
942 | the build system uses to find files during the build. | ||
943 | Consequently, for this example you need to have the | ||
944 | <filename>files</filename> directory in the same location | ||
945 | as your append file.</para></listitem> | ||
946 | </orderedlist> | ||
947 | </para> | ||
948 | </section> | ||
949 | |||
950 | <section id='bsp-licensing-considerations'> | ||
951 | <title>BSP Licensing Considerations</title> | ||
952 | |||
953 | <para> | ||
954 | In some cases, a BSP contains separately licensed Intellectual Property (IP) | ||
955 | for a component or components. | ||
956 | For these cases, you are required to accept the terms of a commercial or other | ||
957 | type of license that requires some kind of explicit End User License Agreement (EULA). | ||
958 | Once the license is accepted, the OpenEmbedded build system can then build and | ||
959 | include the corresponding component in the final BSP image. | ||
960 | If the BSP is available as a pre-built image, you can download the image after | ||
961 | agreeing to the license or EULA. | ||
962 | </para> | ||
963 | |||
964 | <para> | ||
965 | You could find that some separately licensed components that are essential | ||
966 | for normal operation of the system might not have an unencumbered (or free) | ||
967 | substitute. | ||
968 | Without these essential components, the system would be non-functional. | ||
969 | Then again, you might find that other licensed components that are simply | ||
970 | 'good-to-have' or purely elective do have an unencumbered, free replacement | ||
971 | component that you can use rather than agreeing to the separately licensed component. | ||
972 | Even for components essential to the system, you might find an unencumbered component | ||
973 | that is not identical but will work as a less-capable version of the | ||
974 | licensed version in the BSP recipe. | ||
975 | </para> | ||
976 | |||
977 | <para> | ||
978 | For cases where you can substitute a free component and still | ||
979 | maintain the system's functionality, the "Downloads" page from the | ||
980 | <ulink url='&YOCTO_HOME_URL;'>Yocto Project website's</ulink> | ||
981 | makes available de-featured BSPs | ||
982 | that are completely free of any IP encumbrances. | ||
983 | For these cases, you can use the substitution directly and | ||
984 | without any further licensing requirements. | ||
985 | If present, these fully de-featured BSPs are named appropriately | ||
986 | different as compared to the names of the respective | ||
987 | encumbered BSPs. | ||
988 | If available, these substitutions are your | ||
989 | simplest and most preferred options. | ||
990 | Use of these substitutions of course assumes the resulting functionality meets | ||
991 | system requirements. | ||
992 | </para> | ||
993 | |||
994 | <para> | ||
995 | If however, a non-encumbered version is unavailable or | ||
996 | it provides unsuitable functionality or quality, you can use an encumbered | ||
997 | version. | ||
998 | </para> | ||
999 | |||
1000 | <para> | ||
1001 | A couple different methods exist within the OpenEmbedded build system to | ||
1002 | satisfy the licensing requirements for an encumbered BSP. | ||
1003 | The following list describes them in order of preference: | ||
1004 | <orderedlist> | ||
1005 | <listitem><para><emphasis>Use the <filename>LICENSE_FLAGS</filename> variable | ||
1006 | to define the recipes that have commercial or other types of | ||
1007 | specially-licensed packages:</emphasis> | ||
1008 | For each of those recipes, you can | ||
1009 | specify a matching license string in a | ||
1010 | <filename>local.conf</filename> variable named | ||
1011 | <filename>LICENSE_FLAGS_WHITELIST</filename>. | ||
1012 | Specifying the matching license string signifies that you agree to the license. | ||
1013 | Thus, the build system can build the corresponding recipe and include | ||
1014 | the component in the image. | ||
1015 | See the | ||
1016 | "<ulink url='&YOCTO_DOCS_REF_URL;#enabling-commercially-licensed-recipes'>Enabling | ||
1017 | Commercially Licensed Recipes</ulink>" section in the Yocto Project Reference | ||
1018 | Manual for details on how to use these variables.</para> | ||
1019 | <para>If you build as you normally would, without | ||
1020 | specifying any recipes in the | ||
1021 | <filename>LICENSE_FLAGS_WHITELIST</filename>, the build stops and | ||
1022 | provides you with the list of recipes that you have | ||
1023 | tried to include in the image that need entries in | ||
1024 | the <filename>LICENSE_FLAGS_WHITELIST</filename>. | ||
1025 | Once you enter the appropriate license flags into the whitelist, | ||
1026 | restart the build to continue where it left off. | ||
1027 | During the build, the prompt will not appear again | ||
1028 | since you have satisfied the requirement.</para> | ||
1029 | <para>Once the appropriate license flags are on the white list | ||
1030 | in the <filename>LICENSE_FLAGS_WHITELIST</filename> variable, you | ||
1031 | can build the encumbered image with no change at all | ||
1032 | to the normal build process.</para></listitem> | ||
1033 | <listitem><para><emphasis>Get a pre-built version of the BSP:</emphasis> | ||
1034 | You can get this type of BSP by visiting the | ||
1035 | "Downloads" page of the | ||
1036 | <ulink url='&YOCTO_HOME_URL;'>Yocto Project website</ulink>. | ||
1037 | You can download BSP tarballs that contain proprietary components | ||
1038 | after agreeing to the licensing | ||
1039 | requirements of each of the individually encumbered | ||
1040 | packages as part of the download process. | ||
1041 | Obtaining the BSP this way allows you to access an encumbered | ||
1042 | image immediately after agreeing to the | ||
1043 | click-through license agreements presented by the | ||
1044 | website. | ||
1045 | Note that if you want to build the image | ||
1046 | yourself using the recipes contained within the BSP | ||
1047 | tarball, you will still need to create an | ||
1048 | appropriate <filename>LICENSE_FLAGS_WHITELIST</filename> to match the | ||
1049 | encumbered recipes in the BSP.</para></listitem> | ||
1050 | </orderedlist> | ||
1051 | </para> | ||
1052 | |||
1053 | <note> | ||
1054 | Pre-compiled images are bundled with | ||
1055 | a time-limited kernel that runs for a | ||
1056 | predetermined amount of time (10 days) before it forces | ||
1057 | the system to reboot. | ||
1058 | This limitation is meant to discourage direct redistribution | ||
1059 | of the image. | ||
1060 | You must eventually rebuild the image if you want to remove this restriction. | ||
1061 | </note> | ||
1062 | </section> | ||
1063 | |||
1064 | <section id='using-the-yocto-projects-bsp-tools'> | ||
1065 | <title>Using the Yocto Project's BSP Tools</title> | ||
1066 | |||
1067 | <para> | ||
1068 | The Yocto Project includes a couple of tools that enable | ||
1069 | you to create a <link linkend='bsp-layers'>BSP layer</link> | ||
1070 | from scratch and do basic configuration and maintenance | ||
1071 | of the kernel without ever looking at a Metadata file. | ||
1072 | These tools are <filename>yocto-bsp</filename> and <filename>yocto-kernel</filename>, | ||
1073 | respectively. | ||
1074 | </para> | ||
1075 | |||
1076 | <para> | ||
1077 | The following sections describe the common location and help features as well | ||
1078 | as provide details for the | ||
1079 | <filename>yocto-bsp</filename> and <filename>yocto-kernel</filename> tools. | ||
1080 | </para> | ||
1081 | |||
1082 | <section id='common-features'> | ||
1083 | <title>Common Features</title> | ||
1084 | |||
1085 | <para> | ||
1086 | Designed to have a command interface somewhat like | ||
1087 | <ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink>, each | ||
1088 | tool is structured as a set of sub-commands under a | ||
1089 | top-level command. | ||
1090 | The top-level command (<filename>yocto-bsp</filename> | ||
1091 | or <filename>yocto-kernel</filename>) itself does | ||
1092 | nothing but invoke or provide help on the sub-commands | ||
1093 | it supports. | ||
1094 | </para> | ||
1095 | |||
1096 | <para> | ||
1097 | Both tools reside in the <filename>scripts/</filename> subdirectory | ||
1098 | of the <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
1099 | Consequently, to use the scripts, you must <filename>source</filename> the | ||
1100 | environment just as you would when invoking a build: | ||
1101 | <literallayout class='monospaced'> | ||
1102 | $ source oe-init-build-env [build_dir] | ||
1103 | </literallayout> | ||
1104 | </para> | ||
1105 | |||
1106 | <para> | ||
1107 | The most immediately useful function is to get help on both tools. | ||
1108 | The built-in help system makes it easy to drill down at | ||
1109 | any time and view the syntax required for any specific command. | ||
1110 | Simply enter the name of the command with the <filename>help</filename> | ||
1111 | switch: | ||
1112 | <literallayout class='monospaced'> | ||
1113 | $ yocto-bsp help | ||
1114 | Usage: | ||
1115 | |||
1116 | Create a customized Yocto BSP layer. | ||
1117 | |||
1118 | usage: yocto-bsp [--version] [--help] COMMAND [ARGS] | ||
1119 | |||
1120 | Current 'yocto-bsp' commands are: | ||
1121 | create Create a new Yocto BSP | ||
1122 | list List available values for options and BSP properties | ||
1123 | |||
1124 | See 'yocto-bsp help COMMAND' for more information on a specific command. | ||
1125 | |||
1126 | |||
1127 | Options: | ||
1128 | --version show program's version number and exit | ||
1129 | -h, --help show this help message and exit | ||
1130 | -D, --debug output debug information | ||
1131 | </literallayout> | ||
1132 | </para> | ||
1133 | |||
1134 | <para> | ||
1135 | Similarly, entering just the name of a sub-command shows the detailed usage | ||
1136 | for that sub-command: | ||
1137 | <literallayout class='monospaced'> | ||
1138 | $ yocto-bsp create | ||
1139 | |||
1140 | Usage: | ||
1141 | |||
1142 | Create a new Yocto BSP | ||
1143 | |||
1144 | usage: yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>] | ||
1145 | [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>] | ||
1146 | |||
1147 | This command creates a Yocto BSP based on the specified parameters. | ||
1148 | The new BSP will be a new Yocto BSP layer contained by default within | ||
1149 | the top-level directory specified as 'meta-bsp-name'. The -o option | ||
1150 | can be used to place the BSP layer in a directory with a different | ||
1151 | name and location. | ||
1152 | |||
1153 | ... | ||
1154 | </literallayout> | ||
1155 | </para> | ||
1156 | |||
1157 | <para> | ||
1158 | For any sub-command, you can use the word "help" option just before the | ||
1159 | sub-command to get more extensive documentation: | ||
1160 | <literallayout class='monospaced'> | ||
1161 | $ yocto-bsp help create | ||
1162 | |||
1163 | NAME | ||
1164 | yocto-bsp create - Create a new Yocto BSP | ||
1165 | |||
1166 | SYNOPSIS | ||
1167 | yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>] | ||
1168 | [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>] | ||
1169 | |||
1170 | DESCRIPTION | ||
1171 | This command creates a Yocto BSP based on the specified | ||
1172 | parameters. The new BSP will be a new Yocto BSP layer contained | ||
1173 | by default within the top-level directory specified as | ||
1174 | 'meta-bsp-name'. The -o option can be used to place the BSP layer | ||
1175 | in a directory with a different name and location. | ||
1176 | |||
1177 | The value of the 'karch' parameter determines the set of files | ||
1178 | that will be generated for the BSP, along with the specific set of | ||
1179 | 'properties' that will be used to fill out the BSP-specific | ||
1180 | portions of the BSP. The possible values for the 'karch' parameter | ||
1181 | can be listed via 'yocto-bsp list karch'. | ||
1182 | |||
1183 | ... | ||
1184 | </literallayout> | ||
1185 | </para> | ||
1186 | |||
1187 | <para> | ||
1188 | Now that you know where these two commands reside and how to access information | ||
1189 | on them, you should find it relatively straightforward to discover the commands | ||
1190 | necessary to create a BSP and perform basic kernel maintenance on that BSP using | ||
1191 | the tools. | ||
1192 | <note> | ||
1193 | You can also use the <filename>yocto-layer</filename> tool to create | ||
1194 | a "generic" layer. | ||
1195 | For information on this tool, see the | ||
1196 | "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-general-layer-using-the-yocto-layer-script'>Creating a General Layer Using the yocto-layer Script</ulink>" | ||
1197 | section in the Yocto Project Development Guide. | ||
1198 | </note> | ||
1199 | </para> | ||
1200 | |||
1201 | <para> | ||
1202 | The next sections provide a concrete starting point to expand on a few points that | ||
1203 | might not be immediately obvious or that could use further explanation. | ||
1204 | </para> | ||
1205 | </section> | ||
1206 | |||
1207 | |||
1208 | <section id='creating-a-new-bsp-layer-using-the-yocto-bsp-script'> | ||
1209 | <title>Creating a new BSP Layer Using the yocto-bsp Script</title> | ||
1210 | |||
1211 | <para> | ||
1212 | The <filename>yocto-bsp</filename> script creates a new | ||
1213 | <link linkend='bsp-layers'>BSP layer</link> for any architecture supported | ||
1214 | by the Yocto Project, as well as QEMU versions of the same. | ||
1215 | The default mode of the script's operation is to prompt you for information needed | ||
1216 | to generate the BSP layer. | ||
1217 | </para> | ||
1218 | |||
1219 | <para> | ||
1220 | For the current set of BSPs, the script prompts you for various important | ||
1221 | parameters such as: | ||
1222 | <itemizedlist> | ||
1223 | <listitem><para>The kernel to use</para></listitem> | ||
1224 | <listitem><para>The branch of that kernel to use (or re-use)</para></listitem> | ||
1225 | <listitem><para>Whether or not to use X, and if so, which drivers to use</para></listitem> | ||
1226 | <listitem><para>Whether to turn on SMP</para></listitem> | ||
1227 | <listitem><para>Whether the BSP has a keyboard</para></listitem> | ||
1228 | <listitem><para>Whether the BSP has a touchscreen</para></listitem> | ||
1229 | <listitem><para>Remaining configurable items associated with the BSP</para></listitem> | ||
1230 | </itemizedlist> | ||
1231 | </para> | ||
1232 | |||
1233 | <para> | ||
1234 | You use the <filename>yocto-bsp create</filename> sub-command to create | ||
1235 | a new BSP layer. | ||
1236 | This command requires you to specify a particular kernel architecture | ||
1237 | (<filename>karch</filename>) on which to base the BSP. | ||
1238 | Assuming you have sourced the environment, you can use the | ||
1239 | <filename>yocto-bsp list karch</filename> sub-command to list the | ||
1240 | architectures available for BSP creation as follows: | ||
1241 | <literallayout class='monospaced'> | ||
1242 | $ yocto-bsp list karch | ||
1243 | Architectures available: | ||
1244 | powerpc | ||
1245 | i386 | ||
1246 | x86_64 | ||
1247 | arm | ||
1248 | qemu | ||
1249 | mips | ||
1250 | </literallayout> | ||
1251 | </para> | ||
1252 | |||
1253 | <para> | ||
1254 | The remainder of this section presents an example that uses | ||
1255 | <filename>myarm</filename> as the machine name and <filename>qemu</filename> | ||
1256 | as the machine architecture. | ||
1257 | Of the available architectures, <filename>qemu</filename> is the only architecture | ||
1258 | that causes the script to prompt you further for an actual architecture. | ||
1259 | In every other way, this architecture is representative of how creating a BSP for | ||
1260 | an actual machine would work. | ||
1261 | The reason the example uses this architecture is because it is an emulated architecture | ||
1262 | and can easily be followed without requiring actual hardware. | ||
1263 | </para> | ||
1264 | |||
1265 | <para> | ||
1266 | As the <filename>yocto-bsp create</filename> command runs, default values for | ||
1267 | the prompts appear in brackets. | ||
1268 | Pressing enter without supplying anything on the command line or pressing enter | ||
1269 | with an invalid response causes the script to accept the default value. | ||
1270 | Once the script completes, the new <filename>meta-myarm</filename> BSP layer | ||
1271 | is created in the current working directory. | ||
1272 | This example assumes you have sourced the | ||
1273 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> | ||
1274 | setup script. | ||
1275 | </para> | ||
1276 | |||
1277 | <para> | ||
1278 | Following is the complete example: | ||
1279 | <literallayout class='monospaced'> | ||
1280 | $ yocto-bsp create myarm qemu | ||
1281 | Checking basic git connectivity... | ||
1282 | Done. | ||
1283 | |||
1284 | Which qemu architecture would you like to use? [default: i386] | ||
1285 | 1) i386 (32-bit) | ||
1286 | 2) x86_64 (64-bit) | ||
1287 | 3) ARM (32-bit) | ||
1288 | 4) PowerPC (32-bit) | ||
1289 | 5) MIPS (32-bit) | ||
1290 | 3 | ||
1291 | Would you like to use the default (3.10) kernel? (y/n) [default: y] y | ||
1292 | Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [y/n] [default: y] | ||
1293 | Getting branches from remote repo git://git.yoctoproject.org/linux-yocto-3.10.git... | ||
1294 | Please choose a machine branch to base your new BSP branch on: [default: standard/base] | ||
1295 | 1) standard/arm-versatile-926ejs | ||
1296 | 2) standard/base | ||
1297 | 3) standard/beagleboard | ||
1298 | 4) standard/beaglebone | ||
1299 | 5) standard/ck | ||
1300 | 6) standard/crownbay | ||
1301 | 7) standard/edgerouter | ||
1302 | 8) standard/emenlow | ||
1303 | 9) standard/fri2 | ||
1304 | 10) standard/fsl-mpc8315e-rdb | ||
1305 | 11) standard/mti-malta32 | ||
1306 | 12) standard/mti-malta64 | ||
1307 | 13) standard/qemuppc | ||
1308 | 14) standard/routerstationpro | ||
1309 | 15) standard/sys940x | ||
1310 | 1 | ||
1311 | Would you like SMP support? (y/n) [default: y] | ||
1312 | Does your BSP have a touchscreen? (y/n) [default: n] | ||
1313 | Does your BSP have a keyboard? (y/n) [default: y] | ||
1314 | |||
1315 | New qemu BSP created in meta-myarm | ||
1316 | </literallayout> | ||
1317 | Take a closer look at the example now: | ||
1318 | <orderedlist> | ||
1319 | <listitem><para>For the QEMU architecture, | ||
1320 | the script first prompts you for which emulated architecture to use. | ||
1321 | In the example, we use the ARM architecture. | ||
1322 | </para></listitem> | ||
1323 | <listitem><para>The script then prompts you for the kernel. | ||
1324 | The default 3.14 kernel is acceptable. | ||
1325 | So, the example accepts the default. | ||
1326 | If you enter 'n', the script prompts you to further enter the kernel | ||
1327 | you do want to use.</para></listitem> | ||
1328 | <listitem><para>Next, the script asks whether you would like to have a new | ||
1329 | branch created especially for your BSP in the local | ||
1330 | <ulink url='&YOCTO_DOCS_DEV_URL;#local-kernel-files'>Linux Yocto Kernel</ulink> | ||
1331 | Git repository . | ||
1332 | If not, then the script re-uses an existing branch.</para> | ||
1333 | <para>In this example, the default (or "yes") is accepted. | ||
1334 | Thus, a new branch is created for the BSP rather than using a common, shared | ||
1335 | branch. | ||
1336 | The new branch is the branch committed to for any patches you might later add. | ||
1337 | The reason a new branch is the default is that typically | ||
1338 | new BSPs do require BSP-specific patches. | ||
1339 | The tool thus assumes that most of time a new branch is required. | ||
1340 | </para></listitem> | ||
1341 | <listitem><para>Regardless of which choice you make in the previous step, | ||
1342 | you are now given the opportunity to select a particular machine branch on | ||
1343 | which to base your new BSP-specific machine branch | ||
1344 | (or to re-use if you had elected to not create a new branch). | ||
1345 | Because this example is generating an ARM-based BSP, the example | ||
1346 | uses <filename>#1</filename> at the prompt, which selects the ARM-versatile branch. | ||
1347 | </para></listitem> | ||
1348 | <listitem><para>The remainder of the prompts are routine. | ||
1349 | Defaults are accepted for each.</para></listitem> | ||
1350 | <listitem><para>By default, the script creates the new BSP Layer in the | ||
1351 | current working directory of the | ||
1352 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>, | ||
1353 | which is <filename>poky</filename> in this case. | ||
1354 | </para></listitem> | ||
1355 | </orderedlist> | ||
1356 | </para> | ||
1357 | |||
1358 | <para> | ||
1359 | Once the BSP Layer is created, you must add it to your | ||
1360 | <filename>bblayers.conf</filename> file. | ||
1361 | Here is an example: | ||
1362 | <literallayout class='monospaced'> | ||
1363 | BBLAYERS = ? " \ | ||
1364 | /usr/local/src/yocto/meta \ | ||
1365 | /usr/local/src/yocto/meta-yocto \ | ||
1366 | /usr/local/src/yocto/meta-yocto-bsp \ | ||
1367 | /usr/local/src/yocto/meta-myarm \ | ||
1368 | " | ||
1369 | |||
1370 | BBLAYERS_NON_REMOVABLE ?= " \ | ||
1371 | /usr/local/src/yocto/meta \ | ||
1372 | /usr/local/src/yocto/meta-yocto \ | ||
1373 | " | ||
1374 | </literallayout> | ||
1375 | Adding the layer to this file allows the build system to build the BSP and | ||
1376 | the <filename>yocto-kernel</filename> tool to be able to find the layer and | ||
1377 | other Metadata it needs on which to operate. | ||
1378 | </para> | ||
1379 | </section> | ||
1380 | |||
1381 | <section id='managing-kernel-patches-and-config-items-with-yocto-kernel'> | ||
1382 | <title>Managing Kernel Patches and Config Items with yocto-kernel</title> | ||
1383 | |||
1384 | <para> | ||
1385 | Assuming you have created a <link linkend='bsp-layers'>BSP Layer</link> using | ||
1386 | <link linkend='creating-a-new-bsp-layer-using-the-yocto-bsp-script'> | ||
1387 | <filename>yocto-bsp</filename></link> and you added it to your | ||
1388 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink> | ||
1389 | variable in the <filename>bblayers.conf</filename> file, you can now use | ||
1390 | the <filename>yocto-kernel</filename> script to add patches and configuration | ||
1391 | items to the BSP's kernel. | ||
1392 | </para> | ||
1393 | |||
1394 | <para> | ||
1395 | The <filename>yocto-kernel</filename> script allows you to add, remove, and list patches | ||
1396 | and kernel config settings to a BSP's kernel | ||
1397 | <filename>.bbappend</filename> file. | ||
1398 | All you need to do is use the appropriate sub-command. | ||
1399 | Recall that the easiest way to see exactly what sub-commands are available | ||
1400 | is to use the <filename>yocto-kernel</filename> built-in help as follows: | ||
1401 | <literallayout class='monospaced'> | ||
1402 | $ yocto-kernel | ||
1403 | Usage: | ||
1404 | |||
1405 | Modify and list Yocto BSP kernel config items and patches. | ||
1406 | |||
1407 | usage: yocto-kernel [--version] [--help] COMMAND [ARGS] | ||
1408 | |||
1409 | Current 'yocto-kernel' commands are: | ||
1410 | config list List the modifiable set of bare kernel config options for a BSP | ||
1411 | config add Add or modify bare kernel config options for a BSP | ||
1412 | config rm Remove bare kernel config options from a BSP | ||
1413 | patch list List the patches associated with a BSP | ||
1414 | patch add Patch the Yocto kernel for a BSP | ||
1415 | patch rm Remove patches from a BSP | ||
1416 | feature list List the features used by a BSP | ||
1417 | feature add Have a BSP use a feature | ||
1418 | feature rm Have a BSP stop using a feature | ||
1419 | features list List the features available to BSPs | ||
1420 | feature describe Describe a particular feature | ||
1421 | feature create Create a new BSP-local feature | ||
1422 | feature destroy Remove a BSP-local feature | ||
1423 | |||
1424 | See 'yocto-kernel help COMMAND' for more information on a specific command. | ||
1425 | |||
1426 | |||
1427 | |||
1428 | Options: | ||
1429 | --version show program's version number and exit | ||
1430 | -h, --help show this help message and exit | ||
1431 | -D, --debug output debug information | ||
1432 | </literallayout> | ||
1433 | </para> | ||
1434 | |||
1435 | <para> | ||
1436 | The <filename>yocto-kernel patch add</filename> sub-command allows you to add a | ||
1437 | patch to a BSP. | ||
1438 | The following example adds two patches to the <filename>myarm</filename> BSP: | ||
1439 | <literallayout class='monospaced'> | ||
1440 | $ yocto-kernel patch add myarm ~/test.patch | ||
1441 | Added patches: | ||
1442 | test.patch | ||
1443 | |||
1444 | $ yocto-kernel patch add myarm ~/yocto-testmod.patch | ||
1445 | Added patches: | ||
1446 | yocto-testmod.patch | ||
1447 | </literallayout> | ||
1448 | <note>Although the previous example adds patches one at a time, it is possible | ||
1449 | to add multiple patches at the same time.</note> | ||
1450 | </para> | ||
1451 | |||
1452 | <para> | ||
1453 | You can verify patches have been added by using the | ||
1454 | <filename>yocto-kernel patch list</filename> sub-command. | ||
1455 | Here is an example: | ||
1456 | <literallayout class='monospaced'> | ||
1457 | $ yocto-kernel patch list myarm | ||
1458 | The current set of machine-specific patches for myarm is: | ||
1459 | 1) test.patch | ||
1460 | 2) yocto-testmod.patch | ||
1461 | </literallayout> | ||
1462 | </para> | ||
1463 | |||
1464 | <para> | ||
1465 | You can also use the <filename>yocto-kernel</filename> script to | ||
1466 | remove a patch using the <filename>yocto-kernel patch rm</filename> sub-command. | ||
1467 | Here is an example: | ||
1468 | <literallayout class='monospaced'> | ||
1469 | $ yocto-kernel patch rm myarm | ||
1470 | Specify the patches to remove: | ||
1471 | 1) test.patch | ||
1472 | 2) yocto-testmod.patch | ||
1473 | 1 | ||
1474 | Removed patches: | ||
1475 | test.patch | ||
1476 | </literallayout> | ||
1477 | </para> | ||
1478 | |||
1479 | <para> | ||
1480 | Again, using the <filename>yocto-kernel patch list</filename> sub-command, | ||
1481 | you can verify that the patch was in fact removed: | ||
1482 | <literallayout class='monospaced'> | ||
1483 | $ yocto-kernel patch list myarm | ||
1484 | The current set of machine-specific patches for myarm is: | ||
1485 | 1) yocto-testmod.patch | ||
1486 | </literallayout> | ||
1487 | </para> | ||
1488 | |||
1489 | <para> | ||
1490 | In a completely similar way, you can use the <filename>yocto-kernel config add</filename> | ||
1491 | sub-command to add one or more kernel config item settings to a BSP. | ||
1492 | The following commands add a couple of config items to the | ||
1493 | <filename>myarm</filename> BSP: | ||
1494 | <literallayout class='monospaced'> | ||
1495 | $ yocto-kernel config add myarm CONFIG_MISC_DEVICES=y | ||
1496 | Added items: | ||
1497 | CONFIG_MISC_DEVICES=y | ||
1498 | |||
1499 | $ yocto-kernel config add myarm CONFIG_YOCTO_TESTMOD=y | ||
1500 | Added items: | ||
1501 | CONFIG_YOCTO_TESTMOD=y | ||
1502 | </literallayout> | ||
1503 | <note>Although the previous example adds config items one at a time, it is possible | ||
1504 | to add multiple config items at the same time.</note> | ||
1505 | </para> | ||
1506 | |||
1507 | <para> | ||
1508 | You can list the config items now associated with the BSP. | ||
1509 | Doing so shows you the config items you added as well as others associated | ||
1510 | with the BSP: | ||
1511 | <literallayout class='monospaced'> | ||
1512 | $ yocto-kernel config list myarm | ||
1513 | The current set of machine-specific kernel config items for myarm is: | ||
1514 | 1) CONFIG_MISC_DEVICES=y | ||
1515 | 2) CONFIG_YOCTO_TESTMOD=y | ||
1516 | </literallayout> | ||
1517 | </para> | ||
1518 | |||
1519 | <para> | ||
1520 | Finally, you can remove one or more config items using the | ||
1521 | <filename>yocto-kernel config rm</filename> sub-command in a manner | ||
1522 | completely analogous to <filename>yocto-kernel patch rm</filename>. | ||
1523 | </para> | ||
1524 | </section> | ||
1525 | </section> | ||
1526 | </chapter> | ||
diff --git a/documentation/bsp-guide/figures/bsp-title.png b/documentation/bsp-guide/figures/bsp-title.png new file mode 100644 index 0000000..f624dd4 --- /dev/null +++ b/documentation/bsp-guide/figures/bsp-title.png | |||
Binary files differ | |||
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml new file mode 100644 index 0000000..0d16dbe --- /dev/null +++ b/documentation/dev-manual/dev-manual-common-tasks.xml | |||
@@ -0,0 +1,8501 @@ | |||
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 | |||
5 | <chapter id='extendpoky'> | ||
6 | |||
7 | <title>Common Tasks</title> | ||
8 | <para> | ||
9 | This chapter describes fundamental procedures such as creating layers, | ||
10 | adding new software packages, extending or customizing images, | ||
11 | porting work to new hardware (adding a new machine), and so forth. | ||
12 | You will find that the procedures documented here occur often in the | ||
13 | development cycle using the Yocto Project. | ||
14 | </para> | ||
15 | |||
16 | <section id="understanding-and-creating-layers"> | ||
17 | <title>Understanding and Creating Layers</title> | ||
18 | |||
19 | <para> | ||
20 | The OpenEmbedded build system supports organizing | ||
21 | <link linkend='metadata'>Metadata</link> into multiple layers. | ||
22 | Layers allow you to isolate different types of customizations from | ||
23 | each other. | ||
24 | You might find it tempting to keep everything in one layer when | ||
25 | working on a single project. | ||
26 | However, the more modular your Metadata, the easier | ||
27 | it is to cope with future changes. | ||
28 | </para> | ||
29 | |||
30 | <para> | ||
31 | To illustrate how layers are used to keep things modular, consider | ||
32 | machine customizations. | ||
33 | These types of customizations typically reside in a special layer, | ||
34 | rather than a general layer, called a Board Support Package (BSP) | ||
35 | Layer. | ||
36 | Furthermore, the machine customizations should be isolated from | ||
37 | recipes and Metadata that support a new GUI environment, | ||
38 | for example. | ||
39 | This situation gives you a couple of layers: one for the machine | ||
40 | configurations, and one for the GUI environment. | ||
41 | It is important to understand, however, that the BSP layer can | ||
42 | still make machine-specific additions to recipes within the GUI | ||
43 | environment layer without polluting the GUI layer itself | ||
44 | with those machine-specific changes. | ||
45 | You can accomplish this through a recipe that is a BitBake append | ||
46 | (<filename>.bbappend</filename>) file, which is described later | ||
47 | in this section. | ||
48 | </para> | ||
49 | |||
50 | <para> | ||
51 | </para> | ||
52 | |||
53 | <section id='yocto-project-layers'> | ||
54 | <title>Layers</title> | ||
55 | |||
56 | <para> | ||
57 | The <link linkend='source-directory'>Source Directory</link> | ||
58 | contains both general layers and BSP | ||
59 | layers right out of the box. | ||
60 | You can easily identify layers that ship with a | ||
61 | Yocto Project release in the Source Directory by their | ||
62 | folder names. | ||
63 | Folders that represent layers typically have names that begin with | ||
64 | the string <filename>meta-</filename>. | ||
65 | <note> | ||
66 | It is not a requirement that a layer name begin with the | ||
67 | prefix <filename>meta-</filename>, but it is a commonly | ||
68 | accepted standard in the Yocto Project community. | ||
69 | </note> | ||
70 | For example, when you set up the Source Directory structure, | ||
71 | you will see several layers: | ||
72 | <filename>meta</filename>, | ||
73 | <filename>meta-skeleton</filename>, | ||
74 | <filename>meta-yocto</filename>, and | ||
75 | <filename>meta-yocto-bsp</filename>. | ||
76 | Each of these folders represents a distinct layer. | ||
77 | </para> | ||
78 | |||
79 | <para> | ||
80 | As another example, if you set up a local copy of the | ||
81 | <filename>meta-intel</filename> Git repository | ||
82 | and then explore the folder of that general layer, | ||
83 | you will discover many Intel-specific BSP layers inside. | ||
84 | For more information on BSP layers, see the | ||
85 | "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>" | ||
86 | section in the Yocto Project Board Support Package (BSP) | ||
87 | Developer's Guide. | ||
88 | </para> | ||
89 | </section> | ||
90 | |||
91 | <section id='creating-your-own-layer'> | ||
92 | <title>Creating Your Own Layer</title> | ||
93 | |||
94 | <para> | ||
95 | It is very easy to create your own layers to use with the | ||
96 | OpenEmbedded build system. | ||
97 | The Yocto Project ships with scripts that speed up creating | ||
98 | general layers and BSP layers. | ||
99 | This section describes the steps you perform by hand to create | ||
100 | a layer so that you can better understand them. | ||
101 | For information about the layer-creation scripts, see the | ||
102 | "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>" | ||
103 | section in the Yocto Project Board Support Package (BSP) | ||
104 | Developer's Guide and the | ||
105 | "<link linkend='creating-a-general-layer-using-the-yocto-layer-script'>Creating a General Layer Using the yocto-layer Script</link>" | ||
106 | section further down in this manual. | ||
107 | </para> | ||
108 | |||
109 | <para> | ||
110 | Follow these general steps to create your layer: | ||
111 | <orderedlist> | ||
112 | <listitem><para><emphasis>Check Existing Layers:</emphasis> | ||
113 | Before creating a new layer, you should be sure someone | ||
114 | has not already created a layer containing the Metadata | ||
115 | you need. | ||
116 | You can see the | ||
117 | <ulink url='http://layers.openembedded.org/layerindex/layers/'><filename>OpenEmbedded Metadata Index</filename></ulink> | ||
118 | for a list of layers from the OpenEmbedded community | ||
119 | that can be used in the Yocto Project. | ||
120 | </para></listitem> | ||
121 | <listitem><para><emphasis>Create a Directory:</emphasis> | ||
122 | Create the directory for your layer. | ||
123 | While not strictly required, prepend the name of the | ||
124 | folder with the string <filename>meta-</filename>. | ||
125 | For example: | ||
126 | <literallayout class='monospaced'> | ||
127 | meta-mylayer | ||
128 | meta-GUI_xyz | ||
129 | meta-mymachine | ||
130 | </literallayout> | ||
131 | </para></listitem> | ||
132 | <listitem><para><emphasis>Create a Layer Configuration | ||
133 | File:</emphasis> | ||
134 | Inside your new layer folder, you need to create a | ||
135 | <filename>conf/layer.conf</filename> file. | ||
136 | It is easiest to take an existing layer configuration | ||
137 | file and copy that to your layer's | ||
138 | <filename>conf</filename> directory and then modify the | ||
139 | file as needed.</para> | ||
140 | <para>The | ||
141 | <filename>meta-yocto-bsp/conf/layer.conf</filename> file | ||
142 | demonstrates the required syntax: | ||
143 | <literallayout class='monospaced'> | ||
144 | # We have a conf and classes directory, add to BBPATH | ||
145 | BBPATH .= ":${LAYERDIR}" | ||
146 | |||
147 | # We have recipes-* directories, add to BBFILES | ||
148 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ | ||
149 | ${LAYERDIR}/recipes-*/*/*.bbappend" | ||
150 | |||
151 | BBFILE_COLLECTIONS += "yoctobsp" | ||
152 | BBFILE_PATTERN_yoctobsp = "^${LAYERDIR}/" | ||
153 | BBFILE_PRIORITY_yoctobsp = "5" | ||
154 | LAYERVERSION_yoctobsp = "2" | ||
155 | </literallayout></para> | ||
156 | <para>Here is an explanation of the example: | ||
157 | <itemizedlist> | ||
158 | <listitem><para>The configuration and | ||
159 | classes directory is appended to | ||
160 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BBPATH'><filename>BBPATH</filename></ulink>. | ||
161 | <note> | ||
162 | All non-distro layers, which include all BSP | ||
163 | layers, are expected to append the layer | ||
164 | directory to the | ||
165 | <filename>BBPATH</filename>. | ||
166 | On the other hand, distro layers, such as | ||
167 | <filename>meta-yocto</filename>, can choose | ||
168 | to enforce their own precedence over | ||
169 | <filename>BBPATH</filename>. | ||
170 | For an example of that syntax, see the | ||
171 | <filename>layer.conf</filename> file for | ||
172 | the <filename>meta-yocto</filename> layer. | ||
173 | </note></para></listitem> | ||
174 | <listitem><para>The recipes for the layers are | ||
175 | appended to | ||
176 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILES'>BBFILES</ulink></filename>. | ||
177 | </para></listitem> | ||
178 | <listitem><para>The | ||
179 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_COLLECTIONS'>BBFILE_COLLECTIONS</ulink></filename> | ||
180 | variable is then appended with the layer name. | ||
181 | </para></listitem> | ||
182 | <listitem><para>The | ||
183 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_PATTERN'>BBFILE_PATTERN</ulink></filename> | ||
184 | variable is set to a regular expression and is | ||
185 | used to match files from | ||
186 | <filename>BBFILES</filename> into a particular | ||
187 | layer. | ||
188 | In this case, | ||
189 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LAYERDIR'>LAYERDIR</ulink></filename> | ||
190 | is used to make <filename>BBFILE_PATTERN</filename> match within the | ||
191 | layer's path.</para></listitem> | ||
192 | <listitem><para>The | ||
193 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_PRIORITY'>BBFILE_PRIORITY</ulink></filename> | ||
194 | variable then assigns a priority to the layer. | ||
195 | Applying priorities is useful in situations | ||
196 | where the same package might appear in multiple | ||
197 | layers and allows you to choose the layer | ||
198 | that takes precedence.</para></listitem> | ||
199 | <listitem><para>The | ||
200 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LAYERVERSION'>LAYERVERSION</ulink></filename> | ||
201 | variable optionally specifies the version of a | ||
202 | layer as a single number.</para></listitem> | ||
203 | </itemizedlist></para> | ||
204 | <para>Note the use of the | ||
205 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LAYERDIR'>LAYERDIR</ulink></filename> | ||
206 | variable, which expands to the directory of the current | ||
207 | layer.</para> | ||
208 | <para>Through the use of the <filename>BBPATH</filename> | ||
209 | variable, BitBake locates class files | ||
210 | (<filename>.bbclass</filename>), | ||
211 | configuration files, and files that are included | ||
212 | with <filename>include</filename> and | ||
213 | <filename>require</filename> statements. | ||
214 | For these cases, BitBake uses the first file that | ||
215 | matches the name found in <filename>BBPATH</filename>. | ||
216 | This is similar to the way the <filename>PATH</filename> | ||
217 | variable is used for binaries. | ||
218 | It is recommended, therefore, that you use unique | ||
219 | class and configuration | ||
220 | filenames in your custom layer.</para></listitem> | ||
221 | <listitem><para><emphasis>Add Content:</emphasis> Depending | ||
222 | on the type of layer, add the content. | ||
223 | If the layer adds support for a machine, add the machine | ||
224 | configuration in a <filename>conf/machine/</filename> | ||
225 | file within the layer. | ||
226 | If the layer adds distro policy, add the distro | ||
227 | configuration in a <filename>conf/distro/</filename> | ||
228 | file within the layer. | ||
229 | If the layer introduces new recipes, put the recipes | ||
230 | you need in <filename>recipes-*</filename> | ||
231 | subdirectories within the layer. | ||
232 | <note>In order to be compliant with the Yocto Project, | ||
233 | a layer must contain a | ||
234 | <ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout-readme'>README file.</ulink> | ||
235 | </note></para></listitem> | ||
236 | </orderedlist> | ||
237 | </para> | ||
238 | </section> | ||
239 | |||
240 | <section id='best-practices-to-follow-when-creating-layers'> | ||
241 | <title>Best Practices to Follow When Creating Layers</title> | ||
242 | |||
243 | <para> | ||
244 | To create layers that are easier to maintain and that will | ||
245 | not impact builds for other machines, you should consider the | ||
246 | information in the following sections. | ||
247 | </para> | ||
248 | |||
249 | <section id='avoid-overlaying-entire-recipes'> | ||
250 | <title>Avoid "Overlaying" Entire Recipes</title> | ||
251 | |||
252 | <para> | ||
253 | Avoid "overlaying" entire recipes from other layers in your | ||
254 | configuration. | ||
255 | In other words, do not copy an entire recipe into your | ||
256 | layer and then modify it. | ||
257 | Rather, use an append file (<filename>.bbappend</filename>) | ||
258 | to override | ||
259 | only those parts of the original recipe you need to modify. | ||
260 | </para> | ||
261 | </section> | ||
262 | |||
263 | <section id='avoid-duplicating-include-files'> | ||
264 | <title>Avoid Duplicating Include Files</title> | ||
265 | |||
266 | <para> | ||
267 | Avoid duplicating include files. | ||
268 | Use append files (<filename>.bbappend</filename>) | ||
269 | for each recipe | ||
270 | that uses an include file. | ||
271 | Or, if you are introducing a new recipe that requires | ||
272 | the included file, use the path relative to the original | ||
273 | layer directory to refer to the file. | ||
274 | For example, use | ||
275 | <filename>require recipes-core/somepackage/somefile.inc</filename> | ||
276 | instead of <filename>require somefile.inc</filename>. | ||
277 | If you're finding you have to overlay the include file, | ||
278 | it could indicate a deficiency in the include file in | ||
279 | the layer to which it originally belongs. | ||
280 | If this is the case, you need to address that deficiency | ||
281 | instead of overlaying the include file. | ||
282 | </para> | ||
283 | |||
284 | <para> | ||
285 | For example, consider how support plug-ins for the Qt 4 | ||
286 | database are configured. | ||
287 | The Source Directory does not have MySQL or PostgreSQL. | ||
288 | However, OpenEmbedded's layer <filename>meta-oe</filename> | ||
289 | does. | ||
290 | Consequently, <filename>meta-oe</filename> uses | ||
291 | append files to modify the | ||
292 | <filename>QT_SQL_DRIVER_FLAGS</filename> variable to | ||
293 | enable the appropriate plug-ins. | ||
294 | This variable was added to the <filename>qt4.inc</filename> | ||
295 | include file in the Source Directory specifically to allow | ||
296 | the <filename>meta-oe</filename> layer to be able to control | ||
297 | which plug-ins are built. | ||
298 | </para> | ||
299 | </section> | ||
300 | |||
301 | <section id='structure-your-layers'> | ||
302 | <title>Structure Your Layers</title> | ||
303 | |||
304 | <para> | ||
305 | Proper use of overrides within append files and placement | ||
306 | of machine-specific files within your layer can ensure that | ||
307 | a build is not using the wrong Metadata and negatively | ||
308 | impacting a build for a different machine. | ||
309 | Following are some examples: | ||
310 | <itemizedlist> | ||
311 | <listitem><para><emphasis>Modifying Variables to Support | ||
312 | a Different Machine:</emphasis> | ||
313 | Suppose you have a layer named | ||
314 | <filename>meta-one</filename> that adds support | ||
315 | for building machine "one". | ||
316 | To do so, you use an append file named | ||
317 | <filename>base-files.bbappend</filename> and | ||
318 | create a dependency on "foo" by altering the | ||
319 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink> | ||
320 | variable: | ||
321 | <literallayout class='monospaced'> | ||
322 | DEPENDS = "foo" | ||
323 | </literallayout> | ||
324 | The dependency is created during any build that | ||
325 | includes the layer | ||
326 | <filename>meta-one</filename>. | ||
327 | However, you might not want this dependency | ||
328 | for all machines. | ||
329 | For example, suppose you are building for | ||
330 | machine "two" but your | ||
331 | <filename>bblayers.conf</filename> file has the | ||
332 | <filename>meta-one</filename> layer included. | ||
333 | During the build, the | ||
334 | <filename>base-files</filename> for machine | ||
335 | "two" will also have the dependency on | ||
336 | <filename>foo</filename>.</para> | ||
337 | <para>To make sure your changes apply only when | ||
338 | building machine "one", use a machine override | ||
339 | with the <filename>DEPENDS</filename> statement: | ||
340 | <literallayout class='monospaced'> | ||
341 | DEPENDS_one = "foo" | ||
342 | </literallayout> | ||
343 | You should follow the same strategy when using | ||
344 | <filename>_append</filename> and | ||
345 | <filename>_prepend</filename> operations: | ||
346 | <literallayout class='monospaced'> | ||
347 | DEPENDS_append_one = " foo" | ||
348 | DEPENDS_prepend_one = "foo " | ||
349 | </literallayout> | ||
350 | <note> | ||
351 | Avoiding "+=" and "=+" and using | ||
352 | machine-specific | ||
353 | <filename>_append</filename> | ||
354 | and <filename>_prepend</filename> operations | ||
355 | is recommended as well. | ||
356 | </note></para></listitem> | ||
357 | <listitem><para><emphasis>Place Machine-Specific Files | ||
358 | in Machine-Specific Locations:</emphasis> | ||
359 | When you have a base recipe, such as | ||
360 | <filename>base-files.bb</filename>, that | ||
361 | contains a | ||
362 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
363 | statement to a file, you can use an append file | ||
364 | to cause the build to use your own version of | ||
365 | the file. | ||
366 | For example, an append file in your layer at | ||
367 | <filename>meta-one/recipes-core/base-files/base-files.bbappend</filename> | ||
368 | could extend | ||
369 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink> | ||
370 | using | ||
371 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink> | ||
372 | as follows: | ||
373 | <literallayout class='monospaced'> | ||
374 | FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" | ||
375 | </literallayout> | ||
376 | The build for machine "one" will pick up your | ||
377 | machine-specific file as long as you have the | ||
378 | file in | ||
379 | <filename>meta-one/recipes-core/base-files/base-files/</filename>. | ||
380 | However, if you are building for a different | ||
381 | machine and the | ||
382 | <filename>bblayers.conf</filename> file includes | ||
383 | the <filename>meta-one</filename> layer and | ||
384 | the location of your machine-specific file is | ||
385 | the first location where that file is found | ||
386 | according to <filename>FILESPATH</filename>, | ||
387 | builds for all machines will also use that | ||
388 | machine-specific file.</para> | ||
389 | <para>You can make sure that a machine-specific | ||
390 | file is used for a particular machine by putting | ||
391 | the file in a subdirectory specific to the | ||
392 | machine. | ||
393 | For example, rather than placing the file in | ||
394 | <filename>meta-one/recipes-core/base-files/base-files/</filename> | ||
395 | as shown above, put it in | ||
396 | <filename>meta-one/recipes-core/base-files/base-files/one/</filename>. | ||
397 | Not only does this make sure the file is used | ||
398 | only when building for machine "one", but the | ||
399 | build process locates the file more quickly.</para> | ||
400 | <para>In summary, you need to place all files | ||
401 | referenced from <filename>SRC_URI</filename> | ||
402 | in a machine-specific subdirectory within the | ||
403 | layer in order to restrict those files to | ||
404 | machine-specific builds.</para></listitem> | ||
405 | </itemizedlist> | ||
406 | </para> | ||
407 | </section> | ||
408 | |||
409 | <section id='other-recommendations'> | ||
410 | <title>Other Recommendations</title> | ||
411 | |||
412 | <para> | ||
413 | We also recommend the following: | ||
414 | <itemizedlist> | ||
415 | <listitem><para>Store custom layers in a Git repository | ||
416 | that uses the | ||
417 | <filename>meta-<layer_name></filename> format. | ||
418 | </para></listitem> | ||
419 | <listitem><para>Clone the repository alongside other | ||
420 | <filename>meta</filename> directories in the | ||
421 | <link linkend='source-directory'>Source Directory</link>. | ||
422 | </para></listitem> | ||
423 | </itemizedlist> | ||
424 | Following these recommendations keeps your Source Directory and | ||
425 | its configuration entirely inside the Yocto Project's core | ||
426 | base. | ||
427 | </para> | ||
428 | </section> | ||
429 | </section> | ||
430 | |||
431 | <section id='enabling-your-layer'> | ||
432 | <title>Enabling Your Layer</title> | ||
433 | |||
434 | <para> | ||
435 | Before the OpenEmbedded build system can use your new layer, | ||
436 | you need to enable it. | ||
437 | To enable your layer, simply add your layer's path to the | ||
438 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'>BBLAYERS</ulink></filename> | ||
439 | variable in your <filename>conf/bblayers.conf</filename> file, | ||
440 | which is found in the | ||
441 | <link linkend='build-directory'>Build Directory</link>. | ||
442 | The following example shows how to enable a layer named | ||
443 | <filename>meta-mylayer</filename>: | ||
444 | <literallayout class='monospaced'> | ||
445 | LCONF_VERSION = "6" | ||
446 | |||
447 | BBPATH = "${TOPDIR}" | ||
448 | BBFILES ?= "" | ||
449 | |||
450 | BBLAYERS ?= " \ | ||
451 | $HOME/poky/meta \ | ||
452 | $HOME/poky/meta-yocto \ | ||
453 | $HOME/poky/meta-yocto-bsp \ | ||
454 | $HOME/poky/meta-mylayer \ | ||
455 | " | ||
456 | |||
457 | BBLAYERS_NON_REMOVABLE ?= " \ | ||
458 | $HOME/poky/meta \ | ||
459 | $HOME/poky/meta-yocto \ | ||
460 | " | ||
461 | </literallayout> | ||
462 | </para> | ||
463 | |||
464 | <para> | ||
465 | BitBake parses each <filename>conf/layer.conf</filename> file | ||
466 | as specified in the <filename>BBLAYERS</filename> variable | ||
467 | within the <filename>conf/bblayers.conf</filename> file. | ||
468 | During the processing of each | ||
469 | <filename>conf/layer.conf</filename> file, BitBake adds the | ||
470 | recipes, classes and configurations contained within the | ||
471 | particular layer to the source directory. | ||
472 | </para> | ||
473 | </section> | ||
474 | |||
475 | <section id='using-bbappend-files'> | ||
476 | <title>Using .bbappend Files</title> | ||
477 | |||
478 | <para> | ||
479 | Recipes used to append Metadata to other recipes are called | ||
480 | BitBake append files. | ||
481 | BitBake append files use the <filename>.bbappend</filename> file | ||
482 | type suffix, while the corresponding recipes to which Metadata | ||
483 | is being appended use the <filename>.bb</filename> file type | ||
484 | suffix. | ||
485 | </para> | ||
486 | |||
487 | <para> | ||
488 | A <filename>.bbappend</filename> file allows your layer to make | ||
489 | additions or changes to the content of another layer's recipe | ||
490 | without having to copy the other recipe into your layer. | ||
491 | Your <filename>.bbappend</filename> file resides in your layer, | ||
492 | while the main <filename>.bb</filename> recipe file to | ||
493 | which you are appending Metadata resides in a different layer. | ||
494 | </para> | ||
495 | |||
496 | <para> | ||
497 | Append files must have the same root names as their corresponding | ||
498 | recipes. | ||
499 | For example, the append file | ||
500 | <filename>someapp_&DISTRO;.bbappend</filename> must apply to | ||
501 | <filename>someapp_&DISTRO;.bb</filename>. | ||
502 | This means the original recipe and append file names are version | ||
503 | number-specific. | ||
504 | If the corresponding recipe is renamed to update to a newer | ||
505 | version, the corresponding <filename>.bbappend</filename> file must | ||
506 | be renamed (and possibly updated) as well. | ||
507 | During the build process, BitBake displays an error on starting | ||
508 | if it detects a <filename>.bbappend</filename> file that does | ||
509 | not have a corresponding recipe with a matching name. | ||
510 | See the | ||
511 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BB_DANGLINGAPPENDS_WARNONLY'><filename>BB_DANGLINGAPPENDS_WARNONLY</filename></ulink> | ||
512 | variable for information on how to handle this error. | ||
513 | </para> | ||
514 | |||
515 | <para> | ||
516 | Being able to append information to an existing recipe not only | ||
517 | avoids duplication, but also automatically applies recipe | ||
518 | changes in a different layer to your layer. | ||
519 | If you were copying recipes, you would have to manually merge | ||
520 | changes as they occur. | ||
521 | </para> | ||
522 | |||
523 | <para> | ||
524 | As an example, consider the main formfactor recipe and a | ||
525 | corresponding formfactor append file both from the | ||
526 | <link linkend='source-directory'>Source Directory</link>. | ||
527 | Here is the main formfactor recipe, which is named | ||
528 | <filename>formfactor_0.0.bb</filename> and located in the | ||
529 | "meta" layer at | ||
530 | <filename>meta/recipes-bsp/formfactor</filename>: | ||
531 | <literallayout class='monospaced'> | ||
532 | SUMMARY = "Device formfactor information" | ||
533 | SECTION = "base" | ||
534 | LICENSE = "MIT" | ||
535 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ | ||
536 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
537 | PR = "r44" | ||
538 | |||
539 | SRC_URI = "file://config file://machconfig" | ||
540 | S = "${WORKDIR}" | ||
541 | |||
542 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
543 | INHIBIT_DEFAULT_DEPS = "1" | ||
544 | |||
545 | do_install() { | ||
546 | # Only install file if it has a contents | ||
547 | install -d ${D}${sysconfdir}/formfactor/ | ||
548 | install -m 0644 ${S}/config ${D}${sysconfdir}/formfactor/ | ||
549 | if [ -s "${S}/machconfig" ]; then | ||
550 | install -m 0644 ${S}/machconfig ${D}${sysconfdir}/formfactor/ | ||
551 | fi | ||
552 | } | ||
553 | </literallayout> | ||
554 | In the main recipe, note the | ||
555 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
556 | variable, which tells the OpenEmbedded build system where to | ||
557 | find files during the build. | ||
558 | </para> | ||
559 | |||
560 | <para> | ||
561 | Following is the append file, which is named | ||
562 | <filename>formfactor_0.0.bbappend</filename> and is from the | ||
563 | Crown Bay BSP Layer named | ||
564 | <filename>meta-intel/meta-crownbay</filename>. | ||
565 | The file is in <filename>recipes-bsp/formfactor</filename>: | ||
566 | <literallayout class='monospaced'> | ||
567 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
568 | </literallayout> | ||
569 | </para> | ||
570 | |||
571 | <para> | ||
572 | By default, the build system uses the | ||
573 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink> | ||
574 | variable to locate files. | ||
575 | This append file extends the locations by setting the | ||
576 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink> | ||
577 | variable. | ||
578 | Setting this variable in the <filename>.bbappend</filename> | ||
579 | file is the most reliable and recommended method for adding | ||
580 | directories to the search path used by the build system | ||
581 | to find files. | ||
582 | </para> | ||
583 | |||
584 | <para> | ||
585 | The statement in this example extends the directories to include | ||
586 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-THISDIR'><filename>THISDIR</filename></ulink><filename>}/${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>, | ||
587 | which resolves to a directory named | ||
588 | <filename>formfactor</filename> in the same directory | ||
589 | in which the append file resides (i.e. | ||
590 | <filename>meta-intel/meta-crownbay/recipes-bsp/formfactor/formfactor</filename>. | ||
591 | This implies that you must have the supporting directory | ||
592 | structure set up that will contain any files or patches you | ||
593 | will be including from the layer. | ||
594 | </para> | ||
595 | |||
596 | <para> | ||
597 | Using the immediate expansion assignment operator | ||
598 | <filename>:=</filename> is important because of the reference to | ||
599 | <filename>THISDIR</filename>. | ||
600 | The trailing colon character is important as it ensures that | ||
601 | items in the list remain colon-separated. | ||
602 | <note> | ||
603 | <para> | ||
604 | BitBake automatically defines the | ||
605 | <filename>THISDIR</filename> variable. | ||
606 | You should never set this variable yourself. | ||
607 | Using "_prepend" ensures your path will | ||
608 | be searched prior to other paths in the final list. | ||
609 | </para> | ||
610 | |||
611 | <para> | ||
612 | Also, not all append files add extra files. | ||
613 | Many append files simply exist to add build options | ||
614 | (e.g. <filename>systemd</filename>). | ||
615 | For these cases, it is not necessary to use the | ||
616 | "_prepend" part of the statement. | ||
617 | </para> | ||
618 | </note> | ||
619 | </para> | ||
620 | </section> | ||
621 | |||
622 | <section id='prioritizing-your-layer'> | ||
623 | <title>Prioritizing Your Layer</title> | ||
624 | |||
625 | <para> | ||
626 | Each layer is assigned a priority value. | ||
627 | Priority values control which layer takes precedence if there | ||
628 | are recipe files with the same name in multiple layers. | ||
629 | For these cases, the recipe file from the layer with a higher | ||
630 | priority number takes precedence. | ||
631 | Priority values also affect the order in which multiple | ||
632 | <filename>.bbappend</filename> files for the same recipe are | ||
633 | applied. | ||
634 | You can either specify the priority manually, or allow the | ||
635 | build system to calculate it based on the layer's dependencies. | ||
636 | </para> | ||
637 | |||
638 | <para> | ||
639 | To specify the layer's priority manually, use the | ||
640 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_PRIORITY'><filename>BBFILE_PRIORITY</filename></ulink> | ||
641 | variable. | ||
642 | For example: | ||
643 | <literallayout class='monospaced'> | ||
644 | BBFILE_PRIORITY_mylayer = "1" | ||
645 | </literallayout> | ||
646 | </para> | ||
647 | |||
648 | <note> | ||
649 | <para>It is possible for a recipe with a lower version number | ||
650 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink> | ||
651 | in a layer that has a higher priority to take precedence.</para> | ||
652 | <para>Also, the layer priority does not currently affect the | ||
653 | precedence order of <filename>.conf</filename> | ||
654 | or <filename>.bbclass</filename> files. | ||
655 | Future versions of BitBake might address this.</para> | ||
656 | </note> | ||
657 | </section> | ||
658 | |||
659 | <section id='managing-layers'> | ||
660 | <title>Managing Layers</title> | ||
661 | |||
662 | <para> | ||
663 | You can use the BitBake layer management tool to provide a view | ||
664 | into the structure of recipes across a multi-layer project. | ||
665 | Being able to generate output that reports on configured layers | ||
666 | with their paths and priorities and on | ||
667 | <filename>.bbappend</filename> files and their applicable | ||
668 | recipes can help to reveal potential problems. | ||
669 | </para> | ||
670 | |||
671 | <para> | ||
672 | Use the following form when running the layer management tool. | ||
673 | <literallayout class='monospaced'> | ||
674 | $ bitbake-layers <command> [arguments] | ||
675 | </literallayout> | ||
676 | The following list describes the available commands: | ||
677 | <itemizedlist> | ||
678 | <listitem><para><filename><emphasis>help:</emphasis></filename> | ||
679 | Displays general help or help on a specified command. | ||
680 | </para></listitem> | ||
681 | <listitem><para><filename><emphasis>show-layers:</emphasis></filename> | ||
682 | Shows the current configured layers. | ||
683 | </para></listitem> | ||
684 | <listitem><para><filename><emphasis>show-recipes:</emphasis></filename> | ||
685 | Lists available recipes and the layers that provide them. | ||
686 | </para></listitem> | ||
687 | <listitem><para><filename><emphasis>show-overlayed:</emphasis></filename> | ||
688 | Lists overlayed recipes. | ||
689 | A recipe is overlayed when a recipe with the same name | ||
690 | exists in another layer that has a higher layer | ||
691 | priority. | ||
692 | </para></listitem> | ||
693 | <listitem><para><filename><emphasis>show-appends:</emphasis></filename> | ||
694 | Lists <filename>.bbappend</filename> files and the | ||
695 | recipe files to which they apply. | ||
696 | </para></listitem> | ||
697 | <listitem><para><filename><emphasis>show-cross-depends:</emphasis></filename> | ||
698 | Lists dependency relationships between recipes that | ||
699 | cross layer boundaries. | ||
700 | </para></listitem> | ||
701 | <listitem><para><filename><emphasis>flatten:</emphasis></filename> | ||
702 | Flattens the layer configuration into a separate output | ||
703 | directory. | ||
704 | Flattening your layer configuration builds a "flattened" | ||
705 | directory that contains the contents of all layers, | ||
706 | with any overlayed recipes removed and any | ||
707 | <filename>.bbappend</filename> files appended to the | ||
708 | corresponding recipes. | ||
709 | You might have to perform some manual cleanup of the | ||
710 | flattened layer as follows: | ||
711 | <itemizedlist> | ||
712 | <listitem><para>Non-recipe files (such as patches) | ||
713 | are overwritten. | ||
714 | The flatten command shows a warning for these | ||
715 | files. | ||
716 | </para></listitem> | ||
717 | <listitem><para>Anything beyond the normal layer | ||
718 | setup has been added to the | ||
719 | <filename>layer.conf</filename> file. | ||
720 | Only the lowest priority layer's | ||
721 | <filename>layer.conf</filename> is used. | ||
722 | </para></listitem> | ||
723 | <listitem><para>Overridden and appended items from | ||
724 | <filename>.bbappend</filename> files need to be | ||
725 | cleaned up. | ||
726 | The contents of each | ||
727 | <filename>.bbappend</filename> end up in the | ||
728 | flattened recipe. | ||
729 | However, if there are appended or changed | ||
730 | variable values, you need to tidy these up | ||
731 | yourself. | ||
732 | Consider the following example. | ||
733 | Here, the <filename>bitbake-layers</filename> | ||
734 | command adds the line | ||
735 | <filename>#### bbappended ...</filename> so that | ||
736 | you know where the following lines originate: | ||
737 | <literallayout class='monospaced'> | ||
738 | ... | ||
739 | DESCRIPTION = "A useful utility" | ||
740 | ... | ||
741 | EXTRA_OECONF = "--enable-something" | ||
742 | ... | ||
743 | |||
744 | #### bbappended from meta-anotherlayer #### | ||
745 | |||
746 | DESCRIPTION = "Customized utility" | ||
747 | EXTRA_OECONF += "--enable-somethingelse" | ||
748 | </literallayout> | ||
749 | Ideally, you would tidy up these utilities as | ||
750 | follows: | ||
751 | <literallayout class='monospaced'> | ||
752 | ... | ||
753 | DESCRIPTION = "Customized utility" | ||
754 | ... | ||
755 | EXTRA_OECONF = "--enable-something --enable-somethingelse" | ||
756 | ... | ||
757 | </literallayout></para></listitem> | ||
758 | </itemizedlist></para></listitem> | ||
759 | </itemizedlist> | ||
760 | </para> | ||
761 | </section> | ||
762 | |||
763 | <section id='creating-a-general-layer-using-the-yocto-layer-script'> | ||
764 | <title>Creating a General Layer Using the yocto-layer Script</title> | ||
765 | |||
766 | <para> | ||
767 | The <filename>yocto-layer</filename> script simplifies | ||
768 | creating a new general layer. | ||
769 | <note> | ||
770 | For information on BSP layers, see the | ||
771 | "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>" | ||
772 | section in the Yocto Project Board Specific (BSP) | ||
773 | Developer's Guide. | ||
774 | </note> | ||
775 | The default mode of the script's operation is to prompt you for | ||
776 | information needed to generate the layer: | ||
777 | <itemizedlist> | ||
778 | <listitem><para>The layer priority | ||
779 | </para></listitem> | ||
780 | <listitem><para>Whether or not to create a sample recipe. | ||
781 | </para></listitem> | ||
782 | <listitem><para>Whether or not to create a sample | ||
783 | append file. | ||
784 | </para></listitem> | ||
785 | </itemizedlist> | ||
786 | </para> | ||
787 | |||
788 | <para> | ||
789 | Use the <filename>yocto-layer create</filename> sub-command | ||
790 | to create a new general layer. | ||
791 | In its simplest form, you can create a layer as follows: | ||
792 | <literallayout class='monospaced'> | ||
793 | $ yocto-layer create mylayer | ||
794 | </literallayout> | ||
795 | The previous example creates a layer named | ||
796 | <filename>meta-mylayer</filename> in the current directory. | ||
797 | </para> | ||
798 | |||
799 | <para> | ||
800 | As the <filename>yocto-layer create</filename> command runs, | ||
801 | default values for the prompts appear in brackets. | ||
802 | Pressing enter without supplying anything for the prompts | ||
803 | or pressing enter and providing an invalid response causes the | ||
804 | script to accept the default value. | ||
805 | Once the script completes, the new layer | ||
806 | is created in the current working directory. | ||
807 | The script names the layer by prepending | ||
808 | <filename>meta-</filename> to the name you provide. | ||
809 | </para> | ||
810 | |||
811 | <para> | ||
812 | Minimally, the script creates the following within the layer: | ||
813 | <itemizedlist> | ||
814 | <listitem><para><emphasis>The <filename>conf</filename> | ||
815 | directory:</emphasis> | ||
816 | This directory contains the layer's configuration file. | ||
817 | The root name for the file is the same as the root name | ||
818 | your provided for the layer (e.g. | ||
819 | <filename><layer>.conf</filename>). | ||
820 | </para></listitem> | ||
821 | <listitem><para><emphasis>The | ||
822 | <filename>COPYING.MIT</filename> file:</emphasis> | ||
823 | The copyright and use notice for the software. | ||
824 | </para></listitem> | ||
825 | <listitem><para><emphasis>The <filename>README</filename> | ||
826 | file:</emphasis> | ||
827 | A file describing the contents of your new layer. | ||
828 | </para></listitem> | ||
829 | </itemizedlist> | ||
830 | </para> | ||
831 | |||
832 | <para> | ||
833 | If you choose to generate a sample recipe file, the script | ||
834 | prompts you for the name for the recipe and then creates it | ||
835 | in <filename><layer>/recipes-example/example/</filename>. | ||
836 | The script creates a <filename>.bb</filename> file and a | ||
837 | directory, which contains a sample | ||
838 | <filename>helloworld.c</filename> source file, along with | ||
839 | a sample patch file. | ||
840 | If you do not provide a recipe name, the script uses | ||
841 | "example". | ||
842 | </para> | ||
843 | |||
844 | <para> | ||
845 | If you choose to generate a sample append file, the script | ||
846 | prompts you for the name for the file and then creates it | ||
847 | in <filename><layer>/recipes-example-bbappend/example-bbappend/</filename>. | ||
848 | The script creates a <filename>.bbappend</filename> file and a | ||
849 | directory, which contains a sample patch file. | ||
850 | If you do not provide a recipe name, the script uses | ||
851 | "example". | ||
852 | The script also prompts you for the version of the append file. | ||
853 | The version should match the recipe to which the append file | ||
854 | is associated. | ||
855 | </para> | ||
856 | |||
857 | <para> | ||
858 | The easiest way to see how the <filename>yocto-layer</filename> | ||
859 | script works is to experiment with the script. | ||
860 | You can also read the usage information by entering the | ||
861 | following: | ||
862 | <literallayout class='monospaced'> | ||
863 | $ yocto-layer help | ||
864 | </literallayout> | ||
865 | </para> | ||
866 | |||
867 | <para> | ||
868 | Once you create your general layer, you must add it to your | ||
869 | <filename>bblayers.conf</filename> file. | ||
870 | Here is an example where a layer named | ||
871 | <filename>meta-mylayer</filename> is added: | ||
872 | <literallayout class='monospaced'> | ||
873 | BBLAYERS = ?" \ | ||
874 | /usr/local/src/yocto/meta \ | ||
875 | /usr/local/src/yocto/meta-yocto \ | ||
876 | /usr/local/src/yocto/meta-yocto-bsp \ | ||
877 | /usr/local/src/yocto/meta-mylayer \ | ||
878 | " | ||
879 | |||
880 | BBLAYERS_NON_REMOVABLE ?= " \ | ||
881 | /usr/local/src/yocto/meta \ | ||
882 | /usr/local/src/yocto/meta-yocto \ | ||
883 | " | ||
884 | </literallayout> | ||
885 | Adding the layer to this file enables the build system to | ||
886 | locate the layer during the build. | ||
887 | </para> | ||
888 | </section> | ||
889 | </section> | ||
890 | |||
891 | <section id='usingpoky-extend-customimage'> | ||
892 | <title>Customizing Images</title> | ||
893 | |||
894 | <para> | ||
895 | You can customize images to satisfy particular requirements. | ||
896 | This section describes several methods and provides guidelines for each. | ||
897 | </para> | ||
898 | |||
899 | <section id='usingpoky-extend-customimage-localconf'> | ||
900 | <title>Customizing Images Using <filename>local.conf</filename></title> | ||
901 | |||
902 | <para> | ||
903 | Probably the easiest way to customize an image is to add a | ||
904 | package by way of the <filename>local.conf</filename> | ||
905 | configuration file. | ||
906 | Because it is limited to local use, this method generally only | ||
907 | allows you to add packages and is not as flexible as creating | ||
908 | your own customized image. | ||
909 | When you add packages using local variables this way, you need | ||
910 | to realize that these variable changes are in effect for every | ||
911 | build and consequently affect all images, which might not | ||
912 | be what you require. | ||
913 | </para> | ||
914 | |||
915 | <para> | ||
916 | To add a package to your image using the local configuration | ||
917 | file, use the | ||
918 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'>IMAGE_INSTALL</ulink></filename> | ||
919 | variable with the <filename>_append</filename> operator: | ||
920 | <literallayout class='monospaced'> | ||
921 | IMAGE_INSTALL_append = " strace" | ||
922 | </literallayout> | ||
923 | Use of the syntax is important - specifically, the space between | ||
924 | the quote and the package name, which is | ||
925 | <filename>strace</filename> in this example. | ||
926 | This space is required since the <filename>_append</filename> | ||
927 | operator does not add the space. | ||
928 | </para> | ||
929 | |||
930 | <para> | ||
931 | Furthermore, you must use <filename>_append</filename> instead | ||
932 | of the <filename>+=</filename> operator if you want to avoid | ||
933 | ordering issues. | ||
934 | The reason for this is because doing so unconditionally appends | ||
935 | to the variable and avoids ordering problems due to the | ||
936 | variable being set in image recipes and | ||
937 | <filename>.bbclass</filename> files with operators like | ||
938 | <filename>?=</filename>. | ||
939 | Using <filename>_append</filename> ensures the operation takes | ||
940 | affect. | ||
941 | </para> | ||
942 | |||
943 | <para> | ||
944 | As shown in its simplest use, | ||
945 | <filename>IMAGE_INSTALL_append</filename> affects all images. | ||
946 | It is possible to extend the syntax so that the variable | ||
947 | applies to a specific image only. | ||
948 | Here is an example: | ||
949 | <literallayout class='monospaced'> | ||
950 | IMAGE_INSTALL_append_pn-core-image-minimal = " strace" | ||
951 | </literallayout> | ||
952 | This example adds <filename>strace</filename> to the | ||
953 | <filename>core-image-minimal</filename> image only. | ||
954 | </para> | ||
955 | |||
956 | <para> | ||
957 | You can add packages using a similar approach through the | ||
958 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-CORE_IMAGE_EXTRA_INSTALL'>CORE_IMAGE_EXTRA_INSTALL</ulink></filename> | ||
959 | variable. | ||
960 | If you use this variable, only | ||
961 | <filename>core-image-*</filename> images are affected. | ||
962 | </para> | ||
963 | </section> | ||
964 | |||
965 | <section id='usingpoky-extend-customimage-imagefeatures'> | ||
966 | <title>Customizing Images Using Custom <filename>IMAGE_FEATURES</filename> and | ||
967 | <filename>EXTRA_IMAGE_FEATURES</filename></title> | ||
968 | |||
969 | <para> | ||
970 | Another method for customizing your image is to enable or | ||
971 | disable high-level image features by using the | ||
972 | <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink> | ||
973 | and <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink> | ||
974 | variables. | ||
975 | Although the functions for both variables are nearly equivalent, | ||
976 | best practices dictate using <filename>IMAGE_FEATURES</filename> | ||
977 | from within a recipe and using | ||
978 | <filename>EXTRA_IMAGE_FEATURES</filename> from within | ||
979 | your <filename>local.conf</filename> file, which is found in the | ||
980 | <link linkend='build-directory'>Build Directory</link>. | ||
981 | </para> | ||
982 | |||
983 | <para> | ||
984 | To understand how these features work, the best reference is | ||
985 | <filename>meta/classes/core-image.bbclass</filename>. | ||
986 | In summary, the file looks at the contents of the | ||
987 | <filename>IMAGE_FEATURES</filename> variable and then maps | ||
988 | those contents into a set of package groups. | ||
989 | Based on this information, the build system automatically | ||
990 | adds the appropriate packages to the | ||
991 | <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink> | ||
992 | variable. | ||
993 | Effectively, you are enabling extra features by extending the | ||
994 | class or creating a custom class for use with specialized image | ||
995 | <filename>.bb</filename> files. | ||
996 | </para> | ||
997 | |||
998 | <para> | ||
999 | Use the <filename>EXTRA_IMAGE_FEATURES</filename> variable | ||
1000 | from within your local configuration file. | ||
1001 | Using a separate area from which to enable features with | ||
1002 | this variable helps you avoid overwriting the features in the | ||
1003 | image recipe that are enabled with | ||
1004 | <filename>IMAGE_FEATURES</filename>. | ||
1005 | The value of <filename>EXTRA_IMAGE_FEATURES</filename> is added | ||
1006 | to <filename>IMAGE_FEATURES</filename> within | ||
1007 | <filename>meta/conf/bitbake.conf</filename>. | ||
1008 | </para> | ||
1009 | |||
1010 | <para> | ||
1011 | To illustrate how you can use these variables to modify your | ||
1012 | image, consider an example that selects the SSH server. | ||
1013 | The Yocto Project ships with two SSH servers you can use | ||
1014 | with your images: Dropbear and OpenSSH. | ||
1015 | Dropbear is a minimal SSH server appropriate for | ||
1016 | resource-constrained environments, while OpenSSH is a | ||
1017 | well-known standard SSH server implementation. | ||
1018 | By default, the <filename>core-image-sato</filename> image | ||
1019 | is configured to use Dropbear. | ||
1020 | The <filename>core-image-full-cmdline</filename> and | ||
1021 | <filename>core-image-lsb</filename> images both | ||
1022 | include OpenSSH. | ||
1023 | The <filename>core-image-minimal</filename> image does not | ||
1024 | contain an SSH server. | ||
1025 | </para> | ||
1026 | |||
1027 | <para> | ||
1028 | You can customize your image and change these defaults. | ||
1029 | Edit the <filename>IMAGE_FEATURES</filename> variable | ||
1030 | in your recipe or use the | ||
1031 | <filename>EXTRA_IMAGE_FEATURES</filename> in your | ||
1032 | <filename>local.conf</filename> file so that it configures the | ||
1033 | image you are working with to include | ||
1034 | <filename>ssh-server-dropbear</filename> or | ||
1035 | <filename>ssh-server-openssh</filename>. | ||
1036 | </para> | ||
1037 | |||
1038 | <note> | ||
1039 | See the | ||
1040 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" | ||
1041 | section in the Yocto Project Reference Manual for a complete | ||
1042 | list of image features that ship with the Yocto Project. | ||
1043 | </note> | ||
1044 | </section> | ||
1045 | |||
1046 | <section id='usingpoky-extend-customimage-custombb'> | ||
1047 | <title>Customizing Images Using Custom .bb Files</title> | ||
1048 | |||
1049 | <para> | ||
1050 | You can also customize an image by creating a custom recipe | ||
1051 | that defines additional software as part of the image. | ||
1052 | The following example shows the form for the two lines you need: | ||
1053 | <literallayout class='monospaced'> | ||
1054 | IMAGE_INSTALL = "packagegroup-core-x11-base package1 package2" | ||
1055 | |||
1056 | inherit core-image | ||
1057 | </literallayout> | ||
1058 | </para> | ||
1059 | |||
1060 | <para> | ||
1061 | Defining the software using a custom recipe gives you total | ||
1062 | control over the contents of the image. | ||
1063 | It is important to use the correct names of packages in the | ||
1064 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'>IMAGE_INSTALL</ulink></filename> | ||
1065 | variable. | ||
1066 | You must use the OpenEmbedded notation and not the Debian notation for the names | ||
1067 | (e.g. <filename>eglibc-dev</filename> instead of <filename>libc6-dev</filename>). | ||
1068 | </para> | ||
1069 | |||
1070 | <para> | ||
1071 | The other method for creating a custom image is to base it on an existing image. | ||
1072 | For example, if you want to create an image based on <filename>core-image-sato</filename> | ||
1073 | but add the additional package <filename>strace</filename> to the image, | ||
1074 | copy the <filename>meta/recipes-sato/images/core-image-sato.bb</filename> to a | ||
1075 | new <filename>.bb</filename> and add the following line to the end of the copy: | ||
1076 | <literallayout class='monospaced'> | ||
1077 | IMAGE_INSTALL += "strace" | ||
1078 | </literallayout> | ||
1079 | </para> | ||
1080 | </section> | ||
1081 | |||
1082 | <section id='usingpoky-extend-customimage-customtasks'> | ||
1083 | <title>Customizing Images Using Custom Package Groups</title> | ||
1084 | |||
1085 | <para> | ||
1086 | For complex custom images, the best approach for customizing | ||
1087 | an image is to create a custom package group recipe that is | ||
1088 | used to build the image or images. | ||
1089 | A good example of a package group recipe is | ||
1090 | <filename>meta/recipes-core/packagegroups/packagegroup-core-boot.bb</filename>. | ||
1091 | The | ||
1092 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'>PACKAGES</ulink></filename> | ||
1093 | variable lists the package group packages you wish to produce. | ||
1094 | <filename>inherit packagegroup</filename> sets appropriate | ||
1095 | default values and automatically adds <filename>-dev</filename>, | ||
1096 | <filename>-dbg</filename>, and <filename>-ptest</filename> | ||
1097 | complementary packages for every package specified in | ||
1098 | <filename>PACKAGES</filename>. | ||
1099 | Note that the inherit line should be towards | ||
1100 | the top of the recipe, certainly before you set | ||
1101 | <filename>PACKAGES</filename>. | ||
1102 | For each package you specify in <filename>PACKAGES</filename>, | ||
1103 | you can use | ||
1104 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'>RDEPENDS</ulink></filename> | ||
1105 | and | ||
1106 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'>RRECOMMENDS</ulink></filename> | ||
1107 | entries to provide a list of packages the parent task package | ||
1108 | should contain. | ||
1109 | Following is an example: | ||
1110 | <literallayout class='monospaced'> | ||
1111 | DESCRIPTION = "My Custom Package Groups" | ||
1112 | |||
1113 | inherit packagegroup | ||
1114 | |||
1115 | PACKAGES = "\ | ||
1116 | packagegroup-custom-apps \ | ||
1117 | packagegroup-custom-tools \ | ||
1118 | " | ||
1119 | |||
1120 | RDEPENDS_packagegroup-custom-apps = "\ | ||
1121 | dropbear \ | ||
1122 | portmap \ | ||
1123 | psplash" | ||
1124 | |||
1125 | RDEPENDS_packagegroup-custom-tools = "\ | ||
1126 | oprofile \ | ||
1127 | oprofileui-server \ | ||
1128 | lttng-control \ | ||
1129 | lttng-viewer" | ||
1130 | |||
1131 | RRECOMMENDS_packagegroup-custom-tools = "\ | ||
1132 | kernel-module-oprofile" | ||
1133 | </literallayout> | ||
1134 | </para> | ||
1135 | |||
1136 | <para> | ||
1137 | In the previous example, two package group packages are created with their dependencies and their | ||
1138 | recommended package dependencies listed: <filename>packagegroup-custom-apps</filename>, and | ||
1139 | <filename>packagegroup-custom-tools</filename>. | ||
1140 | To build an image using these package group packages, you need to add | ||
1141 | <filename>packagegroup-custom-apps</filename> and/or | ||
1142 | <filename>packagegroup-custom-tools</filename> to | ||
1143 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'>IMAGE_INSTALL</ulink></filename>. | ||
1144 | For other forms of image dependencies see the other areas of this section. | ||
1145 | </para> | ||
1146 | </section> | ||
1147 | </section> | ||
1148 | |||
1149 | <section id='new-recipe-writing-a-new-recipe'> | ||
1150 | <title>Writing a New Recipe</title> | ||
1151 | |||
1152 | <para> | ||
1153 | Recipes (<filename>.bb</filename> files) are fundamental components | ||
1154 | in the Yocto Project environment. | ||
1155 | Each software component built by the OpenEmbedded build system | ||
1156 | requires a recipe to define the component. | ||
1157 | This section describes how to create, write, and test a new | ||
1158 | recipe. | ||
1159 | <note> | ||
1160 | For information on variables that are useful for recipes and | ||
1161 | for information about recipe naming issues, see the | ||
1162 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-varlocality-recipe-required'>Required</ulink>" | ||
1163 | section of the Yocto Project Reference Manual. | ||
1164 | </note> | ||
1165 | </para> | ||
1166 | |||
1167 | <section id='new-recipe-overview'> | ||
1168 | <title>Overview</title> | ||
1169 | |||
1170 | <para> | ||
1171 | The following figure shows the basic process for creating a | ||
1172 | new recipe. | ||
1173 | The remainder of the section provides details for the steps. | ||
1174 | <imagedata fileref="figures/recipe-workflow.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
1175 | </para> | ||
1176 | </section> | ||
1177 | |||
1178 | <section id='new-recipe-locate-a-base-recipe'> | ||
1179 | <title>Locate a Base Recipe</title> | ||
1180 | |||
1181 | <para> | ||
1182 | Before writing a recipe from scratch, it is often useful to | ||
1183 | discover whether someone else has already written one that | ||
1184 | meets (or comes close to meeting) your needs. | ||
1185 | The Yocto Project and OpenEmbedded communities maintain many | ||
1186 | recipes that might be candidates for what you are doing. | ||
1187 | You can find a good central index of these recipes in the | ||
1188 | <ulink url='http://layers.openembedded.org'>OpenEmbedded metadata index</ulink>. | ||
1189 | </para> | ||
1190 | |||
1191 | <para> | ||
1192 | Working from an existing recipe or a skeleton recipe is the | ||
1193 | best way to get started. | ||
1194 | Here are some points on both methods: | ||
1195 | <itemizedlist> | ||
1196 | <listitem><para><emphasis>Locate and modify a recipe that | ||
1197 | is close to what you want to do:</emphasis> | ||
1198 | This method works when you are familiar with the | ||
1199 | current recipe space. | ||
1200 | The method does not work so well for those new to | ||
1201 | the Yocto Project or writing recipes.</para> | ||
1202 | <para>Some risks associated with this method are | ||
1203 | using a recipe that has areas totally unrelated to | ||
1204 | what you are trying to accomplish with your recipe, | ||
1205 | not recognizing areas of the recipe that you might | ||
1206 | have to add from scratch, and so forth. | ||
1207 | All these risks stem from unfamiliarity with the | ||
1208 | existing recipe space.</para></listitem> | ||
1209 | <listitem><para><emphasis>Use and modify the following | ||
1210 | skeleton recipe:</emphasis> | ||
1211 | <literallayout class='monospaced'> | ||
1212 | SUMMARY = "" | ||
1213 | HOMEPAGE = "" | ||
1214 | LICENSE = "" | ||
1215 | |||
1216 | LIC_FILES_CHKSUM = "" | ||
1217 | |||
1218 | SRC_URI = "" | ||
1219 | SRC_URI[md5sum] = "" | ||
1220 | SRC_URI[sha256sum] = "" | ||
1221 | |||
1222 | S = "${WORKDIR}/${PN}-${PV}" | ||
1223 | |||
1224 | inherit <stuff> | ||
1225 | </literallayout> | ||
1226 | Modifying this recipe is the recommended method for | ||
1227 | creating a new recipe. | ||
1228 | The recipe provides the fundamental areas that you need | ||
1229 | to include, exclude, or alter to fit your needs. | ||
1230 | </para></listitem> | ||
1231 | </itemizedlist> | ||
1232 | </para> | ||
1233 | </section> | ||
1234 | |||
1235 | <section id='new-recipe-storing-and-naming-the-recipe'> | ||
1236 | <title>Storing and Naming the Recipe</title> | ||
1237 | |||
1238 | <para> | ||
1239 | Once you have your base recipe, you should put it in your | ||
1240 | own layer and name it appropriately. | ||
1241 | Locating it correctly ensures that the OpenEmbedded build | ||
1242 | system can find it when you use BitBake to process the | ||
1243 | recipe. | ||
1244 | </para> | ||
1245 | |||
1246 | <itemizedlist> | ||
1247 | <listitem><para><emphasis>Storing Your Recipe:</emphasis> | ||
1248 | The OpenEmbedded build system locates your recipe | ||
1249 | through the layer's <filename>conf/layer.conf</filename> | ||
1250 | file and the | ||
1251 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILES'><filename>BBFILES</filename></ulink> | ||
1252 | variable. | ||
1253 | This variable sets up a path from which the build system can | ||
1254 | locate recipes. | ||
1255 | Here is the typical use: | ||
1256 | <literallayout class='monospaced'> | ||
1257 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ | ||
1258 | ${LAYERDIR}/recipes-*/*/*.bbappend" | ||
1259 | </literallayout> | ||
1260 | Consequently, you need to be sure you locate your new recipe | ||
1261 | inside your layer such that it can be found.</para> | ||
1262 | <para>You can find more information on how layers are | ||
1263 | structured in the | ||
1264 | "<link linkend='understanding-and-creating-layers'>Understanding and Creating Layers</link>" | ||
1265 | section.</para></listitem> | ||
1266 | <listitem><para><emphasis>Naming Your Recipe:</emphasis> | ||
1267 | When you name your recipe, you need to follow this naming | ||
1268 | convention: | ||
1269 | <literallayout class='monospaced'> | ||
1270 | <basename>_<version>.bb | ||
1271 | </literallayout> | ||
1272 | Use lower-cased characters and do not include the reserved | ||
1273 | suffixes <filename>-native</filename>, | ||
1274 | <filename>-cross</filename>, <filename>-initial</filename>, | ||
1275 | or <filename>-dev</filename> casually (i.e. do not use them | ||
1276 | as part of your recipe name unless the string applies). | ||
1277 | Here are some examples: | ||
1278 | <literallayout class='monospaced'> | ||
1279 | cups_1.7.0.bb | ||
1280 | gawk_4.0.2.bb | ||
1281 | irssi_0.8.16-rc1.bb | ||
1282 | </literallayout></para></listitem> | ||
1283 | </itemizedlist> | ||
1284 | </section> | ||
1285 | |||
1286 | <section id='understanding-recipe-syntax'> | ||
1287 | <title>Understanding Recipe Syntax</title> | ||
1288 | |||
1289 | <para> | ||
1290 | Understanding recipe file syntax is important for | ||
1291 | writing recipes. | ||
1292 | The following list overviews the basic items that make up a | ||
1293 | BitBake recipe file. | ||
1294 | For more complete BitBake syntax descriptions, see the | ||
1295 | "<ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-metadata'>Syntax and Operators</ulink>" | ||
1296 | chapter of the BitBake User Manual. | ||
1297 | <itemizedlist> | ||
1298 | <listitem><para><emphasis>Variable Assignments and Manipulations:</emphasis> | ||
1299 | Variable assignments allow a value to be assigned to a | ||
1300 | variable. | ||
1301 | The assignment can be static text or might include | ||
1302 | the contents of other variables. | ||
1303 | In addition to the assignment, appending and prepending | ||
1304 | operations are also supported.</para> | ||
1305 | <para>The following example shows some of the ways | ||
1306 | you can use variables in recipes: | ||
1307 | <literallayout class='monospaced'> | ||
1308 | S = "${WORKDIR}/postfix-${PV}" | ||
1309 | CFLAGS += "-DNO_ASM" | ||
1310 | SRC_URI_append = " file://fixup.patch" | ||
1311 | </literallayout> | ||
1312 | </para></listitem> | ||
1313 | <listitem><para><emphasis>Functions:</emphasis> | ||
1314 | Functions provide a series of actions to be performed. | ||
1315 | You usually use functions to override the default | ||
1316 | implementation of a task function or to compliment | ||
1317 | a default function (i.e. append or prepend to an | ||
1318 | existing function). | ||
1319 | Standard functions use <filename>sh</filename> shell | ||
1320 | syntax, although access to OpenEmbedded variables and | ||
1321 | internal methods are also available.</para> | ||
1322 | <para>The following is an example function from the | ||
1323 | <filename>sed</filename> recipe: | ||
1324 | <literallayout class='monospaced'> | ||
1325 | do_install () { | ||
1326 | autotools_do_install | ||
1327 | install -d ${D}${base_bindir} | ||
1328 | mv ${D}${bindir}/sed ${D}${base_bindir}/sed.${PN} | ||
1329 | } | ||
1330 | </literallayout> | ||
1331 | It is also possible to implement new functions that | ||
1332 | are called between existing tasks as long as the | ||
1333 | new functions are not replacing or complimenting the | ||
1334 | default functions. | ||
1335 | You can implement functions in Python | ||
1336 | instead of shell. | ||
1337 | Both of these options are not seen in the majority of | ||
1338 | recipes.</para></listitem> | ||
1339 | <listitem><para><emphasis>Keywords:</emphasis> | ||
1340 | BitBake recipes use only a few keywords. | ||
1341 | You use keywords to include common | ||
1342 | functions (<filename>inherit</filename>), load parts | ||
1343 | of a recipe from other files | ||
1344 | (<filename>include</filename> and | ||
1345 | <filename>require</filename>) and export variables | ||
1346 | to the environment (<filename>export</filename>).</para> | ||
1347 | <para>The following example shows the use of some of | ||
1348 | these keywords: | ||
1349 | <literallayout class='monospaced'> | ||
1350 | export POSTCONF = "${STAGING_BINDIR}/postconf" | ||
1351 | inherit autoconf | ||
1352 | require otherfile.inc | ||
1353 | </literallayout> | ||
1354 | </para></listitem> | ||
1355 | <listitem><para><emphasis>Comments:</emphasis> | ||
1356 | Any lines that begin with the hash character | ||
1357 | (<filename>#</filename>) are treated as comment lines | ||
1358 | and are ignored: | ||
1359 | <literallayout class='monospaced'> | ||
1360 | # This is a comment | ||
1361 | </literallayout> | ||
1362 | </para></listitem> | ||
1363 | </itemizedlist> | ||
1364 | </para> | ||
1365 | |||
1366 | <para> | ||
1367 | This next list summarizes the most important and most commonly | ||
1368 | used parts of the recipe syntax. | ||
1369 | For more information on these parts of the syntax, you can | ||
1370 | reference the | ||
1371 | <ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-metadata'>Syntax and Operators</ulink> | ||
1372 | chapter in the BitBake User Manual. | ||
1373 | <itemizedlist> | ||
1374 | <listitem><para><emphasis>Line Continuation: <filename>\</filename></emphasis> - | ||
1375 | Use the backward slash (<filename>\</filename>) | ||
1376 | character to split a statement over multiple lines. | ||
1377 | Place the slash character at the end of the line that | ||
1378 | is to be continued on the next line: | ||
1379 | <literallayout class='monospaced'> | ||
1380 | VAR = "A really long \ | ||
1381 | line" | ||
1382 | </literallayout> | ||
1383 | <note> | ||
1384 | You cannot have any characters including spaces | ||
1385 | or tabs after the slash character. | ||
1386 | </note> | ||
1387 | </para></listitem> | ||
1388 | <listitem><para><emphasis>Using Variables: <filename>${...}</filename></emphasis> - | ||
1389 | Use the <filename>${<varname>}</filename> syntax to | ||
1390 | access the contents of a variable: | ||
1391 | <literallayout class='monospaced'> | ||
1392 | SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/zlib-${PV}.tar.gz" | ||
1393 | </literallayout> | ||
1394 | </para></listitem> | ||
1395 | <listitem><para><emphasis>Quote All Assignments: <filename>"<value>"</filename></emphasis> - | ||
1396 | Use double quotes around the value in all variable | ||
1397 | assignments. | ||
1398 | <literallayout class='monospaced'> | ||
1399 | VAR1 = "${OTHERVAR}" | ||
1400 | VAR2 = "The version is ${PV}" | ||
1401 | </literallayout> | ||
1402 | </para></listitem> | ||
1403 | <listitem><para><emphasis>Conditional Assignment: <filename>?=</filename></emphasis> - | ||
1404 | Conditional assignment is used to assign a value to | ||
1405 | a variable, but only when the variable is currently | ||
1406 | unset. | ||
1407 | Use the question mark followed by the equal sign | ||
1408 | (<filename>?=</filename>) to make a "soft" assignment | ||
1409 | used for conditional assignment. | ||
1410 | Typically, "soft" assignments are used in the | ||
1411 | <filename>local.conf</filename> file for variables | ||
1412 | that are allowed to come through from the external | ||
1413 | environment. | ||
1414 | </para> | ||
1415 | <para>Here is an example where | ||
1416 | <filename>VAR1</filename> is set to "New value" if | ||
1417 | it is currently empty. | ||
1418 | However, if <filename>VAR1</filename> has already been | ||
1419 | set, it remains unchanged: | ||
1420 | <literallayout class='monospaced'> | ||
1421 | VAR1 ?= "New value" | ||
1422 | </literallayout> | ||
1423 | In this next example, <filename>VAR1</filename> | ||
1424 | is left with the value "Original value": | ||
1425 | <literallayout class='monospaced'> | ||
1426 | VAR1 = "Original value" | ||
1427 | VAR1 ?= "New value" | ||
1428 | </literallayout> | ||
1429 | </para></listitem> | ||
1430 | <listitem><para><emphasis>Appending: <filename>+=</filename></emphasis> - | ||
1431 | Use the plus character followed by the equals sign | ||
1432 | (<filename>+=</filename>) to append values to existing | ||
1433 | variables. | ||
1434 | <note> | ||
1435 | This operator adds a space between the existing | ||
1436 | content of the variable and the new content. | ||
1437 | </note></para> | ||
1438 | <para>Here is an example: | ||
1439 | <literallayout class='monospaced'> | ||
1440 | SRC_URI += "file://fix-makefile.patch" | ||
1441 | </literallayout> | ||
1442 | </para></listitem> | ||
1443 | <listitem><para><emphasis>Prepending: <filename>=+</filename></emphasis> - | ||
1444 | Use the equals sign followed by the plus character | ||
1445 | (<filename>=+</filename>) to prepend values to existing | ||
1446 | variables. | ||
1447 | <note> | ||
1448 | This operator adds a space between the new content | ||
1449 | and the existing content of the variable. | ||
1450 | </note></para> | ||
1451 | <para>Here is an example: | ||
1452 | <literallayout class='monospaced'> | ||
1453 | VAR =+ "Starts" | ||
1454 | </literallayout> | ||
1455 | </para></listitem> | ||
1456 | <listitem><para><emphasis>Appending: <filename>_append</filename></emphasis> - | ||
1457 | Use the <filename>_append</filename> operator to | ||
1458 | append values to existing variables. | ||
1459 | This operator does not add any additional space. | ||
1460 | Also, the operator is applied after all the | ||
1461 | <filename>+=</filename>, and | ||
1462 | <filename>=+</filename> operators have been applied and | ||
1463 | after all <filename>=</filename> assignments have | ||
1464 | occurred. | ||
1465 | </para> | ||
1466 | <para>The following example shows the space being | ||
1467 | explicitly added to the start to ensure the appended | ||
1468 | value is not merged with the existing value: | ||
1469 | <literallayout class='monospaced'> | ||
1470 | SRC_URI_append = " file://fix-makefile.patch" | ||
1471 | </literallayout> | ||
1472 | You can also use the <filename>_append</filename> | ||
1473 | operator with overrides, which results in the actions | ||
1474 | only being performed for the specified target or | ||
1475 | machine: | ||
1476 | <literallayout class='monospaced'> | ||
1477 | SRC_URI_append_sh4 = " file://fix-makefile.patch" | ||
1478 | </literallayout> | ||
1479 | </para></listitem> | ||
1480 | <listitem><para><emphasis>Prepending: <filename>_prepend</filename></emphasis> - | ||
1481 | Use the <filename>_prepend</filename> operator to | ||
1482 | prepend values to existing variables. | ||
1483 | This operator does not add any additional space. | ||
1484 | This operator does not add any additional space. | ||
1485 | Also, the operator is applied after all the | ||
1486 | <filename>+=</filename>, and | ||
1487 | <filename>=+</filename> operators have been applied and | ||
1488 | after all <filename>=</filename> assignments have | ||
1489 | occurred. | ||
1490 | </para> | ||
1491 | <para>The following example shows the space being | ||
1492 | explicitly added to the end to ensure the prepended | ||
1493 | value is not merged with the existing value: | ||
1494 | <literallayout class='monospaced'> | ||
1495 | CFLAGS_prepend = "-I${S}/myincludes " | ||
1496 | </literallayout> | ||
1497 | You can also use the <filename>_prepend</filename> | ||
1498 | operator with overrides, which results in the actions | ||
1499 | only being performed for the specified target or | ||
1500 | machine: | ||
1501 | <literallayout class='monospaced'> | ||
1502 | CFLAGS_prepend_sh4 = " file://fix-makefile.patch" | ||
1503 | </literallayout> | ||
1504 | </para></listitem> | ||
1505 | <listitem><para><emphasis>Overrides:</emphasis> - | ||
1506 | You can use overrides to set a value conditionally, | ||
1507 | typically on how the recipe is being built. | ||
1508 | For example, to set the | ||
1509 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink> | ||
1510 | variable's value to "standard/base" for any target | ||
1511 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>, | ||
1512 | except for qemuarm where it should be set to | ||
1513 | "standard/arm-versatile-926ejs", you would do the | ||
1514 | following: | ||
1515 | <literallayout class='monospaced'> | ||
1516 | KBRANCH = "standard/base" | ||
1517 | KBRANCH_qemuarm = "standard/arm-versatile-926ejs" | ||
1518 | </literallayout> | ||
1519 | Overrides are also used to separate alternate values | ||
1520 | of a variable in other situations. | ||
1521 | For example, when setting variables such as | ||
1522 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink> | ||
1523 | and | ||
1524 | <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>, | ||
1525 | that are specific to individual packages produced by | ||
1526 | a recipe, you should always use an override that | ||
1527 | specifies the name of the package. | ||
1528 | </para></listitem> | ||
1529 | <listitem><para><emphasis>Indentation:</emphasis> | ||
1530 | Use spaces for indentation rather than than tabs. | ||
1531 | For shell functions, both currently work. | ||
1532 | However, it is a policy decision of the Yocto Project | ||
1533 | to use tabs in shell functions. | ||
1534 | Realize that some layers have a policy to use spaces | ||
1535 | for all indentation. | ||
1536 | </para></listitem> | ||
1537 | <listitem><para><emphasis>Using Python for Complex Operations: <filename>${@<python_code>}</filename></emphasis> - | ||
1538 | For more advanced processing, it is possible to use | ||
1539 | Python code during variable assignments (e.g. | ||
1540 | search and replacement on a variable).</para> | ||
1541 | <para>You indicate Python code using the | ||
1542 | <filename>${@<python_code>}</filename> | ||
1543 | syntax for the variable assignment: | ||
1544 | <literallayout class='monospaced'> | ||
1545 | SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz | ||
1546 | </literallayout> | ||
1547 | </para></listitem> | ||
1548 | <listitem><para><emphasis>Shell Function Syntax:</emphasis> | ||
1549 | Write shell functions as if you were writing a shell | ||
1550 | script when you describe a list of actions to take. | ||
1551 | You should ensure that your script works with a generic | ||
1552 | <filename>sh</filename> and that it does not require | ||
1553 | any <filename>bash</filename> or other shell-specific | ||
1554 | functionality. | ||
1555 | The same considerations apply to various system | ||
1556 | utilities (e.g. <filename>sed</filename>, | ||
1557 | <filename>grep</filename>, <filename>awk</filename>, | ||
1558 | and so forth) that you might wish to use. | ||
1559 | If in doubt, you should check with multiple | ||
1560 | implementations - including those from BusyBox. | ||
1561 | </para></listitem> | ||
1562 | </itemizedlist> | ||
1563 | </para> | ||
1564 | </section> | ||
1565 | |||
1566 | <section id='new-recipe-running-a-build-on-the-recipe'> | ||
1567 | <title>Running a Build on the Recipe</title> | ||
1568 | |||
1569 | <para> | ||
1570 | Creating a new recipe is usually an iterative process that | ||
1571 | requires using BitBake to process the recipe multiple times in | ||
1572 | order to progressively discover and add information to the | ||
1573 | recipe. | ||
1574 | </para> | ||
1575 | |||
1576 | <para> | ||
1577 | Assuming you have sourced a build environment setup script (i.e. | ||
1578 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> | ||
1579 | or | ||
1580 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>) | ||
1581 | and you are in the | ||
1582 | <link linkend='build-directory'>Build Directory</link>, | ||
1583 | use BitBake to process your recipe. | ||
1584 | All you need to provide is the | ||
1585 | <filename><basename></filename> of the recipe as described | ||
1586 | in the previous section: | ||
1587 | <literallayout class='monospaced'> | ||
1588 | $ bitbake <basename> | ||
1589 | </literallayout> | ||
1590 | |||
1591 | </para> | ||
1592 | |||
1593 | <para> | ||
1594 | During the build, the OpenEmbedded build system creates a | ||
1595 | temporary work directory for the recipe | ||
1596 | (<filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}</filename>) | ||
1597 | where it keeps extracted source files, log files, intermediate | ||
1598 | compilation and packaging files, and so forth. | ||
1599 | </para> | ||
1600 | |||
1601 | <para> | ||
1602 | The temporary work directory is constructed as follows and | ||
1603 | depends on several factors: | ||
1604 | <literallayout class='monospaced'> | ||
1605 | ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR} | ||
1606 | </literallayout> | ||
1607 | As an example, assume a Source Directory top-level folder named | ||
1608 | <filename>poky</filename>, a default Build Directory at | ||
1609 | <filename>poky/build</filename>, and a | ||
1610 | <filename>qemux86-poky-linux</filename> machine target system. | ||
1611 | Furthermore, suppose your recipe is named | ||
1612 | <filename>foo_1.3.0-r0.bb</filename>. | ||
1613 | In this case, the work directory the build system uses to | ||
1614 | build the package would be as follows: | ||
1615 | <literallayout class='monospaced'> | ||
1616 | poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0 | ||
1617 | </literallayout> | ||
1618 | Inside this directory you can find sub-directories such as | ||
1619 | <filename>image</filename>, <filename>packages-split</filename>, | ||
1620 | and <filename>temp</filename>. | ||
1621 | After the build, you can examine these to determine how well | ||
1622 | the build went. | ||
1623 | <note> | ||
1624 | You can find log files for each task in the recipe's | ||
1625 | <filename>temp</filename> directory (e.g. | ||
1626 | <filename>poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0/temp</filename>). | ||
1627 | Log files are named <filename>log.<taskname></filename> | ||
1628 | (e.g. <filename>log.do_configure</filename>, | ||
1629 | <filename>log.do_fetch</filename>, and | ||
1630 | <filename>log.do_compile</filename>). | ||
1631 | </note> | ||
1632 | </para> | ||
1633 | |||
1634 | <para> | ||
1635 | You can find more information about the build process in the | ||
1636 | "<ulink url='&YOCTO_DOCS_REF_URL;#closer-look'>A Closer Look at the Yocto Project Development Environment</ulink>" | ||
1637 | chapter of the Yocto Project Reference Manual. | ||
1638 | </para> | ||
1639 | |||
1640 | <para> | ||
1641 | You can also reference the following variables in the | ||
1642 | Yocto Project Reference Manual's glossary for more information: | ||
1643 | <itemizedlist> | ||
1644 | <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>: | ||
1645 | The top-level build output directory</listitem> | ||
1646 | <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></ulink>: | ||
1647 | The target system identifier</listitem> | ||
1648 | <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>: | ||
1649 | The recipe name</listitem> | ||
1650 | <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-EXTENDPE'><filename>EXTENDPE</filename></ulink>: | ||
1651 | The epoch - (if | ||
1652 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink> | ||
1653 | is not specified, which is usually the case for most | ||
1654 | recipes, then <filename>EXTENDPE</filename> is blank)</listitem> | ||
1655 | <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>: | ||
1656 | The recipe version</listitem> | ||
1657 | <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>: | ||
1658 | The recipe revision</listitem> | ||
1659 | </itemizedlist> | ||
1660 | </para> | ||
1661 | </section> | ||
1662 | |||
1663 | <section id='new-recipe-fetching-code'> | ||
1664 | <title>Fetching Code</title> | ||
1665 | |||
1666 | <para> | ||
1667 | The first thing your recipe must do is specify how to fetch | ||
1668 | the source files. | ||
1669 | Fetching is controlled mainly through the | ||
1670 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
1671 | variable. | ||
1672 | Your recipe must have a <filename>SRC_URI</filename> variable | ||
1673 | that points to where the source is located. | ||
1674 | For a graphical representation of source locations, see the | ||
1675 | "<ulink url='&YOCTO_DOCS_REF_URL;#sources-dev-environment'>Sources</ulink>" | ||
1676 | section in the Yocto Project Reference Manual. | ||
1677 | </para> | ||
1678 | |||
1679 | <para> | ||
1680 | The | ||
1681 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink> | ||
1682 | task uses the prefix of each entry in the | ||
1683 | <filename>SRC_URI</filename> variable value to determine what | ||
1684 | fetcher to use to get your source files. | ||
1685 | It is the <filename>SRC_URI</filename> variable that triggers | ||
1686 | the fetcher. | ||
1687 | The | ||
1688 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink> | ||
1689 | task uses the variable after source is fetched to apply | ||
1690 | patches. | ||
1691 | The OpenEmbedded build system uses | ||
1692 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESOVERRIDES'><filename>FILESOVERRIDES</filename></ulink> | ||
1693 | for scanning directory locations for local files in | ||
1694 | <filename>SRC_URI</filename>. | ||
1695 | </para> | ||
1696 | |||
1697 | <para> | ||
1698 | The <filename>SRC_URI</filename> variable in your recipe must | ||
1699 | define each unique location for your source files. | ||
1700 | It is good practice to not hard-code pathnames in an URL used | ||
1701 | in <filename>SRC_URI</filename>. | ||
1702 | Rather than hard-code these paths, use | ||
1703 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink><filename>}</filename>, | ||
1704 | which causes the fetch process to use the version specified in | ||
1705 | the recipe filename. | ||
1706 | Specifying the version in this manner means that upgrading the | ||
1707 | recipe to a future version is as simple as renaming the recipe | ||
1708 | to match the new version. | ||
1709 | </para> | ||
1710 | |||
1711 | <para> | ||
1712 | Here is a simple example from the | ||
1713 | <filename>meta/recipes-devtools/cdrtools/cdrtools-native_3.01a17.bb</filename> | ||
1714 | recipe where the source comes from a single tarball. | ||
1715 | Notice the use of the | ||
1716 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink> | ||
1717 | variable: | ||
1718 | <literallayout class='monospaced'> | ||
1719 | SRC_URI = "ftp://ftp.berlios.de/pub/cdrecord/alpha/cdrtools-${PV}.tar.bz2" | ||
1720 | </literallayout> | ||
1721 | </para> | ||
1722 | |||
1723 | <para> | ||
1724 | Files mentioned in <filename>SRC_URI</filename> whose names end | ||
1725 | in a typical archive extension (e.g. <filename>.tar</filename>, | ||
1726 | <filename>.tar.gz</filename>, <filename>.tar.bz2</filename>, | ||
1727 | <filename>.zip</filename>, and so forth), are automatically | ||
1728 | extracted during the | ||
1729 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-unpack'><filename>do_unpack</filename></ulink> | ||
1730 | task. | ||
1731 | For another example that specifies these types of files, see | ||
1732 | the | ||
1733 | "<link linkend='new-recipe-autotooled-package'>Autotooled Package</link>" | ||
1734 | section. | ||
1735 | </para> | ||
1736 | |||
1737 | <para> | ||
1738 | Another way of specifying source is from an SCM. | ||
1739 | For Git repositories, you must specify | ||
1740 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink> | ||
1741 | and you should specify | ||
1742 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink> | ||
1743 | to include the revision with | ||
1744 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCPV'><filename>SRCPV</filename></ulink>. | ||
1745 | Here is an example from the recipe | ||
1746 | <filename>meta/recipes-kernel/blktrace/blktrace_git.bb</filename>: | ||
1747 | <literallayout class='monospaced'> | ||
1748 | SRCREV = "d6918c8832793b4205ed3bfede78c2f915c23385" | ||
1749 | |||
1750 | PR = "r6" | ||
1751 | PV = "1.0.5+git${SRCPV}" | ||
1752 | |||
1753 | SRC_URI = "git://git.kernel.dk/blktrace.git \ | ||
1754 | file://ldflags.patch" | ||
1755 | </literallayout> | ||
1756 | </para> | ||
1757 | |||
1758 | <para> | ||
1759 | If your <filename>SRC_URI</filename> statement includes | ||
1760 | URLs pointing to individual files fetched from a remote server | ||
1761 | other than a version control system, BitBake attempts to | ||
1762 | verify the files against checksums defined in your recipe to | ||
1763 | ensure they have not been tampered with or otherwise modified | ||
1764 | since the recipe was written. | ||
1765 | Two checksums are used: | ||
1766 | <filename>SRC_URI[md5sum]</filename> and | ||
1767 | <filename>SRC_URI[sha256sum]</filename>. | ||
1768 | </para> | ||
1769 | |||
1770 | <para> | ||
1771 | If your <filename>SRC_URI</filename> variable points to | ||
1772 | more than a single URL (excluding SCM URLs), you need to | ||
1773 | provide the <filename>md5</filename> and | ||
1774 | <filename>sha256</filename> checksums for each URL. | ||
1775 | For these cases, you provide a name for each URL as part of | ||
1776 | the <filename>SRC_URI</filename> and then reference that name | ||
1777 | in the subsequent checksum statements. | ||
1778 | Here is an example: | ||
1779 | <literallayout class='monospaced'> | ||
1780 | SRC_URI = "${DEBIAN_MIRROR}/main/a/apmd/apmd_3.2.2.orig.tar.gz;name=tarball \ | ||
1781 | ${DEBIAN_MIRROR}/main/a/apmd/apmd_${PV}.diff.gz;name=patch | ||
1782 | |||
1783 | SRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8" | ||
1784 | SRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d" | ||
1785 | |||
1786 | SRC_URI[patch.md5sum] = "57e1b689264ea80f78353519eece0c92" | ||
1787 | SRC_URI[patch.sha256sum] = "7905ff96be93d725544d0040e425c42f9c05580db3c272f11cff75b9aa89d430" | ||
1788 | </literallayout> | ||
1789 | </para> | ||
1790 | |||
1791 | <para> | ||
1792 | To find these checksums, you can comment the statements out | ||
1793 | and then attempt to build the software. | ||
1794 | The build will produce an error for each missing checksum | ||
1795 | and as part of the error message provide the correct checksum | ||
1796 | string. | ||
1797 | Once you have the correct checksums, simply copy them into your | ||
1798 | recipe for a subsequent build. | ||
1799 | </para> | ||
1800 | |||
1801 | <para> | ||
1802 | This final example is a bit more complicated and is from the | ||
1803 | <filename>meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.19.bb</filename> | ||
1804 | recipe. | ||
1805 | The example's <filename>SRC_URI</filename> statement identifies | ||
1806 | multiple files as the source files for the recipe: a tarball, a | ||
1807 | patch file, a desktop file, and an icon. | ||
1808 | <literallayout class='monospaced'> | ||
1809 | SRC_URI = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${PV}.tar.bz2 \ | ||
1810 | file://xwc.patch \ | ||
1811 | file://rxvt.desktop \ | ||
1812 | file://rxvt.png" | ||
1813 | </literallayout> | ||
1814 | </para> | ||
1815 | |||
1816 | <para> | ||
1817 | When you specify local files using the | ||
1818 | <filename>file://</filename> URI protocol, the build system | ||
1819 | fetches files from the local machine. | ||
1820 | The path is relative to the | ||
1821 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink> | ||
1822 | variable and searches specific directories in a certain order: | ||
1823 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BPN'><filename>BPN</filename></ulink><filename>}</filename>, | ||
1824 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BP'><filename>BP</filename></ulink><filename>}</filename>, | ||
1825 | and <filename>files</filename>. | ||
1826 | The directories are assumed to be subdirectories of the | ||
1827 | directory in which the recipe or append file resides. | ||
1828 | For another example that specifies these types of files, see the | ||
1829 | "<link linkend='new-recipe-single-c-file-package-hello-world'>Single .c File Package (Hello World!)</link>" | ||
1830 | section. | ||
1831 | </para> | ||
1832 | |||
1833 | <para> | ||
1834 | The previous example also specifies a patch file. | ||
1835 | Patch files are files whose names end in | ||
1836 | <filename>.patch</filename> or <filename>.diff</filename>. | ||
1837 | The build system automatically applies patches as described | ||
1838 | in the | ||
1839 | "<link linkend='new-recipe-patching-code'>Patching Code</link>" section. | ||
1840 | </para> | ||
1841 | </section> | ||
1842 | |||
1843 | <section id='new-recipe-unpacking-code'> | ||
1844 | <title>Unpacking Code</title> | ||
1845 | |||
1846 | <para> | ||
1847 | During the build, the | ||
1848 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-unpack'><filename>do_unpack</filename></ulink> | ||
1849 | task unpacks the source with | ||
1850 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink><filename>}</filename> | ||
1851 | pointing to where it is unpacked. | ||
1852 | </para> | ||
1853 | |||
1854 | <para> | ||
1855 | If you are fetching your source files from an upstream source | ||
1856 | archived tarball and the tarball's internal structure matches | ||
1857 | the common convention of a top-level subdirectory named | ||
1858 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BPN'><filename>BPN</filename></ulink><filename>}-${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink><filename>}</filename>, | ||
1859 | then you do not need to set <filename>S</filename>. | ||
1860 | However, if <filename>SRC_URI</filename> specifies to fetch | ||
1861 | source from an archive that does not use this convention, | ||
1862 | or from an SCM like Git or Subversion, your recipe needs to | ||
1863 | define <filename>S</filename>. | ||
1864 | </para> | ||
1865 | |||
1866 | <para> | ||
1867 | If processing your recipe using BitBake successfully unpacks | ||
1868 | the source files, you need to be sure that the directory | ||
1869 | pointed to by <filename>${S}</filename> matches the structure | ||
1870 | of the source. | ||
1871 | </para> | ||
1872 | </section> | ||
1873 | |||
1874 | <section id='new-recipe-patching-code'> | ||
1875 | <title>Patching Code</title> | ||
1876 | |||
1877 | <para> | ||
1878 | Sometimes it is necessary to patch code after it has been | ||
1879 | fetched. | ||
1880 | Any files mentioned in <filename>SRC_URI</filename> whose | ||
1881 | names end in <filename>.patch</filename> or | ||
1882 | <filename>.diff</filename> are treated as patches. | ||
1883 | The | ||
1884 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink> | ||
1885 | task automatically applies these patches. | ||
1886 | </para> | ||
1887 | |||
1888 | <para> | ||
1889 | The build system should be able to apply patches with the "-p1" | ||
1890 | option (i.e. one directory level in the path will be stripped | ||
1891 | off). | ||
1892 | If your patch needs to have more directory levels stripped off, | ||
1893 | specify the number of levels using the "striplevel" option in | ||
1894 | the <filename>SRC_URI</filename> entry for the patch. | ||
1895 | Alternatively, if your patch needs to be applied in a specific | ||
1896 | subdirectory that is not specified in the patch file, use the | ||
1897 | "patchdir" option in the entry. | ||
1898 | </para> | ||
1899 | |||
1900 | <para> | ||
1901 | As with all local files referenced in | ||
1902 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
1903 | using <filename>file://</filename>, you should place | ||
1904 | patch files in a directory next to the recipe either | ||
1905 | named the same as the base name of the recipe | ||
1906 | (<ulink url='&YOCTO_DOCS_REF_URL;#var-BPN'><filename>BPN</filename></ulink>), | ||
1907 | or "files". | ||
1908 | </para> | ||
1909 | </section> | ||
1910 | |||
1911 | <section id='new-recipe-licensing'> | ||
1912 | <title>Licensing</title> | ||
1913 | |||
1914 | <para> | ||
1915 | Your recipe needs to have both the | ||
1916 | <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE'><filename>LICENSE</filename></ulink> | ||
1917 | and | ||
1918 | <ulink url='&YOCTO_DOCS_REF_URL;#var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></ulink> | ||
1919 | variables: | ||
1920 | <itemizedlist> | ||
1921 | <listitem><para><emphasis><filename>LICENSE</filename>:</emphasis> | ||
1922 | This variable specifies the license for the software. | ||
1923 | If you do not know the license under which the software | ||
1924 | you are building is distributed, you should go to the | ||
1925 | source code and look for that information. | ||
1926 | Typical files containing this information include | ||
1927 | <filename>COPYING</filename>, | ||
1928 | <filename>LICENSE</filename>, and | ||
1929 | <filename>README</filename> files. | ||
1930 | You could also find the information near the top of | ||
1931 | a source file. | ||
1932 | For example, given a piece of software licensed under | ||
1933 | the GNU General Public License version 2, you would | ||
1934 | set <filename>LICENSE</filename> as follows: | ||
1935 | <literallayout class='monospaced'> | ||
1936 | LICENSE = "GPLv2" | ||
1937 | </literallayout></para> | ||
1938 | <para>The licenses you specify within | ||
1939 | <filename>LICENSE</filename> can have any name as long | ||
1940 | as you do not use spaces, since spaces are used as | ||
1941 | separators between license names. | ||
1942 | For standard licenses, use the names of the files in | ||
1943 | <filename>meta/files/common-licenses/</filename> | ||
1944 | or the <filename>SPDXLICENSEMAP</filename> flag names | ||
1945 | defined in <filename>meta/conf/licenses.conf</filename>. | ||
1946 | </para></listitem> | ||
1947 | <listitem><para><emphasis><filename>LIC_FILES_CHKSUM</filename>:</emphasis> | ||
1948 | The OpenEmbedded build system uses this variable to | ||
1949 | make sure the license text has not changed. | ||
1950 | If it has, the build produces an error and it affords | ||
1951 | you the chance to figure it out and correct the problem. | ||
1952 | </para> | ||
1953 | <para>You need to specify all applicable licensing | ||
1954 | files for the software. | ||
1955 | At the end of the configuration step, the build process | ||
1956 | will compare the checksums of the files to be sure | ||
1957 | the text has not changed. | ||
1958 | Any differences result in an error with the message | ||
1959 | containing the current checksum. | ||
1960 | For more explanation and examples of how to set the | ||
1961 | <filename>LIC_FILES_CHKSUM</filename> variable, see the | ||
1962 | "<ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-configuring-LIC_FILES_CHKSUM'>Tracking License Changes</ulink>" | ||
1963 | section in the Yocto Project Reference Manual.</para> | ||
1964 | <para>To determine the correct checksum string, you | ||
1965 | can list the appropriate files in the | ||
1966 | <filename>LIC_FILES_CHKSUM</filename> variable with | ||
1967 | incorrect md5 strings, attempt to build the software, | ||
1968 | and then note the resulting error messages that will | ||
1969 | report the correct md5 strings. | ||
1970 | Here is an example that assumes the software has a | ||
1971 | <filename>COPYING</filename> file: | ||
1972 | <literallayout class='monospaced'> | ||
1973 | LIC_FILES_CHKSUM = "file://COPYING;md5=xxx" | ||
1974 | </literallayout> | ||
1975 | When you try to build the software, the build system | ||
1976 | will produce an error and give you the correct string | ||
1977 | that you can substitute into the recipe file for a | ||
1978 | subsequent build. | ||
1979 | </para></listitem> | ||
1980 | </itemizedlist> | ||
1981 | </para> | ||
1982 | |||
1983 | <!-- | ||
1984 | |||
1985 | <para> | ||
1986 | For trying this out I created a new recipe named | ||
1987 | <filename>htop_1.0.2.bb</filename> and put it in | ||
1988 | <filename>poky/meta/recipes-extended/htop</filename>. | ||
1989 | There are two license type statements in my very simple | ||
1990 | recipe: | ||
1991 | <literallayout class='monospaced'> | ||
1992 | LICENSE = "" | ||
1993 | |||
1994 | LIC_FILES_CHKSUM = "" | ||
1995 | |||
1996 | SRC_URI[md5sum] = "" | ||
1997 | SRC_URI[sha256sum] = "" | ||
1998 | </literallayout> | ||
1999 | Evidently, you need to run a <filename>bitbake -c cleanall htop</filename>. | ||
2000 | Next, you delete or comment out the two <filename>SRC_URI</filename> | ||
2001 | lines at the end and then attempt to build the software with | ||
2002 | <filename>bitbake htop</filename>. | ||
2003 | Doing so causes BitBake to report some errors and and give | ||
2004 | you the actual strings you need for the last two | ||
2005 | <filename>SRC_URI</filename> lines. | ||
2006 | Prior to this, you have to dig around in the home page of the | ||
2007 | source for <filename>htop</filename> and determine that the | ||
2008 | software is released under GPLv2. | ||
2009 | You can provide that in the <filename>LICENSE</filename> | ||
2010 | statement. | ||
2011 | Now you edit your recipe to have those two strings for | ||
2012 | the <filename>SRC_URI</filename> statements: | ||
2013 | <literallayout class='monospaced'> | ||
2014 | LICENSE = "GPLv2" | ||
2015 | |||
2016 | LIC_FILES_CHKSUM = "" | ||
2017 | |||
2018 | SRC_URI = "${SOURCEFORGE_MIRROR}/htop/htop-${PV}.tar.gz" | ||
2019 | SRC_URI[md5sum] = "0d01cca8df3349c74569cefebbd9919e" | ||
2020 | SRC_URI[sha256sum] = "ee60657b044ece0df096c053060df7abf3cce3a568ab34d260049e6a37ccd8a1" | ||
2021 | </literallayout> | ||
2022 | At this point, you can build the software again using the | ||
2023 | <filename>bitbake htop</filename> command. | ||
2024 | There is just a set of errors now associated with the | ||
2025 | empty <filename>LIC_FILES_CHKSUM</filename> variable now. | ||
2026 | </para> | ||
2027 | --> | ||
2028 | |||
2029 | </section> | ||
2030 | |||
2031 | <section id='new-recipe-configuring-the-recipe'> | ||
2032 | <title>Configuring the Recipe</title> | ||
2033 | |||
2034 | <para> | ||
2035 | Most software provides some means of setting build-time | ||
2036 | configuration options before compilation. | ||
2037 | Typically, setting these options is accomplished by running a | ||
2038 | configure script with some options, or by modifying a build | ||
2039 | configuration file. | ||
2040 | </para> | ||
2041 | |||
2042 | <para> | ||
2043 | A major part of build-time configuration is about checking for | ||
2044 | build-time dependencies and possibly enabling optional | ||
2045 | functionality as a result. | ||
2046 | You need to specify any build-time dependencies for the | ||
2047 | software you are building in your recipe's | ||
2048 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink> | ||
2049 | value, in terms of other recipes that satisfy those | ||
2050 | dependencies. | ||
2051 | You can often find build-time or runtime | ||
2052 | dependencies described in the software's documentation. | ||
2053 | </para> | ||
2054 | |||
2055 | <para> | ||
2056 | The following list provides configuration items of note based | ||
2057 | on how your software is built: | ||
2058 | <itemizedlist> | ||
2059 | <listitem><para><emphasis>Autotools:</emphasis> | ||
2060 | If your source files have a | ||
2061 | <filename>configure.ac</filename> file, then your | ||
2062 | software is built using Autotools. | ||
2063 | If this is the case, you just need to worry about | ||
2064 | tweaking the configuration.</para> | ||
2065 | <para>When using Autotools, your recipe needs to inherit | ||
2066 | the | ||
2067 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-autotools'><filename>autotools</filename></ulink> | ||
2068 | class and your recipe does not have to contain a | ||
2069 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-configure'><filename>do_configure</filename></ulink> | ||
2070 | task. | ||
2071 | However, you might still want to make some adjustments. | ||
2072 | For example, you can set | ||
2073 | <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></ulink> | ||
2074 | to pass any needed configure options that are specific | ||
2075 | to the recipe.</para></listitem> | ||
2076 | <listitem><para><emphasis>CMake:</emphasis> | ||
2077 | If your source files have a | ||
2078 | <filename>CMakeLists.txt</filename> file, then your | ||
2079 | software is built using CMake. | ||
2080 | If this is the case, you just need to worry about | ||
2081 | tweaking the configuration.</para> | ||
2082 | <para>When you use CMake, your recipe needs to inherit | ||
2083 | the | ||
2084 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-cmake'><filename>cmake</filename></ulink> | ||
2085 | class and your recipe does not have to contain a | ||
2086 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-configure'><filename>do_configure</filename></ulink> | ||
2087 | task. | ||
2088 | You can make some adjustments by setting | ||
2089 | <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OECMAKE'><filename>EXTRA_OECMAKE</filename></ulink> | ||
2090 | to pass any needed configure options that are specific | ||
2091 | to the recipe.</para></listitem> | ||
2092 | <listitem><para><emphasis>Other:</emphasis> | ||
2093 | If your source files do not have a | ||
2094 | <filename>configure.ac</filename> or | ||
2095 | <filename>CMakeLists.txt</filename> file, then your | ||
2096 | software is built using some method other than Autotools | ||
2097 | or CMake. | ||
2098 | If this is the case, you normally need to provide a | ||
2099 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-configure'><filename>do_configure</filename></ulink> | ||
2100 | task in your recipe | ||
2101 | unless, of course, there is nothing to configure. | ||
2102 | </para> | ||
2103 | <para>Even if your software is not being built by | ||
2104 | Autotools or CMake, you still might not need to deal | ||
2105 | with any configuration issues. | ||
2106 | You need to determine if configuration is even a required step. | ||
2107 | You might need to modify a Makefile or some configuration file | ||
2108 | used for the build to specify necessary build options. | ||
2109 | Or, perhaps you might need to run a provided, custom | ||
2110 | configure script with the appropriate options.</para> | ||
2111 | <para>For the case involving a custom configure | ||
2112 | script, you would run | ||
2113 | <filename>./configure --help</filename> and look for | ||
2114 | the options you need to set.</para></listitem> | ||
2115 | </itemizedlist> | ||
2116 | </para> | ||
2117 | |||
2118 | <para> | ||
2119 | Once configuration succeeds, it is always good practice to | ||
2120 | look at the <filename>log.do_configure</filename> file to | ||
2121 | ensure that the appropriate options have been enabled and no | ||
2122 | additional build-time dependencies need to be added to | ||
2123 | <filename>DEPENDS</filename>. | ||
2124 | For example, if the configure script reports that it found | ||
2125 | something not mentioned in <filename>DEPENDS</filename>, or | ||
2126 | that it did not find something that it needed for some | ||
2127 | desired optional functionality, then you would need to add | ||
2128 | those to <filename>DEPENDS</filename>. | ||
2129 | Looking at the log might also reveal items being checked for | ||
2130 | and/or enabled that you do not want, or items not being found | ||
2131 | that are in <filename>DEPENDS</filename>, in which case | ||
2132 | you would need to look at passing extra options to the | ||
2133 | configure script as needed. | ||
2134 | For reference information on configure options specific to the | ||
2135 | software you are building, you can consult the output of the | ||
2136 | <filename>./configure --help</filename> command within | ||
2137 | <filename>${S}</filename> or consult the software's upstream | ||
2138 | documentation. | ||
2139 | </para> | ||
2140 | </section> | ||
2141 | |||
2142 | <section id='new-recipe-compilation'> | ||
2143 | <title>Compilation</title> | ||
2144 | |||
2145 | <para> | ||
2146 | During a build, the <filename>do_compile</filename> task | ||
2147 | happens after source is fetched, unpacked, and configured. | ||
2148 | If the recipe passes through <filename>do_compile</filename> | ||
2149 | successfully, nothing needs to be done. | ||
2150 | </para> | ||
2151 | |||
2152 | <para> | ||
2153 | However, if the compile step fails, you need to diagnose the | ||
2154 | failure. | ||
2155 | Here are some common issues that cause failures: | ||
2156 | <itemizedlist> | ||
2157 | <listitem><para><emphasis>Parallel build failures:</emphasis> | ||
2158 | These failures manifest themselves as intermittent | ||
2159 | errors, or errors reporting that a file or directory | ||
2160 | that should be created by some other part of the build | ||
2161 | process could not be found. | ||
2162 | This type of failure can occur even if, upon inspection, | ||
2163 | the file or directory does exist after the build has | ||
2164 | failed, because that part of the build process happened | ||
2165 | in the wrong order.</para> | ||
2166 | <para>To fix the problem, you need to either satisfy | ||
2167 | the missing dependency in the Makefile or whatever | ||
2168 | script produced the Makefile, or (as a workaround) | ||
2169 | set | ||
2170 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></ulink> | ||
2171 | to an empty string: | ||
2172 | <literallayout class='monospaced'> | ||
2173 | PARALLEL_MAKE = "" | ||
2174 | </literallayout></para></listitem> | ||
2175 | <listitem><para><emphasis>Improper host path usage:</emphasis> | ||
2176 | This failure applies to recipes building for the target | ||
2177 | or <filename>nativesdk</filename> only. | ||
2178 | The failure occurs when the compilation process uses | ||
2179 | improper headers, libraries, or other files from the | ||
2180 | host system when cross-compiling for the target. | ||
2181 | </para> | ||
2182 | <para>To fix the problem, examine the | ||
2183 | <filename>log.do_compile</filename> file to identify | ||
2184 | the host paths being used (e.g. | ||
2185 | <filename>/usr/include</filename>, | ||
2186 | <filename>/usr/lib</filename>, and so forth) and then | ||
2187 | either add configure options, apply a patch, or do both. | ||
2188 | </para></listitem> | ||
2189 | <listitem><para><emphasis>Failure to find required | ||
2190 | libraries/headers:</emphasis> | ||
2191 | If a build-time dependency is missing because it has | ||
2192 | not been declared in | ||
2193 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>, | ||
2194 | or because the dependency exists but the path used by | ||
2195 | the build process to find the file is incorrect and the | ||
2196 | configure step did not detect it, the compilation | ||
2197 | process could fail. | ||
2198 | For either of these failures, the compilation process | ||
2199 | notes that files could not be found. | ||
2200 | In these cases, you need to go back and add additional | ||
2201 | options to the configure script as well as possibly | ||
2202 | add additional build-time dependencies to | ||
2203 | <filename>DEPENDS</filename>.</para> | ||
2204 | <para>Occasionally, it is necessary to apply a patch | ||
2205 | to the source to ensure the correct paths are used. | ||
2206 | If you need to specify paths to find files staged | ||
2207 | into the sysroot from other recipes, use the variables | ||
2208 | that the OpenEmbedded build system provides | ||
2209 | (e.g. | ||
2210 | <filename>STAGING_BINDIR</filename>, | ||
2211 | <filename>STAGING_INCDIR</filename>, | ||
2212 | <filename>STAGING_DATADIR</filename>, and so forth). | ||
2213 | <!-- | ||
2214 | (e.g. | ||
2215 | <ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_BINDIR'><filename>STAGING_BINDIR</filename></ulink>, | ||
2216 | <ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_INCDIR'><filename>STAGING_INCDIR</filename></ulink>, | ||
2217 | <ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_DATADIR'><filename>STAGING_DATADIR</filename></ulink>, | ||
2218 | and so forth). | ||
2219 | --> | ||
2220 | </para></listitem> | ||
2221 | </itemizedlist> | ||
2222 | </para> | ||
2223 | </section> | ||
2224 | |||
2225 | <section id='new-recipe-installing'> | ||
2226 | <title>Installing</title> | ||
2227 | |||
2228 | <para> | ||
2229 | During <filename>do_install</filename>, the task copies the | ||
2230 | built files along with their hierarchy to locations that | ||
2231 | would mirror their locations on the target device. | ||
2232 | The installation process copies files from the | ||
2233 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink><filename>}</filename>, | ||
2234 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-B'><filename>B</filename></ulink><filename>}</filename>, | ||
2235 | and | ||
2236 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}</filename> | ||
2237 | directories to the | ||
2238 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink><filename>}</filename> | ||
2239 | directory to create the structure as it should appear on the | ||
2240 | target system. | ||
2241 | </para> | ||
2242 | |||
2243 | <para> | ||
2244 | How your software is built affects what you must do to be | ||
2245 | sure your software is installed correctly. | ||
2246 | The following list describes what you must do for installation | ||
2247 | depending on the type of build system used by the software | ||
2248 | being built: | ||
2249 | <itemizedlist> | ||
2250 | <listitem><para><emphasis>Autotools and CMake:</emphasis> | ||
2251 | If the software your recipe is building uses Autotools | ||
2252 | or CMake, the OpenEmbedded build | ||
2253 | system understands how to install the software. | ||
2254 | Consequently, you do not have to have a | ||
2255 | <filename>do_install</filename> task as part of your | ||
2256 | recipe. | ||
2257 | You just need to make sure the install portion of the | ||
2258 | build completes with no issues. | ||
2259 | However, if you wish to install additional files not | ||
2260 | already being installed by | ||
2261 | <filename>make install</filename>, you should do this | ||
2262 | using a <filename>do_install_append</filename> function | ||
2263 | using the install command as described in | ||
2264 | <emphasis>Manual</emphasis> later in this list. | ||
2265 | </para></listitem> | ||
2266 | <listitem><para><emphasis>Other (using | ||
2267 | <filename>make install</filename>):</emphasis> | ||
2268 | You need to define a | ||
2269 | <filename>do_install</filename> function in your | ||
2270 | recipe. | ||
2271 | The function should call | ||
2272 | <filename>oe_runmake install</filename> and will likely | ||
2273 | need to pass in the destination directory as well. | ||
2274 | How you pass that path is dependent on how the | ||
2275 | <filename>Makefile</filename> being run is written | ||
2276 | (e.g. <filename>DESTDIR=${D}</filename>, | ||
2277 | <filename>PREFIX=${D}</filename>, | ||
2278 | <filename>INSTALLROOT=${D}</filename>, and so forth). | ||
2279 | </para> | ||
2280 | <para>For an example recipe using | ||
2281 | <filename>make install</filename>, see the | ||
2282 | "<link linkend='new-recipe-makefile-based-package'>Makefile-Based Package</link>" | ||
2283 | section.</para></listitem> | ||
2284 | <listitem><para><emphasis>Manual:</emphasis> | ||
2285 | You need to define a | ||
2286 | <filename>do_install</filename> function in your | ||
2287 | recipe. | ||
2288 | The function must first use | ||
2289 | <filename>install -d</filename> to create the | ||
2290 | directories under | ||
2291 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink><filename>}</filename>. | ||
2292 | Once the directories exist, your function can use | ||
2293 | <filename>install</filename> to manually install the | ||
2294 | built software into the directories.</para> | ||
2295 | <para>You can find more information on | ||
2296 | <filename>install</filename> at | ||
2297 | <ulink url='http://www.gnu.org/software/coreutils/manual/html_node/install-invocation.html'></ulink>. | ||
2298 | </para></listitem> | ||
2299 | </itemizedlist> | ||
2300 | </para> | ||
2301 | |||
2302 | <para> | ||
2303 | For the scenarios that do not use Autotools or | ||
2304 | CMake, you need to track the installation | ||
2305 | and diagnose and fix any issues until everything installs | ||
2306 | correctly. | ||
2307 | You need to look in the default location of | ||
2308 | <filename>${D}</filename>, which is | ||
2309 | <filename>${WORKDIR}/image</filename>, to be sure your | ||
2310 | files have been installed correctly. | ||
2311 | </para> | ||
2312 | |||
2313 | <note> | ||
2314 | During the installation process, you might need to modify | ||
2315 | some of the installed files to suit the target layout. | ||
2316 | For example, you might need to replace hard-coded paths in an | ||
2317 | initscript with values of variables provided by the build | ||
2318 | system, such as replacing <filename>/usr/bin/</filename> with | ||
2319 | <filename>${bindir}</filename>. | ||
2320 | If you do perform such modifications during | ||
2321 | <filename>do_install</filename>, be sure to modify the | ||
2322 | destination file after copying rather than before copying. | ||
2323 | Modifying after copying ensures that the build system can | ||
2324 | re-execute <filename>do_install</filename> if needed. | ||
2325 | </note> | ||
2326 | |||
2327 | <note> | ||
2328 | <filename>oe_runmake install</filename>, which can be run | ||
2329 | directly or can be run indirectly by the | ||
2330 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-autotools'><filename>autotools</filename></ulink> | ||
2331 | and | ||
2332 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-cmake'><filename>cmake</filename></ulink> | ||
2333 | classes, runs <filename>make install</filename> in parallel. | ||
2334 | Sometimes, a Makefile can have missing dependencies between | ||
2335 | targets that can result in race conditions. | ||
2336 | If you experience intermittent failures during | ||
2337 | <filename>do_install</filename>, you might be able to work | ||
2338 | around them by disabling parallel Makefile installs | ||
2339 | by adding the following to the recipe: | ||
2340 | <literallayout class='monospaced'> | ||
2341 | PARALLEL_MAKEINST = "" | ||
2342 | </literallayout> | ||
2343 | See | ||
2344 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKEINST'><filename>PARALLEL_MAKEINST</filename></ulink> | ||
2345 | for additional information. | ||
2346 | </note> | ||
2347 | </section> | ||
2348 | |||
2349 | <section id='new-recipe-enabling-system-services'> | ||
2350 | <title>Enabling System Services</title> | ||
2351 | |||
2352 | <para> | ||
2353 | If you want to install a service, which is a process that | ||
2354 | usually starts on boot and runs in the background, then | ||
2355 | you must include some additional definitions in your recipe. | ||
2356 | </para> | ||
2357 | |||
2358 | <para> | ||
2359 | If you are adding services and the service initialization | ||
2360 | script or the service file itself is not installed, you must | ||
2361 | provide for that installation in your recipe using a | ||
2362 | <filename>do_install_append</filename> function. | ||
2363 | If your recipe already has a <filename>do_install</filename> | ||
2364 | function, update the function near its end rather than | ||
2365 | adding an additional <filename>do_install_append</filename> | ||
2366 | function. | ||
2367 | </para> | ||
2368 | |||
2369 | <para> | ||
2370 | When you create the installation for your services, you need | ||
2371 | to accomplish what is normally done by | ||
2372 | <filename>make install</filename>. | ||
2373 | In other words, make sure your installation arranges the output | ||
2374 | similar to how it is arranged on the target system. | ||
2375 | </para> | ||
2376 | |||
2377 | <para> | ||
2378 | The OpenEmbedded build system provides support for starting | ||
2379 | services two different ways: | ||
2380 | <itemizedlist> | ||
2381 | <listitem><para><emphasis>SysVinit:</emphasis> | ||
2382 | SysVinit is a system and service manager that | ||
2383 | manages the init system used to control the very basic | ||
2384 | functions of your system. | ||
2385 | The init program is the first program | ||
2386 | started by the Linux kernel when the system boots. | ||
2387 | Init then controls the startup, running and shutdown | ||
2388 | of all other programs.</para> | ||
2389 | <para>To enable a service using SysVinit, your recipe | ||
2390 | needs to inherit the | ||
2391 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-update-rc.d'><filename>update-rc.d</filename></ulink> | ||
2392 | class. | ||
2393 | The class helps facilitate safely installing the | ||
2394 | package on the target.</para> | ||
2395 | <para>You will need to set the | ||
2396 | <ulink url='&YOCTO_DOCS_REF_URL;#var-INITSCRIPT_PACKAGES'><filename>INITSCRIPT_PACKAGES</filename></ulink>, | ||
2397 | <ulink url='&YOCTO_DOCS_REF_URL;#var-INITSCRIPT_NAME'><filename>INITSCRIPT_NAME</filename></ulink>, | ||
2398 | and | ||
2399 | <ulink url='&YOCTO_DOCS_REF_URL;#var-INITSCRIPT_PARAMS'><filename>INITSCRIPT_PARAMS</filename></ulink> | ||
2400 | variables within your recipe.</para></listitem> | ||
2401 | <listitem><para><emphasis>systemd:</emphasis> | ||
2402 | System Management Daemon (systemd) was designed to | ||
2403 | replace SysVinit and to provide | ||
2404 | enhanced management of services. | ||
2405 | For more information on systemd, see the systemd | ||
2406 | homepage at | ||
2407 | <ulink url='http://freedesktop.org/wiki/Software/systemd/'></ulink>. | ||
2408 | </para> | ||
2409 | <para>To enable a service using systemd, your recipe | ||
2410 | needs to inherit the | ||
2411 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-systemd'><filename>systemd</filename></ulink> | ||
2412 | class. | ||
2413 | See the <filename>systemd.class</filename> file | ||
2414 | located in your | ||
2415 | <link linkend='source-directory'>Source Directory</link>. | ||
2416 | section for more information. | ||
2417 | </para></listitem> | ||
2418 | </itemizedlist> | ||
2419 | </para> | ||
2420 | </section> | ||
2421 | |||
2422 | <section id='new-recipe-packaging'> | ||
2423 | <title>Packaging</title> | ||
2424 | |||
2425 | <para> | ||
2426 | Successful packaging is a combination of automated processes | ||
2427 | performed by the OpenEmbedded build system and some | ||
2428 | specific steps you need to take. | ||
2429 | The following list describes the process: | ||
2430 | <itemizedlist> | ||
2431 | <listitem><para><emphasis>Splitting Files</emphasis>: | ||
2432 | The <filename>do_package</filename> task splits the | ||
2433 | files produced by the recipe into logical components. | ||
2434 | Even software that produces a single binary might | ||
2435 | still have debug symbols, documentation, and other | ||
2436 | logical components that should be split out. | ||
2437 | The <filename>do_package</filename> task ensures | ||
2438 | that files are split up and packaged correctly. | ||
2439 | </para></listitem> | ||
2440 | <listitem><para><emphasis>Running QA Checks</emphasis>: | ||
2441 | The <filename>insane</filename> class adds a step to | ||
2442 | the package generation process so that output quality | ||
2443 | assurance checks are generated by the OpenEmbedded | ||
2444 | build system. | ||
2445 | This step performs a range of checks to be sure the | ||
2446 | build's output is free of common problems that show | ||
2447 | up during runtime. | ||
2448 | For information on these checks, see the | ||
2449 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-insane'><filename>insane</filename></ulink> | ||
2450 | class and the | ||
2451 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-qa-checks'>QA Error and Warning Messages</ulink>" | ||
2452 | chapter in the Yocto Project Reference Manual. | ||
2453 | </para></listitem> | ||
2454 | <listitem><para><emphasis>Hand-Checking Your Packages</emphasis>: | ||
2455 | After you build your software, you need to be sure | ||
2456 | your packages are correct. | ||
2457 | Examine the | ||
2458 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}/packages-split</filename> | ||
2459 | directory and make sure files are where you expect | ||
2460 | them to be. | ||
2461 | If you discover problems, you can set | ||
2462 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'><filename>PACKAGES</filename></ulink>, | ||
2463 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink>, | ||
2464 | <filename>do_install(_append)</filename>, and so forth as | ||
2465 | needed. | ||
2466 | </para></listitem> | ||
2467 | <listitem><para><emphasis>Splitting an Application into Multiple Packages</emphasis>: | ||
2468 | If you need to split an application into several | ||
2469 | packages, see the | ||
2470 | "<link linkend='splitting-an-application-into-multiple-packages'>Splitting an Application into Multiple Packages</link>" | ||
2471 | section for an example. | ||
2472 | </para></listitem> | ||
2473 | <listitem><para><emphasis>Installing a Post-Installation Script</emphasis>: | ||
2474 | For an example showing how to install a | ||
2475 | post-installation script, see the | ||
2476 | "<link linkend='new-recipe-post-installation-scripts'>Post-Installation Scripts</link>" | ||
2477 | section. | ||
2478 | </para></listitem> | ||
2479 | <listitem><para><emphasis>Marking Package Architecture</emphasis>: | ||
2480 | Depending on what your recipe is building and how it | ||
2481 | is configured, it might be important to mark the | ||
2482 | packages produced as being specific to a particular | ||
2483 | machine, or to mark them as not being specific to | ||
2484 | a particular machine or architecture at all. | ||
2485 | By default, packages produced for the target are | ||
2486 | marked as being specific to the architecture of the | ||
2487 | target machine because that is usually the desired | ||
2488 | result. | ||
2489 | However, if the recipe configures the software to be | ||
2490 | built specific to the target machine (e.g. the | ||
2491 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> | ||
2492 | value is passed into the configure script or a patch | ||
2493 | is applied only for a particular machine), then you | ||
2494 | should mark the packages produced as being | ||
2495 | machine-specific by adding the following to the | ||
2496 | recipe: | ||
2497 | <literallayout class='monospaced'> | ||
2498 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
2499 | </literallayout> | ||
2500 | On the other hand, if the recipe produces packages | ||
2501 | that do not contain anything specific to the target | ||
2502 | machine or architecture at all (e.g. recipes | ||
2503 | that simply package script files or configuration | ||
2504 | files), you should use the | ||
2505 | <ulink url='&YOCTO_DOCS_REF_URL;#allarch'><filename>allarch</filename></ulink> | ||
2506 | class to do this for you by adding this to your | ||
2507 | recipe: | ||
2508 | <literallayout class='monospaced'> | ||
2509 | inherit allarch | ||
2510 | </literallayout> | ||
2511 | Ensuring that the package architecture is correct is | ||
2512 | not critical while you are doing the first few builds | ||
2513 | of your recipe. | ||
2514 | However, it is important in order to | ||
2515 | to ensure that your recipe rebuilds (or does not | ||
2516 | rebuild) appropriately in response to changes in | ||
2517 | configuration, and to ensure that you get the | ||
2518 | appropriate packages installed on the target machine, | ||
2519 | particularly if you run separate builds for more | ||
2520 | than one target machine. | ||
2521 | </para></listitem> | ||
2522 | </itemizedlist> | ||
2523 | </para> | ||
2524 | </section> | ||
2525 | |||
2526 | <section id='properly-versioning-pre-release-recipes'> | ||
2527 | <title>Properly Versioning Pre-Release Recipes</title> | ||
2528 | |||
2529 | <para> | ||
2530 | Sometimes the name of a recipe can lead to versioning | ||
2531 | problems when the recipe is upgraded to a final release. | ||
2532 | For example, consider the | ||
2533 | <filename>irssi_0.8.16-rc1.bb</filename> recipe file in | ||
2534 | the list of example recipes in the | ||
2535 | "<link linkend='new-recipe-storing-and-naming-the-recipe'>Storing and Naming the Recipe</link>" | ||
2536 | section. | ||
2537 | This recipe is at a release candidate stage (i.e. | ||
2538 | "rc1"). | ||
2539 | When the recipe is released, the recipe filename becomes | ||
2540 | <filename>irssi_0.8.16.bb</filename>. | ||
2541 | The version change from <filename>0.8.16-rc1</filename> | ||
2542 | to <filename>0.8.16</filename> is seen as a decrease by the | ||
2543 | build system and package managers, so the resulting packages | ||
2544 | will not correctly trigger an upgrade. | ||
2545 | </para> | ||
2546 | |||
2547 | <para> | ||
2548 | In order to ensure the versions compare properly, the | ||
2549 | recommended convention is to set | ||
2550 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink> | ||
2551 | within the recipe to | ||
2552 | "<previous version>+<current version>". | ||
2553 | You can use an additional variable so that you can use the | ||
2554 | current version elsewhere. | ||
2555 | Here is an example: | ||
2556 | <literallayout class='monospaced'> | ||
2557 | REALPV = "0.8.16-rc1" | ||
2558 | PV = "0.8.15+${REALPV}" | ||
2559 | </literallayout> | ||
2560 | </para> | ||
2561 | </section> | ||
2562 | |||
2563 | <section id='new-recipe-post-installation-scripts'> | ||
2564 | <title>Post-Installation Scripts</title> | ||
2565 | |||
2566 | <para> | ||
2567 | Post-installation scripts run immediately after installing | ||
2568 | a package on the target, or during image creation when a | ||
2569 | package is included in an image. | ||
2570 | To add a post-installation script to a package, add a | ||
2571 | <filename>pkg_postinst_PACKAGENAME()</filename> function to | ||
2572 | the recipe file (<filename>.bb</filename>) and replace | ||
2573 | <filename>PACKAGENAME</filename> with the name of the package | ||
2574 | you want to attach to the <filename>postinst</filename> | ||
2575 | script. | ||
2576 | To apply the post-installation script to the main package | ||
2577 | for the recipe, which is usually what is required, specify | ||
2578 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename> | ||
2579 | in place of <filename>PACKAGENAME</filename>. | ||
2580 | </para> | ||
2581 | |||
2582 | <para> | ||
2583 | A post-installation function has the following structure: | ||
2584 | <literallayout class='monospaced'> | ||
2585 | pkg_postinst_PACKAGENAME () { | ||
2586 | #!/bin/sh -e | ||
2587 | # Commands to carry out | ||
2588 | } | ||
2589 | </literallayout> | ||
2590 | </para> | ||
2591 | |||
2592 | <para> | ||
2593 | The script defined in the post-installation function is | ||
2594 | called when the root filesystem is created. | ||
2595 | If the script succeeds, the package is marked as installed. | ||
2596 | If the script fails, the package is marked as unpacked and | ||
2597 | the script is executed when the image boots again. | ||
2598 | </para> | ||
2599 | |||
2600 | <para> | ||
2601 | Sometimes it is necessary for the execution of a | ||
2602 | post-installation script to be delayed until the first boot. | ||
2603 | For example, the script might need to be executed on the | ||
2604 | device itself. | ||
2605 | To delay script execution until boot time, use the following | ||
2606 | structure in the post-installation script: | ||
2607 | <literallayout class='monospaced'> | ||
2608 | pkg_postinst_PACKAGENAME () { | ||
2609 | #!/bin/sh -e | ||
2610 | if [ x"$D" = "x" ]; then | ||
2611 | # Actions to carry out on the device go here | ||
2612 | else | ||
2613 | exit 1 | ||
2614 | fi | ||
2615 | } | ||
2616 | </literallayout> | ||
2617 | </para> | ||
2618 | |||
2619 | <para> | ||
2620 | The previous example delays execution until the image boots | ||
2621 | again because the environment variable <filename>D</filename> | ||
2622 | points to the directory containing the image when | ||
2623 | the root filesystem is created at build time but is unset | ||
2624 | when executed on the first boot. | ||
2625 | </para> | ||
2626 | |||
2627 | <note> | ||
2628 | Equivalent support for pre-install, pre-uninstall, and | ||
2629 | post-uninstall scripts exist by way of | ||
2630 | <filename>pkg_preinst</filename>, | ||
2631 | <filename>pkg_prerm</filename>, and | ||
2632 | <filename>pkg_postrm</filename>, respectively. | ||
2633 | These scrips work in exactly the same way as does | ||
2634 | <filename>pkg_postinst</filename> with the exception that they | ||
2635 | run at different times. | ||
2636 | Also, because of when they run, they are not applicable to | ||
2637 | being run at image creation time like | ||
2638 | <filename>pkg_postinst</filename>. | ||
2639 | </note> | ||
2640 | </section> | ||
2641 | |||
2642 | <section id='new-recipe-testing'> | ||
2643 | <title>Testing</title> | ||
2644 | |||
2645 | <para> | ||
2646 | The final step for completing your recipe is to be sure that | ||
2647 | the software you built runs correctly. | ||
2648 | To accomplish runtime testing, add the build's output | ||
2649 | packages to your image and test them on the target. | ||
2650 | </para> | ||
2651 | |||
2652 | <para> | ||
2653 | For information on how to customize your image by adding | ||
2654 | specific packages, see the | ||
2655 | "<link linkend='usingpoky-extend-customimage'>Customizing Images</link>" | ||
2656 | section. | ||
2657 | </para> | ||
2658 | </section> | ||
2659 | |||
2660 | <section id='new-recipe-testing-examples'> | ||
2661 | <title>Examples</title> | ||
2662 | |||
2663 | <para> | ||
2664 | To help summarize how to write a recipe, this section provides | ||
2665 | some examples given various scenarios: | ||
2666 | <itemizedlist> | ||
2667 | <listitem><para>Recipes that use local files</para></listitem> | ||
2668 | <listitem><para>Using an Autotooled package</para></listitem> | ||
2669 | <listitem><para>Using a Makefile-based package</para></listitem> | ||
2670 | <listitem><para>Splitting an application into multiple packages</para></listitem> | ||
2671 | </itemizedlist> | ||
2672 | </para> | ||
2673 | |||
2674 | <section id='new-recipe-single-c-file-package-hello-world'> | ||
2675 | <title>Single .c File Package (Hello World!)</title> | ||
2676 | |||
2677 | <para> | ||
2678 | Building an application from a single file that is stored | ||
2679 | locally (e.g. under <filename>files/</filename>) requires | ||
2680 | a recipe that has the file listed in the | ||
2681 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename> | ||
2682 | variable. | ||
2683 | Additionally, you need to manually write the | ||
2684 | <filename>do_compile</filename> and | ||
2685 | <filename>do_install</filename> tasks. | ||
2686 | The <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'>S</ulink></filename> | ||
2687 | variable defines the directory containing the source code, | ||
2688 | which is set to | ||
2689 | <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink> | ||
2690 | in this case - the directory BitBake uses for the build. | ||
2691 | <literallayout class='monospaced'> | ||
2692 | SUMMARY = "Simple helloworld application" | ||
2693 | SECTION = "examples" | ||
2694 | LICENSE = "MIT" | ||
2695 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
2696 | |||
2697 | SRC_URI = "file://helloworld.c" | ||
2698 | |||
2699 | S = "${WORKDIR}" | ||
2700 | |||
2701 | do_compile() { | ||
2702 | ${CC} helloworld.c -o helloworld | ||
2703 | } | ||
2704 | |||
2705 | do_install() { | ||
2706 | install -d ${D}${bindir} | ||
2707 | install -m 0755 helloworld ${D}${bindir} | ||
2708 | } | ||
2709 | </literallayout> | ||
2710 | </para> | ||
2711 | |||
2712 | <para> | ||
2713 | By default, the <filename>helloworld</filename>, | ||
2714 | <filename>helloworld-dbg</filename>, and | ||
2715 | <filename>helloworld-dev</filename> packages are built. | ||
2716 | For information on how to customize the packaging process, | ||
2717 | see the | ||
2718 | "<link linkend='splitting-an-application-into-multiple-packages'>Splitting an Application into Multiple Packages</link>" | ||
2719 | section. | ||
2720 | </para> | ||
2721 | </section> | ||
2722 | |||
2723 | <section id='new-recipe-autotooled-package'> | ||
2724 | <title>Autotooled Package</title> | ||
2725 | <para> | ||
2726 | Applications that use Autotools such as <filename>autoconf</filename> and | ||
2727 | <filename>automake</filename> require a recipe that has a source archive listed in | ||
2728 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename> and | ||
2729 | also inherit the | ||
2730 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-autotools'><filename>autotools</filename></ulink> | ||
2731 | class, which contains the definitions of all the steps | ||
2732 | needed to build an Autotool-based application. | ||
2733 | The result of the build is automatically packaged. | ||
2734 | And, if the application uses NLS for localization, packages with local information are | ||
2735 | generated (one package per language). | ||
2736 | Following is one example: (<filename>hello_2.3.bb</filename>) | ||
2737 | <literallayout class='monospaced'> | ||
2738 | SUMMARY = "GNU Helloworld application" | ||
2739 | SECTION = "examples" | ||
2740 | LICENSE = "GPLv2+" | ||
2741 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | ||
2742 | |||
2743 | SRC_URI = "${GNU_MIRROR}/hello/hello-${PV}.tar.gz" | ||
2744 | |||
2745 | inherit autotools gettext | ||
2746 | </literallayout> | ||
2747 | </para> | ||
2748 | |||
2749 | <para> | ||
2750 | The variable | ||
2751 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LIC_FILES_CHKSUM'>LIC_FILES_CHKSUM</ulink></filename> | ||
2752 | is used to track source license changes as described in the | ||
2753 | "<ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-configuring-LIC_FILES_CHKSUM'>Tracking License Changes</ulink>" section. | ||
2754 | You can quickly create Autotool-based recipes in a manner similar to the previous example. | ||
2755 | </para> | ||
2756 | </section> | ||
2757 | |||
2758 | <section id='new-recipe-makefile-based-package'> | ||
2759 | <title>Makefile-Based Package</title> | ||
2760 | |||
2761 | <para> | ||
2762 | Applications that use GNU <filename>make</filename> also require a recipe that has | ||
2763 | the source archive listed in | ||
2764 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename>. | ||
2765 | You do not need to add a <filename>do_compile</filename> step since by default BitBake | ||
2766 | starts the <filename>make</filename> command to compile the application. | ||
2767 | If you need additional <filename>make</filename> options, you should store them in the | ||
2768 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OEMAKE'>EXTRA_OEMAKE</ulink></filename> | ||
2769 | variable. | ||
2770 | BitBake passes these options into the <filename>make</filename> GNU invocation. | ||
2771 | Note that a <filename>do_install</filename> task is still required. | ||
2772 | Otherwise, BitBake runs an empty <filename>do_install</filename> task by default. | ||
2773 | </para> | ||
2774 | |||
2775 | <para> | ||
2776 | Some applications might require extra parameters to be passed to the compiler. | ||
2777 | For example, the application might need an additional header path. | ||
2778 | You can accomplish this by adding to the | ||
2779 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-CFLAGS'>CFLAGS</ulink></filename> variable. | ||
2780 | The following example shows this: | ||
2781 | <literallayout class='monospaced'> | ||
2782 | CFLAGS_prepend = "-I ${S}/include " | ||
2783 | </literallayout> | ||
2784 | </para> | ||
2785 | |||
2786 | <para> | ||
2787 | In the following example, <filename>mtd-utils</filename> is a makefile-based package: | ||
2788 | <literallayout class='monospaced'> | ||
2789 | SUMMARY = "Tools for managing memory technology devices." | ||
2790 | SECTION = "base" | ||
2791 | DEPENDS = "zlib lzo e2fsprogs util-linux" | ||
2792 | HOMEPAGE = "http://www.linux-mtd.infradead.org/" | ||
2793 | LICENSE = "GPLv2+" | ||
2794 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ | ||
2795 | file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c" | ||
2796 | |||
2797 | SRC_URI = "git://git.infradead.org/mtd-utils.git;protocol=git;tag=995cfe51b0a3cf32f381c140bf72b21bf91cef1b \ | ||
2798 | file://add-exclusion-to-mkfs-jffs2-git-2.patch" | ||
2799 | |||
2800 | S = "${WORKDIR}/git/" | ||
2801 | |||
2802 | PR = "r1" | ||
2803 | |||
2804 | EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' \ | ||
2805 | 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'BUILDDIR=${S}'" | ||
2806 | |||
2807 | do_install () { | ||
2808 | oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} \ | ||
2809 | INCLUDEDIR=${includedir} | ||
2810 | install -d ${D}${includedir}/mtd/ | ||
2811 | for f in ${S}/include/mtd/*.h; do | ||
2812 | install -m 0644 $f ${D}${includedir}/mtd/ | ||
2813 | done | ||
2814 | } | ||
2815 | |||
2816 | PARALLEL_MAKE = "" | ||
2817 | |||
2818 | BBCLASSEXTEND = "native" | ||
2819 | </literallayout> | ||
2820 | </para> | ||
2821 | </section> | ||
2822 | |||
2823 | <section id='splitting-an-application-into-multiple-packages'> | ||
2824 | <title>Splitting an Application into Multiple Packages</title> | ||
2825 | |||
2826 | <para> | ||
2827 | You can use the variables | ||
2828 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'>PACKAGES</ulink></filename> and | ||
2829 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'>FILES</ulink></filename> | ||
2830 | to split an application into multiple packages. | ||
2831 | </para> | ||
2832 | |||
2833 | <para> | ||
2834 | Following is an example that uses the <filename>libxpm</filename> recipe. | ||
2835 | By default, this recipe generates a single package that contains the library along | ||
2836 | with a few binaries. | ||
2837 | You can modify the recipe to split the binaries into separate packages: | ||
2838 | <literallayout class='monospaced'> | ||
2839 | require xorg-lib-common.inc | ||
2840 | |||
2841 | SUMMARY = "X11 Pixmap library" | ||
2842 | LICENSE = "X-BSD" | ||
2843 | LIC_FILES_CHKSUM = "file://COPYING;md5=3e07763d16963c3af12db271a31abaa5" | ||
2844 | DEPENDS += "libxext libsm libxt" | ||
2845 | PR = "r3" | ||
2846 | PE = "1" | ||
2847 | |||
2848 | XORG_PN = "libXpm" | ||
2849 | |||
2850 | PACKAGES =+ "sxpm cxpm" | ||
2851 | FILES_cxpm = "${bindir}/cxpm" | ||
2852 | FILES_sxpm = "${bindir}/sxpm" | ||
2853 | </literallayout> | ||
2854 | </para> | ||
2855 | |||
2856 | <para> | ||
2857 | In the previous example, we want to ship the <filename>sxpm</filename> | ||
2858 | and <filename>cxpm</filename> binaries in separate packages. | ||
2859 | Since <filename>bindir</filename> would be packaged into the main | ||
2860 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'>PN</ulink></filename> | ||
2861 | package by default, we prepend the <filename>PACKAGES</filename> | ||
2862 | variable so additional package names are added to the start of list. | ||
2863 | This results in the extra <filename>FILES_*</filename> | ||
2864 | variables then containing information that define which files and | ||
2865 | directories go into which packages. | ||
2866 | Files included by earlier packages are skipped by latter packages. | ||
2867 | Thus, the main <filename>PN</filename> package | ||
2868 | does not include the above listed files. | ||
2869 | </para> | ||
2870 | </section> | ||
2871 | </section> | ||
2872 | </section> | ||
2873 | |||
2874 | <section id="platdev-newmachine"> | ||
2875 | <title>Adding a New Machine</title> | ||
2876 | |||
2877 | <para> | ||
2878 | Adding a new machine to the Yocto Project is a straight forward | ||
2879 | process. | ||
2880 | This section describes how to add machines that are similar | ||
2881 | to those that the Yocto Project already supports. | ||
2882 | <note> | ||
2883 | Although well within the capabilities of the Yocto Project, | ||
2884 | adding a totally new architecture might require | ||
2885 | changes to <filename>gcc/eglibc</filename> and to the site | ||
2886 | information, which is beyond the scope of this manual. | ||
2887 | </note> | ||
2888 | </para> | ||
2889 | |||
2890 | <para> | ||
2891 | For a complete example that shows how to add a new machine, | ||
2892 | see the | ||
2893 | "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>" | ||
2894 | section in the Yocto Project Board Support Package (BSP) Developer's Guide. | ||
2895 | </para> | ||
2896 | |||
2897 | <section id="platdev-newmachine-conffile"> | ||
2898 | <title>Adding the Machine Configuration File</title> | ||
2899 | |||
2900 | <para> | ||
2901 | To add a new machine, you need to add a new machine | ||
2902 | configuration file to the layer's | ||
2903 | <filename>conf/machine</filename> directory. | ||
2904 | This configuration file provides details about the device | ||
2905 | you are adding. | ||
2906 | </para> | ||
2907 | |||
2908 | <para> | ||
2909 | The OpenEmbedded build system uses the root name of the | ||
2910 | machine configuration file to reference the new machine. | ||
2911 | For example, given a machine configuration file named | ||
2912 | <filename>crownbay.conf</filename>, the build system | ||
2913 | recognizes the machine as "crownbay". | ||
2914 | </para> | ||
2915 | |||
2916 | <para> | ||
2917 | The most important variables you must set in your machine | ||
2918 | configuration file are as follows: | ||
2919 | <itemizedlist> | ||
2920 | <listitem><para><filename><ulink url='&YOCTO_DOCS_REF_URL;#var-TARGET_ARCH'>TARGET_ARCH</ulink></filename> | ||
2921 | (e.g. "arm")</para></listitem> | ||
2922 | <listitem><para><filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'>PREFERRED_PROVIDER</ulink>_virtual/kernel</filename> | ||
2923 | (see below)</para></listitem> | ||
2924 | <listitem><para><filename><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_FEATURES'>MACHINE_FEATURES</ulink></filename> | ||
2925 | (e.g. "apm screen wifi")</para></listitem> | ||
2926 | </itemizedlist> | ||
2927 | </para> | ||
2928 | |||
2929 | <para> | ||
2930 | You might also need these variables: | ||
2931 | <itemizedlist> | ||
2932 | <listitem><para><filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SERIAL_CONSOLES'>SERIAL_CONSOLES</ulink></filename> | ||
2933 | (e.g. "115200;ttyS0 115200;ttyS1")</para></listitem> | ||
2934 | <listitem><para><filename><ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_IMAGETYPE'>KERNEL_IMAGETYPE</ulink></filename> | ||
2935 | (e.g. "zImage")</para></listitem> | ||
2936 | <listitem><para><filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FSTYPES'>IMAGE_FSTYPES</ulink></filename> | ||
2937 | (e.g. "tar.gz jffs2")</para></listitem> | ||
2938 | </itemizedlist> | ||
2939 | </para> | ||
2940 | |||
2941 | <para> | ||
2942 | You can find full details on these variables in the reference | ||
2943 | section. | ||
2944 | You can leverage existing machine <filename>.conf</filename> | ||
2945 | files from <filename>meta-yocto-bsp/conf/machine/</filename>. | ||
2946 | </para> | ||
2947 | </section> | ||
2948 | |||
2949 | <section id="platdev-newmachine-kernel"> | ||
2950 | <title>Adding a Kernel for the Machine</title> | ||
2951 | |||
2952 | <para> | ||
2953 | The OpenEmbedded build system needs to be able to build a kernel | ||
2954 | for the machine. | ||
2955 | You need to either create a new kernel recipe for this machine, | ||
2956 | or extend an existing kernel recipe. | ||
2957 | You can find several kernel recipe examples in the | ||
2958 | Source Directory at | ||
2959 | <filename>meta/recipes-kernel/linux</filename> | ||
2960 | that you can use as references. | ||
2961 | </para> | ||
2962 | |||
2963 | <para> | ||
2964 | If you are creating a new kernel recipe, normal recipe-writing | ||
2965 | rules apply for setting up a | ||
2966 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename>. | ||
2967 | Thus, you need to specify any necessary patches and set | ||
2968 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'>S</ulink></filename> | ||
2969 | to point at the source code. | ||
2970 | You need to create a <filename>do_configure</filename> task that | ||
2971 | configures the unpacked kernel with a | ||
2972 | <filename>defconfig</filename> file. | ||
2973 | You can do this by using a <filename>make defconfig</filename> | ||
2974 | command or, more commonly, by copying in a suitable | ||
2975 | <filename>defconfig</filename> file and then running | ||
2976 | <filename>make oldconfig</filename>. | ||
2977 | By making use of <filename>inherit kernel</filename> and | ||
2978 | potentially some of the <filename>linux-*.inc</filename> files, | ||
2979 | most other functionality is centralized and the defaults of the | ||
2980 | class normally work well. | ||
2981 | </para> | ||
2982 | |||
2983 | <para> | ||
2984 | If you are extending an existing kernel recipe, it is usually | ||
2985 | a matter of adding a suitable <filename>defconfig</filename> | ||
2986 | file. | ||
2987 | The file needs to be added into a location similar to | ||
2988 | <filename>defconfig</filename> files used for other machines | ||
2989 | in a given kernel recipe. | ||
2990 | A possible way to do this is by listing the file in the | ||
2991 | <filename>SRC_URI</filename> and adding the machine to the | ||
2992 | expression in | ||
2993 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE'>COMPATIBLE_MACHINE</ulink></filename>: | ||
2994 | <literallayout class='monospaced'> | ||
2995 | COMPATIBLE_MACHINE = '(qemux86|qemumips)' | ||
2996 | </literallayout> | ||
2997 | </para> | ||
2998 | </section> | ||
2999 | |||
3000 | <section id="platdev-newmachine-formfactor"> | ||
3001 | <title>Adding a Formfactor Configuration File</title> | ||
3002 | |||
3003 | <para> | ||
3004 | A formfactor configuration file provides information about the | ||
3005 | target hardware for which the image is being built and information that | ||
3006 | the build system cannot obtain from other sources such as the kernel. | ||
3007 | Some examples of information contained in a formfactor configuration file include | ||
3008 | framebuffer orientation, whether or not the system has a keyboard, | ||
3009 | the positioning of the keyboard in relation to the screen, and | ||
3010 | the screen resolution. | ||
3011 | </para> | ||
3012 | |||
3013 | <para> | ||
3014 | The build system uses reasonable defaults in most cases. | ||
3015 | However, if customization is | ||
3016 | necessary, you need to create a <filename>machconfig</filename> file | ||
3017 | in the <filename>meta/recipes-bsp/formfactor/files</filename> | ||
3018 | directory. | ||
3019 | This directory contains directories for specific machines such as | ||
3020 | <filename>qemuarm</filename> and <filename>qemux86</filename>. | ||
3021 | For information about the settings available and the defaults, see the | ||
3022 | <filename>meta/recipes-bsp/formfactor/files/config</filename> file found in the | ||
3023 | same area. | ||
3024 | </para> | ||
3025 | |||
3026 | <para> | ||
3027 | Following is an example for "qemuarm" machine: | ||
3028 | <literallayout class='monospaced'> | ||
3029 | HAVE_TOUCHSCREEN=1 | ||
3030 | HAVE_KEYBOARD=1 | ||
3031 | |||
3032 | DISPLAY_CAN_ROTATE=0 | ||
3033 | DISPLAY_ORIENTATION=0 | ||
3034 | #DISPLAY_WIDTH_PIXELS=640 | ||
3035 | #DISPLAY_HEIGHT_PIXELS=480 | ||
3036 | #DISPLAY_BPP=16 | ||
3037 | DISPLAY_DPI=150 | ||
3038 | DISPLAY_SUBPIXEL_ORDER=vrgb | ||
3039 | </literallayout> | ||
3040 | </para> | ||
3041 | </section> | ||
3042 | </section> | ||
3043 | |||
3044 | <section id="platdev-working-with-libraries"> | ||
3045 | <title>Working With Libraries</title> | ||
3046 | |||
3047 | <para> | ||
3048 | Libraries are an integral part of your system. | ||
3049 | This section describes some common practices you might find | ||
3050 | helpful when working with libraries to build your system: | ||
3051 | <itemizedlist> | ||
3052 | <listitem><para><link linkend='including-static-library-files'>How to include static library files</link> | ||
3053 | </para></listitem> | ||
3054 | <listitem><para><link linkend='combining-multiple-versions-library-files-into-one-image'>How to use the Multilib feature to combine multiple versions of library files into a single image</link> | ||
3055 | </para></listitem> | ||
3056 | <listitem><para><link linkend='installing-multiple-versions-of-the-same-library'>How to install multiple versions of the same library in parallel on the same system</link> | ||
3057 | </para></listitem> | ||
3058 | </itemizedlist> | ||
3059 | </para> | ||
3060 | |||
3061 | <section id='including-static-library-files'> | ||
3062 | <title>Including Static Library Files</title> | ||
3063 | |||
3064 | <para> | ||
3065 | If you are building a library and the library offers static linking, you can control | ||
3066 | which static library files (<filename>*.a</filename> files) get included in the | ||
3067 | built library. | ||
3068 | </para> | ||
3069 | |||
3070 | <para> | ||
3071 | The <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'><filename>PACKAGES</filename></ulink> | ||
3072 | and <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES_*</filename></ulink> | ||
3073 | variables in the | ||
3074 | <filename>meta/conf/bitbake.conf</filename> configuration file define how files installed | ||
3075 | by the <filename>do_install</filename> task are packaged. | ||
3076 | By default, the <filename>PACKAGES</filename> variable contains | ||
3077 | <filename>${PN}-staticdev</filename>, which includes all static library files. | ||
3078 | <note> | ||
3079 | Some previously released versions of the Yocto Project | ||
3080 | defined the static library files through | ||
3081 | <filename>${PN}-dev</filename>. | ||
3082 | </note> | ||
3083 | Following, is part of the BitBake configuration file. | ||
3084 | You can see where the static library files are defined: | ||
3085 | <literallayout class='monospaced'> | ||
3086 | PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-dev ${PN}-staticdev ${PN}-locale" | ||
3087 | PACKAGES_DYNAMIC = "${PN}-locale-*" | ||
3088 | FILES = "" | ||
3089 | |||
3090 | FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*${SOLIBS} \ | ||
3091 | ${sysconfdir} ${sharedstatedir} ${localstatedir} \ | ||
3092 | ${base_bindir}/* ${base_sbindir}/* \ | ||
3093 | ${base_libdir}/*${SOLIBS} \ | ||
3094 | ${datadir}/${BPN} ${libdir}/${BPN}/* \ | ||
3095 | ${datadir}/pixmaps ${datadir}/applications \ | ||
3096 | ${datadir}/idl ${datadir}/omf ${datadir}/sounds \ | ||
3097 | ${libdir}/bonobo/servers" | ||
3098 | |||
3099 | FILES_${PN}-doc = "${docdir} ${mandir} ${infodir} ${datadir}/gtk-doc \ | ||
3100 | ${datadir}/gnome/help" | ||
3101 | SECTION_${PN}-doc = "doc" | ||
3102 | |||
3103 | FILES_${PN}-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la \ | ||
3104 | ${libdir}/*.o ${libdir}/pkgconfig ${datadir}/pkgconfig \ | ||
3105 | ${datadir}/aclocal ${base_libdir}/*.o" | ||
3106 | SECTION_${PN}-dev = "devel" | ||
3107 | ALLOW_EMPTY_${PN}-dev = "1" | ||
3108 | RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})" | ||
3109 | |||
3110 | FILES_${PN}-staticdev = "${libdir}/*.a ${base_libdir}/*.a" | ||
3111 | SECTION_${PN}-staticdev = "devel" | ||
3112 | RDEPENDS_${PN}-staticdev = "${PN}-dev (= ${EXTENDPKGV})" | ||
3113 | </literallayout> | ||
3114 | </para> | ||
3115 | </section> | ||
3116 | |||
3117 | <section id="combining-multiple-versions-library-files-into-one-image"> | ||
3118 | <title>Combining Multiple Versions of Library Files into One Image</title> | ||
3119 | |||
3120 | <para> | ||
3121 | The build system offers the ability to build libraries with different | ||
3122 | target optimizations or architecture formats and combine these together | ||
3123 | into one system image. | ||
3124 | You can link different binaries in the image | ||
3125 | against the different libraries as needed for specific use cases. | ||
3126 | This feature is called "Multilib." | ||
3127 | </para> | ||
3128 | |||
3129 | <para> | ||
3130 | An example would be where you have most of a system compiled in 32-bit | ||
3131 | mode using 32-bit libraries, but you have something large, like a database | ||
3132 | engine, that needs to be a 64-bit application and uses 64-bit libraries. | ||
3133 | Multilib allows you to get the best of both 32-bit and 64-bit libraries. | ||
3134 | </para> | ||
3135 | |||
3136 | <para> | ||
3137 | While the Multilib feature is most commonly used for 32 and 64-bit differences, | ||
3138 | the approach the build system uses facilitates different target optimizations. | ||
3139 | You could compile some binaries to use one set of libraries and other binaries | ||
3140 | to use other different sets of libraries. | ||
3141 | The libraries could differ in architecture, compiler options, or other | ||
3142 | optimizations. | ||
3143 | </para> | ||
3144 | |||
3145 | <para> | ||
3146 | This section overviews the Multilib process only. | ||
3147 | For more details on how to implement Multilib, see the | ||
3148 | <ulink url='&YOCTO_WIKI_URL;/wiki/Multilib'>Multilib</ulink> wiki | ||
3149 | page. | ||
3150 | </para> | ||
3151 | |||
3152 | <para> | ||
3153 | Aside from this wiki page, several examples exist in the | ||
3154 | <filename>meta-skeleton</filename> layer found in the | ||
3155 | <link linkend='source-directory'>Source Directory</link>: | ||
3156 | <itemizedlist> | ||
3157 | <listitem><para><filename>conf/multilib-example.conf</filename> | ||
3158 | configuration file</para></listitem> | ||
3159 | <listitem><para><filename>conf/multilib-example2.conf</filename> | ||
3160 | configuration file</para></listitem> | ||
3161 | <listitem><para><filename>recipes-multilib/images/core-image-multilib-example.bb</filename> | ||
3162 | recipe</para></listitem> | ||
3163 | </itemizedlist> | ||
3164 | </para> | ||
3165 | |||
3166 | <section id='preparing-to-use-multilib'> | ||
3167 | <title>Preparing to Use Multilib</title> | ||
3168 | |||
3169 | <para> | ||
3170 | User-specific requirements drive the Multilib feature. | ||
3171 | Consequently, there is no one "out-of-the-box" configuration that likely | ||
3172 | exists to meet your needs. | ||
3173 | </para> | ||
3174 | |||
3175 | <para> | ||
3176 | In order to enable Multilib, you first need to ensure your recipe is | ||
3177 | extended to support multiple libraries. | ||
3178 | Many standard recipes are already extended and support multiple libraries. | ||
3179 | You can check in the <filename>meta/conf/multilib.conf</filename> | ||
3180 | configuration file in the | ||
3181 | <link linkend='source-directory'>Source Directory</link> to see how this is | ||
3182 | done using the | ||
3183 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BBCLASSEXTEND'><filename>BBCLASSEXTEND</filename></ulink> | ||
3184 | variable. | ||
3185 | Eventually, all recipes will be covered and this list will | ||
3186 | not be needed. | ||
3187 | </para> | ||
3188 | |||
3189 | <para> | ||
3190 | For the most part, the Multilib class extension works automatically to | ||
3191 | extend the package name from <filename>${PN}</filename> to | ||
3192 | <filename>${MLPREFIX}${PN}</filename>, where <filename>MLPREFIX</filename> | ||
3193 | is the particular multilib (e.g. "lib32-" or "lib64-"). | ||
3194 | Standard variables such as | ||
3195 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>, | ||
3196 | <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>, | ||
3197 | <ulink url='&YOCTO_DOCS_REF_URL;#var-RPROVIDES'><filename>RPROVIDES</filename></ulink>, | ||
3198 | <ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'><filename>RRECOMMENDS</filename></ulink>, | ||
3199 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'><filename>PACKAGES</filename></ulink>, | ||
3200 | and <filename>PACKAGES_DYNAMIC</filename> are automatically extended by the system. | ||
3201 | If you are extending any manual code in the recipe, you can use the | ||
3202 | <filename>${MLPREFIX}</filename> variable to ensure those names are extended | ||
3203 | correctly. | ||
3204 | This automatic extension code resides in <filename>multilib.bbclass</filename>. | ||
3205 | </para> | ||
3206 | </section> | ||
3207 | |||
3208 | <section id='using-multilib'> | ||
3209 | <title>Using Multilib</title> | ||
3210 | |||
3211 | <para> | ||
3212 | After you have set up the recipes, you need to define the actual | ||
3213 | combination of multiple libraries you want to build. | ||
3214 | You accomplish this through your <filename>local.conf</filename> | ||
3215 | configuration file in the | ||
3216 | <link linkend='build-directory'>Build Directory</link>. | ||
3217 | An example configuration would be as follows: | ||
3218 | <literallayout class='monospaced'> | ||
3219 | MACHINE = "qemux86-64" | ||
3220 | require conf/multilib.conf | ||
3221 | MULTILIBS = "multilib:lib32" | ||
3222 | DEFAULTTUNE_virtclass-multilib-lib32 = "x86" | ||
3223 | IMAGE_INSTALL = "lib32-connman" | ||
3224 | </literallayout> | ||
3225 | This example enables an | ||
3226 | additional library named <filename>lib32</filename> alongside the | ||
3227 | normal target packages. | ||
3228 | When combining these "lib32" alternatives, the example uses "x86" for tuning. | ||
3229 | For information on this particular tuning, see | ||
3230 | <filename>meta/conf/machine/include/ia32/arch-ia32.inc</filename>. | ||
3231 | </para> | ||
3232 | |||
3233 | <para> | ||
3234 | The example then includes <filename>lib32-connman</filename> | ||
3235 | in all the images, which illustrates one method of including a | ||
3236 | multiple library dependency. | ||
3237 | You can use a normal image build to include this dependency, | ||
3238 | for example: | ||
3239 | <literallayout class='monospaced'> | ||
3240 | $ bitbake core-image-sato | ||
3241 | </literallayout> | ||
3242 | You can also build Multilib packages specifically with a command like this: | ||
3243 | <literallayout class='monospaced'> | ||
3244 | $ bitbake lib32-connman | ||
3245 | </literallayout> | ||
3246 | </para> | ||
3247 | </section> | ||
3248 | |||
3249 | <section id='additional-implementation-details'> | ||
3250 | <title>Additional Implementation Details</title> | ||
3251 | |||
3252 | <para> | ||
3253 | Different packaging systems have different levels of native Multilib | ||
3254 | support. | ||
3255 | For the RPM Package Management System, the following implementation details | ||
3256 | exist: | ||
3257 | <itemizedlist> | ||
3258 | <listitem><para>A unique architecture is defined for the Multilib packages, | ||
3259 | along with creating a unique deploy folder under | ||
3260 | <filename>tmp/deploy/rpm</filename> in the | ||
3261 | <link linkend='build-directory'>Build Directory</link>. | ||
3262 | For example, consider <filename>lib32</filename> in a | ||
3263 | <filename>qemux86-64</filename> image. | ||
3264 | The possible architectures in the system are "all", "qemux86_64", | ||
3265 | "lib32_qemux86_64", and "lib32_x86".</para></listitem> | ||
3266 | <listitem><para>The <filename>${MLPREFIX}</filename> variable is stripped from | ||
3267 | <filename>${PN}</filename> during RPM packaging. | ||
3268 | The naming for a normal RPM package and a Multilib RPM package in a | ||
3269 | <filename>qemux86-64</filename> system resolves to something similar to | ||
3270 | <filename>bash-4.1-r2.x86_64.rpm</filename> and | ||
3271 | <filename>bash-4.1.r2.lib32_x86.rpm</filename>, respectively. | ||
3272 | </para></listitem> | ||
3273 | <listitem><para>When installing a Multilib image, the RPM backend first | ||
3274 | installs the base image and then installs the Multilib libraries. | ||
3275 | </para></listitem> | ||
3276 | <listitem><para>The build system relies on RPM to resolve the identical files in the | ||
3277 | two (or more) Multilib packages.</para></listitem> | ||
3278 | </itemizedlist> | ||
3279 | </para> | ||
3280 | |||
3281 | <para> | ||
3282 | For the IPK Package Management System, the following implementation details exist: | ||
3283 | <itemizedlist> | ||
3284 | <listitem><para>The <filename>${MLPREFIX}</filename> is not stripped from | ||
3285 | <filename>${PN}</filename> during IPK packaging. | ||
3286 | The naming for a normal RPM package and a Multilib IPK package in a | ||
3287 | <filename>qemux86-64</filename> system resolves to something like | ||
3288 | <filename>bash_4.1-r2.x86_64.ipk</filename> and | ||
3289 | <filename>lib32-bash_4.1-rw_x86.ipk</filename>, respectively. | ||
3290 | </para></listitem> | ||
3291 | <listitem><para>The IPK deploy folder is not modified with | ||
3292 | <filename>${MLPREFIX}</filename> because packages with and without | ||
3293 | the Multilib feature can exist in the same folder due to the | ||
3294 | <filename>${PN}</filename> differences.</para></listitem> | ||
3295 | <listitem><para>IPK defines a sanity check for Multilib installation | ||
3296 | using certain rules for file comparison, overridden, etc. | ||
3297 | </para></listitem> | ||
3298 | </itemizedlist> | ||
3299 | </para> | ||
3300 | </section> | ||
3301 | </section> | ||
3302 | |||
3303 | <section id='installing-multiple-versions-of-the-same-library'> | ||
3304 | <title>Installing Multiple Versions of the Same Library</title> | ||
3305 | |||
3306 | <para> | ||
3307 | Situations can exist where you need to install and use | ||
3308 | multiple versions of the same library on the same system | ||
3309 | at the same time. | ||
3310 | These situations almost always exist when a library API | ||
3311 | changes and you have multiple pieces of software that | ||
3312 | depend on the separate versions of the library. | ||
3313 | To accommodate these situations, you can install multiple | ||
3314 | versions of the same library in parallel on the same system. | ||
3315 | </para> | ||
3316 | |||
3317 | <para> | ||
3318 | The process is straight forward as long as the libraries use | ||
3319 | proper versioning. | ||
3320 | With properly versioned libraries, all you need to do to | ||
3321 | individually specify the libraries is create separate, | ||
3322 | appropriately named recipes where the | ||
3323 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink> part of the | ||
3324 | name includes a portion that differentiates each library version | ||
3325 | (e.g.the major part of the version number). | ||
3326 | Thus, instead of having a single recipe that loads one version | ||
3327 | of a library (e.g. <filename>clutter</filename>), you provide | ||
3328 | multiple recipes that result in different versions | ||
3329 | of the libraries you want. | ||
3330 | As an example, the following two recipes would allow the | ||
3331 | two separate versions of the <filename>clutter</filename> | ||
3332 | library to co-exist on the same system: | ||
3333 | <literallayout class='monospaced'> | ||
3334 | clutter-1.6_1.6.20.bb | ||
3335 | clutter-1.8_1.8.4.bb | ||
3336 | </literallayout> | ||
3337 | Additionally, if you have other recipes that depend on a given | ||
3338 | library, you need to use the | ||
3339 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink> | ||
3340 | variable to create the dependency. | ||
3341 | Continuing with the same example, if you want to have a recipe | ||
3342 | depend on the 1.8 version of the <filename>clutter</filename> | ||
3343 | library, use the following in your recipe: | ||
3344 | <literallayout class='monospaced'> | ||
3345 | DEPENDS = "clutter-1.8" | ||
3346 | </literallayout> | ||
3347 | </para> | ||
3348 | </section> | ||
3349 | </section> | ||
3350 | |||
3351 | <section id='configuring-the-kernel'> | ||
3352 | <title>Configuring the Kernel</title> | ||
3353 | |||
3354 | <para> | ||
3355 | Configuring the Yocto Project kernel consists of making sure the <filename>.config</filename> | ||
3356 | file has all the right information in it for the image you are building. | ||
3357 | You can use the <filename>menuconfig</filename> tool and configuration fragments to | ||
3358 | make sure your <filename>.config</filename> file is just how you need it. | ||
3359 | This section describes how to use <filename>menuconfig</filename>, create and use | ||
3360 | configuration fragments, and how to interactively tweak your <filename>.config</filename> | ||
3361 | file to create the leanest kernel configuration file possible. | ||
3362 | </para> | ||
3363 | |||
3364 | <para> | ||
3365 | For more information on kernel configuration, see the | ||
3366 | "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#changing-the-configuration'>Changing the Configuration</ulink>" | ||
3367 | section in the Yocto Project Linux Kernel Development Manual. | ||
3368 | </para> | ||
3369 | |||
3370 | <section id='using-menuconfig'> | ||
3371 | <title>Using <filename>menuconfig</filename></title> | ||
3372 | |||
3373 | <para> | ||
3374 | The easiest way to define kernel configurations is to set them through the | ||
3375 | <filename>menuconfig</filename> tool. | ||
3376 | This tool provides an interactive method with which | ||
3377 | to set kernel configurations. | ||
3378 | For general information on <filename>menuconfig</filename>, see | ||
3379 | <ulink url='http://en.wikipedia.org/wiki/Menuconfig'></ulink>. | ||
3380 | </para> | ||
3381 | |||
3382 | <para> | ||
3383 | To use the <filename>menuconfig</filename> tool in the Yocto Project development | ||
3384 | environment, you must launch it using BitBake. | ||
3385 | Thus, the environment must be set up using the | ||
3386 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> | ||
3387 | or | ||
3388 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink> | ||
3389 | script found in the | ||
3390 | <link linkend='build-directory'>Build Directory</link>. | ||
3391 | The following commands run <filename>menuconfig</filename> assuming the | ||
3392 | <link linkend='source-directory'>Source Directory</link> | ||
3393 | top-level folder is <filename>~/poky</filename>: | ||
3394 | <literallayout class='monospaced'> | ||
3395 | $ cd poky | ||
3396 | $ source oe-init-build-env | ||
3397 | $ bitbake linux-yocto -c menuconfig | ||
3398 | </literallayout> | ||
3399 | Once <filename>menuconfig</filename> comes up, its standard interface allows you to | ||
3400 | interactively examine and configure all the kernel configuration parameters. | ||
3401 | After making your changes, simply exit the tool and save your changes to | ||
3402 | create an updated version of the <filename>.config</filename> configuration file. | ||
3403 | </para> | ||
3404 | |||
3405 | <para> | ||
3406 | Consider an example that configures the <filename>linux-yocto-3.14</filename> | ||
3407 | kernel. | ||
3408 | The OpenEmbedded build system recognizes this kernel as | ||
3409 | <filename>linux-yocto</filename>. | ||
3410 | Thus, the following commands from the shell in which you previously sourced the | ||
3411 | environment initialization script cleans the shared state cache and the | ||
3412 | <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink> | ||
3413 | directory and then runs <filename>menuconfig</filename>: | ||
3414 | <literallayout class='monospaced'> | ||
3415 | $ bitbake linux-yocto -c menuconfig | ||
3416 | </literallayout> | ||
3417 | </para> | ||
3418 | |||
3419 | <para> | ||
3420 | Once <filename>menuconfig</filename> launches, use the interface | ||
3421 | to navigate through the selections to find the configuration settings in | ||
3422 | which you are interested. | ||
3423 | For example, consider the <filename>CONFIG_SMP</filename> configuration setting. | ||
3424 | You can find it at <filename>Processor Type and Features</filename> under | ||
3425 | the configuration selection <filename>Symmetric Multi-processing Support</filename>. | ||
3426 | After highlighting the selection, use the arrow keys to select or deselect | ||
3427 | the setting. | ||
3428 | When you are finished with all your selections, exit out and save them. | ||
3429 | </para> | ||
3430 | |||
3431 | <para> | ||
3432 | Saving the selections updates the <filename>.config</filename> configuration file. | ||
3433 | This is the file that the OpenEmbedded build system uses to configure the | ||
3434 | kernel during the build. | ||
3435 | You can find and examine this file in the Build Directory in | ||
3436 | <filename>tmp/work/</filename>. | ||
3437 | The actual <filename>.config</filename> is located in the area where the | ||
3438 | specific kernel is built. | ||
3439 | For example, if you were building a Linux Yocto kernel based on the | ||
3440 | Linux 3.14 kernel and you were building a QEMU image targeted for | ||
3441 | <filename>x86</filename> architecture, the | ||
3442 | <filename>.config</filename> file would be located here: | ||
3443 | <literallayout class='monospaced'> | ||
3444 | poky/build/tmp/work/qemux86-poky-linux/linux-yocto-3.14.11+git1+84f... | ||
3445 | ...656ed30-r1/linux-qemux86-standard-build | ||
3446 | </literallayout> | ||
3447 | <note> | ||
3448 | The previous example directory is artificially split and many of the characters | ||
3449 | in the actual filename are omitted in order to make it more readable. | ||
3450 | Also, depending on the kernel you are using, the exact pathname | ||
3451 | for <filename>linux-yocto-3.14...</filename> might differ. | ||
3452 | </note> | ||
3453 | </para> | ||
3454 | |||
3455 | <para> | ||
3456 | Within the <filename>.config</filename> file, you can see the kernel settings. | ||
3457 | For example, the following entry shows that symmetric multi-processor support | ||
3458 | is not set: | ||
3459 | <literallayout class='monospaced'> | ||
3460 | # CONFIG_SMP is not set | ||
3461 | </literallayout> | ||
3462 | </para> | ||
3463 | |||
3464 | <para> | ||
3465 | A good method to isolate changed configurations is to use a combination of the | ||
3466 | <filename>menuconfig</filename> tool and simple shell commands. | ||
3467 | Before changing configurations with <filename>menuconfig</filename>, copy the | ||
3468 | existing <filename>.config</filename> and rename it to something else, | ||
3469 | use <filename>menuconfig</filename> to make | ||
3470 | as many changes as you want and save them, then compare the renamed configuration | ||
3471 | file against the newly created file. | ||
3472 | You can use the resulting differences as your base to create configuration fragments | ||
3473 | to permanently save in your kernel layer. | ||
3474 | <note> | ||
3475 | Be sure to make a copy of the <filename>.config</filename> and don't just | ||
3476 | rename it. | ||
3477 | The build system needs an existing <filename>.config</filename> | ||
3478 | from which to work. | ||
3479 | </note> | ||
3480 | </para> | ||
3481 | </section> | ||
3482 | |||
3483 | <section id='creating-config-fragments'> | ||
3484 | <title>Creating Configuration Fragments</title> | ||
3485 | |||
3486 | <para> | ||
3487 | Configuration fragments are simply kernel options that appear in a file | ||
3488 | placed where the OpenEmbedded build system can find and apply them. | ||
3489 | Syntactically, the configuration statement is identical to what would appear | ||
3490 | in the <filename>.config</filename> file, which is in the | ||
3491 | <link linkend='build-directory'>Build Directory</link> in | ||
3492 | <filename>tmp/work/<arch>-poky-linux/linux-yocto-<release-specific-string>/linux-<arch>-<build-type></filename>. | ||
3493 | </para> | ||
3494 | |||
3495 | <para> | ||
3496 | It is simple to create a configuration fragment. | ||
3497 | For example, issuing the following from the shell creates a configuration fragment | ||
3498 | file named <filename>my_smp.cfg</filename> that enables multi-processor support | ||
3499 | within the kernel: | ||
3500 | <literallayout class='monospaced'> | ||
3501 | $ echo "CONFIG_SMP=y" >> my_smp.cfg | ||
3502 | </literallayout> | ||
3503 | <note> | ||
3504 | All configuration files must use the <filename>.cfg</filename> extension in order | ||
3505 | for the OpenEmbedded build system to recognize them as a configuration fragment. | ||
3506 | </note> | ||
3507 | </para> | ||
3508 | |||
3509 | <para> | ||
3510 | Where do you put your configuration files? | ||
3511 | You can place these configuration files in the same area pointed to by | ||
3512 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>. | ||
3513 | The OpenEmbedded build system will pick up the configuration and add it to the | ||
3514 | kernel's configuration. | ||
3515 | For example, suppose you had a set of configuration options in a file called | ||
3516 | <filename>myconfig.cfg</filename>. | ||
3517 | If you put that file inside a directory named <filename>linux-yocto</filename> | ||
3518 | that resides in the same directory as the kernel's append file and then add | ||
3519 | a <filename>SRC_URI</filename> statement such as the following to the kernel's append file, | ||
3520 | those configuration options will be picked up and applied when the kernel is built. | ||
3521 | <literallayout class='monospaced'> | ||
3522 | SRC_URI += "file://myconfig.cfg" | ||
3523 | </literallayout> | ||
3524 | </para> | ||
3525 | |||
3526 | <para> | ||
3527 | As mentioned earlier, you can group related configurations into multiple files and | ||
3528 | name them all in the <filename>SRC_URI</filename> statement as well. | ||
3529 | For example, you could group separate configurations specifically for Ethernet and graphics | ||
3530 | into their own files and add those by using a <filename>SRC_URI</filename> statement like the | ||
3531 | following in your append file: | ||
3532 | <literallayout class='monospaced'> | ||
3533 | SRC_URI += "file://myconfig.cfg \ | ||
3534 | file://eth.cfg \ | ||
3535 | file://gfx.cfg" | ||
3536 | </literallayout> | ||
3537 | </para> | ||
3538 | </section> | ||
3539 | |||
3540 | <section id='fine-tuning-the-kernel-configuration-file'> | ||
3541 | <title>Fine-Tuning the Kernel Configuration File</title> | ||
3542 | |||
3543 | <para> | ||
3544 | You can make sure the <filename>.config</filename> file is as lean or efficient as | ||
3545 | possible by reading the output of the kernel configuration fragment audit, | ||
3546 | noting any issues, making changes to correct the issues, and then repeating. | ||
3547 | </para> | ||
3548 | |||
3549 | <para> | ||
3550 | As part of the kernel build process, the | ||
3551 | <filename>do_kernel_configcheck</filename> task runs. | ||
3552 | This task validates the kernel configuration by checking the final | ||
3553 | <filename>.config</filename> file against the input files. | ||
3554 | During the check, the task produces warning messages for the following | ||
3555 | issues: | ||
3556 | <itemizedlist> | ||
3557 | <listitem><para>Requested options that did not make the final | ||
3558 | <filename>.config</filename> file.</para></listitem> | ||
3559 | <listitem><para>Configuration items that appear twice in the same | ||
3560 | configuration fragment.</para></listitem> | ||
3561 | <listitem><para>Configuration items tagged as "required" that were overridden. | ||
3562 | </para></listitem> | ||
3563 | <listitem><para>A board overrides a non-board specific option.</para></listitem> | ||
3564 | <listitem><para>Listed options not valid for the kernel being processed. | ||
3565 | In other words, the option does not appear anywhere.</para></listitem> | ||
3566 | </itemizedlist> | ||
3567 | <note> | ||
3568 | The <filename>do_kernel_configcheck</filename> task can | ||
3569 | also optionally report if an option is overridden during | ||
3570 | processing. | ||
3571 | </note> | ||
3572 | </para> | ||
3573 | |||
3574 | <para> | ||
3575 | For each output warning, a message points to the file | ||
3576 | that contains a list of the options and a pointer to the config | ||
3577 | fragment that defines them. | ||
3578 | Collectively, the files are the key to streamlining the configuration. | ||
3579 | </para> | ||
3580 | |||
3581 | <para> | ||
3582 | To streamline the configuration, do the following: | ||
3583 | <orderedlist> | ||
3584 | <listitem><para>Start with a full configuration that you | ||
3585 | know works - it builds and boots successfully. | ||
3586 | This configuration file will be your baseline. | ||
3587 | </para></listitem> | ||
3588 | <listitem><para>Separately run the | ||
3589 | <filename>do_configme</filename> and | ||
3590 | <filename>do_kernel_configcheck</filename> tasks. | ||
3591 | </para></listitem> | ||
3592 | <listitem><para>Take the resulting list of files from the | ||
3593 | <filename>do_kernel_configcheck</filename> task | ||
3594 | warnings and do the following: | ||
3595 | <itemizedlist> | ||
3596 | <listitem><para> | ||
3597 | Drop values that are redefined in the fragment | ||
3598 | but do not change the final | ||
3599 | <filename>.config</filename> file. | ||
3600 | </para></listitem> | ||
3601 | <listitem><para> | ||
3602 | Analyze and potentially drop values from the | ||
3603 | <filename>.config</filename> file that override | ||
3604 | required configurations. | ||
3605 | </para></listitem> | ||
3606 | <listitem><para> | ||
3607 | Analyze and potentially remove non-board | ||
3608 | specific options. | ||
3609 | </para></listitem> | ||
3610 | <listitem><para> | ||
3611 | Remove repeated and invalid options. | ||
3612 | </para></listitem> | ||
3613 | </itemizedlist></para></listitem> | ||
3614 | <listitem><para> | ||
3615 | After you have worked through the output of the kernel | ||
3616 | configuration audit, you can re-run the | ||
3617 | <filename>do_configme</filename> and | ||
3618 | <filename>do_kernel_configcheck</filename> tasks to | ||
3619 | see the results of your changes. | ||
3620 | If you have more issues, you can deal with them as | ||
3621 | described in the previous step. | ||
3622 | </para></listitem> | ||
3623 | </orderedlist> | ||
3624 | </para> | ||
3625 | |||
3626 | <para> | ||
3627 | Iteratively working through steps two through four eventually yields | ||
3628 | a minimal, streamlined configuration file. | ||
3629 | Once you have the best <filename>.config</filename>, you can build the Linux | ||
3630 | Yocto kernel. | ||
3631 | </para> | ||
3632 | </section> | ||
3633 | </section> | ||
3634 | |||
3635 | <section id="patching-the-kernel"> | ||
3636 | <title>Patching the Kernel</title> | ||
3637 | |||
3638 | <para> | ||
3639 | Patching the kernel involves changing or adding configurations to an existing kernel, | ||
3640 | changing or adding recipes to the kernel that are needed to support specific hardware features, | ||
3641 | or even altering the source code itself. | ||
3642 | <note> | ||
3643 | You can use the <filename>yocto-kernel</filename> script | ||
3644 | found in the <link linkend='source-directory'>Source Directory</link> | ||
3645 | under <filename>scripts</filename> to manage kernel patches and configuration. | ||
3646 | See the "<ulink url='&YOCTO_DOCS_BSP_URL;#managing-kernel-patches-and-config-items-with-yocto-kernel'>Managing kernel Patches and Config Items with yocto-kernel</ulink>" | ||
3647 | section in the Yocto Project Board Support Packages (BSP) Developer's Guide for | ||
3648 | more information.</note> | ||
3649 | </para> | ||
3650 | |||
3651 | <para> | ||
3652 | This example creates a simple patch by adding some QEMU emulator console | ||
3653 | output at boot time through <filename>printk</filename> statements in the kernel's | ||
3654 | <filename>calibrate.c</filename> source code file. | ||
3655 | Applying the patch and booting the modified image causes the added | ||
3656 | messages to appear on the emulator's console. | ||
3657 | </para> | ||
3658 | |||
3659 | <para> | ||
3660 | The example assumes a clean build exists for the <filename>qemux86</filename> | ||
3661 | machine in a | ||
3662 | <link linkend='source-directory'>Source Directory</link> | ||
3663 | named <filename>poky</filename>. | ||
3664 | Furthermore, the <link linkend='build-directory'>Build Directory</link> is | ||
3665 | <filename>build</filename> and is located in <filename>poky</filename> and | ||
3666 | the kernel is based on the Linux 3.4 kernel. | ||
3667 | For general information on how to configure the most efficient build, see the | ||
3668 | "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" section | ||
3669 | in the Yocto Project Quick Start. | ||
3670 | </para> | ||
3671 | |||
3672 | <para> | ||
3673 | Also, for more information on patching the kernel, see the | ||
3674 | "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#applying-patches'>Applying Patches</ulink>" | ||
3675 | section in the Yocto Project Linux Kernel Development Manual. | ||
3676 | </para> | ||
3677 | |||
3678 | <section id='create-a-layer-for-your-changes'> | ||
3679 | <title>Create a Layer for your Changes</title> | ||
3680 | |||
3681 | <para> | ||
3682 | The first step is to create a layer so you can isolate your | ||
3683 | changes. | ||
3684 | Rather than use the <filename>yocto-layer</filename> script | ||
3685 | to create the layer, this example steps through the process | ||
3686 | by hand. | ||
3687 | If you want information on the script that creates a general | ||
3688 | layer, see the | ||
3689 | "<link linkend='creating-a-general-layer-using-the-yocto-layer-script'>Creating a General Layer Using the yocto-layer Script</link>" | ||
3690 | section. | ||
3691 | </para> | ||
3692 | |||
3693 | <para> | ||
3694 | These two commands create a directory you can use for your | ||
3695 | layer: | ||
3696 | <literallayout class='monospaced'> | ||
3697 | $ cd ~/poky | ||
3698 | $ mkdir meta-mylayer | ||
3699 | </literallayout> | ||
3700 | Creating a directory that follows the Yocto Project layer naming | ||
3701 | conventions sets up the layer for your changes. | ||
3702 | The layer is where you place your configuration files, append | ||
3703 | files, and patch files. | ||
3704 | To learn more about creating a layer and filling it with the | ||
3705 | files you need, see the "<link linkend='understanding-and-creating-layers'>Understanding | ||
3706 | and Creating Layers</link>" section. | ||
3707 | </para> | ||
3708 | </section> | ||
3709 | |||
3710 | <section id='finding-the-kernel-source-code'> | ||
3711 | <title>Finding the Kernel Source Code</title> | ||
3712 | |||
3713 | <para> | ||
3714 | Each time you build a kernel image, the kernel source code is fetched | ||
3715 | and unpacked into the following directory: | ||
3716 | <literallayout class='monospaced'> | ||
3717 | ${S}/linux | ||
3718 | </literallayout> | ||
3719 | See the "<link linkend='finding-the-temporary-source-code'>Finding the Temporary Source Code</link>" | ||
3720 | section and the | ||
3721 | <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink> variable | ||
3722 | for more information about where source is kept during a build. | ||
3723 | </para> | ||
3724 | |||
3725 | <para> | ||
3726 | For this example, we are going to patch the | ||
3727 | <filename>init/calibrate.c</filename> file | ||
3728 | by adding some simple console <filename>printk</filename> statements that we can | ||
3729 | see when we boot the image using QEMU. | ||
3730 | </para> | ||
3731 | </section> | ||
3732 | |||
3733 | <section id='creating-the-patch'> | ||
3734 | <title>Creating the Patch</title> | ||
3735 | |||
3736 | <para> | ||
3737 | Two methods exist by which you can create the patch: | ||
3738 | <link linkend='using-a-git-workflow'>Git workflow</link> and | ||
3739 | <link linkend='using-a-quilt-workflow'>Quilt workflow</link>. | ||
3740 | For kernel patches, the Git workflow is more appropriate. | ||
3741 | This section assumes the Git workflow and shows the steps specific to | ||
3742 | this example. | ||
3743 | <orderedlist> | ||
3744 | <listitem><para><emphasis>Change the working directory</emphasis>: | ||
3745 | Change to where the kernel source code is before making | ||
3746 | your edits to the <filename>calibrate.c</filename> file: | ||
3747 | <literallayout class='monospaced'> | ||
3748 | $ cd ~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-${PV}-${PR}/linux | ||
3749 | </literallayout> | ||
3750 | Because you are working in an established Git repository, | ||
3751 | you must be in this directory in order to commit your changes | ||
3752 | and create the patch file. | ||
3753 | <note>The <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink> and | ||
3754 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink> variables | ||
3755 | represent the version and revision for the | ||
3756 | <filename>linux-yocto</filename> recipe. | ||
3757 | The <filename>PV</filename> variable includes the Git meta and machine | ||
3758 | hashes, which make the directory name longer than you might | ||
3759 | expect. | ||
3760 | </note></para></listitem> | ||
3761 | <listitem><para><emphasis>Edit the source file</emphasis>: | ||
3762 | Edit the <filename>init/calibrate.c</filename> file to have the | ||
3763 | following changes: | ||
3764 | <literallayout class='monospaced'> | ||
3765 | void calibrate_delay(void) | ||
3766 | { | ||
3767 | unsigned long lpj; | ||
3768 | static bool printed; | ||
3769 | int this_cpu = smp_processor_id(); | ||
3770 | |||
3771 | printk("*************************************\n"); | ||
3772 | printk("* *\n"); | ||
3773 | printk("* HELLO YOCTO KERNEL *\n"); | ||
3774 | printk("* *\n"); | ||
3775 | printk("*************************************\n"); | ||
3776 | |||
3777 | if (per_cpu(cpu_loops_per_jiffy, this_cpu)) { | ||
3778 | . | ||
3779 | . | ||
3780 | . | ||
3781 | </literallayout></para></listitem> | ||
3782 | <listitem><para><emphasis>Stage and commit your changes</emphasis>: | ||
3783 | These Git commands display the modified file, stage it, and then | ||
3784 | commit the file: | ||
3785 | <literallayout class='monospaced'> | ||
3786 | $ git status | ||
3787 | $ git add init/calibrate.c | ||
3788 | $ git commit -m "calibrate: Add printk example" | ||
3789 | </literallayout></para></listitem> | ||
3790 | <listitem><para><emphasis>Generate the patch file</emphasis>: | ||
3791 | This Git command creates the a patch file named | ||
3792 | <filename>0001-calibrate-Add-printk-example.patch</filename> | ||
3793 | in the current directory. | ||
3794 | <literallayout class='monospaced'> | ||
3795 | $ git format-patch -1 | ||
3796 | </literallayout> | ||
3797 | </para></listitem> | ||
3798 | </orderedlist> | ||
3799 | </para> | ||
3800 | </section> | ||
3801 | |||
3802 | <section id='set-up-your-layer-for-the-build'> | ||
3803 | <title>Set Up Your Layer for the Build</title> | ||
3804 | |||
3805 | <para>These steps get your layer set up for the build: | ||
3806 | <orderedlist> | ||
3807 | <listitem><para><emphasis>Create additional structure</emphasis>: | ||
3808 | Create the additional layer structure: | ||
3809 | <literallayout class='monospaced'> | ||
3810 | $ cd ~/poky/meta-mylayer | ||
3811 | $ mkdir conf | ||
3812 | $ mkdir recipes-kernel | ||
3813 | $ mkdir recipes-kernel/linux | ||
3814 | $ mkdir recipes-kernel/linux/linux-yocto | ||
3815 | </literallayout> | ||
3816 | The <filename>conf</filename> directory holds your configuration files, while the | ||
3817 | <filename>recipes-kernel</filename> directory holds your append file and | ||
3818 | your patch file.</para></listitem> | ||
3819 | <listitem><para><emphasis>Create the layer configuration file</emphasis>: | ||
3820 | Move to the <filename>meta-mylayer/conf</filename> directory and create | ||
3821 | the <filename>layer.conf</filename> file as follows: | ||
3822 | <literallayout class='monospaced'> | ||
3823 | # We have a conf and classes directory, add to BBPATH | ||
3824 | BBPATH .= ":${LAYERDIR}" | ||
3825 | |||
3826 | # We have recipes-* directories, add to BBFILES | ||
3827 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ | ||
3828 | ${LAYERDIR}/recipes-*/*/*.bbappend" | ||
3829 | |||
3830 | BBFILE_COLLECTIONS += "mylayer" | ||
3831 | BBFILE_PATTERN_mylayer = "^${LAYERDIR}/" | ||
3832 | BBFILE_PRIORITY_mylayer = "5" | ||
3833 | </literallayout> | ||
3834 | Notice <filename>mylayer</filename> as part of the last three | ||
3835 | statements.</para></listitem> | ||
3836 | <listitem><para><emphasis>Create the kernel recipe append file</emphasis>: | ||
3837 | Move to the <filename>meta-mylayer/recipes-kernel/linux</filename> directory and create | ||
3838 | the <filename>linux-yocto_3.4.bbappend</filename> file as follows: | ||
3839 | <literallayout class='monospaced'> | ||
3840 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
3841 | |||
3842 | SRC_URI += "file://0001-calibrate-Add-printk-example.patch" | ||
3843 | </literallayout> | ||
3844 | The <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink> | ||
3845 | and <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
3846 | statements enable the OpenEmbedded build system to find the patch file. | ||
3847 | For more information on using append files, see the | ||
3848 | "<link linkend='using-bbappend-files'>Using .bbappend Files</link>" | ||
3849 | section. | ||
3850 | </para></listitem> | ||
3851 | <listitem><para><emphasis>Put the patch file in your layer</emphasis>: | ||
3852 | Move the <filename>0001-calibrate-Add-printk-example.patch</filename> file to | ||
3853 | the <filename>meta-mylayer/recipes-kernel/linux/linux-yocto</filename> | ||
3854 | directory.</para></listitem> | ||
3855 | </orderedlist> | ||
3856 | </para> | ||
3857 | </section> | ||
3858 | |||
3859 | <section id='set-up-for-the-build'> | ||
3860 | <title>Set Up for the Build</title> | ||
3861 | |||
3862 | <para> | ||
3863 | Do the following to make sure the build parameters are set up for the example. | ||
3864 | Once you set up these build parameters, they do not have to change unless you | ||
3865 | change the target architecture of the machine you are building: | ||
3866 | <itemizedlist> | ||
3867 | <listitem><para><emphasis>Build for the correct target architecture:</emphasis> Your | ||
3868 | selected <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> | ||
3869 | definition within the <filename>local.conf</filename> file in the | ||
3870 | <link linkend='build-directory'>Build Directory</link> | ||
3871 | specifies the target architecture used when building the Linux kernel. | ||
3872 | By default, <filename>MACHINE</filename> is set to | ||
3873 | <filename>qemux86</filename>, which specifies a 32-bit | ||
3874 | <trademark class='registered'>Intel</trademark> Architecture | ||
3875 | target machine suitable for the QEMU emulator.</para></listitem> | ||
3876 | <listitem><para><emphasis>Identify your <filename>meta-mylayer</filename> | ||
3877 | layer:</emphasis> The | ||
3878 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink> | ||
3879 | variable in the | ||
3880 | <filename>bblayers.conf</filename> file found in the | ||
3881 | <filename>poky/build/conf</filename> directory needs to have the path to your local | ||
3882 | <filename>meta-mylayer</filename> layer. | ||
3883 | By default, the <filename>BBLAYERS</filename> variable contains paths to | ||
3884 | <filename>meta</filename>, <filename>meta-yocto</filename>, and | ||
3885 | <filename>meta-yocto-bsp</filename> in the | ||
3886 | <filename>poky</filename> Git repository. | ||
3887 | Add the path to your <filename>meta-mylayer</filename> location: | ||
3888 | <literallayout class='monospaced'> | ||
3889 | BBLAYERS ?= " \ | ||
3890 | $HOME/poky/meta \ | ||
3891 | $HOME/poky/meta-yocto \ | ||
3892 | $HOME/poky/meta-yocto-bsp \ | ||
3893 | $HOME/poky/meta-mylayer \ | ||
3894 | " | ||
3895 | |||
3896 | BBLAYERS_NON_REMOVABLE ?= " \ | ||
3897 | $HOME/poky/meta \ | ||
3898 | $HOME/poky/meta-yocto \ | ||
3899 | " | ||
3900 | </literallayout></para></listitem> | ||
3901 | </itemizedlist> | ||
3902 | </para> | ||
3903 | </section> | ||
3904 | |||
3905 | <section id='build-the-modified-qemu-kernel-image'> | ||
3906 | <title>Build the Modified QEMU Kernel Image</title> | ||
3907 | |||
3908 | <para> | ||
3909 | The following steps build your modified kernel image: | ||
3910 | <orderedlist> | ||
3911 | <listitem><para><emphasis>Be sure your build environment is initialized</emphasis>: | ||
3912 | Your environment should be set up since you previously sourced | ||
3913 | the | ||
3914 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> | ||
3915 | script. | ||
3916 | If it is not, source the script again from <filename>poky</filename>. | ||
3917 | <literallayout class='monospaced'> | ||
3918 | $ cd ~/poky | ||
3919 | $ source &OE_INIT_FILE; | ||
3920 | </literallayout> | ||
3921 | </para></listitem> | ||
3922 | <listitem><para><emphasis>Clean up</emphasis>: | ||
3923 | Be sure to clean the shared state out by using BitBake | ||
3924 | to run from within the Build Directory the | ||
3925 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>do_cleansstate</filename></ulink> | ||
3926 | task as follows: | ||
3927 | <literallayout class='monospaced'> | ||
3928 | $ bitbake -c cleansstate linux-yocto | ||
3929 | </literallayout></para> | ||
3930 | <para> | ||
3931 | <note> | ||
3932 | Never remove any files by hand from the | ||
3933 | <filename>tmp/deploy</filename> | ||
3934 | directory inside the | ||
3935 | <link linkend='build-directory'>Build Directory</link>. | ||
3936 | Always use the various BitBake clean tasks to | ||
3937 | clear out previous build artifacts. | ||
3938 | For information on the clean tasks, see the | ||
3939 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-clean'><filename>do_clean</filename></ulink>", | ||
3940 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>do_cleanall</filename></ulink>", | ||
3941 | and | ||
3942 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>do_cleansstate</filename></ulink>" | ||
3943 | sections all in the Yocto Project Reference | ||
3944 | Manual. | ||
3945 | </note> | ||
3946 | </para></listitem> | ||
3947 | <listitem><para><emphasis>Build the image</emphasis>: | ||
3948 | Next, build the kernel image using this command: | ||
3949 | <literallayout class='monospaced'> | ||
3950 | $ bitbake -k linux-yocto | ||
3951 | </literallayout></para></listitem> | ||
3952 | </orderedlist> | ||
3953 | </para> | ||
3954 | </section> | ||
3955 | |||
3956 | <section id='boot-the-image-and-verify-your-changes'> | ||
3957 | <title>Boot the Image and Verify Your Changes</title> | ||
3958 | |||
3959 | <para> | ||
3960 | These steps boot the image and allow you to see the changes | ||
3961 | <orderedlist> | ||
3962 | <listitem><para><emphasis>Boot the image</emphasis>: | ||
3963 | Boot the modified image in the QEMU emulator | ||
3964 | using this command: | ||
3965 | <literallayout class='monospaced'> | ||
3966 | $ runqemu qemux86 | ||
3967 | </literallayout></para></listitem> | ||
3968 | <listitem><para><emphasis>Verify the changes</emphasis>: | ||
3969 | Log into the machine using <filename>root</filename> with no password and then | ||
3970 | use the following shell command to scroll through the console's boot output. | ||
3971 | <literallayout class='monospaced'> | ||
3972 | # dmesg | less | ||
3973 | </literallayout> | ||
3974 | You should see the results of your <filename>printk</filename> statements | ||
3975 | as part of the output.</para></listitem> | ||
3976 | </orderedlist> | ||
3977 | </para> | ||
3978 | </section> | ||
3979 | </section> | ||
3980 | |||
3981 | <section id='making-images-more-secure'> | ||
3982 | <title>Making Images More Secure</title> | ||
3983 | |||
3984 | <para> | ||
3985 | Security is of increasing concern for embedded devices. | ||
3986 | Consider the issues and problems discussed in just this | ||
3987 | sampling of work found across the Internet: | ||
3988 | <itemizedlist> | ||
3989 | <listitem><para><emphasis> | ||
3990 | "<ulink url='https://www.schneier.com/blog/archives/2014/01/security_risks_9.html'>Security Risks of Embedded Systems</ulink>"</emphasis> | ||
3991 | by Bruce Schneier | ||
3992 | </para></listitem> | ||
3993 | <listitem><para><emphasis> | ||
3994 | "<ulink url='http://internetcensus2012.bitbucket.org/paper.html'>Internet Census 2012</ulink>"</emphasis> | ||
3995 | by Carna Botnet</para></listitem> | ||
3996 | <listitem><para><emphasis> | ||
3997 | "<ulink url='http://elinux.org/images/6/6f/Security-issues.pdf'>Security Issues for Embedded Devices</ulink>"</emphasis> | ||
3998 | by Jake Edge | ||
3999 | </para></listitem> | ||
4000 | <listitem><para><emphasis> | ||
4001 | "<ulink url='https://www.nccgroup.com/media/18475/exploiting_security_gateways_via_their_web_interfaces.pdf'>They ought to know better: Exploiting Security | ||
4002 | Gateways via their Web Interfaces</ulink>"</emphasis> | ||
4003 | by Ben Williams | ||
4004 | </para></listitem> | ||
4005 | </itemizedlist> | ||
4006 | </para> | ||
4007 | |||
4008 | <para> | ||
4009 | When securing your image is of concern, there are steps, tools, | ||
4010 | and variables that you can consider to help you reach the | ||
4011 | security goals you need for your particular device. | ||
4012 | Not all situations are identical when it comes to making an | ||
4013 | image secure. | ||
4014 | Consequently, this section provides some guidance and suggestions | ||
4015 | for consideration when you want to make your image more secure. | ||
4016 | <note> | ||
4017 | Because the security requirements and risks are | ||
4018 | different for every type of device, this section cannot | ||
4019 | provide a complete reference on securing your custom OS. | ||
4020 | It is strongly recommended that you also consult other sources | ||
4021 | of information on embedded Linux system hardening and on | ||
4022 | security. | ||
4023 | </note> | ||
4024 | </para> | ||
4025 | |||
4026 | <section id='general-considerations'> | ||
4027 | <title>General Considerations</title> | ||
4028 | |||
4029 | <para> | ||
4030 | General considerations exist that help you create more | ||
4031 | secure images. | ||
4032 | You should consider the following suggestions to help | ||
4033 | make your device more secure: | ||
4034 | <itemizedlist> | ||
4035 | <listitem><para> | ||
4036 | Scan additional code you are adding to the system | ||
4037 | (e.g. application code) by using static analysis | ||
4038 | tools. | ||
4039 | Look for buffer overflows and other potential | ||
4040 | security problems. | ||
4041 | </para></listitem> | ||
4042 | <listitem><para> | ||
4043 | Pay particular attention to to the security for | ||
4044 | any web-based administration interface. | ||
4045 | </para> | ||
4046 | <para>Web interfaces typically need to perform | ||
4047 | administrative functions and tend to need to run with | ||
4048 | elevated privileges. | ||
4049 | Thus, the consequences resulting from the interface's | ||
4050 | security becoming compromised can be serious. | ||
4051 | Look for common web vulnerabilities such as | ||
4052 | cross-site-scripting (XSS), unvalidated inputs, | ||
4053 | and so forth.</para> | ||
4054 | <para>As with system passwords, the default credentials | ||
4055 | for accessing a web-based interface should not be the | ||
4056 | same across all devices. | ||
4057 | This is particularly true if the interface is enabled | ||
4058 | by default as it can be assumed that many end-users | ||
4059 | will not change the credentials. | ||
4060 | </para></listitem> | ||
4061 | <listitem><para> | ||
4062 | Ensure you can update the software on the device to | ||
4063 | mitigate vulnerabilities discovered in the future. | ||
4064 | This consideration especially applies when your | ||
4065 | device is network-enabled. | ||
4066 | </para></listitem> | ||
4067 | <listitem><para> | ||
4068 | Ensure you remove or disable debugging functionality | ||
4069 | before producing the final image. | ||
4070 | For information on how to do this, see the | ||
4071 | "<link linkend='considerations-specific-to-the-openembedded-build-system'>Considerations Specific to the OpenEmbedded Build System</link>" | ||
4072 | section. | ||
4073 | </para></listitem> | ||
4074 | <listitem><para> | ||
4075 | Ensure you have no network services listening that | ||
4076 | are not needed. | ||
4077 | </para></listitem> | ||
4078 | <listitem><para> | ||
4079 | Remove any software from the image that is not needed. | ||
4080 | </para></listitem> | ||
4081 | <listitem><para> | ||
4082 | Enable hardware support for secure boot functionality | ||
4083 | when your device supports this functionality. | ||
4084 | </para></listitem> | ||
4085 | </itemizedlist> | ||
4086 | </para> | ||
4087 | </section> | ||
4088 | |||
4089 | <section id='security-flags'> | ||
4090 | <title>Security Flags</title> | ||
4091 | |||
4092 | <para> | ||
4093 | The Yocto Project has security flags that you can enable that | ||
4094 | help make your build output more secure. | ||
4095 | The security flags are in the | ||
4096 | <filename>meta/conf/distro/include/security_flags.inc</filename> | ||
4097 | file in your | ||
4098 | <link linkend='source-directory'>Source Directory</link> | ||
4099 | (e.g. <filename>poky</filename>). | ||
4100 | <note> | ||
4101 | Depending on the recipe, certain security flags are enabled | ||
4102 | and disabled by default. | ||
4103 | </note> | ||
4104 | </para> | ||
4105 | |||
4106 | <para> | ||
4107 | <!-- | ||
4108 | The GCC/LD flags in <filename>security_flags.inc</filename> | ||
4109 | enable more secure code generation. | ||
4110 | By including the <filename>security_flags.inc</filename> | ||
4111 | file, you enable flags to the compiler and linker that cause | ||
4112 | them to generate more secure code. | ||
4113 | <note> | ||
4114 | The GCC/LD flags are enabled by default in the | ||
4115 | <filename>poky-lsb</filename> distribution. | ||
4116 | </note> | ||
4117 | --> | ||
4118 | Use the following line in your | ||
4119 | <filename>local.conf</filename> file or in your custom | ||
4120 | distribution configuration file to enable the security | ||
4121 | compiler and linker flags to your build: | ||
4122 | <literallayout class='monospaced'> | ||
4123 | require conf/distro/include/security_flags.inc | ||
4124 | </literallayout> | ||
4125 | </para> | ||
4126 | </section> | ||
4127 | |||
4128 | <section id='considerations-specific-to-the-openembedded-build-system'> | ||
4129 | <title>Considerations Specific to the OpenEmbedded Build System</title> | ||
4130 | |||
4131 | <para> | ||
4132 | You can take some steps that are specific to the | ||
4133 | OpenEmbedded build system to make your images more secure: | ||
4134 | <itemizedlist> | ||
4135 | <listitem><para> | ||
4136 | Ensure "debug-tweaks" is not listed with | ||
4137 | <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>. | ||
4138 | The default is to enable "debug-tweaks" by adding it | ||
4139 | to | ||
4140 | <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink> | ||
4141 | in <filename>local.conf</filename>. | ||
4142 | However, you should comment out the variable or be | ||
4143 | sure that it does not have "debug-tweaks" before | ||
4144 | producing your final image. | ||
4145 | Among other things, leaving this in place sets the | ||
4146 | root password as blank, which makes logging in for | ||
4147 | debugging or inspection easy during | ||
4148 | development but also means anyone can easily log in | ||
4149 | during production. | ||
4150 | </para></listitem> | ||
4151 | <listitem><para> | ||
4152 | It is possible to set a root password for the image | ||
4153 | and also to set passwords for any extra users you might | ||
4154 | add (e.g. administrative or service type users). | ||
4155 | When you set up passwords for multiple images or | ||
4156 | users, you should not duplicate passwords. | ||
4157 | </para> | ||
4158 | <para> | ||
4159 | To set up passwords, use the | ||
4160 | <filename>extrausers</filename> class, which is the | ||
4161 | preferred method. | ||
4162 | For an example on how to set up both root and user | ||
4163 | passwords, see the | ||
4164 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-extrausers'><filename>extrausers.bbclass</filename></ulink>" | ||
4165 | section. | ||
4166 | <note> | ||
4167 | When adding extra user accounts or setting a | ||
4168 | root password, be cautious about setting the | ||
4169 | same password on every device. | ||
4170 | If you do this, and the password you have set | ||
4171 | is exposed, then every device is now potentially | ||
4172 | compromised. | ||
4173 | If you need this access but want to ensure | ||
4174 | security, consider setting a different, | ||
4175 | random password for each device. | ||
4176 | Typically, you do this as a separate step after | ||
4177 | you deploy the image onto the device. | ||
4178 | </note> | ||
4179 | </para></listitem> | ||
4180 | <listitem><para> | ||
4181 | Consider enabling a Mandatory Access Control (MAC) | ||
4182 | framework (such as SMACK or SELinux) and tuning it | ||
4183 | appropriately for your device's usage. | ||
4184 | </para></listitem> | ||
4185 | </itemizedlist> | ||
4186 | </para> | ||
4187 | |||
4188 | <para> | ||
4189 | </para> | ||
4190 | </section> | ||
4191 | |||
4192 | <section id='tools-for-hardening-your-image'> | ||
4193 | <title>Tools for Hardening Your Image</title> | ||
4194 | |||
4195 | <para> | ||
4196 | The Yocto Project provides tools for making your image | ||
4197 | more secure. | ||
4198 | You can find these tools in the | ||
4199 | <filename>meta-security</filename> layer of the | ||
4200 | <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi'>Yocto Project Source Repositories</ulink>. | ||
4201 | </para> | ||
4202 | </section> | ||
4203 | </section> | ||
4204 | |||
4205 | <section id='creating-your-own-distribution'> | ||
4206 | <title>Creating Your Own Distribution</title> | ||
4207 | |||
4208 | <para> | ||
4209 | When you build an image using the Yocto Project and | ||
4210 | do not alter any distribution | ||
4211 | <link linkend='metadata'>Metadata</link>, you are creating a | ||
4212 | Poky distribution. | ||
4213 | If you wish to gain more control over package alternative | ||
4214 | selections, compile-time options, and other low-level | ||
4215 | configurations, you can create your own distribution. | ||
4216 | </para> | ||
4217 | |||
4218 | <para> | ||
4219 | To create your own distribution, the basic steps consist of | ||
4220 | creating your own distribution layer, creating your own | ||
4221 | distribution configuration file, and then adding any needed | ||
4222 | code and Metadata to the layer. | ||
4223 | The following steps provide some more detail: | ||
4224 | <itemizedlist> | ||
4225 | <listitem><para><emphasis>Create a layer for your new distro:</emphasis> | ||
4226 | Create your distribution layer so that you can keep your | ||
4227 | Metadata and code for the distribution separate. | ||
4228 | It is strongly recommended that you create and use your own | ||
4229 | layer for configuration and code. | ||
4230 | Using your own layer as compared to just placing | ||
4231 | configurations in a <filename>local.conf</filename> | ||
4232 | configuration file makes it easier to reproduce the same | ||
4233 | build configuration when using multiple build machines. | ||
4234 | See the | ||
4235 | "<link linkend='creating-a-general-layer-using-the-yocto-layer-script'>Creating a General Layer Using the yocto-layer Script</link>" | ||
4236 | section for information on how to quickly set up a layer. | ||
4237 | </para></listitem> | ||
4238 | <listitem><para><emphasis>Create the distribution configuration file:</emphasis> | ||
4239 | The distribution configuration file needs to be created in | ||
4240 | the <filename>conf/distro</filename> directory of your | ||
4241 | layer. | ||
4242 | You need to name it using your distribution name | ||
4243 | (e.g. <filename>mydistro.conf</filename>). | ||
4244 | <note> | ||
4245 | The | ||
4246 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink> | ||
4247 | variable in your | ||
4248 | <filename>local.conf</filename> file determines the | ||
4249 | name of your distribution. | ||
4250 | </note></para> | ||
4251 | <para>You can split out parts of your configuration file | ||
4252 | into include files and then "require" them from within | ||
4253 | your distribution configuration file. | ||
4254 | Be sure to place the include files in the | ||
4255 | <filename>conf/distro/include</filename> directory of | ||
4256 | your layer. | ||
4257 | A common example usage of include files would be to | ||
4258 | separate out the selection of desired version and revisions | ||
4259 | for individual recipes. | ||
4260 | </para> | ||
4261 | <para>Your configuration file needs to set the following | ||
4262 | required variables: | ||
4263 | <literallayout class='monospaced'> | ||
4264 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_NAME'><filename>DISTRO_NAME</filename></ulink> | ||
4265 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_VERSION'><filename>DISTRO_VERSION</filename></ulink> | ||
4266 | </literallayout> | ||
4267 | These following variables are optional and you typically | ||
4268 | set them from the distribution configuration file: | ||
4269 | <literallayout class='monospaced'> | ||
4270 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></ulink> | ||
4271 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_EXTRA_RDEPENDS'><filename>DISTRO_EXTRA_RDEPENDS</filename></ulink> | ||
4272 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_EXTRA_RRECOMMENDS'><filename>DISTRO_EXTRA_RRECOMMENDS</filename></ulink> | ||
4273 | <ulink url='&YOCTO_DOCS_REF_URL;#var-TCLIBC'><filename>TCLIBC</filename></ulink> | ||
4274 | </literallayout> | ||
4275 | <tip> | ||
4276 | If you want to base your distribution configuration file | ||
4277 | on the very basic configuration from OE-Core, you | ||
4278 | can use | ||
4279 | <filename>conf/distro/defaultsetup.conf</filename> as | ||
4280 | a reference and just include variables that differ | ||
4281 | as compared to <filename>defaultsetup.conf</filename>. | ||
4282 | Alternatively, you can create a distribution | ||
4283 | configuration file from scratch using the | ||
4284 | <filename>defaultsetup.conf</filename> file | ||
4285 | or configuration files from other distributions | ||
4286 | such as Poky or Angstrom as references. | ||
4287 | </tip></para></listitem> | ||
4288 | <listitem><para><emphasis>Provide miscellaneous variables:</emphasis> | ||
4289 | Be sure to define any other variables for which you want to | ||
4290 | create a default or enforce as part of the distribution | ||
4291 | configuration. | ||
4292 | You can include nearly any variable from the | ||
4293 | <filename>local.conf</filename> file. | ||
4294 | The variables you use are not limited to the list in the | ||
4295 | previous bulleted item.</para></listitem> | ||
4296 | <listitem><para><emphasis>Point to Your distribution configuration file:</emphasis> | ||
4297 | In your <filename>local.conf</filename> file in the | ||
4298 | <link linkend='build-directory'>Build Directory</link>, | ||
4299 | set your | ||
4300 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink> | ||
4301 | variable to point to your distribution's configuration file. | ||
4302 | For example, if your distribution's configuration file is | ||
4303 | named <filename>mydistro.conf</filename>, then you point | ||
4304 | to it as follows: | ||
4305 | <literallayout class='monospaced'> | ||
4306 | DISTRO = "mydistro" | ||
4307 | </literallayout></para></listitem> | ||
4308 | <listitem><para><emphasis>Add more to the layer if necessary:</emphasis> | ||
4309 | Use your layer to hold other information needed for the | ||
4310 | distribution: | ||
4311 | <itemizedlist> | ||
4312 | <listitem><para>Add recipes for installing | ||
4313 | distro-specific configuration files that are not | ||
4314 | already installed by another recipe. | ||
4315 | If you have distro-specific configuration files | ||
4316 | that are included by an existing recipe, you should | ||
4317 | add an append file (<filename>.bbappend</filename>) | ||
4318 | for those. | ||
4319 | For general information and recommendations | ||
4320 | on how to add recipes to your layer, see the | ||
4321 | "<link linkend='creating-your-own-layer'>Creating Your Own Layer</link>" | ||
4322 | and | ||
4323 | "<link linkend='best-practices-to-follow-when-creating-layers'>Best Practices to Follow When Creating Layers</link>" | ||
4324 | sections.</para></listitem> | ||
4325 | <listitem><para>Add any image recipes that are specific | ||
4326 | to your distribution.</para></listitem> | ||
4327 | <listitem><para>Add a <filename>psplash</filename> | ||
4328 | append file for a branded splash screen. | ||
4329 | For information on append files, see the | ||
4330 | "<link linkend='using-bbappend-files'>Using .bbappend Files</link>" | ||
4331 | section.</para></listitem> | ||
4332 | <listitem><para>Add any other append files to make | ||
4333 | custom changes that are specific to individual | ||
4334 | recipes.</para></listitem> | ||
4335 | </itemizedlist></para></listitem> | ||
4336 | </itemizedlist> | ||
4337 | </para> | ||
4338 | </section> | ||
4339 | |||
4340 | <section id='creating-a-custom-template-configuration-directory'> | ||
4341 | <title>Creating a Custom Template Configuration Directory</title> | ||
4342 | |||
4343 | <para> | ||
4344 | If you're producing your own customized version | ||
4345 | of the build system for use by other users, you might | ||
4346 | want to customize the message shown by the setup script or | ||
4347 | you might want to change the template configuration files (i.e. | ||
4348 | (<filename>local.conf</filename> and | ||
4349 | <filename>bblayers.conf</filename>) that are created in | ||
4350 | a new build directory. | ||
4351 | </para> | ||
4352 | |||
4353 | <para> | ||
4354 | The OpenEmbedded build system uses the environment variable | ||
4355 | <filename>TEMPLATECONF</filename> to locate the directory | ||
4356 | from which it gathers configuration information that ultimately | ||
4357 | ends up in the | ||
4358 | <link linkend='build-directory'>Build Directory's</link> | ||
4359 | <filename>conf</filename> directory. | ||
4360 | By default, <filename>TEMPLATECONF</filename> is set as | ||
4361 | follows in the <filename>poky</filename> repository: | ||
4362 | <literallayout class='monospaced'> | ||
4363 | TEMPLATECONF=${TEMPLATECONF:-meta-yocto/conf} | ||
4364 | </literallayout> | ||
4365 | This is the directory used by the build system to find templates | ||
4366 | from which to build some key configuration files. | ||
4367 | If you look at this directory, you will see the | ||
4368 | <filename>bblayers.conf.sample</filename>, | ||
4369 | <filename>local.conf.sample</filename>, and | ||
4370 | <filename>conf-notes.txt</filename> files. | ||
4371 | The build system uses these files to form the respective | ||
4372 | <filename>bblayers.conf</filename> file, | ||
4373 | <filename>local.conf</filename> file, and display the list of | ||
4374 | BitBake targets when running the setup script. | ||
4375 | </para> | ||
4376 | |||
4377 | <para> | ||
4378 | To override these default configuration files with | ||
4379 | configurations you want used within every new | ||
4380 | Build Directory, simply set the | ||
4381 | <filename>TEMPLATECONF</filename> variable to your directory. | ||
4382 | The <filename>TEMPLATECONF</filename> variable is set in the | ||
4383 | <filename>.templateconf</filename> file, which is in the | ||
4384 | top-level | ||
4385 | <link linkend='source-directory'>Source Directory</link> | ||
4386 | folder (e.g. <filename>poky</filename>). | ||
4387 | Edit the <filename>.templateconf</filename> so that it can locate | ||
4388 | your directory. | ||
4389 | </para> | ||
4390 | |||
4391 | <para> | ||
4392 | Best practices dictate that you should keep your | ||
4393 | template configuration directory in your custom distribution layer. | ||
4394 | For example, suppose you have a layer named | ||
4395 | <filename>meta-mylayer</filename> located in your home directory | ||
4396 | and you want your template configuration directory named | ||
4397 | <filename>myconf</filename>. | ||
4398 | Changing the <filename>.templateconf</filename> as follows | ||
4399 | causes the OpenEmbedded build system to look in your directory | ||
4400 | and base its configuration files on the | ||
4401 | <filename>*.sample</filename> configuration files it finds. | ||
4402 | The final configuration files (i.e. | ||
4403 | <filename>local.conf</filename> and | ||
4404 | <filename>bblayers.conf</filename> ultimately still end up in | ||
4405 | your Build Directory, but they are based on your | ||
4406 | <filename>*.sample</filename> files. | ||
4407 | <literallayout class='monospaced'> | ||
4408 | TEMPLATECONF=${TEMPLATECONF:-meta-mylayer/myconf} | ||
4409 | </literallayout> | ||
4410 | </para> | ||
4411 | |||
4412 | <para> | ||
4413 | Aside from the <filename>*.sample</filename> configuration files, | ||
4414 | the <filename>conf-notes.txt</filename> also resides in the | ||
4415 | default <filename>meta-yocto/conf</filename> directory. | ||
4416 | The scripts that set up the build environment | ||
4417 | (i.e. | ||
4418 | <ulink url="&YOCTO_DOCS_REF_URL;#structure-core-script"><filename>&OE_INIT_FILE;</filename></ulink> | ||
4419 | and | ||
4420 | <ulink url="&YOCTO_DOCS_REF_URL;#structure-memres-core-script"><filename>oe-init-build-env-memres</filename></ulink>) | ||
4421 | use this file to display BitBake targets as part of the script | ||
4422 | output. | ||
4423 | Customizing this <filename>conf-notes.txt</filename> file is a | ||
4424 | good way to make sure your list of custom targets appears | ||
4425 | as part of the script's output. | ||
4426 | </para> | ||
4427 | |||
4428 | <para> | ||
4429 | Here is the default list of targets displayed as a result of | ||
4430 | running either of the setup scripts: | ||
4431 | <literallayout class='monospaced'> | ||
4432 | You can now run 'bitbake <target>' | ||
4433 | |||
4434 | Common targets are: | ||
4435 | core-image-minimal | ||
4436 | core-image-sato | ||
4437 | meta-toolchain | ||
4438 | adt-installer | ||
4439 | meta-ide-support | ||
4440 | </literallayout> | ||
4441 | </para> | ||
4442 | |||
4443 | <para> | ||
4444 | Changing the listed common targets is as easy as editing your | ||
4445 | version of <filename>conf-notes.txt</filename> in your | ||
4446 | custom template configuration directory and making sure you | ||
4447 | have <filename>TEMPLATECONF</filename> set to your directory. | ||
4448 | </para> | ||
4449 | </section> | ||
4450 | |||
4451 | <section id='building-a-tiny-system'> | ||
4452 | <title>Building a Tiny System</title> | ||
4453 | |||
4454 | <para> | ||
4455 | Very small distributions have some significant advantages such | ||
4456 | as requiring less on-die or in-package memory (cheaper), better | ||
4457 | performance through efficient cache usage, lower power requirements | ||
4458 | due to less memory, faster boot times, and reduced development | ||
4459 | overhead. | ||
4460 | Some real-world examples where a very small distribution gives | ||
4461 | you distinct advantages are digital cameras, medical devices, | ||
4462 | and small headless systems. | ||
4463 | </para> | ||
4464 | |||
4465 | <para> | ||
4466 | This section presents information that shows you how you can | ||
4467 | trim your distribution to even smaller sizes than the | ||
4468 | <filename>poky-tiny</filename> distribution, which is around | ||
4469 | 5 Mbytes, that can be built out-of-the-box using the Yocto Project. | ||
4470 | </para> | ||
4471 | |||
4472 | <section id='tiny-system-overview'> | ||
4473 | <title>Overview</title> | ||
4474 | |||
4475 | <para> | ||
4476 | The following list presents the overall steps you need to | ||
4477 | consider and perform to create distributions with smaller | ||
4478 | root filesystems, achieve faster boot times, maintain your critical | ||
4479 | functionality, and avoid initial RAM disks: | ||
4480 | <itemizedlist> | ||
4481 | <listitem><para> | ||
4482 | <link linkend='goals-and-guiding-principles'>Determine your goals and guiding principles.</link> | ||
4483 | </para></listitem> | ||
4484 | <listitem><para> | ||
4485 | <link linkend='understand-what-gives-your-image-size'>Understand what contributes to your image size.</link> | ||
4486 | </para></listitem> | ||
4487 | <listitem><para> | ||
4488 | <link linkend='trim-the-root-filesystem'>Reduce the size of the root filesystem.</link> | ||
4489 | </para></listitem> | ||
4490 | <listitem><para> | ||
4491 | <link linkend='trim-the-kernel'>Reduce the size of the kernel.</link> | ||
4492 | </para></listitem> | ||
4493 | <listitem><para> | ||
4494 | <link linkend='remove-package-management-requirements'>Eliminate packaging requirements.</link> | ||
4495 | </para></listitem> | ||
4496 | <listitem><para> | ||
4497 | <link linkend='look-for-other-ways-to-minimize-size'>Look for other ways to minimize size.</link> | ||
4498 | </para></listitem> | ||
4499 | <listitem><para> | ||
4500 | <link linkend='iterate-on-the-process'>Iterate on the process.</link> | ||
4501 | </para></listitem> | ||
4502 | </itemizedlist> | ||
4503 | </para> | ||
4504 | </section> | ||
4505 | |||
4506 | <section id='goals-and-guiding-principles'> | ||
4507 | <title>Goals and Guiding Principles</title> | ||
4508 | |||
4509 | <para> | ||
4510 | Before you can reach your destination, you need to know | ||
4511 | where you are going. | ||
4512 | Here is an example list that you can use as a guide when | ||
4513 | creating very small distributions: | ||
4514 | <itemizedlist> | ||
4515 | <listitem><para>Determine how much space you need | ||
4516 | (e.g. a kernel that is 1 Mbyte or less and | ||
4517 | a root filesystem that is 3 Mbytes or less). | ||
4518 | </para></listitem> | ||
4519 | <listitem><para>Find the areas that are currently | ||
4520 | taking 90% of the space and concentrate on reducing | ||
4521 | those areas. | ||
4522 | </para></listitem> | ||
4523 | <listitem><para>Do not create any difficult "hacks" | ||
4524 | to achieve your goals.</para></listitem> | ||
4525 | <listitem><para>Leverage the device-specific | ||
4526 | options.</para></listitem> | ||
4527 | <listitem><para>Work in a separate layer so that you | ||
4528 | keep changes isolated. | ||
4529 | For information on how to create layers, see | ||
4530 | the "<link linkend='understanding-and-creating-layers'>Understanding and Creating Layers</link>" section. | ||
4531 | </para></listitem> | ||
4532 | </itemizedlist> | ||
4533 | </para> | ||
4534 | </section> | ||
4535 | |||
4536 | <section id='understand-what-gives-your-image-size'> | ||
4537 | <title>Understand What Contributes to Your Image Size</title> | ||
4538 | |||
4539 | <para> | ||
4540 | It is easiest to have something to start with when creating | ||
4541 | your own distribution. | ||
4542 | You can use the Yocto Project out-of-the-box to create the | ||
4543 | <filename>poky-tiny</filename> distribution. | ||
4544 | Ultimately, you will want to make changes in your own | ||
4545 | distribution that are likely modeled after | ||
4546 | <filename>poky-tiny</filename>. | ||
4547 | <note> | ||
4548 | To use <filename>poky-tiny</filename> in your build, | ||
4549 | set the | ||
4550 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink> | ||
4551 | variable in your | ||
4552 | <filename>local.conf</filename> file to "poky-tiny" | ||
4553 | as described in the | ||
4554 | "<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>" | ||
4555 | section. | ||
4556 | </note> | ||
4557 | </para> | ||
4558 | |||
4559 | <para> | ||
4560 | Understanding some memory concepts will help you reduce the | ||
4561 | system size. | ||
4562 | Memory consists of static, dynamic, and temporary memory. | ||
4563 | Static memory is the TEXT (code), DATA (initialized data | ||
4564 | in the code), and BSS (uninitialized data) sections. | ||
4565 | Dynamic memory represents memory that is allocated at runtime: | ||
4566 | stacks, hash tables, and so forth. | ||
4567 | Temporary memory is recovered after the boot process. | ||
4568 | This memory consists of memory used for decompressing | ||
4569 | the kernel and for the <filename>__init__</filename> | ||
4570 | functions. | ||
4571 | </para> | ||
4572 | |||
4573 | <para> | ||
4574 | To help you see where you currently are with kernel and root | ||
4575 | filesystem sizes, you can use two tools found in the | ||
4576 | <link linkend='source-directory'>Source Directory</link> in | ||
4577 | the <filename>scripts/tiny/</filename> directory: | ||
4578 | <itemizedlist> | ||
4579 | <listitem><para><filename>ksize.py</filename>: Reports | ||
4580 | component sizes for the kernel build objects. | ||
4581 | </para></listitem> | ||
4582 | <listitem><para><filename>dirsize.py</filename>: Reports | ||
4583 | component sizes for the root filesystem.</para></listitem> | ||
4584 | </itemizedlist> | ||
4585 | This next tool and command help you organize configuration | ||
4586 | fragments and view file dependencies in a human-readable form: | ||
4587 | <itemizedlist> | ||
4588 | <listitem><para><filename>merge_config.sh</filename>: | ||
4589 | Helps you manage configuration files and fragments | ||
4590 | within the kernel. | ||
4591 | With this tool, you can merge individual configuration | ||
4592 | fragments together. | ||
4593 | The tool allows you to make overrides and warns you | ||
4594 | of any missing configuration options. | ||
4595 | The tool is ideal for allowing you to iterate on | ||
4596 | configurations, create minimal configurations, and | ||
4597 | create configuration files for different machines | ||
4598 | without having to duplicate your process.</para> | ||
4599 | <para>The <filename>merge_config.sh</filename> script is | ||
4600 | part of the Linux Yocto kernel Git repositories | ||
4601 | (i.e. <filename>linux-yocto-3.14</filename>, | ||
4602 | <filename>linux-yocto-3.10</filename>, | ||
4603 | <filename>linux-yocto-3.8</filename>, and so forth) | ||
4604 | in the | ||
4605 | <filename>scripts/kconfig</filename> directory.</para> | ||
4606 | <para>For more information on configuration fragments, | ||
4607 | see the | ||
4608 | "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#generating-configuration-files'>Generating Configuration Files</ulink>" | ||
4609 | section of the Yocto Project Linux Kernel Development | ||
4610 | Manual and the "<link linkend='creating-config-fragments'>Creating Configuration Fragments</link>" | ||
4611 | section, which is in this manual.</para></listitem> | ||
4612 | <listitem><para><filename>bitbake -u depexp -g <bitbake_target></filename>: | ||
4613 | Using the BitBake command with these options brings up | ||
4614 | a Dependency Explorer from which you can view file | ||
4615 | dependencies. | ||
4616 | Understanding these dependencies allows you to make | ||
4617 | informed decisions when cutting out various pieces of the | ||
4618 | kernel and root filesystem.</para></listitem> | ||
4619 | </itemizedlist> | ||
4620 | </para> | ||
4621 | </section> | ||
4622 | |||
4623 | <section id='trim-the-root-filesystem'> | ||
4624 | <title>Trim the Root Filesystem</title> | ||
4625 | |||
4626 | <para> | ||
4627 | The root filesystem is made up of packages for booting, | ||
4628 | libraries, and applications. | ||
4629 | To change things, you can configure how the packaging happens, | ||
4630 | which changes the way you build them. | ||
4631 | You can also tweak the filesystem itself or select a different | ||
4632 | filesystem. | ||
4633 | </para> | ||
4634 | |||
4635 | <para> | ||
4636 | First, find out what is hogging your root filesystem by running the | ||
4637 | <filename>dirsize.py</filename> script from your root directory: | ||
4638 | <literallayout class='monospaced'> | ||
4639 | $ cd <root-directory-of-image> | ||
4640 | $ dirsize.py 100000 > dirsize-100k.log | ||
4641 | $ cat dirsize-100k.log | ||
4642 | </literallayout> | ||
4643 | You can apply a filter to the script to ignore files under | ||
4644 | a certain size. | ||
4645 | The previous example filters out any files below 100 Kbytes. | ||
4646 | The sizes reported by the tool are uncompressed, and thus | ||
4647 | will be smaller by a relatively constant factor in a | ||
4648 | compressed root filesystem. | ||
4649 | When you examine your log file, you can focus on areas of the | ||
4650 | root filesystem that take up large amounts of memory. | ||
4651 | </para> | ||
4652 | |||
4653 | <para> | ||
4654 | You need to be sure that what you eliminate does not cripple | ||
4655 | the functionality you need. | ||
4656 | One way to see how packages relate to each other is by using | ||
4657 | the Dependency Explorer UI with the BitBake command: | ||
4658 | <literallayout class='monospaced'> | ||
4659 | $ cd <image-directory> | ||
4660 | $ bitbake -u depexp -g <image> | ||
4661 | </literallayout> | ||
4662 | Use the interface to select potential packages you wish to | ||
4663 | eliminate and see their dependency relationships. | ||
4664 | </para> | ||
4665 | |||
4666 | <para> | ||
4667 | When deciding how to reduce the size, get rid of packages that | ||
4668 | result in minimal impact on the feature set. | ||
4669 | For example, you might not need a VGA display. | ||
4670 | Or, you might be able to get by with <filename>devtmpfs</filename> | ||
4671 | and <filename>mdev</filename> instead of | ||
4672 | <filename>udev</filename>. | ||
4673 | </para> | ||
4674 | |||
4675 | <para> | ||
4676 | Use your <filename>local.conf</filename> file to make changes. | ||
4677 | For example, to eliminate <filename>udev</filename> and | ||
4678 | <filename>glib</filename>, set the following in the | ||
4679 | local configuration file: | ||
4680 | <literallayout class='monospaced'> | ||
4681 | VIRTUAL-RUNTIME_dev_manager = "" | ||
4682 | </literallayout> | ||
4683 | </para> | ||
4684 | |||
4685 | <para> | ||
4686 | Finally, you should consider exactly the type of root | ||
4687 | filesystem you need to meet your needs while also reducing | ||
4688 | its size. | ||
4689 | For example, consider <filename>cramfs</filename>, | ||
4690 | <filename>squashfs</filename>, <filename>ubifs</filename>, | ||
4691 | <filename>ext2</filename>, or an <filename>initramfs</filename> | ||
4692 | using <filename>initramfs</filename>. | ||
4693 | Be aware that <filename>ext3</filename> requires a 1 Mbyte | ||
4694 | journal. | ||
4695 | If you are okay with running read-only, you do not need this | ||
4696 | journal. | ||
4697 | </para> | ||
4698 | |||
4699 | <note> | ||
4700 | After each round of elimination, you need to rebuild your | ||
4701 | system and then use the tools to see the effects of your | ||
4702 | reductions. | ||
4703 | </note> | ||
4704 | |||
4705 | |||
4706 | </section> | ||
4707 | |||
4708 | <section id='trim-the-kernel'> | ||
4709 | <title>Trim the Kernel</title> | ||
4710 | |||
4711 | <para> | ||
4712 | The kernel is built by including policies for hardware-independent | ||
4713 | aspects. | ||
4714 | What subsystems do you enable? | ||
4715 | For what architecture are you building? | ||
4716 | Which drivers do you build by default? | ||
4717 | <note>You can modify the kernel source if you want to help | ||
4718 | with boot time. | ||
4719 | </note> | ||
4720 | </para> | ||
4721 | |||
4722 | <para> | ||
4723 | Run the <filename>ksize.py</filename> script from the top-level | ||
4724 | Linux build directory to get an idea of what is making up | ||
4725 | the kernel: | ||
4726 | <literallayout class='monospaced'> | ||
4727 | $ cd <top-level-linux-build-directory> | ||
4728 | $ ksize.py > ksize.log | ||
4729 | $ cat ksize.log | ||
4730 | </literallayout> | ||
4731 | When you examine the log, you will see how much space is | ||
4732 | taken up with the built-in <filename>.o</filename> files for | ||
4733 | drivers, networking, core kernel files, filesystem, sound, | ||
4734 | and so forth. | ||
4735 | The sizes reported by the tool are uncompressed, and thus | ||
4736 | will be smaller by a relatively constant factor in a compressed | ||
4737 | kernel image. | ||
4738 | Look to reduce the areas that are large and taking up around | ||
4739 | the "90% rule." | ||
4740 | </para> | ||
4741 | |||
4742 | <para> | ||
4743 | To examine, or drill down, into any particular area, use the | ||
4744 | <filename>-d</filename> option with the script: | ||
4745 | <literallayout class='monospaced'> | ||
4746 | $ ksize.py -d > ksize.log | ||
4747 | </literallayout> | ||
4748 | Using this option breaks out the individual file information | ||
4749 | for each area of the kernel (e.g. drivers, networking, and | ||
4750 | so forth). | ||
4751 | </para> | ||
4752 | |||
4753 | <para> | ||
4754 | Use your log file to see what you can eliminate from the kernel | ||
4755 | based on features you can let go. | ||
4756 | For example, if you are not going to need sound, you do not | ||
4757 | need any drivers that support sound. | ||
4758 | </para> | ||
4759 | |||
4760 | <para> | ||
4761 | After figuring out what to eliminate, you need to reconfigure | ||
4762 | the kernel to reflect those changes during the next build. | ||
4763 | You could run <filename>menuconfig</filename> and make all your | ||
4764 | changes at once. | ||
4765 | However, that makes it difficult to see the effects of your | ||
4766 | individual eliminations and also makes it difficult to replicate | ||
4767 | the changes for perhaps another target device. | ||
4768 | A better method is to start with no configurations using | ||
4769 | <filename>allnoconfig</filename>, create configuration | ||
4770 | fragments for individual changes, and then manage the | ||
4771 | fragments into a single configuration file using | ||
4772 | <filename>merge_config.sh</filename>. | ||
4773 | The tool makes it easy for you to iterate using the | ||
4774 | configuration change and build cycle. | ||
4775 | </para> | ||
4776 | |||
4777 | <para> | ||
4778 | Each time you make configuration changes, you need to rebuild | ||
4779 | the kernel and check to see what impact your changes had on | ||
4780 | the overall size. | ||
4781 | </para> | ||
4782 | </section> | ||
4783 | |||
4784 | <section id='remove-package-management-requirements'> | ||
4785 | <title>Remove Package Management Requirements</title> | ||
4786 | |||
4787 | <para> | ||
4788 | Packaging requirements add size to the image. | ||
4789 | One way to reduce the size of the image is to remove all the | ||
4790 | packaging requirements from the image. | ||
4791 | This reduction includes both removing the package manager | ||
4792 | and its unique dependencies as well as removing the package | ||
4793 | management data itself. | ||
4794 | </para> | ||
4795 | |||
4796 | <para> | ||
4797 | To eliminate all the packaging requirements for an image, | ||
4798 | be sure that "package-management" is not part of your | ||
4799 | <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink> | ||
4800 | statement for the image. | ||
4801 | When you remove this feature, you are removing the package | ||
4802 | manager as well as its dependencies from the root filesystem. | ||
4803 | </para> | ||
4804 | </section> | ||
4805 | |||
4806 | <section id='look-for-other-ways-to-minimize-size'> | ||
4807 | <title>Look for Other Ways to Minimize Size</title> | ||
4808 | |||
4809 | <para> | ||
4810 | Depending on your particular circumstances, other areas that you | ||
4811 | can trim likely exist. | ||
4812 | The key to finding these areas is through tools and methods | ||
4813 | described here combined with experimentation and iteration. | ||
4814 | Here are a couple of areas to experiment with: | ||
4815 | <itemizedlist> | ||
4816 | <listitem><para><filename>eglibc</filename>: | ||
4817 | In general, follow this process: | ||
4818 | <orderedlist> | ||
4819 | <listitem><para>Remove <filename>eglibc</filename> | ||
4820 | features from | ||
4821 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></ulink> | ||
4822 | that you think you do not need.</para></listitem> | ||
4823 | <listitem><para>Build your distribution. | ||
4824 | </para></listitem> | ||
4825 | <listitem><para>If the build fails due to missing | ||
4826 | symbols in a package, determine if you can | ||
4827 | reconfigure the package to not need those | ||
4828 | features. | ||
4829 | For example, change the configuration to not | ||
4830 | support wide character support as is done for | ||
4831 | <filename>ncurses</filename>. | ||
4832 | Or, if support for those characters is needed, | ||
4833 | determine what <filename>eglibc</filename> | ||
4834 | features provide the support and restore the | ||
4835 | configuration. | ||
4836 | </para></listitem> | ||
4837 | <listitem><para>Rebuild and repeat the process. | ||
4838 | </para></listitem> | ||
4839 | </orderedlist></para></listitem> | ||
4840 | <listitem><para><filename>busybox</filename>: | ||
4841 | For BusyBox, use a process similar as described for | ||
4842 | <filename>eglibc</filename>. | ||
4843 | A difference is you will need to boot the resulting | ||
4844 | system to see if you are able to do everything you | ||
4845 | expect from the running system. | ||
4846 | You need to be sure to integrate configuration fragments | ||
4847 | into Busybox because BusyBox handles its own core | ||
4848 | features and then allows you to add configuration | ||
4849 | fragments on top. | ||
4850 | </para></listitem> | ||
4851 | </itemizedlist> | ||
4852 | </para> | ||
4853 | </section> | ||
4854 | |||
4855 | <section id='iterate-on-the-process'> | ||
4856 | <title>Iterate on the Process</title> | ||
4857 | |||
4858 | <para> | ||
4859 | If you have not reached your goals on system size, you need | ||
4860 | to iterate on the process. | ||
4861 | The process is the same. | ||
4862 | Use the tools and see just what is taking up 90% of the root | ||
4863 | filesystem and the kernel. | ||
4864 | Decide what you can eliminate without limiting your device | ||
4865 | beyond what you need. | ||
4866 | </para> | ||
4867 | |||
4868 | <para> | ||
4869 | Depending on your system, a good place to look might be | ||
4870 | Busybox, which provides a stripped down | ||
4871 | version of Unix tools in a single, executable file. | ||
4872 | You might be able to drop virtual terminal services or perhaps | ||
4873 | ipv6. | ||
4874 | </para> | ||
4875 | </section> | ||
4876 | </section> | ||
4877 | |||
4878 | <section id='working-with-packages'> | ||
4879 | <title>Working with Packages</title> | ||
4880 | |||
4881 | <para> | ||
4882 | This section describes a few tasks that involve packages: | ||
4883 | <itemizedlist> | ||
4884 | <listitem><para> | ||
4885 | <link linkend='excluding-packages-from-an-image'>Excluding packages from an image</link> | ||
4886 | </para></listitem> | ||
4887 | <listitem><para> | ||
4888 | <link linkend='incrementing-a-package-revision-number'>Incrementing a package revision number</link> | ||
4889 | </para></listitem> | ||
4890 | <listitem><para> | ||
4891 | <link linkend='usingpoky-configuring-DISTRO_PN_ALIAS'>Handling a package name alias</link> | ||
4892 | </para></listitem> | ||
4893 | <listitem><para> | ||
4894 | <link linkend='handling-optional-module-packaging'>Handling optional module packaging</link> | ||
4895 | </para></listitem> | ||
4896 | <listitem><para> | ||
4897 | <link linkend='using-runtime-package-management'>Using Runtime Package Management</link> | ||
4898 | </para></listitem> | ||
4899 | <listitem><para> | ||
4900 | <link linkend='testing-packages-with-ptest'>Setting up and running package test (ptest)</link> | ||
4901 | </para></listitem> | ||
4902 | </itemizedlist> | ||
4903 | </para> | ||
4904 | |||
4905 | <section id='excluding-packages-from-an-image'> | ||
4906 | <title>Excluding Packages from an Image</title> | ||
4907 | |||
4908 | <para> | ||
4909 | You might find it necessary to prevent specific packages | ||
4910 | from being installed into an image. | ||
4911 | If so, you can use several variables to direct the build | ||
4912 | system to essentially ignore installing recommended packages | ||
4913 | or to not install a package at all. | ||
4914 | </para> | ||
4915 | |||
4916 | <para> | ||
4917 | The following list introduces variables you can use to | ||
4918 | prevent packages from being installed into your image. | ||
4919 | Each of these variables only works with IPK and RPM | ||
4920 | package types. | ||
4921 | Support for Debian packages does not exist. | ||
4922 | Also, you can use these variables from your | ||
4923 | <filename>local.conf</filename> file or attach them to a | ||
4924 | specific image recipe by using a recipe name override. | ||
4925 | For more detail on the variables, see the descriptions in the | ||
4926 | Yocto Project Reference Manual's glossary chapter. | ||
4927 | <itemizedlist> | ||
4928 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-BAD_RECOMMENDATIONS'><filename>BAD_RECOMMENDATIONS</filename></ulink>: | ||
4929 | Use this variable to specify "recommended-only" | ||
4930 | packages that you do not want installed. | ||
4931 | </para></listitem> | ||
4932 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-NO_RECOMMENDATIONS'><filename>NO_RECOMMENDATIONS</filename></ulink>: | ||
4933 | Use this variable to prevent all "recommended-only" | ||
4934 | packages from being installed. | ||
4935 | </para></listitem> | ||
4936 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_EXCLUDE'><filename>PACKAGE_EXCLUDE</filename></ulink>: | ||
4937 | Use this variable to prevent specific packages from | ||
4938 | being installed regardless of whether they are | ||
4939 | "recommended-only" or not. | ||
4940 | You need to realize that the build process could | ||
4941 | fail with an error when you | ||
4942 | prevent the installation of a package whose presence | ||
4943 | is required by an installed package. | ||
4944 | </para></listitem> | ||
4945 | </itemizedlist> | ||
4946 | </para> | ||
4947 | </section> | ||
4948 | |||
4949 | <section id='incrementing-a-package-revision-number'> | ||
4950 | <title>Incrementing a Package Revision Number</title> | ||
4951 | |||
4952 | <para> | ||
4953 | If a committed change results in changing the package output, | ||
4954 | then the value of the | ||
4955 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink> | ||
4956 | variable needs to be increased (or "bumped"). | ||
4957 | Increasing <filename>PR</filename> occurs one of two ways: | ||
4958 | <itemizedlist> | ||
4959 | <listitem><para>Automatically using a Package Revision | ||
4960 | Service (PR Service).</para></listitem> | ||
4961 | <listitem><para>Manually incrementing the | ||
4962 | <filename>PR</filename> variable.</para></listitem> | ||
4963 | </itemizedlist> | ||
4964 | </para> | ||
4965 | |||
4966 | <para> | ||
4967 | Given that one of the challenges any build system and its | ||
4968 | users face is how to maintain a package feed that is compatible | ||
4969 | with existing package manager applications such as | ||
4970 | RPM, APT, and OPKG, using an automated system is much | ||
4971 | preferred over a manual system. | ||
4972 | In either system, the main requirement is that version | ||
4973 | numbering increases in a linear fashion and that a number of | ||
4974 | version components exist that support that linear progression. | ||
4975 | </para> | ||
4976 | |||
4977 | <para> | ||
4978 | The following two sections provide information on the PR Service | ||
4979 | and on manual <filename>PR</filename> bumping. | ||
4980 | </para> | ||
4981 | |||
4982 | <section id='working-with-a-pr-service'> | ||
4983 | <title>Working With a PR Service</title> | ||
4984 | |||
4985 | <para> | ||
4986 | As mentioned, attempting to maintain revision numbers in the | ||
4987 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> | ||
4988 | is error prone, inaccurate, and causes problems for people | ||
4989 | submitting recipes. | ||
4990 | Conversely, the PR Service automatically generates | ||
4991 | increasing numbers, particularly the revision field, | ||
4992 | which removes the human element. | ||
4993 | <note> | ||
4994 | For additional information on using a PR Service, you | ||
4995 | can see the | ||
4996 | <ulink url='&YOCTO_WIKI_URL;/wiki/PR_Service'>PR Service</ulink> | ||
4997 | wiki page. | ||
4998 | </note> | ||
4999 | </para> | ||
5000 | |||
5001 | <para> | ||
5002 | The Yocto Project uses variables in order of | ||
5003 | decreasing priority to facilitate revision numbering (i.e. | ||
5004 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink>, | ||
5005 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>, and | ||
5006 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink> | ||
5007 | for epoch, version, and revision, respectively). | ||
5008 | The values are highly dependent on the policies and | ||
5009 | procedures of a given distribution and package feed. | ||
5010 | </para> | ||
5011 | |||
5012 | <para> | ||
5013 | Because the OpenEmbedded build system uses | ||
5014 | "<ulink url='&YOCTO_DOCS_REF_URL;#checksums'>signatures</ulink>", | ||
5015 | which are unique to a given build, the build system | ||
5016 | knows when to rebuild packages. | ||
5017 | All the inputs into a given task are represented by a | ||
5018 | signature, which can trigger a rebuild when different. | ||
5019 | Thus, the build system itself does not rely on the | ||
5020 | <filename>PR</filename> numbers to trigger a rebuild. | ||
5021 | The signatures, however, can be used to generate | ||
5022 | <filename>PR</filename> values. | ||
5023 | </para> | ||
5024 | |||
5025 | <para> | ||
5026 | The PR Service works with both | ||
5027 | <filename>OEBasic</filename> and | ||
5028 | <filename>OEBasicHash</filename> generators. | ||
5029 | The value of <filename>PR</filename> bumps when the | ||
5030 | checksum changes and the different generator mechanisms | ||
5031 | change signatures under different circumstances. | ||
5032 | </para> | ||
5033 | |||
5034 | <para> | ||
5035 | As implemented, the build system includes values from | ||
5036 | the PR Service into the <filename>PR</filename> field as | ||
5037 | an addition using the form "<filename>.x</filename>" so | ||
5038 | <filename>r0</filename> becomes <filename>r0.1</filename>, | ||
5039 | <filename>r0.2</filename> and so forth. | ||
5040 | This scheme allows existing <filename>PR</filename> values | ||
5041 | to be used for whatever reasons, which include manual | ||
5042 | <filename>PR</filename> bumps, should it be necessary. | ||
5043 | </para> | ||
5044 | |||
5045 | <para> | ||
5046 | By default, the PR Service is not enabled or running. | ||
5047 | Thus, the packages generated are just "self consistent". | ||
5048 | The build system adds and removes packages and | ||
5049 | there are no guarantees about upgrade paths but images | ||
5050 | will be consistent and correct with the latest changes. | ||
5051 | </para> | ||
5052 | |||
5053 | <para> | ||
5054 | The simplest form for a PR Service is for it to exist | ||
5055 | for a single host development system that builds the | ||
5056 | package feed (building system). | ||
5057 | For this scenario, you can enable a local PR Service by | ||
5058 | setting | ||
5059 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PRSERV_HOST'><filename>PRSERV_HOST</filename></ulink> | ||
5060 | in your <filename>local.conf</filename> file in the | ||
5061 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>: | ||
5062 | <literallayout class='monospaced'> | ||
5063 | PRSERV_HOST = "localhost:0" | ||
5064 | </literallayout> | ||
5065 | Once the service is started, packages will automatically | ||
5066 | get increasing <filename>PR</filename> values and | ||
5067 | BitBake will take care of starting and stopping the server. | ||
5068 | </para> | ||
5069 | |||
5070 | <para> | ||
5071 | If you have a more complex setup where multiple host | ||
5072 | development systems work against a common, shared package | ||
5073 | feed, you have a single PR Service running and it is | ||
5074 | connected to each building system. | ||
5075 | For this scenario, you need to start the PR Service using | ||
5076 | the <filename>bitbake-prserv</filename> command: | ||
5077 | <literallayout class='monospaced'> | ||
5078 | bitbake-prserv ‐‐host <ip> ‐‐port <port> ‐‐start | ||
5079 | </literallayout> | ||
5080 | In addition to hand-starting the service, you need to | ||
5081 | update the <filename>local.conf</filename> file of each | ||
5082 | building system as described earlier so each system | ||
5083 | points to the server and port. | ||
5084 | </para> | ||
5085 | |||
5086 | <para> | ||
5087 | It is also recommended you use build history, which adds | ||
5088 | some sanity checks to package versions, in conjunction with | ||
5089 | the server that is running the PR Service. | ||
5090 | To enable build history, add the following to each building | ||
5091 | system's <filename>local.conf</filename> file: | ||
5092 | <literallayout class='monospaced'> | ||
5093 | # It is recommended to activate "buildhistory" for testing the PR service | ||
5094 | INHERIT += "buildhistory" | ||
5095 | BUILDHISTORY_COMMIT = "1" | ||
5096 | </literallayout> | ||
5097 | For information on build history, see the | ||
5098 | "<ulink url='&YOCTO_DOCS_REF_URL;#maintaining-build-output-quality'>Maintaining Build Output Quality</ulink>" | ||
5099 | section in the Yocto Project Reference Manual. | ||
5100 | </para> | ||
5101 | |||
5102 | <note> | ||
5103 | <para>The OpenEmbedded build system does not maintain | ||
5104 | <filename>PR</filename> information as part of the | ||
5105 | shared state (sstate) packages. | ||
5106 | If you maintain an sstate feed, its expected that either | ||
5107 | all your building systems that contribute to the sstate | ||
5108 | feed use a shared PR Service, or you do not run a PR | ||
5109 | Service on any of your building systems. | ||
5110 | Having some systems use a PR Service while others do | ||
5111 | not leads to obvious problems.</para> | ||
5112 | <para>For more information on shared state, see the | ||
5113 | "<ulink url='&YOCTO_DOCS_REF_URL;#shared-state-cache'>Shared State Cache</ulink>" | ||
5114 | section in the Yocto Project Reference Manual.</para> | ||
5115 | </note> | ||
5116 | </section> | ||
5117 | |||
5118 | <section id='manually-bumping-pr'> | ||
5119 | <title>Manually Bumping PR</title> | ||
5120 | |||
5121 | <para> | ||
5122 | The alternative to setting up a PR Service is to manually | ||
5123 | bump the | ||
5124 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink> | ||
5125 | variable. | ||
5126 | </para> | ||
5127 | |||
5128 | <para> | ||
5129 | If a committed change results in changing the package output, | ||
5130 | then the value of the PR variable needs to be increased | ||
5131 | (or "bumped") as part of that commit. | ||
5132 | For new recipes you should add the <filename>PR</filename> | ||
5133 | variable and set its initial value equal to "r0", which is the default. | ||
5134 | Even though the default value is "r0", the practice of adding it to a new recipe makes | ||
5135 | it harder to forget to bump the variable when you make changes | ||
5136 | to the recipe in future. | ||
5137 | </para> | ||
5138 | |||
5139 | <para> | ||
5140 | If you are sharing a common <filename>.inc</filename> file with multiple recipes, | ||
5141 | you can also use the | ||
5142 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-INC_PR'>INC_PR</ulink></filename> | ||
5143 | variable to ensure that | ||
5144 | the recipes sharing the <filename>.inc</filename> file are rebuilt when the | ||
5145 | <filename>.inc</filename> file itself is changed. | ||
5146 | The <filename>.inc</filename> file must set <filename>INC_PR</filename> | ||
5147 | (initially to "r0"), and all recipes referring to it should set <filename>PR</filename> | ||
5148 | to "$(INC_PR).0" initially, incrementing the last number when the recipe is changed. | ||
5149 | If the <filename>.inc</filename> file is changed then its | ||
5150 | <filename>INC_PR</filename> should be incremented. | ||
5151 | </para> | ||
5152 | |||
5153 | <para> | ||
5154 | When upgrading the version of a package, assuming the | ||
5155 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'>PV</ulink></filename> | ||
5156 | changes, the <filename>PR</filename> variable should be | ||
5157 | reset to "r0" (or "$(INC_PR).0" if you are using | ||
5158 | <filename>INC_PR</filename>). | ||
5159 | </para> | ||
5160 | |||
5161 | <para> | ||
5162 | Usually, version increases occur only to packages. | ||
5163 | However, if for some reason <filename>PV</filename> changes but does not | ||
5164 | increase, you can increase the | ||
5165 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PE'>PE</ulink></filename> | ||
5166 | variable (Package Epoch). | ||
5167 | The <filename>PE</filename> variable defaults to "0". | ||
5168 | </para> | ||
5169 | |||
5170 | <para> | ||
5171 | Version numbering strives to follow the | ||
5172 | <ulink url='http://www.debian.org/doc/debian-policy/ch-controlfields.html'> | ||
5173 | Debian Version Field Policy Guidelines</ulink>. | ||
5174 | These guidelines define how versions are compared and what "increasing" a version means. | ||
5175 | </para> | ||
5176 | </section> | ||
5177 | </section> | ||
5178 | |||
5179 | <section id="usingpoky-configuring-DISTRO_PN_ALIAS"> | ||
5180 | <title>Handling a Package Name Alias</title> | ||
5181 | <para> | ||
5182 | Sometimes a package name you are using might exist under | ||
5183 | an alias or as a similarly named package in a different | ||
5184 | distribution. | ||
5185 | The OpenEmbedded build system implements a | ||
5186 | <filename>do_distro_check</filename> | ||
5187 | task that automatically connects to major distributions | ||
5188 | and checks for these situations. | ||
5189 | If the package exists under a different name in a different | ||
5190 | distribution, you get a <filename>distro_check</filename> | ||
5191 | mismatch. | ||
5192 | You can resolve this problem by defining a per-distro recipe | ||
5193 | name alias using the | ||
5194 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_PN_ALIAS'>DISTRO_PN_ALIAS</ulink></filename> | ||
5195 | variable. | ||
5196 | </para> | ||
5197 | |||
5198 | <para> | ||
5199 | Following is an example that shows how you specify the <filename>DISTRO_PN_ALIAS</filename> | ||
5200 | variable: | ||
5201 | <literallayout class='monospaced'> | ||
5202 | DISTRO_PN_ALIAS_pn-PACKAGENAME = "distro1=package_name_alias1 \ | ||
5203 | distro2=package_name_alias2 \ | ||
5204 | distro3=package_name_alias3 \ | ||
5205 | ..." | ||
5206 | </literallayout> | ||
5207 | </para> | ||
5208 | |||
5209 | <para> | ||
5210 | If you have more than one distribution alias, separate them with a space. | ||
5211 | Note that the build system currently automatically checks the | ||
5212 | Fedora, OpenSUSE, Debian, Ubuntu, | ||
5213 | and Mandriva distributions for source package recipes without having to specify them | ||
5214 | using the <filename>DISTRO_PN_ALIAS</filename> variable. | ||
5215 | For example, the following command generates a report that lists the Linux distributions | ||
5216 | that include the sources for each of the recipes. | ||
5217 | <literallayout class='monospaced'> | ||
5218 | $ bitbake world -f -c distro_check | ||
5219 | </literallayout> | ||
5220 | The results are stored in the <filename>build/tmp/log/distro_check-${DATETIME}.results</filename> | ||
5221 | file found in the | ||
5222 | <link linkend='source-directory'>Source Directory</link>. | ||
5223 | </para> | ||
5224 | </section> | ||
5225 | |||
5226 | <section id='handling-optional-module-packaging'> | ||
5227 | <title>Handling Optional Module Packaging</title> | ||
5228 | |||
5229 | <para> | ||
5230 | Many pieces of software split functionality into optional | ||
5231 | modules (or plug-ins) and the plug-ins that are built | ||
5232 | might depend on configuration options. | ||
5233 | To avoid having to duplicate the logic that determines what | ||
5234 | modules are available in your recipe or to avoid having | ||
5235 | to package each module by hand, the OpenEmbedded build system | ||
5236 | provides functionality to handle module packaging dynamically. | ||
5237 | </para> | ||
5238 | |||
5239 | <para> | ||
5240 | To handle optional module packaging, you need to do two things: | ||
5241 | <itemizedlist> | ||
5242 | <listitem><para>Ensure the module packaging is actually | ||
5243 | done.</para></listitem> | ||
5244 | <listitem><para>Ensure that any dependencies on optional | ||
5245 | modules from other recipes are satisfied by your recipe. | ||
5246 | </para></listitem> | ||
5247 | </itemizedlist> | ||
5248 | </para> | ||
5249 | |||
5250 | <section id='making-sure-the-packaging-is-done'> | ||
5251 | <title>Making Sure the Packaging is Done</title> | ||
5252 | |||
5253 | <para> | ||
5254 | To ensure the module packaging actually gets done, you use | ||
5255 | the <filename>do_split_packages</filename> function within | ||
5256 | the <filename>populate_packages</filename> Python function | ||
5257 | in your recipe. | ||
5258 | The <filename>do_split_packages</filename> function | ||
5259 | searches for a pattern of files or directories under a | ||
5260 | specified path and creates a package for each one it finds | ||
5261 | by appending to the | ||
5262 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'><filename>PACKAGES</filename></ulink> | ||
5263 | variable and setting the appropriate values for | ||
5264 | <filename>FILES_packagename</filename>, | ||
5265 | <filename>RDEPENDS_packagename</filename>, | ||
5266 | <filename>DESCRIPTION_packagename</filename>, and so forth. | ||
5267 | Here is an example from the <filename>lighttpd</filename> | ||
5268 | recipe: | ||
5269 | <literallayout class='monospaced'> | ||
5270 | python populate_packages_prepend () { | ||
5271 | lighttpd_libdir = d.expand('${libdir}') | ||
5272 | do_split_packages(d, lighttpd_libdir, '^mod_(.*)\.so$', | ||
5273 | 'lighttpd-module-%s', 'Lighttpd module for %s', | ||
5274 | extra_depends='') | ||
5275 | } | ||
5276 | </literallayout> | ||
5277 | The previous example specifies a number of things in the | ||
5278 | call to <filename>do_split_packages</filename>. | ||
5279 | <itemizedlist> | ||
5280 | <listitem><para>A directory within the files installed | ||
5281 | by your recipe through <filename>do_install</filename> | ||
5282 | in which to search.</para></listitem> | ||
5283 | <listitem><para>A regular expression used to match module | ||
5284 | files in that directory. | ||
5285 | In the example, note the parentheses () that mark | ||
5286 | the part of the expression from which the module | ||
5287 | name should be derived.</para></listitem> | ||
5288 | <listitem><para>A pattern to use for the package names. | ||
5289 | </para></listitem> | ||
5290 | <listitem><para>A description for each package. | ||
5291 | </para></listitem> | ||
5292 | <listitem><para>An empty string for | ||
5293 | <filename>extra_depends</filename>, which disables | ||
5294 | the default dependency on the main | ||
5295 | <filename>lighttpd</filename> package. | ||
5296 | Thus, if a file in <filename>${libdir}</filename> | ||
5297 | called <filename>mod_alias.so</filename> is found, | ||
5298 | a package called <filename>lighttpd-module-alias</filename> | ||
5299 | is created for it and the | ||
5300 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DESCRIPTION'><filename>DESCRIPTION</filename></ulink> | ||
5301 | is set to "Lighttpd module for alias".</para></listitem> | ||
5302 | </itemizedlist> | ||
5303 | </para> | ||
5304 | |||
5305 | <para> | ||
5306 | Often, packaging modules is as simple as the previous | ||
5307 | example. | ||
5308 | However, more advanced options exist that you can use | ||
5309 | within <filename>do_split_packages</filename> to modify its | ||
5310 | behavior. | ||
5311 | And, if you need to, you can add more logic by specifying | ||
5312 | a hook function that is called for each package. | ||
5313 | It is also perfectly acceptable to call | ||
5314 | <filename>do_split_packages</filename> multiple times if | ||
5315 | you have more than one set of modules to package. | ||
5316 | </para> | ||
5317 | |||
5318 | <para> | ||
5319 | For more examples that show how to use | ||
5320 | <filename>do_split_packages</filename>, see the | ||
5321 | <filename>connman.inc</filename> file in the | ||
5322 | <filename>meta/recipes-connectivity/connman/</filename> | ||
5323 | directory of the <filename>poky</filename> | ||
5324 | <link linkend='yocto-project-repositories'>source repository</link>. | ||
5325 | You can also find examples in | ||
5326 | <filename>meta/classes/kernel.bbclass</filename>. | ||
5327 | </para> | ||
5328 | |||
5329 | <para> | ||
5330 | Following is a reference that shows | ||
5331 | <filename>do_split_packages</filename> mandatory and | ||
5332 | optional arguments: | ||
5333 | <literallayout class='monospaced'> | ||
5334 | Mandatory arguments | ||
5335 | |||
5336 | root | ||
5337 | The path in which to search | ||
5338 | file_regex | ||
5339 | Regular expression to match searched files. | ||
5340 | Use parentheses () to mark the part of this | ||
5341 | expression that should be used to derive the | ||
5342 | module name (to be substituted where %s is | ||
5343 | used in other function arguments as noted below) | ||
5344 | output_pattern | ||
5345 | Pattern to use for the package names. Must | ||
5346 | include %s. | ||
5347 | description | ||
5348 | Description to set for each package. Must | ||
5349 | include %s. | ||
5350 | |||
5351 | Optional arguments | ||
5352 | |||
5353 | postinst | ||
5354 | Postinstall script to use for all packages | ||
5355 | (as a string) | ||
5356 | recursive | ||
5357 | True to perform a recursive search - default | ||
5358 | False | ||
5359 | hook | ||
5360 | A hook function to be called for every match. | ||
5361 | The function will be called with the following | ||
5362 | arguments (in the order listed): | ||
5363 | |||
5364 | f | ||
5365 | Full path to the file/directory match | ||
5366 | pkg | ||
5367 | The package name | ||
5368 | file_regex | ||
5369 | As above | ||
5370 | output_pattern | ||
5371 | As above | ||
5372 | modulename | ||
5373 | The module name derived using file_regex | ||
5374 | |||
5375 | extra_depends | ||
5376 | Extra runtime dependencies (RDEPENDS) to be | ||
5377 | set for all packages. The default value of None | ||
5378 | causes a dependency on the main package | ||
5379 | (${PN}) - if you do not want this, pass empty | ||
5380 | string '' for this parameter. | ||
5381 | aux_files_pattern | ||
5382 | Extra item(s) to be added to FILES for each | ||
5383 | package. Can be a single string item or a list | ||
5384 | of strings for multiple items. Must include %s. | ||
5385 | postrm | ||
5386 | postrm script to use for all packages (as a | ||
5387 | string) | ||
5388 | allow_dirs | ||
5389 | True to allow directories to be matched - | ||
5390 | default False | ||
5391 | prepend | ||
5392 | If True, prepend created packages to PACKAGES | ||
5393 | instead of the default False which appends them | ||
5394 | match_path | ||
5395 | match file_regex on the whole relative path to | ||
5396 | the root rather than just the file name | ||
5397 | aux_files_pattern_verbatim | ||
5398 | Extra item(s) to be added to FILES for each | ||
5399 | package, using the actual derived module name | ||
5400 | rather than converting it to something legal | ||
5401 | for a package name. Can be a single string item | ||
5402 | or a list of strings for multiple items. Must | ||
5403 | include %s. | ||
5404 | allow_links | ||
5405 | True to allow symlinks to be matched - default | ||
5406 | False | ||
5407 | summary | ||
5408 | Summary to set for each package. Must include %s; | ||
5409 | defaults to description if not set. | ||
5410 | </literallayout> | ||
5411 | </para> | ||
5412 | </section> | ||
5413 | |||
5414 | <section id='satisfying-dependencies'> | ||
5415 | <title>Satisfying Dependencies</title> | ||
5416 | |||
5417 | <para> | ||
5418 | The second part for handling optional module packaging | ||
5419 | is to ensure that any dependencies on optional modules | ||
5420 | from other recipes are satisfied by your recipe. | ||
5421 | You can be sure these dependencies are satisfied by | ||
5422 | using the | ||
5423 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES_DYNAMIC'><filename>PACKAGES_DYNAMIC</filename></ulink> variable. | ||
5424 | Here is an example that continues with the | ||
5425 | <filename>lighttpd</filename> recipe shown earlier: | ||
5426 | <literallayout class='monospaced'> | ||
5427 | PACKAGES_DYNAMIC = "lighttpd-module-.*" | ||
5428 | </literallayout> | ||
5429 | The name specified in the regular expression can of | ||
5430 | course be anything. | ||
5431 | In this example, it is <filename>lighttpd-module-</filename> | ||
5432 | and is specified as the prefix to ensure that any | ||
5433 | <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink> | ||
5434 | and <ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'><filename>RRECOMMENDS</filename></ulink> | ||
5435 | on a package name starting with the prefix are satisfied | ||
5436 | during build time. | ||
5437 | If you are using <filename>do_split_packages</filename> | ||
5438 | as described in the previous section, the value you put in | ||
5439 | <filename>PACKAGES_DYNAMIC</filename> should correspond to | ||
5440 | the name pattern specified in the call to | ||
5441 | <filename>do_split_packages</filename>. | ||
5442 | </para> | ||
5443 | </section> | ||
5444 | </section> | ||
5445 | |||
5446 | <section id='using-runtime-package-management'> | ||
5447 | <title>Using Runtime Package Management</title> | ||
5448 | |||
5449 | <para> | ||
5450 | During a build, BitBake always transforms a recipe into one or | ||
5451 | more packages. | ||
5452 | For example, BitBake takes the <filename>bash</filename> recipe | ||
5453 | and currently produces the <filename>bash-dbg</filename>, | ||
5454 | <filename>bash-staticdev</filename>, | ||
5455 | <filename>bash-dev</filename>, <filename>bash-doc</filename>, | ||
5456 | <filename>bash-locale</filename>, and | ||
5457 | <filename>bash</filename> packages. | ||
5458 | Not all generated packages are included in an image. | ||
5459 | </para> | ||
5460 | |||
5461 | <para> | ||
5462 | In several situations, you might need to update, add, remove, | ||
5463 | or query the packages on a target device at runtime | ||
5464 | (i.e. without having to generate a new image). | ||
5465 | Examples of such situations include: | ||
5466 | <itemizedlist> | ||
5467 | <listitem><para> | ||
5468 | You want to provide in-the-field updates to deployed | ||
5469 | devices (e.g. security updates). | ||
5470 | </para></listitem> | ||
5471 | <listitem><para> | ||
5472 | You want to have a fast turn-around development cycle | ||
5473 | for one or more applications that run on your device. | ||
5474 | </para></listitem> | ||
5475 | <listitem><para> | ||
5476 | You want to temporarily install the "debug" packages | ||
5477 | of various applications on your device so that | ||
5478 | debugging can be greatly improved by allowing | ||
5479 | access to symbols and source debugging. | ||
5480 | </para></listitem> | ||
5481 | <listitem><para> | ||
5482 | You want to deploy a more minimal package selection of | ||
5483 | your device but allow in-the-field updates to add a | ||
5484 | larger selection for customization. | ||
5485 | </para></listitem> | ||
5486 | </itemizedlist> | ||
5487 | </para> | ||
5488 | |||
5489 | <para> | ||
5490 | In all these situations, you have something similar to a more | ||
5491 | traditional Linux distribution in that in-field devices | ||
5492 | are able to receive pre-compiled packages from a server for | ||
5493 | installation or update. | ||
5494 | Being able to install these packages on a running, | ||
5495 | in-field device is what is termed "runtime package | ||
5496 | management". | ||
5497 | </para> | ||
5498 | |||
5499 | <para> | ||
5500 | In order to use runtime package management, you | ||
5501 | need a host/server machine that serves up the pre-compiled | ||
5502 | packages plus the required metadata. | ||
5503 | You also need package manipulation tools on the target. | ||
5504 | The build machine is a likely candidate to act as the server. | ||
5505 | However, that machine does not necessarily have to be the | ||
5506 | package server. | ||
5507 | The build machine could push its artifacts to another machine | ||
5508 | that acts as the server (e.g. Internet-facing). | ||
5509 | </para> | ||
5510 | |||
5511 | <para> | ||
5512 | A simple build that targets just one device produces | ||
5513 | more than one package database. | ||
5514 | In other words, the packages produced by a build are separated | ||
5515 | out into a couple of different package groupings based on | ||
5516 | criteria such as the target's CPU architecture, the target | ||
5517 | board, or the C library used on the target. | ||
5518 | For example, a build targeting the <filename>qemuarm</filename> | ||
5519 | device produces the following three package databases: | ||
5520 | <filename>all</filename>, <filename>armv5te</filename>, and | ||
5521 | <filename>qemuarm</filename>. | ||
5522 | If you wanted your <filename>qemuarm</filename> device to be | ||
5523 | aware of all the packages that were available to it, | ||
5524 | you would need to point it to each of these databases | ||
5525 | individually. | ||
5526 | In a similar way, a traditional Linux distribution usually is | ||
5527 | configured to be aware of a number of software repositories | ||
5528 | from which it retrieves packages. | ||
5529 | </para> | ||
5530 | |||
5531 | <para> | ||
5532 | Using runtime package management is completely optional and | ||
5533 | not required for a successful build or deployment in any | ||
5534 | way. | ||
5535 | But if you want to make use of runtime package management, | ||
5536 | you need to do a couple things above and beyond the basics. | ||
5537 | The remainder of this section describes what you need to do. | ||
5538 | </para> | ||
5539 | |||
5540 | <section id='runtime-package-management-build'> | ||
5541 | <title>Build Considerations</title> | ||
5542 | |||
5543 | <para> | ||
5544 | This section describes build considerations that you need | ||
5545 | to be aware of in order to provide support for runtime | ||
5546 | package management. | ||
5547 | </para> | ||
5548 | |||
5549 | <para> | ||
5550 | When BitBake generates packages it needs to know | ||
5551 | what format or formats to use. | ||
5552 | In your configuration, you use the | ||
5553 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink> | ||
5554 | variable to specify the format. | ||
5555 | <note> | ||
5556 | You can choose to have more than one format but you must | ||
5557 | provide at least one. | ||
5558 | </note> | ||
5559 | </para> | ||
5560 | |||
5561 | <para> | ||
5562 | If you would like your image to start off with a basic | ||
5563 | package database of the packages in your current build | ||
5564 | as well as have the relevant tools available on the | ||
5565 | target for runtime package management, you can include | ||
5566 | "package-management" in the | ||
5567 | <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink> | ||
5568 | variable. | ||
5569 | Including "package-management" in this | ||
5570 | configuration variable ensures that when the image | ||
5571 | is assembled for your target, the image includes | ||
5572 | the currently-known package databases as well as | ||
5573 | the target-specific tools required for runtime | ||
5574 | package management to be performed on the target. | ||
5575 | However, this is not strictly necessary. | ||
5576 | You could start your image off without any databases | ||
5577 | but only include the required on-target package | ||
5578 | tool(s). | ||
5579 | As an example, you could include "opkg" in your | ||
5580 | <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink> | ||
5581 | variable if you are using the IPK package format. | ||
5582 | You can then initialize your target's package database(s) | ||
5583 | later once your image is up and running. | ||
5584 | </para> | ||
5585 | |||
5586 | <para> | ||
5587 | Whenever you perform any sort of build step that can | ||
5588 | potentially generate a package or modify an existing | ||
5589 | package, it is always a good idea to re-generate the | ||
5590 | package index with: | ||
5591 | <literallayout class='monospaced'> | ||
5592 | $ bitbake package-index | ||
5593 | </literallayout> | ||
5594 | Realize that it is not sufficient to simply do the | ||
5595 | following: | ||
5596 | <literallayout class='monospaced'> | ||
5597 | $ bitbake <some-package> package-index | ||
5598 | </literallayout> | ||
5599 | This is because BitBake does not properly schedule the | ||
5600 | <filename>package-index</filename> target fully after any | ||
5601 | other target has completed. | ||
5602 | Thus, be sure to run the package update step separately. | ||
5603 | </para> | ||
5604 | |||
5605 | <para> | ||
5606 | As described below in the | ||
5607 | "<link linkend='runtime-package-management-target-ipk'>Using IPK</link>" | ||
5608 | section, if you are using IPK as your package format, you | ||
5609 | can make use of the | ||
5610 | <filename>distro-feed-configs</filename> recipe provided | ||
5611 | by <filename>meta-oe</filename> in order to configure your | ||
5612 | target to use your IPK databases. | ||
5613 | </para> | ||
5614 | |||
5615 | <para> | ||
5616 | When your build is complete, your packages reside in the | ||
5617 | <filename>${TMPDIR}/deploy/<package-format></filename> | ||
5618 | directory. | ||
5619 | For example, if <filename>${TMPDIR}</filename> | ||
5620 | is <filename>tmp</filename> and your selected package type | ||
5621 | is IPK, then your IPK packages are available in | ||
5622 | <filename>tmp/deploy/ipk</filename>. | ||
5623 | </para> | ||
5624 | </section> | ||
5625 | |||
5626 | <section id='runtime-package-management-server'> | ||
5627 | <title>Host or Server Machine Setup</title> | ||
5628 | |||
5629 | <para> | ||
5630 | Typically, packages are served from a server using | ||
5631 | HTTP. | ||
5632 | However, other protocols are possible. | ||
5633 | If you want to use HTTP, then setup and configure a | ||
5634 | web server, such as Apache 2 or lighttpd, on the machine | ||
5635 | serving the packages. | ||
5636 | </para> | ||
5637 | |||
5638 | <para> | ||
5639 | As previously mentioned, the build machine can act as the | ||
5640 | package server. | ||
5641 | In the following sections that describe server machine | ||
5642 | setups, the build machine is assumed to also be the server. | ||
5643 | </para> | ||
5644 | |||
5645 | <section id='package-server-apache'> | ||
5646 | <title>Serving Packages via Apache 2</title> | ||
5647 | |||
5648 | <para> | ||
5649 | This example assumes you are using the Apache 2 | ||
5650 | server: | ||
5651 | <orderedlist> | ||
5652 | <listitem><para> | ||
5653 | Add the directory to your Apache | ||
5654 | configuration, which you can find at | ||
5655 | <filename>/etc/httpd/conf/httpd.conf</filename>. | ||
5656 | Use commands similar to these on the | ||
5657 | development system. | ||
5658 | These example commands assume a top-level | ||
5659 | <link linkend='source-directory'>Source Directory</link> | ||
5660 | named <filename>poky</filename> in your home | ||
5661 | directory. | ||
5662 | The example also assumes an RPM package type. | ||
5663 | If you are using a different package type, such | ||
5664 | as IPK, use "ipk" in the pathnames: | ||
5665 | <literallayout class='monospaced'> | ||
5666 | <VirtualHost *:80> | ||
5667 | .... | ||
5668 | Alias /rpm ~/poky/build/tmp/deploy/rpm | ||
5669 | <Directory "~/poky/build/tmp/deploy/rpm"> | ||
5670 | Options +Indexes | ||
5671 | </Directory> | ||
5672 | </VirtualHost> | ||
5673 | </literallayout></para></listitem> | ||
5674 | <listitem><para> | ||
5675 | Reload the Apache configuration as described | ||
5676 | in this step. | ||
5677 | For all commands, be sure you have root | ||
5678 | privileges. | ||
5679 | </para> | ||
5680 | |||
5681 | <para> | ||
5682 | If your development system is using Fedora or | ||
5683 | CentOS, use the following: | ||
5684 | <literallayout class='monospaced'> | ||
5685 | # service httpd reload | ||
5686 | </literallayout> | ||
5687 | For Ubuntu and Debian, use the following: | ||
5688 | <literallayout class='monospaced'> | ||
5689 | # /etc/init.d/apache2 reload | ||
5690 | </literallayout> | ||
5691 | For OpenSUSE, use the following: | ||
5692 | <literallayout class='monospaced'> | ||
5693 | # /etc/init.d/apache2 reload | ||
5694 | </literallayout></para></listitem> | ||
5695 | <listitem><para> | ||
5696 | If you are using Security-Enhanced Linux | ||
5697 | (SELinux), you need to label the files as | ||
5698 | being accessible through Apache. | ||
5699 | Use the following command from the development | ||
5700 | host. | ||
5701 | This example assumes RPM package types: | ||
5702 | <literallayout class='monospaced'> | ||
5703 | # chcon -R -h -t httpd_sys_content_t tmp/deploy/rpm | ||
5704 | </literallayout></para></listitem> | ||
5705 | </orderedlist> | ||
5706 | </para> | ||
5707 | </section> | ||
5708 | |||
5709 | <section id='package-server-lighttpd'> | ||
5710 | <title>Serving Packages via lighttpd</title> | ||
5711 | |||
5712 | <para> | ||
5713 | If you are using lighttpd, all you need | ||
5714 | to do is to provide a link from your | ||
5715 | <filename>${TMPDIR}/deploy/<package-format></filename> | ||
5716 | directory to lighttpd's document-root. | ||
5717 | You can determine the specifics of your lighttpd | ||
5718 | installation by looking through its configuration file, | ||
5719 | which is usually found at: | ||
5720 | <filename>/etc/lighttpd/lighttpd.conf</filename>. | ||
5721 | </para> | ||
5722 | |||
5723 | <para> | ||
5724 | For example, if you are using IPK, lighttpd's | ||
5725 | document-root is set to | ||
5726 | <filename>/var/www/lighttpd</filename>, and you had | ||
5727 | packages for a target named "BOARD", | ||
5728 | then you might create a link from your build location | ||
5729 | to lighttpd's document-root as follows: | ||
5730 | <literallayout class='monospaced'> | ||
5731 | # ln -s $(PWD)/tmp/deploy/ipk /var/www/lighttpd/BOARD-dir | ||
5732 | </literallayout> | ||
5733 | </para> | ||
5734 | |||
5735 | <para> | ||
5736 | At this point, you need to start the lighttpd server. | ||
5737 | The method used to start the server varies by | ||
5738 | distribution. | ||
5739 | However, one basic method that starts it by hand is: | ||
5740 | <literallayout class='monospaced'> | ||
5741 | # lighttpd -f /etc/lighttpd/lighttpd.conf | ||
5742 | </literallayout> | ||
5743 | </para> | ||
5744 | </section> | ||
5745 | </section> | ||
5746 | |||
5747 | <section id='runtime-package-management-target'> | ||
5748 | <title>Target Setup</title> | ||
5749 | |||
5750 | <para> | ||
5751 | Setting up the target differs depending on the | ||
5752 | package management system. | ||
5753 | This section provides information for RPM and IPK. | ||
5754 | </para> | ||
5755 | |||
5756 | <section id='runtime-package-management-target-rpm'> | ||
5757 | <title>Using RPM</title> | ||
5758 | |||
5759 | <para> | ||
5760 | The application for performing runtime package | ||
5761 | management of RPM packages on the target is called | ||
5762 | <filename>smart</filename>. | ||
5763 | </para> | ||
5764 | |||
5765 | <para> | ||
5766 | On the target machine, you need to inform | ||
5767 | <filename>smart</filename> of every package database | ||
5768 | you want to use. | ||
5769 | As an example, suppose your target device can use the | ||
5770 | following three package databases from a server named | ||
5771 | <filename>server.name</filename>: | ||
5772 | <filename>all</filename>, <filename>i586</filename>, | ||
5773 | and <filename>qemux86</filename>. | ||
5774 | Given this example, issue the following commands on the | ||
5775 | target: | ||
5776 | <literallayout class='monospaced'> | ||
5777 | # smart channel --add all type=rpm-md baseurl=http://server.name/rpm/all | ||
5778 | # smart channel --add i585 type=rpm-md baseurl=http://server.name/rpm/i586 | ||
5779 | # smart channel --add qemux86 type=rpm-md baseurl=http://server.name/rpm/qemux86 | ||
5780 | </literallayout> | ||
5781 | Also from the target machine, fetch the repository | ||
5782 | information using this command: | ||
5783 | <literallayout class='monospaced'> | ||
5784 | # smart update | ||
5785 | </literallayout> | ||
5786 | You can now use the <filename>smart query</filename> | ||
5787 | and <filename>smart install</filename> commands to | ||
5788 | find and install packages from the repositories. | ||
5789 | </para> | ||
5790 | </section> | ||
5791 | |||
5792 | <section id='runtime-package-management-target-ipk'> | ||
5793 | <title>Using IPK</title> | ||
5794 | |||
5795 | <para> | ||
5796 | The application for performing runtime package | ||
5797 | management of IPK packages on the target is called | ||
5798 | <filename>opkg</filename>. | ||
5799 | </para> | ||
5800 | |||
5801 | <para> | ||
5802 | In order to inform <filename>opkg</filename> of the | ||
5803 | package databases you want to use, simply create one | ||
5804 | or more <filename>*.conf</filename> files in the | ||
5805 | <filename>/etc/opkg</filename> directory on the target. | ||
5806 | The <filename>opkg</filename> application uses them | ||
5807 | to find its available package databases. | ||
5808 | As an example, suppose you configured your HTTP server | ||
5809 | on your machine named | ||
5810 | <filename>www.mysite.com</filename> to serve files | ||
5811 | from a <filename>BOARD-dir</filename> directory under | ||
5812 | its document-root. | ||
5813 | In this case, you might create a configuration | ||
5814 | file on the target called | ||
5815 | <filename>/etc/opkg/base-feeds.conf</filename> that | ||
5816 | contains: | ||
5817 | <literallayout class='monospaced'> | ||
5818 | src/gz all http://www.mysite.com/BOARD-dir/all | ||
5819 | src/gz armv7a http://www.mysite.com/BOARD-dir/armv7a | ||
5820 | src/gz beaglebone http://www.mysite.com/BOARD-dir/beaglebone | ||
5821 | </literallayout> | ||
5822 | </para> | ||
5823 | |||
5824 | <para> | ||
5825 | As a way of making it easier to generate and make | ||
5826 | these IPK configuration files available on your | ||
5827 | target, simply define | ||
5828 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FEED_DEPLOYDIR_BASE_URI'><filename>FEED_DEPLOYDIR_BASE_URI</filename></ulink> | ||
5829 | to point to your server and the location within the | ||
5830 | document-root which contains the databases. | ||
5831 | For example: if you are serving your packages over | ||
5832 | HTTP, your server's IP address is 192.168.7.1, and | ||
5833 | your databases are located in a directory called | ||
5834 | <filename>BOARD-dir</filename> underneath your HTTP | ||
5835 | server's document-root, you need to set | ||
5836 | <filename>FEED_DEPLOYDIR_BASE_URI</filename> to | ||
5837 | <filename>http://192.168.7.1/BOARD-dir</filename> and | ||
5838 | a set of configuration files will be generated for you | ||
5839 | in your target to work with this feed. | ||
5840 | </para> | ||
5841 | |||
5842 | <para> | ||
5843 | On the target machine, fetch (or refresh) the | ||
5844 | repository information using this command: | ||
5845 | <literallayout class='monospaced'> | ||
5846 | # opkg update | ||
5847 | </literallayout> | ||
5848 | You can now use the <filename>opkg list</filename> and | ||
5849 | <filename>opkg install</filename> commands to find and | ||
5850 | install packages from the repositories. | ||
5851 | </para> | ||
5852 | </section> | ||
5853 | </section> | ||
5854 | </section> | ||
5855 | |||
5856 | <section id='testing-packages-with-ptest'> | ||
5857 | <title>Testing Packages With ptest</title> | ||
5858 | |||
5859 | <para> | ||
5860 | A Package Test (ptest) runs tests against packages built | ||
5861 | by the OpenEmbedded build system on the target machine. | ||
5862 | A ptest contains at least two items: the actual test, and | ||
5863 | a shell script (<filename>run-ptest</filename>) that starts | ||
5864 | the test. | ||
5865 | The shell script that starts the test must not contain | ||
5866 | the actual test, the script only starts it. | ||
5867 | On the other hand, the test can be anything from a simple | ||
5868 | shell script that runs a binary and checks the output to | ||
5869 | an elaborate system of test binaries and data files. | ||
5870 | </para> | ||
5871 | |||
5872 | <para> | ||
5873 | The test generates output in the format used by | ||
5874 | Automake: | ||
5875 | <literallayout class='monospaced'> | ||
5876 | <result>: <testname> | ||
5877 | </literallayout> | ||
5878 | where the result can be <filename>PASS</filename>, | ||
5879 | <filename>FAIL</filename>, or <filename>SKIP</filename>, | ||
5880 | and the testname can be any identifying string. | ||
5881 | </para> | ||
5882 | |||
5883 | <note> | ||
5884 | A recipe is "ptest-enabled" if it inherits the | ||
5885 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-ptest'><filename>ptest</filename></ulink> | ||
5886 | class. | ||
5887 | </note> | ||
5888 | |||
5889 | <section id='adding-ptest-to-your-build'> | ||
5890 | <title>Adding ptest to Your Build</title> | ||
5891 | |||
5892 | <para> | ||
5893 | To add package testing to your build, add the | ||
5894 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></ulink> | ||
5895 | and <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink> | ||
5896 | variables to your <filename>local.conf</filename> file, | ||
5897 | which is found in the | ||
5898 | <link linkend='build-directory'>Build Directory</link>: | ||
5899 | <literallayout class='monospaced'> | ||
5900 | DISTRO_FEATURES_append = " ptest" | ||
5901 | EXTRA_IMAGE_FEATURES += "ptest-pkgs" | ||
5902 | </literallayout> | ||
5903 | Once your build is complete, the ptest files are installed | ||
5904 | into the <filename>/usr/lib/<package>/ptest</filename> | ||
5905 | directory within the image, where | ||
5906 | <filename><package></filename> is the name of the | ||
5907 | package. | ||
5908 | </para> | ||
5909 | </section> | ||
5910 | |||
5911 | <section id='running-ptest'> | ||
5912 | <title>Running ptest</title> | ||
5913 | |||
5914 | <para> | ||
5915 | The <filename>ptest-runner</filename> package installs a | ||
5916 | shell script that loops through all installed ptest test | ||
5917 | suites and runs them in sequence. | ||
5918 | Consequently, you might want to add this package to | ||
5919 | your image. | ||
5920 | </para> | ||
5921 | </section> | ||
5922 | |||
5923 | <section id='getting-your-package-ready'> | ||
5924 | <title>Getting Your Package Ready</title> | ||
5925 | |||
5926 | <para> | ||
5927 | In order to enable a recipe to run installed ptests | ||
5928 | on target hardware, | ||
5929 | you need to prepare the recipes that build the packages | ||
5930 | you want to test. | ||
5931 | Here is what you have to do for each recipe: | ||
5932 | <itemizedlist> | ||
5933 | <listitem><para><emphasis>Be sure the recipe | ||
5934 | inherits the | ||
5935 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-ptest'><filename>ptest</filename></ulink> | ||
5936 | class:</emphasis> | ||
5937 | Include the following line in each recipe: | ||
5938 | <literallayout class='monospaced'> | ||
5939 | inherit ptest | ||
5940 | </literallayout> | ||
5941 | </para></listitem> | ||
5942 | <listitem><para><emphasis>Create <filename>run-ptest</filename>:</emphasis> | ||
5943 | This script starts your test. | ||
5944 | Locate the script where you will refer to it | ||
5945 | using | ||
5946 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>. | ||
5947 | Here is an example that starts a test for | ||
5948 | <filename>dbus</filename>: | ||
5949 | <literallayout class='monospaced'> | ||
5950 | #!/bin/sh | ||
5951 | cd test | ||
5952 | make -k runtest-TESTS | ||
5953 | </literallayout> | ||
5954 | </para></listitem> | ||
5955 | <listitem><para><emphasis>Ensure dependencies are | ||
5956 | met:</emphasis> | ||
5957 | If the test adds build or runtime dependencies | ||
5958 | that normally do not exist for the package | ||
5959 | (such as requiring "make" to run the test suite), | ||
5960 | use the | ||
5961 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink> | ||
5962 | and | ||
5963 | <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink> | ||
5964 | variables in your recipe in order for the package | ||
5965 | to meet the dependencies. | ||
5966 | Here is an example where the package has a runtime | ||
5967 | dependency on "make": | ||
5968 | <literallayout class='monospaced'> | ||
5969 | RDEPENDS_${PN}-ptest += "make" | ||
5970 | </literallayout> | ||
5971 | </para></listitem> | ||
5972 | <listitem><para><emphasis>Add a function to build the | ||
5973 | test suite:</emphasis> | ||
5974 | Not many packages support cross-compilation of | ||
5975 | their test suites. | ||
5976 | Consequently, you usually need to add a | ||
5977 | cross-compilation function to the package. | ||
5978 | </para> | ||
5979 | <para>Many packages based on Automake compile and | ||
5980 | run the test suite by using a single command | ||
5981 | such as <filename>make check</filename>. | ||
5982 | However, the native <filename>make check</filename> | ||
5983 | builds and runs on the same computer, while | ||
5984 | cross-compiling requires that the package is built | ||
5985 | on the host but executed on the target. | ||
5986 | The built version of Automake that ships with the | ||
5987 | Yocto Project includes a patch that separates | ||
5988 | building and execution. | ||
5989 | Consequently, packages that use the unaltered, | ||
5990 | patched version of <filename>make check</filename> | ||
5991 | automatically cross-compiles.</para> | ||
5992 | <para>However, you still must add a | ||
5993 | <filename>do_compile_ptest</filename> function to | ||
5994 | build the test suite. | ||
5995 | Add a function similar to the following to your | ||
5996 | recipe: | ||
5997 | <literallayout class='monospaced'> | ||
5998 | do_compile_ptest() { | ||
5999 | oe_runmake buildtest-TESTS | ||
6000 | } | ||
6001 | </literallayout> | ||
6002 | </para></listitem> | ||
6003 | <listitem><para><emphasis>Ensure special configurations | ||
6004 | are set:</emphasis> | ||
6005 | If the package requires special configurations | ||
6006 | prior to compiling the test code, you must | ||
6007 | insert a <filename>do_configure_ptest</filename> | ||
6008 | function into the recipe. | ||
6009 | </para></listitem> | ||
6010 | <listitem><para><emphasis>Install the test | ||
6011 | suite:</emphasis> | ||
6012 | The <filename>ptest</filename> class | ||
6013 | automatically copies the file | ||
6014 | <filename>run-ptest</filename> to the target and | ||
6015 | then runs make <filename>install-ptest</filename> | ||
6016 | to run the tests. | ||
6017 | If this is not enough, you need to create a | ||
6018 | <filename>do_install_ptest</filename> function and | ||
6019 | make sure it gets called after the | ||
6020 | "make install-ptest" completes. | ||
6021 | </para></listitem> | ||
6022 | </itemizedlist> | ||
6023 | </para> | ||
6024 | </section> | ||
6025 | </section> | ||
6026 | </section> | ||
6027 | |||
6028 | <section id='working-with-source-files'> | ||
6029 | <title>Working with Source Files</title> | ||
6030 | |||
6031 | <para> | ||
6032 | The OpenEmbedded build system works with source files located | ||
6033 | through the | ||
6034 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
6035 | variable. | ||
6036 | When you build something using BitBake, a big part of the operation | ||
6037 | is locating and downloading all the source tarballs. | ||
6038 | For images, downloading all the source for various packages can | ||
6039 | take a significant amount of time. | ||
6040 | </para> | ||
6041 | |||
6042 | <para> | ||
6043 | This section presents information for working with source | ||
6044 | files that can lead to more efficient use of resources and | ||
6045 | time. | ||
6046 | </para> | ||
6047 | |||
6048 | <section id='setting-up-effective-mirrors'> | ||
6049 | <title>Setting up Effective Mirrors</title> | ||
6050 | |||
6051 | <para> | ||
6052 | As mentioned, a good deal that goes into a Yocto Project | ||
6053 | build is simply downloading all of the source tarballs. | ||
6054 | Maybe you have been working with another build system | ||
6055 | (OpenEmbedded or Angstrom) for which you have built up a | ||
6056 | sizable directory of source tarballs. | ||
6057 | Or, perhaps someone else has such a directory for which you | ||
6058 | have read access. | ||
6059 | If so, you can save time by adding statements to your | ||
6060 | configuration file so that the build process checks local | ||
6061 | directories first for existing tarballs before checking the | ||
6062 | Internet. | ||
6063 | </para> | ||
6064 | |||
6065 | <para> | ||
6066 | Here is an efficient way to set it up in your | ||
6067 | <filename>local.conf</filename> file: | ||
6068 | <literallayout class='monospaced'> | ||
6069 | SOURCE_MIRROR_URL ?= "file:///home/you/your-download-dir/" | ||
6070 | INHERIT += "own-mirrors" | ||
6071 | BB_GENERATE_MIRROR_TARBALLS = "1" | ||
6072 | # BB_NO_NETWORK = "1" | ||
6073 | </literallayout> | ||
6074 | </para> | ||
6075 | |||
6076 | <para> | ||
6077 | In the previous example, the | ||
6078 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BB_GENERATE_MIRROR_TARBALLS'><filename>BB_GENERATE_MIRROR_TARBALLS</filename></ulink> | ||
6079 | variable causes the OpenEmbedded build system to generate | ||
6080 | tarballs of the Git repositories and store them in the | ||
6081 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'><filename>DL_DIR</filename></ulink> | ||
6082 | directory. | ||
6083 | Due to performance reasons, generating and storing these | ||
6084 | tarballs is not the build system's default behavior. | ||
6085 | </para> | ||
6086 | |||
6087 | <para> | ||
6088 | You can also use the | ||
6089 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PREMIRRORS'><filename>PREMIRRORS</filename></ulink> | ||
6090 | variable. | ||
6091 | For an example, see the variable's glossary entry in the | ||
6092 | Yocto Project Reference Manual. | ||
6093 | </para> | ||
6094 | </section> | ||
6095 | |||
6096 | <section id='getting-source-files-and-suppressing-the-build'> | ||
6097 | <title>Getting Source Files and Suppressing the Build</title> | ||
6098 | |||
6099 | <para> | ||
6100 | Another technique you can use to ready yourself for a | ||
6101 | successive string of build operations, is to pre-fetch | ||
6102 | all the source files without actually starting a build. | ||
6103 | This technique lets you work through any download issues | ||
6104 | and ultimately gathers all the source files into your | ||
6105 | download directory | ||
6106 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-build-downloads'><filename>build/downloads</filename></ulink>, | ||
6107 | which is located with | ||
6108 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'><filename>DL_DIR</filename></ulink>. | ||
6109 | </para> | ||
6110 | |||
6111 | <para> | ||
6112 | Use the following BitBake command form to fetch all the | ||
6113 | necessary sources without starting the build: | ||
6114 | <literallayout class='monospaced'> | ||
6115 | $ bitbake -c fetchall <target> | ||
6116 | </literallayout> | ||
6117 | This variation of the BitBake command guarantees that you | ||
6118 | have all the sources for that BitBake target should you | ||
6119 | disconnect from the Internet and want to do the build | ||
6120 | later offline. | ||
6121 | </para> | ||
6122 | </section> | ||
6123 | </section> | ||
6124 | |||
6125 | <section id="building-software-from-an-external-source"> | ||
6126 | <title>Building Software from an External Source</title> | ||
6127 | |||
6128 | <para> | ||
6129 | By default, the OpenEmbedded build system uses the | ||
6130 | <link linkend='build-directory'>Build Directory</link> to | ||
6131 | build source code. | ||
6132 | The build process involves fetching the source files, unpacking | ||
6133 | them, and then patching them if necessary before the build takes | ||
6134 | place. | ||
6135 | </para> | ||
6136 | |||
6137 | <para> | ||
6138 | Situations exist where you might want to build software from source | ||
6139 | files that are external to and thus outside of the | ||
6140 | OpenEmbedded build system. | ||
6141 | For example, suppose you have a project that includes a new BSP with | ||
6142 | a heavily customized kernel. | ||
6143 | And, you want to minimize exposing the build system to the | ||
6144 | development team so that they can focus on their project and | ||
6145 | maintain everyone's workflow as much as possible. | ||
6146 | In this case, you want a kernel source directory on the development | ||
6147 | machine where the development occurs. | ||
6148 | You want the recipe's | ||
6149 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
6150 | variable to point to the external directory and use it as is, not | ||
6151 | copy it. | ||
6152 | </para> | ||
6153 | |||
6154 | <para> | ||
6155 | To build from software that comes from an external source, all you | ||
6156 | need to do is inherit the | ||
6157 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-externalsrc'><filename>externalsrc</filename></ulink> | ||
6158 | class and then set the | ||
6159 | <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTERNALSRC'><filename>EXTERNALSRC</filename></ulink> | ||
6160 | variable to point to your external source code. | ||
6161 | Here are the statements to put in your | ||
6162 | <filename>local.conf</filename> file: | ||
6163 | <literallayout class='monospaced'> | ||
6164 | INHERIT += "externalsrc" | ||
6165 | EXTERNALSRC_pn-myrecipe = "/some/path/to/your/source/tree" | ||
6166 | </literallayout> | ||
6167 | </para> | ||
6168 | |||
6169 | <para> | ||
6170 | By default, <filename>externalsrc.bbclass</filename> builds | ||
6171 | the source code in a directory separate from the external source | ||
6172 | directory as specified by | ||
6173 | <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTERNALSRC'><filename>EXTERNALSRC</filename></ulink>. | ||
6174 | If you need to have the source built in the same directory in | ||
6175 | which it resides, or some other nominated directory, you can set | ||
6176 | <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTERNALSRC_BUILD'><filename>EXTERNALSRC_BUILD</filename></ulink> | ||
6177 | to point to that directory: | ||
6178 | <literallayout class='monospaced'> | ||
6179 | EXTERNALSRC_BUILD_pn-myrecipe = "/path/to/my/source/tree" | ||
6180 | </literallayout> | ||
6181 | </para> | ||
6182 | </section> | ||
6183 | |||
6184 | <section id="selecting-an-initialization-manager"> | ||
6185 | <title>Selecting an Initialization Manager</title> | ||
6186 | |||
6187 | <para> | ||
6188 | By default, the Yocto Project uses SysVinit as the initialization | ||
6189 | manager. | ||
6190 | However, support also exists for systemd, | ||
6191 | which is a full replacement for init with | ||
6192 | parallel starting of services, reduced shell overhead and other | ||
6193 | features that are used by many distributions. | ||
6194 | </para> | ||
6195 | |||
6196 | <para> | ||
6197 | If you want to use SysVinit, you do | ||
6198 | not have to do anything. | ||
6199 | But, if you want to use systemd, you must | ||
6200 | take some steps as described in the following sections. | ||
6201 | </para> | ||
6202 | |||
6203 | <section id='using-systemd-exclusively'> | ||
6204 | <title>Using systemd Exclusively</title> | ||
6205 | |||
6206 | <para> | ||
6207 | Set the these variables in your distribution configuration | ||
6208 | file as follows: | ||
6209 | <literallayout class='monospaced'> | ||
6210 | DISTRO_FEATURES_append = " systemd" | ||
6211 | VIRTUAL-RUNTIME_init_manager = "systemd" | ||
6212 | </literallayout> | ||
6213 | You can also prevent the SysVinit | ||
6214 | distribution feature from | ||
6215 | being automatically enabled as follows: | ||
6216 | <literallayout class='monospaced'> | ||
6217 | DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit" | ||
6218 | </literallayout> | ||
6219 | Doing so removes any redundant SysVinit scripts. | ||
6220 | </para> | ||
6221 | |||
6222 | <para> | ||
6223 | To remove initscripts from your image altogether, | ||
6224 | set this variable also: | ||
6225 | <literallayout class='monospaced'> | ||
6226 | VIRTUAL-RUNTIME_initscripts = "" | ||
6227 | </literallayout> | ||
6228 | </para> | ||
6229 | |||
6230 | <para> | ||
6231 | For information on the backfill variable, see | ||
6232 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES_BACKFILL_CONSIDERED'><filename>DISTRO_FEATURES_BACKFILL_CONSIDERED</filename></ulink>. | ||
6233 | </para> | ||
6234 | </section> | ||
6235 | |||
6236 | <section id='using-systemd-for-the-main-image-and-using-sysvinit-for-the-rescue-image'> | ||
6237 | <title>Using systemd for the Main Image and Using SysVinit for the Rescue Image</title> | ||
6238 | |||
6239 | <para> | ||
6240 | Set the these variables in your distribution configuration | ||
6241 | file as follows: | ||
6242 | <literallayout class='monospaced'> | ||
6243 | DISTRO_FEATURES_append = " systemd" | ||
6244 | VIRTUAL-RUNTIME_init_manager = "systemd" | ||
6245 | </literallayout> | ||
6246 | Doing so causes your main image to use the | ||
6247 | <filename>packagegroup-core-boot.bb</filename> recipe and | ||
6248 | systemd. | ||
6249 | The rescue/minimal image cannot use this package group. | ||
6250 | However, it can install SysVinit | ||
6251 | and the appropriate packages will have support for both | ||
6252 | systemd and SysVinit. | ||
6253 | </para> | ||
6254 | </section> | ||
6255 | </section> | ||
6256 | |||
6257 | <section id="platdev-appdev-srcrev"> | ||
6258 | <title>Using an External SCM</title> | ||
6259 | |||
6260 | <para> | ||
6261 | If you're working on a recipe that pulls from an external Source | ||
6262 | Code Manager (SCM), it is possible to have the OpenEmbedded build | ||
6263 | system notice new recipe changes added to the SCM and then build | ||
6264 | the resulting packages that depend on the new recipes by using | ||
6265 | the latest versions. | ||
6266 | This only works for SCMs from which it is possible to get a | ||
6267 | sensible revision number for changes. | ||
6268 | Currently, you can do this with Apache Subversion (SVN), Git, and | ||
6269 | Bazaar (BZR) repositories. | ||
6270 | </para> | ||
6271 | |||
6272 | <para> | ||
6273 | To enable this behavior, the | ||
6274 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink> | ||
6275 | of the recipe needs to reference | ||
6276 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCPV'><filename>SRCPV</filename></ulink>. | ||
6277 | Here is an example: | ||
6278 | <literallayout class='monospaced'> | ||
6279 | PV = "1.2.3+git${SRCPV} | ||
6280 | </literallayout> | ||
6281 | Then, you can add the following to your | ||
6282 | <filename>local.conf</filename>: | ||
6283 | <literallayout class='monospaced'> | ||
6284 | SRCREV_pn-<PN> = "${AUTOREV}" | ||
6285 | </literallayout> | ||
6286 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink> | ||
6287 | is the name of the recipe for which you want to enable automatic source | ||
6288 | revision updating. | ||
6289 | </para> | ||
6290 | |||
6291 | <para> | ||
6292 | If you do not want to update your local configuration file, you can | ||
6293 | add the following directly to the recipe to finish enabling | ||
6294 | the feature: | ||
6295 | <literallayout class='monospaced'> | ||
6296 | SRCREV = "${AUTOREV}" | ||
6297 | </literallayout> | ||
6298 | </para> | ||
6299 | |||
6300 | <para> | ||
6301 | The Yocto Project provides a distribution named | ||
6302 | <filename>poky-bleeding</filename>, whose configuration | ||
6303 | file contains the line: | ||
6304 | <literallayout class='monospaced'> | ||
6305 | require conf/distro/include/poky-floating-revisions.inc | ||
6306 | </literallayout> | ||
6307 | This line pulls in the listed include file that contains | ||
6308 | numerous lines of exactly that form: | ||
6309 | <literallayout class='monospaced'> | ||
6310 | SRCREV_pn-gconf-dbus ?= "${AUTOREV}" | ||
6311 | SRCREV_pn-matchbox-common ?= "${AUTOREV}" | ||
6312 | SRCREV_pn-matchbox-config-gtk ?= "${AUTOREV}" | ||
6313 | SRCREV_pn-matchbox-desktop ?= "${AUTOREV}" | ||
6314 | SRCREV_pn-matchbox-keyboard ?= "${AUTOREV}" | ||
6315 | SRCREV_pn-matchbox-panel ?= "${AUTOREV}" | ||
6316 | SRCREV_pn-matchbox-panel-2 ?= "${AUTOREV}" | ||
6317 | SRCREV_pn-matchbox-themes-extra ?= "${AUTOREV}" | ||
6318 | SRCREV_pn-matchbox-terminal ?= "${AUTOREV}" | ||
6319 | SRCREV_pn-matchbox-wm ?= "${AUTOREV}" | ||
6320 | SRCREV_pn-matchbox-wm-2 ?= "${AUTOREV}" | ||
6321 | SRCREV_pn-settings-daemon ?= "${AUTOREV}" | ||
6322 | SRCREV_pn-screenshot ?= "${AUTOREV}" | ||
6323 | SRCREV_pn-libfakekey ?= "${AUTOREV}" | ||
6324 | SRCREV_pn-oprofileui ?= "${AUTOREV}" | ||
6325 | . | ||
6326 | . | ||
6327 | . | ||
6328 | </literallayout> | ||
6329 | These lines allow you to experiment with building a | ||
6330 | distribution that tracks the latest development source | ||
6331 | for numerous packages. | ||
6332 | <note><title>Caution</title> | ||
6333 | The <filename>poky-bleeding</filename> distribution | ||
6334 | is not tested on a regular basis. | ||
6335 | Keep this in mind if you use it. | ||
6336 | </note> | ||
6337 | </para> | ||
6338 | </section> | ||
6339 | |||
6340 | <section id='creating-a-read-only-root-filesystem'> | ||
6341 | <title>Creating a Read-Only Root Filesystem</title> | ||
6342 | |||
6343 | <para> | ||
6344 | Suppose, for security reasons, you need to disable | ||
6345 | your target device's root filesystem's write permissions | ||
6346 | (i.e. you need a read-only root filesystem). | ||
6347 | Or, perhaps you are running the device's operating system | ||
6348 | from a read-only storage device. | ||
6349 | For either case, you can customize your image for | ||
6350 | that behavior. | ||
6351 | </para> | ||
6352 | |||
6353 | <note> | ||
6354 | Supporting a read-only root filesystem requires that the system and | ||
6355 | applications do not try to write to the root filesystem. | ||
6356 | You must configure all parts of the target system to write | ||
6357 | elsewhere, or to gracefully fail in the event of attempting to | ||
6358 | write to the root filesystem. | ||
6359 | </note> | ||
6360 | |||
6361 | <section id='creating-the-root-filesystem'> | ||
6362 | <title>Creating the Root Filesystem</title> | ||
6363 | |||
6364 | <para> | ||
6365 | To create the read-only root filesystem, simply add the | ||
6366 | "read-only-rootfs" feature to your image. | ||
6367 | Using either of the following statements in your | ||
6368 | image recipe or from within the | ||
6369 | <filename>local.conf</filename> file found in the | ||
6370 | <link linkend='build-directory'>Build Directory</link> | ||
6371 | causes the build system to create a read-only root filesystem: | ||
6372 | <literallayout class='monospaced'> | ||
6373 | IMAGE_FEATURES = "read-only-rootfs" | ||
6374 | </literallayout> | ||
6375 | or | ||
6376 | <literallayout class='monospaced'> | ||
6377 | EXTRA_IMAGE_FEATURES += "read-only-rootfs" | ||
6378 | </literallayout> | ||
6379 | </para> | ||
6380 | |||
6381 | <para> | ||
6382 | For more information on how to use these variables, see the | ||
6383 | "<link linkend='usingpoky-extend-customimage-imagefeatures'>Customizing Images Using Custom <filename>IMAGE_FEATURES</filename> and <filename>EXTRA_IMAGE_FEATURES</filename></link>" | ||
6384 | section. | ||
6385 | For information on the variables, see | ||
6386 | <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink> | ||
6387 | and <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink>. | ||
6388 | </para> | ||
6389 | </section> | ||
6390 | |||
6391 | <section id='post-installation-scripts'> | ||
6392 | <title>Post-Installation Scripts</title> | ||
6393 | |||
6394 | <para> | ||
6395 | It is very important that you make sure all | ||
6396 | post-Installation (<filename>pkg_postinst</filename>) scripts | ||
6397 | for packages that are installed into the image can be run | ||
6398 | at the time when the root filesystem is created during the | ||
6399 | build on the host system. | ||
6400 | These scripts cannot attempt to run during first-boot on the | ||
6401 | target device. | ||
6402 | With the "read-only-rootfs" feature enabled, | ||
6403 | the build system checks during root filesystem creation to make | ||
6404 | sure all post-installation scripts succeed. | ||
6405 | If any of these scripts still need to be run after the root | ||
6406 | filesystem is created, the build immediately fails. | ||
6407 | These build-time checks ensure that the build fails | ||
6408 | rather than the target device fails later during its | ||
6409 | initial boot operation. | ||
6410 | </para> | ||
6411 | |||
6412 | <para> | ||
6413 | Most of the common post-installation scripts generated by the | ||
6414 | build system for the out-of-the-box Yocto Project are engineered | ||
6415 | so that they can run during root filesystem creation | ||
6416 | (e.g. post-installation scripts for caching fonts). | ||
6417 | However, if you create and add custom scripts, you need | ||
6418 | to be sure they can be run during this file system creation. | ||
6419 | </para> | ||
6420 | |||
6421 | <para> | ||
6422 | Here are some common problems that prevent | ||
6423 | post-installation scripts from running during root filesystem | ||
6424 | creation: | ||
6425 | <itemizedlist> | ||
6426 | <listitem><para> | ||
6427 | <emphasis>Not using $D in front of absolute | ||
6428 | paths:</emphasis> | ||
6429 | The build system defines | ||
6430 | <filename>$</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink> | ||
6431 | when the root filesystem is created. | ||
6432 | Furthermore, <filename>$D</filename> is blank when the | ||
6433 | script is run on the target device. | ||
6434 | This implies two purposes for <filename>$D</filename>: | ||
6435 | ensuring paths are valid in both the host and target | ||
6436 | environments, and checking to determine which | ||
6437 | environment is being used as a method for taking | ||
6438 | appropriate actions. | ||
6439 | </para></listitem> | ||
6440 | <listitem><para> | ||
6441 | <emphasis>Attempting to run processes that are | ||
6442 | specific to or dependent on the target | ||
6443 | architecture:</emphasis> | ||
6444 | You can work around these attempts by using native | ||
6445 | tools to accomplish the same tasks, or | ||
6446 | by alternatively running the processes under QEMU, | ||
6447 | which has the <filename>qemu_run_binary</filename> | ||
6448 | function. | ||
6449 | For more information, see the | ||
6450 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-qemu'><filename>qemu</filename></ulink> | ||
6451 | class.</para></listitem> | ||
6452 | </itemizedlist> | ||
6453 | </para> | ||
6454 | </section> | ||
6455 | |||
6456 | <section id='areas-with-write-access'> | ||
6457 | <title>Areas With Write Access</title> | ||
6458 | |||
6459 | <para> | ||
6460 | With the "read-only-rootfs" feature enabled, | ||
6461 | any attempt by the target to write to the root filesystem at | ||
6462 | runtime fails. | ||
6463 | Consequently, you must make sure that you configure processes | ||
6464 | and applications that attempt these types of writes do so | ||
6465 | to directories with write access (e.g. | ||
6466 | <filename>/tmp</filename> or <filename>/var/run</filename>). | ||
6467 | </para> | ||
6468 | </section> | ||
6469 | </section> | ||
6470 | |||
6471 | <section id="performing-automated-runtime-testing"> | ||
6472 | <title>Performing Automated Runtime Testing</title> | ||
6473 | |||
6474 | <para> | ||
6475 | The OpenEmbedded build system makes available a series of automated | ||
6476 | tests for images to verify runtime functionality. | ||
6477 | You can run these tests on either QEMU or actual target hardware. | ||
6478 | Tests are written in Python making use of the | ||
6479 | <filename>unittest</filename> module, and the majority of them | ||
6480 | run commands on the target system over SSH. | ||
6481 | This section describes how you set up the environment to use these | ||
6482 | tests, run available tests, and write and add your own tests. | ||
6483 | </para> | ||
6484 | |||
6485 | <section id='enabling-tests'> | ||
6486 | <title>Enabling Tests</title> | ||
6487 | |||
6488 | <para> | ||
6489 | Depending on whether you are planning on running tests using | ||
6490 | QEMU or on running them on the hardware, you have to take | ||
6491 | different steps to enable the tests. | ||
6492 | See the following subsections for information on how to | ||
6493 | enable both types of tests. | ||
6494 | </para> | ||
6495 | |||
6496 | <section id='qemu-image-enabling-tests'> | ||
6497 | <title>Enabling Runtime Tests on QEMU</title> | ||
6498 | |||
6499 | <para> | ||
6500 | In order to run tests, you need to do the following: | ||
6501 | <itemizedlist> | ||
6502 | <listitem><para><emphasis>Set up to avoid interaction | ||
6503 | with <filename>sudo</filename> for networking:</emphasis> | ||
6504 | To accomplish this, you must do one of the | ||
6505 | following: | ||
6506 | <itemizedlist> | ||
6507 | <listitem><para>Add | ||
6508 | <filename>NOPASSWD</filename> for your user | ||
6509 | in <filename>/etc/sudoers</filename> either for | ||
6510 | ALL commands or just for | ||
6511 | <filename>runqemu-ifup</filename>. | ||
6512 | You must provide the full path as that can | ||
6513 | change if you are using multiple clones of the | ||
6514 | source repository. | ||
6515 | <note> | ||
6516 | On some distributions, you also need to | ||
6517 | comment out "Defaults requiretty" in | ||
6518 | <filename>/etc/sudoers</filename>. | ||
6519 | </note></para></listitem> | ||
6520 | <listitem><para>Manually configure a tap interface | ||
6521 | for your system.</para></listitem> | ||
6522 | <listitem><para>Run as root the script in | ||
6523 | <filename>scripts/runqemu-gen-tapdevs</filename>, | ||
6524 | which should generate a list of tap devices. | ||
6525 | This is the option typically chosen for | ||
6526 | Autobuilder-type environments. | ||
6527 | </para></listitem> | ||
6528 | </itemizedlist></para></listitem> | ||
6529 | <listitem><para><emphasis>Set the | ||
6530 | <filename>DISPLAY</filename> variable:</emphasis> | ||
6531 | You need to set this variable so that you have an X | ||
6532 | server available (e.g. start | ||
6533 | <filename>vncserver</filename> for a headless machine). | ||
6534 | </para></listitem> | ||
6535 | <listitem><para><emphasis>Be sure your host's firewall | ||
6536 | accepts incoming connections from | ||
6537 | 192.168.7.0/24:</emphasis> | ||
6538 | Some of the tests (in particular smart tests) start an | ||
6539 | HTTP server on a random high number port, which is | ||
6540 | used to serve files to the target. | ||
6541 | The smart module serves | ||
6542 | <filename>${DEPLOY_DIR}/rpm</filename> so it can run | ||
6543 | smart channel commands. That means your host's firewall | ||
6544 | must accept incoming connections from 192.168.7.0/24, | ||
6545 | which is the default IP range used for tap devices | ||
6546 | by <filename>runqemu</filename>.</para></listitem> | ||
6547 | </itemizedlist> | ||
6548 | </para> | ||
6549 | |||
6550 | <para> | ||
6551 | Once you start running the tests, the following happens: | ||
6552 | <itemizedlist> | ||
6553 | <listitem><para>A copy of the root filesystem is written | ||
6554 | to <filename>${WORKDIR}/testimage</filename>. | ||
6555 | </para></listitem> | ||
6556 | <listitem><para>The image is booted under QEMU using the | ||
6557 | standard <filename>runqemu</filename> script. | ||
6558 | </para></listitem> | ||
6559 | <listitem><para>A default timeout of 500 seconds occurs | ||
6560 | to allow for the boot process to reach the login prompt. | ||
6561 | You can change the timeout period by setting | ||
6562 | <ulink url='&YOCTO_DOCS_REF_URL;#var-TEST_QEMUBOOT_TIMEOUT'><filename>TEST_QEMUBOOT_TIMEOUT</filename></ulink> | ||
6563 | in the <filename>local.conf</filename> file. | ||
6564 | </para></listitem> | ||
6565 | <listitem><para>Once the boot process is reached and the | ||
6566 | login prompt appears, the tests run. | ||
6567 | The full boot log is written to | ||
6568 | <filename>${WORKDIR}/testimage/qemu_boot_log</filename>. | ||
6569 | </para></listitem> | ||
6570 | <listitem><para>Each test module loads in the order found | ||
6571 | in <filename>TEST_SUITES</filename>. | ||
6572 | You can find the full output of the commands run over | ||
6573 | SSH in | ||
6574 | <filename>${WORKDIR}/testimgage/ssh_target_log</filename>. | ||
6575 | </para></listitem> | ||
6576 | <listitem><para>If no failures occur, the task running the | ||
6577 | tests ends successfully. | ||
6578 | You can find the output from the | ||
6579 | <filename>unittest</filename> in the task log at | ||
6580 | <filename>${WORKDIR}/temp/log.do_testimage</filename>. | ||
6581 | </para></listitem> | ||
6582 | </itemizedlist> | ||
6583 | </para> | ||
6584 | </section> | ||
6585 | |||
6586 | <section id='hardware-image-enabling-tests'> | ||
6587 | <title>Enabling Runtime Tests on Hardware</title> | ||
6588 | |||
6589 | <para> | ||
6590 | The OpenEmbedded build system can run tests on real | ||
6591 | hardware, and for certain devices it can also deploy | ||
6592 | the image to be tested onto the device beforehand. | ||
6593 | </para> | ||
6594 | |||
6595 | <para> | ||
6596 | For automated deployment, a "master image" is installed | ||
6597 | onto the hardware once as part of setup. | ||
6598 | Then, each time tests are to be run, the following | ||
6599 | occurs: | ||
6600 | <orderedlist> | ||
6601 | <listitem><para>The master image is booted into and | ||
6602 | used to write the image to be tested to | ||
6603 | a second partition. | ||
6604 | </para></listitem> | ||
6605 | <listitem><para>The device is then rebooted using an | ||
6606 | external script that you need to provide. | ||
6607 | </para></listitem> | ||
6608 | <listitem><para>The device boots into the image to be | ||
6609 | tested. | ||
6610 | </para></listitem> | ||
6611 | </orderedlist> | ||
6612 | </para> | ||
6613 | |||
6614 | <para> | ||
6615 | When running tests (independent of whether the image | ||
6616 | has been deployed automatically or not), the device is | ||
6617 | expected to be connected to a network on a | ||
6618 | pre-determined IP address. | ||
6619 | You can either use static IP addresses written into | ||
6620 | the image, or set the image to use DHCP and have your | ||
6621 | DHCP server on the test network assign a known IP address | ||
6622 | based on the MAC address of the device. | ||
6623 | </para> | ||
6624 | |||
6625 | <para> | ||
6626 | In order to run tests on hardware, you need to set | ||
6627 | <filename>TEST_TARGET</filename> to an appropriate value. | ||
6628 | For QEMU, you do not have to change anything, the default | ||
6629 | value is "QemuTarget". | ||
6630 | For running tests on hardware, two options exist: | ||
6631 | "SimpleRemoteTarget" and "GummibootTarget". | ||
6632 | <itemizedlist> | ||
6633 | <listitem><para><emphasis>"SimpleRemoteTarget":</emphasis> | ||
6634 | Choose "SimpleRemoteTarget" if you are going to | ||
6635 | run tests on a target system that is already | ||
6636 | running the image to be tested and is available | ||
6637 | on the network. | ||
6638 | You can use "SimpleRemoteTarget" in conjunction | ||
6639 | with either real hardware or an image running | ||
6640 | within a separately started QEMU or any | ||
6641 | other virtual machine manager. | ||
6642 | </para></listitem> | ||
6643 | <listitem><para><emphasis>"GummibootTarget":</emphasis> | ||
6644 | Choose "GummibootTarget" if your hardware is | ||
6645 | an EFI-based machine with | ||
6646 | <filename>gummiboot</filename> as bootloader and | ||
6647 | <filename>core-image-testmaster</filename> | ||
6648 | (or something similar) is installed. | ||
6649 | Also, your hardware under test must be in a | ||
6650 | DHCP-enabled network that gives it the same IP | ||
6651 | address for each reboot.</para> | ||
6652 | <para>If you choose "GummibootTarget", there are | ||
6653 | additional requirements and considerations. | ||
6654 | See the | ||
6655 | "<link linkend='selecting-gummiboottarget'>Selecting GummibootTarget</link>" | ||
6656 | section, which follows, for more information. | ||
6657 | </para></listitem> | ||
6658 | </itemizedlist> | ||
6659 | </para> | ||
6660 | </section> | ||
6661 | |||
6662 | <section id='selecting-gummiboottarget'> | ||
6663 | <title>Selecting GummibootTarget</title> | ||
6664 | |||
6665 | <para> | ||
6666 | If you did not set <filename>TEST_TARGET</filename> to | ||
6667 | "GummibootTarget", then you do not need any information | ||
6668 | in this section. | ||
6669 | You can skip down to the | ||
6670 | "<link linkend='qemu-image-running-tests'>Running Tests</link>" | ||
6671 | section. | ||
6672 | </para> | ||
6673 | |||
6674 | <para> | ||
6675 | If you did set <filename>TEST_TARGET</filename> to | ||
6676 | "GummibootTarget", you also need to perform a one-time | ||
6677 | setup of your master image by doing the following: | ||
6678 | <orderedlist> | ||
6679 | <listitem><para><emphasis>Set <filename>EFI_PROVIDER</filename>:</emphasis> | ||
6680 | Be sure that <filename>EFI_PROVIDER</filename> | ||
6681 | is as follows: | ||
6682 | <literallayout class='monospaced'> | ||
6683 | EFI_PROVIDER = "gummiboot" | ||
6684 | </literallayout> | ||
6685 | </para></listitem> | ||
6686 | <listitem><para><emphasis>Build the master image:</emphasis> | ||
6687 | Build the <filename>core-image-testmaster</filename> | ||
6688 | image. | ||
6689 | The <filename>core-image-testmaster</filename> | ||
6690 | recipe is provided as an example for a | ||
6691 | "master" image and you can customize the image | ||
6692 | recipe as you would any other recipe. | ||
6693 | </para> | ||
6694 | <para>Here are the image recipe requirements: | ||
6695 | <itemizedlist> | ||
6696 | <listitem><para>Inherits | ||
6697 | <filename>core-image</filename> | ||
6698 | so that kernel modules are installed. | ||
6699 | </para></listitem> | ||
6700 | <listitem><para>Installs normal linux utilities | ||
6701 | not busybox ones (e.g. | ||
6702 | <filename>bash</filename>, | ||
6703 | <filename>coreutils</filename>, | ||
6704 | <filename>tar</filename>, | ||
6705 | <filename>gzip</filename>, and | ||
6706 | <filename>kmod</filename>). | ||
6707 | </para></listitem> | ||
6708 | <listitem><para>Uses a custom | ||
6709 | initramfs image with a custom installer. | ||
6710 | A normal image that you can install usually | ||
6711 | creates a single rootfs partition. | ||
6712 | This image uses another installer that | ||
6713 | creates a specific partition layout. | ||
6714 | Not all Board Support Packages (BSPs) | ||
6715 | can use an installer. | ||
6716 | For such cases, you need to manually create | ||
6717 | the following partition layout on the | ||
6718 | target: | ||
6719 | <itemizedlist> | ||
6720 | <listitem><para>First partition mounted | ||
6721 | under <filename>/boot</filename>, | ||
6722 | labeled "boot". | ||
6723 | </para></listitem> | ||
6724 | <listitem><para>The main rootfs | ||
6725 | partition where this image gets | ||
6726 | installed, which is mounted under | ||
6727 | <filename>/</filename>. | ||
6728 | </para></listitem> | ||
6729 | <listitem><para>Another partition | ||
6730 | labeled "testrootfs" where test | ||
6731 | images get deployed. | ||
6732 | </para></listitem> | ||
6733 | </itemizedlist> | ||
6734 | </para></listitem> | ||
6735 | </itemizedlist> | ||
6736 | </para></listitem> | ||
6737 | <listitem><para><emphasis>Install image:</emphasis> | ||
6738 | Install the image that you just built on the target | ||
6739 | system. | ||
6740 | </para></listitem> | ||
6741 | </orderedlist> | ||
6742 | </para> | ||
6743 | |||
6744 | <para> | ||
6745 | The final thing you need to do when setting | ||
6746 | <filename>TEST_TARGET</filename> to "GummibootTarget" is | ||
6747 | to set up the test image: | ||
6748 | <orderedlist> | ||
6749 | <listitem><para><emphasis>Set up your <filename>local.conf</filename> file:</emphasis> | ||
6750 | Make sure you have the following statements in | ||
6751 | your <filename>local.conf</filename> file: | ||
6752 | <literallayout class='monospaced'> | ||
6753 | IMAGE_FSTYPES += "tar.gz" | ||
6754 | INHERIT += "testimage" | ||
6755 | TEST_TARGET = "GummibootTarget" | ||
6756 | TEST_TARGET_IP = "192.168.2.3" | ||
6757 | </literallayout> | ||
6758 | </para></listitem> | ||
6759 | <listitem><para><emphasis>Build your test image:</emphasis> | ||
6760 | Use BitBake to build the image: | ||
6761 | <literallayout class='monospaced'> | ||
6762 | $ bitbake core-image-sato | ||
6763 | </literallayout> | ||
6764 | </para></listitem> | ||
6765 | </orderedlist> | ||
6766 | </para> | ||
6767 | |||
6768 | <para> | ||
6769 | Here is some additional information regarding running | ||
6770 | "GummibootTarget" as your test target: | ||
6771 | <itemizedlist> | ||
6772 | <listitem><para> | ||
6773 | You can use | ||
6774 | <filename>TEST_POWERCONTROL_CMD</filename> | ||
6775 | together with | ||
6776 | <filename>TEST_POWERCONTROL_EXTRA_ARGS</filename> | ||
6777 | as a command that runs on the host and does power | ||
6778 | cycling. | ||
6779 | The test code passes one argument to that command: | ||
6780 | off, on or cycle (off then on). | ||
6781 | Here is an example that could appear in your | ||
6782 | <filename>local.conf</filename> file: | ||
6783 | <literallayout class='monospaced'> | ||
6784 | TEST_POWERCONTROL_CMD = "powercontrol.exp test 10.11.12.1 nuc1" | ||
6785 | </literallayout> | ||
6786 | In this example, the expect script does the | ||
6787 | following: | ||
6788 | <literallayout class='monospaced'> | ||
6789 | ssh test@10.11.12.1 "pyctl nuc1 <arg>" | ||
6790 | </literallayout> | ||
6791 | It then runs a Python script that controls power | ||
6792 | for a label called <filename>nuc1</filename>. | ||
6793 | <note> | ||
6794 | You need to customize | ||
6795 | <filename>TEST_POWERCONTROL_CMD</filename> | ||
6796 | and | ||
6797 | <filename>TEST_POWERCONTROL_EXTRA_ARGS</filename> | ||
6798 | for your own setup. | ||
6799 | The one requirement is that it accepts | ||
6800 | "on", "off", and "cycle" as the last argument. | ||
6801 | </note> | ||
6802 | </para></listitem> | ||
6803 | <listitem><para> | ||
6804 | When no command is defined, it connects to the | ||
6805 | device over SSH and uses the classic reboot command | ||
6806 | to reboot the device. | ||
6807 | Classic reboot is fine as long as the machine | ||
6808 | actually reboots (i.e. the SSH test has not | ||
6809 | failed). | ||
6810 | It is useful for scenarios where you have a simple | ||
6811 | setup, typically with a single board, and where | ||
6812 | some manual interaction is okay from time to time. | ||
6813 | </para></listitem> | ||
6814 | </itemizedlist> | ||
6815 | </para> | ||
6816 | </section> | ||
6817 | </section> | ||
6818 | |||
6819 | <section id="qemu-image-running-tests"> | ||
6820 | <title>Running Tests</title> | ||
6821 | |||
6822 | <para> | ||
6823 | You can start the tests automatically or manually: | ||
6824 | <itemizedlist> | ||
6825 | <listitem><para><emphasis>Automatically running tests:</emphasis> | ||
6826 | To run the tests automatically after the | ||
6827 | OpenEmbedded build system successfully creates an image, | ||
6828 | first set the | ||
6829 | <ulink url='&YOCTO_DOCS_REF_URL;#var-TEST_IMAGE'><filename>TEST_IMAGE</filename></ulink> | ||
6830 | variable to "1" in your <filename>local.conf</filename> | ||
6831 | file in the | ||
6832 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>: | ||
6833 | <literallayout class='monospaced'> | ||
6834 | TEST_IMAGE = "1" | ||
6835 | </literallayout> | ||
6836 | Next, build your image. | ||
6837 | If the image successfully builds, the tests will be | ||
6838 | run: | ||
6839 | <literallayout class='monospaced'> | ||
6840 | bitbake core-image-sato | ||
6841 | </literallayout></para></listitem> | ||
6842 | <listitem><para><emphasis>Manually running tests:</emphasis> | ||
6843 | To manually run the tests, first globally inherit the | ||
6844 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-testimage'><filename>testimage</filename></ulink> | ||
6845 | class by editing your <filename>local.conf</filename> | ||
6846 | file: | ||
6847 | <literallayout class='monospaced'> | ||
6848 | INHERIT += "testimage" | ||
6849 | </literallayout> | ||
6850 | Next, use BitBake to run the tests: | ||
6851 | <literallayout class='monospaced'> | ||
6852 | bitbake -c testimage <image> | ||
6853 | </literallayout></para></listitem> | ||
6854 | </itemizedlist> | ||
6855 | </para> | ||
6856 | |||
6857 | <para> | ||
6858 | All test files reside in | ||
6859 | <filename>meta/lib/oeqa/runtime</filename> in the | ||
6860 | <link linkend='source-directory'>Source Directory</link>. | ||
6861 | A test name maps directly to a Python module. | ||
6862 | Each test module may contain a number of individual tests. | ||
6863 | Tests are usually grouped together by the area | ||
6864 | tested (e.g tests for systemd reside in | ||
6865 | <filename>meta/lib/oeqa/runtime/systemd.py</filename>). | ||
6866 | </para> | ||
6867 | |||
6868 | <para> | ||
6869 | You can add tests to any layer provided you place them in the | ||
6870 | proper area and you extend | ||
6871 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BBPATH'><filename>BBPATH</filename></ulink> | ||
6872 | in the <filename>local.conf</filename> file as normal. | ||
6873 | Be sure that tests reside in | ||
6874 | <filename><layer>/lib/oeqa/runtime</filename>. | ||
6875 | <note> | ||
6876 | Be sure that module names do not collide with module names | ||
6877 | used in the default set of test modules in | ||
6878 | <filename>meta/lib/oeqa/runtime</filename>. | ||
6879 | </note> | ||
6880 | </para> | ||
6881 | |||
6882 | <para> | ||
6883 | You can change the set of tests run by appending or overriding | ||
6884 | <ulink url='&YOCTO_DOCS_REF_URL;#var-TEST_SUITES'><filename>TEST_SUITES</filename></ulink> | ||
6885 | variable in <filename>local.conf</filename>. | ||
6886 | Each name in <filename>TEST_SUITES</filename> represents a | ||
6887 | required test for the image. | ||
6888 | Test modules named within <filename>TEST_SUITES</filename> | ||
6889 | cannot be skipped even if a test is not suitable for an image | ||
6890 | (e.g. running the RPM tests on an image without | ||
6891 | <filename>rpm</filename>). | ||
6892 | Appending "auto" to <filename>TEST_SUITES</filename> causes the | ||
6893 | build system to try to run all tests that are suitable for the | ||
6894 | image (i.e. each test module may elect to skip itself). | ||
6895 | </para> | ||
6896 | |||
6897 | <para> | ||
6898 | The order you list tests in <filename>TEST_SUITES</filename> | ||
6899 | is important and influences test dependencies. | ||
6900 | Consequently, tests that depend on other tests should be added | ||
6901 | after the test on which they depend. | ||
6902 | For example, since the <filename>ssh</filename> test | ||
6903 | depends on the | ||
6904 | <filename>ping</filename> test, "ssh" needs to come after | ||
6905 | "ping" in the list. | ||
6906 | The test class provides no re-ordering or dependency handling. | ||
6907 | <note> | ||
6908 | Each module can have multiple classes with multiple test | ||
6909 | methods. | ||
6910 | And, Python <filename>unittest</filename> rules apply. | ||
6911 | </note> | ||
6912 | </para> | ||
6913 | |||
6914 | <para> | ||
6915 | Here are some things to keep in mind when running tests: | ||
6916 | <itemizedlist> | ||
6917 | <listitem><para>The default tests for the image are defined | ||
6918 | as: | ||
6919 | <literallayout class='monospaced'> | ||
6920 | DEFAULT_TEST_SUITES_pn-<image> = "ping ssh df connman syslog xorg scp vnc date rpm smart dmesg" | ||
6921 | </literallayout></para></listitem> | ||
6922 | <listitem><para>Add your own test to the list of the | ||
6923 | by using the following: | ||
6924 | <literallayout class='monospaced'> | ||
6925 | TEST_SUITES_append = " mytest" | ||
6926 | </literallayout></para></listitem> | ||
6927 | <listitem><para>Run a specific list of tests as follows: | ||
6928 | <literallayout class='monospaced'> | ||
6929 | TEST_SUITES = "test1 test2 test3" | ||
6930 | </literallayout> | ||
6931 | Remember, order is important. | ||
6932 | Be sure to place a test that is dependent on another test | ||
6933 | later in the order.</para></listitem> | ||
6934 | </itemizedlist> | ||
6935 | </para> | ||
6936 | </section> | ||
6937 | |||
6938 | <section id="exporting-tests"> | ||
6939 | <title>Exporting Tests</title> | ||
6940 | |||
6941 | <para> | ||
6942 | You can export tests so that they can run independently of | ||
6943 | the build system. | ||
6944 | Exporting tests is required if you want to be able to hand | ||
6945 | the test execution off to a scheduler. | ||
6946 | You can only export tests that are defined in | ||
6947 | <ulink url='&YOCTO_DOCS_REF_URL;#var-TEST_SUITES'><filename>TEST_SUITES</filename></ulink>. | ||
6948 | </para> | ||
6949 | |||
6950 | <para> | ||
6951 | If you image is already built, make sure the following are set | ||
6952 | in your <filename>local.conf</filename> file. | ||
6953 | Be sure to provide the IP address you need: | ||
6954 | <literallayout class='monospaced'> | ||
6955 | TEST_EXPORT_ONLY = "1" | ||
6956 | TEST_TARGET = "simpleremote" | ||
6957 | TEST_TARGET_IP = "192.168.7.2" | ||
6958 | TEST_SERVER_IP = "192.168.7.1" | ||
6959 | </literallayout> | ||
6960 | You can then export the tests with the following: | ||
6961 | <literallayout class='monospaced'> | ||
6962 | $ bitbake core-image-sato -c testimage | ||
6963 | </literallayout> | ||
6964 | Exporting the tests places them in the | ||
6965 | <link linkend='build-directory'>Build Directory</link> in | ||
6966 | <filename>tmp/testimage/core-image-sato</filename>, which | ||
6967 | is controlled by the | ||
6968 | <filename>TEST_EXPORT_DIR</filename> variable. | ||
6969 | </para> | ||
6970 | |||
6971 | <para> | ||
6972 | The exported data (i.e. <filename>testdata.json</filename>) | ||
6973 | contains paths to the Build Directory. | ||
6974 | Thus, the contents of the directory can be moved | ||
6975 | to another machine as long as you update some paths in the | ||
6976 | JSON. | ||
6977 | Usually you only care about the | ||
6978 | ${DEPLOY_DIR}/rpm directory (assuming the RPM and Smart tests | ||
6979 | are enabled). | ||
6980 | Consequently, running the tests on other machine | ||
6981 | means that you have to move the contents and call | ||
6982 | <filename>runexported</filename> with "--deploy-dir PATH: | ||
6983 | ./runexported.py --deploy-dir /new/path/on/this/machine testdata.json | ||
6984 | runexported.py accepts other arguments as well, see --help. | ||
6985 | </para> | ||
6986 | |||
6987 | <para> | ||
6988 | You can now run the tests outside of the build environment: | ||
6989 | <literallayout class='monospaced'> | ||
6990 | $ cd tmp/testimage/core-image-sato | ||
6991 | $ ./runexported.py testdata.json | ||
6992 | </literallayout> | ||
6993 | <note> | ||
6994 | This "export" feature does not deploy or boot the target | ||
6995 | image. | ||
6996 | Your target (be it a Qemu or hardware one) | ||
6997 | has to already be up and running when you call | ||
6998 | <filename>runexported.py</filename> | ||
6999 | </note> | ||
7000 | </para> | ||
7001 | </section> | ||
7002 | |||
7003 | <section id="qemu-image-writing-new-tests"> | ||
7004 | <title>Writing New Tests</title> | ||
7005 | |||
7006 | <para> | ||
7007 | As mentioned previously, all new test files need to be in the | ||
7008 | proper place for the build system to find them. | ||
7009 | New tests for additional functionality outside of the core | ||
7010 | should be added to the layer that adds the functionality, in | ||
7011 | <filename><layer>/lib/oeqa/runtime</filename> (as | ||
7012 | long as | ||
7013 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BBPATH'><filename>BBPATH</filename></ulink> | ||
7014 | is extended in the layer's | ||
7015 | <filename>layer.conf</filename> file as normal). | ||
7016 | Just remember that filenames need to map directly to test | ||
7017 | (module) names and that you do not use module names that | ||
7018 | collide with existing core tests. | ||
7019 | </para> | ||
7020 | |||
7021 | <para> | ||
7022 | To create a new test, start by copying an existing module | ||
7023 | (e.g. <filename>syslog.py</filename> or | ||
7024 | <filename>gcc.py</filename> are good ones to use). | ||
7025 | Test modules can use code from | ||
7026 | <filename>meta/lib/oeqa/utils</filename>, which are helper | ||
7027 | classes. | ||
7028 | </para> | ||
7029 | |||
7030 | <note> | ||
7031 | Structure shell commands such that you rely on them and they | ||
7032 | return a single code for success. | ||
7033 | Be aware that sometimes you will need to parse the output. | ||
7034 | See the <filename>df.py</filename> and | ||
7035 | <filename>date.py</filename> modules for examples. | ||
7036 | </note> | ||
7037 | |||
7038 | <para> | ||
7039 | You will notice that all test classes inherit | ||
7040 | <filename>oeRuntimeTest</filename>, which is found in | ||
7041 | <filename>meta/lib/oetest.py</filename>. | ||
7042 | This base class offers some helper attributes, which are | ||
7043 | described in the following sections: | ||
7044 | </para> | ||
7045 | |||
7046 | <section id='qemu-image-writing-tests-class-methods'> | ||
7047 | <title>Class Methods</title> | ||
7048 | |||
7049 | <para> | ||
7050 | Class methods are as follows: | ||
7051 | <itemizedlist> | ||
7052 | <listitem><para><emphasis><filename>hasPackage(pkg)</filename>:</emphasis> | ||
7053 | Returns "True" if <filename>pkg</filename> is in the | ||
7054 | installed package list of the image, which is based | ||
7055 | on the manifest file that is generated during the | ||
7056 | <filename>do_rootfs</filename> task. | ||
7057 | </para></listitem> | ||
7058 | <listitem><para><emphasis><filename>hasFeature(feature)</filename>:</emphasis> | ||
7059 | Returns "True" if the feature is in | ||
7060 | <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink> | ||
7061 | or | ||
7062 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></ulink>. | ||
7063 | </para></listitem> | ||
7064 | </itemizedlist> | ||
7065 | </para> | ||
7066 | </section> | ||
7067 | |||
7068 | <section id='qemu-image-writing-tests-class-attributes'> | ||
7069 | <title>Class Attributes</title> | ||
7070 | |||
7071 | <para> | ||
7072 | Class attributes are as follows: | ||
7073 | <itemizedlist> | ||
7074 | <listitem><para><emphasis><filename>pscmd</filename>:</emphasis> | ||
7075 | Equals "ps -ef" if <filename>procps</filename> is | ||
7076 | installed in the image. | ||
7077 | Otherwise, <filename>pscmd</filename> equals | ||
7078 | "ps" (busybox). | ||
7079 | </para></listitem> | ||
7080 | <listitem><para><emphasis><filename>tc</filename>:</emphasis> | ||
7081 | The called text context, which gives access to the | ||
7082 | following attributes: | ||
7083 | <itemizedlist> | ||
7084 | <listitem><para><emphasis><filename>d</filename>:</emphasis> | ||
7085 | The BitBake datastore, which allows you to | ||
7086 | use stuff such as | ||
7087 | <filename>oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager")</filename>. | ||
7088 | </para></listitem> | ||
7089 | <listitem><para><emphasis><filename>testslist</filename> and <filename>testsrequired</filename>:</emphasis> | ||
7090 | Used internally. | ||
7091 | The tests do not need these. | ||
7092 | </para></listitem> | ||
7093 | <listitem><para><emphasis><filename>filesdir</filename>:</emphasis> | ||
7094 | The absolute path to | ||
7095 | <filename>meta/lib/oeqa/runtime/files</filename>, | ||
7096 | which contains helper files for tests meant | ||
7097 | for copying on the target such as small | ||
7098 | files written in C for compilation. | ||
7099 | </para></listitem> | ||
7100 | <listitem><para><emphasis><filename>target</filename>:</emphasis> | ||
7101 | The target controller object used to deploy | ||
7102 | and start an image on a particular target | ||
7103 | (e.g. QemuTarget, SimpleRemote, and | ||
7104 | GummibootTarget). | ||
7105 | Tests usually use the following: | ||
7106 | <itemizedlist> | ||
7107 | <listitem><para><emphasis><filename>ip</filename>:</emphasis> | ||
7108 | The target's IP address. | ||
7109 | </para></listitem> | ||
7110 | <listitem><para><emphasis><filename>server_ip</filename>:</emphasis> | ||
7111 | The host's IP address, which is | ||
7112 | usually used by the "smart" test | ||
7113 | suite. | ||
7114 | </para></listitem> | ||
7115 | <listitem><para><emphasis><filename>run(cmd, timeout=None)</filename>:</emphasis> | ||
7116 | The single, most used method. | ||
7117 | This command is a wrapper for: | ||
7118 | <filename>ssh root@host "cmd"</filename>. | ||
7119 | The command returns a tuple: | ||
7120 | (status, output), which are what | ||
7121 | their names imply - the return code | ||
7122 | of 'cmd' and whatever output | ||
7123 | it produces. | ||
7124 | The optional timeout argument | ||
7125 | represents the number of seconds the | ||
7126 | test should wait for 'cmd' to | ||
7127 | return. | ||
7128 | If the argument is "None", the | ||
7129 | test uses the default instance's | ||
7130 | timeout period, which is 300 | ||
7131 | seconds. | ||
7132 | If the argument is "0", the test | ||
7133 | runs until the command returns. | ||
7134 | </para></listitem> | ||
7135 | <listitem><para><emphasis><filename>copy_to(localpath, remotepath)</filename>:</emphasis> | ||
7136 | <filename>scp localpath root@ip:remotepath</filename>. | ||
7137 | </para></listitem> | ||
7138 | <listitem><para><emphasis><filename>copy_from(remotepath, localpath)</filename>:</emphasis> | ||
7139 | <filename>scp root@host:remotepath localpath</filename>. | ||
7140 | </para></listitem> | ||
7141 | </itemizedlist></para></listitem> | ||
7142 | </itemizedlist></para></listitem> | ||
7143 | </itemizedlist> | ||
7144 | </para> | ||
7145 | </section> | ||
7146 | |||
7147 | <section id='qemu-image-writing-tests-instance-attributes'> | ||
7148 | <title>Instance Attributes</title> | ||
7149 | |||
7150 | <para> | ||
7151 | A single instance attribute exists, which is | ||
7152 | <filename>target</filename>. | ||
7153 | The <filename>target</filename> instance attribute is | ||
7154 | identical to the class attribute of the same name, which | ||
7155 | is described in the previous section. | ||
7156 | This attribute exists as both an instance and class | ||
7157 | attribute so tests can use | ||
7158 | <filename>self.target.run(cmd)</filename> in instance | ||
7159 | methods instead of | ||
7160 | <filename>oeRuntimeTest.tc.target.run(cmd)</filename>. | ||
7161 | </para> | ||
7162 | </section> | ||
7163 | </section> | ||
7164 | </section> | ||
7165 | |||
7166 | <section id="platdev-gdb-remotedebug"> | ||
7167 | <title>Debugging With the GNU Project Debugger (GDB) Remotely</title> | ||
7168 | |||
7169 | <para> | ||
7170 | GDB allows you to examine running programs, which in turn helps you to understand and fix problems. | ||
7171 | It also allows you to perform post-mortem style analysis of program crashes. | ||
7172 | GDB is available as a package within the Yocto Project and is | ||
7173 | installed in SDK images by default. | ||
7174 | See the "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" chapter | ||
7175 | in the Yocto Project Reference Manual for a description of these images. | ||
7176 | You can find information on GDB at <ulink url="http://sourceware.org/gdb/"/>. | ||
7177 | </para> | ||
7178 | |||
7179 | <tip> | ||
7180 | For best results, install DBG (<filename>-dbg</filename>) packages | ||
7181 | for the applications you are going to debug. | ||
7182 | Doing so makes extra debug symbols available that give you more | ||
7183 | meaningful output. | ||
7184 | </tip> | ||
7185 | |||
7186 | <para> | ||
7187 | Sometimes, due to memory or disk space constraints, it is not possible | ||
7188 | to use GDB directly on the remote target to debug applications. | ||
7189 | These constraints arise because GDB needs to load the debugging information and the | ||
7190 | binaries of the process being debugged. | ||
7191 | Additionally, GDB needs to perform many computations to locate information such as function | ||
7192 | names, variable names and values, stack traces and so forth - even before starting the | ||
7193 | debugging process. | ||
7194 | These extra computations place more load on the target system and can alter the | ||
7195 | characteristics of the program being debugged. | ||
7196 | </para> | ||
7197 | |||
7198 | <para> | ||
7199 | To help get past the previously mentioned constraints, you can use Gdbserver. | ||
7200 | Gdbserver runs on the remote target and does not load any debugging information | ||
7201 | from the debugged process. | ||
7202 | Instead, a GDB instance processes the debugging information that is run on a | ||
7203 | remote computer - the host GDB. | ||
7204 | The host GDB then sends control commands to Gdbserver to make it stop or start the debugged | ||
7205 | program, as well as read or write memory regions of that debugged program. | ||
7206 | All the debugging information loaded and processed as well | ||
7207 | as all the heavy debugging is done by the host GDB. | ||
7208 | Offloading these processes gives the Gdbserver running on the target a chance to remain | ||
7209 | small and fast. | ||
7210 | </para> | ||
7211 | |||
7212 | <para> | ||
7213 | Because the host GDB is responsible for loading the debugging information and | ||
7214 | for doing the necessary processing to make actual debugging happen, the | ||
7215 | user has to make sure the host can access the unstripped binaries complete | ||
7216 | with their debugging information and also be sure the target is compiled with no optimizations. | ||
7217 | The host GDB must also have local access to all the libraries used by the | ||
7218 | debugged program. | ||
7219 | Because Gdbserver does not need any local debugging information, the binaries on | ||
7220 | the remote target can remain stripped. | ||
7221 | However, the binaries must also be compiled without optimization | ||
7222 | so they match the host's binaries. | ||
7223 | </para> | ||
7224 | |||
7225 | <para> | ||
7226 | To remain consistent with GDB documentation and terminology, the binary being debugged | ||
7227 | on the remote target machine is referred to as the "inferior" binary. | ||
7228 | For documentation on GDB see the | ||
7229 | <ulink url="http://sourceware.org/gdb/documentation/">GDB site</ulink>. | ||
7230 | </para> | ||
7231 | |||
7232 | <para> | ||
7233 | The remainder of this section describes the steps you need to take | ||
7234 | to debug using the GNU project debugger. | ||
7235 | </para> | ||
7236 | |||
7237 | <section id='platdev-gdb-remotedebug-setup'> | ||
7238 | <title>Set Up the Cross-Development Debugging Environment</title> | ||
7239 | |||
7240 | <para> | ||
7241 | Before you can initiate a remote debugging session, you need | ||
7242 | to be sure you have set up the cross-development environment, | ||
7243 | toolchain, and sysroot. | ||
7244 | The "<ulink url='&YOCTO_DOCS_ADT_URL;#adt-prepare'>Preparing for Application Development</ulink>" | ||
7245 | chapter of the Yocto Project Application Developer's Guide | ||
7246 | describes this process. | ||
7247 | Be sure you have read that chapter and have set up | ||
7248 | your environment. | ||
7249 | </para> | ||
7250 | </section> | ||
7251 | |||
7252 | <section id="platdev-gdb-remotedebug-launch-gdbserver"> | ||
7253 | <title>Launch Gdbserver on the Target</title> | ||
7254 | |||
7255 | <para> | ||
7256 | Make sure Gdbserver is installed on the target. | ||
7257 | If it is not, install the package | ||
7258 | <filename>gdbserver</filename>, which needs the | ||
7259 | <filename>libthread-db1</filename> package. | ||
7260 | </para> | ||
7261 | |||
7262 | <para> | ||
7263 | Here is an example that when entered from the host | ||
7264 | connects to the target and launches Gdbserver in order to | ||
7265 | "debug" a binary named <filename>helloworld</filename>: | ||
7266 | <literallayout class='monospaced'> | ||
7267 | $ gdbserver localhost:2345 /usr/bin/helloworld | ||
7268 | </literallayout> | ||
7269 | Gdbserver should now be listening on port 2345 for debugging | ||
7270 | commands coming from a remote GDB process that is running on | ||
7271 | the host computer. | ||
7272 | Communication between Gdbserver and the host GDB are done | ||
7273 | using TCP. | ||
7274 | To use other communication protocols, please refer to the | ||
7275 | <ulink url='http://www.gnu.org/software/gdb/'>Gdbserver documentation</ulink>. | ||
7276 | </para> | ||
7277 | </section> | ||
7278 | |||
7279 | <section id="platdev-gdb-remotedebug-launch-gdb"> | ||
7280 | <title>Launch GDB on the Host Computer</title> | ||
7281 | |||
7282 | <para> | ||
7283 | Running GDB on the host computer takes a number of stages, which | ||
7284 | this section describes. | ||
7285 | </para> | ||
7286 | |||
7287 | <section id="platdev-gdb-remotedebug-launch-gdb-buildcross"> | ||
7288 | <title>Build the Cross-GDB Package</title> | ||
7289 | <para> | ||
7290 | A suitable GDB cross-binary is required that runs on your | ||
7291 | host computer but also knows about the the ABI of the | ||
7292 | remote target. | ||
7293 | You can get this binary from the | ||
7294 | <link linkend='cross-development-toolchain'>Cross-Development Toolchain</link>. | ||
7295 | Here is an example where the toolchain has been installed | ||
7296 | in the default directory | ||
7297 | <filename>/opt/poky/&DISTRO;</filename>: | ||
7298 | <literallayout class='monospaced'> | ||
7299 | /opt/poky/&DISTRO;/sysroots/i686-pokysdk-linux/usr/bin/armv7a-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb | ||
7300 | </literallayout> | ||
7301 | where <filename>arm</filename> is the target architecture | ||
7302 | and <filename>linux-gnueabi</filename> is the target ABI. | ||
7303 | </para> | ||
7304 | |||
7305 | <para> | ||
7306 | Alternatively, you can use BitBake to build the | ||
7307 | <filename>gdb-cross</filename> binary. | ||
7308 | Here is an example: | ||
7309 | <literallayout class='monospaced'> | ||
7310 | $ bitbake gdb-cross | ||
7311 | </literallayout> | ||
7312 | Once the binary is built, you can find it here: | ||
7313 | <literallayout class='monospaced'> | ||
7314 | tmp/sysroots/<host-arch>/usr/bin/<target-platform>/<target-abi>-gdb | ||
7315 | </literallayout> | ||
7316 | </para> | ||
7317 | </section> | ||
7318 | |||
7319 | <section id='create-the-gdb-initialization-file'> | ||
7320 | <title>Create the GDB Initialization File and Point to Your Root Filesystem</title> | ||
7321 | |||
7322 | <para> | ||
7323 | Aside from the GDB cross-binary, you also need a GDB | ||
7324 | initialization file in the same top directory in which | ||
7325 | your binary resides. | ||
7326 | When you start GDB on your host development system, GDB | ||
7327 | finds this initialization file and executes all the | ||
7328 | commands within. | ||
7329 | For information on the <filename>.gdbinit</filename>, see | ||
7330 | "<ulink url='http://sourceware.org/gdb/onlinedocs/gdb/'>Debugging with GDB</ulink>", | ||
7331 | which is maintained by | ||
7332 | <ulink url='http://www.sourceware.org'>sourceware.org</ulink>. | ||
7333 | </para> | ||
7334 | |||
7335 | <para> | ||
7336 | You need to add a statement in the | ||
7337 | <filename>.gdbinit</filename> file that points to your | ||
7338 | root filesystem. | ||
7339 | Here is an example that points to the root filesystem for | ||
7340 | an ARM-based target device: | ||
7341 | <literallayout class='monospaced'> | ||
7342 | set sysroot /home/jzhang/sysroot_arm | ||
7343 | </literallayout> | ||
7344 | </para> | ||
7345 | </section> | ||
7346 | |||
7347 | <section id="platdev-gdb-remotedebug-launch-gdb-launchhost"> | ||
7348 | <title>Launch the Host GDB</title> | ||
7349 | |||
7350 | <para> | ||
7351 | Before launching the host GDB, you need to be sure | ||
7352 | you have sourced the cross-debugging environment script, | ||
7353 | which if you installed the root filesystem in the default | ||
7354 | location is at <filename>/opt/poky/&DISTRO;</filename> | ||
7355 | and begins with the string "environment-setup". | ||
7356 | For more information, see the | ||
7357 | "<ulink url='&YOCTO_DOCS_ADT_URL;#setting-up-the-cross-development-environment'>Setting Up the Cross-Development Environment</ulink>" | ||
7358 | section in the Yocto Project Application Developer's | ||
7359 | Guide. | ||
7360 | </para> | ||
7361 | |||
7362 | <para> | ||
7363 | Finally, switch to the directory where the binary resides | ||
7364 | and run the <filename>cross-gdb</filename> binary. | ||
7365 | Provide the binary file you are going to debug. | ||
7366 | For example, the following command continues with the | ||
7367 | example used in the previous section by loading | ||
7368 | the <filename>helloworld</filename> binary as well as the | ||
7369 | debugging information: | ||
7370 | <literallayout class='monospaced'> | ||
7371 | $ arm-poky-linux-gnuabi-gdb helloworld | ||
7372 | </literallayout> | ||
7373 | The commands in your <filename>.gdbinit</filename> execute | ||
7374 | and the GDB prompt appears. | ||
7375 | </para> | ||
7376 | </section> | ||
7377 | </section> | ||
7378 | |||
7379 | <section id='platdev-gdb-connect-to-the-remote-gdb-server'> | ||
7380 | <title>Connect to the Remote GDB Server</title> | ||
7381 | |||
7382 | <para> | ||
7383 | From the target, you need to connect to the remote GDB | ||
7384 | server that is running on the host. | ||
7385 | You need to specify the remote host and port. | ||
7386 | Here is the command continuing with the example: | ||
7387 | <literallayout class='monospaced'> | ||
7388 | target remote 192.168.7.2:2345 | ||
7389 | </literallayout> | ||
7390 | </para> | ||
7391 | </section> | ||
7392 | |||
7393 | <section id="platdev-gdb-remotedebug-launch-gdb-using"> | ||
7394 | <title>Use the Debugger</title> | ||
7395 | |||
7396 | <para> | ||
7397 | You can now proceed with debugging as normal - as if you were debugging | ||
7398 | on the local machine. | ||
7399 | For example, to instruct GDB to break in the "main" function and then | ||
7400 | continue with execution of the inferior binary use the following commands | ||
7401 | from within GDB: | ||
7402 | <literallayout class='monospaced'> | ||
7403 | (gdb) break main | ||
7404 | (gdb) continue | ||
7405 | </literallayout> | ||
7406 | </para> | ||
7407 | |||
7408 | <para> | ||
7409 | For more information about using GDB, see the project's online documentation at | ||
7410 | <ulink url="http://sourceware.org/gdb/download/onlinedocs/"/>. | ||
7411 | </para> | ||
7412 | </section> | ||
7413 | </section> | ||
7414 | |||
7415 | <section id='debugging-parallel-make-races'> | ||
7416 | <title>Debugging Parallel Make Races</title> | ||
7417 | |||
7418 | <para> | ||
7419 | A parallel <filename>make</filename> race occurs when the build | ||
7420 | consists of several parts that are run simultaneously and | ||
7421 | a situation occurs when the output or result of one | ||
7422 | part is not ready for use with a different part of the build that | ||
7423 | depends on that output. | ||
7424 | Parallel make races are annoying and can sometimes be difficult | ||
7425 | to reproduce and fix. | ||
7426 | However, some simple tips and tricks exist that can help | ||
7427 | you debug and fix them. | ||
7428 | This section presents a real-world example of an error encountered | ||
7429 | on the Yocto Project autobuilder and the process used to fix it. | ||
7430 | </para> | ||
7431 | |||
7432 | <section id='the-failure'> | ||
7433 | <title>The Failure</title> | ||
7434 | |||
7435 | <para> | ||
7436 | For this example, assume that you are building an image that | ||
7437 | depends on the "neard" package. | ||
7438 | And, during the build, BitBake runs into problems and | ||
7439 | creates the following output. | ||
7440 | <note> | ||
7441 | This example log file has longer lines artificially | ||
7442 | broken to make the listing easier to read. | ||
7443 | </note> | ||
7444 | If you examine the output or the log file, you see the | ||
7445 | failure during <filename>make</filename>: | ||
7446 | <literallayout class='monospaced'> | ||
7447 | | DEBUG: SITE files ['endian-little', 'bit-32', 'ix86-common', 'common-linux', 'common-glibc', 'i586-linux', 'common'] | ||
7448 | | DEBUG: Executing shell function do_compile | ||
7449 | | NOTE: make -j 16 | ||
7450 | | make --no-print-directory all-am | ||
7451 | | /bin/mkdir -p include/near | ||
7452 | | /bin/mkdir -p include/near | ||
7453 | | /bin/mkdir -p include/near | ||
7454 | | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/ | ||
7455 | 0.14-r0/neard-0.14/include/types.h include/near/types.h | ||
7456 | | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/ | ||
7457 | 0.14-r0/neard-0.14/include/log.h include/near/log.h | ||
7458 | | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/ | ||
7459 | 0.14-r0/neard-0.14/include/plugin.h include/near/plugin.h | ||
7460 | | /bin/mkdir -p include/near | ||
7461 | | /bin/mkdir -p include/near | ||
7462 | | /bin/mkdir -p include/near | ||
7463 | | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/ | ||
7464 | 0.14-r0/neard-0.14/include/tag.h include/near/tag.h | ||
7465 | | /bin/mkdir -p include/near | ||
7466 | | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/ | ||
7467 | 0.14-r0/neard-0.14/include/adapter.h include/near/adapter.h | ||
7468 | | /bin/mkdir -p include/near | ||
7469 | | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/ | ||
7470 | 0.14-r0/neard-0.14/include/ndef.h include/near/ndef.h | ||
7471 | | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/ | ||
7472 | 0.14-r0/neard-0.14/include/tlv.h include/near/tlv.h | ||
7473 | | /bin/mkdir -p include/near | ||
7474 | | /bin/mkdir -p include/near | ||
7475 | | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/ | ||
7476 | 0.14-r0/neard-0.14/include/setting.h include/near/setting.h | ||
7477 | | /bin/mkdir -p include/near | ||
7478 | | /bin/mkdir -p include/near | ||
7479 | | /bin/mkdir -p include/near | ||
7480 | | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/ | ||
7481 | 0.14-r0/neard-0.14/include/device.h include/near/device.h | ||
7482 | | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/ | ||
7483 | 0.14-r0/neard-0.14/include/nfc_copy.h include/near/nfc_copy.h | ||
7484 | | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/ | ||
7485 | 0.14-r0/neard-0.14/include/snep.h include/near/snep.h | ||
7486 | | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/ | ||
7487 | 0.14-r0/neard-0.14/include/version.h include/near/version.h | ||
7488 | | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/ | ||
7489 | 0.14-r0/neard-0.14/include/dbus.h include/near/dbus.h | ||
7490 | | ./src/genbuiltin nfctype1 nfctype2 nfctype3 nfctype4 p2p > src/builtin.h | ||
7491 | | i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/ | ||
7492 | build/build/tmp/sysroots/qemux86 -DHAVE_CONFIG_H -I. -I./include -I./src -I./gdbus -I/home/pokybuild/ | ||
7493 | yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/sysroots/qemux86/usr/include/glib-2.0 | ||
7494 | -I/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/sysroots/qemux86/usr/ | ||
7495 | lib/glib-2.0/include -I/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/ | ||
7496 | tmp/sysroots/qemux86/usr/include/dbus-1.0 -I/home/pokybuild/yocto-autobuilder/yocto-slave/ | ||
7497 | nightly-x86/build/build/tmp/sysroots/qemux86/usr/lib/dbus-1.0/include -I/home/pokybuild/yocto-autobuilder/ | ||
7498 | yocto-slave/nightly-x86/build/build/tmp/sysroots/qemux86/usr/include/libnl3 | ||
7499 | -DNEAR_PLUGIN_BUILTIN -DPLUGINDIR=\""/usr/lib/near/plugins"\" | ||
7500 | -DCONFIGDIR=\""/etc/neard\"" -O2 -pipe -g -feliminate-unused-debug-types -c | ||
7501 | -o tools/snep-send.o tools/snep-send.c | ||
7502 | | In file included from tools/snep-send.c:16:0: | ||
7503 | | tools/../src/near.h:41:23: fatal error: near/dbus.h: No such file or directory | ||
7504 | | #include <near/dbus.h> | ||
7505 | | ^ | ||
7506 | | compilation terminated. | ||
7507 | | make[1]: *** [tools/snep-send.o] Error 1 | ||
7508 | | make[1]: *** Waiting for unfinished jobs.... | ||
7509 | | make: *** [all] Error 2 | ||
7510 | | ERROR: oe_runmake failed | ||
7511 | </literallayout> | ||
7512 | </para> | ||
7513 | </section> | ||
7514 | |||
7515 | <section id='reproducing-the-error'> | ||
7516 | <title>Reproducing the Error</title> | ||
7517 | |||
7518 | <para> | ||
7519 | Because race conditions are intermittent, they do not | ||
7520 | manifest themselves every time you do the build. | ||
7521 | In fact, most times the build will complete without problems | ||
7522 | even though the potential race condition exists. | ||
7523 | Thus, once the error surfaces, you need a way to reproduce it. | ||
7524 | </para> | ||
7525 | |||
7526 | <para> | ||
7527 | In this example, compiling the "neard" package is causing the | ||
7528 | problem. | ||
7529 | So the first thing to do is build "neard" locally. | ||
7530 | Before you start the build, set the | ||
7531 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></ulink> | ||
7532 | variable in your <filename>local.conf</filename> file to | ||
7533 | a high number (e.g. "-j 20"). | ||
7534 | Using a high value for <filename>PARALLEL_MAKE</filename> | ||
7535 | increases the chances of the race condition showing up: | ||
7536 | <literallayout class='monospaced'> | ||
7537 | $ bitbake neard | ||
7538 | </literallayout> | ||
7539 | </para> | ||
7540 | |||
7541 | <para> | ||
7542 | Once the local build for "neard" completes, start a | ||
7543 | <filename>devshell</filename> build: | ||
7544 | <literallayout class='monospaced'> | ||
7545 | $ bitbake neard -c devshell | ||
7546 | </literallayout> | ||
7547 | For information on how to use a | ||
7548 | <filename>devshell</filename>, see the | ||
7549 | "<link linkend='platdev-appdev-devshell'>Using a Development Shell</link>" | ||
7550 | section. | ||
7551 | </para> | ||
7552 | |||
7553 | <para> | ||
7554 | In the <filename>devshell</filename>, do the following: | ||
7555 | <literallayout class='monospaced'> | ||
7556 | $ make clean | ||
7557 | $ make tools/snep-send.o | ||
7558 | </literallayout> | ||
7559 | The <filename>devshell</filename> commands cause the failure | ||
7560 | to clearly be visible. | ||
7561 | In this case, a missing dependency exists for the "neard" | ||
7562 | Makefile target. | ||
7563 | Here is some abbreviated, sample output with the | ||
7564 | missing dependency clearly visible at the end: | ||
7565 | <literallayout class='monospaced'> | ||
7566 | i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/scott-lenovo/...... | ||
7567 | . | ||
7568 | . | ||
7569 | . | ||
7570 | tools/snep-send.c | ||
7571 | In file included from tools/snep-send.c:16:0: | ||
7572 | tools/../src/near.h:41:23: fatal error: near/dbus.h: No such file or directory | ||
7573 | #include <near/dbus.h> | ||
7574 | ^ | ||
7575 | compilation terminated. | ||
7576 | make: *** [tools/snep-send.o] Error 1 | ||
7577 | $ | ||
7578 | </literallayout> | ||
7579 | </para> | ||
7580 | </section> | ||
7581 | |||
7582 | <section id='creating-a-patch-for-the-fix'> | ||
7583 | <title>Creating a Patch for the Fix</title> | ||
7584 | |||
7585 | <para> | ||
7586 | Because there is a missing dependency for the Makefile | ||
7587 | target, you need to patch the | ||
7588 | <filename>Makefile.am</filename> file, which is generated | ||
7589 | from <filename>Makefile.in</filename>. | ||
7590 | You can use Quilt to create the patch: | ||
7591 | <literallayout class='monospaced'> | ||
7592 | $ quilt new parallelmake.patch | ||
7593 | Patch patches/parallelmake.patch is now on top | ||
7594 | $ quilt add Makefile.am | ||
7595 | File Makefile.am added to patch patches/parallelmake.patch | ||
7596 | </literallayout> | ||
7597 | For more information on using Quilt, see the | ||
7598 | "<link linkend='using-a-quilt-workflow'>Using a Quilt Workflow</link>" | ||
7599 | section. | ||
7600 | </para> | ||
7601 | |||
7602 | <para> | ||
7603 | At this point you need to make the edits to | ||
7604 | <filename>Makefile.am</filename> to add the missing | ||
7605 | dependency. | ||
7606 | For our example, you have to add the following line | ||
7607 | to the file: | ||
7608 | <literallayout class='monospaced'> | ||
7609 | tools/snep-send.$(OBJEXT): include/near/dbus.h | ||
7610 | </literallayout> | ||
7611 | </para> | ||
7612 | |||
7613 | <para> | ||
7614 | Once you have edited the file, use the | ||
7615 | <filename>refresh</filename> command to create the patch: | ||
7616 | <literallayout class='monospaced'> | ||
7617 | $ quilt refresh | ||
7618 | Refreshed patch patches/parallelmake.patch | ||
7619 | </literallayout> | ||
7620 | Once the patch file exists, you need to add it back to the | ||
7621 | originating recipe folder. | ||
7622 | Here is an example assuming a top-level | ||
7623 | <link linkend='source-directory'>Source Directory</link> | ||
7624 | named <filename>poky</filename>: | ||
7625 | <literallayout class='monospaced'> | ||
7626 | $ cp patches/parallelmake.patch poky/meta/recipes-connectivity/neard/neard | ||
7627 | </literallayout> | ||
7628 | The final thing you need to do to implement the fix in the | ||
7629 | build is to update the "neard" recipe (i.e. | ||
7630 | <filename>neard-0.14.bb</filename> so that the | ||
7631 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
7632 | statement includes the patch file. | ||
7633 | The recipe file is in the folder above the patch. | ||
7634 | Here is what the edited <filename>SRC_URI</filename> | ||
7635 | statement would look like: | ||
7636 | <literallayout class='monospaced'> | ||
7637 | SRC_URI = "${KERNELORG_MIRROR}/linux/network/nfc/${BPN}-${PV}.tar.xz \ | ||
7638 | file://neard.in \ | ||
7639 | file://neard.service.in \ | ||
7640 | file://parallelmake.patch \ | ||
7641 | " | ||
7642 | </literallayout> | ||
7643 | </para> | ||
7644 | |||
7645 | <para> | ||
7646 | With the patch complete and moved to the correct folder and | ||
7647 | the <filename>SRC_URI</filename> statement updated, you can | ||
7648 | exit the <filename>devshell</filename>: | ||
7649 | <literallayout class='monospaced'> | ||
7650 | $ exit | ||
7651 | </literallayout> | ||
7652 | </para> | ||
7653 | </section> | ||
7654 | |||
7655 | <section id='testing-the-build'> | ||
7656 | <title>Testing the Build</title> | ||
7657 | |||
7658 | <para> | ||
7659 | With everything in place, you can get back to trying the | ||
7660 | build again locally: | ||
7661 | <literallayout class='monospaced'> | ||
7662 | $ bitbake neard | ||
7663 | </literallayout> | ||
7664 | This build should succeed. | ||
7665 | </para> | ||
7666 | |||
7667 | <para> | ||
7668 | Now you can open up a <filename>devshell</filename> again | ||
7669 | and repeat the clean and make operations as follows: | ||
7670 | <literallayout class='monospaced'> | ||
7671 | $ bitbake neard -c devshell | ||
7672 | $ make clean | ||
7673 | $ make tools/snep-send.o | ||
7674 | </literallayout> | ||
7675 | The build should work without issue. | ||
7676 | </para> | ||
7677 | |||
7678 | <para> | ||
7679 | As with all solved problems, if they originated upstream, you | ||
7680 | need to submit the fix for the recipe in OE-Core and upstream | ||
7681 | so that the problem is taken care of at its source. | ||
7682 | See the | ||
7683 | "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>" | ||
7684 | section for more information. | ||
7685 | </para> | ||
7686 | </section> | ||
7687 | </section> | ||
7688 | |||
7689 | <section id="examining-builds-using-toaster"> | ||
7690 | <title>Examining Builds Using the Toaster API</title> | ||
7691 | |||
7692 | <para> | ||
7693 | Toaster is an Application Programming Interface (API) and | ||
7694 | web-based interface to the OpenEmbedded build system, which uses | ||
7695 | BitBake. | ||
7696 | Both interfaces are based on a Representational State Transfer | ||
7697 | (REST) API that queries for and returns build information using | ||
7698 | <filename>GET</filename> and <filename>JSON</filename>. | ||
7699 | These types of search operations retrieve sets of objects from | ||
7700 | a datastore used to collect build information. | ||
7701 | The results contain all the data for the objects being returned. | ||
7702 | You can order the results of the search by key and the search | ||
7703 | parameters are consistent for all object types. | ||
7704 | </para> | ||
7705 | |||
7706 | <para> | ||
7707 | Using the interfaces you can do the following: | ||
7708 | <itemizedlist> | ||
7709 | <listitem><para>See information about the tasks executed | ||
7710 | and reused during the build.</para></listitem> | ||
7711 | <listitem><para>See what is built (recipes and | ||
7712 | packages) and what packages were installed into the final | ||
7713 | image.</para></listitem> | ||
7714 | <listitem><para>See performance-related information such | ||
7715 | as build time, CPU usage, and disk I/O.</para></listitem> | ||
7716 | <listitem><para>Examine error, warning and trace messages | ||
7717 | to aid in debugging.</para></listitem> | ||
7718 | </itemizedlist> | ||
7719 | </para> | ||
7720 | |||
7721 | <note> | ||
7722 | <para>This release of Toaster provides you with information | ||
7723 | about a BitBake run. | ||
7724 | The tool does not allow you to configure and launch a build. | ||
7725 | However, future development includes plans to integrate the | ||
7726 | configuration and build launching capabilities of | ||
7727 | <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/hob'>Hob</ulink>. | ||
7728 | </para> | ||
7729 | <para>For more information on using Hob to build an image, | ||
7730 | see the | ||
7731 | "<link linkend='image-development-using-hob'>Image Development Using Hob</link>" | ||
7732 | section.</para> | ||
7733 | </note> | ||
7734 | |||
7735 | <para> | ||
7736 | The remainder of this section describes what you need to have in | ||
7737 | place to use Toaster, how to start it, use it, and stop it. | ||
7738 | For additional information on installing and running Toaster, see the | ||
7739 | "<ulink url='https://wiki.yoctoproject.org/wiki/Toaster#Installation_and_Running'>Installation and Running</ulink>" | ||
7740 | section of the "Toaster" wiki page. | ||
7741 | For complete information on the API and its search operation | ||
7742 | URI, parameters, and responses, see the | ||
7743 | <ulink url='https://wiki.yoctoproject.org/wiki/REST_API_Contracts'>REST API Contracts</ulink> | ||
7744 | Wiki page. | ||
7745 | </para> | ||
7746 | |||
7747 | <section id='starting-toaster'> | ||
7748 | <title>Starting Toaster</title> | ||
7749 | |||
7750 | <para> | ||
7751 | Getting set up to use and start Toaster is simple. | ||
7752 | First, be sure you have met the following requirements: | ||
7753 | <itemizedlist> | ||
7754 | <listitem><para>You have set up your | ||
7755 | <link linkend='source-directory'>Source Directory</link> | ||
7756 | by cloning the upstream <filename>poky</filename> | ||
7757 | repository. | ||
7758 | See the | ||
7759 | <link linkend='local-yp-release'>Yocto Project Release</link> | ||
7760 | item for information on how to set up the Source | ||
7761 | Directory.</para></listitem> | ||
7762 | <listitem><para>Be sure your build machine has | ||
7763 | <ulink url='http://en.wikipedia.org/wiki/Django_%28web_framework%29'>Django</ulink> | ||
7764 | version 1.5 installed.</para></listitem> | ||
7765 | <listitem><para>Make sure that port 8000 and 8200 are | ||
7766 | free (i.e. they have no servers on them). | ||
7767 | </para></listitem> | ||
7768 | </itemizedlist> | ||
7769 | </para> | ||
7770 | |||
7771 | <para> | ||
7772 | Once you have met the requirements, follow these steps to | ||
7773 | start Toaster running in the background of your shell: | ||
7774 | <orderedlist> | ||
7775 | <listitem><para><emphasis>Set up your build environment:</emphasis> | ||
7776 | Source a build environment script (i.e. | ||
7777 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> | ||
7778 | or | ||
7779 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>). | ||
7780 | </para></listitem> | ||
7781 | <listitem><para><emphasis>Start Toaster:</emphasis> | ||
7782 | Start the Toaster service using this | ||
7783 | command from within your | ||
7784 | <link linkend='build-directory'>Build Directory</link>: | ||
7785 | <literallayout class='monospaced'> | ||
7786 | $ source toaster start | ||
7787 | </literallayout></para></listitem> | ||
7788 | <note> | ||
7789 | The Toaster must be started and running in order | ||
7790 | for it to collect data. | ||
7791 | </note> | ||
7792 | </orderedlist> | ||
7793 | </para> | ||
7794 | |||
7795 | <para> | ||
7796 | When Toaster starts, it creates some additional files in your | ||
7797 | Build Directory. | ||
7798 | Deleting these files will cause you to lose data or interrupt | ||
7799 | Toaster: | ||
7800 | <itemizedlist> | ||
7801 | <listitem><para><emphasis><filename>toaster.sqlite</filename>:</emphasis> | ||
7802 | Toaster's database file.</para></listitem> | ||
7803 | <listitem><para><emphasis><filename>toaster_web.log</filename>:</emphasis> | ||
7804 | The log file of the web server.</para></listitem> | ||
7805 | <listitem><para><emphasis><filename>toaster_ui.log</filename>:</emphasis> | ||
7806 | The log file of the user interface component. | ||
7807 | </para></listitem> | ||
7808 | <listitem><para><emphasis><filename>toastermain.pid</filename>:</emphasis> | ||
7809 | The PID of the web server.</para></listitem> | ||
7810 | <listitem><para><emphasis><filename>toasterui.pid</filename>:</emphasis> | ||
7811 | The PID of the DSI data bridge.</para></listitem> | ||
7812 | <listitem><para><emphasis><filename>bitbake-cookerdaemon.log</filename>:</emphasis> | ||
7813 | The BitBake server's log file.</para></listitem> | ||
7814 | </itemizedlist> | ||
7815 | </para> | ||
7816 | </section> | ||
7817 | |||
7818 | <section id='using-toaster'> | ||
7819 | <title>Using Toaster</title> | ||
7820 | |||
7821 | <para> | ||
7822 | Once Toaster is running, it logs information for any BitBake | ||
7823 | run from your Build Directory. | ||
7824 | This logging is automatic. | ||
7825 | All you need to do is access and use the information. | ||
7826 | </para> | ||
7827 | |||
7828 | <para> | ||
7829 | You access the information one of two ways: | ||
7830 | <itemizedlist> | ||
7831 | <listitem><para>Open a Browser and enter | ||
7832 | <filename>http://localhost:8000</filename> | ||
7833 | for the URL. | ||
7834 | </para></listitem> | ||
7835 | <listitem><para>Use the <filename>xdg-open</filename> | ||
7836 | tool from the shell and pass it the same URL. | ||
7837 | </para></listitem> | ||
7838 | </itemizedlist> | ||
7839 | Either method opens the home page for the Toaster interface. | ||
7840 | </para> | ||
7841 | |||
7842 | <note><title>Notes</title> | ||
7843 | <para> | ||
7844 | For information on how to delete information from the Toaster | ||
7845 | database, see the | ||
7846 | <ulink url='https://wiki.yoctoproject.org/wiki/Toaster#Deleting_a_Build_from_the_Toaster_Database'>Deleting a Build from the Toaster Database</ulink> | ||
7847 | wiki page. | ||
7848 | </para> | ||
7849 | |||
7850 | <para> | ||
7851 | For information on how to set up an instance of Toaster on | ||
7852 | a remote host, see the | ||
7853 | <ulink url='https://wiki.yoctoproject.org/wiki/Toaster#Setting_up_a_Toaster_Instance_on_a_Remote_Host'>Setting Up a Toaster Instance on a Remote Host</ulink> | ||
7854 | wiki page. | ||
7855 | </para> | ||
7856 | </note> | ||
7857 | </section> | ||
7858 | |||
7859 | <section id='examining-toaster-data'> | ||
7860 | <title>Examining Toaster Data</title> | ||
7861 | |||
7862 | <para> | ||
7863 | The Toaster database is persistent regardless of whether you | ||
7864 | start or stop the service. | ||
7865 | </para> | ||
7866 | |||
7867 | <para> | ||
7868 | Toaster's interface shows you a list of builds | ||
7869 | (successful and unsuccessful) for which it has data. | ||
7870 | You can click on any build to see related information. | ||
7871 | This information includes configuration details, information | ||
7872 | about tasks, all recipes and packages built and their | ||
7873 | dependencies, packages and their directory structure as | ||
7874 | installed in your final image, | ||
7875 | execution time, CPU usage and disk I/O per task. | ||
7876 | </para> | ||
7877 | |||
7878 | <para> | ||
7879 | For details on the interface, see the | ||
7880 | <ulink url='https://www.yoctoproject.org/documentation/toaster-manual'>Toaster Manual</ulink>. | ||
7881 | </para> | ||
7882 | </section> | ||
7883 | |||
7884 | <section id='stopping-toaster'> | ||
7885 | <title>Stopping Toaster</title> | ||
7886 | |||
7887 | <para> | ||
7888 | Stop the Toaster service with the following command | ||
7889 | from with the | ||
7890 | <link linkend='build-directory'>Build Directory</link>: | ||
7891 | <literallayout class='monospaced'> | ||
7892 | $ source toaster stop | ||
7893 | </literallayout> | ||
7894 | The service stops but the Toaster database remains persistent. | ||
7895 | </para> | ||
7896 | </section> | ||
7897 | </section> | ||
7898 | |||
7899 | <section id="platdev-oprofile"> | ||
7900 | <title>Profiling with OProfile</title> | ||
7901 | |||
7902 | <para> | ||
7903 | <ulink url="http://oprofile.sourceforge.net/">OProfile</ulink> is a | ||
7904 | statistical profiler well suited for finding performance | ||
7905 | bottlenecks in both user-space software and in the kernel. | ||
7906 | This profiler provides answers to questions like "Which functions does my application spend | ||
7907 | the most time in when doing X?" | ||
7908 | Because the OpenEmbedded build system is well integrated with OProfile, it makes profiling | ||
7909 | applications on target hardware straight forward. | ||
7910 | <note> | ||
7911 | For more information on how to set up and run OProfile, see the | ||
7912 | "<ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual-oprofile'>oprofile</ulink>" | ||
7913 | section in the Yocto Project Profiling and Tracing Manual. | ||
7914 | </note> | ||
7915 | </para> | ||
7916 | |||
7917 | <para> | ||
7918 | To use OProfile, you need an image that has OProfile installed. | ||
7919 | The easiest way to do this is with "tools-profile" in the | ||
7920 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'>IMAGE_FEATURES</ulink></filename> variable. | ||
7921 | You also need debugging symbols to be available on the system where the analysis | ||
7922 | takes place. | ||
7923 | You can gain access to the symbols by using "dbg-pkgs" in the | ||
7924 | <filename>IMAGE_FEATURES</filename> variable or by | ||
7925 | installing the appropriate DBG (<filename>-dbg</filename>) packages. | ||
7926 | </para> | ||
7927 | |||
7928 | <para> | ||
7929 | For successful call graph analysis, the binaries must preserve the frame | ||
7930 | pointer register and should also be compiled with the | ||
7931 | <filename>-fno-omit-framepointer</filename> flag. | ||
7932 | You can achieve this by setting the | ||
7933 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SELECTED_OPTIMIZATION'>SELECTED_OPTIMIZATION</ulink></filename> | ||
7934 | variable with the following options: | ||
7935 | <literallayout class='monospaced'> | ||
7936 | -fexpensive-optimizations | ||
7937 | -fno-omit-framepointer | ||
7938 | -frename-registers | ||
7939 | -O2 | ||
7940 | </literallayout> | ||
7941 | You can also achieve it by setting the | ||
7942 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-DEBUG_BUILD'>DEBUG_BUILD</ulink></filename> | ||
7943 | variable to "1" in the <filename>local.conf</filename> configuration file. | ||
7944 | If you use the <filename>DEBUG_BUILD</filename> variable, | ||
7945 | you also add extra debugging information that can make the debug | ||
7946 | packages large. | ||
7947 | </para> | ||
7948 | |||
7949 | <section id="platdev-oprofile-target"> | ||
7950 | <title>Profiling on the Target</title> | ||
7951 | |||
7952 | <para> | ||
7953 | Using OProfile, you can perform all the profiling work on the target device. | ||
7954 | A simple OProfile session might look like the following: | ||
7955 | </para> | ||
7956 | |||
7957 | <para> | ||
7958 | <literallayout class='monospaced'> | ||
7959 | # opcontrol --reset | ||
7960 | # opcontrol --start --separate=lib --no-vmlinux -c 5 | ||
7961 | . | ||
7962 | . | ||
7963 | [do whatever is being profiled] | ||
7964 | . | ||
7965 | . | ||
7966 | # opcontrol --stop | ||
7967 | $ opreport -cl | ||
7968 | </literallayout> | ||
7969 | </para> | ||
7970 | |||
7971 | <para> | ||
7972 | In this example, the <filename>reset</filename> command clears any previously profiled data. | ||
7973 | The next command starts OProfile. | ||
7974 | The options used when starting the profiler separate dynamic library data | ||
7975 | within applications, disable kernel profiling, and enable callgraphing up to | ||
7976 | five levels deep. | ||
7977 | <note> | ||
7978 | To profile the kernel, you would specify the | ||
7979 | <filename>--vmlinux=/path/to/vmlinux</filename> option. | ||
7980 | The <filename>vmlinux</filename> file is usually in the source directory in the | ||
7981 | <filename>/boot/</filename> directory and must match the running kernel. | ||
7982 | </note> | ||
7983 | </para> | ||
7984 | |||
7985 | <para> | ||
7986 | After you perform your profiling tasks, the next command stops the profiler. | ||
7987 | After that, you can view results with the <filename>opreport</filename> command with options | ||
7988 | to see the separate library symbols and callgraph information. | ||
7989 | </para> | ||
7990 | |||
7991 | <para> | ||
7992 | Callgraphing logs information about time spent in functions and about a function's | ||
7993 | calling function (parent) and called functions (children). | ||
7994 | The higher the callgraphing depth, the more accurate the results. | ||
7995 | However, higher depths also increase the logging overhead. | ||
7996 | Consequently, you should take care when setting the callgraphing depth. | ||
7997 | <note> | ||
7998 | On ARM, binaries need to have the frame pointer enabled for callgraphing to work. | ||
7999 | To accomplish this use the <filename>-fno-omit-framepointer</filename> option | ||
8000 | with <filename>gcc</filename>. | ||
8001 | </note> | ||
8002 | </para> | ||
8003 | |||
8004 | <para> | ||
8005 | For more information on using OProfile, see the OProfile | ||
8006 | online documentation at | ||
8007 | <ulink url="http://oprofile.sourceforge.net/docs/"/>. | ||
8008 | </para> | ||
8009 | </section> | ||
8010 | |||
8011 | <section id="platdev-oprofile-oprofileui"> | ||
8012 | <title>Using OProfileUI</title> | ||
8013 | |||
8014 | <para> | ||
8015 | A graphical user interface for OProfile is also available. | ||
8016 | You can download and build this interface from the Yocto Project at | ||
8017 | <ulink url="&YOCTO_GIT_URL;/cgit.cgi/oprofileui/"></ulink>. | ||
8018 | If the "tools-profile" image feature is selected, all necessary binaries | ||
8019 | are installed onto the target device for OProfileUI interaction. | ||
8020 | For a list of image features that ship with the Yocto Project, | ||
8021 | see the | ||
8022 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-features-image'>Image Features</ulink>" | ||
8023 | section in the Yocto Project Reference Manual. | ||
8024 | </para> | ||
8025 | |||
8026 | <para> | ||
8027 | Even though the source directory usually includes all needed patches on the target device, you | ||
8028 | might find you need other OProfile patches for recent OProfileUI features. | ||
8029 | If so, see the <ulink url='&YOCTO_GIT_URL;/cgit.cgi/oprofileui/tree/README'> | ||
8030 | OProfileUI README</ulink> for the most recent information. | ||
8031 | </para> | ||
8032 | |||
8033 | <section id="platdev-oprofile-oprofileui-online"> | ||
8034 | <title>Online Mode</title> | ||
8035 | |||
8036 | <para> | ||
8037 | Using OProfile in online mode assumes a working network connection with the target | ||
8038 | hardware. | ||
8039 | With this connection, you just need to run "oprofile-server" on the device. | ||
8040 | By default, OProfile listens on port 4224. | ||
8041 | <note> | ||
8042 | You can change the port using the <filename>--port</filename> command-line | ||
8043 | option. | ||
8044 | </note> | ||
8045 | </para> | ||
8046 | |||
8047 | <para> | ||
8048 | The client program is called <filename>oprofile-viewer</filename> and its UI is relatively | ||
8049 | straight forward. | ||
8050 | You access key functionality through the buttons on the toolbar, which | ||
8051 | are duplicated in the menus. | ||
8052 | Here are the buttons: | ||
8053 | <itemizedlist> | ||
8054 | <listitem><para><emphasis>Connect:</emphasis> Connects to the remote host. | ||
8055 | You can also supply the IP address or hostname.</para></listitem> | ||
8056 | <listitem><para><emphasis>Disconnect:</emphasis> Disconnects from the target. | ||
8057 | </para></listitem> | ||
8058 | <listitem><para><emphasis>Start:</emphasis> Starts profiling on the device. | ||
8059 | </para></listitem> | ||
8060 | <listitem><para><emphasis>Stop:</emphasis> Stops profiling on the device and | ||
8061 | downloads the data to the local host. | ||
8062 | Stopping the profiler generates the profile and displays it in the viewer. | ||
8063 | </para></listitem> | ||
8064 | <listitem><para><emphasis>Download:</emphasis> Downloads the data from the | ||
8065 | target and generates the profile, which appears in the viewer.</para></listitem> | ||
8066 | <listitem><para><emphasis>Reset:</emphasis> Resets the sample data on the device. | ||
8067 | Resetting the data removes sample information collected from previous | ||
8068 | sampling runs. | ||
8069 | Be sure you reset the data if you do not want to include old sample information. | ||
8070 | </para></listitem> | ||
8071 | <listitem><para><emphasis>Save:</emphasis> Saves the data downloaded from the | ||
8072 | target to another directory for later examination.</para></listitem> | ||
8073 | <listitem><para><emphasis>Open:</emphasis> Loads previously saved data. | ||
8074 | </para></listitem> | ||
8075 | </itemizedlist> | ||
8076 | </para> | ||
8077 | |||
8078 | <para> | ||
8079 | The client downloads the complete profile archive from | ||
8080 | the target to the host for processing. | ||
8081 | This archive is a directory that contains the sample data, the object files, | ||
8082 | and the debug information for the object files. | ||
8083 | The archive is then converted using the <filename>oparchconv</filename> script, which is | ||
8084 | included in this distribution. | ||
8085 | The script uses <filename>opimport</filename> to convert the archive from | ||
8086 | the target to something that can be processed on the host. | ||
8087 | </para> | ||
8088 | |||
8089 | <para> | ||
8090 | Downloaded archives reside in the | ||
8091 | <link linkend='build-directory'>Build Directory</link> in | ||
8092 | <filename>tmp</filename> and are cleared up when they are no longer in use. | ||
8093 | </para> | ||
8094 | |||
8095 | <para> | ||
8096 | If you wish to perform kernel profiling, you need to be sure | ||
8097 | a <filename>vmlinux</filename> file that matches the running kernel is available. | ||
8098 | In the source directory, that file is usually located in | ||
8099 | <filename>/boot/vmlinux-KERNELVERSION</filename>, where | ||
8100 | <filename>KERNEL-version</filename> is the version of the kernel. | ||
8101 | The OpenEmbedded build system generates separate <filename>vmlinux</filename> | ||
8102 | packages for each kernel it builds. | ||
8103 | Thus, it should just be a question of making sure a matching package is | ||
8104 | installed (e.g. <filename>opkg install kernel-vmlinux</filename>). | ||
8105 | The files are automatically installed into development and profiling images | ||
8106 | alongside OProfile. | ||
8107 | A configuration option exists within the OProfileUI settings page that you can use to | ||
8108 | enter the location of the <filename>vmlinux</filename> file. | ||
8109 | </para> | ||
8110 | |||
8111 | <para> | ||
8112 | Waiting for debug symbols to transfer from the device can be slow, and it | ||
8113 | is not always necessary to actually have them on the device for OProfile use. | ||
8114 | All that is needed is a copy of the filesystem with the debug symbols present | ||
8115 | on the viewer system. | ||
8116 | The "<link linkend='platdev-gdb-remotedebug-launch-gdb'>Launch GDB on the Host Computer</link>" | ||
8117 | section covers how to create such a directory within | ||
8118 | the source directory and how to use the OProfileUI Settings | ||
8119 | Dialog to specify the location. | ||
8120 | If you specify the directory, it will be used when the file checksums | ||
8121 | match those on the system you are profiling. | ||
8122 | </para> | ||
8123 | </section> | ||
8124 | |||
8125 | <section id="platdev-oprofile-oprofileui-offline"> | ||
8126 | <title>Offline Mode</title> | ||
8127 | |||
8128 | <para> | ||
8129 | If network access to the target is unavailable, you can generate | ||
8130 | an archive for processing in <filename>oprofile-viewer</filename> as follows: | ||
8131 | <literallayout class='monospaced'> | ||
8132 | # opcontrol --reset | ||
8133 | # opcontrol --start --separate=lib --no-vmlinux -c 5 | ||
8134 | . | ||
8135 | . | ||
8136 | [do whatever is being profiled] | ||
8137 | . | ||
8138 | . | ||
8139 | # opcontrol --stop | ||
8140 | # oparchive -o my_archive | ||
8141 | </literallayout> | ||
8142 | </para> | ||
8143 | |||
8144 | <para> | ||
8145 | In the above example, <filename>my_archive</filename> is the name of the | ||
8146 | archive directory where you would like the profile archive to be kept. | ||
8147 | After the directory is created, you can copy it to another host and load it | ||
8148 | using <filename>oprofile-viewer</filename> open functionality. | ||
8149 | If necessary, the archive is converted. | ||
8150 | </para> | ||
8151 | </section> | ||
8152 | </section> | ||
8153 | </section> | ||
8154 | |||
8155 | <section id='maintaining-open-source-license-compliance-during-your-products-lifecycle'> | ||
8156 | <title>Maintaining Open Source License Compliance During Your Product's Lifecycle</title> | ||
8157 | |||
8158 | <para> | ||
8159 | One of the concerns for a development organization using open source | ||
8160 | software is how to maintain compliance with various open source | ||
8161 | licensing during the lifecycle of the product. | ||
8162 | While this section does not provide legal advice or | ||
8163 | comprehensively cover all scenarios, it does | ||
8164 | present methods that you can use to | ||
8165 | assist you in meeting the compliance requirements during a software | ||
8166 | release. | ||
8167 | </para> | ||
8168 | |||
8169 | <para> | ||
8170 | With hundreds of different open source licenses that the Yocto | ||
8171 | Project tracks, it is difficult to know the requirements of each | ||
8172 | and every license. | ||
8173 | However, the requirements of the major FLOSS licenses can begin | ||
8174 | to be covered by | ||
8175 | assuming that three main areas of concern exist: | ||
8176 | <itemizedlist> | ||
8177 | <listitem><para>Source code must be provided.</para></listitem> | ||
8178 | <listitem><para>License text for the software must be | ||
8179 | provided.</para></listitem> | ||
8180 | <listitem><para>Compilation scripts and modifications to the | ||
8181 | source code must be provided. | ||
8182 | </para></listitem> | ||
8183 | </itemizedlist> | ||
8184 | There are other requirements beyond the scope of these | ||
8185 | three and the methods described in this section | ||
8186 | (e.g. the mechanism through which source code is distributed). | ||
8187 | </para> | ||
8188 | |||
8189 | <para> | ||
8190 | As different organizations have different methods of complying with | ||
8191 | open source licensing, this section is not meant to imply that | ||
8192 | there is only one single way to meet your compliance obligations, | ||
8193 | but rather to describe one method of achieving compliance. | ||
8194 | The remainder of this section describes methods supported to meet the | ||
8195 | previously mentioned three requirements. | ||
8196 | Once you take steps to meet these requirements, | ||
8197 | and prior to releasing images, sources, and the build system, | ||
8198 | you should audit all artifacts to ensure completeness. | ||
8199 | <note> | ||
8200 | The Yocto Project generates a license manifest during | ||
8201 | image creation that is located | ||
8202 | in <filename>${DEPLOY_DIR}/licenses/<image_name-datestamp></filename> | ||
8203 | to assist with any audits. | ||
8204 | </note> | ||
8205 | </para> | ||
8206 | |||
8207 | <section id='providing-the-source-code'> | ||
8208 | <title>Providing the Source Code</title> | ||
8209 | |||
8210 | <para> | ||
8211 | Compliance activities should begin before you generate the | ||
8212 | final image. | ||
8213 | The first thing you should look at is the requirement that | ||
8214 | tops the list for most compliance groups - providing | ||
8215 | the source. | ||
8216 | The Yocto Project has a few ways of meeting this | ||
8217 | requirement. | ||
8218 | </para> | ||
8219 | |||
8220 | <para> | ||
8221 | One of the easiest ways to meet this requirement is | ||
8222 | to provide the entire | ||
8223 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'><filename>DL_DIR</filename></ulink> | ||
8224 | used by the build. | ||
8225 | This method, however, has a few issues. | ||
8226 | The most obvious is the size of the directory since it includes | ||
8227 | all sources used in the build and not just the source used in | ||
8228 | the released image. | ||
8229 | It will include toolchain source, and other artifacts, which | ||
8230 | you would not generally release. | ||
8231 | However, the more serious issue for most companies is accidental | ||
8232 | release of proprietary software. | ||
8233 | The Yocto Project provides an | ||
8234 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-archiver'><filename>archiver</filename></ulink> | ||
8235 | class to help avoid some of these concerns. | ||
8236 | </para> | ||
8237 | |||
8238 | <para> | ||
8239 | Before you employ <filename>DL_DIR</filename> or the | ||
8240 | archiver class, you need to decide how you choose to | ||
8241 | provide source. | ||
8242 | The source archiver class can generate tarballs and SRPMs | ||
8243 | and can create them with various levels of compliance in mind. | ||
8244 | </para> | ||
8245 | |||
8246 | <para> | ||
8247 | One way of doing this (but certainly not the only way) is to | ||
8248 | release just the source as a tarball. | ||
8249 | You can do this by adding the following to the | ||
8250 | <filename>local.conf</filename> file found in the | ||
8251 | <link linkend='build-directory'>Build Directory</link>: | ||
8252 | <literallayout class='monospaced'> | ||
8253 | INHERIT += "archiver" | ||
8254 | ARCHIVER_MODE[src] = "original" | ||
8255 | </literallayout> | ||
8256 | During the creation of your image, the source from all | ||
8257 | recipes that deploy packages to the image is placed within | ||
8258 | subdirectories of | ||
8259 | <filename>DEPLOY_DIR/sources</filename> based on the | ||
8260 | <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE'><filename>LICENSE</filename></ulink> | ||
8261 | for each recipe. | ||
8262 | Releasing the entire directory enables you to comply with | ||
8263 | requirements concerning providing the unmodified source. | ||
8264 | It is important to note that the size of the directory can | ||
8265 | get large. | ||
8266 | </para> | ||
8267 | |||
8268 | <para> | ||
8269 | A way to help mitigate the size issue is to only release | ||
8270 | tarballs for licenses that require the release of | ||
8271 | source. | ||
8272 | Let us assume you are only concerned with GPL code as | ||
8273 | identified with the following: | ||
8274 | <literallayout class='monospaced'> | ||
8275 | $ cd poky/build/tmp/deploy/sources | ||
8276 | $ mkdir ~/gpl_source_release | ||
8277 | $ for dir in */*GPL*; do cp -r $dir ~/gpl_source_release; done | ||
8278 | </literallayout> | ||
8279 | At this point, you could create a tarball from the | ||
8280 | <filename>gpl_source_release</filename> directory and | ||
8281 | provide that to the end user. | ||
8282 | This method would be a step toward achieving compliance | ||
8283 | with section 3a of GPLv2 and with section 6 of GPLv3. | ||
8284 | </para> | ||
8285 | </section> | ||
8286 | |||
8287 | <section id='providing-license-text'> | ||
8288 | <title>Providing License Text</title> | ||
8289 | |||
8290 | <para> | ||
8291 | One requirement that is often overlooked is inclusion | ||
8292 | of license text. | ||
8293 | This requirement also needs to be dealt with prior to | ||
8294 | generating the final image. | ||
8295 | Some licenses require the license text to accompany | ||
8296 | the binary. | ||
8297 | You can achieve this by adding the following to your | ||
8298 | <filename>local.conf</filename> file: | ||
8299 | <literallayout class='monospaced'> | ||
8300 | COPY_LIC_MANIFEST = "1" | ||
8301 | COPY_LIC_DIRS = "1" | ||
8302 | </literallayout> | ||
8303 | Adding these statements to the configuration file ensures | ||
8304 | that the licenses collected during package generation | ||
8305 | are included on your image. | ||
8306 | As the source archiver has already archived the original | ||
8307 | unmodified source that contains the license files, | ||
8308 | you would have already met the requirements for inclusion | ||
8309 | of the license information with source as defined by the GPL | ||
8310 | and other open source licenses. | ||
8311 | </para> | ||
8312 | </section> | ||
8313 | |||
8314 | <section id='providing-compilation-scripts-and-source-code-modifications'> | ||
8315 | <title>Providing Compilation Scripts and Source Code Modifications</title> | ||
8316 | |||
8317 | <para> | ||
8318 | At this point, we have addressed all we need to address | ||
8319 | prior to generating the image. | ||
8320 | The next two requirements are addressed during the final | ||
8321 | packaging of the release. | ||
8322 | </para> | ||
8323 | |||
8324 | <para> | ||
8325 | By releasing the version of the OpenEmbedded build system | ||
8326 | and the layers used during the build, you will be providing both | ||
8327 | compilation scripts and the source code modifications in one | ||
8328 | step. | ||
8329 | </para> | ||
8330 | |||
8331 | <para> | ||
8332 | If the deployment team has a | ||
8333 | <ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP layer</ulink> | ||
8334 | and a distro layer, and those those layers are used to patch, | ||
8335 | compile, package, or modify (in any way) any open source | ||
8336 | software included in your released images, you | ||
8337 | might be required to to release those layers under section 3 of | ||
8338 | GPLv2 or section 1 of GPLv3. | ||
8339 | One way of doing that is with a clean | ||
8340 | checkout of the version of the Yocto Project and layers used | ||
8341 | during your build. | ||
8342 | Here is an example: | ||
8343 | <literallayout class='monospaced'> | ||
8344 | # We built using the &DISTRO_NAME; branch of the poky repo | ||
8345 | $ git clone -b &DISTRO_NAME; git://git.yoctoproject.org/poky | ||
8346 | $ cd poky | ||
8347 | # We built using the release_branch for our layers | ||
8348 | $ git clone -b release_branch git://git.mycompany.com/meta-my-bsp-layer | ||
8349 | $ git clone -b release_branch git://git.mycompany.com/meta-my-software-layer | ||
8350 | # clean up the .git repos | ||
8351 | $ find . -name ".git" -type d -exec rm -rf {} \; | ||
8352 | </literallayout> | ||
8353 | One thing a development organization might want to consider | ||
8354 | for end-user convenience is to modify | ||
8355 | <filename>meta-yocto/conf/bblayers.conf.sample</filename> to | ||
8356 | ensure that when the end user utilizes the released build | ||
8357 | system to build an image, the development organization's | ||
8358 | layers are included in the <filename>bblayers.conf</filename> | ||
8359 | file automatically: | ||
8360 | <literallayout class='monospaced'> | ||
8361 | # LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf | ||
8362 | # changes incompatibly | ||
8363 | LCONF_VERSION = "6" | ||
8364 | |||
8365 | BBPATH = "${TOPDIR}" | ||
8366 | BBFILES ?= "" | ||
8367 | |||
8368 | BBLAYERS ?= " \ | ||
8369 | ##OEROOT##/meta \ | ||
8370 | ##OEROOT##/meta-yocto \ | ||
8371 | ##OEROOT##/meta-yocto-bsp \ | ||
8372 | ##OEROOT##/meta-mylayer \ | ||
8373 | " | ||
8374 | |||
8375 | BBLAYERS_NON_REMOVABLE ?= " \ | ||
8376 | ##OEROOT##/meta \ | ||
8377 | ##OEROOT##/meta-yocto \ | ||
8378 | " | ||
8379 | </literallayout> | ||
8380 | Creating and providing an archive of the | ||
8381 | <link linkend='metadata'>Metadata</link> layers | ||
8382 | (recipes, configuration files, and so forth) | ||
8383 | enables you to meet your | ||
8384 | requirements to include the scripts to control compilation | ||
8385 | as well as any modifications to the original source. | ||
8386 | </para> | ||
8387 | </section> | ||
8388 | </section> | ||
8389 | |||
8390 | <section id='using-the-error-reporting-tool'> | ||
8391 | <title>Using the Error Reporting Tool</title> | ||
8392 | |||
8393 | <para> | ||
8394 | The error reporting tool allows you to | ||
8395 | submit errors encountered during builds to a central database. | ||
8396 | Outside of the build environment, you can use a web interface to | ||
8397 | browse errors, view statistics, and query for errors. | ||
8398 | The tool works using a client-server system where the client | ||
8399 | portion is integrated with the installed Yocto Project | ||
8400 | <link linkend='source-directory'>Source Directory</link> | ||
8401 | (e.g. <filename>poky</filename>). | ||
8402 | The server receives the information collected and saves it in a | ||
8403 | database. | ||
8404 | </para> | ||
8405 | |||
8406 | <para> | ||
8407 | A live instance of the error reporting server exists at | ||
8408 | <ulink url='http://errors.yoctoproject.org'></ulink>. | ||
8409 | This server exists so that when you want to get help with | ||
8410 | build failures, you can submit all of the information on the | ||
8411 | failure easily and then point to the URL in your bug report | ||
8412 | or send an email to the mailing list. | ||
8413 | <note> | ||
8414 | If you send error reports to this server, the reports become | ||
8415 | publicly visible. | ||
8416 | </note> | ||
8417 | </para> | ||
8418 | |||
8419 | <section id='enabling-and-using-the-tool'> | ||
8420 | <title>Enabling and Using the Tool</title> | ||
8421 | |||
8422 | <para> | ||
8423 | By default, the error reporting tool is disabled. | ||
8424 | You can enable it by inheriting the | ||
8425 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-report-error'><filename>report-error</filename></ulink> | ||
8426 | class by adding the following statement to the end of | ||
8427 | your <filename>local.conf</filename> file in your | ||
8428 | <link linkend='build-directory'>Build Directory</link>. | ||
8429 | <literallayout class='monospaced'> | ||
8430 | INHERIT += "report-error" | ||
8431 | </literallayout> | ||
8432 | </para> | ||
8433 | |||
8434 | <para> | ||
8435 | By default, the error reporting feature stores information in | ||
8436 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LOG_DIR'><filename>LOG_DIR</filename></ulink><filename>}/error-report</filename>. | ||
8437 | However, you can specify a directory to use by adding the following | ||
8438 | to your <filename>local.conf</filename> file: | ||
8439 | <literallayout class='monospaced'> | ||
8440 | ERR_REPORT_DIR = "path" | ||
8441 | </literallayout> | ||
8442 | Enabling error reporting causes the build process to collect | ||
8443 | the errors and store them in a file as previously described. | ||
8444 | When the build system encounters an error, it includes a command | ||
8445 | as part of the console output. | ||
8446 | You can run the command to send the error file to the server. | ||
8447 | For example, the following command sends the errors to an upstream | ||
8448 | server: | ||
8449 | <literallayout class='monospaced'> | ||
8450 | send-error-report /home/brandusa/project/poky/build/tmp/log/error-report/error_report_201403141617.txt [server] | ||
8451 | </literallayout> | ||
8452 | In the above example, the <filename>server</filename> parameter is | ||
8453 | optional. | ||
8454 | By default, the errors are sent to a database used by the entire | ||
8455 | community. | ||
8456 | If you specify a particular server, you can send them to a different | ||
8457 | database. | ||
8458 | </para> | ||
8459 | |||
8460 | <para> | ||
8461 | When sending the error file, you receive a link that corresponds | ||
8462 | to your entry in the database. | ||
8463 | For example, here is a typical link: | ||
8464 | <literallayout class='monospaced'> | ||
8465 | http://localhost:8000/Errors/Search/1/158 | ||
8466 | </literallayout> | ||
8467 | Following the link takes you to a web interface where you can | ||
8468 | browse, query the errors, and view statistics. | ||
8469 | </para> | ||
8470 | </section> | ||
8471 | |||
8472 | <section id='disabling-the-tool'> | ||
8473 | <title>Disabling the Tool</title> | ||
8474 | |||
8475 | <para> | ||
8476 | To disable the error reporting feature, simply remove or comment | ||
8477 | out the following statement from the end of your | ||
8478 | <filename>local.conf</filename> file in your | ||
8479 | <link linkend='build-directory'>Build Directory</link>. | ||
8480 | <literallayout class='monospaced'> | ||
8481 | INHERIT += "report-error" | ||
8482 | </literallayout> | ||
8483 | </para> | ||
8484 | </section> | ||
8485 | |||
8486 | <section id='setting-up-your-own-error-reporting-server'> | ||
8487 | <title>Setting Up Your Own Error Reporting Server</title> | ||
8488 | |||
8489 | <para> | ||
8490 | If you want to set up your own error reporting server, you | ||
8491 | can obtain the code from the Git repository at | ||
8492 | <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/'></ulink>. | ||
8493 | Instructions on how to set it up are in the README document. | ||
8494 | </para> | ||
8495 | </section> | ||
8496 | </section> | ||
8497 | </chapter> | ||
8498 | |||
8499 | <!-- | ||
8500 | vim: expandtab tw=80 ts=4 | ||
8501 | --> | ||
diff --git a/documentation/dev-manual/dev-manual-customization.xsl b/documentation/dev-manual/dev-manual-customization.xsl new file mode 100644 index 0000000..470f8bd --- /dev/null +++ b/documentation/dev-manual/dev-manual-customization.xsl | |||
@@ -0,0 +1,19 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> | ||
3 | |||
4 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" /> | ||
5 | |||
6 | <xsl:include href="../template/permalinks.xsl"/> | ||
7 | <xsl:include href="../template/section.title.xsl"/> | ||
8 | <xsl:include href="../template/component.title.xsl"/> | ||
9 | <xsl:include href="../template/division.title.xsl"/> | ||
10 | <xsl:include href="../template/formal.object.heading.xsl"/> | ||
11 | |||
12 | <xsl:param name="html.stylesheet" select="'dev-style.css'" /> | ||
13 | <xsl:param name="chapter.autolabel" select="1" /> | ||
14 | <xsl:param name="appendix.autolabel" select="A" /> | ||
15 | <xsl:param name="section.autolabel" select="1" /> | ||
16 | <xsl:param name="section.label.includes.component.label" select="1" /> | ||
17 | <xsl:param name="generate.id.attributes" select="1" /> | ||
18 | |||
19 | </xsl:stylesheet> | ||
diff --git a/documentation/dev-manual/dev-manual-eclipse-customization.xsl b/documentation/dev-manual/dev-manual-eclipse-customization.xsl new file mode 100644 index 0000000..8ac4c18 --- /dev/null +++ b/documentation/dev-manual/dev-manual-eclipse-customization.xsl | |||
@@ -0,0 +1,27 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet | ||
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
4 | xmlns="http://www.w3.org/1999/xhtml" | ||
5 | xmlns:fo="http://www.w3.org/1999/XSL/Format" | ||
6 | version="1.0"> | ||
7 | |||
8 | <xsl:import | ||
9 | href="http://docbook.sourceforge.net/release/xsl/current/eclipse/eclipse3.xsl" /> | ||
10 | |||
11 | <xsl:param name="chunker.output.indent" select="'yes'"/> | ||
12 | <xsl:param name="chunk.quietly" select="1"/> | ||
13 | <xsl:param name="chunk.first.sections" select="1"/> | ||
14 | <xsl:param name="chunk.section.depth" select="10"/> | ||
15 | <xsl:param name="use.id.as.filename" select="1"/> | ||
16 | <xsl:param name="ulink.target" select="'_self'" /> | ||
17 | <xsl:param name="base.dir" select="'html/dev-manual/'"/> | ||
18 | <xsl:param name="html.stylesheet" select="'../book.css'"/> | ||
19 | <xsl:param name="eclipse.manifest" select="0"/> | ||
20 | <xsl:param name="create.plugin.xml" select="0"/> | ||
21 | <xsl:param name="suppress.navigation" select="1"/> | ||
22 | <xsl:param name="generate.index" select="0"/> | ||
23 | <xsl:param name="chapter.autolabel" select="1" /> | ||
24 | <xsl:param name="appendix.autolabel" select="1" /> | ||
25 | <xsl:param name="section.autolabel" select="1" /> | ||
26 | <xsl:param name="section.label.includes.component.label" select="1" /> | ||
27 | </xsl:stylesheet> | ||
diff --git a/documentation/dev-manual/dev-manual-intro.xml b/documentation/dev-manual/dev-manual-intro.xml new file mode 100644 index 0000000..f3cf489 --- /dev/null +++ b/documentation/dev-manual/dev-manual-intro.xml | |||
@@ -0,0 +1,207 @@ | |||
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 | |||
5 | <chapter id='dev-manual-intro'> | ||
6 | |||
7 | <title>The Yocto Project Development Manual</title> | ||
8 | <section id='intro'> | ||
9 | <title>Introduction</title> | ||
10 | |||
11 | <para> | ||
12 | Welcome to the Yocto Project Development Manual! | ||
13 | This manual provides information on how to use the Yocto Project to | ||
14 | develop embedded Linux images and user-space applications that | ||
15 | run on targeted devices. | ||
16 | The manual provides an overview of image, kernel, and | ||
17 | user-space application development using the Yocto Project. | ||
18 | Because much of the information in this manual is general, it | ||
19 | contains many references to other sources where you can find more | ||
20 | detail. | ||
21 | For example, you can find detailed information on Git, repositories, | ||
22 | and open source in general in many places on the Internet. | ||
23 | Another example specific to the Yocto Project is how to quickly | ||
24 | set up your host development system and build an image, which you | ||
25 | find in the | ||
26 | <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>. | ||
27 | </para> | ||
28 | |||
29 | <para> | ||
30 | The Yocto Project Development Manual does, however, provide | ||
31 | guidance and examples on how to change the kernel source code, | ||
32 | reconfigure the kernel, and develop an application using the | ||
33 | popular <trademark class='trade'>Eclipse</trademark> IDE. | ||
34 | </para> | ||
35 | |||
36 | <note> | ||
37 | By default, using the Yocto Project creates a Poky distribution. | ||
38 | However, you can create your own distribution by providing key | ||
39 | <link linkend='metadata'>Metadata</link>. | ||
40 | A good example is Angstrom, which has had a distribution | ||
41 | based on the Yocto Project since its inception. | ||
42 | Other examples include commercial distributions like | ||
43 | Wind River Linux, Mentor Embedded Linux, and ENEA Linux. | ||
44 | See the "<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>" | ||
45 | section for more information. | ||
46 | </note> | ||
47 | </section> | ||
48 | |||
49 | <section id='what-this-manual-provides'> | ||
50 | <title>What This Manual Provides</title> | ||
51 | |||
52 | <para> | ||
53 | The following list describes what you can get from this manual: | ||
54 | <itemizedlist> | ||
55 | <listitem><para>Information that lets you get set | ||
56 | up to develop using the Yocto Project.</para></listitem> | ||
57 | <listitem><para>Information to help developers who are new to | ||
58 | the open source environment and to the distributed revision | ||
59 | control system Git, which the Yocto Project uses. | ||
60 | </para></listitem> | ||
61 | <listitem><para>An understanding of common end-to-end | ||
62 | development models and tasks.</para></listitem> | ||
63 | <listitem><para>Information about common development tasks | ||
64 | generally used during image development for | ||
65 | embedded devices. | ||
66 | </para></listitem> | ||
67 | <listitem><para>Many references to other sources of related | ||
68 | information.</para></listitem> | ||
69 | </itemizedlist> | ||
70 | </para> | ||
71 | </section> | ||
72 | |||
73 | <section id='what-this-manual-does-not-provide'> | ||
74 | <title>What this Manual Does Not Provide</title> | ||
75 | |||
76 | <para> | ||
77 | This manual will not give you the following: | ||
78 | <itemizedlist> | ||
79 | <listitem><para><emphasis>Step-by-step instructions when those instructions exist in other Yocto | ||
80 | Project documentation:</emphasis> | ||
81 | For example, the Yocto Project Application Developer's Guide contains detailed | ||
82 | instructions on how to run the | ||
83 | <ulink url='&YOCTO_DOCS_ADT_URL;#installing-the-adt'>ADT Installer</ulink>, | ||
84 | which is used to set up a cross-development environment.</para></listitem> | ||
85 | <listitem><para><emphasis>Reference material:</emphasis> | ||
86 | This type of material resides in an appropriate reference manual. | ||
87 | For example, system variables are documented in the | ||
88 | <ulink url='&YOCTO_DOCS_REF_URL;'>Yocto Project Reference Manual</ulink>.</para></listitem> | ||
89 | <listitem><para><emphasis>Detailed public information that is not specific to the Yocto Project:</emphasis> | ||
90 | For example, exhaustive information on how to use Git is covered better through the | ||
91 | Internet than in this manual.</para></listitem> | ||
92 | </itemizedlist> | ||
93 | </para> | ||
94 | </section> | ||
95 | |||
96 | <section id='other-information'> | ||
97 | <title>Other Information</title> | ||
98 | |||
99 | <para> | ||
100 | Because this manual presents overview information for many different | ||
101 | topics, supplemental information is recommended for full | ||
102 | comprehension. | ||
103 | The following list presents other sources of information you might find helpful: | ||
104 | <itemizedlist> | ||
105 | <listitem><para><emphasis><ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>: | ||
106 | </emphasis> The home page for the Yocto Project provides lots of information on the project | ||
107 | as well as links to software and documentation.</para></listitem> | ||
108 | <listitem><para><emphasis> | ||
109 | <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>:</emphasis> This short document lets you get started | ||
110 | with the Yocto Project and quickly begin building an image.</para></listitem> | ||
111 | <listitem><para><emphasis> | ||
112 | <ulink url='&YOCTO_DOCS_REF_URL;'>Yocto Project Reference Manual</ulink>:</emphasis> This manual is a reference | ||
113 | guide to the OpenEmbedded build system, which is based on BitBake. | ||
114 | The build system is sometimes referred to as "Poky". | ||
115 | </para></listitem> | ||
116 | <listitem><para><emphasis> | ||
117 | <ulink url='&YOCTO_DOCS_ADT_URL;'>Yocto Project Application Developer's Guide</ulink>:</emphasis> | ||
118 | This guide provides information that lets you get going with the Application | ||
119 | Development Toolkit (ADT) and stand-alone cross-development toolchains to | ||
120 | develop projects using the Yocto Project.</para></listitem> | ||
121 | <listitem><para><emphasis> | ||
122 | <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>:</emphasis> | ||
123 | This guide defines the structure for BSP components. | ||
124 | Having a commonly understood structure encourages standardization.</para></listitem> | ||
125 | <listitem><para><emphasis> | ||
126 | <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>:</emphasis> | ||
127 | This manual describes how to work with Linux Yocto kernels as well as provides a bit | ||
128 | of conceptual information on the construction of the Yocto Linux kernel tree. | ||
129 | </para></listitem> | ||
130 | <listitem><para><emphasis> | ||
131 | <ulink url='&YOCTO_DOCS_PROF_URL;'>Yocto Project Profiling and Tracing Manual</ulink>:</emphasis> | ||
132 | This manual presents a set of common and generally useful tracing and | ||
133 | profiling schemes along with their applications (as appropriate) to each tool. | ||
134 | </para></listitem> | ||
135 | <listitem><para><emphasis> | ||
136 | <ulink url='http://www.youtube.com/watch?v=3ZlOu-gLsh0'> | ||
137 | Eclipse IDE Yocto Plug-in</ulink>:</emphasis> A step-by-step instructional video that | ||
138 | demonstrates how an application developer uses Yocto Plug-in features within | ||
139 | the Eclipse IDE.</para></listitem> | ||
140 | <listitem><para><emphasis> | ||
141 | <ulink url='&YOCTO_WIKI_URL;/wiki/FAQ'>FAQ</ulink>:</emphasis> | ||
142 | A list of commonly asked questions and their answers.</para></listitem> | ||
143 | <listitem><para><emphasis> | ||
144 | <ulink url='&YOCTO_RELEASE_NOTES;'>Release Notes</ulink>:</emphasis> | ||
145 | Features, updates and known issues for the current | ||
146 | release of the Yocto Project.</para></listitem> | ||
147 | <listitem><para><emphasis> | ||
148 | <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/hob'> | ||
149 | Hob</ulink>:</emphasis> A graphical user interface for BitBake. | ||
150 | Hob's primary goal is to enable a user to perform common tasks more easily.</para></listitem> | ||
151 | <listitem><para><emphasis> | ||
152 | <ulink url='&YOCTO_HOME_URL;/download/build-appliance-0'> | ||
153 | Build Appliance</ulink>:</emphasis> A virtual machine that | ||
154 | enables you to build and boot a custom embedded Linux image | ||
155 | with the Yocto Project using a non-Linux development system. | ||
156 | </para></listitem> | ||
157 | <listitem><para><emphasis> | ||
158 | <ulink url='&YOCTO_BUGZILLA_URL;'>Bugzilla</ulink>:</emphasis> | ||
159 | The bug tracking application the Yocto Project uses. | ||
160 | If you find problems with the Yocto Project, you should report them using this | ||
161 | application.</para></listitem> | ||
162 | <listitem><para><emphasis> | ||
163 | Yocto Project Mailing Lists:</emphasis> To subscribe to the Yocto Project mailing | ||
164 | lists, click on the following URLs and follow the instructions: | ||
165 | <itemizedlist> | ||
166 | <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'></ulink> for a | ||
167 | Yocto Project Discussions mailing list.</para></listitem> | ||
168 | <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/poky'></ulink> for a | ||
169 | Yocto Project Discussions mailing list about the | ||
170 | OpenEmbedded build system (Poky). | ||
171 | </para></listitem> | ||
172 | <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/yocto-announce'></ulink> | ||
173 | for a mailing list to receive official Yocto Project announcements | ||
174 | as well as Yocto Project milestones.</para></listitem> | ||
175 | <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo'></ulink> for a | ||
176 | listing of all public mailing lists on <filename>lists.yoctoproject.org</filename>. | ||
177 | </para></listitem> | ||
178 | </itemizedlist></para></listitem> | ||
179 | <listitem><para><emphasis>Internet Relay Chat (IRC):</emphasis> | ||
180 | Two IRC channels on freenode are available | ||
181 | for Yocto Project and Poky discussions: <filename>#yocto</filename> and | ||
182 | <filename>#poky</filename>, respectively.</para></listitem> | ||
183 | <listitem><para><emphasis> | ||
184 | <ulink url='&OE_HOME_URL;'>OpenEmbedded</ulink>:</emphasis> | ||
185 | The build system used by the Yocto Project. | ||
186 | This project is the upstream, generic, embedded distribution | ||
187 | from which the Yocto Project derives its build system (Poky) | ||
188 | and to which it contributes.</para></listitem> | ||
189 | <listitem><para><emphasis> | ||
190 | <ulink url='http://developer.berlios.de/projects/bitbake/'> | ||
191 | BitBake</ulink>:</emphasis> The tool used by the OpenEmbedded build system | ||
192 | to process project metadata.</para></listitem> | ||
193 | <listitem><para><emphasis> | ||
194 | <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual:</ulink></emphasis> | ||
195 | A comprehensive guide to the BitBake tool. | ||
196 | If you want information on BitBake, see this manual. | ||
197 | </para></listitem> | ||
198 | <listitem><para><emphasis> | ||
199 | <ulink url='http://wiki.qemu.org/Index.html'>Quick EMUlator (QEMU)</ulink>: | ||
200 | </emphasis> An open-source machine emulator and virtualizer.</para></listitem> | ||
201 | </itemizedlist> | ||
202 | </para> | ||
203 | </section> | ||
204 | </chapter> | ||
205 | <!-- | ||
206 | vim: expandtab tw=80 ts=4 | ||
207 | --> | ||
diff --git a/documentation/dev-manual/dev-manual-model.xml b/documentation/dev-manual/dev-manual-model.xml new file mode 100644 index 0000000..a05a555 --- /dev/null +++ b/documentation/dev-manual/dev-manual-model.xml | |||
@@ -0,0 +1,2078 @@ | |||
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 | |||
5 | <chapter id='dev-manual-model'> | ||
6 | |||
7 | <title>Common Development Models</title> | ||
8 | |||
9 | <para> | ||
10 | Many development models exist for which you can use the Yocto Project. | ||
11 | This chapter overviews simple methods that use tools provided by the | ||
12 | Yocto Project: | ||
13 | <itemizedlist> | ||
14 | <listitem><para><emphasis>System Development:</emphasis> | ||
15 | System Development covers Board Support Package (BSP) development and kernel | ||
16 | modification or configuration. | ||
17 | For an example on how to create a BSP, see the | ||
18 | "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>" | ||
19 | section in the Yocto Project Board Support Package (BSP) Developer's Guide. | ||
20 | For more complete information on how to work with the kernel, see the | ||
21 | <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>. | ||
22 | </para></listitem> | ||
23 | <listitem><para><emphasis>User Application Development:</emphasis> | ||
24 | User Application Development covers development of applications that you intend | ||
25 | to run on target hardware. | ||
26 | For information on how to set up your host development system for user-space | ||
27 | application development, see the | ||
28 | <ulink url='&YOCTO_DOCS_ADT_URL;'>Yocto Project Application Developer's Guide</ulink>. | ||
29 | For a simple example of user-space application development using the | ||
30 | <trademark class='trade'>Eclipse</trademark> IDE, see the | ||
31 | "<link linkend='application-development-workflow'>Application | ||
32 | Development Workflow</link>" section. | ||
33 | </para></listitem> | ||
34 | <listitem><para><emphasis>Temporary Source Code Modification:</emphasis> | ||
35 | Direct modification of temporary source code is a convenient development model | ||
36 | to quickly iterate and develop towards a solution. | ||
37 | Once you implement the solution, you should of course take steps to | ||
38 | get the changes upstream and applied in the affected recipes.</para></listitem> | ||
39 | <listitem><para><emphasis>Image Development using Hob:</emphasis> | ||
40 | You can use the <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/hob'>Hob</ulink> to build | ||
41 | custom operating system images within the build environment. | ||
42 | Hob provides an efficient interface to the OpenEmbedded build system.</para></listitem> | ||
43 | <listitem><para><emphasis>Using a Development Shell:</emphasis> | ||
44 | You can use a <filename>devshell</filename> to efficiently debug commands or simply | ||
45 | edit packages. | ||
46 | Working inside a development shell is a quick way to set up the OpenEmbedded build | ||
47 | environment to work on parts of a project.</para></listitem> | ||
48 | </itemizedlist> | ||
49 | </para> | ||
50 | |||
51 | <section id='system-development-model'> | ||
52 | <title>System Development Workflow</title> | ||
53 | |||
54 | <para> | ||
55 | System development involves modification or creation of an image that you want to run on | ||
56 | a specific hardware target. | ||
57 | Usually, when you want to create an image that runs on embedded hardware, the image does | ||
58 | not require the same number of features that a full-fledged Linux distribution provides. | ||
59 | Thus, you can create a much smaller image that is designed to use only the | ||
60 | features for your particular hardware. | ||
61 | </para> | ||
62 | |||
63 | <para> | ||
64 | To help you understand how system development works in the Yocto Project, this section | ||
65 | covers two types of image development: BSP creation and kernel modification or | ||
66 | configuration. | ||
67 | </para> | ||
68 | |||
69 | <section id='developing-a-board-support-package-bsp'> | ||
70 | <title>Developing a Board Support Package (BSP)</title> | ||
71 | |||
72 | <para> | ||
73 | A BSP is a package of recipes that, when applied during a build, results in | ||
74 | an image that you can run on a particular board. | ||
75 | Thus, the package when compiled into the new image, supports the operation of the board. | ||
76 | </para> | ||
77 | |||
78 | <note> | ||
79 | For a brief list of terms used when describing the development process in the Yocto Project, | ||
80 | see the "<link linkend='yocto-project-terms'>Yocto Project Terms</link>" section. | ||
81 | </note> | ||
82 | |||
83 | <para> | ||
84 | The remainder of this section presents the basic | ||
85 | steps used to create a BSP using the Yocto Project's | ||
86 | <ulink url='&YOCTO_DOCS_BSP_URL;#using-the-yocto-projects-bsp-tools'>BSP Tools</ulink>. | ||
87 | Although not required for BSP creation, the | ||
88 | <filename>meta-intel</filename> repository, which contains | ||
89 | many BSPs supported by the Yocto Project, is part of the example. | ||
90 | </para> | ||
91 | |||
92 | <para> | ||
93 | For an example that shows how to create a new layer using the tools, see the | ||
94 | "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>" | ||
95 | section in the Yocto Project Board Support Package (BSP) Developer's Guide. | ||
96 | </para> | ||
97 | |||
98 | <para> | ||
99 | The following illustration and list summarize the BSP creation general workflow. | ||
100 | </para> | ||
101 | |||
102 | <para> | ||
103 | <imagedata fileref="figures/bsp-dev-flow.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
104 | </para> | ||
105 | |||
106 | <para> | ||
107 | <orderedlist> | ||
108 | <listitem><para><emphasis>Set up your host development system to support | ||
109 | development using the Yocto Project</emphasis>: See the | ||
110 | "<ulink url='&YOCTO_DOCS_QS_URL;#the-linux-distro'>The Linux Distribution</ulink>" | ||
111 | and the | ||
112 | "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Packages</ulink>" sections both | ||
113 | in the Yocto Project Quick Start for requirements.</para></listitem> | ||
114 | <listitem><para><emphasis>Establish a local copy of the project files on your | ||
115 | system</emphasis>: You need this <link linkend='source-directory'>Source | ||
116 | Directory</link> available on your host system. | ||
117 | Having these files on your system gives you access to the build | ||
118 | process and to the tools you need. | ||
119 | For information on how to set up the Source Directory, | ||
120 | see the | ||
121 | "<link linkend='getting-setup'>Getting Set Up</link>" section.</para></listitem> | ||
122 | <listitem><para><emphasis>Establish the <filename>meta-intel</filename> | ||
123 | repository on your system</emphasis>: Having local copies | ||
124 | of these supported BSP layers on your system gives you | ||
125 | access to layers you might be able to build on or modify | ||
126 | to create your BSP. | ||
127 | For information on how to get these files, see the | ||
128 | "<link linkend='getting-setup'>Getting Set Up</link>" section.</para></listitem> | ||
129 | <listitem><para><emphasis>Create your own BSP layer using the | ||
130 | <ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'><filename>yocto-bsp</filename></ulink> script</emphasis>: | ||
131 | Layers are ideal for | ||
132 | isolating and storing work for a given piece of hardware. | ||
133 | A layer is really just a location or area in which you place | ||
134 | the recipes and configurations for your BSP. | ||
135 | In fact, a BSP is, in itself, a special type of layer. | ||
136 | The simplest way to create a new BSP layer that is compliant with the | ||
137 | Yocto Project is to use the <filename>yocto-bsp</filename> script. | ||
138 | For information about that script, see the | ||
139 | "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>" | ||
140 | section in the Yocto Project Board Support (BSP) Developer's Guide. | ||
141 | </para> | ||
142 | <para> | ||
143 | Another example that illustrates a layer is an application. | ||
144 | Suppose you are creating an application that has library or other dependencies in | ||
145 | order for it to compile and run. | ||
146 | The layer, in this case, would be where all the recipes that define those dependencies | ||
147 | are kept. | ||
148 | The key point for a layer is that it is an isolated area that contains | ||
149 | all the relevant information for the project that the OpenEmbedded build | ||
150 | system knows about. | ||
151 | For more information on layers, see the | ||
152 | "<link linkend='understanding-and-creating-layers'>Understanding and Creating Layers</link>" | ||
153 | section. | ||
154 | For more information on BSP layers, see the | ||
155 | "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>" section in the | ||
156 | Yocto Project Board Support Package (BSP) Developer's Guide.</para> | ||
157 | <note>Five BSPs exist that are part of the | ||
158 | Yocto Project release: <filename>genericx86</filename>, <filename>genericx86-64</filename>, | ||
159 | <filename>beaglebone</filename>, | ||
160 | <filename>mpc8315e</filename>, and <filename>edgerouter</filename>. | ||
161 | The recipes and configurations for these five BSPs are located and dispersed | ||
162 | within the <link linkend='source-directory'>Source Directory</link>. | ||
163 | On the other hand, BSP layers for Crown Bay, | ||
164 | Crystal Forest, Emenlow, Fish River Island 2, Haswell, | ||
165 | Jasper Forest, NUC DC3217IYE, | ||
166 | Romley, Sugar Bay, and tlk exist in their own separate layers | ||
167 | within the larger <filename>meta-intel</filename> layer.</note> | ||
168 | <para>When you set up a layer for a new BSP, you should follow a standard layout. | ||
169 | This layout is described in the | ||
170 | "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout'>Example Filesystem Layout</ulink>" | ||
171 | section of the Board Support Package (BSP) Development Guide. | ||
172 | In the standard layout, you will notice a suggested structure for recipes and | ||
173 | configuration information. | ||
174 | You can see the standard layout for a BSP by examining | ||
175 | any supported BSP found in the <filename>meta-intel</filename> layer inside | ||
176 | the Source Directory.</para></listitem> | ||
177 | <listitem><para><emphasis>Make configuration changes to your new BSP | ||
178 | layer</emphasis>: The standard BSP layer structure organizes the files you need | ||
179 | to edit in <filename>conf</filename> and several <filename>recipes-*</filename> | ||
180 | directories within the BSP layer. | ||
181 | Configuration changes identify where your new layer is on the local system | ||
182 | and identify which kernel you are going to use. | ||
183 | When you run the <filename>yocto-bsp</filename> script, you are able to interactively | ||
184 | configure many things for the BSP (e.g. keyboard, touchscreen, and so forth). | ||
185 | </para></listitem> | ||
186 | <listitem><para><emphasis>Make recipe changes to your new BSP layer</emphasis>: Recipe | ||
187 | changes include altering recipes (<filename>.bb</filename> files), removing | ||
188 | recipes you do not use, and adding new recipes or append files | ||
189 | (<filename>.bbappend</filename>) that you need to support your hardware. | ||
190 | </para></listitem> | ||
191 | <listitem><para><emphasis>Prepare for the build</emphasis>: Once you have made all the | ||
192 | changes to your BSP layer, there remains a few things | ||
193 | you need to do for the OpenEmbedded build system in order for it to create your image. | ||
194 | You need to get the build environment ready by sourcing an environment setup script | ||
195 | (i.e. <filename>oe-init-build-env</filename> or | ||
196 | <filename>oe-init-build-env-memres</filename>) | ||
197 | and you need to be sure two key configuration files are configured appropriately: | ||
198 | the <filename>conf/local.conf</filename> and the | ||
199 | <filename>conf/bblayers.conf</filename> file. | ||
200 | You must make the OpenEmbedded build system aware of your new layer. | ||
201 | See the | ||
202 | "<link linkend='enabling-your-layer'>Enabling Your Layer</link>" section | ||
203 | for information on how to let the build system know about your new layer.</para> | ||
204 | <para>The entire process for building an image is overviewed in the section | ||
205 | "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" section | ||
206 | of the Yocto Project Quick Start. | ||
207 | You might want to reference this information.</para></listitem> | ||
208 | <listitem><para><emphasis>Build the image</emphasis>: The OpenEmbedded build system | ||
209 | uses the BitBake tool to build images based on the type of image you want to create. | ||
210 | You can find more information about BitBake in the | ||
211 | <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>. | ||
212 | </para> | ||
213 | <para>The build process supports several types of images to satisfy different needs. | ||
214 | See the | ||
215 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" chapter | ||
216 | in the Yocto Project Reference Manual for information on | ||
217 | supported images.</para></listitem> | ||
218 | </orderedlist> | ||
219 | </para> | ||
220 | |||
221 | <para> | ||
222 | You can view a video presentation on "Building Custom Embedded Images with Yocto" | ||
223 | at <ulink url='http://free-electrons.com/blog/elc-2011-videos'>Free Electrons</ulink>. | ||
224 | After going to the page, just search for "Embedded". | ||
225 | You can also find supplemental information in the | ||
226 | <ulink url='&YOCTO_DOCS_BSP_URL;'> | ||
227 | Yocto Project Board Support Package (BSP) Developer's Guide</ulink>. | ||
228 | Finally, there is a wiki page write up of the example also located | ||
229 | <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_creating_one_generic_Atom_BSP_from_another'> | ||
230 | here</ulink> that you might find helpful. | ||
231 | </para> | ||
232 | </section> | ||
233 | |||
234 | <section id='modifying-the-kernel'> | ||
235 | <title><anchor id='kernel-spot' />Modifying the Kernel</title> | ||
236 | |||
237 | <para> | ||
238 | Kernel modification involves changing the Yocto Project kernel, which could involve changing | ||
239 | configuration options as well as adding new kernel recipes. | ||
240 | Configuration changes can be added in the form of configuration fragments, while recipe | ||
241 | modification comes through the kernel's <filename>recipes-kernel</filename> area | ||
242 | in a kernel layer you create. | ||
243 | </para> | ||
244 | |||
245 | <para> | ||
246 | The remainder of this section presents a high-level overview of the Yocto Project | ||
247 | kernel architecture and the steps to modify the kernel. | ||
248 | You can reference the | ||
249 | "<link linkend='patching-the-kernel'>Patching the Kernel</link>" section | ||
250 | for an example that changes the source code of the kernel. | ||
251 | For information on how to configure the kernel, see the | ||
252 | "<link linkend='configuring-the-kernel'>Configuring the Kernel</link>" section. | ||
253 | For more information on the kernel and on modifying the kernel, see the | ||
254 | <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>. | ||
255 | </para> | ||
256 | |||
257 | <section id='kernel-overview'> | ||
258 | <title>Kernel Overview</title> | ||
259 | |||
260 | <para> | ||
261 | Traditionally, when one thinks of a patched kernel, they think of a base kernel | ||
262 | source tree and a fixed structure that contains kernel patches. | ||
263 | The Yocto Project, however, employs mechanisms that, in a sense, result in a kernel source | ||
264 | generator. | ||
265 | By the end of this section, this analogy will become clearer. | ||
266 | </para> | ||
267 | |||
268 | <para> | ||
269 | You can find a web interface to the Yocto Project kernel source repositories at | ||
270 | <ulink url='&YOCTO_GIT_URL;'></ulink>. | ||
271 | If you look at the interface, you will see to the left a grouping of | ||
272 | Git repositories titled "Yocto Linux Kernel." | ||
273 | Within this group, you will find several kernels supported by | ||
274 | the Yocto Project: | ||
275 | <itemizedlist> | ||
276 | <listitem><para><emphasis><filename>linux-yocto-3.4</filename></emphasis> - The | ||
277 | stable Yocto Project kernel to use with the Yocto Project Release 1.3. This kernel | ||
278 | is based on the Linux 3.4 released kernel.</para></listitem> | ||
279 | <listitem><para><emphasis><filename>linux-yocto-3.8</filename></emphasis> - The | ||
280 | stable Yocto Project kernel to use with the Yocto Project Release 1.4. This kernel | ||
281 | is based on the Linux 3.8 released kernel.</para></listitem> | ||
282 | <listitem><para><emphasis><filename>linux-yocto-3.10</filename></emphasis> - The | ||
283 | stable Yocto Project kernel to use with the Yocto Project Release 1.5. This kernel | ||
284 | is based on the Linux 3.10 released kernel.</para></listitem> | ||
285 | <listitem><para><emphasis><filename>linux-yocto-3.14</filename></emphasis> - The | ||
286 | stable Yocto Project kernel to use with the Yocto Project Release 1.6. This kernel | ||
287 | is based on the Linux 3.14 released kernel.</para></listitem> | ||
288 | <listitem><para><emphasis><filename>linux-yocto-dev</filename></emphasis> - A development | ||
289 | kernel based on the latest upstream release candidate available.</para></listitem> | ||
290 | </itemizedlist> | ||
291 | </para> | ||
292 | |||
293 | <para> | ||
294 | The kernels are maintained using the Git revision control system | ||
295 | that structures them using the familiar "tree", "branch", and "leaf" scheme. | ||
296 | Branches represent diversions from general code to more specific code, while leaves | ||
297 | represent the end-points for a complete and unique kernel whose source files, | ||
298 | when gathered from the root of the tree to the leaf, accumulate to create the files | ||
299 | necessary for a specific piece of hardware and its features. | ||
300 | The following figure displays this concept: | ||
301 | <para> | ||
302 | <imagedata fileref="figures/kernel-overview-1.png" | ||
303 | width="6in" depth="6in" align="center" scale="100" /> | ||
304 | </para> | ||
305 | |||
306 | <para> | ||
307 | Within the figure, the "Kernel.org Branch Point" represents the point in the tree | ||
308 | where a supported base kernel is modified from the Linux kernel. | ||
309 | For example, this could be the branch point for the <filename>linux-yocto-3.4</filename> | ||
310 | kernel. | ||
311 | Thus, everything further to the right in the structure is based on the | ||
312 | <filename>linux-yocto-3.4</filename> kernel. | ||
313 | Branch points to right in the figure represent where the | ||
314 | <filename>linux-yocto-3.4</filename> kernel is modified for specific hardware | ||
315 | or types of kernels, such as real-time kernels. | ||
316 | Each leaf thus represents the end-point for a kernel designed to run on a specific | ||
317 | targeted device. | ||
318 | </para> | ||
319 | |||
320 | <para> | ||
321 | The overall result is a Git-maintained repository from which all the supported | ||
322 | kernel types can be derived for all the supported devices. | ||
323 | A big advantage to this scheme is the sharing of common features by keeping them in | ||
324 | "larger" branches within the tree. | ||
325 | This practice eliminates redundant storage of similar features shared among kernels. | ||
326 | </para> | ||
327 | |||
328 | <note> | ||
329 | Keep in mind the figure does not take into account all the supported Yocto | ||
330 | Project kernel types, but rather shows a single generic kernel just for conceptual purposes. | ||
331 | Also keep in mind that this structure represents the Yocto Project source repositories | ||
332 | that are either pulled from during the build or established on the host development system | ||
333 | prior to the build by either cloning a particular kernel's Git repository or by | ||
334 | downloading and unpacking a tarball. | ||
335 | </note> | ||
336 | |||
337 | <para> | ||
338 | Upstream storage of all the available kernel source code is one thing, while | ||
339 | representing and using the code on your host development system is another. | ||
340 | Conceptually, you can think of the kernel source repositories as all the | ||
341 | source files necessary for all the supported kernels. | ||
342 | As a developer, you are just interested in the source files for the kernel on | ||
343 | which you are working. | ||
344 | And, furthermore, you need them available on your host system. | ||
345 | </para> | ||
346 | |||
347 | <para> | ||
348 | Kernel source code is available on your host system a couple of different | ||
349 | ways. | ||
350 | If you are working in the kernel all the time, you probably would want | ||
351 | to set up your own local Git repository of the kernel tree. | ||
352 | If you just need to make some patches to the kernel, you can access | ||
353 | temporary kernel source files that were extracted and used | ||
354 | during a build. | ||
355 | We will just talk about working with the temporary source code. | ||
356 | For more information on how to get kernel source code onto your | ||
357 | host system, see the | ||
358 | "<link linkend='local-kernel-files'>Yocto Project Kernel</link>" | ||
359 | bulleted item earlier in the manual. | ||
360 | </para> | ||
361 | |||
362 | <para> | ||
363 | What happens during the build? | ||
364 | When you build the kernel on your development system, all files needed for the build | ||
365 | are taken from the source repositories pointed to by the | ||
366 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> variable | ||
367 | and gathered in a temporary work area | ||
368 | where they are subsequently used to create the unique kernel. | ||
369 | Thus, in a sense, the process constructs a local source tree specific to your | ||
370 | kernel to generate the new kernel image - a source generator if you will. | ||
371 | </para> | ||
372 | The following figure shows the temporary file structure | ||
373 | created on your host system when the build occurs. | ||
374 | This | ||
375 | <link linkend='build-directory'>Build Directory</link> contains all the | ||
376 | source files used during the build. | ||
377 | </para> | ||
378 | |||
379 | <para> | ||
380 | <imagedata fileref="figures/kernel-overview-2-generic.png" | ||
381 | width="6in" depth="5in" align="center" scale="100" /> | ||
382 | </para> | ||
383 | |||
384 | <para> | ||
385 | Again, for additional information on the Yocto Project kernel's | ||
386 | architecture and its branching strategy, see the | ||
387 | <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>. | ||
388 | You can also reference the | ||
389 | "<link linkend='patching-the-kernel'>Patching the Kernel</link>" | ||
390 | section for a detailed example that modifies the kernel. | ||
391 | </para> | ||
392 | </section> | ||
393 | |||
394 | <section id='kernel-modification-workflow'> | ||
395 | <title>Kernel Modification Workflow</title> | ||
396 | |||
397 | <para> | ||
398 | This illustration and the following list summarizes the kernel modification general workflow. | ||
399 | </para> | ||
400 | |||
401 | <para> | ||
402 | <imagedata fileref="figures/kernel-dev-flow.png" | ||
403 | width="6in" depth="5in" align="center" scalefit="1" /> | ||
404 | </para> | ||
405 | |||
406 | <para> | ||
407 | <orderedlist> | ||
408 | <listitem><para><emphasis>Set up your host development system to support | ||
409 | development using the Yocto Project</emphasis>: See | ||
410 | "<ulink url='&YOCTO_DOCS_QS_URL;#the-linux-distro'>The Linux Distribution</ulink>" and | ||
411 | "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Packages</ulink>" sections both | ||
412 | in the Yocto Project Quick Start for requirements.</para></listitem> | ||
413 | <listitem><para><emphasis>Establish a local copy of project files on your | ||
414 | system</emphasis>: Having the <link linkend='source-directory'>Source | ||
415 | Directory</link> on your system gives you access to the build process and tools | ||
416 | you need. | ||
417 | For information on how to get these files, see the bulleted item | ||
418 | "<link linkend='local-yp-release'>Yocto Project Release</link>" earlier in this manual. | ||
419 | </para></listitem> | ||
420 | <listitem><para><emphasis>Establish the temporary kernel source files</emphasis>: | ||
421 | Temporary kernel source files are kept in the | ||
422 | <link linkend='build-directory'>Build Directory</link> | ||
423 | created by the | ||
424 | OpenEmbedded build system when you run BitBake. | ||
425 | If you have never built the kernel in which you are | ||
426 | interested, you need to run an initial build to | ||
427 | establish local kernel source files.</para> | ||
428 | <para>If you are building an image for the first time, you need to get the build | ||
429 | environment ready by sourcing an environment setup script | ||
430 | (i.e. <filename>oe-init-build-env</filename> or | ||
431 | <filename>oe-init-build-env-memres</filename>). | ||
432 | You also need to be sure two key configuration files | ||
433 | (<filename>local.conf</filename> and <filename>bblayers.conf</filename>) | ||
434 | are configured appropriately.</para> | ||
435 | <para>The entire process for building an image is overviewed in the | ||
436 | "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" | ||
437 | section of the Yocto Project Quick Start. | ||
438 | You might want to reference this information. | ||
439 | You can find more information on BitBake in the | ||
440 | <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>. | ||
441 | </para> | ||
442 | <para>The build process supports several types of images to satisfy different needs. | ||
443 | See the "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" chapter in | ||
444 | the Yocto Project Reference Manual for information on supported images. | ||
445 | </para></listitem> | ||
446 | <listitem><para><emphasis>Make changes to the kernel source code if | ||
447 | applicable</emphasis>: Modifying the kernel does not always mean directly | ||
448 | changing source files. | ||
449 | However, if you have to do this, you make the changes to the files in the | ||
450 | Build Directory.</para></listitem> | ||
451 | <listitem><para><emphasis>Make kernel configuration changes | ||
452 | if applicable</emphasis>: | ||
453 | If your situation calls for changing the kernel's configuration, you can | ||
454 | use the <filename>yocto-kernel</filename> script or <filename>menuconfig</filename> | ||
455 | to enable and disable kernel configurations. | ||
456 | Using the script lets you interactively set up kernel configurations. | ||
457 | Using <filename>menuconfig</filename> allows you to interactively develop and test the | ||
458 | configuration changes you are making to the kernel. | ||
459 | When saved, changes using <filename>menuconfig</filename> update the kernel's | ||
460 | <filename>.config</filename> file. | ||
461 | Try to resist the temptation of directly editing the <filename>.config</filename> | ||
462 | file found in the Build Directory at | ||
463 | <filename>tmp/sysroots/<machine-name>/kernel</filename>. | ||
464 | Doing so, can produce unexpected results when the OpenEmbedded build system | ||
465 | regenerates the configuration file.</para> | ||
466 | <para>Once you are satisfied with the configuration changes made using | ||
467 | <filename>menuconfig</filename>, you can directly compare the | ||
468 | <filename>.config</filename> file against a saved original and gather those | ||
469 | changes into a config fragment to be referenced from within the kernel's | ||
470 | <filename>.bbappend</filename> file.</para></listitem> | ||
471 | <listitem><para><emphasis>Rebuild the kernel image with your changes</emphasis>: | ||
472 | Rebuilding the kernel image applies your changes.</para></listitem> | ||
473 | </orderedlist> | ||
474 | </para> | ||
475 | </section> | ||
476 | </section> | ||
477 | </section> | ||
478 | |||
479 | <section id='application-development-workflow'> | ||
480 | <title>Application Development Workflow</title> | ||
481 | |||
482 | <para> | ||
483 | Application development involves creating an application that you want | ||
484 | to run on your target hardware, which is running a kernel image created using the | ||
485 | OpenEmbedded build system. | ||
486 | The Yocto Project provides an | ||
487 | <ulink url='&YOCTO_DOCS_ADT_URL;#adt-intro'>Application Development Toolkit (ADT)</ulink> | ||
488 | and stand-alone | ||
489 | <ulink url='&YOCTO_DOCS_ADT_URL;#the-cross-development-toolchain'>cross-development toolchains</ulink> | ||
490 | that facilitate quick development and integration of your application into its runtime environment. | ||
491 | Using the ADT and toolchains, you can compile and link your application. | ||
492 | You can then deploy your application to the actual hardware or to the QEMU emulator for testing. | ||
493 | If you are familiar with the popular <trademark class='trade'>Eclipse</trademark> IDE, | ||
494 | you can use an Eclipse Yocto Plug-in to | ||
495 | allow you to develop, deploy, and test your application all from within Eclipse. | ||
496 | </para> | ||
497 | |||
498 | <para> | ||
499 | While we strongly suggest using the ADT to develop your application, this option might not | ||
500 | be best for you. | ||
501 | If this is the case, you can still use pieces of the Yocto Project for your development process. | ||
502 | However, because the process can vary greatly, this manual does not provide detail on the process. | ||
503 | </para> | ||
504 | |||
505 | <section id='workflow-using-the-adt-and-eclipse'> | ||
506 | <title>Workflow Using the ADT and <trademark class='trade'>Eclipse</trademark></title> | ||
507 | |||
508 | <para> | ||
509 | To help you understand how application development works using the ADT, this section | ||
510 | provides an overview of the general development process and a detailed example of the process | ||
511 | as it is used from within the Eclipse IDE. | ||
512 | </para> | ||
513 | |||
514 | <para> | ||
515 | The following illustration and list summarize the application development general workflow. | ||
516 | </para> | ||
517 | |||
518 | <para> | ||
519 | <imagedata fileref="figures/app-dev-flow.png" | ||
520 | width="7in" depth="8in" align="center" scale="100" /> | ||
521 | </para> | ||
522 | |||
523 | <para> | ||
524 | <orderedlist> | ||
525 | <listitem><para><emphasis>Prepare the host system for the Yocto Project</emphasis>: | ||
526 | See | ||
527 | "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" | ||
528 | and | ||
529 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>" sections both | ||
530 | in the Yocto Project Reference Manual for requirements. | ||
531 | In particular, be sure your host system has the | ||
532 | <filename>xterm</filename> package installed. | ||
533 | </para></listitem> | ||
534 | <listitem><para><emphasis>Secure the Yocto Project kernel target image</emphasis>: | ||
535 | You must have a target kernel image that has been built using the OpenEmbedded | ||
536 | build system.</para> | ||
537 | <para>Depending on whether the Yocto Project has a pre-built image that matches your target | ||
538 | architecture and where you are going to run the image while you develop your application | ||
539 | (QEMU or real hardware), the area from which you get the image differs. | ||
540 | <itemizedlist> | ||
541 | <listitem><para>Download the image from | ||
542 | <ulink url='&YOCTO_MACHINES_DL_URL;'><filename>machines</filename></ulink> | ||
543 | if your target architecture is supported and you are going to develop | ||
544 | and test your application on actual hardware.</para></listitem> | ||
545 | <listitem><para>Download the image from | ||
546 | <ulink url='&YOCTO_QEMU_DL_URL;'> | ||
547 | <filename>machines/qemu</filename></ulink> if your target architecture is supported | ||
548 | and you are going to develop and test your application using the QEMU | ||
549 | emulator.</para></listitem> | ||
550 | <listitem><para>Build your image if you cannot find a pre-built image that matches | ||
551 | your target architecture. | ||
552 | If your target architecture is similar to a supported architecture, you can | ||
553 | modify the kernel image before you build it. | ||
554 | See the | ||
555 | "<link linkend='patching-the-kernel'>Patching the Kernel</link>" | ||
556 | section for an example.</para></listitem> | ||
557 | </itemizedlist></para> | ||
558 | <para>For information on pre-built kernel image naming schemes for images | ||
559 | that can run on the QEMU emulator, see the | ||
560 | "<ulink url='&YOCTO_DOCS_QS_URL;#downloading-the-pre-built-linux-kernel'>Downloading the Pre-Built Linux Kernel</ulink>" | ||
561 | section in the Yocto Project Quick Start.</para></listitem> | ||
562 | <listitem><para><emphasis>Install the ADT</emphasis>: | ||
563 | The ADT provides a target-specific cross-development toolchain, the root filesystem, | ||
564 | the QEMU emulator, and other tools that can help you develop your application. | ||
565 | While it is possible to get these pieces separately, the ADT Installer provides an | ||
566 | easy, inclusive method. | ||
567 | You can get these pieces by running an ADT installer script, which is configurable. | ||
568 | For information on how to install the ADT, see the | ||
569 | "<ulink url='&YOCTO_DOCS_ADT_URL;#using-the-adt-installer'>Using the ADT Installer</ulink>" | ||
570 | section | ||
571 | in the Yocto Project Application Developer's Guide.</para></listitem> | ||
572 | <listitem><para><emphasis>If applicable, secure the target root filesystem | ||
573 | and the Cross-development toolchain</emphasis>: | ||
574 | If you choose not to install the ADT using the ADT Installer, | ||
575 | you need to find and download the appropriate root filesystem and | ||
576 | the cross-development toolchain.</para> | ||
577 | <para>You can find the tarballs for the root filesystem in the same area used | ||
578 | for the kernel image. | ||
579 | Depending on the type of image you are running, the root filesystem you need differs. | ||
580 | For example, if you are developing an application that runs on an image that | ||
581 | supports Sato, you need to get a root filesystem that supports Sato.</para> | ||
582 | <para>You can find the cross-development toolchains at | ||
583 | <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'><filename>toolchains</filename></ulink>. | ||
584 | Be sure to get the correct toolchain for your development host and your | ||
585 | target architecture. | ||
586 | See the "<ulink url='&YOCTO_DOCS_ADT_URL;#using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball</ulink>" | ||
587 | section in the Yocto Project Application Developer's Guide for information | ||
588 | and the | ||
589 | "<ulink url='&YOCTO_DOCS_QS_URL;#installing-the-toolchain'>Installing the Toolchain</ulink>" | ||
590 | in the Yocto Project Quick Start for information on finding and installing | ||
591 | the correct toolchain based on your host development system and your target | ||
592 | architecture. | ||
593 | </para></listitem> | ||
594 | <listitem><para><emphasis>Create and build your application</emphasis>: | ||
595 | At this point, you need to have source files for your application. | ||
596 | Once you have the files, you can use the Eclipse IDE to import them and build the | ||
597 | project. | ||
598 | If you are not using Eclipse, you need to use the cross-development tools you have | ||
599 | installed to create the image.</para></listitem> | ||
600 | <listitem><para><emphasis>Deploy the image with the application</emphasis>: | ||
601 | If you are using the Eclipse IDE, you can deploy your image to the hardware or to | ||
602 | QEMU through the project's preferences. | ||
603 | If you are not using the Eclipse IDE, then you need to deploy the application | ||
604 | to the hardware using other methods. | ||
605 | Or, if you are using QEMU, you need to use that tool and load your image in for testing. | ||
606 | </para></listitem> | ||
607 | <listitem><para><emphasis>Test and debug the application</emphasis>: | ||
608 | Once your application is deployed, you need to test it. | ||
609 | Within the Eclipse IDE, you can use the debugging environment along with the | ||
610 | set of user-space tools installed along with the ADT to debug your application. | ||
611 | Of course, the same user-space tools are available separately if you choose | ||
612 | not to use the Eclipse IDE.</para></listitem> | ||
613 | </orderedlist> | ||
614 | </para> | ||
615 | </section> | ||
616 | |||
617 | <section id='adt-eclipse'> | ||
618 | <title>Working Within Eclipse</title> | ||
619 | |||
620 | <para> | ||
621 | The Eclipse IDE is a popular development environment and it fully | ||
622 | supports development using the Yocto Project. | ||
623 | <note> | ||
624 | This release of the Yocto Project supports both the Kepler | ||
625 | and Juno versions of the Eclipse IDE. | ||
626 | Thus, the following information provides setup information for | ||
627 | both versions. | ||
628 | </note> | ||
629 | </para> | ||
630 | |||
631 | <para> | ||
632 | When you install and configure the Eclipse Yocto Project Plug-in | ||
633 | into the Eclipse IDE, you maximize your Yocto Project experience. | ||
634 | Installing and configuring the Plug-in results in an environment | ||
635 | that has extensions specifically designed to let you more easily | ||
636 | develop software. | ||
637 | These extensions allow for cross-compilation, deployment, and | ||
638 | execution of your output into a QEMU emulation session as well as | ||
639 | actual target hardware. | ||
640 | You can also perform cross-debugging and profiling. | ||
641 | The environment also supports a suite of tools that allows you | ||
642 | to perform remote profiling, tracing, collection of power data, | ||
643 | collection of latency data, and collection of performance data. | ||
644 | </para> | ||
645 | |||
646 | <para> | ||
647 | This section describes how to install and configure the Eclipse IDE | ||
648 | Yocto Plug-in and how to use it to develop your application. | ||
649 | </para> | ||
650 | |||
651 | <section id='setting-up-the-eclipse-ide'> | ||
652 | <title>Setting Up the Eclipse IDE</title> | ||
653 | |||
654 | <para> | ||
655 | To develop within the Eclipse IDE, you need to do the following: | ||
656 | <orderedlist> | ||
657 | <listitem><para>Install the optimal version of the Eclipse | ||
658 | IDE.</para></listitem> | ||
659 | <listitem><para>Configure the Eclipse IDE. | ||
660 | </para></listitem> | ||
661 | <listitem><para>Install the Eclipse Yocto Plug-in. | ||
662 | </para></listitem> | ||
663 | <listitem><para>Configure the Eclipse Yocto Plug-in. | ||
664 | </para></listitem> | ||
665 | </orderedlist> | ||
666 | <note> | ||
667 | Do not install Eclipse from your distribution's package | ||
668 | repository. | ||
669 | Be sure to install Eclipse from the official Eclipse | ||
670 | download site as directed in the next section. | ||
671 | </note> | ||
672 | </para> | ||
673 | |||
674 | <section id='installing-eclipse-ide'> | ||
675 | <title>Installing the Eclipse IDE</title> | ||
676 | |||
677 | <para> | ||
678 | It is recommended that you have the Kepler 4.3.2 version of | ||
679 | the Eclipse IDE installed on your development system. | ||
680 | However, if you currently have the Juno 4.2 version | ||
681 | installed and you do not want to upgrade the IDE, you can | ||
682 | configure Juno to work with the Yocto Project. | ||
683 | </para> | ||
684 | |||
685 | <para> | ||
686 | If you do not have the Kepler 4.3.2 Eclipse IDE installed, | ||
687 | you can find the tarball at | ||
688 | <ulink url='&ECLIPSE_MAIN_URL;'></ulink>. | ||
689 | From that site, choose the Eclipse Standard 4.3.2 version | ||
690 | particular to your development host. | ||
691 | This version contains the Eclipse Platform, the Java | ||
692 | Development Tools (JDT), and the Plug-in Development | ||
693 | Environment. | ||
694 | </para> | ||
695 | |||
696 | <para> | ||
697 | Once you have downloaded the tarball, extract it into a | ||
698 | clean directory. | ||
699 | For example, the following commands unpack and install the | ||
700 | downloaded Eclipse IDE tarball into a clean directory | ||
701 | using the default name <filename>eclipse</filename>: | ||
702 | <literallayout class='monospaced'> | ||
703 | $ cd ~ | ||
704 | $ tar -xzvf ~/Downloads/eclipse-standard-kepler-SR2-linux-gtk-x86_64.tar.gz | ||
705 | </literallayout> | ||
706 | </para> | ||
707 | </section> | ||
708 | |||
709 | <section id='configuring-the-eclipse-ide'> | ||
710 | <title>Configuring the Eclipse IDE</title> | ||
711 | |||
712 | <para> | ||
713 | This section presents the steps needed to configure the | ||
714 | Eclipse IDE. | ||
715 | </para> | ||
716 | |||
717 | <para> | ||
718 | Before installing and configuring the Eclipse Yocto Plug-in, | ||
719 | you need to configure the Eclipse IDE. | ||
720 | Follow these general steps: | ||
721 | <orderedlist> | ||
722 | <listitem><para>Start the Eclipse IDE.</para></listitem> | ||
723 | <listitem><para>Make sure you are in your Workbench and | ||
724 | select "Install New Software" from the "Help" | ||
725 | pull-down menu.</para></listitem> | ||
726 | <listitem><para>Select | ||
727 | <filename>Kepler - &ECLIPSE_KEPLER_URL;</filename> | ||
728 | from the "Work with:" pull-down menu. | ||
729 | <note> | ||
730 | For Juno, select | ||
731 | <filename>Juno - &ECLIPSE_JUNO_URL;</filename> | ||
732 | </note> | ||
733 | </para></listitem> | ||
734 | <listitem><para>Expand the box next to "Linux Tools" | ||
735 | and select the | ||
736 | <filename>LTTng - Linux Tracing Toolkit</filename> | ||
737 | boxes.</para></listitem> | ||
738 | <listitem><para>Expand the box next to "Mobile and | ||
739 | Device Development" and select the following boxes: | ||
740 | <itemizedlist> | ||
741 | <listitem><para><filename>C/C++ Remote Launch (Requires RSE Remote System Explorer)</filename></para></listitem> | ||
742 | <listitem><para><filename>Remote System Explorer End-user Runtime</filename></para></listitem> | ||
743 | <listitem><para><filename>Remote System Explorer User Actions</filename></para></listitem> | ||
744 | <listitem><para><filename>Target Management Terminal</filename></para></listitem> | ||
745 | <listitem><para><filename>TCF Remote System Explorer add-in</filename></para></listitem> | ||
746 | <listitem><para><filename>TCF Target Explorer</filename></para></listitem> | ||
747 | </itemizedlist></para></listitem> | ||
748 | <listitem><para>Expand the box next to "Programming | ||
749 | Languages" and select the | ||
750 | <filename>C/C++ Autotools Support</filename> | ||
751 | and <filename>C/C++ Development Tools</filename> | ||
752 | boxes.</para></listitem> | ||
753 | <listitem><para>Complete the installation and restart | ||
754 | the Eclipse IDE.</para></listitem> | ||
755 | </orderedlist> | ||
756 | </para> | ||
757 | </section> | ||
758 | |||
759 | <section id='installing-the-eclipse-yocto-plug-in'> | ||
760 | <title>Installing or Accessing the Eclipse Yocto Plug-in</title> | ||
761 | |||
762 | <para> | ||
763 | You can install the Eclipse Yocto Plug-in into the Eclipse | ||
764 | IDE one of two ways: use the Yocto Project's Eclipse | ||
765 | Update site to install the pre-built plug-in or build and | ||
766 | install the plug-in from the latest source code. | ||
767 | </para> | ||
768 | |||
769 | <section id='new-software'> | ||
770 | <title>Installing the Pre-built Plug-in from the Yocto Project Eclipse Update Site</title> | ||
771 | |||
772 | <para> | ||
773 | To install the Eclipse Yocto Plug-in from the update | ||
774 | site, follow these steps: | ||
775 | <orderedlist> | ||
776 | <listitem><para>Start up the Eclipse IDE. | ||
777 | </para></listitem> | ||
778 | <listitem><para>In Eclipse, select "Install New | ||
779 | Software" from the "Help" menu. | ||
780 | </para></listitem> | ||
781 | <listitem><para>Click "Add..." in the "Work with:" | ||
782 | area.</para></listitem> | ||
783 | <listitem><para>Enter | ||
784 | <filename>&ECLIPSE_DL_PLUGIN_URL;/kepler</filename> | ||
785 | in the URL field and provide a meaningful name | ||
786 | in the "Name" field. | ||
787 | <note> | ||
788 | If you are using Juno, use | ||
789 | <filename>&ECLIPSE_DL_PLUGIN_URL;/juno</filename> | ||
790 | in the URL field. | ||
791 | </note></para></listitem> | ||
792 | <listitem><para>Click "OK" to have the entry added | ||
793 | to the "Work with:" drop-down list. | ||
794 | </para></listitem> | ||
795 | <listitem><para>Select the entry for the plug-in | ||
796 | from the "Work with:" drop-down list. | ||
797 | </para></listitem> | ||
798 | <listitem><para>Check the boxes next to | ||
799 | <filename>Yocto Project ADT Plug-in</filename>, | ||
800 | <filename>Yocto Project Bitbake Commander Plug-in</filename>, | ||
801 | and | ||
802 | <filename>Yocto Project Documentation plug-in</filename>. | ||
803 | </para></listitem> | ||
804 | <listitem><para>Complete the remaining software | ||
805 | installation steps and then restart the Eclipse | ||
806 | IDE to finish the installation of the plug-in. | ||
807 | </para></listitem> | ||
808 | </orderedlist> | ||
809 | </para> | ||
810 | </section> | ||
811 | |||
812 | <section id='zip-file-method'> | ||
813 | <title>Installing the Plug-in Using the Latest Source Code</title> | ||
814 | |||
815 | <para> | ||
816 | To install the Eclipse Yocto Plug-in from the latest | ||
817 | source code, follow these steps: | ||
818 | <orderedlist> | ||
819 | <listitem><para>Be sure your development system | ||
820 | is not using OpenJDK to build the plug-in | ||
821 | by doing the following: | ||
822 | <orderedlist> | ||
823 | <listitem><para>Use the Oracle JDK. | ||
824 | If you don't have that, go to | ||
825 | <ulink url='http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html'></ulink> | ||
826 | and download the appropriate tarball | ||
827 | for your development system and | ||
828 | extract it into your home directory. | ||
829 | </para></listitem> | ||
830 | <listitem><para>In the shell you are going | ||
831 | to do your work, export the location of | ||
832 | the Oracle Java as follows: | ||
833 | <literallayout class='monospaced'> | ||
834 | export PATH=~/jdk1.7.0_40/bin:$PATH | ||
835 | </literallayout></para></listitem> | ||
836 | </orderedlist></para></listitem> | ||
837 | <listitem><para>In the same shell, create a Git | ||
838 | repository with: | ||
839 | <literallayout class='monospaced'> | ||
840 | $ cd ~ | ||
841 | $ git clone git://git.yoctoproject.org/eclipse-poky-kepler | ||
842 | </literallayout> | ||
843 | <note> | ||
844 | If you are using Juno, the repository is | ||
845 | located at | ||
846 | <filename>git://git.yoctoproject.org/eclipse-poky-juno</filename>. | ||
847 | </note> | ||
848 | For this example, the repository is named | ||
849 | <filename>~/eclipse-poky-kepler</filename>. | ||
850 | </para></listitem> | ||
851 | <listitem><para>Change to the directory where you | ||
852 | set up the Git repository: | ||
853 | <literallayout class='monospaced'> | ||
854 | $ cd ~/eclipse-poky-kepler | ||
855 | </literallayout></para></listitem> | ||
856 | <listitem><para>Be sure you are in the right branch | ||
857 | for your Git repository. | ||
858 | For this release set the branch to | ||
859 | <filename>&DISTRO_NAME;</filename>: | ||
860 | <literallayout class='monospaced'> | ||
861 | $ git checkout &DISTRO_NAME; | ||
862 | </literallayout></para></listitem> | ||
863 | <listitem><para>Change to the | ||
864 | <filename>scripts</filename> | ||
865 | directory within the Git repository: | ||
866 | <literallayout class='monospaced'> | ||
867 | $ cd scripts | ||
868 | </literallayout></para></listitem> | ||
869 | <listitem><para>Set up the local build environment | ||
870 | by running the setup script: | ||
871 | <literallayout class='monospaced'> | ||
872 | $ ./setup.sh | ||
873 | </literallayout></para></listitem> | ||
874 | <listitem><para>When the script finishes execution, | ||
875 | it prompts you with instructions on how to run | ||
876 | the <filename>build.sh</filename> script, which | ||
877 | is also in the <filename>scripts</filename> | ||
878 | directory of | ||
879 | the Git repository created earlier. | ||
880 | </para></listitem> | ||
881 | <listitem><para>Run the <filename>build.sh</filename> script | ||
882 | as directed. | ||
883 | Be sure to provide the name of the Git branch | ||
884 | along with the Yocto Project release you are | ||
885 | using. | ||
886 | Here is an example that uses the | ||
887 | <filename>&DISTRO_NAME;</filename> branch: | ||
888 | <literallayout class='monospaced'> | ||
889 | $ ECLIPSE_HOME=/home/scottrif/eclipse-poky-kepler/scripts/eclipse ./build.sh &DISTRO_NAME; &DISTRO_NAME; | ||
890 | </literallayout> | ||
891 | After running the script, the file | ||
892 | <filename>org.yocto.sdk-<release>-<date>-archive.zip</filename> | ||
893 | is in the current directory.</para></listitem> | ||
894 | <listitem><para>If necessary, start the Eclipse IDE | ||
895 | and be sure you are in the Workbench. | ||
896 | </para></listitem> | ||
897 | <listitem><para>Select "Install New Software" from the "Help" pull-down menu. | ||
898 | </para></listitem> | ||
899 | <listitem><para>Click "Add".</para></listitem> | ||
900 | <listitem><para>Provide anything you want in the | ||
901 | "Name" field.</para></listitem> | ||
902 | <listitem><para>Click "Archive" and browse to the | ||
903 | ZIP file you built in step eight. | ||
904 | This ZIP file should not be "unzipped", and must | ||
905 | be the <filename>*archive.zip</filename> file | ||
906 | created by running the | ||
907 | <filename>build.sh</filename> script. | ||
908 | </para></listitem> | ||
909 | <listitem><para>Click through the "Okay" buttons. | ||
910 | </para></listitem> | ||
911 | <listitem><para>Check the boxes | ||
912 | in the installation window and complete | ||
913 | the installation.</para></listitem> | ||
914 | <listitem><para>Restart the Eclipse IDE if | ||
915 | necessary.</para></listitem> | ||
916 | </orderedlist> | ||
917 | </para> | ||
918 | |||
919 | <para> | ||
920 | At this point you should be able to configure the | ||
921 | Eclipse Yocto Plug-in as described in the | ||
922 | "<link linkend='configuring-the-eclipse-yocto-plug-in'>Configuring the Eclipse Yocto Plug-in</link>" | ||
923 | section.</para> | ||
924 | </section> | ||
925 | </section> | ||
926 | |||
927 | <section id='configuring-the-eclipse-yocto-plug-in'> | ||
928 | <title>Configuring the Eclipse Yocto Plug-in</title> | ||
929 | |||
930 | <para> | ||
931 | Configuring the Eclipse Yocto Plug-in involves setting the | ||
932 | Cross Compiler options and the Target options. | ||
933 | The configurations you choose become the default settings | ||
934 | for all projects. | ||
935 | You do have opportunities to change them later when | ||
936 | you configure the project (see the following section). | ||
937 | </para> | ||
938 | |||
939 | <para> | ||
940 | To start, you need to do the following from within the | ||
941 | Eclipse IDE: | ||
942 | <itemizedlist> | ||
943 | <listitem><para>Choose "Preferences" from the | ||
944 | "Windows" menu to display the Preferences Dialog. | ||
945 | </para></listitem> | ||
946 | <listitem><para>Click "Yocto Project ADT". | ||
947 | </para></listitem> | ||
948 | </itemizedlist> | ||
949 | </para> | ||
950 | |||
951 | <section id='configuring-the-cross-compiler-options'> | ||
952 | <title>Configuring the Cross-Compiler Options</title> | ||
953 | |||
954 | <para> | ||
955 | To configure the Cross Compiler Options, you must select | ||
956 | the type of toolchain, point to the toolchain, specify | ||
957 | the sysroot location, and select the target | ||
958 | architecture. | ||
959 | <itemizedlist> | ||
960 | <listitem><para><emphasis>Selecting the Toolchain Type:</emphasis> | ||
961 | Choose between | ||
962 | <filename>Standalone pre-built toolchain</filename> | ||
963 | and | ||
964 | <filename>Build system derived toolchain</filename> | ||
965 | for Cross Compiler Options. | ||
966 | <itemizedlist> | ||
967 | <listitem><para><emphasis> | ||
968 | <filename>Standalone Pre-built Toolchain:</filename></emphasis> | ||
969 | Select this mode when you are using | ||
970 | a stand-alone cross-toolchain. | ||
971 | For example, suppose you are an | ||
972 | application developer and do not | ||
973 | need to build a target image. | ||
974 | Instead, you just want to use an | ||
975 | architecture-specific toolchain on | ||
976 | an existing kernel and target root | ||
977 | filesystem.</para></listitem> | ||
978 | <listitem><para><emphasis> | ||
979 | <filename>Build System Derived Toolchain:</filename></emphasis> | ||
980 | Select this mode if the | ||
981 | cross-toolchain has been installed | ||
982 | and built as part of the | ||
983 | <link linkend='build-directory'>Build Directory</link>. | ||
984 | When you select | ||
985 | <filename>Build system derived toolchain</filename>, | ||
986 | you are using the toolchain bundled | ||
987 | inside the Build Directory. | ||
988 | </para></listitem> | ||
989 | </itemizedlist> | ||
990 | </para></listitem> | ||
991 | <listitem><para><emphasis>Point to the Toolchain:</emphasis> | ||
992 | If you are using a stand-alone pre-built | ||
993 | toolchain, you should be pointing to where it is | ||
994 | installed. | ||
995 | If you used the ADT Installer script and | ||
996 | accepted the default installation directory, the | ||
997 | toolchain will be installed in the | ||
998 | <filename>&YOCTO_ADTPATH_DIR;</filename> | ||
999 | directory. | ||
1000 | Sections "<ulink url='&YOCTO_DOCS_ADT_URL;#configuring-and-running-the-adt-installer-script'>Configuring and Running the ADT Installer Script</ulink>" | ||
1001 | and | ||
1002 | "<ulink url='&YOCTO_DOCS_ADT_URL;#using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball</ulink>" | ||
1003 | in the Yocto Project Application Developer's | ||
1004 | Guide describe how to install a stand-alone | ||
1005 | cross-toolchain.</para> | ||
1006 | <para>If you are using a system-derived | ||
1007 | toolchain, the path you provide for the | ||
1008 | <filename>Toolchain Root Location</filename> | ||
1009 | field is the | ||
1010 | <link linkend='build-directory'>Build Directory</link>. | ||
1011 | See the | ||
1012 | "<ulink url='&YOCTO_DOCS_ADT_URL;#using-the-toolchain-from-within-the-build-tree'>Using BitBake and the Build Directory</ulink>" | ||
1013 | section in the Yocto Project Application | ||
1014 | Developer's Guide for information on how to | ||
1015 | install the toolchain into the Build | ||
1016 | Directory.</para></listitem> | ||
1017 | <listitem><para><emphasis>Specify the Sysroot Location:</emphasis> | ||
1018 | This location is where the root filesystem for | ||
1019 | the target hardware resides. | ||
1020 | If you used the ADT Installer script and | ||
1021 | accepted the default installation directory, | ||
1022 | then the location is | ||
1023 | <filename>/opt/poky/&DISTRO;</filename>. | ||
1024 | Additionally, when you use the ADT Installer | ||
1025 | script, the same location is used for the QEMU | ||
1026 | user-space tools and the NFS boot process. | ||
1027 | </para> | ||
1028 | <para>If you used either of the other two | ||
1029 | methods to install the toolchain or did not | ||
1030 | accept the ADT Installer script's default | ||
1031 | installation directory, then the location of | ||
1032 | the sysroot filesystem depends on where you | ||
1033 | separately extracted and installed the | ||
1034 | filesystem.</para> | ||
1035 | <para>For information on how to install the | ||
1036 | toolchain and on how to extract and install the | ||
1037 | sysroot filesystem, see the | ||
1038 | "<ulink url='&YOCTO_DOCS_ADT_URL;#installing-the-adt'>Installing the ADT and Toolchains</ulink>" | ||
1039 | section in the Yocto Project Application | ||
1040 | Developer's Guide. | ||
1041 | </para></listitem> | ||
1042 | <listitem><para><emphasis>Select the Target Architecture:</emphasis> | ||
1043 | The target architecture is the type of hardware | ||
1044 | you are going to use or emulate. | ||
1045 | Use the pull-down | ||
1046 | <filename>Target Architecture</filename> menu | ||
1047 | to make your selection. | ||
1048 | The pull-down menu should have the supported | ||
1049 | architectures. | ||
1050 | If the architecture you need is not listed in | ||
1051 | the menu, you will need to build the image. | ||
1052 | See the | ||
1053 | "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" | ||
1054 | section of the Yocto Project Quick Start for | ||
1055 | more information.</para></listitem> | ||
1056 | </itemizedlist> | ||
1057 | </para> | ||
1058 | </section> | ||
1059 | |||
1060 | <section id='configuring-the-target-options'> | ||
1061 | <title>Configuring the Target Options</title> | ||
1062 | |||
1063 | <para> | ||
1064 | You can choose to emulate hardware using the QEMU | ||
1065 | emulator, or you can choose to run your image on actual | ||
1066 | hardware. | ||
1067 | <itemizedlist> | ||
1068 | <listitem><para><emphasis>QEMU:</emphasis> | ||
1069 | Select this option if you will be using the | ||
1070 | QEMU emulator. | ||
1071 | If you are using the emulator, you also need to | ||
1072 | locate the kernel and specify any custom | ||
1073 | options.</para> | ||
1074 | <para>If you selected | ||
1075 | <filename>Build system derived toolchain</filename>, | ||
1076 | the target kernel you built will be located in | ||
1077 | the Build Directory in | ||
1078 | <filename>tmp/deploy/images/<machine></filename> | ||
1079 | directory. | ||
1080 | If you selected | ||
1081 | <filename>Standalone pre-built toolchain</filename>, | ||
1082 | the pre-built image you downloaded is located | ||
1083 | in the directory you specified when you | ||
1084 | downloaded the image.</para> | ||
1085 | <para>Most custom options are for advanced QEMU | ||
1086 | users to further customize their QEMU instance. | ||
1087 | These options are specified between paired | ||
1088 | angled brackets. | ||
1089 | Some options must be specified outside the | ||
1090 | brackets. | ||
1091 | In particular, the options | ||
1092 | <filename>serial</filename>, | ||
1093 | <filename>nographic</filename>, and | ||
1094 | <filename>kvm</filename> must all be outside the | ||
1095 | brackets. | ||
1096 | Use the <filename>man qemu</filename> command | ||
1097 | to get help on all the options and their use. | ||
1098 | The following is an example: | ||
1099 | <literallayout class='monospaced'> | ||
1100 | serial ‘<-m 256 -full-screen>’ | ||
1101 | </literallayout></para> | ||
1102 | <para> | ||
1103 | Regardless of the mode, Sysroot is already | ||
1104 | defined as part of the Cross-Compiler Options | ||
1105 | configuration in the | ||
1106 | <filename>Sysroot Location:</filename> field. | ||
1107 | </para></listitem> | ||
1108 | <listitem><para><emphasis>External HW:</emphasis> | ||
1109 | Select this option if you will be using actual | ||
1110 | hardware.</para></listitem> | ||
1111 | </itemizedlist> | ||
1112 | </para> | ||
1113 | |||
1114 | <para> | ||
1115 | Click the "OK" to save your plug-in configurations. | ||
1116 | </para> | ||
1117 | </section> | ||
1118 | </section> | ||
1119 | </section> | ||
1120 | |||
1121 | <section id='creating-the-project'> | ||
1122 | <title>Creating the Project</title> | ||
1123 | |||
1124 | <para> | ||
1125 | You can create two types of projects: Autotools-based, or | ||
1126 | Makefile-based. | ||
1127 | This section describes how to create Autotools-based projects | ||
1128 | from within the Eclipse IDE. | ||
1129 | For information on creating Makefile-based projects in a | ||
1130 | terminal window, see the section | ||
1131 | "<ulink url='&YOCTO_DOCS_ADT_URL;#using-the-command-line'>Using the Command Line</ulink>" | ||
1132 | in the Yocto Project Application Developer's Guide. | ||
1133 | <note> | ||
1134 | Do not use special characters in project names | ||
1135 | (e.g. spaces, underscores, etc.). Doing so can | ||
1136 | cause configuration to fail. | ||
1137 | </note> | ||
1138 | </para> | ||
1139 | |||
1140 | <para> | ||
1141 | To create a project based on a Yocto template and then display | ||
1142 | the source code, follow these steps: | ||
1143 | <orderedlist> | ||
1144 | <listitem><para>Select "Project" from the "File -> New" menu. | ||
1145 | </para></listitem> | ||
1146 | <listitem><para>Double click <filename>CC++</filename>. | ||
1147 | </para></listitem> | ||
1148 | <listitem><para>Double click <filename>C Project</filename> | ||
1149 | to create the project.</para></listitem> | ||
1150 | <listitem><para>Expand <filename>Yocto Project ADT Project</filename>. | ||
1151 | </para></listitem> | ||
1152 | <listitem><para>Select <filename>Hello World ANSI C Autotools Project</filename>. | ||
1153 | This is an Autotools-based project based on a Yocto | ||
1154 | template.</para></listitem> | ||
1155 | <listitem><para>Put a name in the <filename>Project name:</filename> | ||
1156 | field. | ||
1157 | Do not use hyphens as part of the name. | ||
1158 | </para></listitem> | ||
1159 | <listitem><para>Click "Next".</para></listitem> | ||
1160 | <listitem><para>Add information in the | ||
1161 | <filename>Author</filename> and | ||
1162 | <filename>Copyright notice</filename> fields. | ||
1163 | </para></listitem> | ||
1164 | <listitem><para>Be sure the <filename>License</filename> | ||
1165 | field is correct.</para></listitem> | ||
1166 | <listitem><para>Click "Finish".</para></listitem> | ||
1167 | <listitem><para>If the "open perspective" prompt appears, | ||
1168 | click "Yes" so that you in the C/C++ perspective. | ||
1169 | </para></listitem> | ||
1170 | <listitem><para>The left-hand navigation pane shows your | ||
1171 | project. | ||
1172 | You can display your source by double clicking the | ||
1173 | project's source file.</para></listitem> | ||
1174 | </orderedlist> | ||
1175 | </para> | ||
1176 | </section> | ||
1177 | |||
1178 | <section id='configuring-the-cross-toolchains'> | ||
1179 | <title>Configuring the Cross-Toolchains</title> | ||
1180 | |||
1181 | <para> | ||
1182 | The earlier section, | ||
1183 | "<link linkend='configuring-the-eclipse-yocto-plug-in'>Configuring the Eclipse Yocto Plug-in</link>", | ||
1184 | sets up the default project configurations. | ||
1185 | You can override these settings for a given project by following | ||
1186 | these steps: | ||
1187 | <orderedlist> | ||
1188 | <listitem><para>Select "Change Yocto Project Settings" from | ||
1189 | the "Project" menu. | ||
1190 | This selection brings up the Yocto Project Settings | ||
1191 | Dialog and allows you to make changes specific to an | ||
1192 | individual project.</para> | ||
1193 | <para>By default, the Cross Compiler Options and Target | ||
1194 | Options for a project are inherited from settings you | ||
1195 | provided using the Preferences Dialog as described | ||
1196 | earlier in the | ||
1197 | "<link linkend='configuring-the-eclipse-yocto-plug-in'>Configuring the Eclipse Yocto Plug-in</link>" section. | ||
1198 | The Yocto Project Settings Dialog allows you to override | ||
1199 | those default settings for a given project. | ||
1200 | </para></listitem> | ||
1201 | <listitem><para>Make your configurations for the project | ||
1202 | and click "OK". | ||
1203 | If you are running the Juno version of Eclipse, you can | ||
1204 | skip down to the next section where you build the | ||
1205 | project. | ||
1206 | If you are not working with Juno, you need to reconfigure the | ||
1207 | project as described in the next step. | ||
1208 | </para></listitem> | ||
1209 | <listitem><para>Select "Reconfigure Project" from the | ||
1210 | "Project" menu. | ||
1211 | This selection reconfigures the project by running | ||
1212 | <filename>autogen.sh</filename> in the workspace for | ||
1213 | your project. | ||
1214 | The script also runs <filename>libtoolize</filename>, | ||
1215 | <filename>aclocal</filename>, | ||
1216 | <filename>autoconf</filename>, | ||
1217 | <filename>autoheader</filename>, | ||
1218 | <filename>automake --a</filename>, and | ||
1219 | <filename>./configure</filename>. | ||
1220 | Click on the "Console" tab beneath your source code to | ||
1221 | see the results of reconfiguring your project. | ||
1222 | </para></listitem> | ||
1223 | </orderedlist> | ||
1224 | </para> | ||
1225 | </section> | ||
1226 | |||
1227 | <section id='building-the-project'> | ||
1228 | <title>Building the Project</title> | ||
1229 | |||
1230 | <para> | ||
1231 | To build the project in Juno, right click on the project in | ||
1232 | the navigator pane and select "Build Project". | ||
1233 | If you are not running Juno, select "Build Project" from the | ||
1234 | "Project" menu. | ||
1235 | The console should update and you can note the cross-compiler | ||
1236 | you are using. | ||
1237 | </para> | ||
1238 | </section> | ||
1239 | |||
1240 | <section id='starting-qemu-in-user-space-nfs-mode'> | ||
1241 | <title>Starting QEMU in User-Space NFS Mode</title> | ||
1242 | |||
1243 | <para> | ||
1244 | To start the QEMU emulator from within Eclipse, follow these | ||
1245 | steps: | ||
1246 | <orderedlist> | ||
1247 | <listitem><para>Expose and select "External Tools" from | ||
1248 | the "Run" menu. | ||
1249 | Your image should appear as a selectable menu item. | ||
1250 | </para></listitem> | ||
1251 | <listitem><para>Select your image from the menu to launch | ||
1252 | the emulator in a new window.</para></listitem> | ||
1253 | <listitem><para>If needed, enter your host root password in | ||
1254 | the shell window at the prompt. | ||
1255 | This sets up a <filename>Tap 0</filename> connection | ||
1256 | needed for running in user-space NFS mode. | ||
1257 | </para></listitem> | ||
1258 | <listitem><para>Wait for QEMU to launch.</para></listitem> | ||
1259 | <listitem><para>Once QEMU launches, you can begin operating | ||
1260 | within that environment. | ||
1261 | For example, you could determine the IP Address | ||
1262 | for the user-space NFS by using the | ||
1263 | <filename>ifconfig</filename> command.</para></listitem> | ||
1264 | </orderedlist> | ||
1265 | </para> | ||
1266 | </section> | ||
1267 | |||
1268 | <section id='deploying-and-debugging-the-application'> | ||
1269 | <title>Deploying and Debugging the Application</title> | ||
1270 | |||
1271 | <para> | ||
1272 | Once the QEMU emulator is running the image, you can deploy | ||
1273 | your application using the Eclipse IDE and then use | ||
1274 | the emulator to perform debugging. | ||
1275 | Follow these steps to deploy the application. | ||
1276 | <orderedlist> | ||
1277 | <listitem><para>Select "Debug Configurations..." from the | ||
1278 | "Run" menu.</para></listitem> | ||
1279 | <listitem><para>In the left area, expand | ||
1280 | <filename>C/C++Remote Application</filename>. | ||
1281 | </para></listitem> | ||
1282 | <listitem><para>Locate your project and select it to bring | ||
1283 | up a new tabbed view in the Debug Configurations Dialog. | ||
1284 | </para></listitem> | ||
1285 | <listitem><para>Enter the absolute path into which you want | ||
1286 | to deploy the application. | ||
1287 | Use the "Remote Absolute File Path for | ||
1288 | C/C++Application:" field. | ||
1289 | For example, enter | ||
1290 | <filename>/usr/bin/<programname></filename>. | ||
1291 | </para></listitem> | ||
1292 | <listitem><para>Click on the "Debugger" tab to see the | ||
1293 | cross-tool debugger you are using.</para></listitem> | ||
1294 | <listitem><para>Click on the "Main" tab.</para></listitem> | ||
1295 | <listitem><para>Create a new connection to the QEMU instance | ||
1296 | by clicking on "new".</para></listitem> | ||
1297 | <listitem><para>Select <filename>TCF</filename>, which means | ||
1298 | Target Communication Framework.</para></listitem> | ||
1299 | <listitem><para>Click "Next".</para></listitem> | ||
1300 | <listitem><para>Clear out the "host name" field and enter | ||
1301 | the IP Address determined earlier.</para></listitem> | ||
1302 | <listitem><para>Click "Finish" to close the | ||
1303 | New Connections Dialog.</para></listitem> | ||
1304 | <listitem><para>Use the drop-down menu now in the | ||
1305 | "Connection" field and pick the IP Address you entered. | ||
1306 | </para></listitem> | ||
1307 | <listitem><para>Click "Run" to bring up a login screen | ||
1308 | and login.</para></listitem> | ||
1309 | <listitem><para>Accept the debug perspective. | ||
1310 | </para></listitem> | ||
1311 | </orderedlist> | ||
1312 | </para> | ||
1313 | </section> | ||
1314 | |||
1315 | <section id='running-user-space-tools'> | ||
1316 | <title>Running User-Space Tools</title> | ||
1317 | |||
1318 | <para> | ||
1319 | As mentioned earlier in the manual, several tools exist that | ||
1320 | enhance your development experience. | ||
1321 | These tools are aids in developing and debugging applications | ||
1322 | and images. | ||
1323 | You can run these user-space tools from within the Eclipse | ||
1324 | IDE through the "YoctoTools" menu. | ||
1325 | </para> | ||
1326 | |||
1327 | <para> | ||
1328 | Once you pick a tool, you need to configure it for the remote | ||
1329 | target. | ||
1330 | Every tool needs to have the connection configured. | ||
1331 | You must select an existing TCF-based RSE connection to the | ||
1332 | remote target. | ||
1333 | If one does not exist, click "New" to create one. | ||
1334 | </para> | ||
1335 | |||
1336 | <para> | ||
1337 | Here are some specifics about the remote tools: | ||
1338 | <itemizedlist> | ||
1339 | <listitem><para><emphasis><filename>OProfile</filename>:</emphasis> | ||
1340 | Selecting this tool causes the | ||
1341 | <filename>oprofile-server</filename> on the remote | ||
1342 | target to launch on the local host machine. | ||
1343 | The <filename>oprofile-viewer</filename> must be | ||
1344 | installed on the local host machine and the | ||
1345 | <filename>oprofile-server</filename> must be installed | ||
1346 | on the remote target, respectively, in order to use. | ||
1347 | You must compile and install the | ||
1348 | <filename>oprofile-viewer</filename> from the source | ||
1349 | code on your local host machine. | ||
1350 | Furthermore, in order to convert the target's sample | ||
1351 | format data into a form that the host can use, you must | ||
1352 | have OProfile version 0.9.4 or greater installed on the | ||
1353 | host.</para> | ||
1354 | <para>You can locate both the viewer and server from | ||
1355 | <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/oprofileui/'></ulink>. | ||
1356 | You can also find more information on setting up and | ||
1357 | using this tool in the | ||
1358 | "<ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual-oprofile'>oprofile</ulink>" | ||
1359 | section of the Yocto Project Profiling and Tracing | ||
1360 | Manual. | ||
1361 | <note>The <filename>oprofile-server</filename> is | ||
1362 | installed by default on the | ||
1363 | <filename>core-image-sato-sdk</filename> image.</note> | ||
1364 | </para></listitem> | ||
1365 | <listitem><para><emphasis><filename>Lttng2.0 ust trace import</filename>:</emphasis> | ||
1366 | Selecting this tool transfers the remote target's | ||
1367 | <filename>Lttng</filename> tracing data back to the | ||
1368 | local host machine and uses the Lttng Eclipse plug-in | ||
1369 | to graphically display the output. | ||
1370 | For information on how to use Lttng to trace an | ||
1371 | application, | ||
1372 | see <ulink url='http://lttng.org/documentation'></ulink> | ||
1373 | and the | ||
1374 | "<ulink url='&YOCTO_DOCS_PROF_URL;#lttng-linux-trace-toolkit-next-generation'>LTTng (Linux Trace Toolkit, next generation)</ulink>" | ||
1375 | section, which is in the Yocto Project Profiling and | ||
1376 | Tracing Manual. | ||
1377 | <note>Do not use | ||
1378 | <filename>Lttng-user space (legacy)</filename> tool. | ||
1379 | This tool no longer has any upstream support.</note> | ||
1380 | </para> | ||
1381 | <para>Before you use the | ||
1382 | <filename>Lttng2.0 ust trace import</filename> tool, | ||
1383 | you need to setup the Lttng Eclipse plug-in and create a | ||
1384 | Tracing project. | ||
1385 | Do the following: | ||
1386 | <orderedlist> | ||
1387 | <listitem><para>Select "Open Perspective" from the | ||
1388 | "Window" menu and then select "Tracing". | ||
1389 | </para></listitem> | ||
1390 | <listitem><para>Click "OK" to change the Eclipse | ||
1391 | perspective into the Tracing perspective. | ||
1392 | </para></listitem> | ||
1393 | <listitem><para>Create a new Tracing project by | ||
1394 | selecting "Project" from the "File -> New" menu. | ||
1395 | </para></listitem> | ||
1396 | <listitem><para>Choose "Tracing Project" from the | ||
1397 | "Tracing" menu. | ||
1398 | </para></listitem> | ||
1399 | <listitem><para>Generate your tracing data on the | ||
1400 | remote target.</para></listitem> | ||
1401 | <listitem><para>Select "Lttng2.0 ust trace import" | ||
1402 | from the "Yocto Project Tools" menu to | ||
1403 | start the data import process.</para></listitem> | ||
1404 | <listitem><para>Specify your remote connection name. | ||
1405 | </para></listitem> | ||
1406 | <listitem><para>For the Ust directory path, specify | ||
1407 | the location of your remote tracing data. | ||
1408 | Make sure the location ends with | ||
1409 | <filename>ust</filename> (e.g. | ||
1410 | <filename>/usr/mysession/ust</filename>). | ||
1411 | </para></listitem> | ||
1412 | <listitem><para>Click "OK" to complete the import | ||
1413 | process. | ||
1414 | The data is now in the local tracing project | ||
1415 | you created.</para></listitem> | ||
1416 | <listitem><para>Right click on the data and then use | ||
1417 | the menu to Select "Generic CTF Trace" from the | ||
1418 | "Trace Type... -> Common Trace Format" menu to | ||
1419 | map the tracing type.</para></listitem> | ||
1420 | <listitem><para>Right click the mouse and select | ||
1421 | "Open" to bring up the Eclipse Lttng Trace | ||
1422 | Viewer so you view the tracing data. | ||
1423 | </para></listitem> | ||
1424 | </orderedlist></para></listitem> | ||
1425 | <listitem><para><emphasis><filename>PowerTOP</filename>:</emphasis> | ||
1426 | Selecting this tool runs PowerTOP on the remote target | ||
1427 | machine and displays the results in a new view called | ||
1428 | PowerTOP.</para> | ||
1429 | <para>The "Time to gather data(sec):" field is the time | ||
1430 | passed in seconds before data is gathered from the | ||
1431 | remote target for analysis.</para> | ||
1432 | <para>The "show pids in wakeups list:" field corresponds | ||
1433 | to the <filename>-p</filename> argument passed to | ||
1434 | <filename>PowerTOP</filename>.</para></listitem> | ||
1435 | <listitem><para><emphasis><filename>LatencyTOP and Perf</filename>:</emphasis> | ||
1436 | LatencyTOP identifies system latency, while | ||
1437 | Perf monitors the system's performance counter | ||
1438 | registers. | ||
1439 | Selecting either of these tools causes an RSE terminal | ||
1440 | view to appear from which you can run the tools. | ||
1441 | Both tools refresh the entire screen to display results | ||
1442 | while they run. | ||
1443 | For more information on setting up and using | ||
1444 | <filename>perf</filename>, see the | ||
1445 | "<ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual-perf'>perf</ulink>" | ||
1446 | section in the Yocto Project Profiling and Tracing | ||
1447 | Manual. | ||
1448 | </para></listitem> | ||
1449 | </itemizedlist> | ||
1450 | </para> | ||
1451 | </section> | ||
1452 | |||
1453 | <section id='customizing-an-image-using-a-bitbake-commander-project-and-hob'> | ||
1454 | <title>Customizing an Image Using a BitBake Commander Project and Hob</title> | ||
1455 | |||
1456 | <para> | ||
1457 | Within the Eclipse IDE, you can create a Yocto BitBake Commander | ||
1458 | project, edit the <link linkend='metadata'>Metadata</link>, and | ||
1459 | then use | ||
1460 | <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/hob'>Hob</ulink> to build a customized image all within one IDE. | ||
1461 | </para> | ||
1462 | |||
1463 | <section id='creating-the-yocto-bitbake-commander-project'> | ||
1464 | <title>Creating the Yocto BitBake Commander Project</title> | ||
1465 | |||
1466 | <para> | ||
1467 | To create a Yocto BitBake Commander project, follow these | ||
1468 | steps: | ||
1469 | <orderedlist> | ||
1470 | <listitem><para>Select "Other" from the | ||
1471 | "Window -> Open Perspective" menu | ||
1472 | and then choose "Bitbake Commander". | ||
1473 | </para></listitem> | ||
1474 | <listitem><para>Click "OK" to change the perspective to | ||
1475 | Bitbake Commander.</para></listitem> | ||
1476 | <listitem><para>Select "Project" from the "File -> New" | ||
1477 | menu to create a new Yocto | ||
1478 | Bitbake Commander project.</para></listitem> | ||
1479 | <listitem><para>Choose "New Yocto Project" from the | ||
1480 | "Yocto Project Bitbake Commander" menu and click | ||
1481 | "Next".</para></listitem> | ||
1482 | <listitem><para>Enter the Project Name and choose the | ||
1483 | Project Location. | ||
1484 | The Yocto project's Metadata files will be put under | ||
1485 | the directory | ||
1486 | <filename><project_location>/<project_name></filename>. | ||
1487 | If that directory does not exist, you need to check | ||
1488 | the "Clone from Yocto Git Repository" box, which | ||
1489 | would execute a <filename>git clone</filename> | ||
1490 | command to get the project's Metadata files. | ||
1491 | <note> | ||
1492 | Do not specify your BitBake Commander project | ||
1493 | location as your Eclipse workspace. | ||
1494 | Doing so causes an error indicating that the | ||
1495 | current project overlaps the location of | ||
1496 | another project. | ||
1497 | This error occurs even if no such project exits. | ||
1498 | </note></para></listitem> | ||
1499 | <listitem><para>Select <filename>Finish</filename> to | ||
1500 | create the project.</para></listitem> | ||
1501 | </orderedlist> | ||
1502 | </para> | ||
1503 | </section> | ||
1504 | |||
1505 | <section id='editing-the-metadata'> | ||
1506 | <title>Editing the Metadata</title> | ||
1507 | |||
1508 | <para> | ||
1509 | After you create the Yocto Bitbake Commander project, you | ||
1510 | can modify the <link linkend='metadata'>Metadata</link> | ||
1511 | files by opening them in the project. | ||
1512 | When editing recipe files (<filename>.bb</filename> files), | ||
1513 | you can view BitBake variable values and information by | ||
1514 | hovering the mouse pointer over the variable name and | ||
1515 | waiting a few seconds. | ||
1516 | </para> | ||
1517 | |||
1518 | <para> | ||
1519 | To edit the Metadata, follow these steps: | ||
1520 | <orderedlist> | ||
1521 | <listitem><para>Select your Yocto Bitbake Commander | ||
1522 | project.</para></listitem> | ||
1523 | <listitem><para>Select "BitBake Recipe" from the | ||
1524 | "File -> New -> Yocto BitBake Commander" menu | ||
1525 | to open a new recipe wizard.</para></listitem> | ||
1526 | <listitem><para>Point to your source by filling in the | ||
1527 | "SRC_URL" field. | ||
1528 | For example, you can add a recipe to your | ||
1529 | <link linkend='source-directory'>Source Directory</link> | ||
1530 | by defining "SRC_URL" as follows: | ||
1531 | <literallayout class='monospaced'> | ||
1532 | ftp://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz | ||
1533 | </literallayout></para></listitem> | ||
1534 | <listitem><para>Click "Populate" to calculate the | ||
1535 | archive md5, sha256, license checksum values and to | ||
1536 | auto-generate the recipe filename.</para></listitem> | ||
1537 | <listitem><para>Fill in the "Description" field. | ||
1538 | </para></listitem> | ||
1539 | <listitem><para>Be sure values for all required | ||
1540 | fields exist.</para></listitem> | ||
1541 | <listitem><para>Click "Finish".</para></listitem> | ||
1542 | </orderedlist> | ||
1543 | </para> | ||
1544 | </section> | ||
1545 | |||
1546 | <section id='biding-and-customizing-the-image-using-hob'> | ||
1547 | <title>Building and Customizing the Image Using Hob</title> | ||
1548 | |||
1549 | <para> | ||
1550 | To build and customize the image using Hob from within the | ||
1551 | Eclipse IDE, follow these steps: | ||
1552 | <orderedlist> | ||
1553 | <listitem><para>Select your Yocto Bitbake Commander | ||
1554 | project.</para></listitem> | ||
1555 | <listitem><para>Select "Launch Hob" from the "Project" | ||
1556 | menu.</para></listitem> | ||
1557 | <listitem><para>Enter the | ||
1558 | <link linkend='build-directory'>Build Directory</link> | ||
1559 | where you want to put your final images. | ||
1560 | </para></listitem> | ||
1561 | <listitem><para>Click "OK" to launch Hob. | ||
1562 | </para></listitem> | ||
1563 | <listitem><para>Use Hob to customize and build your own | ||
1564 | images. | ||
1565 | For information on Hob, see the | ||
1566 | <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/hob'>Hob Project Page</ulink> | ||
1567 | on the Yocto Project website.</para></listitem> | ||
1568 | </orderedlist> | ||
1569 | </para> | ||
1570 | </section> | ||
1571 | </section> | ||
1572 | </section> | ||
1573 | |||
1574 | <section id='workflow-using-stand-alone-cross-development-toolchains'> | ||
1575 | <title>Workflow Using Stand-Alone Cross-Development Toolchains</title> | ||
1576 | |||
1577 | <para> | ||
1578 | If you want to develop an application without prior installation | ||
1579 | of the ADT, you still can employ the | ||
1580 | <link linkend='cross-development-toolchain'>Cross Development Toolchain</link>, | ||
1581 | the QEMU emulator, and a number of supported target image files. | ||
1582 | You just need to follow these general steps: | ||
1583 | <orderedlist> | ||
1584 | <listitem><para><emphasis>Install the cross-development | ||
1585 | toolchain for your target hardware:</emphasis> | ||
1586 | For information on how to install the toolchain, see the | ||
1587 | "<ulink url='&YOCTO_DOCS_ADT_URL;#using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball</ulink>" | ||
1588 | section in the Yocto Project Application Developer's | ||
1589 | Guide.</para></listitem> | ||
1590 | <listitem><para><emphasis>Download the Target Image:</emphasis> | ||
1591 | The Yocto Project supports several target architectures | ||
1592 | and has many pre-built kernel images and root filesystem | ||
1593 | images.</para> | ||
1594 | <para>If you are going to develop your application on | ||
1595 | hardware, go to the | ||
1596 | <ulink url='&YOCTO_MACHINES_DL_URL;'><filename>machines</filename></ulink> | ||
1597 | download area and choose a target machine area | ||
1598 | from which to download the kernel image and root filesystem. | ||
1599 | This download area could have several files in it that | ||
1600 | support development using actual hardware. | ||
1601 | For example, the area might contain | ||
1602 | <filename>.hddimg</filename> files that combine the | ||
1603 | kernel image with the filesystem, boot loaders, and | ||
1604 | so forth. | ||
1605 | Be sure to get the files you need for your particular | ||
1606 | development process.</para> | ||
1607 | <para>If you are going to develop your application and | ||
1608 | then run and test it using the QEMU emulator, go to the | ||
1609 | <ulink url='&YOCTO_QEMU_DL_URL;'><filename>machines/qemu</filename></ulink> | ||
1610 | download area. | ||
1611 | From this area, go down into the directory for your | ||
1612 | target architecture (e.g. <filename>qemux86_64</filename> | ||
1613 | for an <trademark class='registered'>Intel</trademark>-based | ||
1614 | 64-bit architecture). | ||
1615 | Download kernel, root filesystem, and any other files you | ||
1616 | need for your process. | ||
1617 | <note>In order to use the root filesystem in QEMU, you | ||
1618 | need to extract it. | ||
1619 | See the | ||
1620 | "<ulink url='&YOCTO_DOCS_ADT_URL;#extracting-the-root-filesystem'>Extracting the Root Filesystem</ulink>" | ||
1621 | section for information on how to extract the root | ||
1622 | filesystem.</note></para></listitem> | ||
1623 | <listitem><para><emphasis>Develop and Test your | ||
1624 | Application:</emphasis> At this point, you have the tools | ||
1625 | to develop your application. | ||
1626 | If you need to separately install and use the QEMU | ||
1627 | emulator, you can go to | ||
1628 | <ulink url='http://wiki.qemu.org/Main_Page'>QEMU Home Page</ulink> | ||
1629 | to download and learn about the emulator.</para></listitem> | ||
1630 | </orderedlist> | ||
1631 | </para> | ||
1632 | </section> | ||
1633 | </section> | ||
1634 | |||
1635 | <section id="modifying-temporary-source-code"> | ||
1636 | <title>Modifying Temporary Source Code</title> | ||
1637 | |||
1638 | <para> | ||
1639 | You might | ||
1640 | find it helpful during development to modify the temporary source code used by recipes | ||
1641 | to build packages. | ||
1642 | For example, suppose you are developing a patch and you need to experiment a bit | ||
1643 | to figure out your solution. | ||
1644 | After you have initially built the package, you can iteratively tweak the | ||
1645 | source code, which is located in the | ||
1646 | <link linkend='build-directory'>Build Directory</link>, and then | ||
1647 | you can force a re-compile and quickly test your altered code. | ||
1648 | Once you settle on a solution, you can then preserve your changes in the form of | ||
1649 | patches. | ||
1650 | You can accomplish these steps all within either a | ||
1651 | <ulink url='http://savannah.nongnu.org/projects/quilt'>Quilt</ulink> or | ||
1652 | <link linkend='git'>Git</link> workflow. | ||
1653 | </para> | ||
1654 | |||
1655 | <section id='finding-the-temporary-source-code'> | ||
1656 | <title>Finding the Temporary Source Code</title> | ||
1657 | |||
1658 | <para> | ||
1659 | During a build, the unpacked temporary source code used by recipes | ||
1660 | to build packages is available in the Build Directory as | ||
1661 | defined by the | ||
1662 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'>S</ulink></filename> variable. | ||
1663 | Below is the default value for the <filename>S</filename> variable as defined in the | ||
1664 | <filename>meta/conf/bitbake.conf</filename> configuration file in the | ||
1665 | <link linkend='source-directory'>Source Directory</link>: | ||
1666 | <literallayout class='monospaced'> | ||
1667 | S = "${WORKDIR}/${BP}" | ||
1668 | </literallayout> | ||
1669 | You should be aware that many recipes override the <filename>S</filename> variable. | ||
1670 | For example, recipes that fetch their source from Git usually set | ||
1671 | <filename>S</filename> to <filename>${WORKDIR}/git</filename>. | ||
1672 | <note> | ||
1673 | The | ||
1674 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BP'><filename>BP</filename></ulink> | ||
1675 | represents the base recipe name, which consists of the name and version: | ||
1676 | <literallayout class='monospaced'> | ||
1677 | BP = "${BPN}-${PV}" | ||
1678 | </literallayout> | ||
1679 | </note> | ||
1680 | </para> | ||
1681 | |||
1682 | <para> | ||
1683 | The path to the work directory for the recipe | ||
1684 | (<ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>) | ||
1685 | is defined as follows: | ||
1686 | <literallayout class='monospaced'> | ||
1687 | ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR} | ||
1688 | </literallayout> | ||
1689 | The actual directory depends on several things: | ||
1690 | <itemizedlist> | ||
1691 | <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>: | ||
1692 | The top-level build output directory</listitem> | ||
1693 | <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></ulink>: | ||
1694 | The target system identifier</listitem> | ||
1695 | <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>: | ||
1696 | The recipe name</listitem> | ||
1697 | <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-EXTENDPE'><filename>EXTENDPE</filename></ulink>: | ||
1698 | The epoch - (if | ||
1699 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink> | ||
1700 | is not specified, which is usually the case for most | ||
1701 | recipes, then <filename>EXTENDPE</filename> is blank)</listitem> | ||
1702 | <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>: | ||
1703 | The recipe version</listitem> | ||
1704 | <listitem><ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>: | ||
1705 | The recipe revision</listitem> | ||
1706 | </itemizedlist> | ||
1707 | </para> | ||
1708 | |||
1709 | <para> | ||
1710 | As an example, assume a Source Directory top-level folder | ||
1711 | name <filename>poky</filename>, a default Build Directory at | ||
1712 | <filename>poky/build</filename>, and a | ||
1713 | <filename>qemux86-poky-linux</filename> machine target | ||
1714 | system. | ||
1715 | Furthermore, suppose your recipe is named | ||
1716 | <filename>foo_1.3.0-r0.bb</filename>. | ||
1717 | In this case, the work directory the build system uses to | ||
1718 | build the package would be as follows: | ||
1719 | <literallayout class='monospaced'> | ||
1720 | poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0 | ||
1721 | </literallayout> | ||
1722 | </para> | ||
1723 | |||
1724 | <para> | ||
1725 | Now that you know where to locate the directory that has the temporary source code, | ||
1726 | you can use a Quilt or Git workflow to make your edits, test the changes, | ||
1727 | and preserve the changes in the form of patches. | ||
1728 | </para> | ||
1729 | </section> | ||
1730 | |||
1731 | <section id="using-a-quilt-workflow"> | ||
1732 | <title>Using a Quilt Workflow</title> | ||
1733 | |||
1734 | <para> | ||
1735 | <ulink url='http://savannah.nongnu.org/projects/quilt'>Quilt</ulink> | ||
1736 | is a powerful tool that allows you to capture source code changes without having | ||
1737 | a clean source tree. | ||
1738 | This section outlines the typical workflow you can use to modify temporary source code, | ||
1739 | test changes, and then preserve the changes in the form of a patch all using Quilt. | ||
1740 | </para> | ||
1741 | |||
1742 | <para> | ||
1743 | Follow these general steps: | ||
1744 | <orderedlist> | ||
1745 | <listitem><para><emphasis>Find the Source Code:</emphasis> | ||
1746 | The temporary source code used by the OpenEmbedded build system is kept in the | ||
1747 | Build Directory. | ||
1748 | See the | ||
1749 | "<link linkend='finding-the-temporary-source-code'>Finding the Temporary Source Code</link>" | ||
1750 | section to learn how to locate the directory that has the temporary source code for a | ||
1751 | particular package.</para></listitem> | ||
1752 | <listitem><para><emphasis>Change Your Working Directory:</emphasis> | ||
1753 | You need to be in the directory that has the temporary source code. | ||
1754 | That directory is defined by the | ||
1755 | <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink> | ||
1756 | variable.</para></listitem> | ||
1757 | <listitem><para><emphasis>Create a New Patch:</emphasis> | ||
1758 | Before modifying source code, you need to create a new patch. | ||
1759 | To create a new patch file, use <filename>quilt new</filename> as below: | ||
1760 | <literallayout class='monospaced'> | ||
1761 | $ quilt new my_changes.patch | ||
1762 | </literallayout></para></listitem> | ||
1763 | <listitem><para><emphasis>Notify Quilt and Add Files:</emphasis> | ||
1764 | After creating the patch, you need to notify Quilt about the files | ||
1765 | you plan to edit. | ||
1766 | You notify Quilt by adding the files to the patch you just created: | ||
1767 | <literallayout class='monospaced'> | ||
1768 | $ quilt add file1.c file2.c file3.c | ||
1769 | </literallayout> | ||
1770 | </para></listitem> | ||
1771 | <listitem><para><emphasis>Edit the Files:</emphasis> | ||
1772 | Make your changes in the temporary source code to the files you added | ||
1773 | to the patch.</para></listitem> | ||
1774 | <listitem><para><emphasis>Test Your Changes:</emphasis> | ||
1775 | Once you have modified the source code, the easiest way to | ||
1776 | your changes is by calling the | ||
1777 | <filename>do_compile</filename> task as shown in the | ||
1778 | following example: | ||
1779 | <literallayout class='monospaced'> | ||
1780 | $ bitbake -c compile -f <name_of_package> | ||
1781 | </literallayout> | ||
1782 | The <filename>-f</filename> or <filename>--force</filename> | ||
1783 | option forces the specified task to execute. | ||
1784 | If you find problems with your code, you can just keep editing and | ||
1785 | re-testing iteratively until things work as expected. | ||
1786 | <note>All the modifications you make to the temporary source code | ||
1787 | disappear once you run the | ||
1788 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-clean'><filename>do_clean</filename></ulink> | ||
1789 | or | ||
1790 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>do_cleanall</filename></ulink> | ||
1791 | tasks using BitBake (i.e. | ||
1792 | <filename>bitbake -c clean <name_of_package></filename> | ||
1793 | and | ||
1794 | <filename>bitbake -c cleanall <name_of_package></filename>). | ||
1795 | Modifications will also disappear if you use the <filename>rm_work</filename> | ||
1796 | feature as described in the | ||
1797 | "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" | ||
1798 | section of the Yocto Project Quick Start. | ||
1799 | </note></para></listitem> | ||
1800 | <listitem><para><emphasis>Generate the Patch:</emphasis> | ||
1801 | Once your changes work as expected, you need to use Quilt to generate the final patch that | ||
1802 | contains all your modifications. | ||
1803 | <literallayout class='monospaced'> | ||
1804 | $ quilt refresh | ||
1805 | </literallayout> | ||
1806 | At this point, the <filename>my_changes.patch</filename> file has all your edits made | ||
1807 | to the <filename>file1.c</filename>, <filename>file2.c</filename>, and | ||
1808 | <filename>file3.c</filename> files.</para> | ||
1809 | <para>You can find the resulting patch file in the <filename>patches/</filename> | ||
1810 | subdirectory of the source (<filename>S</filename>) directory.</para></listitem> | ||
1811 | <listitem><para><emphasis>Copy the Patch File:</emphasis> | ||
1812 | For simplicity, copy the patch file into a directory named <filename>files</filename>, | ||
1813 | which you can create in the same directory that holds the recipe | ||
1814 | (<filename>.bb</filename>) file or the | ||
1815 | append (<filename>.bbappend</filename>) file. | ||
1816 | Placing the patch here guarantees that the OpenEmbedded build system will find | ||
1817 | the patch. | ||
1818 | Next, add the patch into the | ||
1819 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename> | ||
1820 | of the recipe. | ||
1821 | Here is an example: | ||
1822 | <literallayout class='monospaced'> | ||
1823 | SRC_URI += "file://my_changes.patch" | ||
1824 | </literallayout></para></listitem> | ||
1825 | <listitem><para><emphasis>Increment the Recipe Revision Number:</emphasis> | ||
1826 | Finally, don't forget to 'bump' the | ||
1827 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PR'>PR</ulink></filename> | ||
1828 | value in the recipe since the resulting packages have changed.</para></listitem> | ||
1829 | </orderedlist> | ||
1830 | </para> </section> | ||
1831 | |||
1832 | <section id='using-a-git-workflow'> | ||
1833 | <title>Using a Git Workflow</title> | ||
1834 | <para> | ||
1835 | Git is an even more powerful tool that allows you to capture source code changes without having | ||
1836 | a clean source tree. | ||
1837 | This section outlines the typical workflow you can use to modify temporary source code, | ||
1838 | test changes, and then preserve the changes in the form of a patch all using Git. | ||
1839 | For general information on Git as it is used in the Yocto Project, see the | ||
1840 | "<link linkend='git'>Git</link>" section. | ||
1841 | </para> | ||
1842 | |||
1843 | <note> | ||
1844 | This workflow uses Git only for its ability to manage local changes to the source code | ||
1845 | and produce patches independent of any version control system used with the Yocto Project. | ||
1846 | </note> | ||
1847 | |||
1848 | <para> | ||
1849 | Follow these general steps: | ||
1850 | <orderedlist> | ||
1851 | <listitem><para><emphasis>Find the Source Code:</emphasis> | ||
1852 | The temporary source code used by the OpenEmbedded build system is kept in the | ||
1853 | Build Directory. | ||
1854 | See the | ||
1855 | "<link linkend='finding-the-temporary-source-code'>Finding the Temporary Source Code</link>" | ||
1856 | section to learn how to locate the directory that has the temporary source code for a | ||
1857 | particular package.</para></listitem> | ||
1858 | <listitem><para><emphasis>Change Your Working Directory:</emphasis> | ||
1859 | You need to be in the directory that has the temporary source code. | ||
1860 | That directory is defined by the | ||
1861 | <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink> | ||
1862 | variable.</para></listitem> | ||
1863 | <listitem><para><emphasis>If needed, initialize a Git Repository:</emphasis> | ||
1864 | If the recipe you are working with does not use a Git fetcher, | ||
1865 | you need to set up a Git repository as follows: | ||
1866 | <literallayout class='monospaced'> | ||
1867 | $ git init | ||
1868 | $ git add * | ||
1869 | $ git commit -m "initial revision" | ||
1870 | </literallayout> | ||
1871 | The above Git commands initialize a Git repository that is based on the | ||
1872 | files in your current working directory, stage all the files, and commit | ||
1873 | the files. | ||
1874 | At this point, your Git repository is aware of all the source code files. | ||
1875 | Any edits you now make to files can be committed later and will be tracked by | ||
1876 | Git.</para></listitem> | ||
1877 | <listitem><para><emphasis>Edit the Files:</emphasis> | ||
1878 | Make your changes to the temporary source code.</para></listitem> | ||
1879 | <listitem><para><emphasis>Test Your Changes:</emphasis> | ||
1880 | Once you have modified the source code, the easiest way | ||
1881 | to test your changes is by calling the | ||
1882 | <filename>do_compile</filename> task as shown in the | ||
1883 | following example: | ||
1884 | <literallayout class='monospaced'> | ||
1885 | $ bitbake -c compile -f <name_of_package> | ||
1886 | </literallayout> | ||
1887 | The <filename>-f</filename> or <filename>--force</filename> | ||
1888 | option forces the specified task to execute. | ||
1889 | If you find problems with your code, you can just keep editing and | ||
1890 | re-testing iteratively until things work as expected. | ||
1891 | <note>All the modifications you make to the temporary source code | ||
1892 | disappear once you <filename>-c clean</filename>, <filename>-c cleansstate</filename>, | ||
1893 | or <filename>-c cleanall</filename> with BitBake for the package. | ||
1894 | Modifications will also disappear if you use the <filename>rm_work</filename> | ||
1895 | feature as described in the | ||
1896 | "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" | ||
1897 | section of the Yocto Project Quick Start. | ||
1898 | </note></para></listitem> | ||
1899 | <listitem><para><emphasis>See the List of Files You Changed:</emphasis> | ||
1900 | Use the <filename>git status</filename> command to see what files you have actually edited. | ||
1901 | The ability to have Git track the files you have changed is an advantage that this | ||
1902 | workflow has over the Quilt workflow. | ||
1903 | Here is the Git command to list your changed files: | ||
1904 | <literallayout class='monospaced'> | ||
1905 | $ git status | ||
1906 | </literallayout></para></listitem> | ||
1907 | <listitem><para><emphasis>Stage the Modified Files:</emphasis> | ||
1908 | Use the <filename>git add</filename> command to stage the changed files so they | ||
1909 | can be committed as follows: | ||
1910 | <literallayout class='monospaced'> | ||
1911 | $ git add file1.c file2.c file3.c | ||
1912 | </literallayout></para></listitem> | ||
1913 | <listitem><para><emphasis>Commit the Staged Files and View Your Changes:</emphasis> | ||
1914 | Use the <filename>git commit</filename> command to commit the changes to the | ||
1915 | local repository. | ||
1916 | Once you have committed the files, you can use the <filename>git log</filename> | ||
1917 | command to see your changes: | ||
1918 | <literallayout class='monospaced'> | ||
1919 | $ git commit -m "<commit-summary-message>" | ||
1920 | $ git log | ||
1921 | </literallayout> | ||
1922 | <note>The name of the patch file created in the next step is based on your | ||
1923 | <filename>commit-summary-message</filename>.</note></para></listitem> | ||
1924 | <listitem><para><emphasis>Generate the Patch:</emphasis> | ||
1925 | Once the changes are committed, use the <filename>git format-patch</filename> | ||
1926 | command to generate a patch file: | ||
1927 | <literallayout class='monospaced'> | ||
1928 | $ git format-patch -1 | ||
1929 | </literallayout> | ||
1930 | Specifying "-1" causes Git to generate the | ||
1931 | patch file for the most recent commit.</para> | ||
1932 | <para>At this point, the patch file has all your edits made | ||
1933 | to the <filename>file1.c</filename>, <filename>file2.c</filename>, and | ||
1934 | <filename>file3.c</filename> files. | ||
1935 | You can find the resulting patch file in the current directory and it | ||
1936 | is named according to the <filename>git commit</filename> summary line. | ||
1937 | The patch file ends with <filename>.patch</filename>.</para></listitem> | ||
1938 | <listitem><para><emphasis>Copy the Patch File:</emphasis> | ||
1939 | For simplicity, copy the patch file into a directory named <filename>files</filename>, | ||
1940 | which you can create in the same directory that holds the recipe | ||
1941 | (<filename>.bb</filename>) file or the | ||
1942 | append (<filename>.bbappend</filename>) file. | ||
1943 | Placing the patch here guarantees that the OpenEmbedded build system will find | ||
1944 | the patch. | ||
1945 | Next, add the patch into the | ||
1946 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename> | ||
1947 | of the recipe. | ||
1948 | Here is an example: | ||
1949 | <literallayout class='monospaced'> | ||
1950 | SRC_URI += "file://0001-<commit-summary-message>.patch" | ||
1951 | </literallayout></para></listitem> | ||
1952 | <listitem><para><emphasis>Increment the Recipe Revision Number:</emphasis> | ||
1953 | Finally, don't forget to 'bump' the | ||
1954 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PR'>PR</ulink></filename> | ||
1955 | value in the recipe since the resulting packages have changed.</para></listitem> | ||
1956 | </orderedlist> | ||
1957 | </para> | ||
1958 | </section> | ||
1959 | </section> | ||
1960 | |||
1961 | <section id='image-development-using-hob'> | ||
1962 | <title>Image Development Using Hob</title> | ||
1963 | |||
1964 | <para> | ||
1965 | The <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/hob'>Hob</ulink> is a graphical user interface for the | ||
1966 | OpenEmbedded build system, which is based on BitBake. | ||
1967 | You can use the Hob to build custom operating system images within the Yocto Project build environment. | ||
1968 | Hob simply provides a friendly interface over the build system used during development. | ||
1969 | In other words, building images with the Hob lets you take care of common build tasks more easily. | ||
1970 | </para> | ||
1971 | |||
1972 | <para> | ||
1973 | For a better understanding of Hob, see the project page at | ||
1974 | <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/hob'></ulink> | ||
1975 | on the Yocto Project website. | ||
1976 | If you follow the "Documentation" link from the Hob page, you will | ||
1977 | find a short introductory training video on Hob. | ||
1978 | The following lists some features of Hob: | ||
1979 | <itemizedlist> | ||
1980 | <listitem><para>You can setup and run Hob using these commands: | ||
1981 | <literallayout class='monospaced'> | ||
1982 | $ source oe-init-build-env | ||
1983 | $ hob | ||
1984 | </literallayout></para></listitem> | ||
1985 | <listitem><para>You can set the | ||
1986 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> | ||
1987 | for which you are building the image.</para></listitem> | ||
1988 | <listitem><para>You can modify various policy settings such as the | ||
1989 | package format with which to build, | ||
1990 | the parallelism BitBake uses, whether or not to build an | ||
1991 | external toolchain, and which host to build against. | ||
1992 | </para></listitem> | ||
1993 | <listitem><para>You can manage | ||
1994 | <link linkend='understanding-and-creating-layers'>layers</link>.</para></listitem> | ||
1995 | <listitem><para>You can select a base image and then add extra packages for your custom build. | ||
1996 | </para></listitem> | ||
1997 | <listitem><para>You can launch and monitor the build from within Hob.</para></listitem> | ||
1998 | </itemizedlist> | ||
1999 | </para> | ||
2000 | </section> | ||
2001 | |||
2002 | <section id="platdev-appdev-devshell"> | ||
2003 | <title>Using a Development Shell</title> | ||
2004 | |||
2005 | <para> | ||
2006 | When debugging certain commands or even when just editing packages, | ||
2007 | <filename>devshell</filename> can be a useful tool. | ||
2008 | When you invoke <filename>devshell</filename>, source files are | ||
2009 | extracted into your working directory and patches are applied. | ||
2010 | Then, a new terminal is opened and you are placed in the working directory. | ||
2011 | In the new terminal, all the OpenEmbedded build-related environment variables are | ||
2012 | still defined so you can use commands such as <filename>configure</filename> and | ||
2013 | <filename>make</filename>. | ||
2014 | The commands execute just as if the OpenEmbedded build system were executing them. | ||
2015 | Consequently, working this way can be helpful when debugging a build or preparing | ||
2016 | software to be used with the OpenEmbedded build system. | ||
2017 | </para> | ||
2018 | |||
2019 | <para> | ||
2020 | Following is an example that uses <filename>devshell</filename> on a target named | ||
2021 | <filename>matchbox-desktop</filename>: | ||
2022 | <literallayout class='monospaced'> | ||
2023 | $ bitbake matchbox-desktop -c devshell | ||
2024 | </literallayout> | ||
2025 | </para> | ||
2026 | |||
2027 | <para> | ||
2028 | This command spawns a terminal with a shell prompt within the OpenEmbedded build environment. | ||
2029 | The <ulink url='&YOCTO_DOCS_REF_URL;#var-OE_TERMINAL'><filename>OE_TERMINAL</filename></ulink> | ||
2030 | variable controls what type of shell is opened. | ||
2031 | </para> | ||
2032 | |||
2033 | <para> | ||
2034 | For spawned terminals, the following occurs: | ||
2035 | <itemizedlist> | ||
2036 | <listitem><para>The <filename>PATH</filename> variable includes the | ||
2037 | cross-toolchain.</para></listitem> | ||
2038 | <listitem><para>The <filename>pkgconfig</filename> variables find the correct | ||
2039 | <filename>.pc</filename> files.</para></listitem> | ||
2040 | <listitem><para>The <filename>configure</filename> command finds the | ||
2041 | Yocto Project site files as well as any other necessary files.</para></listitem> | ||
2042 | </itemizedlist> | ||
2043 | </para> | ||
2044 | |||
2045 | <para> | ||
2046 | Within this environment, you can run configure or compile | ||
2047 | commands as if they were being run by | ||
2048 | the OpenEmbedded build system itself. | ||
2049 | As noted earlier, the working directory also automatically changes to the | ||
2050 | Source Directory (<ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>). | ||
2051 | </para> | ||
2052 | |||
2053 | <para> | ||
2054 | When you are finished, you just exit the shell or close the terminal window. | ||
2055 | </para> | ||
2056 | |||
2057 | <note> | ||
2058 | <para> | ||
2059 | It is worth remembering that when using <filename>devshell</filename> | ||
2060 | you need to use the full compiler name such as <filename>arm-poky-linux-gnueabi-gcc</filename> | ||
2061 | instead of just using <filename>gcc</filename>. | ||
2062 | The same applies to other applications such as <filename>binutils</filename>, | ||
2063 | <filename>libtool</filename> and so forth. | ||
2064 | BitBake sets up environment variables such as <filename>CC</filename> | ||
2065 | to assist applications, such as <filename>make</filename> to find the correct tools. | ||
2066 | </para> | ||
2067 | |||
2068 | <para> | ||
2069 | It is also worth noting that <filename>devshell</filename> still works over | ||
2070 | X11 forwarding and similar situations. | ||
2071 | </para> | ||
2072 | </note> | ||
2073 | </section> | ||
2074 | |||
2075 | </chapter> | ||
2076 | <!-- | ||
2077 | vim: expandtab tw=80 ts=4 | ||
2078 | --> | ||
diff --git a/documentation/dev-manual/dev-manual-newbie.xml b/documentation/dev-manual/dev-manual-newbie.xml new file mode 100644 index 0000000..434a7d1 --- /dev/null +++ b/documentation/dev-manual/dev-manual-newbie.xml | |||
@@ -0,0 +1,1688 @@ | |||
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 | |||
5 | <chapter id='dev-manual-newbie'> | ||
6 | |||
7 | <title>The Yocto Project Open Source Development Environment</title> | ||
8 | |||
9 | <para> | ||
10 | This chapter helps you understand the Yocto Project as an open source development project. | ||
11 | In general, working in an open source environment is very different from working in a | ||
12 | closed, proprietary environment. | ||
13 | Additionally, the Yocto Project uses specific tools and constructs as part of its development | ||
14 | environment. | ||
15 | This chapter specifically addresses open source philosophy, using the | ||
16 | Yocto Project in a team environment, source repositories, Yocto Project | ||
17 | terms, licensing, the open source distributed version control system Git, | ||
18 | workflows, bug tracking, and how to submit changes. | ||
19 | </para> | ||
20 | |||
21 | <section id='open-source-philosophy'> | ||
22 | <title>Open Source Philosophy</title> | ||
23 | |||
24 | <para> | ||
25 | Open source philosophy is characterized by software development directed by peer production | ||
26 | and collaboration through an active community of developers. | ||
27 | Contrast this to the more standard centralized development models used by commercial software | ||
28 | companies where a finite set of developers produces a product for sale using a defined set | ||
29 | of procedures that ultimately result in an end product whose architecture and source material | ||
30 | are closed to the public. | ||
31 | </para> | ||
32 | |||
33 | <para> | ||
34 | Open source projects conceptually have differing concurrent agendas, approaches, and production. | ||
35 | These facets of the development process can come from anyone in the public (community) that has a | ||
36 | stake in the software project. | ||
37 | The open source environment contains new copyright, licensing, domain, and consumer issues | ||
38 | that differ from the more traditional development environment. | ||
39 | In an open source environment, the end product, source material, and documentation are | ||
40 | all available to the public at no cost. | ||
41 | </para> | ||
42 | |||
43 | <para> | ||
44 | A benchmark example of an open source project is the Linux Kernel, which was initially conceived | ||
45 | and created by Finnish computer science student Linus Torvalds in 1991. | ||
46 | Conversely, a good example of a non-open source project is the | ||
47 | <trademark class='registered'>Windows</trademark> family of operating | ||
48 | systems developed by <trademark class='registered'>Microsoft</trademark> Corporation. | ||
49 | </para> | ||
50 | |||
51 | <para> | ||
52 | Wikipedia has a good historical description of the Open Source Philosophy | ||
53 | <ulink url='http://en.wikipedia.org/wiki/Open_source'>here</ulink>. | ||
54 | You can also find helpful information on how to participate in the Linux Community | ||
55 | <ulink url='http://ldn.linuxfoundation.org/book/how-participate-linux-community'>here</ulink>. | ||
56 | </para> | ||
57 | </section> | ||
58 | |||
59 | <section id="usingpoky-changes-collaborate"> | ||
60 | <title>Using the Yocto Project in a Team Environment</title> | ||
61 | |||
62 | <para> | ||
63 | It might not be immediately clear how you can use the Yocto | ||
64 | Project in a team environment, or scale it for a large team of | ||
65 | developers. | ||
66 | One of the strengths of the Yocto Project is that it is extremely | ||
67 | flexible. | ||
68 | Thus, you can adapt it to many different use cases and scenarios. | ||
69 | However, these characteristics can cause a struggle if you are trying | ||
70 | to create a working setup that scales across a large team. | ||
71 | </para> | ||
72 | |||
73 | <para> | ||
74 | To help with these types of situations, this section presents | ||
75 | some of the project's most successful experiences, | ||
76 | practices, solutions, and available technologies that work well. | ||
77 | Keep in mind, the information here is a starting point. | ||
78 | You can build off it and customize it to fit any | ||
79 | particular working environment and set of practices. | ||
80 | </para> | ||
81 | |||
82 | <section id='best-practices-system-configurations'> | ||
83 | <title>System Configurations</title> | ||
84 | |||
85 | <para> | ||
86 | Systems across a large team should meet the needs of | ||
87 | two types of developers: those working on the contents of the | ||
88 | operating system image itself and those developing applications. | ||
89 | Regardless of the type of developer, their workstations must | ||
90 | be both reasonably powerful and run Linux. | ||
91 | </para> | ||
92 | |||
93 | <section id='best-practices-application-development'> | ||
94 | <title>Application Development</title> | ||
95 | |||
96 | <para> | ||
97 | For developers who mainly do application level work | ||
98 | on top of an existing software stack, | ||
99 | here are some practices that work best: | ||
100 | <itemizedlist> | ||
101 | <listitem><para>Use a pre-built toolchain that | ||
102 | contains the software stack itself. | ||
103 | Then, develop the application code on top of the | ||
104 | stack. | ||
105 | This method works well for small numbers of relatively | ||
106 | isolated applications.</para></listitem> | ||
107 | <listitem><para>When possible, use the Yocto Project | ||
108 | plug-in for the <trademark class='trade'>Eclipse</trademark> IDE | ||
109 | and other pieces of Application Development | ||
110 | Technology (ADT). | ||
111 | For more information, see the | ||
112 | "<link linkend='application-development-workflow'>Application | ||
113 | Development Workflow</link>" section as well as the | ||
114 | <ulink url='&YOCTO_DOCS_ADT_URL;'>Yocto Project Application Developer's Guide</ulink>. | ||
115 | </para></listitem> | ||
116 | <listitem><para>Keep your cross-development toolchains | ||
117 | updated. | ||
118 | You can do this through provisioning either as new | ||
119 | toolchain downloads or as updates through a package | ||
120 | update mechanism using <filename>opkg</filename> | ||
121 | to provide updates to an existing toolchain. | ||
122 | The exact mechanics of how and when to do this are a | ||
123 | question for local policy.</para></listitem> | ||
124 | <listitem><para>Use multiple toolchains installed locally | ||
125 | into different locations to allow development across | ||
126 | versions.</para></listitem> | ||
127 | </itemizedlist> | ||
128 | </para> | ||
129 | </section> | ||
130 | |||
131 | <section id='best-practices-core-system-development'> | ||
132 | <title>Core System Development</title> | ||
133 | |||
134 | <para> | ||
135 | For core system development, it is often best to have the | ||
136 | build system itself available on the developer workstations | ||
137 | so developers can run their own builds and directly | ||
138 | rebuild the software stack. | ||
139 | You should keep the core system unchanged as much as | ||
140 | possible and do your work in layers on top of the core system. | ||
141 | Doing so gives you a greater level of portability when | ||
142 | upgrading to new versions of the core system or Board | ||
143 | Support Packages (BSPs). | ||
144 | You can share layers amongst the developers of a particular | ||
145 | project and contain the policy configuration that defines | ||
146 | the project. | ||
147 | </para> | ||
148 | |||
149 | <para> | ||
150 | Aside from the previous best practices, there exists a number | ||
151 | of tips and tricks that can help speed up core development | ||
152 | projects: | ||
153 | <itemizedlist> | ||
154 | <listitem><para>Use a | ||
155 | <ulink url='&YOCTO_DOCS_REF_URL;#shared-state-cache'>Shared State Cache</ulink> | ||
156 | (sstate) among groups of developers who are on a | ||
157 | fast network. | ||
158 | The best way to share sstate is through a | ||
159 | Network File System (NFS) share. | ||
160 | The first user to build a given component for the | ||
161 | first time contributes that object to the sstate, | ||
162 | while subsequent builds from other developers then | ||
163 | reuse the object rather than rebuild it themselves. | ||
164 | </para> | ||
165 | <para>Although it is possible to use other protocols for the | ||
166 | sstate such as HTTP and FTP, you should avoid these. | ||
167 | Using HTTP limits the sstate to read-only and | ||
168 | FTP provides poor performance. | ||
169 | </para></listitem> | ||
170 | <listitem><para>Have autobuilders contribute to the sstate | ||
171 | pool similarly to how the developer workstations | ||
172 | contribute. | ||
173 | For information, see the | ||
174 | "<link linkend='best-practices-autobuilders'>Autobuilders</link>" | ||
175 | section.</para></listitem> | ||
176 | <listitem><para>Build stand-alone tarballs that contain | ||
177 | "missing" system requirements if for some reason | ||
178 | developer workstations do not meet minimum system | ||
179 | requirements such as latest Python versions, | ||
180 | <filename>chrpath</filename>, or other tools. | ||
181 | You can install and relocate the tarball exactly as you | ||
182 | would the usual cross-development toolchain so that | ||
183 | all developers can meet minimum version requirements | ||
184 | on most distributions.</para></listitem> | ||
185 | <listitem><para>Use a small number of shared, | ||
186 | high performance systems for testing purposes | ||
187 | (e.g. dual, six-core Xeons with 24 Gbytes of RAM | ||
188 | and plenty of disk space). | ||
189 | Developers can use these systems for wider, more | ||
190 | extensive testing while they continue to develop | ||
191 | locally using their primary development system. | ||
192 | </para></listitem> | ||
193 | <listitem><para>Enable the PR Service when package feeds | ||
194 | need to be incremental with continually increasing | ||
195 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'>PR</ulink> | ||
196 | values. | ||
197 | Typically, this situation occurs when you use or | ||
198 | publish package feeds and use a shared state. | ||
199 | You should enable the PR Service for all users who | ||
200 | use the shared state pool. | ||
201 | For more information on the PR Service, see the | ||
202 | "<link linkend='working-with-a-pr-service'>Working With a PR Service</link>". | ||
203 | </para></listitem> | ||
204 | </itemizedlist> | ||
205 | </para> | ||
206 | </section> | ||
207 | </section> | ||
208 | |||
209 | <section id='best-practices-source-control-management'> | ||
210 | <title>Source Control Management (SCM)</title> | ||
211 | |||
212 | <para> | ||
213 | Keeping your | ||
214 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> | ||
215 | and any software you are developing under the | ||
216 | control of an SCM system that is compatible | ||
217 | with the OpenEmbedded build system is advisable. | ||
218 | Of the SCMs BitBake supports, the | ||
219 | Yocto Project team strongly recommends using | ||
220 | <link linkend='git'>Git</link>. | ||
221 | Git is a distributed system that is easy to backup, | ||
222 | allows you to work remotely, and then connects back to the | ||
223 | infrastructure. | ||
224 | <note> | ||
225 | For information about BitBake, see the | ||
226 | <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>. | ||
227 | </note> | ||
228 | </para> | ||
229 | |||
230 | <para> | ||
231 | It is relatively easy to set up Git services and create | ||
232 | infrastructure like | ||
233 | <ulink url='&YOCTO_GIT_URL;'>http://git.yoctoproject.org</ulink>, | ||
234 | which is based on server software called | ||
235 | <filename>gitolite</filename> with <filename>cgit</filename> | ||
236 | being used to generate the web interface that lets you view the | ||
237 | repositories. | ||
238 | The <filename>gitolite</filename> software identifies users | ||
239 | using SSH keys and allows branch-based | ||
240 | access controls to repositories that you can control as little | ||
241 | or as much as necessary. | ||
242 | </para> | ||
243 | |||
244 | <note> | ||
245 | The setup of these services is beyond the scope of this manual. | ||
246 | However, sites such as these exist that describe how to perform | ||
247 | setup: | ||
248 | <itemizedlist> | ||
249 | <listitem><para><ulink url='http://git-scm.com/book/ch4-8.html'>Git documentation</ulink>: | ||
250 | Describes how to install <filename>gitolite</filename> | ||
251 | on the server.</para></listitem> | ||
252 | <listitem><para><ulink url='http://sitaramc.github.com/gitolite/master-toc.html'>The <filename>gitolite</filename> master index</ulink>: | ||
253 | All topics for <filename>gitolite</filename>. | ||
254 | </para></listitem> | ||
255 | <listitem><para><ulink url='https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools'>Interfaces, frontends, and tools</ulink>: | ||
256 | Documentation on how to create interfaces and frontends | ||
257 | for Git.</para></listitem> | ||
258 | </itemizedlist> | ||
259 | </note> | ||
260 | </section> | ||
261 | |||
262 | <section id='best-practices-autobuilders'> | ||
263 | <title>Autobuilders</title> | ||
264 | |||
265 | <para> | ||
266 | Autobuilders are often the core of a development project. | ||
267 | It is here that changes from individual developers are brought | ||
268 | together and centrally tested and subsequent decisions about | ||
269 | releases can be made. | ||
270 | Autobuilders also allow for "continuous integration" style | ||
271 | testing of software components and regression identification | ||
272 | and tracking. | ||
273 | </para> | ||
274 | |||
275 | <para> | ||
276 | See "<ulink url='http://autobuilder.yoctoproject.org'>Yocto Project Autobuilder</ulink>" | ||
277 | for more information and links to buildbot. | ||
278 | The Yocto Project team has found this implementation | ||
279 | works well in this role. | ||
280 | A public example of this is the Yocto Project | ||
281 | Autobuilders, which we use to test the overall health of the | ||
282 | project. | ||
283 | </para> | ||
284 | |||
285 | <para> | ||
286 | The features of this system are: | ||
287 | <itemizedlist> | ||
288 | <listitem><para>Highlights when commits break the build. | ||
289 | </para></listitem> | ||
290 | <listitem><para>Populates an sstate cache from which | ||
291 | developers can pull rather than requiring local | ||
292 | builds.</para></listitem> | ||
293 | <listitem><para>Allows commit hook triggers, | ||
294 | which trigger builds when commits are made. | ||
295 | </para></listitem> | ||
296 | <listitem><para>Allows triggering of automated image booting | ||
297 | and testing under the QuickEMUlator (QEMU). | ||
298 | </para></listitem> | ||
299 | <listitem><para>Supports incremental build testing and | ||
300 | from-scratch builds.</para></listitem> | ||
301 | <listitem><para>Shares output that allows developer | ||
302 | testing and historical regression investigation. | ||
303 | </para></listitem> | ||
304 | <listitem><para>Creates output that can be used for releases. | ||
305 | </para></listitem> | ||
306 | <listitem><para>Allows scheduling of builds so that resources | ||
307 | can be used efficiently.</para></listitem> | ||
308 | </itemizedlist> | ||
309 | </para> | ||
310 | </section> | ||
311 | |||
312 | <section id='best-practices-policies-and-change-flow'> | ||
313 | <title>Policies and Change Flow</title> | ||
314 | |||
315 | <para> | ||
316 | The Yocto Project itself uses a hierarchical structure and a | ||
317 | pull model. | ||
318 | Scripts exist to create and send pull requests | ||
319 | (i.e. <filename>create-pull-request</filename> and | ||
320 | <filename>send-pull-request</filename>). | ||
321 | This model is in line with other open source projects where | ||
322 | maintainers are responsible for specific areas of the project | ||
323 | and a single maintainer handles the final "top-of-tree" merges. | ||
324 | </para> | ||
325 | |||
326 | <note> | ||
327 | You can also use a more collective push model. | ||
328 | The <filename>gitolite</filename> software supports both the | ||
329 | push and pull models quite easily. | ||
330 | </note> | ||
331 | |||
332 | <para> | ||
333 | As with any development environment, it is important | ||
334 | to document the policy used as well as any main project | ||
335 | guidelines so they are understood by everyone. | ||
336 | It is also a good idea to have well structured | ||
337 | commit messages, which are usually a part of a project's | ||
338 | guidelines. | ||
339 | Good commit messages are essential when looking back in time and | ||
340 | trying to understand why changes were made. | ||
341 | </para> | ||
342 | |||
343 | <para> | ||
344 | If you discover that changes are needed to the core layer of the | ||
345 | project, it is worth sharing those with the community as soon | ||
346 | as possible. | ||
347 | Chances are if you have discovered the need for changes, someone | ||
348 | else in the community needs them also. | ||
349 | </para> | ||
350 | </section> | ||
351 | |||
352 | <section id='best-practices-summary'> | ||
353 | <title>Summary</title> | ||
354 | |||
355 | <para> | ||
356 | This section summarizes the key recommendations described in the | ||
357 | previous sections: | ||
358 | <itemizedlist> | ||
359 | <listitem><para>Use <link linkend='git'>Git</link> | ||
360 | as the source control system.</para></listitem> | ||
361 | <listitem><para>Maintain your Metadata in layers that make sense | ||
362 | for your situation. | ||
363 | See the "<link linkend='understanding-and-creating-layers'>Understanding | ||
364 | and Creating Layers</link>" section for more information on | ||
365 | layers.</para></listitem> | ||
366 | <listitem><para> | ||
367 | Separate the project's Metadata and code by using | ||
368 | separate Git repositories. | ||
369 | See the | ||
370 | "<link linkend='yocto-project-repositories'>Yocto Project Source Repositories</link>" | ||
371 | section for information on these repositories. | ||
372 | See the | ||
373 | "<link linkend='getting-setup'>Getting Set Up</link>" | ||
374 | section for information on how to set up local Git | ||
375 | repositories for related upstream Yocto Project | ||
376 | Git repositories. | ||
377 | </para></listitem> | ||
378 | <listitem><para>Set up the directory for the shared state cache | ||
379 | (<ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>) | ||
380 | where it makes sense. | ||
381 | For example, set up the sstate cache on a system used | ||
382 | by developers in the same organization and share the | ||
383 | same source directories on their machines. | ||
384 | </para></listitem> | ||
385 | <listitem><para>Set up an Autobuilder and have it populate the | ||
386 | sstate cache and source directories.</para></listitem> | ||
387 | <listitem><para>The Yocto Project community encourages you | ||
388 | to send patches to the project to fix bugs or add features. | ||
389 | If you do submit patches, follow the project commit | ||
390 | guidelines for writing good commit messages. | ||
391 | See the "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>" | ||
392 | section.</para></listitem> | ||
393 | <listitem><para>Send changes to the core sooner than later | ||
394 | as others are likely to run into the same issues. | ||
395 | For some guidance on mailing lists to use, see the list in the | ||
396 | "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>" | ||
397 | section. | ||
398 | For a description of the available mailing lists, see the | ||
399 | "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing Lists</ulink>" | ||
400 | section in the Yocto Project Reference Manual. | ||
401 | </para></listitem> | ||
402 | </itemizedlist> | ||
403 | </para> | ||
404 | </section> | ||
405 | </section> | ||
406 | |||
407 | <section id='yocto-project-repositories'> | ||
408 | <title>Yocto Project Source Repositories</title> | ||
409 | |||
410 | <para> | ||
411 | The Yocto Project team maintains complete source repositories for all | ||
412 | Yocto Project files at | ||
413 | <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi'></ulink>. | ||
414 | This web-based source code browser is organized into categories by | ||
415 | function such as IDE Plugins, Matchbox, Poky, Yocto Linux Kernel, and | ||
416 | so forth. | ||
417 | From the interface, you can click on any particular item in the "Name" | ||
418 | column and see the URL at the bottom of the page that you need to clone | ||
419 | a Git repository for that particular item. | ||
420 | Having a local Git repository of the | ||
421 | <link linkend='source-directory'>Source Directory</link>, which is | ||
422 | usually named "poky", allows | ||
423 | you to make changes, contribute to the history, and ultimately enhance | ||
424 | the Yocto Project's tools, Board Support Packages, and so forth. | ||
425 | </para> | ||
426 | |||
427 | <para> | ||
428 | For any supported release of Yocto Project, you can also go to the | ||
429 | <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink> and | ||
430 | select the "Downloads" tab and get a released tarball of the | ||
431 | <filename>poky</filename> repository or any supported BSP tarballs. | ||
432 | Unpacking these tarballs gives you a snapshot of the released | ||
433 | files. | ||
434 | <note><title>Notes</title> | ||
435 | <itemizedlist> | ||
436 | <listitem><para> | ||
437 | The recommended method for setting up the Yocto Project | ||
438 | <link linkend='source-directory'>Source Directory</link> | ||
439 | and the files for supported BSPs | ||
440 | (e.g., <filename>meta-intel</filename>) is to use | ||
441 | <link linkend='git'>Git</link> to create a local copy of | ||
442 | the upstream repositories. | ||
443 | </para></listitem> | ||
444 | <listitem><para> | ||
445 | Be sure to always work in matching branches for both | ||
446 | the <filename>meta-intel</filename> repository and the | ||
447 | <link linkend='source-directory'>Source Directory</link> | ||
448 | (i.e. <filename>poky</filename>) repository. | ||
449 | For example, if you have checked out the "master" branch | ||
450 | of <filename>poky</filename> and you are going to use | ||
451 | <filename>meta-intel</filename>, be sure to checkout the | ||
452 | "master" branch of <filename>meta-intel</filename>. | ||
453 | </para></listitem> | ||
454 | </itemizedlist> | ||
455 | </note> | ||
456 | </para> | ||
457 | |||
458 | <para> | ||
459 | In summary, here is where you can get the project files needed for development: | ||
460 | <itemizedlist> | ||
461 | <listitem><para id='source-repositories'><emphasis><ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi'>Source Repositories:</ulink></emphasis> | ||
462 | This area contains IDE Plugins, Matchbox, Poky, Poky Support, Tools, Yocto Linux Kernel, and Yocto | ||
463 | Metadata Layers. | ||
464 | You can create local copies of Git repositories for each of these areas.</para> | ||
465 | <para> | ||
466 | <imagedata fileref="figures/source-repos.png" align="center" width="6in" depth="4in" /> | ||
467 | </para></listitem> | ||
468 | <listitem><para><anchor id='index-downloads' /><emphasis><ulink url='&YOCTO_DL_URL;/releases/'>Index of /releases:</ulink></emphasis> | ||
469 | This is an index of releases such as | ||
470 | the <trademark class='trade'>Eclipse</trademark> | ||
471 | Yocto Plug-in, miscellaneous support, Poky, Pseudo, installers for cross-development toolchains, | ||
472 | and all released versions of Yocto Project in the form of images or tarballs. | ||
473 | Downloading and extracting these files does not produce a local copy of the | ||
474 | Git repository but rather a snapshot of a particular release or image.</para> | ||
475 | <para> | ||
476 | <imagedata fileref="figures/index-downloads.png" align="center" width="6in" depth="3.5in" /> | ||
477 | </para></listitem> | ||
478 | <listitem><para><emphasis>"Downloads" page for the | ||
479 | <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>:</emphasis> | ||
480 | Access this page by going to the website and then selecting | ||
481 | the "Downloads" tab. | ||
482 | This page allows you to download any Yocto Project | ||
483 | release or Board Support Package (BSP) in tarball form. | ||
484 | The tarballs are similar to those found in the | ||
485 | <ulink url='&YOCTO_DL_URL;/releases/'>Index of /releases:</ulink> area.</para> | ||
486 | <para> | ||
487 | <imagedata fileref="figures/yp-download.png" align="center" width="6in" depth="4in" /> | ||
488 | </para></listitem> | ||
489 | </itemizedlist> | ||
490 | </para> | ||
491 | </section> | ||
492 | |||
493 | <section id='yocto-project-terms'> | ||
494 | <title>Yocto Project Terms</title> | ||
495 | |||
496 | <para> | ||
497 | Following is a list of terms and definitions users new to the Yocto Project development | ||
498 | environment might find helpful. | ||
499 | While some of these terms are universal, the list includes them just in case: | ||
500 | <itemizedlist> | ||
501 | <listitem><para><emphasis>Append Files:</emphasis> Files that append build information to | ||
502 | a recipe file. | ||
503 | Append files are known as BitBake append files and <filename>.bbappend</filename> files. | ||
504 | The OpenEmbedded build system expects every append file to have a corresponding | ||
505 | recipe (<filename>.bb</filename>) file. | ||
506 | Furthermore, the append file and corresponding recipe file | ||
507 | must use the same root filename. | ||
508 | The filenames can differ only in the file type suffix used (e.g. | ||
509 | <filename>formfactor_0.0.bb</filename> and <filename>formfactor_0.0.bbappend</filename>). | ||
510 | </para> | ||
511 | <para>Information in append files overrides the information in the similarly-named recipe file. | ||
512 | For an example of an append file in use, see the | ||
513 | "<link linkend='using-bbappend-files'>Using .bbappend Files</link>" section. | ||
514 | </para></listitem> | ||
515 | <listitem><para id='bitbake-term'><emphasis>BitBake:</emphasis> | ||
516 | The task executor and scheduler used by the OpenEmbedded build | ||
517 | system to build images. | ||
518 | For more information on BitBake, see the | ||
519 | <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>. | ||
520 | </para></listitem> | ||
521 | <listitem> | ||
522 | <para id='build-directory'><emphasis>Build Directory:</emphasis> | ||
523 | This term refers to the area used by the OpenEmbedded build | ||
524 | system for builds. | ||
525 | The area is created when you <filename>source</filename> the | ||
526 | setup environment script that is found in the Source Directory | ||
527 | (i.e. <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> | ||
528 | or | ||
529 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>). | ||
530 | The <ulink url='&YOCTO_DOCS_REF_URL;#var-TOPDIR'><filename>TOPDIR</filename></ulink> | ||
531 | variable points to the Build Directory.</para> | ||
532 | |||
533 | <para> | ||
534 | You have a lot of flexibility when creating the Build | ||
535 | Directory. | ||
536 | Following are some examples that show how to create the | ||
537 | directory. | ||
538 | The examples assume your | ||
539 | <link linkend='source-directory'>Source Directory</link> is | ||
540 | named <filename>poky</filename>: | ||
541 | <itemizedlist> | ||
542 | <listitem><para>Create the Build Directory inside your | ||
543 | Source Directory and let the name of the Build | ||
544 | Directory default to <filename>build</filename>: | ||
545 | <literallayout class='monospaced'> | ||
546 | $ cd $HOME/poky | ||
547 | $ source &OE_INIT_FILE; | ||
548 | </literallayout></para></listitem> | ||
549 | <listitem><para>Create the Build Directory inside your | ||
550 | home directory and specifically name it | ||
551 | <filename>test-builds</filename>: | ||
552 | <literallayout class='monospaced'> | ||
553 | $ cd $HOME | ||
554 | $ source poky/&OE_INIT_FILE; test-builds | ||
555 | </literallayout></para></listitem> | ||
556 | <listitem><para> | ||
557 | Provide a directory path and | ||
558 | specifically name the Build Directory. | ||
559 | Any intermediate folders in the pathname must | ||
560 | exist. | ||
561 | This next example creates a Build Directory named | ||
562 | <filename>YP-&POKYVERSION;</filename> | ||
563 | in your home directory within the existing | ||
564 | directory <filename>mybuilds</filename>: | ||
565 | <literallayout class='monospaced'> | ||
566 | $cd $HOME | ||
567 | $ source $HOME/poky/&OE_INIT_FILE; $HOME/mybuilds/YP-&POKYVERSION; | ||
568 | </literallayout></para></listitem> | ||
569 | </itemizedlist> | ||
570 | <note> | ||
571 | By default, the Build Directory contains | ||
572 | <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>, | ||
573 | which is a temporary directory the build system uses for | ||
574 | its work. | ||
575 | <filename>TMPDIR</filename> cannot be under NFS. | ||
576 | Thus, by default, the Build Directory cannot be under NFS. | ||
577 | However, if you need the Build Directory to be under NFS, | ||
578 | you can set this up by setting <filename>TMPDIR</filename> | ||
579 | in your <filename>local.conf</filename> file | ||
580 | to use a local drive. | ||
581 | Doing so effectively separates <filename>TMPDIR</filename> | ||
582 | from <filename>TOPDIR</filename>, which is the Build | ||
583 | Directory. | ||
584 | </note> | ||
585 | </para></listitem> | ||
586 | <listitem><para id='build-system-term'><emphasis>Build System:</emphasis> | ||
587 | In the context of the Yocto Project, | ||
588 | this term refers to the OpenEmbedded build system used by the project. | ||
589 | This build system is based on the project known as "Poky." | ||
590 | For some historical information about Poky, see the | ||
591 | <link linkend='poky'>Poky</link> term. | ||
592 | </para></listitem> | ||
593 | <listitem><para><emphasis>Classes:</emphasis> Files that provide for logic encapsulation | ||
594 | and inheritance so that commonly used patterns can be defined once and then easily used | ||
595 | in multiple recipes. | ||
596 | For reference information on the Yocto Project classes, see the | ||
597 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes'>Classes</ulink>" chapter of the | ||
598 | Yocto Project Reference Manual. | ||
599 | Class files end with the <filename>.bbclass</filename> filename extension. | ||
600 | </para></listitem> | ||
601 | <listitem><para><emphasis>Configuration File:</emphasis> | ||
602 | Configuration information in various <filename>.conf</filename> | ||
603 | files provides global definitions of variables. | ||
604 | The <filename>conf/local.conf</filename> configuration file in | ||
605 | the | ||
606 | <link linkend='build-directory'>Build Directory</link> | ||
607 | contains user-defined variables that affect every build. | ||
608 | The <filename>meta-yocto/conf/distro/poky.conf</filename> | ||
609 | configuration file defines Yocto "distro" configuration | ||
610 | variables used only when building with this policy. | ||
611 | Machine configuration files, which | ||
612 | are located throughout the | ||
613 | <link linkend='source-directory'>Source Directory</link>, define | ||
614 | variables for specific hardware and are only used when building | ||
615 | for that target (e.g. the | ||
616 | <filename>machine/beaglebone.conf</filename> configuration | ||
617 | file defines variables for the Texas Instruments ARM Cortex-A8 | ||
618 | development board). | ||
619 | Configuration files end with a <filename>.conf</filename> | ||
620 | filename extension. | ||
621 | </para></listitem> | ||
622 | <listitem><para id='cross-development-toolchain'> | ||
623 | <emphasis>Cross-Development Toolchain:</emphasis> | ||
624 | In general, a cross-development toolchain is a collection of | ||
625 | software development tools and utilities that run on one | ||
626 | architecture and allow you to develop software for a | ||
627 | different, or targeted, architecture. | ||
628 | These toolchains contain cross-compilers, linkers, and | ||
629 | debuggers that are specific to the target architecture. | ||
630 | </para> | ||
631 | |||
632 | <para>The Yocto Project supports two different cross-development | ||
633 | toolchains: | ||
634 | <itemizedlist> | ||
635 | <listitem><para>A toolchain only used by and within | ||
636 | BitBake when building an image for a target | ||
637 | architecture.</para></listitem> | ||
638 | <listitem><para>A relocatable toolchain used outside of | ||
639 | BitBake by developers when developing applications | ||
640 | that will run on a targeted device. | ||
641 | Sometimes this relocatable cross-development | ||
642 | toolchain is referred to as the meta-toolchain. | ||
643 | </para></listitem> | ||
644 | </itemizedlist> | ||
645 | </para> | ||
646 | |||
647 | <para> | ||
648 | Creation of these toolchains is simple and automated. | ||
649 | For information on toolchain concepts as they apply to the | ||
650 | Yocto Project, see the | ||
651 | "<ulink url='&YOCTO_DOCS_REF_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>" | ||
652 | section in the Yocto Project Reference Manual. | ||
653 | You can also find more information on using the | ||
654 | relocatable toolchain in the | ||
655 | <ulink url='&YOCTO_DOCS_ADT_URL;'>Yocto Project | ||
656 | Application Developer's Guide</ulink>. | ||
657 | </para></listitem> | ||
658 | <listitem><para><emphasis>Image:</emphasis> | ||
659 | An image is the result produced when BitBake processes a given | ||
660 | collection of recipes and related Metadata. | ||
661 | Images are the binary output that run on specific hardware or | ||
662 | QEMU and are used for specific use-cases. | ||
663 | For a list of the supported image types that the Yocto Project provides, see the | ||
664 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" | ||
665 | chapter in the Yocto Project Reference Manual.</para></listitem> | ||
666 | <listitem><para id='layer'><emphasis>Layer:</emphasis> A collection of recipes representing the core, | ||
667 | a BSP, or an application stack. | ||
668 | For a discussion on BSP Layers, see the | ||
669 | "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>" | ||
670 | section in the Yocto Project Board Support Packages (BSP) | ||
671 | Developer's Guide.</para></listitem> | ||
672 | <listitem><para id='meta-toolchain'><emphasis>Meta-Toolchain:</emphasis> | ||
673 | A term sometimes used for | ||
674 | <link linkend='cross-development-toolchain'>Cross-Development Toolchain</link>. | ||
675 | </para></listitem> | ||
676 | <listitem><para id='metadata'><emphasis>Metadata:</emphasis> | ||
677 | The files that BitBake parses when building an image. | ||
678 | In general, Metadata includes recipes, classes, and | ||
679 | configuration files. | ||
680 | In the context of the kernel ("kernel Metadata"), | ||
681 | it refers to Metadata in the <filename>meta</filename> | ||
682 | branches of the kernel source Git repositories. | ||
683 | </para></listitem> | ||
684 | <listitem><para id='oe-core'><emphasis>OE-Core:</emphasis> A core set of Metadata originating | ||
685 | with OpenEmbedded (OE) that is shared between OE and the Yocto Project. | ||
686 | This Metadata is found in the <filename>meta</filename> directory of the | ||
687 | <link linkend='source-directory'>Source Directory</link>.</para></listitem> | ||
688 | <listitem><para><emphasis>Package:</emphasis> | ||
689 | In the context of the Yocto Project, this term refers a | ||
690 | recipe's packaged output produced by BitBake (i.e. a | ||
691 | "baked recipe"). | ||
692 | A package is generally the compiled binaries produced from the | ||
693 | recipe's sources. | ||
694 | You "bake" something by running it through BitBake.</para> | ||
695 | <para>It is worth noting that the term "package" can, in general, have subtle | ||
696 | meanings. For example, the packages referred to in the | ||
697 | "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Packages</ulink>" section are | ||
698 | compiled binaries that when installed add functionality to your Linux | ||
699 | distribution.</para> | ||
700 | <para>Another point worth noting is that historically within the Yocto Project, | ||
701 | recipes were referred to as packages - thus, the existence of several BitBake | ||
702 | variables that are seemingly mis-named, | ||
703 | (e.g. <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>, | ||
704 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>, and | ||
705 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink>). | ||
706 | </para></listitem> | ||
707 | <listitem><para><emphasis>Package Groups:</emphasis> | ||
708 | Arbitrary groups of software Recipes. | ||
709 | You use package groups to hold recipes that, when built, | ||
710 | usually accomplish a single task. | ||
711 | For example, a package group could contain the recipes for a | ||
712 | company’s proprietary or value-add software. | ||
713 | Or, the package group could contain the recipes that enable | ||
714 | graphics. | ||
715 | A package group is really just another recipe. | ||
716 | Because package group files are recipes, they end with the | ||
717 | <filename>.bb</filename> filename extension.</para></listitem> | ||
718 | <listitem><para id='poky'><emphasis>Poky:</emphasis> The term "poky" can mean several things. | ||
719 | In its most general sense, it is an open-source project that was initially developed | ||
720 | by OpenedHand. With OpenedHand, poky was developed off of the existing OpenEmbedded | ||
721 | build system becoming a build system for embedded images. | ||
722 | After Intel Corporation acquired OpenedHand, the project poky became the basis for | ||
723 | the Yocto Project's build system.</para> | ||
724 | <para> | ||
725 | Within the Yocto Project source repositories, <filename>poky</filename> | ||
726 | exists as a separate Git repository | ||
727 | that can be cloned to yield a local copy on the host system. | ||
728 | Thus, "poky" can refer to the local copy of the Source Directory used to develop within | ||
729 | the Yocto Project.</para></listitem> | ||
730 | <listitem><para><emphasis>Recipe:</emphasis> | ||
731 | A set of instructions for building packages. | ||
732 | A recipe describes where you get source code and which patches | ||
733 | to apply. | ||
734 | Recipes describe dependencies for libraries or for other | ||
735 | recipes, and they also contain configuration and compilation | ||
736 | options. | ||
737 | Recipes contain the logical unit of execution, the software | ||
738 | to build, the images to build, and use the | ||
739 | <filename>.bb</filename> file extension. | ||
740 | </para></listitem> | ||
741 | <listitem> | ||
742 | <para id='source-directory'><emphasis>Source Directory:</emphasis> | ||
743 | This term refers to the directory structure created as a result | ||
744 | of creating a local copy of the <filename>poky</filename> Git | ||
745 | repository <filename>git://git.yoctoproject.org/poky</filename> | ||
746 | or expanding a released <filename>poky</filename> tarball. | ||
747 | <note> | ||
748 | Creating a local copy of the <filename>poky</filename> | ||
749 | Git repository is the recommended method for setting up | ||
750 | your Source Directory. | ||
751 | </note> | ||
752 | Sometimes you might hear the term "poky directory" used to refer | ||
753 | to this directory structure. | ||
754 | <note> | ||
755 | The OpenEmbedded build system does not support file or | ||
756 | directory names that contain spaces. | ||
757 | Be sure that the Source Directory you use does not contain | ||
758 | these types of names. | ||
759 | </note></para> | ||
760 | |||
761 | <para>The Source Directory contains BitBake, Documentation, | ||
762 | Metadata and other files that all support the Yocto Project. | ||
763 | Consequently, you must have the Source Directory in place on | ||
764 | your development system in order to do any development using | ||
765 | the Yocto Project.</para> | ||
766 | |||
767 | <para>When you create a local copy of the Git repository, you | ||
768 | can name the repository anything you like. | ||
769 | Throughout much of the documentation, "poky" | ||
770 | is used as the name of the top-level folder of the local copy of | ||
771 | the poky Git repository. | ||
772 | So, for example, cloning the <filename>poky</filename> Git | ||
773 | repository results in a local Git repository whose top-level | ||
774 | folder is also named "poky".</para> | ||
775 | |||
776 | <para>While it is not recommended that you use tarball expansion | ||
777 | to setup the Source Directory, if you do, the top-level | ||
778 | directory name of the Source Directory is derived from the | ||
779 | Yocto Project release tarball. | ||
780 | For example, downloading and unpacking | ||
781 | <filename>&YOCTO_POKY_TARBALL;</filename> results in a | ||
782 | Source Directory whose root folder is named | ||
783 | <filename>&YOCTO_POKY;</filename>.</para> | ||
784 | |||
785 | <para>It is important to understand the differences between the | ||
786 | Source Directory created by unpacking a released tarball as | ||
787 | compared to cloning | ||
788 | <filename>git://git.yoctoproject.org/poky</filename>. | ||
789 | When you unpack a tarball, you have an exact copy of the files | ||
790 | based on the time of release - a fixed release point. | ||
791 | Any changes you make to your local files in the Source Directory | ||
792 | are on top of the release and will remain local only. | ||
793 | On the other hand, when you clone the <filename>poky</filename> | ||
794 | Git repository, you have an active development repository with | ||
795 | access to the upstream repository's branches and tags. | ||
796 | In this case, any local changes you make to the local | ||
797 | Source Directory can be later applied to active development | ||
798 | branches of the upstream <filename>poky</filename> Git | ||
799 | repository.</para> | ||
800 | |||
801 | <para>For more information on concepts related to Git | ||
802 | repositories, branches, and tags, see the | ||
803 | "<link linkend='repositories-tags-and-branches'>Repositories, Tags, and Branches</link>" | ||
804 | section.</para></listitem> | ||
805 | <listitem><para><emphasis>Task:</emphasis> | ||
806 | A unit of execution for BitBake (e.g. | ||
807 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-compile'><filename>do_compile</filename></ulink>, | ||
808 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink>, | ||
809 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>, | ||
810 | and so forth). | ||
811 | </para></listitem> | ||
812 | <listitem><para><emphasis>Upstream:</emphasis> A reference to source code or repositories | ||
813 | that are not local to the development system but located in a master area that is controlled | ||
814 | by the maintainer of the source code. | ||
815 | For example, in order for a developer to work on a particular piece of code, they need to | ||
816 | first get a copy of it from an "upstream" source.</para></listitem> | ||
817 | </itemizedlist> | ||
818 | </para> | ||
819 | </section> | ||
820 | |||
821 | <section id='licensing'> | ||
822 | <title>Licensing</title> | ||
823 | |||
824 | <para> | ||
825 | Because open source projects are open to the public, they have different licensing structures in place. | ||
826 | License evolution for both Open Source and Free Software has an interesting history. | ||
827 | If you are interested in this history, you can find basic information here: | ||
828 | <itemizedlist> | ||
829 | <listitem><para><ulink url='http://en.wikipedia.org/wiki/Open-source_license'>Open source license history</ulink> | ||
830 | </para></listitem> | ||
831 | <listitem><para><ulink url='http://en.wikipedia.org/wiki/Free_software_license'>Free software license | ||
832 | history</ulink></para></listitem> | ||
833 | </itemizedlist> | ||
834 | </para> | ||
835 | |||
836 | <para> | ||
837 | In general, the Yocto Project is broadly licensed under the Massachusetts Institute of Technology | ||
838 | (MIT) License. | ||
839 | MIT licensing permits the reuse of software within proprietary software as long as the | ||
840 | license is distributed with that software. | ||
841 | MIT is also compatible with the GNU General Public License (GPL). | ||
842 | Patches to the Yocto Project follow the upstream licensing scheme. | ||
843 | You can find information on the MIT license at | ||
844 | <ulink url='http://www.opensource.org/licenses/mit-license.php'>here</ulink>. | ||
845 | You can find information on the GNU GPL <ulink url='http://www.opensource.org/licenses/LGPL-3.0'> | ||
846 | here</ulink>. | ||
847 | </para> | ||
848 | |||
849 | <para> | ||
850 | When you build an image using the Yocto Project, the build process uses a | ||
851 | known list of licenses to ensure compliance. | ||
852 | You can find this list in the | ||
853 | <link linkend='source-directory'>Source Directory</link> at | ||
854 | <filename>meta/files/common-licenses</filename>. | ||
855 | Once the build completes, the list of all licenses found and used during that build are | ||
856 | kept in the | ||
857 | <link linkend='build-directory'>Build Directory</link> at | ||
858 | <filename>tmp/deploy/licenses</filename>. | ||
859 | </para> | ||
860 | |||
861 | <para> | ||
862 | If a module requires a license that is not in the base list, the build process | ||
863 | generates a warning during the build. | ||
864 | These tools make it easier for a developer to be certain of the licenses with which | ||
865 | their shipped products must comply. | ||
866 | However, even with these tools it is still up to the developer to resolve potential licensing issues. | ||
867 | </para> | ||
868 | |||
869 | <para> | ||
870 | The base list of licenses used by the build process is a combination of the Software Package | ||
871 | Data Exchange (SPDX) list and the Open Source Initiative (OSI) projects. | ||
872 | <ulink url='http://spdx.org'>SPDX Group</ulink> is a working group of the Linux Foundation | ||
873 | that maintains a specification | ||
874 | for a standard format for communicating the components, licenses, and copyrights | ||
875 | associated with a software package. | ||
876 | <ulink url='http://opensource.org'>OSI</ulink> is a corporation dedicated to the Open Source | ||
877 | Definition and the effort for reviewing and approving licenses that | ||
878 | conform to the Open Source Definition (OSD). | ||
879 | </para> | ||
880 | |||
881 | <para> | ||
882 | You can find a list of the combined SPDX and OSI licenses that the | ||
883 | Yocto Project uses in the | ||
884 | <filename>meta/files/common-licenses</filename> directory in your | ||
885 | <link linkend='source-directory'>Source Directory</link>. | ||
886 | </para> | ||
887 | |||
888 | <para> | ||
889 | For information that can help you maintain compliance with various | ||
890 | open source licensing during the lifecycle of a product created using | ||
891 | the Yocto Project, see the | ||
892 | "<link linkend='maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</link>" | ||
893 | section. | ||
894 | </para> | ||
895 | </section> | ||
896 | |||
897 | <section id='git'> | ||
898 | <title>Git</title> | ||
899 | |||
900 | <para> | ||
901 | The Yocto Project makes extensive use of Git, | ||
902 | which is a free, open source distributed version control system. | ||
903 | Git supports distributed development, non-linear development, and can handle large projects. | ||
904 | It is best that you have some fundamental understanding of how Git tracks projects and | ||
905 | how to work with Git if you are going to use the Yocto Project for development. | ||
906 | This section provides a quick overview of how Git works and provides you with a summary | ||
907 | of some essential Git commands. | ||
908 | </para> | ||
909 | |||
910 | <para> | ||
911 | For more information on Git, see | ||
912 | <ulink url='http://git-scm.com/documentation'></ulink>. | ||
913 | If you need to download Git, go to <ulink url='http://git-scm.com/download'></ulink>. | ||
914 | </para> | ||
915 | |||
916 | <section id='repositories-tags-and-branches'> | ||
917 | <title>Repositories, Tags, and Branches</title> | ||
918 | |||
919 | <para> | ||
920 | As mentioned earlier in the section | ||
921 | "<link linkend='yocto-project-repositories'>Yocto Project Source Repositories</link>", | ||
922 | the Yocto Project maintains source repositories at | ||
923 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>. | ||
924 | If you look at this web-interface of the repositories, each item is a separate | ||
925 | Git repository. | ||
926 | </para> | ||
927 | |||
928 | <para> | ||
929 | Git repositories use branching techniques that track content change (not files) | ||
930 | within a project (e.g. a new feature or updated documentation). | ||
931 | Creating a tree-like structure based on project divergence allows for excellent historical | ||
932 | information over the life of a project. | ||
933 | This methodology also allows for an environment from which you can do lots of | ||
934 | local experimentation on projects as you develop changes or new features. | ||
935 | </para> | ||
936 | |||
937 | <para> | ||
938 | A Git repository represents all development efforts for a given project. | ||
939 | For example, the Git repository <filename>poky</filename> contains all changes | ||
940 | and developments for Poky over the course of its entire life. | ||
941 | That means that all changes that make up all releases are captured. | ||
942 | The repository maintains a complete history of changes. | ||
943 | </para> | ||
944 | |||
945 | <para> | ||
946 | You can create a local copy of any repository by "cloning" it with the Git | ||
947 | <filename>clone</filename> command. | ||
948 | When you clone a Git repository, you end up with an identical copy of the | ||
949 | repository on your development system. | ||
950 | Once you have a local copy of a repository, you can take steps to develop locally. | ||
951 | For examples on how to clone Git repositories, see the | ||
952 | "<link linkend='getting-setup'>Getting Set Up</link>" section. | ||
953 | </para> | ||
954 | |||
955 | <para> | ||
956 | It is important to understand that Git tracks content change and | ||
957 | not files. | ||
958 | Git uses "branches" to organize different development efforts. | ||
959 | For example, the <filename>poky</filename> repository has | ||
960 | <filename>denzil</filename>, <filename>danny</filename>, | ||
961 | <filename>dylan</filename>, <filename>dora</filename>, | ||
962 | <filename>daisy</filename>, and <filename>master</filename> branches | ||
963 | among others. | ||
964 | You can see all the branches by going to | ||
965 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/'></ulink> and | ||
966 | clicking on the | ||
967 | <filename><ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/refs/heads'>[...]</ulink></filename> | ||
968 | link beneath the "Branch" heading. | ||
969 | </para> | ||
970 | |||
971 | <para> | ||
972 | Each of these branches represents a specific area of development. | ||
973 | The <filename>master</filename> branch represents the current or most recent | ||
974 | development. | ||
975 | All other branches represent off-shoots of the <filename>master</filename> | ||
976 | branch. | ||
977 | </para> | ||
978 | |||
979 | <para> | ||
980 | When you create a local copy of a Git repository, the copy has the same set | ||
981 | of branches as the original. | ||
982 | This means you can use Git to create a local working area (also called a branch) | ||
983 | that tracks a specific development branch from the source Git repository. | ||
984 | in other words, you can define your local Git environment to work on any development | ||
985 | branch in the repository. | ||
986 | To help illustrate, here is a set of commands that creates a local copy of the | ||
987 | <filename>poky</filename> Git repository and then creates and checks out a local | ||
988 | Git branch that tracks the Yocto Project &DISTRO; Release (&DISTRO_NAME;) development: | ||
989 | <literallayout class='monospaced'> | ||
990 | $ cd ~ | ||
991 | $ git clone git://git.yoctoproject.org/poky | ||
992 | $ cd poky | ||
993 | $ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME; | ||
994 | </literallayout> | ||
995 | In this example, the name of the top-level directory of your local | ||
996 | <link linkend='source-directory'>Source Directory</link> | ||
997 | is "poky" and the name of that local working area (local branch) | ||
998 | you just created and checked out is "&DISTRO_NAME;". | ||
999 | The files in your local repository now reflect the same files that | ||
1000 | are in the "&DISTRO_NAME;" development branch of the | ||
1001 | Yocto Project's "poky" upstream repository. | ||
1002 | It is important to understand that when you create and checkout a | ||
1003 | local working branch based on a branch name, | ||
1004 | your local environment matches the "tip" of that development branch | ||
1005 | at the time you created your local branch, which could be | ||
1006 | different from the files at the time of a similarly named release. | ||
1007 | In other words, creating and checking out a local branch based on | ||
1008 | the "&DISTRO_NAME;" branch name is not the same as | ||
1009 | cloning and checking out the "master" branch. | ||
1010 | Keep reading to see how you create a local snapshot of a Yocto | ||
1011 | Project Release. | ||
1012 | </para> | ||
1013 | |||
1014 | <para> | ||
1015 | Git uses "tags" to mark specific changes in a repository. | ||
1016 | Typically, a tag is used to mark a special point such as the final | ||
1017 | change before a project is released. | ||
1018 | You can see the tags used with the <filename>poky</filename> Git | ||
1019 | repository by going to | ||
1020 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/'></ulink> and | ||
1021 | clicking on the | ||
1022 | <filename><ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/refs/tags'>[...]</ulink></filename> | ||
1023 | link beneath the "Tag" heading. | ||
1024 | </para> | ||
1025 | |||
1026 | <para> | ||
1027 | Some key tags are <filename>dylan-9.0.0</filename>, | ||
1028 | <filename>dora-10.0.0</filename>, | ||
1029 | and <filename>&DISTRO_NAME;-&POKYVERSION;</filename>. | ||
1030 | These tags represent Yocto Project releases. | ||
1031 | </para> | ||
1032 | |||
1033 | <para> | ||
1034 | When you create a local copy of the Git repository, you also have access to all the | ||
1035 | tags. | ||
1036 | Similar to branches, you can create and checkout a local working Git branch based | ||
1037 | on a tag name. | ||
1038 | When you do this, you get a snapshot of the Git repository that reflects | ||
1039 | the state of the files when the change was made associated with that tag. | ||
1040 | The most common use is to checkout a working branch that matches a specific | ||
1041 | Yocto Project release. | ||
1042 | Here is an example: | ||
1043 | <literallayout class='monospaced'> | ||
1044 | $ cd ~ | ||
1045 | $ git clone git://git.yoctoproject.org/poky | ||
1046 | $ cd poky | ||
1047 | $ git checkout -b my-&DISTRO_NAME;-&POKYVERSION; &DISTRO_NAME;-&POKYVERSION; | ||
1048 | </literallayout> | ||
1049 | In this example, the name of the top-level directory of your local Yocto Project | ||
1050 | Files Git repository is <filename>poky</filename>. | ||
1051 | And, the name of the local branch you have created and checked out is | ||
1052 | <filename>my-&DISTRO_NAME;-&POKYVERSION;</filename>. | ||
1053 | The files in your repository now exactly match the Yocto Project &DISTRO; | ||
1054 | Release tag (<filename>&DISTRO_NAME;-&POKYVERSION;</filename>). | ||
1055 | It is important to understand that when you create and checkout a local | ||
1056 | working branch based on a tag, your environment matches a specific point | ||
1057 | in time and not the entire development branch. | ||
1058 | </para> | ||
1059 | </section> | ||
1060 | |||
1061 | <section id='basic-commands'> | ||
1062 | <title>Basic Commands</title> | ||
1063 | |||
1064 | <para> | ||
1065 | Git has an extensive set of commands that lets you manage changes and perform | ||
1066 | collaboration over the life of a project. | ||
1067 | Conveniently though, you can manage with a small set of basic operations and workflows | ||
1068 | once you understand the basic philosophy behind Git. | ||
1069 | You do not have to be an expert in Git to be functional. | ||
1070 | A good place to look for instruction on a minimal set of Git commands is | ||
1071 | <ulink url='http://git-scm.com/documentation'>here</ulink>. | ||
1072 | If you need to download Git, you can do so | ||
1073 | <ulink url='http://git-scm.com/download'>here</ulink>. | ||
1074 | </para> | ||
1075 | |||
1076 | <para> | ||
1077 | If you do not know much about Git, you should educate | ||
1078 | yourself by visiting the links previously mentioned. | ||
1079 | </para> | ||
1080 | |||
1081 | <para> | ||
1082 | The following list briefly describes some basic Git operations as a way to get started. | ||
1083 | As with any set of commands, this list (in most cases) simply shows the base command and | ||
1084 | omits the many arguments they support. | ||
1085 | See the Git documentation for complete descriptions and strategies on how to use these commands: | ||
1086 | <itemizedlist> | ||
1087 | <listitem><para><emphasis><filename>git init</filename>:</emphasis> Initializes an empty Git repository. | ||
1088 | You cannot use Git commands unless you have a <filename>.git</filename> repository.</para></listitem> | ||
1089 | <listitem><para><emphasis><filename>git clone</filename>:</emphasis> | ||
1090 | Creates a local clone of a Git repository. | ||
1091 | During collaboration, this command allows you to create a | ||
1092 | local Git repository that is on equal footing with a fellow | ||
1093 | developer’s Git repository. | ||
1094 | </para></listitem> | ||
1095 | <listitem><para><emphasis><filename>git add</filename>:</emphasis> Stages updated file contents | ||
1096 | to the index that | ||
1097 | Git uses to track changes. | ||
1098 | You must stage all files that have changed before you can commit them.</para></listitem> | ||
1099 | <listitem><para><emphasis><filename>git commit</filename>:</emphasis> Creates a "commit" that documents | ||
1100 | the changes you made. | ||
1101 | Commits are used for historical purposes, for determining if a maintainer of a project | ||
1102 | will allow the change, and for ultimately pushing the change from your local Git repository | ||
1103 | into the project’s upstream (or master) repository.</para></listitem> | ||
1104 | <listitem><para><emphasis><filename>git status</filename>:</emphasis> Reports any modified files that | ||
1105 | possibly need to be staged and committed.</para></listitem> | ||
1106 | <listitem><para><emphasis><filename>git checkout <branch-name></filename>:</emphasis> Changes | ||
1107 | your working branch. | ||
1108 | This command is analogous to "cd".</para></listitem> | ||
1109 | <listitem><para><emphasis><filename>git checkout –b <working-branch></filename>:</emphasis> Creates | ||
1110 | a working branch on your local machine where you can isolate work. | ||
1111 | It is a good idea to use local branches when adding specific features or changes. | ||
1112 | This way if you do not like what you have done you can easily get rid of the work.</para></listitem> | ||
1113 | <listitem><para><emphasis><filename>git branch</filename>:</emphasis> Reports | ||
1114 | existing local branches and | ||
1115 | tells you the branch in which you are currently working.</para></listitem> | ||
1116 | <listitem><para><emphasis><filename>git branch -D <branch-name></filename>:</emphasis> | ||
1117 | Deletes an existing local branch. | ||
1118 | You need to be in a local branch other than the one you are deleting | ||
1119 | in order to delete <filename><branch-name></filename>.</para></listitem> | ||
1120 | <listitem><para><emphasis><filename>git pull</filename>:</emphasis> Retrieves information | ||
1121 | from an upstream Git | ||
1122 | repository and places it in your local Git repository. | ||
1123 | You use this command to make sure you are synchronized with the repository | ||
1124 | from which you are basing changes (.e.g. the master branch).</para></listitem> | ||
1125 | <listitem><para><emphasis><filename>git push</filename>:</emphasis> | ||
1126 | Sends all your committed local changes to an upstream Git | ||
1127 | repository (e.g. a contribution repository). | ||
1128 | The maintainer of the project draws from these repositories | ||
1129 | when adding changes to the project’s master repository or | ||
1130 | other development branch. | ||
1131 | </para></listitem> | ||
1132 | <listitem><para><emphasis><filename>git merge</filename>:</emphasis> Combines or adds changes from one | ||
1133 | local branch of your repository with another branch. | ||
1134 | When you create a local Git repository, the default branch is named "master". | ||
1135 | A typical workflow is to create a temporary branch for isolated work, make and commit your | ||
1136 | changes, switch to your local master branch, merge the changes from the temporary branch into the | ||
1137 | local master branch, and then delete the temporary branch.</para></listitem> | ||
1138 | <listitem><para><emphasis><filename>git cherry-pick</filename>:</emphasis> Choose and apply specific | ||
1139 | commits from one branch into another branch. | ||
1140 | There are times when you might not be able to merge all the changes in one branch with | ||
1141 | another but need to pick out certain ones.</para></listitem> | ||
1142 | <listitem><para><emphasis><filename>gitk</filename>:</emphasis> Provides a GUI view of the branches | ||
1143 | and changes in your local Git repository. | ||
1144 | This command is a good way to graphically see where things have diverged in your | ||
1145 | local repository.</para></listitem> | ||
1146 | <listitem><para><emphasis><filename>git log</filename>:</emphasis> Reports a history of your changes to the | ||
1147 | repository.</para></listitem> | ||
1148 | <listitem><para><emphasis><filename>git diff</filename>:</emphasis> Displays line-by-line differences | ||
1149 | between your local working files and the same files in the upstream Git repository that your | ||
1150 | branch currently tracks.</para></listitem> | ||
1151 | </itemizedlist> | ||
1152 | </para> | ||
1153 | </section> | ||
1154 | </section> | ||
1155 | |||
1156 | <section id='workflows'> | ||
1157 | <title>Workflows</title> | ||
1158 | |||
1159 | <para> | ||
1160 | This section provides some overview on workflows using Git. | ||
1161 | In particular, the information covers basic practices that describe roles and actions in a | ||
1162 | collaborative development environment. | ||
1163 | Again, if you are familiar with this type of development environment, you might want to just | ||
1164 | skip this section. | ||
1165 | </para> | ||
1166 | |||
1167 | <para> | ||
1168 | The Yocto Project files are maintained using Git in a "master" branch whose Git history | ||
1169 | tracks every change and whose structure provides branches for all diverging functionality. | ||
1170 | Although there is no need to use Git, many open source projects do so. | ||
1171 | For the Yocto Project, a key individual called the "maintainer" is responsible for the "master" | ||
1172 | branch of a given Git repository. | ||
1173 | The "master" branch is the “upstream” repository where the final builds of the project occur. | ||
1174 | The maintainer is responsible for allowing changes in from other developers and for | ||
1175 | organizing the underlying branch structure to reflect release strategies and so forth. | ||
1176 | <note>For information on finding out who is responsible (maintains) | ||
1177 | for a particular area of code, see the | ||
1178 | "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>" | ||
1179 | section. | ||
1180 | </note> | ||
1181 | </para> | ||
1182 | |||
1183 | <para> | ||
1184 | The project also has an upstream contribution Git repository named | ||
1185 | <filename>poky-contrib</filename>. | ||
1186 | You can see all the branches in this repository using the web interface | ||
1187 | of the | ||
1188 | <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink> organized | ||
1189 | within the "Poky Support" area. | ||
1190 | These branches temporarily hold changes to the project that have been | ||
1191 | submitted or committed by the Yocto Project development team and by | ||
1192 | community members who contribute to the project. | ||
1193 | The maintainer determines if the changes are qualified to be moved | ||
1194 | from the "contrib" branches into the "master" branch of the Git | ||
1195 | repository. | ||
1196 | </para> | ||
1197 | |||
1198 | <para> | ||
1199 | Developers (including contributing community members) create and maintain cloned repositories | ||
1200 | of the upstream "master" branch. | ||
1201 | These repositories are local to their development platforms and are used to develop changes. | ||
1202 | When a developer is satisfied with a particular feature or change, they "push" the changes | ||
1203 | to the appropriate "contrib" repository. | ||
1204 | </para> | ||
1205 | |||
1206 | <para> | ||
1207 | Developers are responsible for keeping their local repository up-to-date with "master". | ||
1208 | They are also responsible for straightening out any conflicts that might arise within files | ||
1209 | that are being worked on simultaneously by more than one person. | ||
1210 | All this work is done locally on the developer’s machines before anything is pushed to a | ||
1211 | "contrib" area and examined at the maintainer’s level. | ||
1212 | </para> | ||
1213 | |||
1214 | <para> | ||
1215 | A somewhat formal method exists by which developers commit changes and push them into the | ||
1216 | "contrib" area and subsequently request that the maintainer include them into "master" | ||
1217 | This process is called “submitting a patch” or "submitting a change." | ||
1218 | For information on submitting patches and changes, see the | ||
1219 | "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>" section. | ||
1220 | </para> | ||
1221 | |||
1222 | <para> | ||
1223 | To summarize the environment: a single point of entry exists for | ||
1224 | changes into the project’s "master" branch of the Git repository, | ||
1225 | which is controlled by the project’s maintainer. | ||
1226 | And, a set of developers exist who independently develop, test, and | ||
1227 | submit changes to "contrib" areas for the maintainer to examine. | ||
1228 | The maintainer then chooses which changes are going to become a | ||
1229 | permanent part of the project. | ||
1230 | </para> | ||
1231 | |||
1232 | <para> | ||
1233 | <imagedata fileref="figures/git-workflow.png" width="6in" depth="3in" align="left" scalefit="1" /> | ||
1234 | </para> | ||
1235 | |||
1236 | <para> | ||
1237 | While each development environment is unique, there are some best practices or methods | ||
1238 | that help development run smoothly. | ||
1239 | The following list describes some of these practices. | ||
1240 | For more information about Git workflows, see the workflow topics in the | ||
1241 | <ulink url='http://book.git-scm.com'>Git Community Book</ulink>. | ||
1242 | <itemizedlist> | ||
1243 | <listitem><para><emphasis>Make Small Changes:</emphasis> It is best to keep the changes you commit | ||
1244 | small as compared to bundling many disparate changes into a single commit. | ||
1245 | This practice not only keeps things manageable but also allows the maintainer | ||
1246 | to more easily include or refuse changes.</para> | ||
1247 | <para>It is also good practice to leave the repository in a state that allows you to | ||
1248 | still successfully build your project. In other words, do not commit half of a feature, | ||
1249 | then add the other half as a separate, later commit. | ||
1250 | Each commit should take you from one buildable project state to another | ||
1251 | buildable state.</para></listitem> | ||
1252 | <listitem><para><emphasis>Use Branches Liberally:</emphasis> It is very easy to create, use, and | ||
1253 | delete local branches in your working Git repository. | ||
1254 | You can name these branches anything you like. | ||
1255 | It is helpful to give them names associated with the particular feature or change | ||
1256 | on which you are working. | ||
1257 | Once you are done with a feature or change and have merged it | ||
1258 | into your local master branch, simply discard the temporary | ||
1259 | branch.</para></listitem> | ||
1260 | <listitem><para><emphasis>Merge Changes:</emphasis> The <filename>git merge</filename> | ||
1261 | command allows you to take the | ||
1262 | changes from one branch and fold them into another branch. | ||
1263 | This process is especially helpful when more than a single developer might be working | ||
1264 | on different parts of the same feature. | ||
1265 | Merging changes also automatically identifies any collisions or "conflicts" | ||
1266 | that might happen as a result of the same lines of code being altered by two different | ||
1267 | developers.</para></listitem> | ||
1268 | <listitem><para><emphasis>Manage Branches:</emphasis> Because branches are easy to use, you should | ||
1269 | use a system where branches indicate varying levels of code readiness. | ||
1270 | For example, you can have a "work" branch to develop in, a "test" branch where the code or | ||
1271 | change is tested, a "stage" branch where changes are ready to be committed, and so forth. | ||
1272 | As your project develops, you can merge code across the branches to reflect ever-increasing | ||
1273 | stable states of the development.</para></listitem> | ||
1274 | <listitem><para><emphasis>Use Push and Pull:</emphasis> The push-pull workflow is based on the | ||
1275 | concept of developers "pushing" local commits to a remote repository, which is | ||
1276 | usually a contribution repository. | ||
1277 | This workflow is also based on developers "pulling" known states of the project down into their | ||
1278 | local development repositories. | ||
1279 | The workflow easily allows you to pull changes submitted by other developers from the | ||
1280 | upstream repository into your work area ensuring that you have the most recent software | ||
1281 | on which to develop. | ||
1282 | The Yocto Project has two scripts named <filename>create-pull-request</filename> and | ||
1283 | <filename>send-pull-request</filename> that ship with the release to facilitate this | ||
1284 | workflow. | ||
1285 | You can find these scripts in the <filename>scripts</filename> | ||
1286 | folder of the | ||
1287 | <link linkend='source-directory'>Source Directory</link>. | ||
1288 | For information on how to use these scripts, see the | ||
1289 | "<link linkend='pushing-a-change-upstream'>Using Scripts to Push a Change Upstream and Request a Pull</link>" section. | ||
1290 | </para></listitem> | ||
1291 | <listitem><para><emphasis>Patch Workflow:</emphasis> This workflow allows you to notify the | ||
1292 | maintainer through an email that you have a change (or patch) you would like considered | ||
1293 | for the "master" branch of the Git repository. | ||
1294 | To send this type of change, you format the patch and then send the email using the Git commands | ||
1295 | <filename>git format-patch</filename> and <filename>git send-email</filename>. | ||
1296 | For information on how to use these scripts, see the | ||
1297 | "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>" | ||
1298 | section. | ||
1299 | </para></listitem> | ||
1300 | </itemizedlist> | ||
1301 | </para> | ||
1302 | </section> | ||
1303 | |||
1304 | <section id='tracking-bugs'> | ||
1305 | <title>Tracking Bugs</title> | ||
1306 | |||
1307 | <para> | ||
1308 | The Yocto Project uses its own implementation of | ||
1309 | <ulink url='http://www.bugzilla.org/about/'>Bugzilla</ulink> to track bugs. | ||
1310 | Implementations of Bugzilla work well for group development because they track bugs and code | ||
1311 | changes, can be used to communicate changes and problems with developers, can be used to | ||
1312 | submit and review patches, and can be used to manage quality assurance. | ||
1313 | The home page for the Yocto Project implementation of Bugzilla is | ||
1314 | <ulink url='&YOCTO_BUGZILLA_URL;'>&YOCTO_BUGZILLA_URL;</ulink>. | ||
1315 | </para> | ||
1316 | |||
1317 | <para> | ||
1318 | Sometimes it is helpful to submit, investigate, or track a bug against the Yocto Project itself | ||
1319 | such as when discovering an issue with some component of the build system that acts contrary | ||
1320 | to the documentation or your expectations. | ||
1321 | Following is the general procedure for submitting a new bug using the Yocto Project | ||
1322 | Bugzilla. | ||
1323 | You can find more information on defect management, bug tracking, and feature request | ||
1324 | processes all accomplished through the Yocto Project Bugzilla on the wiki page | ||
1325 | <ulink url='&YOCTO_WIKI_URL;/wiki/Bugzilla_Configuration_and_Bug_Tracking'>here</ulink>. | ||
1326 | <orderedlist> | ||
1327 | <listitem><para>Always use the Yocto Project implementation of Bugzilla to submit | ||
1328 | a bug.</para></listitem> | ||
1329 | <listitem><para>When submitting a new bug, be sure to choose the appropriate | ||
1330 | Classification, Product, and Component for which the issue was found. | ||
1331 | Defects for the Yocto Project fall into one of six classifications: Yocto Project | ||
1332 | Components, Infrastructure, Build System & Metadata, Documentation, | ||
1333 | QA/Testing, and Runtime. | ||
1334 | Each of these Classifications break down into multiple Products and, in some | ||
1335 | cases, multiple Components.</para></listitem> | ||
1336 | <listitem><para>Use the bug form to choose the correct Hardware and Architecture | ||
1337 | for which the bug applies.</para></listitem> | ||
1338 | <listitem><para>Indicate the Yocto Project version you were using when the issue | ||
1339 | occurred.</para></listitem> | ||
1340 | <listitem><para>Be sure to indicate the Severity of the bug. | ||
1341 | Severity communicates how the bug impacted your work.</para></listitem> | ||
1342 | <listitem><para>Select the appropriate "Documentation change" item | ||
1343 | for the bug. | ||
1344 | Fixing a bug may or may not affect the Yocto Project | ||
1345 | documentation.</para></listitem> | ||
1346 | <listitem><para>Provide a brief summary of the issue. | ||
1347 | Try to limit your summary to just a line or two and be sure to capture the | ||
1348 | essence of the issue.</para></listitem> | ||
1349 | <listitem><para>Provide a detailed description of the issue. | ||
1350 | You should provide as much detail as you can about the context, behavior, output, | ||
1351 | and so forth that surrounds the issue. | ||
1352 | You can even attach supporting files for output from logs by | ||
1353 | using the "Add an attachment" button.</para></listitem> | ||
1354 | <listitem><para>Be sure to copy the appropriate people in the | ||
1355 | "CC List" for the bug. | ||
1356 | See the "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>" | ||
1357 | section for information about finding out who is responsible | ||
1358 | for code.</para></listitem> | ||
1359 | <listitem><para>Submit the bug by clicking the "Submit Bug" button.</para></listitem> | ||
1360 | </orderedlist> | ||
1361 | </para> | ||
1362 | </section> | ||
1363 | |||
1364 | <section id='how-to-submit-a-change'> | ||
1365 | <title>How to Submit a Change</title> | ||
1366 | |||
1367 | <para> | ||
1368 | Contributions to the Yocto Project and OpenEmbedded are very welcome. | ||
1369 | Because the system is extremely configurable and flexible, we recognize that developers | ||
1370 | will want to extend, configure or optimize it for their specific uses. | ||
1371 | You should send patches to the appropriate mailing list so that they | ||
1372 | can be reviewed and merged by the appropriate maintainer. | ||
1373 | </para> | ||
1374 | |||
1375 | <para> | ||
1376 | Before submitting any change, be sure to find out who you should be | ||
1377 | notifying. | ||
1378 | Several methods exist through which you find out who you should be copying | ||
1379 | or notifying: | ||
1380 | <itemizedlist> | ||
1381 | <listitem><para><emphasis>Maintenance File:</emphasis> | ||
1382 | Examine the <filename>maintainers.inc</filename> file, which is | ||
1383 | located in the | ||
1384 | <link linkend='source-directory'>Source Directory</link> | ||
1385 | at <filename>meta-yocto/conf/distro/include</filename>, to | ||
1386 | see who is responsible for code. | ||
1387 | </para></listitem> | ||
1388 | <listitem><para><emphasis>Board Support Package (BSP) README Files:</emphasis> | ||
1389 | For BSP maintainers of supported BSPs, you can examine | ||
1390 | individual BSP <filename>README</filename> files. | ||
1391 | In addition, some layers (such as the <filename>meta-intel</filename> layer), | ||
1392 | include a <filename>MAINTAINERS</filename> file which contains | ||
1393 | a list of all supported BSP maintainers for that layer. | ||
1394 | </para></listitem> | ||
1395 | <listitem><para><emphasis>Search by File:</emphasis> | ||
1396 | Using <link linkend='git'>Git</link>, you can enter the | ||
1397 | following command to bring up a short list of all commits | ||
1398 | against a specific file: | ||
1399 | <literallayout class='monospaced'> | ||
1400 | git shortlog -- <filename> | ||
1401 | </literallayout> | ||
1402 | Just provide the name of the file for which you are interested. | ||
1403 | The information returned is not ordered by history but does | ||
1404 | include a list of all committers grouped by name. | ||
1405 | From the list, you can see who is responsible for the bulk of | ||
1406 | the changes against the file. | ||
1407 | </para></listitem> | ||
1408 | </itemizedlist> | ||
1409 | </para> | ||
1410 | |||
1411 | <para> | ||
1412 | For a list of the Yocto Project and related mailing lists, see the | ||
1413 | "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing lists</ulink>" section in | ||
1414 | the Yocto Project Reference Manual. | ||
1415 | </para> | ||
1416 | |||
1417 | <para> | ||
1418 | Here is some guidance on which mailing list to use for what type of change: | ||
1419 | <itemizedlist> | ||
1420 | <listitem><para>For changes to the core | ||
1421 | <link linkend='metadata'>Metadata</link>, send your patch to the | ||
1422 | <ulink url='&OE_LISTS_URL;/listinfo/openembedded-core'>openembedded-core</ulink> mailing list. | ||
1423 | For example, a change to anything under the <filename>meta</filename> or | ||
1424 | <filename>scripts</filename> directories | ||
1425 | should be sent to this mailing list.</para></listitem> | ||
1426 | <listitem><para>For changes to BitBake (anything under the <filename>bitbake</filename> | ||
1427 | directory), send your patch to the | ||
1428 | <ulink url='&OE_LISTS_URL;/listinfo/bitbake-devel'>bitbake-devel</ulink> mailing list.</para></listitem> | ||
1429 | <listitem><para>For changes to <filename>meta-yocto</filename>, send your patch to the | ||
1430 | <ulink url='&YOCTO_LISTS_URL;/listinfo/poky'>poky</ulink> mailing list.</para></listitem> | ||
1431 | <listitem><para>For changes to other layers hosted on | ||
1432 | <filename>yoctoproject.org</filename> (unless the | ||
1433 | layer's documentation specifies otherwise), tools, and Yocto Project | ||
1434 | documentation, use the | ||
1435 | <ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'>yocto</ulink> mailing list.</para></listitem> | ||
1436 | <listitem><para>For additional recipes that do not fit into the core Metadata, | ||
1437 | you should determine which layer the recipe should go into and submit the | ||
1438 | change in the manner recommended by the documentation (e.g. README) supplied | ||
1439 | with the layer. If in doubt, please ask on the | ||
1440 | <ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'>yocto</ulink> or | ||
1441 | <ulink url='&OE_LISTS_URL;/listinfo/openembedded-devel'>openembedded-devel</ulink> | ||
1442 | mailing lists.</para></listitem> | ||
1443 | </itemizedlist> | ||
1444 | </para> | ||
1445 | |||
1446 | <para> | ||
1447 | When you send a patch, be sure to include a "Signed-off-by:" | ||
1448 | line in the same style as required by the Linux kernel. | ||
1449 | Adding this line signifies that you, the submitter, have agreed to the Developer's Certificate of Origin 1.1 | ||
1450 | as follows: | ||
1451 | <literallayout class='monospaced'> | ||
1452 | Developer's Certificate of Origin 1.1 | ||
1453 | |||
1454 | By making a contribution to this project, I certify that: | ||
1455 | |||
1456 | (a) The contribution was created in whole or in part by me and I | ||
1457 | have the right to submit it under the open source license | ||
1458 | indicated in the file; or | ||
1459 | |||
1460 | (b) The contribution is based upon previous work that, to the best | ||
1461 | of my knowledge, is covered under an appropriate open source | ||
1462 | license and I have the right under that license to submit that | ||
1463 | work with modifications, whether created in whole or in part | ||
1464 | by me, under the same open source license (unless I am | ||
1465 | permitted to submit under a different license), as indicated | ||
1466 | in the file; or | ||
1467 | |||
1468 | (c) The contribution was provided directly to me by some other | ||
1469 | person who certified (a), (b) or (c) and I have not modified | ||
1470 | it. | ||
1471 | |||
1472 | (d) I understand and agree that this project and the contribution | ||
1473 | are public and that a record of the contribution (including all | ||
1474 | personal information I submit with it, including my sign-off) is | ||
1475 | maintained indefinitely and may be redistributed consistent with | ||
1476 | this project or the open source license(s) involved. | ||
1477 | </literallayout> | ||
1478 | </para> | ||
1479 | |||
1480 | <para> | ||
1481 | In a collaborative environment, it is necessary to have some sort of standard | ||
1482 | or method through which you submit changes. | ||
1483 | Otherwise, things could get quite chaotic. | ||
1484 | One general practice to follow is to make small, controlled changes. | ||
1485 | Keeping changes small and isolated aids review, makes merging/rebasing easier | ||
1486 | and keeps the change history clean when anyone needs to refer to it in future. | ||
1487 | </para> | ||
1488 | |||
1489 | <para> | ||
1490 | When you make a commit, you must follow certain standards established by the | ||
1491 | OpenEmbedded and Yocto Project development teams. | ||
1492 | For each commit, you must provide a single-line summary of the change and you | ||
1493 | should almost always provide a more detailed description of what you did (i.e. | ||
1494 | the body of the commit message). | ||
1495 | The only exceptions for not providing a detailed description would be if your | ||
1496 | change is a simple, self-explanatory change that needs no further description | ||
1497 | beyond the summary. | ||
1498 | Here are the guidelines for composing a commit message: | ||
1499 | <itemizedlist> | ||
1500 | <listitem><para>Provide a single-line, short summary of the change. | ||
1501 | This summary is typically viewable in the "shortlist" of changes. | ||
1502 | Thus, providing something short and descriptive that gives the reader | ||
1503 | a summary of the change is useful when viewing a list of many commits. | ||
1504 | This short description should be prefixed by the recipe name (if changing a recipe), or | ||
1505 | else the short form path to the file being changed. | ||
1506 | </para></listitem> | ||
1507 | <listitem><para>For the body of the commit message, provide detailed information | ||
1508 | that describes what you changed, why you made the change, and the approach | ||
1509 | you used. It may also be helpful if you mention how you tested the change. | ||
1510 | Provide as much detail as you can in the body of the commit message. | ||
1511 | </para></listitem> | ||
1512 | <listitem><para> | ||
1513 | If the change addresses a specific bug or issue that is | ||
1514 | associated with a bug-tracking ID, include a reference to that | ||
1515 | ID in your detailed description. | ||
1516 | For example, the Yocto Project uses a specific convention for | ||
1517 | bug references - any commit that addresses a specific bug should | ||
1518 | use the following form for the detailed description: | ||
1519 | <literallayout class='monospaced'> | ||
1520 | Fixes [YOCTO #<bug-id>] | ||
1521 | |||
1522 | <detailed description of change> | ||
1523 | </literallayout></para></listitem> | ||
1524 | Where <bug-id> is replaced with the specific bug ID from | ||
1525 | the Yocto Project Bugzilla instance. | ||
1526 | </itemizedlist> | ||
1527 | </para> | ||
1528 | |||
1529 | <para> | ||
1530 | You can find more guidance on creating well-formed commit messages at this OpenEmbedded | ||
1531 | wiki page: | ||
1532 | <ulink url='&OE_HOME_URL;/wiki/Commit_Patch_Message_Guidelines'></ulink>. | ||
1533 | </para> | ||
1534 | |||
1535 | <para> | ||
1536 | The next two sections describe general instructions for both pushing | ||
1537 | changes upstream and for submitting changes as patches. | ||
1538 | </para> | ||
1539 | |||
1540 | <section id='pushing-a-change-upstream'> | ||
1541 | <title>Using Scripts to Push a Change Upstream and Request a Pull</title> | ||
1542 | |||
1543 | <para> | ||
1544 | The basic flow for pushing a change to an upstream "contrib" Git repository is as follows: | ||
1545 | <itemizedlist> | ||
1546 | <listitem><para>Make your changes in your local Git repository.</para></listitem> | ||
1547 | <listitem><para>Stage your changes by using the <filename>git add</filename> | ||
1548 | command on each file you changed.</para></listitem> | ||
1549 | <listitem><para> | ||
1550 | Commit the change by using the | ||
1551 | <filename>git commit</filename> command. | ||
1552 | Be sure to provide a commit message that follows the | ||
1553 | project’s commit message standards as described earlier. | ||
1554 | </para></listitem> | ||
1555 | <listitem><para> | ||
1556 | Push the change to the upstream "contrib" repository by | ||
1557 | using the <filename>git push</filename> command. | ||
1558 | </para></listitem> | ||
1559 | <listitem><para>Notify the maintainer that you have pushed a change by making a pull | ||
1560 | request. | ||
1561 | The Yocto Project provides two scripts that conveniently let you generate and send | ||
1562 | pull requests to the Yocto Project. | ||
1563 | These scripts are <filename>create-pull-request</filename> and | ||
1564 | <filename>send-pull-request</filename>. | ||
1565 | You can find these scripts in the <filename>scripts</filename> directory | ||
1566 | within the <link linkend='source-directory'>Source Directory</link>.</para> | ||
1567 | <para>Using these scripts correctly formats the requests without introducing any | ||
1568 | whitespace or HTML formatting. | ||
1569 | The maintainer that receives your patches needs to be able to save and apply them | ||
1570 | directly from your emails. | ||
1571 | Using these scripts is the preferred method for sending patches.</para> | ||
1572 | <para>For help on using these scripts, simply provide the | ||
1573 | <filename>-h</filename> argument as follows: | ||
1574 | <literallayout class='monospaced'> | ||
1575 | $ poky/scripts/create-pull-request -h | ||
1576 | $ poky/scripts/send-pull-request -h | ||
1577 | </literallayout></para></listitem> | ||
1578 | </itemizedlist> | ||
1579 | </para> | ||
1580 | |||
1581 | <para> | ||
1582 | You can find general Git information on how to push a change upstream in the | ||
1583 | <ulink url='http://book.git-scm.com/3_distributed_workflows.html'>Git Community Book</ulink>. | ||
1584 | </para> | ||
1585 | </section> | ||
1586 | |||
1587 | <section id='submitting-a-patch'> | ||
1588 | <title>Using Email to Submit a Patch</title> | ||
1589 | |||
1590 | <para> | ||
1591 | You can submit patches without using the <filename>create-pull-request</filename> and | ||
1592 | <filename>send-pull-request</filename> scripts described in the previous section. | ||
1593 | However, keep in mind, the preferred method is to use the scripts. | ||
1594 | </para> | ||
1595 | |||
1596 | <para> | ||
1597 | Depending on the components changed, you need to submit the email to a specific | ||
1598 | mailing list. | ||
1599 | For some guidance on which mailing list to use, see the list in the | ||
1600 | "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>" | ||
1601 | section. | ||
1602 | For a description of the available mailing lists, see the | ||
1603 | "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing Lists</ulink>" | ||
1604 | section in the Yocto Project Reference Manual. | ||
1605 | </para> | ||
1606 | |||
1607 | <para> | ||
1608 | Here is the general procedure on how to submit a patch through email without using the | ||
1609 | scripts: | ||
1610 | <itemizedlist> | ||
1611 | <listitem><para>Make your changes in your local Git repository.</para></listitem> | ||
1612 | <listitem><para>Stage your changes by using the <filename>git add</filename> | ||
1613 | command on each file you changed.</para></listitem> | ||
1614 | <listitem><para>Commit the change by using the | ||
1615 | <filename>git commit --signoff</filename> command. | ||
1616 | Using the <filename>--signoff</filename> option identifies you as the person | ||
1617 | making the change and also satisfies the Developer's Certificate of | ||
1618 | Origin (DCO) shown earlier.</para> | ||
1619 | <para>When you form a commit, you must follow certain standards established by the | ||
1620 | Yocto Project development team. | ||
1621 | See the earlier section | ||
1622 | "<link linkend='how-to-submit-a-change'>How to Submit a Change</link>" | ||
1623 | for Yocto Project commit message standards.</para></listitem> | ||
1624 | <listitem><para>Format the commit into an email message. | ||
1625 | To format commits, use the <filename>git format-patch</filename> command. | ||
1626 | When you provide the command, you must include a revision list or a number of patches | ||
1627 | as part of the command. | ||
1628 | For example, either of these two commands takes your most | ||
1629 | recent single commit and formats it as an email message in | ||
1630 | the current directory: | ||
1631 | <literallayout class='monospaced'> | ||
1632 | $ git format-patch -1 | ||
1633 | </literallayout> | ||
1634 | or | ||
1635 | <literallayout class='monospaced'> | ||
1636 | $ git format-patch HEAD~ | ||
1637 | </literallayout></para> | ||
1638 | <para>After the command is run, the current directory contains a | ||
1639 | numbered <filename>.patch</filename> file for the commit.</para> | ||
1640 | <para>If you provide several commits as part of the command, | ||
1641 | the <filename>git format-patch</filename> command produces a | ||
1642 | series of numbered files in the current directory – one for each commit. | ||
1643 | If you have more than one patch, you should also use the | ||
1644 | <filename>--cover</filename> option with the command, which generates a | ||
1645 | cover letter as the first "patch" in the series. | ||
1646 | You can then edit the cover letter to provide a description for | ||
1647 | the series of patches. | ||
1648 | For information on the <filename>git format-patch</filename> command, | ||
1649 | see <filename>GIT_FORMAT_PATCH(1)</filename> displayed using the | ||
1650 | <filename>man git-format-patch</filename> command.</para> | ||
1651 | <note>If you are or will be a frequent contributor to the Yocto Project | ||
1652 | or to OpenEmbedded, you might consider requesting a contrib area and the | ||
1653 | necessary associated rights.</note></listitem> | ||
1654 | <listitem><para>Import the files into your mail client by using the | ||
1655 | <filename>git send-email</filename> command. | ||
1656 | <note>In order to use <filename>git send-email</filename>, you must have the | ||
1657 | the proper Git packages installed. | ||
1658 | For Ubuntu, Debian, and Fedora the package is <filename>git-email</filename>.</note></para> | ||
1659 | <para>The <filename>git send-email</filename> command sends email by using a local | ||
1660 | or remote Mail Transport Agent (MTA) such as | ||
1661 | <filename>msmtp</filename>, <filename>sendmail</filename>, or through a direct | ||
1662 | <filename>smtp</filename> configuration in your Git <filename>config</filename> | ||
1663 | file. | ||
1664 | If you are submitting patches through email only, it is very important | ||
1665 | that you submit them without any whitespace or HTML formatting that | ||
1666 | either you or your mailer introduces. | ||
1667 | The maintainer that receives your patches needs to be able to save and | ||
1668 | apply them directly from your emails. | ||
1669 | A good way to verify that what you are sending will be applicable by the | ||
1670 | maintainer is to do a dry run and send them to yourself and then | ||
1671 | save and apply them as the maintainer would.</para> | ||
1672 | <para>The <filename>git send-email</filename> command is the preferred method | ||
1673 | for sending your patches since there is no risk of compromising whitespace | ||
1674 | in the body of the message, which can occur when you use your own mail client. | ||
1675 | The command also has several options that let you | ||
1676 | specify recipients and perform further editing of the email message. | ||
1677 | For information on how to use the <filename>git send-email</filename> command, | ||
1678 | see <filename>GIT-SEND-EMAIL(1)</filename> displayed using | ||
1679 | the <filename>man git-send-email</filename> command. | ||
1680 | </para></listitem> | ||
1681 | </itemizedlist> | ||
1682 | </para> | ||
1683 | </section> | ||
1684 | </section> | ||
1685 | </chapter> | ||
1686 | <!-- | ||
1687 | vim: expandtab tw=80 ts=4 | ||
1688 | --> | ||
diff --git a/documentation/dev-manual/dev-manual-start.xml b/documentation/dev-manual/dev-manual-start.xml new file mode 100644 index 0000000..6ab93f7 --- /dev/null +++ b/documentation/dev-manual/dev-manual-start.xml | |||
@@ -0,0 +1,415 @@ | |||
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 | |||
5 | <chapter id='dev-manual-start'> | ||
6 | |||
7 | <title>Getting Started with the Yocto Project</title> | ||
8 | |||
9 | <para> | ||
10 | This chapter introduces the Yocto Project and gives you an idea of what you need to get started. | ||
11 | You can find enough information to set up your development host and build or use images for | ||
12 | hardware supported by the Yocto Project by reading the | ||
13 | <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>. | ||
14 | </para> | ||
15 | |||
16 | <para> | ||
17 | The remainder of this chapter summarizes what is in the Yocto Project Quick Start and provides | ||
18 | some higher-level concepts you might want to consider. | ||
19 | </para> | ||
20 | |||
21 | <section id='introducing-the-yocto-project'> | ||
22 | <title>Introducing the Yocto Project</title> | ||
23 | |||
24 | <para> | ||
25 | The Yocto Project is an open-source collaboration project focused on embedded Linux development. | ||
26 | The project currently provides a build system that is | ||
27 | referred to as the | ||
28 | <link linkend='build-system-term'>OpenEmbedded build system</link> | ||
29 | in the Yocto Project documentation. | ||
30 | The Yocto Project provides various ancillary tools for the embedded developer | ||
31 | and also features the Sato reference User Interface, which is optimized for | ||
32 | stylus driven, low-resolution screens. | ||
33 | </para> | ||
34 | |||
35 | <para> | ||
36 | You can use the OpenEmbedded build system, which uses | ||
37 | <link linkend='bitbake-term'>BitBake</link>, to develop complete Linux | ||
38 | images and associated user-space applications for architectures based | ||
39 | on ARM, MIPS, PowerPC, x86 and x86-64. | ||
40 | <note> | ||
41 | By default, using the Yocto Project creates a Poky distribution. | ||
42 | However, you can create your own distribution by providing key | ||
43 | <link linkend='metadata'>Metadata</link>. | ||
44 | See the "<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>" | ||
45 | section for more information. | ||
46 | </note> | ||
47 | While the Yocto Project does not provide a strict testing framework, | ||
48 | it does provide or generate for you artifacts that let you perform target-level and | ||
49 | emulated testing and debugging. | ||
50 | Additionally, if you are an <trademark class='trade'>Eclipse</trademark> | ||
51 | IDE user, you can install an Eclipse Yocto Plug-in to allow you to | ||
52 | develop within that familiar environment. | ||
53 | </para> | ||
54 | </section> | ||
55 | |||
56 | <section id='getting-setup'> | ||
57 | <title>Getting Set Up</title> | ||
58 | |||
59 | <para> | ||
60 | Here is what you need to use the Yocto Project: | ||
61 | <itemizedlist> | ||
62 | <listitem><para><emphasis>Host System:</emphasis> You should have a reasonably current | ||
63 | Linux-based host system. | ||
64 | You will have the best results with a recent release of Fedora, | ||
65 | openSUSE, Debian, Ubuntu, or CentOS as these releases are frequently tested against the Yocto Project | ||
66 | and officially supported. | ||
67 | For a list of the distributions under validation and their status, see the | ||
68 | "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section | ||
69 | in the Yocto Project Reference Manual and the wiki page at | ||
70 | <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>.</para> | ||
71 | <para> | ||
72 | You should also have about 50 Gbytes of free disk space for building images. | ||
73 | </para></listitem> | ||
74 | <listitem><para><emphasis>Packages:</emphasis> The OpenEmbedded build system | ||
75 | requires that certain packages exist on your development system (e.g. Python 2.6 or 2.7). | ||
76 | See "<ulink url='&YOCTO_DOCS_QS_URL;#packages'>The Packages</ulink>" | ||
77 | section in the Yocto Project Quick Start and the | ||
78 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>" | ||
79 | section in the Yocto Project Reference Manual for the exact | ||
80 | package requirements and the installation commands to install | ||
81 | them for the supported distributions. | ||
82 | </para></listitem> | ||
83 | <listitem id='local-yp-release'><para><emphasis>Yocto Project Release:</emphasis> | ||
84 | You need a release of the Yocto Project locally installed on | ||
85 | your development system. | ||
86 | The documentation refers to this set of locally installed files | ||
87 | as the <link linkend='source-directory'>Source Directory</link>. | ||
88 | You create your Source Directory by using | ||
89 | <link linkend='git'>Git</link> to clone a local copy | ||
90 | of the upstream <filename>poky</filename> repository, | ||
91 | or by downloading and unpacking a tarball of an official | ||
92 | Yocto Project release.</para> | ||
93 | <para>Working from a copy of the upstream repository allows you | ||
94 | to contribute back into the Yocto Project or simply work with | ||
95 | the latest software on a development branch. | ||
96 | Because Git maintains and creates an upstream repository with | ||
97 | a complete history of changes and you are working with a local | ||
98 | clone of that repository, you have access to all the Yocto | ||
99 | Project development branches and tag names used in the upstream | ||
100 | repository.</para> | ||
101 | <note>You can view the Yocto Project Source Repositories at | ||
102 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink> | ||
103 | </note> | ||
104 | <para>The following transcript shows how to clone the | ||
105 | <filename>poky</filename> Git repository into the current | ||
106 | working directory. | ||
107 | The command creates the local repository in a directory | ||
108 | named <filename>poky</filename>. | ||
109 | For information on Git used within the Yocto Project, see | ||
110 | the "<link linkend='git'>Git</link>" section. | ||
111 | <literallayout class='monospaced'> | ||
112 | $ git clone git://git.yoctoproject.org/poky | ||
113 | Cloning into 'poky'... | ||
114 | remote: Counting objects: 226790, done. | ||
115 | remote: Compressing objects: 100% (57465/57465), done. | ||
116 | remote: Total 226790 (delta 165212), reused 225887 (delta 164327) | ||
117 | Receiving objects: 100% (226790/226790), 100.98 MiB | 263 KiB/s, done. | ||
118 | Resolving deltas: 100% (165212/165212), done. | ||
119 | </literallayout></para> | ||
120 | <para>For another example of how to set up your own local Git | ||
121 | repositories, see this | ||
122 | <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'> | ||
123 | wiki page</ulink>, which describes how to create local | ||
124 | Git repositories for both | ||
125 | <filename>poky</filename> and <filename>meta-intel</filename>. | ||
126 | </para></listitem> | ||
127 | <listitem id='local-kernel-files'><para><emphasis>Yocto Project Kernel:</emphasis> | ||
128 | If you are going to be making modifications to a supported Yocto Project kernel, you | ||
129 | need to establish local copies of the source. | ||
130 | You can find Git repositories of supported Yocto Project kernels organized under | ||
131 | "Yocto Linux Kernel" in the Yocto Project Source Repositories at | ||
132 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>.</para> | ||
133 | <para>This setup can involve creating a bare clone of the Yocto Project kernel and then | ||
134 | copying that cloned repository. | ||
135 | You can create the bare clone and the copy of the bare clone anywhere you like. | ||
136 | For simplicity, it is recommended that you create these structures outside of the | ||
137 | Source Directory, which is usually named <filename>poky</filename>.</para> | ||
138 | <para>As an example, the following transcript shows how to create the bare clone | ||
139 | of the <filename>linux-yocto-3.10</filename> kernel and then create a copy of | ||
140 | that clone. | ||
141 | <note>When you have a local Yocto Project kernel Git repository, you can | ||
142 | reference that repository rather than the upstream Git repository as | ||
143 | part of the <filename>clone</filename> command. | ||
144 | Doing so can speed up the process.</note></para> | ||
145 | <para>In the following example, the bare clone is named | ||
146 | <filename>linux-yocto-3.10.git</filename>, while the | ||
147 | copy is named <filename>my-linux-yocto-3.10-work</filename>: | ||
148 | <literallayout class='monospaced'> | ||
149 | $ git clone --bare git://git.yoctoproject.org/linux-yocto-3.10 linux-yocto-3.10.git | ||
150 | Cloning into bare repository 'linux-yocto-3.10.git'... | ||
151 | remote: Counting objects: 3364487, done. | ||
152 | remote: Compressing objects: 100% (507178/507178), done. | ||
153 | remote: Total 3364487 (delta 2827715), reused 3364481 (delta 2827709) | ||
154 | Receiving objects: 100% (3364487/3364487), 722.95 MiB | 423 KiB/s, done. | ||
155 | Resolving deltas: 100% (2827715/2827715), done. | ||
156 | </literallayout></para> | ||
157 | <para>Now create a clone of the bare clone just created: | ||
158 | <literallayout class='monospaced'> | ||
159 | $ git clone linux-yocto-3.10.git my-linux-yocto-3.10-work | ||
160 | Cloning into 'my-linux-yocto-3.10-work'... | ||
161 | done. | ||
162 | </literallayout></para></listitem> | ||
163 | <listitem id='meta-yocto-kernel-extras-repo'><para><emphasis> | ||
164 | The <filename>meta-yocto-kernel-extras</filename> Git Repository</emphasis>: | ||
165 | The <filename>meta-yocto-kernel-extras</filename> Git repository contains Metadata needed | ||
166 | only if you are modifying and building the kernel image. | ||
167 | In particular, it contains the kernel BitBake append (<filename>.bbappend</filename>) | ||
168 | files that you | ||
169 | edit to point to your locally modified kernel source files and to build the kernel | ||
170 | image. | ||
171 | Pointing to these local files is much more efficient than requiring a download of the | ||
172 | kernel's source files from upstream each time you make changes to the kernel.</para> | ||
173 | <para>You can find the <filename>meta-yocto-kernel-extras</filename> Git Repository in the | ||
174 | "Yocto Metadata Layers" area of the Yocto Project Source Repositories at | ||
175 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>. | ||
176 | It is good practice to create this Git repository inside the Source Directory.</para> | ||
177 | <para>Following is an example that creates the <filename>meta-yocto-kernel-extras</filename> Git | ||
178 | repository inside the Source Directory, which is named <filename>poky</filename> | ||
179 | in this case: | ||
180 | <literallayout class='monospaced'> | ||
181 | $ cd ~/poky | ||
182 | $ git clone git://git.yoctoproject.org/meta-yocto-kernel-extras meta-yocto-kernel-extras | ||
183 | Cloning into 'meta-yocto-kernel-extras'... | ||
184 | remote: Counting objects: 727, done. | ||
185 | remote: Compressing objects: 100% (452/452), done. | ||
186 | remote: Total 727 (delta 260), reused 719 (delta 252) | ||
187 | Receiving objects: 100% (727/727), 536.36 KiB | 240 KiB/s, done. | ||
188 | Resolving deltas: 100% (260/260), done. | ||
189 | </literallayout></para></listitem> | ||
190 | <listitem><para id='supported-board-support-packages-(bsps)'><emphasis>Supported Board Support Packages (BSPs):</emphasis> | ||
191 | The Yocto Project provides a layer called | ||
192 | <filename>meta-intel</filename> and it is maintained in its own | ||
193 | separate Git repository. | ||
194 | The <filename>meta-intel</filename> layer contains many | ||
195 | supported | ||
196 | <ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>. | ||
197 | </para> | ||
198 | |||
199 | <para>The Yocto Project uses the following BSP layer naming | ||
200 | scheme: | ||
201 | <literallayout class='monospaced'> | ||
202 | meta-<BSP_name> | ||
203 | </literallayout> | ||
204 | where <filename><BSP_name></filename> is the recognized | ||
205 | BSP name. | ||
206 | Here are some examples: | ||
207 | <literallayout class='monospaced'> | ||
208 | meta-crownbay | ||
209 | meta-emenlow | ||
210 | meta-n450 | ||
211 | </literallayout> | ||
212 | See the | ||
213 | "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>" | ||
214 | section in the Yocto Project Board Support Package (BSP) | ||
215 | Developer's Guide for more information on BSP Layers. | ||
216 | </para> | ||
217 | |||
218 | <para> | ||
219 | You can locate the <filename>meta-intel</filename> Git | ||
220 | repository in the "Yocto Metadata Layers" area of the Yocto | ||
221 | Project Source Repositories at | ||
222 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>. | ||
223 | </para> | ||
224 | |||
225 | <para> | ||
226 | Using | ||
227 | <link linkend='git'>Git</link> to create a local clone of the | ||
228 | upstream repository can be helpful if you are working with | ||
229 | BSPs. | ||
230 | Typically, you set up the <filename>meta-intel</filename> | ||
231 | Git repository inside the Source Directory. | ||
232 | For example, the following transcript shows the steps to clone | ||
233 | <filename>meta-intel</filename>. | ||
234 | <note> | ||
235 | Be sure to work in the <filename>meta-intel</filename> | ||
236 | branch that matches your | ||
237 | <link linkend='source-directory'>Source Directory</link> | ||
238 | (i.e. <filename>poky</filename>) branch. | ||
239 | For example, if you have checked out the "master" branch | ||
240 | of <filename>poky</filename> and you are going to use | ||
241 | <filename>meta-intel</filename>, be sure to checkout the | ||
242 | "master" branch of <filename>meta-intel</filename>. | ||
243 | </note> | ||
244 | <literallayout class='monospaced'> | ||
245 | $ cd ~/poky | ||
246 | $ git clone git://git.yoctoproject.org/meta-intel.git | ||
247 | Cloning into 'meta-intel'... | ||
248 | remote: Counting objects: 8844, done. | ||
249 | remote: Compressing objects: 100% (2864/2864), done. | ||
250 | remote: Total 8844 (delta 4931), reused 8780 (delta 4867) | ||
251 | Receiving objects: 100% (8844/8844), 2.48 MiB | 264 KiB/s, done. | ||
252 | Resolving deltas: 100% (4931/4931), done. | ||
253 | </literallayout> | ||
254 | </para> | ||
255 | |||
256 | <para> | ||
257 | The same | ||
258 | <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_from_git_checkout_to_meta-intel_BSP'>wiki page</ulink> | ||
259 | referenced earlier covers how to set up the | ||
260 | <filename>meta-intel</filename> Git repository. | ||
261 | </para></listitem> | ||
262 | <listitem><para><emphasis>Eclipse Yocto Plug-in:</emphasis> If you are developing | ||
263 | applications using the Eclipse Integrated Development Environment (IDE), | ||
264 | you will need this plug-in. | ||
265 | See the | ||
266 | "<link linkend='setting-up-the-eclipse-ide'>Setting up the Eclipse IDE</link>" | ||
267 | section for more information.</para></listitem> | ||
268 | </itemizedlist> | ||
269 | </para> | ||
270 | </section> | ||
271 | |||
272 | <section id='building-images'> | ||
273 | <title>Building Images</title> | ||
274 | |||
275 | <para> | ||
276 | The build process creates an entire Linux distribution, including the toolchain, from source. | ||
277 | For more information on this topic, see the | ||
278 | "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" | ||
279 | section in the Yocto Project Quick Start. | ||
280 | </para> | ||
281 | |||
282 | <para> | ||
283 | The build process is as follows: | ||
284 | <orderedlist> | ||
285 | <listitem><para>Make sure you have set up the Source Directory described in the | ||
286 | previous section.</para></listitem> | ||
287 | <listitem><para>Initialize the build environment by sourcing a build | ||
288 | environment script (i.e. | ||
289 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> | ||
290 | or | ||
291 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>). | ||
292 | </para></listitem> | ||
293 | <listitem><para>Optionally ensure the <filename>conf/local.conf</filename> configuration file, | ||
294 | which is found in the | ||
295 | <link linkend='build-directory'>Build Directory</link>, | ||
296 | is set up how you want it. | ||
297 | This file defines many aspects of the build environment including | ||
298 | the target machine architecture through the | ||
299 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'>MACHINE</ulink></filename> variable, | ||
300 | the development machine's processor use through the | ||
301 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BB_NUMBER_THREADS'>BB_NUMBER_THREADS</ulink></filename> and | ||
302 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'>PARALLEL_MAKE</ulink></filename> variables, and | ||
303 | a centralized tarball download directory through the | ||
304 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'>DL_DIR</ulink></filename> variable.</para></listitem> | ||
305 | <listitem><para> | ||
306 | Build the image using the <filename>bitbake</filename> command. | ||
307 | If you want information on BitBake, see the | ||
308 | <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>. | ||
309 | </para></listitem> | ||
310 | <listitem><para>Run the image either on the actual hardware or using the QEMU | ||
311 | emulator.</para></listitem> | ||
312 | </orderedlist> | ||
313 | </para> | ||
314 | </section> | ||
315 | |||
316 | <section id='using-pre-built-binaries-and-qemu'> | ||
317 | <title>Using Pre-Built Binaries and QEMU</title> | ||
318 | |||
319 | <para> | ||
320 | Another option you have to get started is to use pre-built binaries. | ||
321 | The Yocto Project provides many types of binaries with each release. | ||
322 | See the "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" | ||
323 | chapter in the Yocto Project Reference Manual | ||
324 | for descriptions of the types of binaries that ship with a Yocto Project | ||
325 | release. | ||
326 | </para> | ||
327 | |||
328 | <para> | ||
329 | Using a pre-built binary is ideal for developing software applications to run on your | ||
330 | target hardware. | ||
331 | To do this, you need to be able to access the appropriate cross-toolchain tarball for | ||
332 | the architecture on which you are developing. | ||
333 | If you are using an SDK type image, the image ships with the complete toolchain native to | ||
334 | the architecture. | ||
335 | If you are not using an SDK type image, you need to separately download and | ||
336 | install the stand-alone Yocto Project cross-toolchain tarball. | ||
337 | </para> | ||
338 | |||
339 | <para> | ||
340 | Regardless of the type of image you are using, you need to download the pre-built kernel | ||
341 | that you will boot in the QEMU emulator and then download and extract the target root | ||
342 | filesystem for your target machine’s architecture. | ||
343 | You can get architecture-specific binaries and file systems from | ||
344 | <ulink url='&YOCTO_MACHINES_DL_URL;'>machines</ulink>. | ||
345 | You can get installation scripts for stand-alone toolchains from | ||
346 | <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'>toolchains</ulink>. | ||
347 | Once you have all your files, you set up the environment to emulate the hardware | ||
348 | by sourcing an environment setup script. | ||
349 | Finally, you start the QEMU emulator. | ||
350 | You can find details on all these steps in the | ||
351 | "<ulink url='&YOCTO_DOCS_QS_URL;#using-pre-built'>Using Pre-Built Binaries and QEMU</ulink>" | ||
352 | section of the Yocto Project Quick Start. | ||
353 | </para> | ||
354 | |||
355 | <para> | ||
356 | Using QEMU to emulate your hardware can result in speed issues | ||
357 | depending on the target and host architecture mix. | ||
358 | For example, using the <filename>qemux86</filename> image in the emulator | ||
359 | on an Intel-based 32-bit (x86) host machine is fast because the target and | ||
360 | host architectures match. | ||
361 | On the other hand, using the <filename>qemuarm</filename> image on the same Intel-based | ||
362 | host can be slower. | ||
363 | But, you still achieve faithful emulation of ARM-specific issues. | ||
364 | </para> | ||
365 | |||
366 | <para> | ||
367 | To speed things up, the QEMU images support using <filename>distcc</filename> | ||
368 | to call a cross-compiler outside the emulated system. | ||
369 | If you used <filename>runqemu</filename> to start QEMU, and the | ||
370 | <filename>distccd</filename> application is present on the host system, any | ||
371 | BitBake cross-compiling toolchain available from the build system is automatically | ||
372 | used from within QEMU simply by calling <filename>distcc</filename>. | ||
373 | You can accomplish this by defining the cross-compiler variable | ||
374 | (e.g. <filename>export CC="distcc"</filename>). | ||
375 | Alternatively, if you are using a suitable SDK image or the appropriate | ||
376 | stand-alone toolchain is present, | ||
377 | the toolchain is also automatically used. | ||
378 | </para> | ||
379 | |||
380 | <note> | ||
381 | Several mechanisms exist that let you connect to the system running on the | ||
382 | QEMU emulator: | ||
383 | <itemizedlist> | ||
384 | <listitem><para>QEMU provides a framebuffer interface that makes standard | ||
385 | consoles available.</para></listitem> | ||
386 | <listitem><para>Generally, headless embedded devices have a serial port. | ||
387 | If so, you can configure the operating system of the running image | ||
388 | to use that port to run a console. | ||
389 | The connection uses standard IP networking.</para></listitem> | ||
390 | <listitem><para> | ||
391 | SSH servers exist in some QEMU images. | ||
392 | The <filename>core-image-sato</filename> QEMU image has a | ||
393 | Dropbear secure shell (SSH) server that runs with the root | ||
394 | password disabled. | ||
395 | The <filename>core-image-full-cmdline</filename> and | ||
396 | <filename>core-image-lsb</filename> QEMU images | ||
397 | have OpenSSH instead of Dropbear. | ||
398 | Including these SSH servers allow you to use standard | ||
399 | <filename>ssh</filename> and <filename>scp</filename> commands. | ||
400 | The <filename>core-image-minimal</filename> QEMU image, | ||
401 | however, contains no SSH server. | ||
402 | </para></listitem> | ||
403 | <listitem><para>You can use a provided, user-space NFS server to boot the QEMU session | ||
404 | using a local copy of the root filesystem on the host. | ||
405 | In order to make this connection, you must extract a root filesystem tarball by using the | ||
406 | <filename>runqemu-extract-sdk</filename> command. | ||
407 | After running the command, you must then point the <filename>runqemu</filename> | ||
408 | script to the extracted directory instead of a root filesystem image file.</para></listitem> | ||
409 | </itemizedlist> | ||
410 | </note> | ||
411 | </section> | ||
412 | </chapter> | ||
413 | <!-- | ||
414 | vim: expandtab tw=80 ts=4 | ||
415 | --> | ||
diff --git a/documentation/dev-manual/dev-manual.xml b/documentation/dev-manual/dev-manual.xml new file mode 100644 index 0000000..b89e2b3 --- /dev/null +++ b/documentation/dev-manual/dev-manual.xml | |||
@@ -0,0 +1,112 @@ | |||
1 | <!DOCTYPE book 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 | |||
5 | <book id='dev-manual' lang='en' | ||
6 | xmlns:xi="http://www.w3.org/2003/XInclude" | ||
7 | xmlns="http://docbook.org/ns/docbook" | ||
8 | > | ||
9 | <bookinfo> | ||
10 | |||
11 | <mediaobject> | ||
12 | <imageobject> | ||
13 | <imagedata fileref='figures/dev-title.png' | ||
14 | format='SVG' | ||
15 | align='left' scalefit='1' width='100%'/> | ||
16 | </imageobject> | ||
17 | </mediaobject> | ||
18 | |||
19 | <title> | ||
20 | Yocto Project Development Manual | ||
21 | </title> | ||
22 | |||
23 | <authorgroup> | ||
24 | <author> | ||
25 | <firstname>Scott</firstname> <surname>Rifenbark</surname> | ||
26 | <affiliation> | ||
27 | <orgname>Intel Corporation</orgname> | ||
28 | </affiliation> | ||
29 | <email>scott.m.rifenbark@intel.com</email> | ||
30 | </author> | ||
31 | </authorgroup> | ||
32 | |||
33 | <revhistory> | ||
34 | <revision> | ||
35 | <revnumber>1.1</revnumber> | ||
36 | <date>6 October 2011</date> | ||
37 | <revremark>The initial document released with the Yocto Project 1.1 Release.</revremark> | ||
38 | </revision> | ||
39 | <revision> | ||
40 | <revnumber>1.2</revnumber> | ||
41 | <date>April 2012</date> | ||
42 | <revremark>Released with the Yocto Project 1.2 Release.</revremark> | ||
43 | </revision> | ||
44 | <revision> | ||
45 | <revnumber>1.3</revnumber> | ||
46 | <date>October 2012</date> | ||
47 | <revremark>Released with the Yocto Project 1.3 Release.</revremark> | ||
48 | </revision> | ||
49 | <revision> | ||
50 | <revnumber>1.4</revnumber> | ||
51 | <date>April 2013</date> | ||
52 | <revremark>Released with the Yocto Project 1.4 Release.</revremark> | ||
53 | </revision> | ||
54 | <revision> | ||
55 | <revnumber>1.5</revnumber> | ||
56 | <date>October 2013</date> | ||
57 | <revremark>Released with the Yocto Project 1.5 Release.</revremark> | ||
58 | </revision> | ||
59 | <revision> | ||
60 | <revnumber>1.5.1</revnumber> | ||
61 | <date>January 2014</date> | ||
62 | <revremark>Released with the Yocto Project 1.5.1 Release.</revremark> | ||
63 | </revision> | ||
64 | <revision> | ||
65 | <revnumber>1.6</revnumber> | ||
66 | <date>April 2014</date> | ||
67 | <revremark>Released with the Yocto Project 1.6 Release.</revremark> | ||
68 | </revision> | ||
69 | <revision> | ||
70 | <revnumber>1.7</revnumber> | ||
71 | <date>Fall of 2014</date> | ||
72 | <revremark>Released with the Yocto Project 1.7 Release.</revremark> | ||
73 | </revision> | ||
74 | </revhistory> | ||
75 | |||
76 | <copyright> | ||
77 | <year>©RIGHT_YEAR;</year> | ||
78 | <holder>Linux Foundation</holder> | ||
79 | </copyright> | ||
80 | |||
81 | <legalnotice> | ||
82 | <para> | ||
83 | Permission is granted to copy, distribute and/or modify this document under | ||
84 | the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/"> | ||
85 | Creative Commons Attribution-Share Alike 2.0 UK: England & Wales</ulink> as published by | ||
86 | Creative Commons. | ||
87 | </para> | ||
88 | |||
89 | <note> | ||
90 | For the latest version of this manual associated with this | ||
91 | Yocto Project release, see the | ||
92 | <ulink url='&YOCTO_DOCS_DEV_URL;'>Yocto Project Development Manual</ulink> | ||
93 | from the Yocto Project website. | ||
94 | </note> | ||
95 | </legalnotice> | ||
96 | |||
97 | </bookinfo> | ||
98 | |||
99 | <xi:include href="dev-manual-intro.xml"/> | ||
100 | |||
101 | <xi:include href="dev-manual-start.xml"/> | ||
102 | |||
103 | <xi:include href="dev-manual-newbie.xml"/> | ||
104 | |||
105 | <xi:include href="dev-manual-model.xml"/> | ||
106 | |||
107 | <xi:include href="dev-manual-common-tasks.xml"/> | ||
108 | |||
109 | </book> | ||
110 | <!-- | ||
111 | vim: expandtab tw=80 ts=4 | ||
112 | --> | ||
diff --git a/documentation/dev-manual/dev-style.css b/documentation/dev-manual/dev-style.css new file mode 100644 index 0000000..b900ffc --- /dev/null +++ b/documentation/dev-manual/dev-style.css | |||
@@ -0,0 +1,984 @@ | |||
1 | /* | ||
2 | Generic XHTML / DocBook XHTML CSS Stylesheet. | ||
3 | |||
4 | Browser wrangling and typographic design by | ||
5 | Oyvind Kolas / pippin@gimp.org | ||
6 | |||
7 | Customised for Poky by | ||
8 | Matthew Allum / mallum@o-hand.com | ||
9 | |||
10 | Thanks to: | ||
11 | Liam R. E. Quin | ||
12 | William Skaggs | ||
13 | Jakub Steiner | ||
14 | |||
15 | Structure | ||
16 | --------- | ||
17 | |||
18 | The stylesheet is divided into the following sections: | ||
19 | |||
20 | Positioning | ||
21 | Margins, paddings, width, font-size, clearing. | ||
22 | Decorations | ||
23 | Borders, style | ||
24 | Colors | ||
25 | Colors | ||
26 | Graphics | ||
27 | Graphical backgrounds | ||
28 | Nasty IE tweaks | ||
29 | Workarounds needed to make it work in internet explorer, | ||
30 | currently makes the stylesheet non validating, but up until | ||
31 | this point it is validating. | ||
32 | Mozilla extensions | ||
33 | Transparency for footer | ||
34 | Rounded corners on boxes | ||
35 | |||
36 | */ | ||
37 | |||
38 | |||
39 | /*************** / | ||
40 | / Positioning / | ||
41 | / ***************/ | ||
42 | |||
43 | body { | ||
44 | font-family: Verdana, Sans, sans-serif; | ||
45 | |||
46 | min-width: 640px; | ||
47 | width: 80%; | ||
48 | margin: 0em auto; | ||
49 | padding: 2em 5em 5em 5em; | ||
50 | color: #333; | ||
51 | } | ||
52 | |||
53 | h1,h2,h3,h4,h5,h6,h7 { | ||
54 | font-family: Arial, Sans; | ||
55 | color: #00557D; | ||
56 | clear: both; | ||
57 | } | ||
58 | |||
59 | h1 { | ||
60 | font-size: 2em; | ||
61 | text-align: left; | ||
62 | padding: 0em 0em 0em 0em; | ||
63 | margin: 2em 0em 0em 0em; | ||
64 | } | ||
65 | |||
66 | h2.subtitle { | ||
67 | margin: 0.10em 0em 3.0em 0em; | ||
68 | padding: 0em 0em 0em 0em; | ||
69 | font-size: 1.8em; | ||
70 | padding-left: 20%; | ||
71 | font-weight: normal; | ||
72 | font-style: italic; | ||
73 | } | ||
74 | |||
75 | h2 { | ||
76 | margin: 2em 0em 0.66em 0em; | ||
77 | padding: 0.5em 0em 0em 0em; | ||
78 | font-size: 1.5em; | ||
79 | font-weight: bold; | ||
80 | } | ||
81 | |||
82 | h3.subtitle { | ||
83 | margin: 0em 0em 1em 0em; | ||
84 | padding: 0em 0em 0em 0em; | ||
85 | font-size: 142.14%; | ||
86 | text-align: right; | ||
87 | } | ||
88 | |||
89 | h3 { | ||
90 | margin: 1em 0em 0.5em 0em; | ||
91 | padding: 1em 0em 0em 0em; | ||
92 | font-size: 140%; | ||
93 | font-weight: bold; | ||
94 | } | ||
95 | |||
96 | h4 { | ||
97 | margin: 1em 0em 0.5em 0em; | ||
98 | padding: 1em 0em 0em 0em; | ||
99 | font-size: 120%; | ||
100 | font-weight: bold; | ||
101 | } | ||
102 | |||
103 | h5 { | ||
104 | margin: 1em 0em 0.5em 0em; | ||
105 | padding: 1em 0em 0em 0em; | ||
106 | font-size: 110%; | ||
107 | font-weight: bold; | ||
108 | } | ||
109 | |||
110 | h6 { | ||
111 | margin: 1em 0em 0em 0em; | ||
112 | padding: 1em 0em 0em 0em; | ||
113 | font-size: 110%; | ||
114 | font-weight: bold; | ||
115 | } | ||
116 | |||
117 | .authorgroup { | ||
118 | background-color: transparent; | ||
119 | background-repeat: no-repeat; | ||
120 | padding-top: 256px; | ||
121 | background-image: url("figures/dev-title.png"); | ||
122 | background-position: left top; | ||
123 | margin-top: -256px; | ||
124 | padding-right: 50px; | ||
125 | margin-left: 0px; | ||
126 | text-align: right; | ||
127 | width: 740px; | ||
128 | } | ||
129 | |||
130 | h3.author { | ||
131 | margin: 0em 0me 0em 0em; | ||
132 | padding: 0em 0em 0em 0em; | ||
133 | font-weight: normal; | ||
134 | font-size: 100%; | ||
135 | color: #333; | ||
136 | clear: both; | ||
137 | } | ||
138 | |||
139 | .author tt.email { | ||
140 | font-size: 66%; | ||
141 | } | ||
142 | |||
143 | .titlepage hr { | ||
144 | width: 0em; | ||
145 | clear: both; | ||
146 | } | ||
147 | |||
148 | .revhistory { | ||
149 | padding-top: 2em; | ||
150 | clear: both; | ||
151 | } | ||
152 | |||
153 | .toc, | ||
154 | .list-of-tables, | ||
155 | .list-of-examples, | ||
156 | .list-of-figures { | ||
157 | padding: 1.33em 0em 2.5em 0em; | ||
158 | color: #00557D; | ||
159 | } | ||
160 | |||
161 | .toc p, | ||
162 | .list-of-tables p, | ||
163 | .list-of-figures p, | ||
164 | .list-of-examples p { | ||
165 | padding: 0em 0em 0em 0em; | ||
166 | padding: 0em 0em 0.3em; | ||
167 | margin: 1.5em 0em 0em 0em; | ||
168 | } | ||
169 | |||
170 | .toc p b, | ||
171 | .list-of-tables p b, | ||
172 | .list-of-figures p b, | ||
173 | .list-of-examples p b{ | ||
174 | font-size: 100.0%; | ||
175 | font-weight: bold; | ||
176 | } | ||
177 | |||
178 | .toc dl, | ||
179 | .list-of-tables dl, | ||
180 | .list-of-figures dl, | ||
181 | .list-of-examples dl { | ||
182 | margin: 0em 0em 0.5em 0em; | ||
183 | padding: 0em 0em 0em 0em; | ||
184 | } | ||
185 | |||
186 | .toc dt { | ||
187 | margin: 0em 0em 0em 0em; | ||
188 | padding: 0em 0em 0em 0em; | ||
189 | } | ||
190 | |||
191 | .toc dd { | ||
192 | margin: 0em 0em 0em 2.6em; | ||
193 | padding: 0em 0em 0em 0em; | ||
194 | } | ||
195 | |||
196 | div.glossary dl, | ||
197 | div.variablelist dl { | ||
198 | } | ||
199 | |||
200 | .glossary dl dt, | ||
201 | .variablelist dl dt, | ||
202 | .variablelist dl dt span.term { | ||
203 | font-weight: normal; | ||
204 | width: 20em; | ||
205 | text-align: right; | ||
206 | } | ||
207 | |||
208 | .variablelist dl dt { | ||
209 | margin-top: 0.5em; | ||
210 | } | ||
211 | |||
212 | .glossary dl dd, | ||
213 | .variablelist dl dd { | ||
214 | margin-top: -1em; | ||
215 | margin-left: 25.5em; | ||
216 | } | ||
217 | |||
218 | .glossary dd p, | ||
219 | .variablelist dd p { | ||
220 | margin-top: 0em; | ||
221 | margin-bottom: 1em; | ||
222 | } | ||
223 | |||
224 | |||
225 | div.calloutlist table td { | ||
226 | padding: 0em 0em 0em 0em; | ||
227 | margin: 0em 0em 0em 0em; | ||
228 | } | ||
229 | |||
230 | div.calloutlist table td p { | ||
231 | margin-top: 0em; | ||
232 | margin-bottom: 1em; | ||
233 | } | ||
234 | |||
235 | div p.copyright { | ||
236 | text-align: left; | ||
237 | } | ||
238 | |||
239 | div.legalnotice p.legalnotice-title { | ||
240 | margin-bottom: 0em; | ||
241 | } | ||
242 | |||
243 | p { | ||
244 | line-height: 1.5em; | ||
245 | margin-top: 0em; | ||
246 | |||
247 | } | ||
248 | |||
249 | dl { | ||
250 | padding-top: 0em; | ||
251 | } | ||
252 | |||
253 | hr { | ||
254 | border: solid 1px; | ||
255 | } | ||
256 | |||
257 | |||
258 | .mediaobject, | ||
259 | .mediaobjectco { | ||
260 | text-align: center; | ||
261 | } | ||
262 | |||
263 | img { | ||
264 | border: none; | ||
265 | } | ||
266 | |||
267 | ul { | ||
268 | padding: 0em 0em 0em 1.5em; | ||
269 | } | ||
270 | |||
271 | ul li { | ||
272 | padding: 0em 0em 0em 0em; | ||
273 | } | ||
274 | |||
275 | ul li p { | ||
276 | text-align: left; | ||
277 | } | ||
278 | |||
279 | table { | ||
280 | width :100%; | ||
281 | } | ||
282 | |||
283 | th { | ||
284 | padding: 0.25em; | ||
285 | text-align: left; | ||
286 | font-weight: normal; | ||
287 | vertical-align: top; | ||
288 | } | ||
289 | |||
290 | td { | ||
291 | padding: 0.25em; | ||
292 | vertical-align: top; | ||
293 | } | ||
294 | |||
295 | p a[id] { | ||
296 | margin: 0px; | ||
297 | padding: 0px; | ||
298 | display: inline; | ||
299 | background-image: none; | ||
300 | } | ||
301 | |||
302 | a { | ||
303 | text-decoration: underline; | ||
304 | color: #444; | ||
305 | } | ||
306 | |||
307 | pre { | ||
308 | overflow: auto; | ||
309 | } | ||
310 | |||
311 | a:hover { | ||
312 | text-decoration: underline; | ||
313 | /*font-weight: bold;*/ | ||
314 | } | ||
315 | |||
316 | /* This style defines how the permalink character | ||
317 | appears by itself and when hovered over with | ||
318 | the mouse. */ | ||
319 | |||
320 | [alt='Permalink'] { color: #eee; } | ||
321 | [alt='Permalink']:hover { color: black; } | ||
322 | |||
323 | |||
324 | div.informalfigure, | ||
325 | div.informalexample, | ||
326 | div.informaltable, | ||
327 | div.figure, | ||
328 | div.table, | ||
329 | div.example { | ||
330 | margin: 1em 0em; | ||
331 | padding: 1em; | ||
332 | page-break-inside: avoid; | ||
333 | } | ||
334 | |||
335 | |||
336 | div.informalfigure p.title b, | ||
337 | div.informalexample p.title b, | ||
338 | div.informaltable p.title b, | ||
339 | div.figure p.title b, | ||
340 | div.example p.title b, | ||
341 | div.table p.title b{ | ||
342 | padding-top: 0em; | ||
343 | margin-top: 0em; | ||
344 | font-size: 100%; | ||
345 | font-weight: normal; | ||
346 | } | ||
347 | |||
348 | .mediaobject .caption, | ||
349 | .mediaobject .caption p { | ||
350 | text-align: center; | ||
351 | font-size: 80%; | ||
352 | padding-top: 0.5em; | ||
353 | padding-bottom: 0.5em; | ||
354 | } | ||
355 | |||
356 | .epigraph { | ||
357 | padding-left: 55%; | ||
358 | margin-bottom: 1em; | ||
359 | } | ||
360 | |||
361 | .epigraph p { | ||
362 | text-align: left; | ||
363 | } | ||
364 | |||
365 | .epigraph .quote { | ||
366 | font-style: italic; | ||
367 | } | ||
368 | .epigraph .attribution { | ||
369 | font-style: normal; | ||
370 | text-align: right; | ||
371 | } | ||
372 | |||
373 | span.application { | ||
374 | font-style: italic; | ||
375 | } | ||
376 | |||
377 | .programlisting { | ||
378 | font-family: monospace; | ||
379 | font-size: 80%; | ||
380 | white-space: pre; | ||
381 | margin: 1.33em 0em; | ||
382 | padding: 1.33em; | ||
383 | } | ||
384 | |||
385 | .tip, | ||
386 | .warning, | ||
387 | .caution, | ||
388 | .note { | ||
389 | margin-top: 1em; | ||
390 | margin-bottom: 1em; | ||
391 | |||
392 | } | ||
393 | |||
394 | /* force full width of table within div */ | ||
395 | .tip table, | ||
396 | .warning table, | ||
397 | .caution table, | ||
398 | .note table { | ||
399 | border: none; | ||
400 | width: 100%; | ||
401 | } | ||
402 | |||
403 | |||
404 | .tip table th, | ||
405 | .warning table th, | ||
406 | .caution table th, | ||
407 | .note table th { | ||
408 | padding: 0.8em 0.0em 0.0em 0.0em; | ||
409 | margin : 0em 0em 0em 0em; | ||
410 | } | ||
411 | |||
412 | .tip p, | ||
413 | .warning p, | ||
414 | .caution p, | ||
415 | .note p { | ||
416 | margin-top: 0.5em; | ||
417 | margin-bottom: 0.5em; | ||
418 | padding-right: 1em; | ||
419 | text-align: left; | ||
420 | } | ||
421 | |||
422 | .acronym { | ||
423 | text-transform: uppercase; | ||
424 | } | ||
425 | |||
426 | b.keycap, | ||
427 | .keycap { | ||
428 | padding: 0.09em 0.3em; | ||
429 | margin: 0em; | ||
430 | } | ||
431 | |||
432 | .itemizedlist li { | ||
433 | clear: none; | ||
434 | } | ||
435 | |||
436 | .filename { | ||
437 | font-size: medium; | ||
438 | font-family: Courier, monospace; | ||
439 | } | ||
440 | |||
441 | |||
442 | div.navheader, div.heading{ | ||
443 | position: absolute; | ||
444 | left: 0em; | ||
445 | top: 0em; | ||
446 | width: 100%; | ||
447 | background-color: #cdf; | ||
448 | width: 100%; | ||
449 | } | ||
450 | |||
451 | div.navfooter, div.footing{ | ||
452 | position: fixed; | ||
453 | left: 0em; | ||
454 | bottom: 0em; | ||
455 | background-color: #eee; | ||
456 | width: 100%; | ||
457 | } | ||
458 | |||
459 | |||
460 | div.navheader td, | ||
461 | div.navfooter td { | ||
462 | font-size: 66%; | ||
463 | } | ||
464 | |||
465 | div.navheader table th { | ||
466 | /*font-family: Georgia, Times, serif;*/ | ||
467 | /*font-size: x-large;*/ | ||
468 | font-size: 80%; | ||
469 | } | ||
470 | |||
471 | div.navheader table { | ||
472 | border-left: 0em; | ||
473 | border-right: 0em; | ||
474 | border-top: 0em; | ||
475 | width: 100%; | ||
476 | } | ||
477 | |||
478 | div.navfooter table { | ||
479 | border-left: 0em; | ||
480 | border-right: 0em; | ||
481 | border-bottom: 0em; | ||
482 | width: 100%; | ||
483 | } | ||
484 | |||
485 | div.navheader table td a, | ||
486 | div.navfooter table td a { | ||
487 | color: #777; | ||
488 | text-decoration: none; | ||
489 | } | ||
490 | |||
491 | /* normal text in the footer */ | ||
492 | div.navfooter table td { | ||
493 | color: black; | ||
494 | } | ||
495 | |||
496 | div.navheader table td a:visited, | ||
497 | div.navfooter table td a:visited { | ||
498 | color: #444; | ||
499 | } | ||
500 | |||
501 | |||
502 | /* links in header and footer */ | ||
503 | div.navheader table td a:hover, | ||
504 | div.navfooter table td a:hover { | ||
505 | text-decoration: underline; | ||
506 | background-color: transparent; | ||
507 | color: #33a; | ||
508 | } | ||
509 | |||
510 | div.navheader hr, | ||
511 | div.navfooter hr { | ||
512 | display: none; | ||
513 | } | ||
514 | |||
515 | |||
516 | .qandaset tr.question td p { | ||
517 | margin: 0em 0em 1em 0em; | ||
518 | padding: 0em 0em 0em 0em; | ||
519 | } | ||
520 | |||
521 | .qandaset tr.answer td p { | ||
522 | margin: 0em 0em 1em 0em; | ||
523 | padding: 0em 0em 0em 0em; | ||
524 | } | ||
525 | .answer td { | ||
526 | padding-bottom: 1.5em; | ||
527 | } | ||
528 | |||
529 | .emphasis { | ||
530 | font-weight: bold; | ||
531 | } | ||
532 | |||
533 | |||
534 | /************* / | ||
535 | / decorations / | ||
536 | / *************/ | ||
537 | |||
538 | .titlepage { | ||
539 | } | ||
540 | |||
541 | .part .title { | ||
542 | } | ||
543 | |||
544 | .subtitle { | ||
545 | border: none; | ||
546 | } | ||
547 | |||
548 | /* | ||
549 | h1 { | ||
550 | border: none; | ||
551 | } | ||
552 | |||
553 | h2 { | ||
554 | border-top: solid 0.2em; | ||
555 | border-bottom: solid 0.06em; | ||
556 | } | ||
557 | |||
558 | h3 { | ||
559 | border-top: 0em; | ||
560 | border-bottom: solid 0.06em; | ||
561 | } | ||
562 | |||
563 | h4 { | ||
564 | border: 0em; | ||
565 | border-bottom: solid 0.06em; | ||
566 | } | ||
567 | |||
568 | h5 { | ||
569 | border: 0em; | ||
570 | } | ||
571 | */ | ||
572 | |||
573 | .programlisting { | ||
574 | border: solid 1px; | ||
575 | } | ||
576 | |||
577 | div.figure, | ||
578 | div.table, | ||
579 | div.informalfigure, | ||
580 | div.informaltable, | ||
581 | div.informalexample, | ||
582 | div.example { | ||
583 | border: 1px solid; | ||
584 | } | ||
585 | |||
586 | |||
587 | |||
588 | .tip, | ||
589 | .warning, | ||
590 | .caution, | ||
591 | .note { | ||
592 | border: 1px solid; | ||
593 | } | ||
594 | |||
595 | .tip table th, | ||
596 | .warning table th, | ||
597 | .caution table th, | ||
598 | .note table th { | ||
599 | border-bottom: 1px solid; | ||
600 | } | ||
601 | |||
602 | .question td { | ||
603 | border-top: 1px solid black; | ||
604 | } | ||
605 | |||
606 | .answer { | ||
607 | } | ||
608 | |||
609 | |||
610 | b.keycap, | ||
611 | .keycap { | ||
612 | border: 1px solid; | ||
613 | } | ||
614 | |||
615 | |||
616 | div.navheader, div.heading{ | ||
617 | border-bottom: 1px solid; | ||
618 | } | ||
619 | |||
620 | |||
621 | div.navfooter, div.footing{ | ||
622 | border-top: 1px solid; | ||
623 | } | ||
624 | |||
625 | /********* / | ||
626 | / colors / | ||
627 | / *********/ | ||
628 | |||
629 | body { | ||
630 | color: #333; | ||
631 | background: white; | ||
632 | } | ||
633 | |||
634 | a { | ||
635 | background: transparent; | ||
636 | } | ||
637 | |||
638 | a:hover { | ||
639 | background-color: #dedede; | ||
640 | } | ||
641 | |||
642 | |||
643 | h1, | ||
644 | h2, | ||
645 | h3, | ||
646 | h4, | ||
647 | h5, | ||
648 | h6, | ||
649 | h7, | ||
650 | h8 { | ||
651 | background-color: transparent; | ||
652 | } | ||
653 | |||
654 | hr { | ||
655 | border-color: #aaa; | ||
656 | } | ||
657 | |||
658 | |||
659 | .tip, .warning, .caution, .note { | ||
660 | border-color: #fff; | ||
661 | } | ||
662 | |||
663 | |||
664 | .tip table th, | ||
665 | .warning table th, | ||
666 | .caution table th, | ||
667 | .note table th { | ||
668 | border-bottom-color: #fff; | ||
669 | } | ||
670 | |||
671 | |||
672 | .warning { | ||
673 | background-color: #f0f0f2; | ||
674 | } | ||
675 | |||
676 | .caution { | ||
677 | background-color: #f0f0f2; | ||
678 | } | ||
679 | |||
680 | .tip { | ||
681 | background-color: #f0f0f2; | ||
682 | } | ||
683 | |||
684 | .note { | ||
685 | background-color: #f0f0f2; | ||
686 | } | ||
687 | |||
688 | .glossary dl dt, | ||
689 | .variablelist dl dt, | ||
690 | .variablelist dl dt span.term { | ||
691 | color: #044; | ||
692 | } | ||
693 | |||
694 | div.figure, | ||
695 | div.table, | ||
696 | div.example, | ||
697 | div.informalfigure, | ||
698 | div.informaltable, | ||
699 | div.informalexample { | ||
700 | border-color: #aaa; | ||
701 | } | ||
702 | |||
703 | pre.programlisting { | ||
704 | color: black; | ||
705 | background-color: #fff; | ||
706 | border-color: #aaa; | ||
707 | border-width: 2px; | ||
708 | } | ||
709 | |||
710 | .guimenu, | ||
711 | .guilabel, | ||
712 | .guimenuitem { | ||
713 | background-color: #eee; | ||
714 | } | ||
715 | |||
716 | |||
717 | b.keycap, | ||
718 | .keycap { | ||
719 | background-color: #eee; | ||
720 | border-color: #999; | ||
721 | } | ||
722 | |||
723 | |||
724 | div.navheader { | ||
725 | border-color: black; | ||
726 | } | ||
727 | |||
728 | |||
729 | div.navfooter { | ||
730 | border-color: black; | ||
731 | } | ||
732 | |||
733 | |||
734 | /*********** / | ||
735 | / graphics / | ||
736 | / ***********/ | ||
737 | |||
738 | /* | ||
739 | body { | ||
740 | background-image: url("images/body_bg.jpg"); | ||
741 | background-attachment: fixed; | ||
742 | } | ||
743 | |||
744 | .navheader, | ||
745 | .note, | ||
746 | .tip { | ||
747 | background-image: url("images/note_bg.jpg"); | ||
748 | background-attachment: fixed; | ||
749 | } | ||
750 | |||
751 | .warning, | ||
752 | .caution { | ||
753 | background-image: url("images/warning_bg.jpg"); | ||
754 | background-attachment: fixed; | ||
755 | } | ||
756 | |||
757 | .figure, | ||
758 | .informalfigure, | ||
759 | .example, | ||
760 | .informalexample, | ||
761 | .table, | ||
762 | .informaltable { | ||
763 | background-image: url("images/figure_bg.jpg"); | ||
764 | background-attachment: fixed; | ||
765 | } | ||
766 | |||
767 | */ | ||
768 | h1, | ||
769 | h2, | ||
770 | h3, | ||
771 | h4, | ||
772 | h5, | ||
773 | h6, | ||
774 | h7{ | ||
775 | } | ||
776 | |||
777 | /* | ||
778 | Example of how to stick an image as part of the title. | ||
779 | |||
780 | div.article .titlepage .title | ||
781 | { | ||
782 | background-image: url("figures/white-on-black.png"); | ||
783 | background-position: center; | ||
784 | background-repeat: repeat-x; | ||
785 | } | ||
786 | */ | ||
787 | |||
788 | div.preface .titlepage .title, | ||
789 | div.colophon .title, | ||
790 | div.chapter .titlepage .title, | ||
791 | div.article .titlepage .title | ||
792 | { | ||
793 | } | ||
794 | |||
795 | div.section div.section .titlepage .title, | ||
796 | div.sect2 .titlepage .title { | ||
797 | background: none; | ||
798 | } | ||
799 | |||
800 | |||
801 | h1.title { | ||
802 | background-color: transparent; | ||
803 | background-repeat: no-repeat; | ||
804 | height: 256px; | ||
805 | text-indent: -9000px; | ||
806 | overflow:hidden; | ||
807 | } | ||
808 | |||
809 | h2.subtitle { | ||
810 | background-color: transparent; | ||
811 | text-indent: -9000px; | ||
812 | overflow:hidden; | ||
813 | width: 0px; | ||
814 | display: none; | ||
815 | } | ||
816 | |||
817 | /*************************************** / | ||
818 | / pippin.gimp.org specific alterations / | ||
819 | / ***************************************/ | ||
820 | |||
821 | /* | ||
822 | div.heading, div.navheader { | ||
823 | color: #777; | ||
824 | font-size: 80%; | ||
825 | padding: 0; | ||
826 | margin: 0; | ||
827 | text-align: left; | ||
828 | position: absolute; | ||
829 | top: 0px; | ||
830 | left: 0px; | ||
831 | width: 100%; | ||
832 | height: 50px; | ||
833 | background: url('/gfx/heading_bg.png') transparent; | ||
834 | background-repeat: repeat-x; | ||
835 | background-attachment: fixed; | ||
836 | border: none; | ||
837 | } | ||
838 | |||
839 | div.heading a { | ||
840 | color: #444; | ||
841 | } | ||
842 | |||
843 | div.footing, div.navfooter { | ||
844 | border: none; | ||
845 | color: #ddd; | ||
846 | font-size: 80%; | ||
847 | text-align:right; | ||
848 | |||
849 | width: 100%; | ||
850 | padding-top: 10px; | ||
851 | position: absolute; | ||
852 | bottom: 0px; | ||
853 | left: 0px; | ||
854 | |||
855 | background: url('/gfx/footing_bg.png') transparent; | ||
856 | } | ||
857 | */ | ||
858 | |||
859 | |||
860 | |||
861 | /****************** / | ||
862 | / nasty ie tweaks / | ||
863 | / ******************/ | ||
864 | |||
865 | /* | ||
866 | div.heading, div.navheader { | ||
867 | width:expression(document.body.clientWidth + "px"); | ||
868 | } | ||
869 | |||
870 | div.footing, div.navfooter { | ||
871 | width:expression(document.body.clientWidth + "px"); | ||
872 | margin-left:expression("-5em"); | ||
873 | } | ||
874 | body { | ||
875 | padding:expression("4em 5em 0em 5em"); | ||
876 | } | ||
877 | */ | ||
878 | |||
879 | /**************************************** / | ||
880 | / mozilla vendor specific css extensions / | ||
881 | / ****************************************/ | ||
882 | /* | ||
883 | div.navfooter, div.footing{ | ||
884 | -moz-opacity: 0.8em; | ||
885 | } | ||
886 | |||
887 | div.figure, | ||
888 | div.table, | ||
889 | div.informalfigure, | ||
890 | div.informaltable, | ||
891 | div.informalexample, | ||
892 | div.example, | ||
893 | .tip, | ||
894 | .warning, | ||
895 | .caution, | ||
896 | .note { | ||
897 | -moz-border-radius: 0.5em; | ||
898 | } | ||
899 | |||
900 | b.keycap, | ||
901 | .keycap { | ||
902 | -moz-border-radius: 0.3em; | ||
903 | } | ||
904 | */ | ||
905 | |||
906 | table tr td table tr td { | ||
907 | display: none; | ||
908 | } | ||
909 | |||
910 | |||
911 | hr { | ||
912 | display: none; | ||
913 | } | ||
914 | |||
915 | table { | ||
916 | border: 0em; | ||
917 | } | ||
918 | |||
919 | .photo { | ||
920 | float: right; | ||
921 | margin-left: 1.5em; | ||
922 | margin-bottom: 1.5em; | ||
923 | margin-top: 0em; | ||
924 | max-width: 17em; | ||
925 | border: 1px solid gray; | ||
926 | padding: 3px; | ||
927 | background: white; | ||
928 | } | ||
929 | .seperator { | ||
930 | padding-top: 2em; | ||
931 | clear: both; | ||
932 | } | ||
933 | |||
934 | #validators { | ||
935 | margin-top: 5em; | ||
936 | text-align: right; | ||
937 | color: #777; | ||
938 | } | ||
939 | @media print { | ||
940 | body { | ||
941 | font-size: 8pt; | ||
942 | } | ||
943 | .noprint { | ||
944 | display: none; | ||
945 | } | ||
946 | } | ||
947 | |||
948 | |||
949 | .tip, | ||
950 | .note { | ||
951 | background: #f0f0f2; | ||
952 | color: #333; | ||
953 | padding: 20px; | ||
954 | margin: 20px; | ||
955 | } | ||
956 | |||
957 | .tip h3, | ||
958 | .note h3 { | ||
959 | padding: 0em; | ||
960 | margin: 0em; | ||
961 | font-size: 2em; | ||
962 | font-weight: bold; | ||
963 | color: #333; | ||
964 | } | ||
965 | |||
966 | .tip a, | ||
967 | .note a { | ||
968 | color: #333; | ||
969 | text-decoration: underline; | ||
970 | } | ||
971 | |||
972 | .footnote { | ||
973 | font-size: small; | ||
974 | color: #333; | ||
975 | } | ||
976 | |||
977 | /* Changes the announcement text */ | ||
978 | .tip h3, | ||
979 | .warning h3, | ||
980 | .caution h3, | ||
981 | .note h3 { | ||
982 | font-size:large; | ||
983 | color: #00557D; | ||
984 | } | ||
diff --git a/documentation/dev-manual/figures/app-dev-flow.png b/documentation/dev-manual/figures/app-dev-flow.png new file mode 100644 index 0000000..ec93374 --- /dev/null +++ b/documentation/dev-manual/figures/app-dev-flow.png | |||
Binary files differ | |||
diff --git a/documentation/dev-manual/figures/bsp-dev-flow.png b/documentation/dev-manual/figures/bsp-dev-flow.png new file mode 100644 index 0000000..540b0ab --- /dev/null +++ b/documentation/dev-manual/figures/bsp-dev-flow.png | |||
Binary files differ | |||
diff --git a/documentation/dev-manual/figures/dev-title.png b/documentation/dev-manual/figures/dev-title.png new file mode 100644 index 0000000..d3cac4a --- /dev/null +++ b/documentation/dev-manual/figures/dev-title.png | |||
Binary files differ | |||
diff --git a/documentation/dev-manual/figures/git-workflow.png b/documentation/dev-manual/figures/git-workflow.png new file mode 100644 index 0000000..e401330 --- /dev/null +++ b/documentation/dev-manual/figures/git-workflow.png | |||
Binary files differ | |||
diff --git a/documentation/dev-manual/figures/index-downloads.png b/documentation/dev-manual/figures/index-downloads.png new file mode 100644 index 0000000..41251d5 --- /dev/null +++ b/documentation/dev-manual/figures/index-downloads.png | |||
Binary files differ | |||
diff --git a/documentation/dev-manual/figures/kernel-dev-flow.png b/documentation/dev-manual/figures/kernel-dev-flow.png new file mode 100644 index 0000000..009105d --- /dev/null +++ b/documentation/dev-manual/figures/kernel-dev-flow.png | |||
Binary files differ | |||
diff --git a/documentation/dev-manual/figures/kernel-overview-1.png b/documentation/dev-manual/figures/kernel-overview-1.png new file mode 100644 index 0000000..116c0b9 --- /dev/null +++ b/documentation/dev-manual/figures/kernel-overview-1.png | |||
Binary files differ | |||
diff --git a/documentation/dev-manual/figures/kernel-overview-2-generic.png b/documentation/dev-manual/figures/kernel-overview-2-generic.png new file mode 100644 index 0000000..889ff1b --- /dev/null +++ b/documentation/dev-manual/figures/kernel-overview-2-generic.png | |||
Binary files differ | |||
diff --git a/documentation/dev-manual/figures/recipe-workflow.png b/documentation/dev-manual/figures/recipe-workflow.png new file mode 100644 index 0000000..c0e960b --- /dev/null +++ b/documentation/dev-manual/figures/recipe-workflow.png | |||
Binary files differ | |||
diff --git a/documentation/dev-manual/figures/source-repos.png b/documentation/dev-manual/figures/source-repos.png new file mode 100644 index 0000000..65c5f29 --- /dev/null +++ b/documentation/dev-manual/figures/source-repos.png | |||
Binary files differ | |||
diff --git a/documentation/dev-manual/figures/yp-download.png b/documentation/dev-manual/figures/yp-download.png new file mode 100644 index 0000000..7f1e5ca --- /dev/null +++ b/documentation/dev-manual/figures/yp-download.png | |||
Binary files differ | |||
diff --git a/documentation/kernel-dev/figures/kernel-architecture-overview.png b/documentation/kernel-dev/figures/kernel-architecture-overview.png new file mode 100755 index 0000000..2aad172 --- /dev/null +++ b/documentation/kernel-dev/figures/kernel-architecture-overview.png | |||
Binary files differ | |||
diff --git a/documentation/kernel-dev/figures/kernel-dev-title.png b/documentation/kernel-dev/figures/kernel-dev-title.png new file mode 100644 index 0000000..7a8dd54 --- /dev/null +++ b/documentation/kernel-dev/figures/kernel-dev-title.png | |||
Binary files differ | |||
diff --git a/documentation/kernel-dev/kernel-dev-advanced.xml b/documentation/kernel-dev/kernel-dev-advanced.xml new file mode 100644 index 0000000..4a6aeb7 --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-advanced.xml | |||
@@ -0,0 +1,1073 @@ | |||
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 | |||
5 | <chapter id='kernel-dev-advanced'> | ||
6 | <title>Working with Advanced Metadata</title> | ||
7 | |||
8 | <section id='kernel-dev-advanced-overview'> | ||
9 | <title>Overview</title> | ||
10 | |||
11 | <para> | ||
12 | In addition to supporting configuration fragments and patches, the | ||
13 | Yocto Project kernel tools also support rich | ||
14 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> that you can | ||
15 | use to define complex policies and Board Support Package (BSP) support. | ||
16 | The purpose of the Metadata and the tools that manage it, known as | ||
17 | the kern-tools (<filename>kern-tools-native_git.bb</filename>), is | ||
18 | to help you manage the complexity of the configuration and sources | ||
19 | used to support multiple BSPs and Linux kernel types. | ||
20 | </para> | ||
21 | </section> | ||
22 | |||
23 | <section id='using-kernel-metadata-in-a-recipe'> | ||
24 | <title>Using Kernel Metadata in a Recipe</title> | ||
25 | |||
26 | <para> | ||
27 | The kernel sources in the Yocto Project contain kernel Metadata, which is | ||
28 | located in the <filename>meta</filename> branches of the kernel source | ||
29 | Git repositories. | ||
30 | This Metadata defines Board Support Packages (BSPs) that | ||
31 | correspond to definitions in linux-yocto recipes for the same BSPs. | ||
32 | A BSP consists of an aggregation of kernel policy and hardware-specific | ||
33 | feature enablements. | ||
34 | The BSP can be influenced from within the linux-yocto recipe. | ||
35 | <note> | ||
36 | Linux kernel source that contains kernel Metadata is said to be | ||
37 | "linux-yocto style" kernel source. | ||
38 | A Linux kernel recipe that inherits from the | ||
39 | <filename>linux-yocto.inc</filename> include file is said to be a | ||
40 | "linux-yocto style" recipe. | ||
41 | </note> | ||
42 | </para> | ||
43 | |||
44 | <para> | ||
45 | Every linux-yocto style recipe must define the | ||
46 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink> | ||
47 | variable. | ||
48 | This variable is typically set to the same value as the | ||
49 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> | ||
50 | variable, which is used by | ||
51 | <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink> | ||
52 | (e.g. "edgerouter" or "fri2"). | ||
53 | Multiple BSPs can reuse the same <filename>KMACHINE</filename> | ||
54 | name if they are built using the same BSP description. | ||
55 | The "fri2" and "fri2-noemgd" BSP combination | ||
56 | in the <filename>meta-intel</filename> | ||
57 | layer is a good example of two BSPs using the same | ||
58 | <filename>KMACHINE</filename> value (i.e. "fri2"). | ||
59 | See the <link linkend='bsp-descriptions'>BSP Descriptions</link> section | ||
60 | for more information. | ||
61 | </para> | ||
62 | |||
63 | <para> | ||
64 | The linux-yocto style recipes can optionally define the following | ||
65 | variables: | ||
66 | <literallayout class='monospaced'> | ||
67 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'>KBRANCH</ulink> | ||
68 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'>KERNEL_FEATURES</ulink> | ||
69 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH_DEFAULT'>KBRANCH_DEFAULT</ulink> | ||
70 | <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'>LINUX_KERNEL_TYPE</ulink> | ||
71 | </literallayout> | ||
72 | <filename>KBRANCH_DEFAULT</filename> defines the Linux kernel source | ||
73 | repository's default branch to use to build the Linux kernel. | ||
74 | The value is used as the default for <filename>KBRANCH</filename>, which | ||
75 | can define an alternate branch typically with a machine override as | ||
76 | follows: | ||
77 | <literallayout class='monospaced'> | ||
78 | KBRANCH_fri2 = "standard/fri2" | ||
79 | </literallayout> | ||
80 | Unless you specify otherwise, <filename>KBRANCH_DEFAULT</filename> | ||
81 | initializes to "master". | ||
82 | </para> | ||
83 | |||
84 | <para> | ||
85 | <filename>LINUX_KERNEL_TYPE</filename> defines the kernel type to be | ||
86 | used in assembling the configuration. | ||
87 | If you do not specify a <filename>LINUX_KERNEL_TYPE</filename>, | ||
88 | it defaults to "standard". | ||
89 | Together with | ||
90 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>, | ||
91 | <filename>LINUX_KERNEL_TYPE</filename> defines the search | ||
92 | arguments used by the kernel tools to find the | ||
93 | appropriate description within the kernel Metadata with which to | ||
94 | build out the sources and configuration. | ||
95 | The linux-yocto recipes define "standard", "tiny", and "preempt-rt" | ||
96 | kernel types. | ||
97 | See the <link linkend='kernel-types'>Kernel Types</link> section | ||
98 | for more information on kernel types. | ||
99 | </para> | ||
100 | |||
101 | <para> | ||
102 | During the build, the kern-tools search for the BSP description | ||
103 | file that most closely matches the <filename>KMACHINE</filename> | ||
104 | and <filename>LINUX_KERNEL_TYPE</filename> variables passed in from the | ||
105 | recipe. | ||
106 | The tools use the first BSP description it finds that match | ||
107 | both variables. | ||
108 | If the tools cannot find a match, they issue a warning such as | ||
109 | the following: | ||
110 | <literallayout class='monospaced'> | ||
111 | WARNING: Can't find any BSP hardware or required configuration fragments. | ||
112 | WARNING: Looked at meta/cfg/broken/fri2-broken/hdw_frags.txt and | ||
113 | meta/cfg/broken/fri2-broken/required_frags.txt in directory: | ||
114 | meta/cfg/broken/fri2-broken | ||
115 | </literallayout> | ||
116 | In this example, <filename>KMACHINE</filename> was set to "fri2-broken" | ||
117 | and <filename>LINUX_KERNEL_TYPE</filename> was set to "broken". | ||
118 | </para> | ||
119 | |||
120 | <para> | ||
121 | The tools first search for the <filename>KMACHINE</filename> and | ||
122 | then for the <filename>LINUX_KERNEL_TYPE</filename>. | ||
123 | If the tools cannot find a partial match, they will use the | ||
124 | sources from the <filename>KBRANCH</filename> and any configuration | ||
125 | specified in the | ||
126 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>. | ||
127 | </para> | ||
128 | |||
129 | <para> | ||
130 | You can use the <filename>KERNEL_FEATURES</filename> variable | ||
131 | to include features (configuration fragments, patches, or both) that | ||
132 | are not already included by the <filename>KMACHINE</filename> and | ||
133 | <filename>LINUX_KERNEL_TYPE</filename> variable combination. | ||
134 | For example, to include a feature specified as "features/netfilter.scc", | ||
135 | specify: | ||
136 | <literallayout class='monospaced'> | ||
137 | KERNEL_FEATURES += "features/netfilter.scc" | ||
138 | </literallayout> | ||
139 | To include a feature called "cfg/sound.scc" just for the | ||
140 | <filename>qemux86</filename> machine, specify: | ||
141 | <literallayout class='monospaced'> | ||
142 | KERNEL_FEATURES_append_qemux86 = "cfg/sound.scc" | ||
143 | </literallayout> | ||
144 | The value of the entries in <filename>KERNEL_FEATURES</filename> | ||
145 | are dependent on their location within the kernel Metadata itself. | ||
146 | The examples here are taken from the | ||
147 | <filename>linux-yocto-3.4</filename> repository where "features" | ||
148 | and "cfg" are subdirectories within the | ||
149 | <filename>meta/cfg/kernel-cache</filename> directory. | ||
150 | For more information, see the | ||
151 | "<link linkend='kernel-metadata-syntax'>Kernel Metadata Syntax</link>" section. | ||
152 | <note> | ||
153 | The processing of the these variables has evolved some between the | ||
154 | 0.9 and 1.3 releases of the Yocto Project and associated | ||
155 | kern-tools sources. | ||
156 | The descriptions in this section are accurate for 1.3 and later | ||
157 | releases of the Yocto Project. | ||
158 | </note> | ||
159 | </para> | ||
160 | </section> | ||
161 | |||
162 | <section id='kernel-metadata-location'> | ||
163 | <title>Kernel Metadata Location</title> | ||
164 | |||
165 | <para> | ||
166 | Kernel Metadata can be defined in either the kernel recipe | ||
167 | (recipe-space) or in the kernel tree (in-tree). | ||
168 | Where you choose to define the Metadata depends on what you want | ||
169 | to do and how you intend to work. | ||
170 | Regardless of where you define the kernel Metadata, the syntax used | ||
171 | applies equally. | ||
172 | </para> | ||
173 | |||
174 | <para> | ||
175 | If you are unfamiliar with the Linux kernel and only wish | ||
176 | to apply a configuration and possibly a couple of patches provided to | ||
177 | you by others, the recipe-space method is recommended. | ||
178 | This method is also a good approach if you are working with Linux kernel | ||
179 | sources you do not control or if you just do not want to maintain a | ||
180 | Linux kernel Git repository on your own. | ||
181 | For partial information on how you can define kernel Metadata in | ||
182 | the recipe-space, see the | ||
183 | "<link linkend='modifying-an-existing-recipe'>Modifying an Existing Recipe</link>" | ||
184 | section. | ||
185 | </para> | ||
186 | |||
187 | <para> | ||
188 | Conversely, if you are actively developing a kernel and are already | ||
189 | maintaining a Linux kernel Git repository of your own, you might find | ||
190 | it more convenient to work with the kernel Metadata in the same | ||
191 | repository as the Linux kernel sources. | ||
192 | This method can make iterative development of the Linux kernel | ||
193 | more efficient outside of the BitBake environment. | ||
194 | </para> | ||
195 | |||
196 | <section id='recipe-space-metadata'> | ||
197 | <title>Recipe-Space Metadata</title> | ||
198 | |||
199 | <para> | ||
200 | When stored in recipe-space, the kernel Metadata files reside in a | ||
201 | directory hierarchy below | ||
202 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>. | ||
203 | For a linux-yocto recipe or for a Linux kernel recipe derived | ||
204 | by copying and modifying | ||
205 | <filename>oe-core/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb</filename> | ||
206 | to a recipe in your layer, <filename>FILESEXTRAPATHS</filename> | ||
207 | is typically set to | ||
208 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-THISDIR'><filename>THISDIR</filename></ulink><filename>}/${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>. | ||
209 | See the "<link linkend='modifying-an-existing-recipe'>Modifying an Existing Recipe</link>" | ||
210 | section for more information. | ||
211 | </para> | ||
212 | |||
213 | <para> | ||
214 | Here is an example that shows a trivial tree of kernel Metadata | ||
215 | stored in recipe-space within a BSP layer: | ||
216 | <literallayout class='monospaced'> | ||
217 | meta-my_bsp_layer/ | ||
218 | `-- recipes-kernel | ||
219 | `-- linux | ||
220 | `-- linux-yocto | ||
221 | |-- bsp-standard.scc | ||
222 | |-- bsp.cfg | ||
223 | `-- standard.cfg | ||
224 | </literallayout> | ||
225 | </para> | ||
226 | |||
227 | <para> | ||
228 | When the Metadata is stored in recipe-space, you must take | ||
229 | steps to ensure BitBake has the necessary information to decide | ||
230 | what files to fetch and when they need to be fetched again. | ||
231 | It is only necessary to specify the <filename>.scc</filename> | ||
232 | files on the | ||
233 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>. | ||
234 | BitBake parses them and fetches any files referenced in the | ||
235 | <filename>.scc</filename> files by the <filename>include</filename>, | ||
236 | <filename>patch</filename>, or <filename>kconf</filename> commands. | ||
237 | Because of this, it is necessary to bump the recipe | ||
238 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink> | ||
239 | value when changing the content of files not explicitly listed | ||
240 | in the <filename>SRC_URI</filename>. | ||
241 | </para> | ||
242 | </section> | ||
243 | |||
244 | <section id='in-tree-metadata'> | ||
245 | <title>In-Tree Metadata</title> | ||
246 | |||
247 | <para> | ||
248 | When stored in-tree, the kernel Metadata files reside in the | ||
249 | <filename>meta</filename> directory of the Linux kernel sources. | ||
250 | The <filename>meta</filename> directory can be present in the | ||
251 | same repository branch as the sources, | ||
252 | such as "master", or <filename>meta</filename> can be its own | ||
253 | orphan branch. | ||
254 | <note> | ||
255 | An orphan branch in Git is a branch with unique history and | ||
256 | content to the other branches in the repository. | ||
257 | Orphan branches are useful to track Metadata changes | ||
258 | independently from the sources of the Linux kernel, while | ||
259 | still keeping them together in the same repository. | ||
260 | </note> | ||
261 | For the purposes of this document, we will discuss all | ||
262 | in-tree Metadata as residing below the | ||
263 | <filename>meta/cfg/kernel-cache</filename> directory. | ||
264 | </para> | ||
265 | |||
266 | <para> | ||
267 | Following is an example that shows how a trivial tree of Metadata | ||
268 | is stored in a custom Linux kernel Git repository: | ||
269 | <literallayout class='monospaced'> | ||
270 | meta/ | ||
271 | `-- cfg | ||
272 | `-- kernel-cache | ||
273 | |-- bsp-standard.scc | ||
274 | |-- bsp.cfg | ||
275 | `-- standard.cfg | ||
276 | </literallayout> | ||
277 | </para> | ||
278 | |||
279 | <para> | ||
280 | To use a branch different from where the sources reside, | ||
281 | specify the branch in the <filename>KMETA</filename> variable | ||
282 | in your Linux kernel recipe. | ||
283 | Here is an example: | ||
284 | <literallayout class='monospaced'> | ||
285 | KMETA = "meta" | ||
286 | </literallayout> | ||
287 | To use the same branch as the sources, set | ||
288 | <filename>KMETA</filename> to an empty string: | ||
289 | <literallayout class='monospaced'> | ||
290 | KMETA = "" | ||
291 | </literallayout> | ||
292 | If you are working with your own sources and want to create an | ||
293 | orphan <filename>meta</filename> branch, use these commands | ||
294 | from within your Linux kernel Git repository: | ||
295 | <literallayout class='monospaced'> | ||
296 | $ git checkout --orphan meta | ||
297 | $ git rm -rf . | ||
298 | $ git commit --allow-empty -m "Create orphan meta branch" | ||
299 | </literallayout> | ||
300 | </para> | ||
301 | |||
302 | <para> | ||
303 | If you modify the Metadata in the linux-yocto | ||
304 | <filename>meta</filename> branch, you must not forget to update | ||
305 | the | ||
306 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink> | ||
307 | statements in the kernel's recipe. | ||
308 | In particular, you need to update the | ||
309 | <filename>SRCREV_meta</filename> variable to match the commit in | ||
310 | the <filename>KMETA</filename> branch you wish to use. | ||
311 | Changing the data in these branches and not updating the | ||
312 | <filename>SRCREV</filename> statements to match will cause the | ||
313 | build to fetch an older commit. | ||
314 | </para> | ||
315 | </section> | ||
316 | </section> | ||
317 | |||
318 | <section id='kernel-metadata-syntax'> | ||
319 | <title>Kernel Metadata Syntax</title> | ||
320 | |||
321 | <para> | ||
322 | The kernel Metadata consists of three primary types of files: | ||
323 | <filename>scc</filename> | ||
324 | <footnote> | ||
325 | <para> | ||
326 | <filename>scc</filename> stands for Series Configuration | ||
327 | Control, but the naming has less significance in the | ||
328 | current implementation of the tooling than it had in the | ||
329 | past. | ||
330 | Consider <filename>scc</filename> files to be description files. | ||
331 | </para> | ||
332 | </footnote> | ||
333 | description files, configuration fragments, and patches. | ||
334 | The <filename>scc</filename> files define variables and include or | ||
335 | otherwise reference any of the three file types. | ||
336 | The description files are used to aggregate all types of kernel | ||
337 | Metadata into | ||
338 | what ultimately describes the sources and the configuration required | ||
339 | to build a Linux kernel tailored to a specific machine. | ||
340 | </para> | ||
341 | |||
342 | <para> | ||
343 | The <filename>scc</filename> description files are used to define two | ||
344 | fundamental types of kernel Metadata: | ||
345 | <itemizedlist> | ||
346 | <listitem><para>Features</para></listitem> | ||
347 | <listitem><para>Board Support Packages (BSPs)</para></listitem> | ||
348 | </itemizedlist> | ||
349 | </para> | ||
350 | |||
351 | <para> | ||
352 | Features aggregate sources in the form of patches and configuration | ||
353 | fragments into a modular reusable unit. | ||
354 | You can use features to implement conceptually separate kernel | ||
355 | Metadata descriptions such as pure configuration fragments, | ||
356 | simple patches, complex features, and kernel types. | ||
357 | <link linkend='kernel-types'>Kernel types</link> define general | ||
358 | kernel features and policy to be reused in the BSPs. | ||
359 | </para> | ||
360 | |||
361 | <para> | ||
362 | BSPs define hardware-specific features and aggregate them with kernel | ||
363 | types to form the final description of what will be assembled and built. | ||
364 | </para> | ||
365 | |||
366 | <para> | ||
367 | While the kernel Metadata syntax does not enforce any logical | ||
368 | separation of configuration fragments, patches, features or kernel | ||
369 | types, best practices dictate a logical separation of these types | ||
370 | of Metadata. | ||
371 | The following Metadata file hierarchy is recommended: | ||
372 | <literallayout class='monospaced'> | ||
373 | <base>/ | ||
374 | bsp/ | ||
375 | cfg/ | ||
376 | features/ | ||
377 | ktypes/ | ||
378 | patches/ | ||
379 | </literallayout> | ||
380 | </para> | ||
381 | |||
382 | <para> | ||
383 | The <filename>bsp</filename> directory contains the | ||
384 | <link linkend='bsp-descriptions'>BSP descriptions</link>. | ||
385 | The remaining directories all contain "features". | ||
386 | Separating <filename>bsp</filename> from the rest of the structure | ||
387 | aids conceptualizing intended usage. | ||
388 | </para> | ||
389 | |||
390 | <para> | ||
391 | Use these guidelines to help place your <filename>scc</filename> | ||
392 | description files within the structure: | ||
393 | <itemizedlist> | ||
394 | <listitem><para>If your file contains | ||
395 | only configuration fragments, place the file in the | ||
396 | <filename>cfg</filename> directory.</para></listitem> | ||
397 | <listitem><para>If your file contains | ||
398 | only source-code fixes, place the file in the | ||
399 | <filename>patches</filename> directory.</para></listitem> | ||
400 | <listitem><para>If your file encapsulates | ||
401 | a major feature, often combining sources and configurations, | ||
402 | place the file in <filename>features</filename> directory. | ||
403 | </para></listitem> | ||
404 | <listitem><para>If your file aggregates | ||
405 | non-hardware configuration and patches in order to define a | ||
406 | base kernel policy or major kernel type to be reused across | ||
407 | multiple BSPs, place the file in <filename>ktypes</filename> | ||
408 | directory. | ||
409 | </para></listitem> | ||
410 | </itemizedlist> | ||
411 | </para> | ||
412 | |||
413 | <para> | ||
414 | These distinctions can easily become blurred - especially as | ||
415 | out-of-tree features slowly merge upstream over time. | ||
416 | Also, remember that how the description files are placed is | ||
417 | a purely logical organization and has no impact on the functionality | ||
418 | of the kernel Metadata. | ||
419 | There is no impact because all of <filename>cfg</filename>, | ||
420 | <filename>features</filename>, <filename>patches</filename>, and | ||
421 | <filename>ktypes</filename>, contain "features" as far as the kernel | ||
422 | tools are concerned. | ||
423 | </para> | ||
424 | |||
425 | <para> | ||
426 | Paths used in kernel Metadata files are relative to | ||
427 | <filename><base></filename>, which is either | ||
428 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink> | ||
429 | if you are creating Metadata in | ||
430 | <link linkend='recipe-space-metadata'>recipe-space</link>, | ||
431 | or <filename>meta/cfg/kernel-cache/</filename> if you are creating | ||
432 | Metadata <link linkend='in-tree-metadata'>in-tree</link>. | ||
433 | </para> | ||
434 | |||
435 | <section id='configuration'> | ||
436 | <title>Configuration</title> | ||
437 | |||
438 | <para> | ||
439 | The simplest unit of kernel Metadata is the configuration-only | ||
440 | feature. | ||
441 | This feature consists of one or more Linux kernel configuration | ||
442 | parameters in a configuration fragment file | ||
443 | (<filename>.cfg</filename>) and an <filename>.scc</filename> file | ||
444 | that describes the fragment. | ||
445 | </para> | ||
446 | |||
447 | <para> | ||
448 | The Symmetric Multi-Processing (SMP) fragment included in the | ||
449 | <filename>linux-yocto-3.4</filename> Git repository | ||
450 | consists of the following two files: | ||
451 | <literallayout class='monospaced'> | ||
452 | cfg/smp.scc: | ||
453 | define KFEATURE_DESCRIPTION "Enable SMP" | ||
454 | kconf hardware smp.cfg | ||
455 | |||
456 | cfg/smp.cfg: | ||
457 | CONFIG_SMP=y | ||
458 | CONFIG_SCHED_SMT=y | ||
459 | </literallayout> | ||
460 | You can find information on configuration fragment files in the | ||
461 | "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-config-fragments'>Creating Configuration Fragments</ulink>" | ||
462 | section of the Yocto Project Development Manual and in | ||
463 | the "<link linkend='generating-configuration-files'>Generating Configuration Files</link>" | ||
464 | section earlier in this manual. | ||
465 | </para> | ||
466 | |||
467 | <para> | ||
468 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KFEATURE_DESCRIPTION'><filename>KFEATURE_DESCRIPTION</filename></ulink> | ||
469 | provides a short description of the fragment. | ||
470 | Higher level kernel tools use this description. | ||
471 | </para> | ||
472 | |||
473 | <para> | ||
474 | The <filename>kconf</filename> command is used to include the | ||
475 | actual configuration fragment in an <filename>.scc</filename> | ||
476 | file, and the "hardware" keyword identifies the fragment as | ||
477 | being hardware enabling, as opposed to general policy, | ||
478 | which would use the "non-hardware" keyword. | ||
479 | The distinction is made for the benefit of the configuration | ||
480 | validation tools, which warn you if a hardware fragment | ||
481 | overrides a policy set by a non-hardware fragment. | ||
482 | <note> | ||
483 | The description file can include multiple | ||
484 | <filename>kconf</filename> statements, one per fragment. | ||
485 | </note> | ||
486 | </para> | ||
487 | |||
488 | <para> | ||
489 | As described in the | ||
490 | "<link linkend='generating-configuration-files'>Generating Configuration Files</link>" | ||
491 | section, you can use the following BitBake command to audit your | ||
492 | configuration: | ||
493 | <literallayout class='monospaced'> | ||
494 | $ bitbake linux-yocto -c kernel_configcheck -f | ||
495 | </literallayout> | ||
496 | </para> | ||
497 | </section> | ||
498 | |||
499 | <section id='patches'> | ||
500 | <title>Patches</title> | ||
501 | |||
502 | <para> | ||
503 | Patch descriptions are very similar to configuration fragment | ||
504 | descriptions, which are described in the previous section. | ||
505 | However, instead of a <filename>.cfg</filename> file, these | ||
506 | descriptions work with source patches. | ||
507 | </para> | ||
508 | |||
509 | <para> | ||
510 | A typical patch includes a description file and the patch itself: | ||
511 | <literallayout class='monospaced'> | ||
512 | patches/mypatch.scc: | ||
513 | patch mypatch.patch | ||
514 | |||
515 | patches/mypatch.patch: | ||
516 | <typical-patch> | ||
517 | </literallayout> | ||
518 | You can create the typical <filename>.patch</filename> | ||
519 | file using <filename>diff -Nurp</filename> or | ||
520 | <filename>git format-patch</filename>. | ||
521 | </para> | ||
522 | |||
523 | <para> | ||
524 | The description file can include multiple patch statements, | ||
525 | one per patch. | ||
526 | </para> | ||
527 | </section> | ||
528 | |||
529 | <section id='features'> | ||
530 | <title>Features</title> | ||
531 | |||
532 | <para> | ||
533 | Features are complex kernel Metadata types that consist | ||
534 | of configuration fragments (<filename>kconf</filename>), patches | ||
535 | (<filename>patch</filename>), and possibly other feature | ||
536 | description files (<filename>include</filename>). | ||
537 | </para> | ||
538 | |||
539 | <para> | ||
540 | Here is an example that shows a feature description file: | ||
541 | <literallayout class='monospaced'> | ||
542 | features/myfeature.scc | ||
543 | define KFEATURE_DESCRIPTION "Enable myfeature" | ||
544 | |||
545 | patch 0001-myfeature-core.patch | ||
546 | patch 0002-myfeature-interface.patch | ||
547 | |||
548 | include cfg/myfeature_dependency.scc | ||
549 | kconf non-hardware myfeature.cfg | ||
550 | </literallayout> | ||
551 | This example shows how the <filename>patch</filename> and | ||
552 | <filename>kconf</filename> commands are used as well as | ||
553 | how an additional feature description file is included. | ||
554 | </para> | ||
555 | |||
556 | <para> | ||
557 | Typically, features are less granular than configuration | ||
558 | fragments and are more likely than configuration fragments | ||
559 | and patches to be the types of things you want to specify | ||
560 | in the <filename>KERNEL_FEATURES</filename> variable of the | ||
561 | Linux kernel recipe. | ||
562 | See the "<link linkend='using-kernel-metadata-in-a-recipe'>Using Kernel Metadata in a Recipe</link>" | ||
563 | section earlier in the manual. | ||
564 | </para> | ||
565 | </section> | ||
566 | |||
567 | <section id='kernel-types'> | ||
568 | <title>Kernel Types</title> | ||
569 | |||
570 | <para> | ||
571 | A kernel type defines a high-level kernel policy by | ||
572 | aggregating non-hardware configuration fragments with | ||
573 | patches you want to use when building a Linux kernels of a | ||
574 | specific type. | ||
575 | Syntactically, kernel types are no different than features | ||
576 | as described in the "<link linkend='features'>Features</link>" | ||
577 | section. | ||
578 | The <filename>LINUX_KERNEL_TYPE</filename> variable in the kernel | ||
579 | recipe selects the kernel type. | ||
580 | See the "<link linkend='using-kernel-metadata-in-a-recipe'>Using Kernel Metadata in a Recipe</link>" | ||
581 | section for more information. | ||
582 | </para> | ||
583 | |||
584 | <para> | ||
585 | As an example, the <filename>linux-yocto-3.4</filename> | ||
586 | tree defines three kernel types: "standard", | ||
587 | "tiny", and "preempt-rt": | ||
588 | <itemizedlist> | ||
589 | <listitem><para>"standard": | ||
590 | Includes the generic Linux kernel policy of the Yocto | ||
591 | Project linux-yocto kernel recipes. | ||
592 | This policy includes, among other things, which file | ||
593 | systems, networking options, core kernel features, and | ||
594 | debugging and tracing options are supported. | ||
595 | </para></listitem> | ||
596 | <listitem><para>"preempt-rt": | ||
597 | Applies the <filename>PREEMPT_RT</filename> | ||
598 | patches and the configuration options required to | ||
599 | build a real-time Linux kernel. | ||
600 | This kernel type inherits from the "standard" kernel type. | ||
601 | </para></listitem> | ||
602 | <listitem><para>"tiny": | ||
603 | Defines a bare minimum configuration meant to serve as a | ||
604 | base for very small Linux kernels. | ||
605 | The "tiny" kernel type is independent from the "standard" | ||
606 | configuration. | ||
607 | Although the "tiny" kernel type does not currently include | ||
608 | any source changes, it might in the future. | ||
609 | </para></listitem> | ||
610 | </itemizedlist> | ||
611 | </para> | ||
612 | |||
613 | <para> | ||
614 | The "standard" kernel type is defined by | ||
615 | <filename>standard.scc</filename>: | ||
616 | <literallayout class='monospaced'> | ||
617 | # Include this kernel type fragment to get the standard features and | ||
618 | # configuration values. | ||
619 | |||
620 | # Include all standard features | ||
621 | include standard-nocfg.scc | ||
622 | |||
623 | kconf non-hardware standard.cfg | ||
624 | |||
625 | # individual cfg block section | ||
626 | include cfg/fs/devtmpfs.scc | ||
627 | include cfg/fs/debugfs.scc | ||
628 | include cfg/fs/btrfs.scc | ||
629 | include cfg/fs/ext2.scc | ||
630 | include cfg/fs/ext3.scc | ||
631 | include cfg/fs/ext4.scc | ||
632 | |||
633 | include cfg/net/ipv6.scc | ||
634 | include cfg/net/ip_nf.scc | ||
635 | include cfg/net/ip6_nf.scc | ||
636 | include cfg/net/bridge.scc | ||
637 | </literallayout> | ||
638 | </para> | ||
639 | |||
640 | <para> | ||
641 | As with any <filename>.scc</filename> file, a | ||
642 | kernel type definition can aggregate other | ||
643 | <filename>.scc</filename> files with | ||
644 | <filename>include</filename> commands. | ||
645 | These definitions can also directly pull in | ||
646 | configuration fragments and patches with the | ||
647 | <filename>kconf</filename> and <filename>patch</filename> | ||
648 | commands, respectively. | ||
649 | </para> | ||
650 | |||
651 | <note> | ||
652 | It is not strictly necessary to create a kernel type | ||
653 | <filename>.scc</filename> file. | ||
654 | The Board Support Package (BSP) file can implicitly define | ||
655 | the kernel type using a <filename>define | ||
656 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KTYPE'>KTYPE</ulink> myktype</filename> | ||
657 | line. | ||
658 | See the "<link linkend='bsp-descriptions'>BSP Descriptions</link>" | ||
659 | section for more information. | ||
660 | </note> | ||
661 | </section> | ||
662 | |||
663 | <section id='bsp-descriptions'> | ||
664 | <title>BSP Descriptions</title> | ||
665 | |||
666 | <para> | ||
667 | BSP descriptions combine kernel types with hardware-specific | ||
668 | features. | ||
669 | The hardware-specific portion is typically defined | ||
670 | independently, and then aggregated with each supported kernel | ||
671 | type. | ||
672 | Consider this simple BSP description that supports the "mybsp" | ||
673 | machine: | ||
674 | <literallayout class='monospaced'> | ||
675 | mybsp.scc: | ||
676 | define KMACHINE mybsp | ||
677 | define KTYPE standard | ||
678 | define KARCH i386 | ||
679 | |||
680 | kconf mybsp.cfg | ||
681 | </literallayout> | ||
682 | Every BSP description should define the | ||
683 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>, | ||
684 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KTYPE'><filename>KTYPE</filename></ulink>, | ||
685 | and <ulink url='&YOCTO_DOCS_REF_URL;#var-KARCH'><filename>KARCH</filename></ulink> | ||
686 | variables. | ||
687 | These variables allow the OpenEmbedded build system to identify | ||
688 | the description as meeting the criteria set by the recipe being | ||
689 | built. | ||
690 | This simple example supports the "mybsp" machine for the "standard" | ||
691 | kernel and the "i386" architecture. | ||
692 | </para> | ||
693 | |||
694 | <para> | ||
695 | Be aware that a hard link between the | ||
696 | <filename>KTYPE</filename> variable and a kernel type | ||
697 | description file does not exist. | ||
698 | Thus, if you do not have kernel types defined in your kernel | ||
699 | Metadata, you only need to ensure that the kernel recipe's | ||
700 | <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'><filename>LINUX_KERNEL_TYPE</filename></ulink> | ||
701 | variable and the <filename>KTYPE</filename> variable in the | ||
702 | BSP description file match. | ||
703 | <note> | ||
704 | Future versions of the tooling make the specification of | ||
705 | <filename>KTYPE</filename> in the BSP optional. | ||
706 | </note> | ||
707 | </para> | ||
708 | |||
709 | <para> | ||
710 | If you did want to separate your kernel policy from your | ||
711 | hardware configuration, you could do so by specifying a kernel | ||
712 | type, such as "standard" and including that description file | ||
713 | in the BSP description file. | ||
714 | See the "<link linkend='kernel-types'>Kernel Types</link>" section | ||
715 | for more information. | ||
716 | </para> | ||
717 | |||
718 | <para> | ||
719 | You might also have multiple hardware configurations that you | ||
720 | aggregate into a single hardware description file that you | ||
721 | could include in the BSP description file, rather than referencing | ||
722 | a single <filename>.cfg</filename> file. | ||
723 | Consider the following: | ||
724 | <literallayout class='monospaced'> | ||
725 | mybsp.scc: | ||
726 | define KMACHINE mybsp | ||
727 | define KTYPE standard | ||
728 | define KARCH i386 | ||
729 | |||
730 | include standard.scc | ||
731 | include mybsp-hw.scc | ||
732 | </literallayout> | ||
733 | </para> | ||
734 | |||
735 | <para> | ||
736 | In the above example, <filename>standard.scc</filename> | ||
737 | aggregates all the configuration fragments, patches, and | ||
738 | features that make up your standard kernel policy whereas | ||
739 | <filename>mybsp-hw.scc</filename> aggregates all those necessary | ||
740 | to support the hardware available on the "mybsp" machine. | ||
741 | For information on how to break a complete | ||
742 | <filename>.config</filename> file into the various | ||
743 | configuration fragments, see the | ||
744 | "<link linkend='generating-configuration-files'>Generating Configuration Files</link>" | ||
745 | section. | ||
746 | </para> | ||
747 | |||
748 | <para> | ||
749 | Many real-world examples are more complex. | ||
750 | Like any other <filename>.scc</filename> file, BSP | ||
751 | descriptions can aggregate features. | ||
752 | Consider the Fish River Island 2 (fri2) | ||
753 | BSP definition from the <filename>linux-yocto-3.4</filename> | ||
754 | Git repository: | ||
755 | <literallayout class='monospaced'> | ||
756 | fri2.scc: | ||
757 | kconf hardware fri2.cfg | ||
758 | |||
759 | include cfg/x86.scc | ||
760 | include features/eg20t/eg20t.scc | ||
761 | include cfg/dmaengine.scc | ||
762 | include features/ericsson-3g/f5521gw.scc | ||
763 | include features/power/intel.scc | ||
764 | include cfg/efi.scc | ||
765 | include features/usb/ehci-hcd.scc | ||
766 | include features/usb/ohci-hcd.scc | ||
767 | include features/iwlwifi/iwlwifi.scc | ||
768 | </literallayout> | ||
769 | </para> | ||
770 | |||
771 | <para> | ||
772 | The <filename>fri2.scc</filename> description file includes | ||
773 | a hardware configuration fragment | ||
774 | (<filename>fri2.cfg</filename>) specific to the Fish River | ||
775 | Island 2 BSP as well as several more general configuration | ||
776 | fragments and features enabling hardware found on the | ||
777 | machine. | ||
778 | This description file is then included in each of the three | ||
779 | "fri2" description files for the supported kernel types | ||
780 | (i.e. "standard", "preempt-rt", and "tiny"). | ||
781 | Consider the "fri2" description for the "standard" kernel | ||
782 | type: | ||
783 | <literallayout class='monospaced'> | ||
784 | fri2-standard.scc: | ||
785 | define KMACHINE fri2 | ||
786 | define KTYPE standard | ||
787 | define KARCH i386 | ||
788 | |||
789 | include ktypes/standard/standard.scc | ||
790 | branch fri2 | ||
791 | |||
792 | git merge emgd-1.14 | ||
793 | |||
794 | include fri2.scc | ||
795 | |||
796 | # Extra fri2 configs above the minimal defined in fri2.scc | ||
797 | include cfg/efi-ext.scc | ||
798 | include features/drm-emgd/drm-emgd.scc | ||
799 | include cfg/vesafb.scc | ||
800 | |||
801 | # default policy for standard kernels | ||
802 | include cfg/usb-mass-storage.scc | ||
803 | </literallayout> | ||
804 | The <filename>include</filename> command midway through the file | ||
805 | includes the <filename>fri2.scc</filename> description that | ||
806 | defines all hardware enablements for the BSP that is common to all | ||
807 | kernel types. | ||
808 | Using this command significantly reduces duplication. | ||
809 | </para> | ||
810 | |||
811 | <para> | ||
812 | This "fri2" standard description introduces a few more variables | ||
813 | and commands that are worth further discussion. | ||
814 | Notice the <filename>branch fri2</filename> command, which creates | ||
815 | a machine-specific branch into which source changes are applied. | ||
816 | With this branch set up, the <filename>git merge</filename> command | ||
817 | uses Git to merge in a feature branch named "emgd-1.14". | ||
818 | You could also handle this with the <filename>patch</filename> | ||
819 | command. | ||
820 | However, for commonly used features such as this, feature branches | ||
821 | are a convenient mechanism. | ||
822 | See the "<link linkend='feature-branches'>Feature Branches</link>" | ||
823 | section for more information. | ||
824 | </para> | ||
825 | |||
826 | <para> | ||
827 | Now consider the "fri2" description for the "tiny" kernel type: | ||
828 | <literallayout class='monospaced'> | ||
829 | fri2-tiny.scc: | ||
830 | define KMACHINE fri2 | ||
831 | define KTYPE tiny | ||
832 | define KARCH i386 | ||
833 | |||
834 | include ktypes/tiny/tiny.scc | ||
835 | branch fri2 | ||
836 | |||
837 | include fri2.scc | ||
838 | </literallayout> | ||
839 | As you might expect, the "tiny" description includes quite a | ||
840 | bit less. | ||
841 | In fact, it includes only the minimal policy defined by the | ||
842 | "tiny" kernel type and the hardware-specific configuration required | ||
843 | for booting the machine along with the most basic functionality of | ||
844 | the system as defined in the base "fri2" description file. | ||
845 | </para> | ||
846 | |||
847 | <para> | ||
848 | Notice again the three critical variables: | ||
849 | <filename>KMACHINE</filename>, <filename>KTYPE</filename>, | ||
850 | and <filename>KARCH</filename>. | ||
851 | Of these variables, only the <filename>KTYPE</filename> has changed. | ||
852 | It is now set to "tiny". | ||
853 | </para> | ||
854 | </section> | ||
855 | </section> | ||
856 | |||
857 | <section id='organizing-your-source'> | ||
858 | <title>Organizing Your Source</title> | ||
859 | |||
860 | <para> | ||
861 | Many recipes based on the <filename>linux-yocto-custom.bb</filename> | ||
862 | recipe use Linux kernel sources that have only a single | ||
863 | branch - "master". | ||
864 | This type of repository structure is fine for linear development | ||
865 | supporting a single machine and architecture. | ||
866 | However, if you work with multiple boards and architectures, | ||
867 | a kernel source repository with multiple branches is more | ||
868 | efficient. | ||
869 | For example, suppose you need a series of patches for one board to boot. | ||
870 | Sometimes, these patches are works-in-progress or fundamentally wrong, | ||
871 | yet they are still necessary for specific boards. | ||
872 | In these situations, you most likely do not want to include these | ||
873 | patches in every kernel you build (i.e. have the patches as part of | ||
874 | the lone "master" branch). | ||
875 | It is situations like these that give rise to multiple branches used | ||
876 | within a Linux kernel sources Git repository. | ||
877 | </para> | ||
878 | |||
879 | <para> | ||
880 | Repository organization strategies exist that maximize source reuse, | ||
881 | remove redundancy, and logically order your changes. | ||
882 | This section presents strategies for the following cases: | ||
883 | <itemizedlist> | ||
884 | <listitem><para>Encapsulating patches in a feature description | ||
885 | and only including the patches in the BSP descriptions of | ||
886 | the applicable boards.</para></listitem> | ||
887 | <listitem><para>Creating a machine branch in your | ||
888 | kernel source repository and applying the patches on that | ||
889 | branch only.</para></listitem> | ||
890 | <listitem><para>Creating a feature branch in your | ||
891 | kernel source repository and merging that branch into your | ||
892 | BSP when needed.</para></listitem> | ||
893 | </itemizedlist> | ||
894 | </para> | ||
895 | |||
896 | <para> | ||
897 | The approach you take is entirely up to you | ||
898 | and depends on what works best for your development model. | ||
899 | </para> | ||
900 | |||
901 | <section id='encapsulating-patches'> | ||
902 | <title>Encapsulating Patches</title> | ||
903 | |||
904 | <para> | ||
905 | if you are reusing patches from an external tree and are not | ||
906 | working on the patches, you might find the encapsulated feature | ||
907 | to be appropriate. | ||
908 | Given this scenario, you do not need to create any branches in the | ||
909 | source repository. | ||
910 | Rather, you just take the static patches you need and encapsulate | ||
911 | them within a feature description. | ||
912 | Once you have the feature description, you simply include that into | ||
913 | the BSP description as described in the | ||
914 | "<link linkend='bsp-descriptions'>BSP Descriptions</link>" | ||
915 | section. | ||
916 | </para> | ||
917 | |||
918 | <para> | ||
919 | You can find information on how to create patches and BSP | ||
920 | descriptions in the "<link linkend='patches'>Patches</link>" and | ||
921 | "<link linkend='bsp-descriptions'>BSP Descriptions</link>" | ||
922 | sections. | ||
923 | </para> | ||
924 | </section> | ||
925 | |||
926 | <section id='machine-branches'> | ||
927 | <title>Machine Branches</title> | ||
928 | |||
929 | <para> | ||
930 | When you have multiple machines and architectures to support, | ||
931 | or you are actively working on board support, it is more | ||
932 | efficient to create branches in the repository based on | ||
933 | individual machines. | ||
934 | Having machine branches allows common source to remain in the | ||
935 | "master" branch with any features specific to a machine stored | ||
936 | in the appropriate machine branch. | ||
937 | This organization method frees you from continually reintegrating | ||
938 | your patches into a feature. | ||
939 | </para> | ||
940 | |||
941 | <para> | ||
942 | Once you have a new branch, you can set up your kernel Metadata | ||
943 | to use the branch a couple different ways. | ||
944 | In the recipe, you can specify the new branch as the | ||
945 | <filename>KBRANCH</filename> to use for the board as | ||
946 | follows: | ||
947 | <literallayout class='monospaced'> | ||
948 | KBRANCH = "mynewbranch" | ||
949 | </literallayout> | ||
950 | Another method is to use the <filename>branch</filename> command | ||
951 | in the BSP description: | ||
952 | <literallayout class='monospaced'> | ||
953 | mybsp.scc: | ||
954 | define KMACHINE mybsp | ||
955 | define KTYPE standard | ||
956 | define KARCH i386 | ||
957 | include standard.scc | ||
958 | |||
959 | branch mynewbranch | ||
960 | |||
961 | include mybsp-hw.scc | ||
962 | </literallayout> | ||
963 | </para> | ||
964 | |||
965 | <para> | ||
966 | If you find | ||
967 | yourself with numerous branches, you might consider using a | ||
968 | hierarchical branching system similar to what the linux-yocto Linux | ||
969 | kernel repositories use: | ||
970 | <literallayout class='monospaced'> | ||
971 | <common>/<kernel_type>/<machine> | ||
972 | </literallayout> | ||
973 | </para> | ||
974 | |||
975 | <para> | ||
976 | If you had two kernel types, "standard" and "small" for | ||
977 | instance, and three machines, the branches in your | ||
978 | Git repository might look like this: | ||
979 | <literallayout class='monospaced'> | ||
980 | common/base | ||
981 | common/standard/base | ||
982 | common/standard/machine_a | ||
983 | common/standard/machine_b | ||
984 | common/standard/machine_c | ||
985 | common/small/base | ||
986 | common/small/machine_a | ||
987 | </literallayout> | ||
988 | </para> | ||
989 | |||
990 | <para> | ||
991 | This organization can help clarify the branch relationships. | ||
992 | In this case, <filename>common/standard/machine_a</filename> | ||
993 | includes everything in <filename>common/base</filename> and | ||
994 | <filename>common/standard/base</filename>. | ||
995 | The "standard" and "small" branches add sources specific to those | ||
996 | kernel types that for whatever reason are not appropriate for the | ||
997 | other branches. | ||
998 | <note>The "base" branches are an artifact of the way Git manages | ||
999 | its data internally on the filesystem: Git will not allow you | ||
1000 | to use <filename>common/standard</filename> and | ||
1001 | <filename>common/standard/machine_a</filename> because it | ||
1002 | would have to create a file and a directory named "standard". | ||
1003 | </note> | ||
1004 | </para> | ||
1005 | </section> | ||
1006 | |||
1007 | <section id='feature-branches'> | ||
1008 | <title>Feature Branches</title> | ||
1009 | |||
1010 | <para> | ||
1011 | When you are actively developing new features, it can be more | ||
1012 | efficient to work with that feature as a branch, rather than | ||
1013 | as a set of patches that have to be regularly updated. | ||
1014 | The Yocto Project Linux kernel tools provide for this with | ||
1015 | the <filename>git merge</filename> command. | ||
1016 | </para> | ||
1017 | |||
1018 | <para> | ||
1019 | To merge a feature branch into a BSP, insert the | ||
1020 | <filename>git merge</filename> command after any | ||
1021 | <filename>branch</filename> commands: | ||
1022 | <literallayout class='monospaced'> | ||
1023 | mybsp.scc: | ||
1024 | define KMACHINE mybsp | ||
1025 | define KTYPE standard | ||
1026 | define KARCH i386 | ||
1027 | include standard.scc | ||
1028 | |||
1029 | branch mynewbranch | ||
1030 | git merge myfeature | ||
1031 | |||
1032 | include mybsp-hw.scc | ||
1033 | </literallayout> | ||
1034 | </para> | ||
1035 | </section> | ||
1036 | </section> | ||
1037 | |||
1038 | <section id='scc-reference'> | ||
1039 | <title>SCC Description File Reference</title> | ||
1040 | |||
1041 | <para> | ||
1042 | This section provides a brief reference for the commands you can use | ||
1043 | within an SCC description file (<filename>.scc</filename>): | ||
1044 | <itemizedlist> | ||
1045 | <listitem><para><filename>branch [ref]</filename>: | ||
1046 | Creates a new branch relative to the current branch | ||
1047 | (typically <filename>${KTYPE}</filename>) using | ||
1048 | the currently checked-out branch, or "ref" if specified. | ||
1049 | </para></listitem> | ||
1050 | <listitem><para><filename>define</filename>: | ||
1051 | Defines variables, such as <filename>KMACHINE</filename>, | ||
1052 | <filename>KTYPE</filename>, <filename>KARCH</filename>, | ||
1053 | and <filename>KFEATURE_DESCRIPTION</filename>.</para></listitem> | ||
1054 | <listitem><para><filename>include SCC_FILE</filename>: | ||
1055 | Includes an SCC file in the current file. | ||
1056 | The file is parsed as if you had inserted it inline. | ||
1057 | </para></listitem> | ||
1058 | <listitem><para><filename>kconf [hardware|non-hardware] CFG_FILE</filename>: | ||
1059 | Queues a configuration fragment for merging into the final | ||
1060 | Linux <filename>.config</filename> file.</para></listitem> | ||
1061 | <listitem><para><filename>git merge GIT_BRANCH</filename>: | ||
1062 | Merges the feature branch into the current branch. | ||
1063 | </para></listitem> | ||
1064 | <listitem><para><filename>patch PATCH_FILE</filename>: | ||
1065 | Applies the patch to the current Git branch.</para></listitem> | ||
1066 | </itemizedlist> | ||
1067 | </para> | ||
1068 | </section> | ||
1069 | |||
1070 | </chapter> | ||
1071 | <!-- | ||
1072 | vim: expandtab tw=80 ts=4 | ||
1073 | --> | ||
diff --git a/documentation/kernel-dev/kernel-dev-common.xml b/documentation/kernel-dev/kernel-dev-common.xml new file mode 100644 index 0000000..555c8d8 --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-common.xml | |||
@@ -0,0 +1,914 @@ | |||
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 | |||
5 | <chapter id='kernel-dev-common'> | ||
6 | |||
7 | <title>Common Tasks</title> | ||
8 | |||
9 | <para> | ||
10 | This chapter presents several common tasks you perform when you | ||
11 | work with the Yocto Project Linux kernel. | ||
12 | These tasks include preparing a layer, modifying an existing recipe, | ||
13 | iterative development, working with your own sources, and incorporating | ||
14 | out-of-tree modules. | ||
15 | <note> | ||
16 | The examples presented in this chapter work with the Yocto Project | ||
17 | 1.2.2 Release and forward. | ||
18 | </note> | ||
19 | </para> | ||
20 | |||
21 | <section id='creating-and-preparing-a-layer'> | ||
22 | <title>Creating and Preparing a Layer</title> | ||
23 | |||
24 | <para> | ||
25 | If you are going to be modifying kernel recipes, it is recommended | ||
26 | that you create and prepare your own layer in which to do your | ||
27 | work. | ||
28 | Your layer contains its own | ||
29 | <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink> | ||
30 | append files | ||
31 | (<filename>.bbappend</filename>) and provides a convenient | ||
32 | mechanism to create your own recipe files | ||
33 | (<filename>.bb</filename>). | ||
34 | For details on how to create and work with layers, see the following | ||
35 | sections in the Yocto Project Development Manual: | ||
36 | <itemizedlist> | ||
37 | <listitem><para>"<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>" for | ||
38 | general information on layers and how to create layers.</para></listitem> | ||
39 | <listitem><para>"<ulink url='&YOCTO_DOCS_DEV_URL;#set-up-your-layer-for-the-build'>Set Up Your Layer for the Build</ulink>" for | ||
40 | specific instructions on setting up a layer for kernel | ||
41 | development.</para></listitem> | ||
42 | </itemizedlist> | ||
43 | </para> | ||
44 | </section> | ||
45 | |||
46 | <section id='modifying-an-existing-recipe'> | ||
47 | <title>Modifying an Existing Recipe</title> | ||
48 | |||
49 | <para> | ||
50 | In many cases, you can customize an existing linux-yocto recipe to | ||
51 | meet the needs of your project. | ||
52 | Each release of the Yocto Project provides a few Linux | ||
53 | kernel recipes from which you can choose. | ||
54 | These are located in the | ||
55 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
56 | in <filename>meta/recipes-kernel/linux</filename>. | ||
57 | </para> | ||
58 | |||
59 | <para> | ||
60 | Modifying an existing recipe can consist of the following: | ||
61 | <itemizedlist> | ||
62 | <listitem><para>Creating the append file</para></listitem> | ||
63 | <listitem><para>Applying patches</para></listitem> | ||
64 | <listitem><para>Changing the configuration</para></listitem> | ||
65 | </itemizedlist> | ||
66 | </para> | ||
67 | |||
68 | <para> | ||
69 | Before modifying an existing recipe, be sure that you have created | ||
70 | a minimal, custom layer from which you can work. | ||
71 | See the "<link linkend='creating-and-preparing-a-layer'>Creating and Preparing a Layer</link>" | ||
72 | section for some general resources. | ||
73 | You can also see the | ||
74 | "<ulink url='&YOCTO_DOCS_DEV_URL;#set-up-your-layer-for-the-build'>Set Up Your Layer for the Build</ulink>" section | ||
75 | of the Yocto Project Development Manual for a detailed | ||
76 | example. | ||
77 | </para> | ||
78 | |||
79 | <section id='creating-the-append-file'> | ||
80 | <title>Creating the Append File</title> | ||
81 | |||
82 | <para> | ||
83 | You create this file in your custom layer. | ||
84 | You also name it accordingly based on the linux-yocto recipe | ||
85 | you are using. | ||
86 | For example, if you are modifying the | ||
87 | <filename>meta/recipes-kernel/linux/linux-yocto_3.4.bb</filename> | ||
88 | recipe, the append file will typical be located as follows | ||
89 | within your custom layer: | ||
90 | <literallayout class='monospaced'> | ||
91 | <your-layer>/recipes-kernel/linux/linux-yocto_3.4.bbappend | ||
92 | </literallayout> | ||
93 | The append file should initially extend the | ||
94 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink> | ||
95 | search path by prepending the directory that contains your | ||
96 | files to the | ||
97 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink> | ||
98 | variable as follows: | ||
99 | <literallayout class='monospaced'> | ||
100 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
101 | </literallayout> | ||
102 | The path <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-THISDIR'><filename>THISDIR</filename></ulink><filename>}/${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename> | ||
103 | expands to "linux-yocto" in the current directory for this | ||
104 | example. | ||
105 | If you add any new files that modify the kernel recipe and you | ||
106 | have extended <filename>FILESPATH</filename> as | ||
107 | described above, you must place the files in your layer in the | ||
108 | following area: | ||
109 | <literallayout class='monospaced'> | ||
110 | <your-layer>/recipes-kernel/linux/linux-yocto/ | ||
111 | </literallayout> | ||
112 | <note>If you are working on a new machine Board Support Package | ||
113 | (BSP), be sure to refer to the | ||
114 | <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>. | ||
115 | </note> | ||
116 | </para> | ||
117 | </section> | ||
118 | |||
119 | <section id='applying-patches'> | ||
120 | <title>Applying Patches</title> | ||
121 | |||
122 | <para> | ||
123 | If you have a single patch or a small series of patches | ||
124 | that you want to apply to the Linux kernel source, you | ||
125 | can do so just as you would with any other recipe. | ||
126 | You first copy the patches to the path added to | ||
127 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink> | ||
128 | in your <filename>.bbappend</filename> file as described in | ||
129 | the previous section, and then reference them in | ||
130 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
131 | statements. | ||
132 | </para> | ||
133 | |||
134 | <para> | ||
135 | For example, you can apply a three-patch series by adding the | ||
136 | following lines to your linux-yocto <filename>.bbappend</filename> | ||
137 | file in your layer: | ||
138 | <literallayout class='monospaced'> | ||
139 | SRC_URI += "file://0001-first-change.patch" | ||
140 | SRC_URI += "file://0002-first-change.patch" | ||
141 | SRC_URI += "file://0003-first-change.patch" | ||
142 | </literallayout> | ||
143 | The next time you run BitBake to build the Linux kernel, BitBake | ||
144 | detects the change in the recipe and fetches and applies the patches | ||
145 | before building the kernel. | ||
146 | </para> | ||
147 | |||
148 | <para> | ||
149 | For a detailed example showing how to patch the kernel, see the | ||
150 | "<ulink url='&YOCTO_DOCS_DEV_URL;#patching-the-kernel'>Patching the Kernel</ulink>" | ||
151 | section in the Yocto Project Development Manual. | ||
152 | </para> | ||
153 | </section> | ||
154 | |||
155 | <section id='changing-the-configuration'> | ||
156 | <title>Changing the Configuration</title> | ||
157 | |||
158 | <para> | ||
159 | You can make wholesale or incremental changes to the Linux | ||
160 | kernel <filename>.config</filename> file by including a | ||
161 | <filename>defconfig</filename> and by specifying | ||
162 | configuration fragments in the | ||
163 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>. | ||
164 | </para> | ||
165 | |||
166 | <para> | ||
167 | If you have a final Linux kernel <filename>.config</filename> | ||
168 | file you want to use, copy it to a directory named | ||
169 | <filename>files</filename>, which must be in | ||
170 | your layer's <filename>recipes-kernel/linux</filename> | ||
171 | directory, and name the file "defconfig". | ||
172 | Then, add the following lines to your linux-yocto | ||
173 | <filename>.bbappend</filename> file in your layer: | ||
174 | <literallayout class='monospaced'> | ||
175 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
176 | SRC_URI += "file://defconfig" | ||
177 | </literallayout> | ||
178 | The <filename>SRC_URI</filename> tells the build system how to | ||
179 | search for the file, while the | ||
180 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink> | ||
181 | extends the | ||
182 | <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink> | ||
183 | variable (search directories) to include the | ||
184 | <filename>files</filename> directory you created for the | ||
185 | configuration changes. | ||
186 | </para> | ||
187 | |||
188 | <note> | ||
189 | The build system applies the configurations from the | ||
190 | <filename>.config</filename> file before applying any | ||
191 | subsequent configuration fragments. | ||
192 | The final kernel configuration is a combination of the | ||
193 | configurations in the <filename>.config</filename> file and | ||
194 | any configuration fragments you provide. | ||
195 | You need to realize that if you have any configuration | ||
196 | fragments, the build system applies these on top of and | ||
197 | after applying the existing <filename>.config</filename> | ||
198 | file configurations. | ||
199 | </note> | ||
200 | |||
201 | <para> | ||
202 | Generally speaking, the preferred approach is to determine the | ||
203 | incremental change you want to make and add that as a | ||
204 | configuration fragment. | ||
205 | For example, if you want to add support for a basic serial | ||
206 | console, create a file named <filename>8250.cfg</filename> in | ||
207 | the <filename>files</filename> directory with the following | ||
208 | content (without indentation): | ||
209 | <literallayout class='monospaced'> | ||
210 | CONFIG_SERIAL_8250=y | ||
211 | CONFIG_SERIAL_8250_CONSOLE=y | ||
212 | CONFIG_SERIAL_8250_PCI=y | ||
213 | CONFIG_SERIAL_8250_NR_UARTS=4 | ||
214 | CONFIG_SERIAL_8250_RUNTIME_UARTS=4 | ||
215 | CONFIG_SERIAL_CORE=y | ||
216 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
217 | </literallayout> | ||
218 | Next, include this configuration fragment and extend the | ||
219 | <filename>FILESPATH</filename> variable in your | ||
220 | <filename>.bbappend</filename> file: | ||
221 | <literallayout class='monospaced'> | ||
222 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
223 | SRC_URI += "file://8250.cfg" | ||
224 | </literallayout> | ||
225 | The next time you run BitBake to build the Linux kernel, BitBake | ||
226 | detects the change in the recipe and fetches and applies the | ||
227 | new configuration before building the kernel. | ||
228 | </para> | ||
229 | |||
230 | <para> | ||
231 | For a detailed example showing how to configure the kernel, | ||
232 | see the | ||
233 | "<ulink url='&YOCTO_DOCS_DEV_URL;#configuring-the-kernel'>Configuring the Kernel</ulink>" | ||
234 | section in the Yocto Project Development Manual. | ||
235 | </para> | ||
236 | </section> | ||
237 | </section> | ||
238 | |||
239 | <section id='using-an-iterative-development-process'> | ||
240 | <title>Using an Iterative Development Process</title> | ||
241 | |||
242 | <para> | ||
243 | If you do not have existing patches or configuration files, | ||
244 | you can iteratively generate them from within the BitBake build | ||
245 | environment as described within this section. | ||
246 | During an iterative workflow, running a previously completed BitBake | ||
247 | task causes BitBake to invalidate the tasks that follow the | ||
248 | completed task in the build sequence. | ||
249 | Invalidated tasks rebuild the next time you run the build using | ||
250 | BitBake. | ||
251 | </para> | ||
252 | |||
253 | <para> | ||
254 | As you read this section, be sure to substitute the name | ||
255 | of your Linux kernel recipe for the term | ||
256 | "linux-yocto". | ||
257 | </para> | ||
258 | |||
259 | <section id='tip-dirty-string'> | ||
260 | <title>"-dirty" String</title> | ||
261 | |||
262 | <!-- | ||
263 | <para> | ||
264 | <emphasis>AR - Darren Hart:</emphasis> This section | ||
265 | originated from the old Yocto Project Kernel Architecture | ||
266 | and Use Manual. | ||
267 | It was decided we need to put it in this section here. | ||
268 | Darren needs to figure out where we want it and what part | ||
269 | of it we want (all, revision???) | ||
270 | </para> | ||
271 | --> | ||
272 | |||
273 | <para> | ||
274 | If kernel images are being built with "-dirty" on the | ||
275 | end of the version string, this simply means that | ||
276 | modifications in the source directory have not been committed. | ||
277 | <literallayout class='monospaced'> | ||
278 | $ git status | ||
279 | </literallayout> | ||
280 | </para> | ||
281 | |||
282 | <para> | ||
283 | You can use the above Git command to report modified, | ||
284 | removed, or added files. | ||
285 | You should commit those changes to the tree regardless of | ||
286 | whether they will be saved, exported, or used. | ||
287 | Once you commit the changes, you need to rebuild the kernel. | ||
288 | </para> | ||
289 | |||
290 | <para> | ||
291 | To force a pickup and commit of all such pending changes, | ||
292 | enter the following: | ||
293 | <literallayout class='monospaced'> | ||
294 | $ git add . | ||
295 | $ git commit -s -a -m "getting rid of -dirty" | ||
296 | </literallayout> | ||
297 | </para> | ||
298 | |||
299 | <para> | ||
300 | Next, rebuild the kernel. | ||
301 | </para> | ||
302 | </section> | ||
303 | |||
304 | <section id='generating-configuration-files'> | ||
305 | <title>Generating Configuration Files</title> | ||
306 | |||
307 | <para> | ||
308 | You can manipulate the <filename>.config</filename> file | ||
309 | used to build a linux-yocto recipe with the | ||
310 | <filename>menuconfig</filename> command as follows: | ||
311 | <literallayout class='monospaced'> | ||
312 | $ bitbake linux-yocto -c menuconfig | ||
313 | </literallayout> | ||
314 | This command starts the Linux kernel configuration tool, | ||
315 | which allows you to prepare a new | ||
316 | <filename>.config</filename> file for the build. | ||
317 | When you exit the tool, be sure to save your changes | ||
318 | at the prompt. | ||
319 | </para> | ||
320 | |||
321 | <para> | ||
322 | The resulting <filename>.config</filename> file is | ||
323 | located in | ||
324 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}</filename> under the | ||
325 | <filename>linux-${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink><filename>}-${<ulink url='&YOCTO_DOCS_REF_URL;#var-KTYPE'><filename>KTYPE</filename></ulink>}-build</filename> directory. | ||
326 | You can use the entire <filename>.config</filename> file as the | ||
327 | <filename>defconfig</filename> file as described in the | ||
328 | "<link linkend='changing-the-configuration'>Changing the Configuration</link>" section. | ||
329 | </para> | ||
330 | |||
331 | <para> | ||
332 | A better method is to create a configuration fragment using the | ||
333 | differences between two configuration files: one previously | ||
334 | created and saved, and one freshly created using the | ||
335 | <filename>menuconfig</filename> tool. | ||
336 | </para> | ||
337 | |||
338 | <para> | ||
339 | To create a configuration fragment using this method, follow | ||
340 | these steps: | ||
341 | <orderedlist> | ||
342 | <listitem><para>Complete a build at least through the kernel | ||
343 | configuration task as follows: | ||
344 | <literallayout class='monospaced'> | ||
345 | $ bitbake linux-yocto -c kernel_configme -f | ||
346 | </literallayout></para></listitem> | ||
347 | <listitem><para>Run the <filename>menuconfig</filename> | ||
348 | command: | ||
349 | <literallayout class='monospaced'> | ||
350 | $ bitbake linux-yocto -c menuconfig | ||
351 | </literallayout></para></listitem> | ||
352 | <listitem><para>Run the <filename>diffconfig</filename> | ||
353 | command to prepare a configuration fragment. | ||
354 | The resulting file <filename>fragment.cfg</filename> | ||
355 | will be placed in the | ||
356 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}</filename> directory: | ||
357 | <literallayout class='monospaced'> | ||
358 | $ bitbake linux-yocto -c diffconfig | ||
359 | </literallayout></para></listitem> | ||
360 | </orderedlist> | ||
361 | </para> | ||
362 | |||
363 | <para> | ||
364 | The <filename>diffconfig</filename> command creates a file that is a | ||
365 | list of Linux kernel <filename>CONFIG_</filename> assignments. | ||
366 | See the "<link linkend='changing-the-configuration'>Changing the Configuration</link>" | ||
367 | section for information on how to use the output as a | ||
368 | configuration fragment. | ||
369 | <note> | ||
370 | You can also use this method to create configuration | ||
371 | fragments for a BSP. | ||
372 | See the "<link linkend='bsp-descriptions'>BSP Descriptions</link>" | ||
373 | section for more information. | ||
374 | </note> | ||
375 | </para> | ||
376 | |||
377 | <para> | ||
378 | The kernel tools also provide configuration validation. | ||
379 | You can use these tools to produce warnings for when a | ||
380 | requested configuration does not appear in the final | ||
381 | <filename>.config</filename> file or when you override a | ||
382 | policy configuration in a hardware configuration fragment. | ||
383 | Here is an example with some sample output of the command | ||
384 | that runs these tools: | ||
385 | <literallayout class='monospaced'> | ||
386 | $ bitbake linux-yocto -c kernel_configcheck -f | ||
387 | |||
388 | ... | ||
389 | |||
390 | NOTE: validating kernel configuration | ||
391 | This BSP sets 3 invalid/obsolete kernel options. | ||
392 | These config options are not offered anywhere within this kernel. | ||
393 | The full list can be found in your kernel src dir at: | ||
394 | meta/cfg/standard/mybsp/invalid.cfg | ||
395 | |||
396 | This BSP sets 21 kernel options that are possibly non-hardware related. | ||
397 | The full list can be found in your kernel src dir at: | ||
398 | meta/cfg/standard/mybsp/specified_non_hdw.cfg | ||
399 | |||
400 | WARNING: There were 2 hardware options requested that do not | ||
401 | have a corresponding value present in the final ".config" file. | ||
402 | This probably means you are not't getting the config you wanted. | ||
403 | The full list can be found in your kernel src dir at: | ||
404 | meta/cfg/standard/mybsp/mismatch.cfg | ||
405 | </literallayout> | ||
406 | </para> | ||
407 | |||
408 | <para> | ||
409 | The output describes the various problems that you can | ||
410 | encounter along with where to find the offending configuration | ||
411 | items. | ||
412 | You can use the information in the logs to adjust your | ||
413 | configuration files and then repeat the | ||
414 | <filename>kernel_configme</filename> and | ||
415 | <filename>kernel_configcheck</filename> commands until | ||
416 | they produce no warnings. | ||
417 | </para> | ||
418 | |||
419 | <para> | ||
420 | For more information on how to use the | ||
421 | <filename>menuconfig</filename> tool, see the | ||
422 | "<ulink url='&YOCTO_DOCS_DEV_URL;#using-menuconfig'>Using <filename>menuconfig</filename></ulink>" | ||
423 | section in the Yocto Project Development Manual. | ||
424 | </para> | ||
425 | </section> | ||
426 | |||
427 | <section id='modifying-source-code'> | ||
428 | <title>Modifying Source Code</title> | ||
429 | |||
430 | <para> | ||
431 | You can experiment with source code changes and create a | ||
432 | simple patch without leaving the BitBake environment. | ||
433 | To get started, be sure to complete a build at | ||
434 | least through the kernel configuration task: | ||
435 | <literallayout class='monospaced'> | ||
436 | $ bitbake linux-yocto -c kernel_configme -f | ||
437 | </literallayout> | ||
438 | Taking this step ensures you have the sources prepared | ||
439 | and the configuration completed. | ||
440 | You can find the sources in the | ||
441 | <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}/linux</filename> directory. | ||
442 | </para> | ||
443 | |||
444 | <para> | ||
445 | You can edit the sources as you would any other Linux source | ||
446 | tree. | ||
447 | However, keep in mind that you will lose changes if you | ||
448 | trigger the | ||
449 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink> | ||
450 | task for the recipe. | ||
451 | You can avoid triggering this task by not using BitBake to | ||
452 | run the | ||
453 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>cleanall</filename></ulink>, | ||
454 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleansstate'><filename>cleansstate</filename></ulink>, | ||
455 | or forced | ||
456 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>fetch</filename></ulink> | ||
457 | commands. | ||
458 | Also, do not modify the recipe itself while working | ||
459 | with temporary changes or BitBake might run the | ||
460 | <filename>fetch</filename> command depending on the | ||
461 | changes to the recipe. | ||
462 | </para> | ||
463 | |||
464 | <para> | ||
465 | To test your temporary changes, instruct BitBake to run the | ||
466 | <filename>compile</filename> again. | ||
467 | The <filename>-f</filename> option forces the command to run | ||
468 | even though BitBake might think it has already done so: | ||
469 | <literallayout class='monospaced'> | ||
470 | $ bitbake linux-yocto -c compile -f | ||
471 | </literallayout> | ||
472 | If the compile fails, you can update the sources and repeat | ||
473 | the <filename>compile</filename>. | ||
474 | Once compilation is successful, you can inspect and test | ||
475 | the resulting build (i.e. kernel, modules, and so forth) from | ||
476 | the <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>: | ||
477 | <literallayout class='monospaced'> | ||
478 | ${WORKDIR}/linux-${MACHINE}-${KTYPE}-build | ||
479 | </literallayout> | ||
480 | Alternatively, you can run the <filename>deploy</filename> | ||
481 | command to place the kernel image in the | ||
482 | <filename>tmp/deploy/images</filename> directory: | ||
483 | <literallayout class='monospaced'> | ||
484 | $ bitbake linux-yocto -c deploy | ||
485 | </literallayout> | ||
486 | And, of course, you can perform the remaining installation and | ||
487 | packaging steps by issuing: | ||
488 | <literallayout class='monospaced'> | ||
489 | $ bitbake linux-yocto | ||
490 | </literallayout> | ||
491 | </para> | ||
492 | |||
493 | <para> | ||
494 | For rapid iterative development, the edit-compile-repeat loop | ||
495 | described in this section is preferable to rebuilding the | ||
496 | entire recipe because the installation and packaging tasks | ||
497 | are very time consuming. | ||
498 | </para> | ||
499 | |||
500 | <para> | ||
501 | Once you are satisfied with your source code modifications, | ||
502 | you can make them permanent by generating patches and | ||
503 | applying them to the | ||
504 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
505 | statement as described in section | ||
506 | "<link linkend='applying-patches'>Applying Patches</link>" section. | ||
507 | If you are not familiar with generating patches, refer to the | ||
508 | "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-the-patch'>Creating the Patch</ulink>" | ||
509 | section in the Yocto Project Development Manual. | ||
510 | </para> | ||
511 | </section> | ||
512 | </section> | ||
513 | |||
514 | <section id='working-with-your-own-sources'> | ||
515 | <title>Working With Your Own Sources</title> | ||
516 | |||
517 | <para> | ||
518 | If you cannot work with one of the Linux kernel | ||
519 | versions supported by existing linux-yocto recipes, you can | ||
520 | still make use of the Yocto Project Linux kernel tooling by | ||
521 | working with your own sources. | ||
522 | When you use your own sources, you will not be able to | ||
523 | leverage the existing kernel | ||
524 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> and | ||
525 | stabilization work of the linux-yocto sources. | ||
526 | However, you will be able to manage your own Metadata in the same | ||
527 | format as the linux-yocto sources. | ||
528 | Maintaining format compatibility facilitates converging with | ||
529 | linux-yocto on a future, mutually-supported kernel version. | ||
530 | </para> | ||
531 | |||
532 | <para> | ||
533 | To help you use your own sources, the Yocto Project provides a | ||
534 | linux-yocto custom recipe | ||
535 | (<filename>linux-yocto-custom.bb</filename>) that uses | ||
536 | <filename>kernel.org</filename> sources | ||
537 | and the Yocto Project Linux kernel tools for managing | ||
538 | kernel Metadata. | ||
539 | You can find this recipe in the | ||
540 | <filename>poky</filename> Git repository of the | ||
541 | Yocto Project <ulink url='&YOCTO_GIT_URL;'>Source Repository</ulink> | ||
542 | at: | ||
543 | <literallayout class="monospaced"> | ||
544 | poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb | ||
545 | </literallayout> | ||
546 | </para> | ||
547 | |||
548 | <para> | ||
549 | Here are some basic steps you can use to work with your own sources: | ||
550 | <orderedlist> | ||
551 | <listitem><para>Copy the <filename>linux-yocto-custom.bb</filename> | ||
552 | recipe to your layer and give it a meaningful name. | ||
553 | The name should include the version of the Linux kernel you | ||
554 | are using (e.g. <filename>linux-yocto-myproject_3.5.bb</filename>, | ||
555 | where "3.5" is the base version of the Linux kernel | ||
556 | with which you would be working).</para></listitem> | ||
557 | <listitem><para>In the same directory inside your layer, | ||
558 | create a matching directory | ||
559 | to store your patches and configuration files (e.g. | ||
560 | <filename>linux-yocto-myproject</filename>). | ||
561 | </para></listitem> | ||
562 | <listitem><para>Edit the following variables in your recipe | ||
563 | as appropriate for your project: | ||
564 | <itemizedlist> | ||
565 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>: | ||
566 | The <filename>SRC_URI</filename> should be a Git | ||
567 | repository that uses one of the supported Git fetcher | ||
568 | protocols (i.e. <filename>file</filename>, | ||
569 | <filename>git</filename>, <filename>http</filename>, | ||
570 | and so forth). | ||
571 | The skeleton recipe provides an example | ||
572 | <filename>SRC_URI</filename> as a syntax reference. | ||
573 | </para></listitem> | ||
574 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_VERSION'><filename>LINUX_VERSION</filename></ulink>: | ||
575 | The Linux kernel version you are using (e.g. | ||
576 | "3.4").</para></listitem> | ||
577 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_VERSION_EXTENSION'><filename>LINUX_VERSION_EXTENSION</filename></ulink>: | ||
578 | The Linux kernel <filename>CONFIG_LOCALVERSION</filename> | ||
579 | that is compiled into the resulting kernel and visible | ||
580 | through the <filename>uname</filename> command. | ||
581 | </para></listitem> | ||
582 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>: | ||
583 | The commit ID from which you want to build. | ||
584 | </para></listitem> | ||
585 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>: | ||
586 | Treat this variable the same as you would in any other | ||
587 | recipe. | ||
588 | Increment the variable to indicate to the OpenEmbedded | ||
589 | build system that the recipe has changed. | ||
590 | </para></listitem> | ||
591 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>: | ||
592 | The default <filename>PV</filename> assignment is | ||
593 | typically adequate. | ||
594 | It combines the <filename>LINUX_VERSION</filename> | ||
595 | with the Source Control Manager (SCM) revision | ||
596 | as derived from the | ||
597 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCPV'><filename>SRCPV</filename></ulink> | ||
598 | variable. | ||
599 | The combined results are a string with | ||
600 | the following form: | ||
601 | <literallayout class='monospaced'> | ||
602 | 3.4.11+git1+68a635bf8dfb64b02263c1ac80c948647cc76d5f_1+218bd8d2022b9852c60d32f0d770931e3cf343e2 | ||
603 | </literallayout> | ||
604 | While lengthy, the extra verbosity in <filename>PV</filename> | ||
605 | helps ensure you are using the exact | ||
606 | sources from which you intend to build. | ||
607 | </para></listitem> | ||
608 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE'><filename>COMPATIBLE_MACHINE</filename></ulink>: | ||
609 | A list of the machines supported by your new recipe. | ||
610 | This variable in the example recipe is set | ||
611 | by default to a regular expression that matches | ||
612 | only the empty string, "(^$)". | ||
613 | This default setting triggers an explicit build | ||
614 | failure. | ||
615 | You must change it to match a list of the machines | ||
616 | that your new recipe supports. | ||
617 | For example, to support the <filename>qemux86</filename> | ||
618 | and <filename>qemux86-64</filename> machines, use | ||
619 | the following form: | ||
620 | <literallayout class='monospaced'> | ||
621 | COMPATIBLE_MACHINE = "qemux86|qemux86-64" | ||
622 | </literallayout></para></listitem> | ||
623 | </itemizedlist></para></listitem> | ||
624 | <listitem><para>Provide further customizations to your recipe | ||
625 | as needed just as you would customize an existing | ||
626 | linux-yocto recipe. | ||
627 | See the "<link linkend='modifying-an-existing-recipe'>Modifying | ||
628 | an Existing Recipe</link>" section for information. | ||
629 | </para></listitem> | ||
630 | </orderedlist> | ||
631 | </para> | ||
632 | </section> | ||
633 | |||
634 | <section id='working-with-out-of-tree-modules'> | ||
635 | <title>Working with Out-of-Tree Modules</title> | ||
636 | |||
637 | <para> | ||
638 | This section describes steps to build out-of-tree modules on | ||
639 | your target and describes how to incorporate out-of-tree modules | ||
640 | in the build. | ||
641 | </para> | ||
642 | |||
643 | <section id='building-out-of-tree-modules-on-the-target'> | ||
644 | <title>Building Out-of-Tree Modules on the Target</title> | ||
645 | |||
646 | <para> | ||
647 | If you want to be able to build out-of-tree modules on | ||
648 | the target, there are some steps you need to take | ||
649 | on the target that is running your SDK image. | ||
650 | Briefly, the <filename>kernel-dev</filename> package | ||
651 | is installed by default on all | ||
652 | <filename>*.sdk</filename> images. | ||
653 | However, you need to create some scripts prior to | ||
654 | attempting to build the out-of-tree modules on the target | ||
655 | that is running that image. | ||
656 | </para> | ||
657 | |||
658 | <para> | ||
659 | Prior to attempting to build the out-of-tree modules, | ||
660 | you need to be on the target as root and you need to | ||
661 | change to the <filename>/usr/src/kernel</filename> directory. | ||
662 | Next, <filename>make</filename> the scripts: | ||
663 | <literallayout class='monospaced'> | ||
664 | # cd /usr/src/kernel | ||
665 | # make scripts | ||
666 | </literallayout> | ||
667 | Because all SDK image recipes include | ||
668 | <filename>dev-pkgs</filename>, the | ||
669 | <filename>kernel-dev</filename> packages will be installed | ||
670 | as part of the SDK image. | ||
671 | The SDK uses the scripts when building out-of-tree | ||
672 | modules. | ||
673 | Once you have switched to that directory and created the | ||
674 | scripts, you should be able to build your out-of-tree modules | ||
675 | on the target. | ||
676 | </para> | ||
677 | </section> | ||
678 | |||
679 | <section id='incorporating-out-of-tree-modules'> | ||
680 | <title>Incorporating Out-of-Tree Modules</title> | ||
681 | |||
682 | <para> | ||
683 | While it is always preferable to work with sources integrated | ||
684 | into the Linux kernel sources, if you need an external kernel | ||
685 | module, the <filename>hello-mod.bb</filename> recipe is | ||
686 | available as a template from which you can create your | ||
687 | own out-of-tree Linux kernel module recipe. | ||
688 | </para> | ||
689 | |||
690 | <para> | ||
691 | This template recipe is located in the | ||
692 | <filename>poky</filename> Git repository of the | ||
693 | Yocto Project <ulink url='&YOCTO_GIT_URL;'>Source Repository</ulink> | ||
694 | at: | ||
695 | <literallayout class="monospaced"> | ||
696 | poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb | ||
697 | </literallayout> | ||
698 | </para> | ||
699 | |||
700 | <para> | ||
701 | To get started, copy this recipe to your layer and give it a | ||
702 | meaningful name (e.g. <filename>mymodule_1.0.bb</filename>). | ||
703 | In the same directory, create a new directory named | ||
704 | <filename>files</filename> where you can store any source files, | ||
705 | patches, or other files necessary for building | ||
706 | the module that do not come with the sources. | ||
707 | Finally, update the recipe as needed for the module. | ||
708 | Typically, you will need to set the following variables: | ||
709 | <itemizedlist> | ||
710 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-DESCRIPTION'><filename>DESCRIPTION</filename></ulink> | ||
711 | </para></listitem> | ||
712 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE'><filename>LICENSE*</filename></ulink> | ||
713 | </para></listitem> | ||
714 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> | ||
715 | </para></listitem> | ||
716 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink> | ||
717 | </para></listitem> | ||
718 | </itemizedlist> | ||
719 | </para> | ||
720 | |||
721 | <para> | ||
722 | Depending on the build system used by the module sources, | ||
723 | you might need to make some adjustments. | ||
724 | For example, a typical module <filename>Makefile</filename> | ||
725 | looks much like the one provided with the | ||
726 | <filename>hello-mod</filename> template: | ||
727 | <literallayout class='monospaced'> | ||
728 | obj-m := hello.o | ||
729 | |||
730 | SRC := $(shell pwd) | ||
731 | |||
732 | all: | ||
733 | $(MAKE) -C $(KERNEL_SRC) M=$(SRC) | ||
734 | |||
735 | modules_install: | ||
736 | $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install | ||
737 | ... | ||
738 | </literallayout> | ||
739 | </para> | ||
740 | |||
741 | <para> | ||
742 | The important point to note here is the | ||
743 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_SRC'><filename>KERNEL_SRC</filename></ulink> | ||
744 | variable. | ||
745 | The | ||
746 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-module'><filename>module</filename></ulink> | ||
747 | class sets this variable and the | ||
748 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_PATH'><filename>KERNEL_PATH</filename></ulink> | ||
749 | variable to | ||
750 | <filename>${<ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_KERNEL_DIR'><filename>STAGING_KERNEL_DIR</filename></ulink>}</filename> | ||
751 | with the necessary Linux kernel build information to build | ||
752 | modules. | ||
753 | If your module <filename>Makefile</filename> uses a different | ||
754 | variable, you might want to override the | ||
755 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-compile'><filename>do_compile()</filename></ulink> | ||
756 | step, or create a patch to | ||
757 | the <filename>Makefile</filename> to work with the more typical | ||
758 | <filename>KERNEL_SRC</filename> or | ||
759 | <filename>KERNEL_PATH</filename> variables. | ||
760 | </para> | ||
761 | |||
762 | <para> | ||
763 | After you have prepared your recipe, you will likely want to | ||
764 | include the module in your images. | ||
765 | To do this, see the documentation for the following variables in | ||
766 | the Yocto Project Reference Manual and set one of them | ||
767 | appropriately for your machine configuration file: | ||
768 | <itemizedlist> | ||
769 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS'><filename>MACHINE_ESSENTIAL_EXTRA_RDEPENDS</filename></ulink> | ||
770 | </para></listitem> | ||
771 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'><filename>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</filename></ulink> | ||
772 | </para></listitem> | ||
773 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_EXTRA_RDEPENDS'><filename>MACHINE_EXTRA_RDEPENDS</filename></ulink> | ||
774 | </para></listitem> | ||
775 | <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_EXTRA_RRECOMMENDS'><filename>MACHINE_EXTRA_RRECOMMENDS</filename></ulink> | ||
776 | </para></listitem> | ||
777 | </itemizedlist> | ||
778 | </para> | ||
779 | |||
780 | <para> | ||
781 | Modules are often not required for boot and can be excluded from | ||
782 | certain build configurations. | ||
783 | The following allows for the most flexibility: | ||
784 | <literallayout class='monospaced'> | ||
785 | MACHINE_EXTRA_RRECOMMENDS += "kernel-module-mymodule" | ||
786 | </literallayout> | ||
787 | The value is derived by appending the module filename without | ||
788 | the <filename>.ko</filename> extension to the string | ||
789 | "kernel-module-". | ||
790 | </para> | ||
791 | |||
792 | <para> | ||
793 | Because the variable is | ||
794 | <ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'><filename>RRECOMMENDS</filename></ulink> | ||
795 | and not a | ||
796 | <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink> | ||
797 | variable, the build will not fail if this module is not | ||
798 | available to include in the image. | ||
799 | </para> | ||
800 | </section> | ||
801 | </section> | ||
802 | |||
803 | |||
804 | <section id='inspecting-changes-and-commits'> | ||
805 | <title>Inspecting Changes and Commits</title> | ||
806 | |||
807 | <para> | ||
808 | A common question when working with a kernel is: | ||
809 | "What changes have been applied to this tree?" | ||
810 | Rather than using "grep" across directories to see what has | ||
811 | changed, you can use Git to inspect or search the kernel tree. | ||
812 | Using Git is an efficient way to see what has changed in the tree. | ||
813 | </para> | ||
814 | |||
815 | <section id='what-changed-in-a-kernel'> | ||
816 | <title>What Changed in a Kernel?</title> | ||
817 | |||
818 | <para> | ||
819 | Following are a few examples that show how to use Git | ||
820 | commands to examine changes. | ||
821 | These examples are by no means the only way to see changes. | ||
822 | <note> | ||
823 | In the following examples, unless you provide a commit | ||
824 | range, <filename>kernel.org</filename> history is blended | ||
825 | with Yocto Project kernel changes. | ||
826 | You can form ranges by using branch names from the | ||
827 | kernel tree as the upper and lower commit markers with | ||
828 | the Git commands. | ||
829 | You can see the branch names through the web interface | ||
830 | to the Yocto Project source repositories at | ||
831 | <ulink url='http://git.yoctoproject.org/cgit.cgi'></ulink>. | ||
832 | </note> | ||
833 | To see a full range of the changes, use the | ||
834 | <filename>git whatchanged</filename> command and specify a | ||
835 | commit range for the branch | ||
836 | (<filename><commit>..<commit></filename>). | ||
837 | </para> | ||
838 | |||
839 | <para> | ||
840 | Here is an example that looks at what has changed in the | ||
841 | <filename>emenlow</filename> branch of the | ||
842 | <filename>linux-yocto-3.4</filename> kernel. | ||
843 | The lower commit range is the commit associated with the | ||
844 | <filename>standard/base</filename> branch, while | ||
845 | the upper commit range is the commit associated with the | ||
846 | <filename>standard/emenlow</filename> branch. | ||
847 | <literallayout class='monospaced'> | ||
848 | $ git whatchanged origin/standard/base..origin/standard/emenlow | ||
849 | </literallayout> | ||
850 | </para> | ||
851 | |||
852 | <para> | ||
853 | To see short, one line summaries of changes use the | ||
854 | <filename>git log</filename> command: | ||
855 | <literallayout class='monospaced'> | ||
856 | $ git log --oneline origin/standard/base..origin/standard/emenlow | ||
857 | </literallayout> | ||
858 | </para> | ||
859 | |||
860 | <para> | ||
861 | Use this command to see code differences for the changes: | ||
862 | <literallayout class='monospaced'> | ||
863 | $ git diff origin/standard/base..origin/standard/emenlow | ||
864 | </literallayout> | ||
865 | </para> | ||
866 | |||
867 | <para> | ||
868 | Use this command to see the commit log messages and the | ||
869 | text differences: | ||
870 | <literallayout class='monospaced'> | ||
871 | $ git show origin/standard/base..origin/standard/emenlow | ||
872 | </literallayout> | ||
873 | </para> | ||
874 | |||
875 | <para> | ||
876 | Use this command to create individual patches for | ||
877 | each change. | ||
878 | Here is an example that that creates patch files for each | ||
879 | commit and places them in your <filename>Documents</filename> | ||
880 | directory: | ||
881 | <literallayout class='monospaced'> | ||
882 | $ git format-patch -o $HOME/Documents origin/standard/base..origin/standard/emenlow | ||
883 | </literallayout> | ||
884 | </para> | ||
885 | </section> | ||
886 | |||
887 | <section id='showing-a-particular-feature-or-branch-change'> | ||
888 | <title>Showing a Particular Feature or Branch Change</title> | ||
889 | |||
890 | <para> | ||
891 | Tags in the Yocto Project kernel tree divide changes for | ||
892 | significant features or branches. | ||
893 | The <filename>git show <tag></filename> command shows | ||
894 | changes based on a tag. | ||
895 | Here is an example that shows <filename>systemtap</filename> | ||
896 | changes: | ||
897 | <literallayout class='monospaced'> | ||
898 | $ git show systemtap | ||
899 | </literallayout> | ||
900 | You can use the | ||
901 | <filename>git branch --contains <tag></filename> command | ||
902 | to show the branches that contain a particular feature. | ||
903 | This command shows the branches that contain the | ||
904 | <filename>systemtap</filename> feature: | ||
905 | <literallayout class='monospaced'> | ||
906 | $ git branch --contains systemtap | ||
907 | </literallayout> | ||
908 | </para> | ||
909 | </section> | ||
910 | </section> | ||
911 | </chapter> | ||
912 | <!-- | ||
913 | vim: expandtab tw=80 ts=4 | ||
914 | --> | ||
diff --git a/documentation/kernel-dev/kernel-dev-concepts-appx.xml b/documentation/kernel-dev/kernel-dev-concepts-appx.xml new file mode 100644 index 0000000..ac91749 --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-concepts-appx.xml | |||
@@ -0,0 +1,253 @@ | |||
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 | |||
5 | <appendix id='kernel-dev-concepts-appx'> | ||
6 | <title>Advanced Kernel Concepts</title> | ||
7 | |||
8 | <section id='kernel-big-picture'> | ||
9 | <title>Yocto Project Kernel Development and Maintenance</title> | ||
10 | <para> | ||
11 | Kernels available through the Yocto Project, like other kernels, are based off the Linux | ||
12 | kernel releases from <ulink url='http://www.kernel.org'></ulink>. | ||
13 | At the beginning of a major development cycle, the Yocto Project team | ||
14 | chooses its kernel based on factors such as release timing, the anticipated release | ||
15 | timing of final upstream <filename>kernel.org</filename> versions, and Yocto Project | ||
16 | feature requirements. | ||
17 | Typically, the kernel chosen is in the | ||
18 | final stages of development by the community. | ||
19 | In other words, the kernel is in the release | ||
20 | candidate or "rc" phase and not yet a final release. | ||
21 | But, by being in the final stages of external development, the team knows that the | ||
22 | <filename>kernel.org</filename> final release will clearly be within the early stages of | ||
23 | the Yocto Project development window. | ||
24 | </para> | ||
25 | <para> | ||
26 | This balance allows the team to deliver the most up-to-date kernel | ||
27 | possible, while still ensuring that the team has a stable official release for | ||
28 | the baseline Linux kernel version. | ||
29 | </para> | ||
30 | <para> | ||
31 | The ultimate source for kernels available through the Yocto Project are released kernels | ||
32 | from <filename>kernel.org</filename>. | ||
33 | In addition to a foundational kernel from <filename>kernel.org</filename>, the | ||
34 | kernels available contain a mix of important new mainline | ||
35 | developments, non-mainline developments (when there is no alternative), | ||
36 | Board Support Package (BSP) developments, | ||
37 | and custom features. | ||
38 | These additions result in a commercially released Yocto Project Linux kernel that caters | ||
39 | to specific embedded designer needs for targeted hardware. | ||
40 | </para> | ||
41 | <para> | ||
42 | Once a kernel is officially released, the Yocto Project team goes into | ||
43 | their next development cycle, or upward revision (uprev) cycle, while still | ||
44 | continuing maintenance on the released kernel. | ||
45 | It is important to note that the most sustainable and stable way | ||
46 | to include feature development upstream is through a kernel uprev process. | ||
47 | Back-porting hundreds of individual fixes and minor features from various | ||
48 | kernel versions is not sustainable and can easily compromise quality. | ||
49 | </para> | ||
50 | <para> | ||
51 | During the uprev cycle, the Yocto Project team uses an ongoing analysis of | ||
52 | kernel development, BSP support, and release timing to select the best | ||
53 | possible <filename>kernel.org</filename> version. | ||
54 | The team continually monitors community kernel | ||
55 | development to look for significant features of interest. | ||
56 | The team does consider back-porting large features if they have a significant advantage. | ||
57 | User or community demand can also trigger a back-port or creation of new | ||
58 | functionality in the Yocto Project baseline kernel during the uprev cycle. | ||
59 | </para> | ||
60 | <para> | ||
61 | Generally speaking, every new kernel both adds features and introduces new bugs. | ||
62 | These consequences are the basic properties of upstream kernel development and are | ||
63 | managed by the Yocto Project team's kernel strategy. | ||
64 | It is the Yocto Project team's policy to not back-port minor features to the released kernel. | ||
65 | They only consider back-porting significant technological jumps - and, that is done | ||
66 | after a complete gap analysis. | ||
67 | The reason for this policy is that back-porting any small to medium sized change | ||
68 | from an evolving kernel can easily create mismatches, incompatibilities and very | ||
69 | subtle errors. | ||
70 | </para> | ||
71 | <para> | ||
72 | These policies result in both a stable and a cutting | ||
73 | edge kernel that mixes forward ports of existing features and significant and critical | ||
74 | new functionality. | ||
75 | Forward porting functionality in the kernels available through the Yocto Project kernel | ||
76 | can be thought of as a "micro uprev." | ||
77 | The many “micro uprevs” produce a kernel version with a mix of | ||
78 | important new mainline, non-mainline, BSP developments and feature integrations. | ||
79 | This kernel gives insight into new features and allows focused | ||
80 | amounts of testing to be done on the kernel, which prevents | ||
81 | surprises when selecting the next major uprev. | ||
82 | The quality of these cutting edge kernels is evolving and the kernels are used in leading edge | ||
83 | feature and BSP development. | ||
84 | </para> | ||
85 | </section> | ||
86 | |||
87 | <section id='kernel-architecture'> | ||
88 | <title>Kernel Architecture</title> | ||
89 | <para> | ||
90 | This section describes the architecture of the kernels available through the | ||
91 | Yocto Project and provides information | ||
92 | on the mechanisms used to achieve that architecture. | ||
93 | </para> | ||
94 | |||
95 | <section id='architecture-overview'> | ||
96 | <title>Overview</title> | ||
97 | <para> | ||
98 | As mentioned earlier, a key goal of the Yocto Project is to present the | ||
99 | developer with | ||
100 | a kernel that has a clear and continuous history that is visible to the user. | ||
101 | The architecture and mechanisms used achieve that goal in a manner similar to the | ||
102 | upstream <filename>kernel.org</filename>. | ||
103 | </para> | ||
104 | <para> | ||
105 | You can think of a Yocto Project kernel as consisting of a baseline Linux kernel with | ||
106 | added features logically structured on top of the baseline. | ||
107 | The features are tagged and organized by way of a branching strategy implemented by the | ||
108 | source code manager (SCM) Git. | ||
109 | For information on Git as applied to the Yocto Project, see the | ||
110 | "<ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink>" section in the | ||
111 | Yocto Project Development Manual. | ||
112 | </para> | ||
113 | <para> | ||
114 | The result is that the user has the ability to see the added features and | ||
115 | the commits that make up those features. | ||
116 | In addition to being able to see added features, the user can also view the history of what | ||
117 | made up the baseline kernel. | ||
118 | </para> | ||
119 | <para> | ||
120 | The following illustration shows the conceptual Yocto Project kernel. | ||
121 | </para> | ||
122 | <para> | ||
123 | <imagedata fileref="figures/kernel-architecture-overview.png" width="6in" depth="7in" align="center" scale="100" /> | ||
124 | </para> | ||
125 | <para> | ||
126 | In the illustration, the "Kernel.org Branch Point" | ||
127 | marks the specific spot (or release) from | ||
128 | which the Yocto Project kernel is created. | ||
129 | From this point "up" in the tree, features and differences are organized and tagged. | ||
130 | </para> | ||
131 | <para> | ||
132 | The "Yocto Project Baseline Kernel" contains functionality that is common to every kernel | ||
133 | type and BSP that is organized further up the tree. | ||
134 | Placing these common features in the | ||
135 | tree this way means features do not have to be duplicated along individual branches of the | ||
136 | structure. | ||
137 | </para> | ||
138 | <para> | ||
139 | From the Yocto Project Baseline Kernel, branch points represent specific functionality | ||
140 | for individual BSPs as well as real-time kernels. | ||
141 | The illustration represents this through three BSP-specific branches and a real-time | ||
142 | kernel branch. | ||
143 | Each branch represents some unique functionality for the BSP or a real-time kernel. | ||
144 | </para> | ||
145 | <para> | ||
146 | In this example structure, the real-time kernel branch has common features for all | ||
147 | real-time kernels and contains | ||
148 | more branches for individual BSP-specific real-time kernels. | ||
149 | The illustration shows three branches as an example. | ||
150 | Each branch points the way to specific, unique features for a respective real-time | ||
151 | kernel as they apply to a given BSP. | ||
152 | </para> | ||
153 | <para> | ||
154 | The resulting tree structure presents a clear path of markers (or branches) to the | ||
155 | developer that, for all practical purposes, is the kernel needed for any given set | ||
156 | of requirements. | ||
157 | </para> | ||
158 | </section> | ||
159 | |||
160 | <section id='branching-and-workflow'> | ||
161 | <title>Branching Strategy and Workflow</title> | ||
162 | <para> | ||
163 | The Yocto Project team creates kernel branches at points where functionality is | ||
164 | no longer shared and thus, needs to be isolated. | ||
165 | For example, board-specific incompatibilities would require different functionality | ||
166 | and would require a branch to separate the features. | ||
167 | Likewise, for specific kernel features, the same branching strategy is used. | ||
168 | </para> | ||
169 | <para> | ||
170 | This branching strategy results in a tree that has features organized to be specific | ||
171 | for particular functionality, single kernel types, or a subset of kernel types. | ||
172 | This strategy also results in not having to store the same feature twice | ||
173 | internally in the tree. | ||
174 | Rather, the kernel team stores the unique differences required to apply the | ||
175 | feature onto the kernel type in question. | ||
176 | <note> | ||
177 | The Yocto Project team strives to place features in the tree such that they can be | ||
178 | shared by all boards and kernel types where possible. | ||
179 | However, during development cycles or when large features are merged, | ||
180 | the team cannot always follow this practice. | ||
181 | In those cases, the team uses isolated branches to merge features. | ||
182 | </note> | ||
183 | </para> | ||
184 | <para> | ||
185 | BSP-specific code additions are handled in a similar manner to kernel-specific additions. | ||
186 | Some BSPs only make sense given certain kernel types. | ||
187 | So, for these types, the team creates branches off the end of that kernel type for all | ||
188 | of the BSPs that are supported on that kernel type. | ||
189 | From the perspective of the tools that create the BSP branch, the BSP is really no | ||
190 | different than a feature. | ||
191 | Consequently, the same branching strategy applies to BSPs as it does to features. | ||
192 | So again, rather than store the BSP twice, the team only stores the unique | ||
193 | differences for the BSP across the supported multiple kernels. | ||
194 | </para> | ||
195 | <para> | ||
196 | While this strategy can result in a tree with a significant number of branches, it is | ||
197 | important to realize that from the developer's point of view, there is a linear | ||
198 | path that travels from the baseline <filename>kernel.org</filename>, through a select | ||
199 | group of features and ends with their BSP-specific commits. | ||
200 | In other words, the divisions of the kernel are transparent and are not relevant | ||
201 | to the developer on a day-to-day basis. | ||
202 | From the developer's perspective, this path is the "master" branch. | ||
203 | The developer does not need to be aware of the existence of any other branches at all. | ||
204 | Of course, there is value in the existence of these branches | ||
205 | in the tree, should a person decide to explore them. | ||
206 | For example, a comparison between two BSPs at either the commit level or at the line-by-line | ||
207 | code <filename>diff</filename> level is now a trivial operation. | ||
208 | </para> | ||
209 | <para> | ||
210 | Working with the kernel as a structured tree follows recognized community best practices. | ||
211 | In particular, the kernel as shipped with the product, should be | ||
212 | considered an "upstream source" and viewed as a series of | ||
213 | historical and documented modifications (commits). | ||
214 | These modifications represent the development and stabilization done | ||
215 | by the Yocto Project kernel development team. | ||
216 | </para> | ||
217 | <para> | ||
218 | Because commits only change at significant release points in the product life cycle, | ||
219 | developers can work on a branch created | ||
220 | from the last relevant commit in the shipped Yocto Project kernel. | ||
221 | As mentioned previously, the structure is transparent to the developer | ||
222 | because the kernel tree is left in this state after cloning and building the kernel. | ||
223 | </para> | ||
224 | </section> | ||
225 | |||
226 | <section id='source-code-manager-git'> | ||
227 | <title>Source Code Manager - Git</title> | ||
228 | <para> | ||
229 | The Source Code Manager (SCM) is Git. | ||
230 | This SCM is the obvious mechanism for meeting the previously mentioned goals. | ||
231 | Not only is it the SCM for <filename>kernel.org</filename> but, | ||
232 | Git continues to grow in popularity and supports many different work flows, | ||
233 | front-ends and management techniques. | ||
234 | </para> | ||
235 | <para> | ||
236 | You can find documentation on Git at <ulink url='http://git-scm.com/documentation'></ulink>. | ||
237 | You can also get an introduction to Git as it applies to the Yocto Project in the | ||
238 | "<ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink>" | ||
239 | section in the Yocto Project Development Manual. | ||
240 | These referenced sections overview Git and describe a minimal set of | ||
241 | commands that allows you to be functional using Git. | ||
242 | <note> | ||
243 | You can use as much, or as little, of what Git has to offer to accomplish what | ||
244 | you need for your project. | ||
245 | You do not have to be a "Git Master" in order to use it with the Yocto Project. | ||
246 | </note> | ||
247 | </para> | ||
248 | </section> | ||
249 | </section> | ||
250 | </appendix> | ||
251 | <!-- | ||
252 | vim: expandtab tw=80 ts=4 | ||
253 | --> | ||
diff --git a/documentation/kernel-dev/kernel-dev-customization.xsl b/documentation/kernel-dev/kernel-dev-customization.xsl new file mode 100644 index 0000000..bd81da5 --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-customization.xsl | |||
@@ -0,0 +1,18 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> | ||
3 | |||
4 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" /> | ||
5 | |||
6 | <xsl:include href="../template/permalinks.xsl"/> | ||
7 | <xsl:include href="../template/section.title.xsl"/> | ||
8 | <xsl:include href="../template/component.title.xsl"/> | ||
9 | <xsl:include href="../template/division.title.xsl"/> | ||
10 | <xsl:include href="../template/formal.object.heading.xsl"/> | ||
11 | |||
12 | <xsl:param name="html.stylesheet" select="'kernel-dev-style.css'" /> | ||
13 | <xsl:param name="chapter.autolabel" select="1" /> | ||
14 | <xsl:param name="appendix.autolabel">A</xsl:param> | ||
15 | <xsl:param name="section.autolabel" select="1" /> | ||
16 | <xsl:param name="section.label.includes.component.label" select="1" /> | ||
17 | |||
18 | </xsl:stylesheet> | ||
diff --git a/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl b/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl new file mode 100644 index 0000000..7d1bb8d --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl | |||
@@ -0,0 +1,27 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet | ||
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
4 | xmlns="http://www.w3.org/1999/xhtml" | ||
5 | xmlns:fo="http://www.w3.org/1999/XSL/Format" | ||
6 | version="1.0"> | ||
7 | |||
8 | <xsl:import | ||
9 | href="http://docbook.sourceforge.net/release/xsl/current/eclipse/eclipse3.xsl" /> | ||
10 | |||
11 | <xsl:param name="chunker.output.indent" select="'yes'"/> | ||
12 | <xsl:param name="chunk.quietly" select="1"/> | ||
13 | <xsl:param name="chunk.first.sections" select="1"/> | ||
14 | <xsl:param name="chunk.section.depth" select="10"/> | ||
15 | <xsl:param name="use.id.as.filename" select="1"/> | ||
16 | <xsl:param name="ulink.target" select="'_self'" /> | ||
17 | <xsl:param name="base.dir" select="'html/kernel-dev/'"/> | ||
18 | <xsl:param name="html.stylesheet" select="'../book.css'"/> | ||
19 | <xsl:param name="eclipse.manifest" select="0"/> | ||
20 | <xsl:param name="create.plugin.xml" select="0"/> | ||
21 | <xsl:param name="suppress.navigation" select="1"/> | ||
22 | <xsl:param name="generate.index" select="0"/> | ||
23 | <xsl:param name="chapter.autolabel" select="1" /> | ||
24 | <xsl:param name="appendix.autolabel">A</xsl:param> | ||
25 | <xsl:param name="section.autolabel" select="1" /> | ||
26 | <xsl:param name="section.label.includes.component.label" select="1" /> | ||
27 | </xsl:stylesheet> | ||
diff --git a/documentation/kernel-dev/kernel-dev-examples.xml b/documentation/kernel-dev/kernel-dev-examples.xml new file mode 100644 index 0000000..9d9aef6 --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-examples.xml | |||
@@ -0,0 +1,918 @@ | |||
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 | |||
5 | <chapter id='kernel-how-to'> | ||
6 | |||
7 | <title>Working with the Yocto Project Kernel</title> | ||
8 | |||
9 | |||
10 | <section id='actions-org'> | ||
11 | <title>Introduction</title> | ||
12 | <para> | ||
13 | This chapter describes how to accomplish tasks involving a kernel's tree structure. | ||
14 | The information is designed to help the developer that wants to modify the Yocto | ||
15 | Project kernel and contribute changes upstream to the Yocto Project. | ||
16 | The information covers the following: | ||
17 | <itemizedlist> | ||
18 | <listitem><para>Tree construction</para></listitem> | ||
19 | <listitem><para>Build strategies</para></listitem> | ||
20 | <listitem><para>Workflow examples</para></listitem> | ||
21 | </itemizedlist> | ||
22 | </para> | ||
23 | </section> | ||
24 | |||
25 | <section id='tree-construction'> | ||
26 | <title>Tree Construction</title> | ||
27 | <para> | ||
28 | This section describes construction of the Yocto Project kernel source repositories | ||
29 | as accomplished by the Yocto Project team to create kernel repositories. | ||
30 | These kernel repositories are found under the heading "Yocto Linux Kernel" at | ||
31 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi'>&YOCTO_GIT_URL;/cgit.cgi</ulink> | ||
32 | and can be shipped as part of a Yocto Project release. | ||
33 | The team creates these repositories by | ||
34 | compiling and executing the set of feature descriptions for every BSP/feature | ||
35 | in the product. | ||
36 | Those feature descriptions list all necessary patches, | ||
37 | configuration, branching, tagging and feature divisions found in a kernel. | ||
38 | Thus, the Yocto Project kernel repository (or tree) is built. | ||
39 | </para> | ||
40 | <para> | ||
41 | The existence of this tree allows you to access and clone a particular | ||
42 | Yocto Project kernel repository and use it to build images based on their configurations | ||
43 | and features. | ||
44 | </para> | ||
45 | <para> | ||
46 | You can find the files used to describe all the valid features and BSPs | ||
47 | in the Yocto Project kernel in any clone of the Yocto Project kernel source repository | ||
48 | Git tree. | ||
49 | For example, the following command clones the Yocto Project baseline kernel that | ||
50 | branched off of <filename>linux.org</filename> version 3.4: | ||
51 | <literallayout class='monospaced'> | ||
52 | $ git clone git://git.yoctoproject.org/linux-yocto-3.4 | ||
53 | </literallayout> | ||
54 | For another example of how to set up a local Git repository of the Yocto Project | ||
55 | kernel files, see the | ||
56 | "<ulink url='&YOCTO_DOCS_DEV_URL;#local-kernel-files'>Yocto Project Kernel</ulink>" bulleted | ||
57 | item in the Yocto Project Development Manual. | ||
58 | </para> | ||
59 | <para> | ||
60 | Once you have cloned the kernel Git repository on your local machine, you can | ||
61 | switch to the <filename>meta</filename> branch within the repository. | ||
62 | Here is an example that assumes the local Git repository for the kernel is in | ||
63 | a top-level directory named <filename>linux-yocto-3.4</filename>: | ||
64 | <literallayout class='monospaced'> | ||
65 | $ cd ~/linux-yocto-3.4 | ||
66 | $ git checkout -b meta origin/meta | ||
67 | </literallayout> | ||
68 | Once you have checked out and switched to the <filename>meta</filename> branch, | ||
69 | you can see a snapshot of all the kernel configuration and feature descriptions that are | ||
70 | used to build that particular kernel repository. | ||
71 | These descriptions are in the form of <filename>.scc</filename> files. | ||
72 | </para> | ||
73 | <para> | ||
74 | You should realize, however, that browsing your local kernel repository | ||
75 | for feature descriptions and patches is not an effective way to determine what is in a | ||
76 | particular kernel branch. | ||
77 | Instead, you should use Git directly to discover the changes in a branch. | ||
78 | Using Git is an efficient and flexible way to inspect changes to the kernel. | ||
79 | For examples showing how to use Git to inspect kernel commits, see the following sections | ||
80 | in this chapter. | ||
81 | <note> | ||
82 | Ground up reconstruction of the complete kernel tree is an action only taken by the | ||
83 | Yocto Project team during an active development cycle. | ||
84 | When you create a clone of the kernel Git repository, you are simply making it | ||
85 | efficiently available for building and development. | ||
86 | </note> | ||
87 | </para> | ||
88 | <para> | ||
89 | The following steps describe what happens when the Yocto Project Team constructs | ||
90 | the Yocto Project kernel source Git repository (or tree) found at | ||
91 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink> given the | ||
92 | introduction of a new top-level kernel feature or BSP. | ||
93 | These are the actions that effectively create the tree | ||
94 | that includes the new feature, patch or BSP: | ||
95 | <orderedlist> | ||
96 | <listitem><para>A top-level kernel feature is passed to the kernel build subsystem. | ||
97 | Normally, this feature is a BSP for a particular kernel type.</para></listitem> | ||
98 | <listitem><para>The file that describes the top-level feature is located by searching | ||
99 | these system directories: | ||
100 | <itemizedlist> | ||
101 | <listitem><para>The in-tree kernel-cache directories, which are located | ||
102 | in <filename>meta/cfg/kernel-cache</filename></para></listitem> | ||
103 | <listitem><para>Areas pointed to by <filename>SRC_URI</filename> statements | ||
104 | found in recipes</para></listitem> | ||
105 | </itemizedlist> | ||
106 | For a typical build, the target of the search is a | ||
107 | feature description in an <filename>.scc</filename> file | ||
108 | whose name follows this format: | ||
109 | <literallayout class='monospaced'> | ||
110 | <bsp_name>-<kernel_type>.scc | ||
111 | </literallayout> | ||
112 | </para></listitem> | ||
113 | <listitem><para>Once located, the feature description is either compiled into a simple script | ||
114 | of actions, or into an existing equivalent script that is already part of the | ||
115 | shipped kernel.</para></listitem> | ||
116 | <listitem><para>Extra features are appended to the top-level feature description. | ||
117 | These features can come from the | ||
118 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'><filename>KERNEL_FEATURES</filename></ulink> | ||
119 | variable in recipes.</para></listitem> | ||
120 | <listitem><para>Each extra feature is located, compiled and appended to the script | ||
121 | as described in step three.</para></listitem> | ||
122 | <listitem><para>The script is executed to produce a series of <filename>meta-*</filename> | ||
123 | directories. | ||
124 | These directories are descriptions of all the branches, tags, patches and configurations that | ||
125 | need to be applied to the base Git repository to completely create the | ||
126 | source (build) branch for the new BSP or feature.</para></listitem> | ||
127 | <listitem><para>The base repository is cloned, and the actions | ||
128 | listed in the <filename>meta-*</filename> directories are applied to the | ||
129 | tree.</para></listitem> | ||
130 | <listitem><para>The Git repository is left with the desired branch checked out and any | ||
131 | required branching, patching and tagging has been performed.</para></listitem> | ||
132 | </orderedlist> | ||
133 | </para> | ||
134 | <para> | ||
135 | The kernel tree is now ready for developer consumption to be locally cloned, | ||
136 | configured, and built into a Yocto Project kernel specific to some target hardware. | ||
137 | <note><para>The generated <filename>meta-*</filename> directories add to the kernel | ||
138 | as shipped with the Yocto Project release. | ||
139 | Any add-ons and configuration data are applied to the end of an existing branch. | ||
140 | The full repository generation that is found in the | ||
141 | official Yocto Project kernel repositories at | ||
142 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi'>http://git.yoctoproject.org/cgit.cgi</ulink> | ||
143 | is the combination of all supported boards and configurations.</para> | ||
144 | <para>The technique the Yocto Project team uses is flexible and allows for seamless | ||
145 | blending of an immutable history with additional patches specific to a | ||
146 | deployment. | ||
147 | Any additions to the kernel become an integrated part of the branches.</para> | ||
148 | </note> | ||
149 | </para> | ||
150 | </section> | ||
151 | |||
152 | <section id='build-strategy'> | ||
153 | <title>Build Strategy</title> | ||
154 | <para> | ||
155 | Once a local Git repository of the Yocto Project kernel exists on a development system, | ||
156 | you can consider the compilation phase of kernel development - building a kernel image. | ||
157 | Some prerequisites exist that are validated by the build process before compilation | ||
158 | starts: | ||
159 | </para> | ||
160 | |||
161 | <itemizedlist> | ||
162 | <listitem><para>The | ||
163 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> points | ||
164 | to the kernel Git repository.</para></listitem> | ||
165 | <listitem><para>A BSP build branch exists. | ||
166 | This branch has the following form: | ||
167 | <literallayout class='monospaced'> | ||
168 | <kernel_type>/<bsp_name> | ||
169 | </literallayout></para></listitem> | ||
170 | </itemizedlist> | ||
171 | |||
172 | <para> | ||
173 | The OpenEmbedded build system makes sure these conditions exist before attempting compilation. | ||
174 | Other means, however, do exist, such as as bootstrapping a BSP, see | ||
175 | the "<link linkend='workflow-examples'>Workflow Examples</link>". | ||
176 | </para> | ||
177 | |||
178 | <para> | ||
179 | Before building a kernel, the build process verifies the tree | ||
180 | and configures the kernel by processing all of the | ||
181 | configuration "fragments" specified by feature descriptions in the <filename>.scc</filename> | ||
182 | files. | ||
183 | As the features are compiled, associated kernel configuration fragments are noted | ||
184 | and recorded in the <filename>meta-*</filename> series of directories in their compilation order. | ||
185 | The fragments are migrated, pre-processed and passed to the Linux Kernel | ||
186 | Configuration subsystem (<filename>lkc</filename>) as raw input in the form | ||
187 | of a <filename>.config</filename> file. | ||
188 | The <filename>lkc</filename> uses its own internal dependency constraints to do the final | ||
189 | processing of that information and generates the final <filename>.config</filename> file | ||
190 | that is used during compilation. | ||
191 | </para> | ||
192 | |||
193 | <para> | ||
194 | Using the board's architecture and other relevant values from the board's template, | ||
195 | kernel compilation is started and a kernel image is produced. | ||
196 | </para> | ||
197 | |||
198 | <para> | ||
199 | The other thing that you notice once you configure a kernel is that | ||
200 | the build process generates a build tree that is separate from your kernel's local Git | ||
201 | source repository tree. | ||
202 | This build tree has a name that uses the following form, where | ||
203 | <filename>${MACHINE}</filename> is the metadata name of the machine (BSP) and "kernel_type" is one | ||
204 | of the Yocto Project supported kernel types (e.g. "standard"): | ||
205 | <literallayout class='monospaced'> | ||
206 | linux-${MACHINE}-<kernel_type>-build | ||
207 | </literallayout> | ||
208 | </para> | ||
209 | |||
210 | <para> | ||
211 | The existing support in the <filename>kernel.org</filename> tree achieves this | ||
212 | default functionality. | ||
213 | </para> | ||
214 | |||
215 | <para> | ||
216 | This behavior means that all the generated files for a particular machine or BSP are now in | ||
217 | the build tree directory. | ||
218 | The files include the final <filename>.config</filename> file, all the <filename>.o</filename> | ||
219 | files, the <filename>.a</filename> files, and so forth. | ||
220 | Since each machine or BSP has its own separate build directory in its own separate branch | ||
221 | of the Git repository, you can easily switch between different builds. | ||
222 | </para> | ||
223 | </section> | ||
224 | |||
225 | <section id='workflow-examples'> | ||
226 | <title>Workflow Examples</title> | ||
227 | |||
228 | <para> | ||
229 | As previously noted, the Yocto Project kernel has built-in Git integration. | ||
230 | However, these utilities are not the only way to work with the kernel repository. | ||
231 | The Yocto Project has not made changes to Git or to other tools that | ||
232 | would invalidate alternate workflows. | ||
233 | Additionally, the way the kernel repository is constructed results in using | ||
234 | only core Git functionality, thus allowing any number of tools or front ends to use the | ||
235 | resulting tree. | ||
236 | </para> | ||
237 | |||
238 | <para> | ||
239 | This section contains several workflow examples. | ||
240 | Many of the examples use Git commands. | ||
241 | You can find Git documentation at | ||
242 | <ulink url='http://git-scm.com/documentation'></ulink>. | ||
243 | You can find a simple overview of using Git with the Yocto Project in the | ||
244 | "<ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink>" | ||
245 | section of the Yocto Project Development Manual. | ||
246 | </para> | ||
247 | |||
248 | <section id='change-inspection-kernel-changes-commits'> | ||
249 | <title>Change Inspection: Changes/Commits</title> | ||
250 | |||
251 | <para> | ||
252 | A common question when working with a kernel is: | ||
253 | "What changes have been applied to this tree?" | ||
254 | </para> | ||
255 | |||
256 | <para> | ||
257 | In projects that have a collection of directories that | ||
258 | contain patches to the kernel, it is possible to inspect or "grep" the contents | ||
259 | of the directories to get a general feel for the changes. | ||
260 | This sort of patch inspection is not an efficient way to determine what has been | ||
261 | done to the kernel. | ||
262 | The reason it is inefficient is because there are many optional patches that are | ||
263 | selected based on the kernel type and the feature description. | ||
264 | Additionally, patches could exist in directories that are not included in the search. | ||
265 | </para> | ||
266 | |||
267 | <para> | ||
268 | A more efficient way to determine what has changed in the branch is to use | ||
269 | Git and inspect or search the kernel tree. | ||
270 | This method gives you a full view of not only the source code modifications, | ||
271 | but also provides the reasons for the changes. | ||
272 | </para> | ||
273 | |||
274 | <section id='what-changed-in-a-kernel'> | ||
275 | <title>What Changed in a Kernel?</title> | ||
276 | |||
277 | <para> | ||
278 | Following are a few examples that show how to use Git commands to examine changes. | ||
279 | Because Git repositories in the Yocto Project do not break existing Git | ||
280 | functionality, and because there exists many permutations of these types of | ||
281 | Git commands, many methods exist by which you can discover changes. | ||
282 | <note> | ||
283 | In the following examples, unless you provide a commit range, | ||
284 | <filename>kernel.org</filename> history is blended with Yocto Project | ||
285 | kernel changes. | ||
286 | You can form ranges by using branch names from the kernel tree as the | ||
287 | upper and lower commit markers with the Git commands. | ||
288 | You can see the branch names through the web interface to the | ||
289 | Yocto Project source repositories at | ||
290 | <ulink url='http://git.yoctoproject.org/cgit.cgi'></ulink>. | ||
291 | For example, the branch names for the <filename>linux-yocto-3.4</filename> | ||
292 | kernel repository can be seen at | ||
293 | <ulink url='http://git.yoctoproject.org/cgit.cgi/linux-yocto-3.4/refs/heads'></ulink>. | ||
294 | </note> | ||
295 | To see a full range of the changes, use the | ||
296 | <filename>git whatchanged</filename> command and specify a commit range | ||
297 | for the branch (<filename><commit>..<commit></filename>). | ||
298 | </para> | ||
299 | |||
300 | <para> | ||
301 | Here is an example that looks at what has changed in the | ||
302 | <filename>emenlow</filename> branch of the | ||
303 | <filename>linux-yocto-3.4</filename> kernel. | ||
304 | The lower commit range is the commit associated with the | ||
305 | <filename>standard/base</filename> branch, while | ||
306 | the upper commit range is the commit associated with the | ||
307 | <filename>standard/emenlow</filename> branch. | ||
308 | <literallayout class='monospaced'> | ||
309 | $ git whatchanged origin/standard/base..origin/standard/emenlow | ||
310 | </literallayout> | ||
311 | </para> | ||
312 | |||
313 | <para> | ||
314 | To see a summary of changes use the <filename>git log</filename> command. | ||
315 | Here is an example using the same branches: | ||
316 | <literallayout class='monospaced'> | ||
317 | $ git log --oneline origin/standard/base..origin/standard/emenlow | ||
318 | </literallayout> | ||
319 | The <filename>git log</filename> output might be more useful than | ||
320 | the <filename>git whatchanged</filename> as you get | ||
321 | a short, one-line summary of each change and not the entire commit. | ||
322 | </para> | ||
323 | |||
324 | <para> | ||
325 | If you want to see code differences associated with all the changes, use | ||
326 | the <filename>git diff</filename> command. | ||
327 | Here is an example: | ||
328 | <literallayout class='monospaced'> | ||
329 | $ git diff origin/standard/base..origin/standard/emenlow | ||
330 | </literallayout> | ||
331 | </para> | ||
332 | |||
333 | <para> | ||
334 | You can see the commit log messages and the text differences using the | ||
335 | <filename>git show</filename> command: | ||
336 | Here is an example: | ||
337 | <literallayout class='monospaced'> | ||
338 | $ git show origin/standard/base..origin/standard/emenlow | ||
339 | </literallayout> | ||
340 | </para> | ||
341 | |||
342 | <para> | ||
343 | You can create individual patches for each change by using the | ||
344 | <filename>git format-patch</filename> command. | ||
345 | Here is an example that that creates patch files for each commit and | ||
346 | places them in your <filename>Documents</filename> directory: | ||
347 | <literallayout class='monospaced'> | ||
348 | $ git format-patch -o $HOME/Documents origin/standard/base..origin/standard/emenlow | ||
349 | </literallayout> | ||
350 | </para> | ||
351 | </section> | ||
352 | |||
353 | <section id='show-a-particular-feature-or-branch-change'> | ||
354 | <title>Show a Particular Feature or Branch Change</title> | ||
355 | |||
356 | <para> | ||
357 | Developers use tags in the Yocto Project kernel tree to divide changes for significant | ||
358 | features or branches. | ||
359 | Once you know a particular tag, you can use Git commands | ||
360 | to show changes associated with the tag and find the branches that contain | ||
361 | the feature. | ||
362 | <note> | ||
363 | Because BSP branch, <filename>kernel.org</filename>, and feature tags are all | ||
364 | present, there could be many tags. | ||
365 | </note> | ||
366 | The <filename>git show <tag></filename> command shows changes that are tagged by | ||
367 | a feature. | ||
368 | Here is an example that shows changes tagged by the <filename>systemtap</filename> | ||
369 | feature: | ||
370 | <literallayout class='monospaced'> | ||
371 | $ git show systemtap | ||
372 | </literallayout> | ||
373 | You can use the <filename>git branch --contains <tag></filename> command | ||
374 | to show the branches that contain a particular feature. | ||
375 | This command shows the branches that contain the <filename>systemtap</filename> | ||
376 | feature: | ||
377 | <literallayout class='monospaced'> | ||
378 | $ git branch --contains systemtap | ||
379 | </literallayout> | ||
380 | </para> | ||
381 | |||
382 | <para> | ||
383 | You can use many other comparisons to isolate BSP and kernel changes. | ||
384 | For example, you can compare against <filename>kernel.org</filename> tags | ||
385 | such as the <filename>v3.4</filename> tag. | ||
386 | </para> | ||
387 | </section> | ||
388 | </section> | ||
389 | |||
390 | <section id='development-saving-kernel-modifications'> | ||
391 | <title>Development: Saving Kernel Modifications</title> | ||
392 | |||
393 | <para> | ||
394 | Another common operation is to build a BSP supplied by the Yocto Project, make some | ||
395 | changes, rebuild, and then test. | ||
396 | Those local changes often need to be exported, shared or otherwise maintained. | ||
397 | </para> | ||
398 | |||
399 | <para> | ||
400 | Since the Yocto Project kernel source tree is backed by Git, this activity is | ||
401 | much easier as compared to with previous releases. | ||
402 | Because Git tracks file modifications, additions and deletions, it is easy | ||
403 | to modify the code and later realize that you need to save the changes. | ||
404 | It is also easy to determine what has changed. | ||
405 | This method also provides many tools to commit, undo and export those modifications. | ||
406 | </para> | ||
407 | |||
408 | <para> | ||
409 | This section and its sub-sections, describe general application of Git's | ||
410 | <filename>push</filename> and <filename>pull</filename> commands, which are used to | ||
411 | get your changes upstream or source your code from an upstream repository. | ||
412 | The Yocto Project provides scripts that help you work in a collaborative development | ||
413 | environment. | ||
414 | For information on these scripts, see the | ||
415 | "<ulink url='&YOCTO_DOCS_DEV_URL;#pushing-a-change-upstream'>Using Scripts to Push a Change | ||
416 | Upstream and Request a Pull</ulink>" and | ||
417 | "<ulink url='&YOCTO_DOCS_DEV_URL;#submitting-a-patch'>Using Email to Submit a Patch</ulink>" | ||
418 | sections in the Yocto Project Development Manual. | ||
419 | </para> | ||
420 | |||
421 | <para> | ||
422 | There are many ways to save kernel modifications. | ||
423 | The technique employed | ||
424 | depends on the destination for the patches: | ||
425 | |||
426 | <itemizedlist> | ||
427 | <listitem><para>Bulk storage</para></listitem> | ||
428 | <listitem><para>Internal sharing either through patches or by using Git</para></listitem> | ||
429 | <listitem><para>External submissions</para></listitem> | ||
430 | <listitem><para>Exporting for integration into another Source Code | ||
431 | Manager (SCM)</para></listitem> | ||
432 | </itemizedlist> | ||
433 | </para> | ||
434 | |||
435 | <para> | ||
436 | Because of the following list of issues, the destination of the patches also influences | ||
437 | the method for gathering them: | ||
438 | |||
439 | <itemizedlist> | ||
440 | <listitem><para>Bisectability</para></listitem> | ||
441 | <listitem><para>Commit headers</para></listitem> | ||
442 | <listitem><para>Division of subsystems for separate submission or review</para></listitem> | ||
443 | </itemizedlist> | ||
444 | </para> | ||
445 | |||
446 | <section id='bulk-export'> | ||
447 | <title>Bulk Export</title> | ||
448 | |||
449 | <para> | ||
450 | This section describes how you can "bulk" export changes that have not | ||
451 | been separated or divided. | ||
452 | This situation works well when you are simply storing patches outside of the kernel | ||
453 | source repository, either permanently or temporarily, and you are not committing | ||
454 | incremental changes during development. | ||
455 | <note> | ||
456 | This technique is not appropriate for full integration of upstream submission | ||
457 | because changes are not properly divided and do not provide an avenue for per-change | ||
458 | commit messages. | ||
459 | Therefore, this example assumes that changes have not been committed incrementally | ||
460 | during development and that you simply must gather and export them. | ||
461 | </note> | ||
462 | <literallayout class='monospaced'> | ||
463 | # bulk export of ALL modifications without separation or division | ||
464 | # of the changes | ||
465 | |||
466 | $ git add . | ||
467 | $ git commit -s -a -m <msg> | ||
468 | or | ||
469 | $ git commit -s -a # and interact with $EDITOR | ||
470 | </literallayout> | ||
471 | </para> | ||
472 | |||
473 | <para> | ||
474 | The previous operations capture all the local changes in the project source | ||
475 | tree in a single Git commit. | ||
476 | And, that commit is also stored in the project's source tree. | ||
477 | </para> | ||
478 | |||
479 | <para> | ||
480 | Once the changes are exported, you can restore them manually using a template | ||
481 | or through integration with the <filename>default_kernel</filename>. | ||
482 | </para> | ||
483 | |||
484 | </section> | ||
485 | |||
486 | <section id='incremental-planned-sharing'> | ||
487 | <title>Incremental/Planned Sharing</title> | ||
488 | |||
489 | <para> | ||
490 | This section describes how to save modifications when you are making incremental | ||
491 | commits or practicing planned sharing. | ||
492 | The examples in this section assume that you have incrementally committed | ||
493 | changes to the tree during development and now need to export them. | ||
494 | The sections that follow | ||
495 | describe how you can export your changes internally through either patches or by | ||
496 | using Git commands. | ||
497 | </para> | ||
498 | |||
499 | <para> | ||
500 | During development, the following commands are of interest. | ||
501 | For full Git documentation, refer to the Git documentation at | ||
502 | <ulink url='http://github.com'></ulink>. | ||
503 | |||
504 | <literallayout class='monospaced'> | ||
505 | # edit a file | ||
506 | $ vi <path>/file | ||
507 | # stage the change | ||
508 | $ git add <path>/file | ||
509 | # commit the change | ||
510 | $ git commit -s | ||
511 | # remove a file | ||
512 | $ git rm <path>/file | ||
513 | # commit the change | ||
514 | $ git commit -s | ||
515 | |||
516 | ... etc. | ||
517 | </literallayout> | ||
518 | </para> | ||
519 | |||
520 | <para> | ||
521 | Distributed development with Git is possible when you use a universally | ||
522 | agreed-upon unique commit identifier (set by the creator of the commit) that maps to a | ||
523 | specific change set with a specific parent. | ||
524 | This identifier is created for you when | ||
525 | you create a commit, and is re-created when you amend, alter or re-apply | ||
526 | a commit. | ||
527 | As an individual in isolation, this is of no interest. | ||
528 | However, if you | ||
529 | intend to share your tree with normal Git <filename>push</filename> and | ||
530 | <filename>pull</filename> operations for | ||
531 | distributed development, you should consider the ramifications of changing a | ||
532 | commit that you have already shared with others. | ||
533 | </para> | ||
534 | |||
535 | <para> | ||
536 | Assuming that the changes have not been pushed upstream, or pulled into | ||
537 | another repository, you can update both the commit content and commit messages | ||
538 | associated with development by using the following commands: | ||
539 | |||
540 | <literallayout class='monospaced'> | ||
541 | $ Git add <path>/file | ||
542 | $ Git commit --amend | ||
543 | $ Git rebase or Git rebase -i | ||
544 | </literallayout> | ||
545 | </para> | ||
546 | |||
547 | <para> | ||
548 | Again, assuming that the changes have not been pushed upstream, and that | ||
549 | no pending works-in-progress exist (use <filename>git status</filename> to check), then | ||
550 | you can revert (undo) commits by using the following commands: | ||
551 | |||
552 | <literallayout class='monospaced'> | ||
553 | # remove the commit, update working tree and remove all | ||
554 | # traces of the change | ||
555 | $ git reset --hard HEAD^ | ||
556 | # remove the commit, but leave the files changed and staged for re-commit | ||
557 | $ git reset --soft HEAD^ | ||
558 | # remove the commit, leave file change, but not staged for commit | ||
559 | $ git reset --mixed HEAD^ | ||
560 | </literallayout> | ||
561 | </para> | ||
562 | |||
563 | <para> | ||
564 | You can create branches, "cherry-pick" changes, or perform any number of Git | ||
565 | operations until the commits are in good order for pushing upstream | ||
566 | or for pull requests. | ||
567 | After a <filename>push</filename> or <filename>pull</filename> command, | ||
568 | commits are normally considered | ||
569 | "permanent" and you should not modify them. | ||
570 | If the commits need to be changed, you can incrementally do so with new commits. | ||
571 | These practices follow standard Git workflow and the <filename>kernel.org</filename> best | ||
572 | practices, which is recommended. | ||
573 | <note> | ||
574 | It is recommended to tag or branch before adding changes to a Yocto Project | ||
575 | BSP or before creating a new one. | ||
576 | The reason for this recommendation is because the branch or tag provides a | ||
577 | reference point to facilitate locating and exporting local changes. | ||
578 | </note> | ||
579 | </para> | ||
580 | |||
581 | <section id='export-internally-via-patches'> | ||
582 | <title>Exporting Changes Internally by Using Patches</title> | ||
583 | |||
584 | <para> | ||
585 | This section describes how you can extract committed changes from a working directory | ||
586 | by exporting them as patches. | ||
587 | Once the changes have been extracted, you can use the patches for upstream submission, | ||
588 | place them in a Yocto Project template for automatic kernel patching, | ||
589 | or apply them in many other common uses. | ||
590 | </para> | ||
591 | |||
592 | <para> | ||
593 | This example shows how to create a directory with sequentially numbered patches. | ||
594 | Once the directory is created, you can apply it to a repository using the | ||
595 | <filename>git am</filename> command to reproduce the original commit and all | ||
596 | the related information such as author, date, commit log, and so forth. | ||
597 | <note> | ||
598 | The new commit identifiers (ID) will be generated upon re-application. | ||
599 | This action reflects that the commit is now applied to an underlying commit | ||
600 | with a different ID. | ||
601 | </note> | ||
602 | <literallayout class='monospaced'> | ||
603 | # <first-commit> can be a tag if one was created before development | ||
604 | # began. It can also be the parent branch if a branch was created | ||
605 | # before development began. | ||
606 | |||
607 | $ git format-patch -o <dir> <first commit>..<last commit> | ||
608 | </literallayout> | ||
609 | </para> | ||
610 | |||
611 | <para> | ||
612 | In other words: | ||
613 | <literallayout class='monospaced'> | ||
614 | # Identify commits of interest. | ||
615 | |||
616 | # If the tree was tagged before development | ||
617 | $ git format-patch -o <save dir> <tag> | ||
618 | |||
619 | # If no tags are available | ||
620 | $ git format-patch -o <save dir> HEAD^ # last commit | ||
621 | $ git format-patch -o <save dir> HEAD^^ # last 2 commits | ||
622 | $ git whatchanged # identify last commit | ||
623 | $ git format-patch -o <save dir> <commit id> | ||
624 | $ git format-patch -o <save dir> <rev-list> | ||
625 | </literallayout> | ||
626 | </para> | ||
627 | </section> | ||
628 | |||
629 | <section id='export-internally-via-git'> | ||
630 | <title>Exporting Changes Internally by Using Git</title> | ||
631 | |||
632 | <para> | ||
633 | This section describes how you can export changes from a working directory | ||
634 | by pushing the changes into a master repository or by making a pull request. | ||
635 | Once you have pushed the changes to the master repository, you can then | ||
636 | pull those same changes into a new kernel build at a later time. | ||
637 | </para> | ||
638 | |||
639 | <para> | ||
640 | Use this command form to push the changes: | ||
641 | <literallayout class='monospaced'> | ||
642 | $ git push ssh://<master_server>/<path_to_repo> | ||
643 | <local_branch>:<remote_branch> | ||
644 | </literallayout> | ||
645 | </para> | ||
646 | |||
647 | <para> | ||
648 | For example, the following command pushes the changes from your local branch | ||
649 | <filename>yocto/standard/common-pc/base</filename> to the remote branch with the same name | ||
650 | in the master repository <filename>//git.mycompany.com/pub/git/kernel-3.4</filename>. | ||
651 | <literallayout class='monospaced'> | ||
652 | $ git push ssh://git.mycompany.com/pub/git/kernel-3.4 \ | ||
653 | yocto/standard/common-pc/base:yocto/standard/common-pc/base | ||
654 | </literallayout> | ||
655 | </para> | ||
656 | |||
657 | <para> | ||
658 | A pull request entails using the <filename>git request-pull</filename> command to compose | ||
659 | an email to the | ||
660 | maintainer requesting that a branch be pulled into the master repository, see | ||
661 | <ulink url='http://github.com/guides/pull-requests'></ulink> for an example. | ||
662 | <note> | ||
663 | Other commands such as <filename>git stash</filename> or branching can also be used to save | ||
664 | changes, but are not covered in this document. | ||
665 | </note> | ||
666 | </para> | ||
667 | </section> | ||
668 | </section> | ||
669 | |||
670 | <section id='export-for-external-upstream-submission'> | ||
671 | <title>Exporting Changes for External (Upstream) Submission</title> | ||
672 | |||
673 | <para> | ||
674 | This section describes how to export changes for external upstream submission. | ||
675 | If the patch series is large or the maintainer prefers to pull | ||
676 | changes, you can submit these changes by using a pull request. | ||
677 | However, it is common to send patches as an email series. | ||
678 | This method allows easy review and integration of the changes. | ||
679 | <note> | ||
680 | Before sending patches for review be sure you understand the | ||
681 | community standards for submitting and documenting changes and follow their best practices. | ||
682 | For example, kernel patches should follow standards such as: | ||
683 | <itemizedlist> | ||
684 | <listitem><para> | ||
685 | <ulink url='http://linux.yyz.us/patch-format.html'></ulink></para></listitem> | ||
686 | <listitem><para>Documentation/SubmittingPatches (in any linux | ||
687 | kernel source tree)</para></listitem> | ||
688 | </itemizedlist> | ||
689 | </note> | ||
690 | </para> | ||
691 | |||
692 | <para> | ||
693 | The messages used to commit changes are a large part of these standards. | ||
694 | Consequently, be sure that the headers for each commit have the required information. | ||
695 | For information on how to follow the Yocto Project commit message standards, see the | ||
696 | "<ulink url='&YOCTO_DOCS_DEV_URL;#how-to-submit-a-change'>How to Submit a | ||
697 | Change</ulink>" section in the Yocto Project Development Manual. | ||
698 | </para> | ||
699 | |||
700 | <para> | ||
701 | If the initial commits were not properly documented or do not meet those standards, | ||
702 | you can re-base by using the <filename>git rebase -i</filename> command to | ||
703 | manipulate the commits and | ||
704 | get them into the required format. | ||
705 | Other techniques such as branching and cherry-picking commits are also viable options. | ||
706 | </para> | ||
707 | |||
708 | <para> | ||
709 | Once you complete the commits, you can generate the email that sends the patches | ||
710 | to the maintainer(s) or lists that review and integrate changes. | ||
711 | The command <filename>git send-email</filename> is commonly used to ensure | ||
712 | that patches are properly | ||
713 | formatted for easy application and avoid mailer-induced patch damage. | ||
714 | </para> | ||
715 | |||
716 | <para> | ||
717 | The following is an example of dumping patches for external submission: | ||
718 | <literallayout class='monospaced'> | ||
719 | # dump the last 4 commits | ||
720 | $ git format-patch --thread -n -o ~/rr/ HEAD^^^^ | ||
721 | $ git send-email --compose --subject '[RFC 0/N] <patch series summary>' \ | ||
722 | --to foo@yoctoproject.org --to bar@yoctoproject.org \ | ||
723 | --cc list@yoctoproject.org ~/rr | ||
724 | # the editor is invoked for the 0/N patch, and when complete the entire | ||
725 | # series is sent via email for review | ||
726 | </literallayout> | ||
727 | </para> | ||
728 | </section> | ||
729 | |||
730 | <section id='export-for-import-into-other-scm'> | ||
731 | <title>Exporting Changes for Import into Another SCM</title> | ||
732 | |||
733 | <para> | ||
734 | When you want to export changes for import into another | ||
735 | Source Code Manager (SCM), you can use any of the previously discussed | ||
736 | techniques. | ||
737 | However, if the patches are manually applied to a secondary tree and then | ||
738 | that tree is checked into the SCM, you can lose change information such as | ||
739 | commit logs. | ||
740 | This process is not recommended. | ||
741 | </para> | ||
742 | |||
743 | <para> | ||
744 | Many SCMs can directly import Git commits, or can translate Git patches so that | ||
745 | information is not lost. | ||
746 | Those facilities are SCM-dependent and you should use them whenever possible. | ||
747 | </para> | ||
748 | </section> | ||
749 | </section> | ||
750 | |||
751 | <section id='scm-working-with-the-yocto-project-kernel-in-another-scm'> | ||
752 | <title>Working with the Yocto Project Kernel in Another SCM</title> | ||
753 | |||
754 | <para> | ||
755 | This section describes kernel development in an SCM other than Git, | ||
756 | which is not the same as exporting changes to another SCM described earlier. | ||
757 | For this scenario, you use the OpenEmbedded build system to | ||
758 | develop the kernel in a different SCM. | ||
759 | The following must be true for you to accomplish this: | ||
760 | <itemizedlist> | ||
761 | <listitem><para>The delivered Yocto Project kernel must be exported into the second | ||
762 | SCM.</para></listitem> | ||
763 | <listitem><para>Development must be exported from that secondary SCM into a | ||
764 | format that can be used by the OpenEmbedded build system.</para></listitem> | ||
765 | </itemizedlist> | ||
766 | </para> | ||
767 | |||
768 | <section id='exporting-delivered-kernel-to-scm'> | ||
769 | <title>Exporting the Delivered Kernel to the SCM</title> | ||
770 | |||
771 | <para> | ||
772 | Depending on the SCM, it might be possible to export the entire Yocto Project | ||
773 | kernel Git repository, branches and all, into a new environment. | ||
774 | This method is preferred because it has the most flexibility and potential to maintain | ||
775 | the meta data associated with each commit. | ||
776 | </para> | ||
777 | |||
778 | <para> | ||
779 | When a direct import mechanism is not available, it is still possible to | ||
780 | export a branch (or series of branches) and check them into a new repository. | ||
781 | </para> | ||
782 | |||
783 | <para> | ||
784 | The following commands illustrate some of the steps you could use to | ||
785 | import the <filename>yocto/standard/common-pc/base</filename> | ||
786 | kernel into a secondary SCM: | ||
787 | <literallayout class='monospaced'> | ||
788 | $ git checkout yocto/standard/common-pc/base | ||
789 | $ cd .. ; echo linux/.git > .cvsignore | ||
790 | $ cvs import -m "initial import" linux MY_COMPANY start | ||
791 | </literallayout> | ||
792 | </para> | ||
793 | |||
794 | <para> | ||
795 | You could now relocate the CVS repository and use it in a centralized manner. | ||
796 | </para> | ||
797 | |||
798 | <para> | ||
799 | The following commands illustrate how you can condense and merge two BSPs into a | ||
800 | second SCM: | ||
801 | <literallayout class='monospaced'> | ||
802 | $ git checkout yocto/standard/common-pc/base | ||
803 | $ git merge yocto/standard/common-pc-64/base | ||
804 | # resolve any conflicts and commit them | ||
805 | $ cd .. ; echo linux/.git > .cvsignore | ||
806 | $ cvs import -m "initial import" linux MY_COMPANY start | ||
807 | </literallayout> | ||
808 | </para> | ||
809 | </section> | ||
810 | |||
811 | <section id='importing-changes-for-build'> | ||
812 | <title>Importing Changes for the Build</title> | ||
813 | |||
814 | <para> | ||
815 | Once development has reached a suitable point in the second development | ||
816 | environment, you need to export the changes as patches. | ||
817 | To export them, place the changes in a recipe and | ||
818 | automatically apply them to the kernel during patching. | ||
819 | </para> | ||
820 | </section> | ||
821 | </section> | ||
822 | |||
823 | <section id='bsp-creating'> | ||
824 | <title>Creating a BSP Based on an Existing Similar BSP</title> | ||
825 | |||
826 | <para> | ||
827 | This section overviews the process of creating a BSP based on an | ||
828 | existing similar BSP. | ||
829 | The information is introductory in nature and does not provide step-by-step examples. | ||
830 | For detailed information on how to create a new BSP, see | ||
831 | the "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a New BSP Layer Using the yocto-bsp Script</ulink>" section in the | ||
832 | Yocto Project Board Support Package (BSP) Developer's Guide, or see the | ||
833 | <ulink url='&YOCTO_WIKI_URL;/wiki/Transcript:_creating_one_generic_Atom_BSP_from_another'>Transcript:_creating_one_generic_Atom_BSP_from_another</ulink> | ||
834 | wiki page. | ||
835 | </para> | ||
836 | |||
837 | <para> | ||
838 | The basic steps you need to follow are: | ||
839 | <orderedlist> | ||
840 | <listitem><para><emphasis>Make sure you have set up a local Source Directory:</emphasis> | ||
841 | You must create a local | ||
842 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
843 | by either creating a Git repository (recommended) or | ||
844 | extracting a Yocto Project release tarball.</para></listitem> | ||
845 | <listitem><para><emphasis>Choose an existing BSP available with the Yocto Project:</emphasis> | ||
846 | Try to map your board features as closely to the features of a BSP that is | ||
847 | already supported and exists in the Yocto Project. | ||
848 | Starting with something as close as possible to your board makes developing | ||
849 | your BSP easier. | ||
850 | You can find all the BSPs that are supported and ship with the Yocto Project | ||
851 | on the Yocto Project's Download page at | ||
852 | <ulink url='&YOCTO_HOME_URL;/download'></ulink>.</para></listitem> | ||
853 | <listitem><para><emphasis>Be sure you have the Base BSP:</emphasis> | ||
854 | You need to either have a local Git repository of the base BSP set up or | ||
855 | have downloaded and extracted the files from a release BSP tarball. | ||
856 | Either method gives you access to the BSP source files.</para></listitem> | ||
857 | <listitem><para><emphasis>Make a copy of the existing BSP, thus isolating your new | ||
858 | BSP work:</emphasis> | ||
859 | Copying the existing BSP file structure gives you a new area in which to work.</para></listitem> | ||
860 | <listitem><para><emphasis>Make configuration and recipe changes to your new BSP:</emphasis> | ||
861 | Configuration changes involve the files in the BSP's <filename>conf</filename> | ||
862 | directory. | ||
863 | Changes include creating a machine-specific configuration file and editing the | ||
864 | <filename>layer.conf</filename> file. | ||
865 | The configuration changes identify the kernel you will be using. | ||
866 | Recipe changes include removing, modifying, or adding new recipe files that | ||
867 | instruct the build process on what features to include in the image.</para></listitem> | ||
868 | <listitem><para><emphasis>Prepare for the build:</emphasis> | ||
869 | Before you actually initiate the build, you need to set up the build environment | ||
870 | by sourcing the environment initialization script. | ||
871 | After setting up the environment, you need to make some build configuration | ||
872 | changes to the <filename>local.conf</filename> and <filename>bblayers.conf</filename> | ||
873 | files.</para></listitem> | ||
874 | <listitem><para><emphasis>Build the image:</emphasis> | ||
875 | The OpenEmbedded build system uses BitBake to create the image. | ||
876 | You need to decide on the type of image you are going to build (e.g. minimal, base, | ||
877 | core, sato, and so forth) and then start the build using the <filename>bitbake</filename> | ||
878 | command.</para></listitem> | ||
879 | </orderedlist> | ||
880 | </para> | ||
881 | </section> | ||
882 | |||
883 | <section id='tip-dirty-string'> | ||
884 | <title>"-dirty" String</title> | ||
885 | |||
886 | <para> | ||
887 | If kernel images are being built with "-dirty" on the end of the version | ||
888 | string, this simply means that modifications in the source | ||
889 | directory have not been committed. | ||
890 | <literallayout class='monospaced'> | ||
891 | $ git status | ||
892 | </literallayout> | ||
893 | </para> | ||
894 | |||
895 | <para> | ||
896 | You can use the above Git command to report modified, removed, or added files. | ||
897 | You should commit those changes to the tree regardless of whether they will be saved, | ||
898 | exported, or used. | ||
899 | Once you commit the changes you need to rebuild the kernel. | ||
900 | </para> | ||
901 | |||
902 | <para> | ||
903 | To brute force pickup and commit all such pending changes, enter the following: | ||
904 | <literallayout class='monospaced'> | ||
905 | $ git add . | ||
906 | $ git commit -s -a -m "getting rid of -dirty" | ||
907 | </literallayout> | ||
908 | </para> | ||
909 | |||
910 | <para> | ||
911 | Next, rebuild the kernel. | ||
912 | </para> | ||
913 | </section> | ||
914 | </section> | ||
915 | </chapter> | ||
916 | <!-- | ||
917 | vim: expandtab tw=80 ts=4 | ||
918 | --> | ||
diff --git a/documentation/kernel-dev/kernel-dev-faq.xml b/documentation/kernel-dev/kernel-dev-faq.xml new file mode 100644 index 0000000..2b99ad2 --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-faq.xml | |||
@@ -0,0 +1,140 @@ | |||
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 | |||
5 | <appendix id='kernel-dev-faq'> | ||
6 | <title>Kernel Development FAQ</title> | ||
7 | |||
8 | <section id='kernel-dev-faq-section'> | ||
9 | <title>Common Questions and Solutions</title> | ||
10 | |||
11 | <para> | ||
12 | The following lists some solutions for common questions. | ||
13 | |||
14 | |||
15 | <qandaset> | ||
16 | <qandaentry> | ||
17 | <question> | ||
18 | <para> | ||
19 | How do I use my own Linux kernel <filename>.config</filename> | ||
20 | file? | ||
21 | </para> | ||
22 | </question> | ||
23 | <answer> | ||
24 | <para> | ||
25 | Refer to the "<link linkend='changing-the-configuration'>Changing the Configuration</link>" | ||
26 | section for information. | ||
27 | </para> | ||
28 | </answer> | ||
29 | </qandaentry> | ||
30 | |||
31 | <qandaentry> | ||
32 | <question> | ||
33 | <para> | ||
34 | How do I create configuration fragments? | ||
35 | </para> | ||
36 | </question> | ||
37 | <answer> | ||
38 | <para> | ||
39 | Refer to the "<link linkend='generating-configuration-files'>Generating Configuration Files</link>" | ||
40 | section for information. | ||
41 | </para> | ||
42 | </answer> | ||
43 | </qandaentry> | ||
44 | |||
45 | <qandaentry> | ||
46 | <question> | ||
47 | <para> | ||
48 | How do I use my own Linux kernel sources? | ||
49 | </para> | ||
50 | </question> | ||
51 | <answer> | ||
52 | <para> | ||
53 | Refer to the "<link linkend='working-with-your-own-sources'>Working With Your Own Sources</link>" | ||
54 | section for information. | ||
55 | </para> | ||
56 | </answer> | ||
57 | </qandaentry> | ||
58 | |||
59 | <qandaentry> | ||
60 | <question> | ||
61 | <para> | ||
62 | How do I install/not-install the kernel image on the rootfs? | ||
63 | </para> | ||
64 | </question> | ||
65 | <answer> | ||
66 | <para> | ||
67 | The kernel image (e.g. <filename>vmlinuz</filename>) is provided | ||
68 | by the <filename>kernel-image</filename> package. | ||
69 | Image recipes depend on <filename>kernel-base</filename>. | ||
70 | To specify whether or not the kernel | ||
71 | image is installed in the generated root filesystem, override | ||
72 | <filename>RDEPENDS_kernel-base</filename> to include or not | ||
73 | include "kernel-image".</para> | ||
74 | <para>See the | ||
75 | "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files</ulink>" | ||
76 | section in the Yocto Project Development Manual for information on | ||
77 | how to use an append file to override metadata. | ||
78 | </para> | ||
79 | </answer> | ||
80 | </qandaentry> | ||
81 | |||
82 | <qandaentry> | ||
83 | <question> | ||
84 | <para> | ||
85 | How do I install a specific kernel module? | ||
86 | </para> | ||
87 | </question> | ||
88 | <answer> | ||
89 | <para> | ||
90 | Linux kernel modules are packaged individually. | ||
91 | To ensure a specific kernel module is included in an image, | ||
92 | include it in the appropriate machine | ||
93 | <ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'><filename>RRECOMMENDS</filename></ulink> | ||
94 | variable.</para> | ||
95 | <para>These other variables are useful for installing specific | ||
96 | modules: | ||
97 | <literallayout class='monospaced'> | ||
98 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS'><filename>MACHINE_ESSENTIAL_EXTRA_RDEPENDS</filename></ulink> | ||
99 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'><filename>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</filename></ulink> | ||
100 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_EXTRA_RDEPENDS'><filename>MACHINE_EXTRA_RDEPENDS</filename></ulink> | ||
101 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_EXTRA_RRECOMMENDS'><filename>MACHINE_EXTRA_RRECOMMENDS</filename></ulink> | ||
102 | </literallayout> | ||
103 | For example, set the following in the <filename>qemux86.conf</filename> | ||
104 | file to include the <filename>ab123</filename> kernel modules | ||
105 | with images built for the <filename>qemux86</filename> machine: | ||
106 | <literallayout class='monospaced'> | ||
107 | MACHINE_EXTRA_RRECOMMENDS += "kernel-module-ab123" | ||
108 | </literallayout> | ||
109 | For more information, see the | ||
110 | "<link linkend='incorporating-out-of-tree-modules'>Incorporating Out-of-Tree Modules</link>" | ||
111 | section. | ||
112 | </para> | ||
113 | </answer> | ||
114 | </qandaentry> | ||
115 | |||
116 | <qandaentry> | ||
117 | <question> | ||
118 | <para> | ||
119 | How do I change the Linux kernel command line? | ||
120 | </para> | ||
121 | </question> | ||
122 | <answer> | ||
123 | <para> | ||
124 | The Linux kernel command line is typically specified in | ||
125 | the machine config using the <filename>APPEND</filename> variable. | ||
126 | For example, you can add some helpful debug information doing | ||
127 | the following: | ||
128 | <literallayout class='monospaced'> | ||
129 | APPEND += "printk.time=y initcall_debug debug" | ||
130 | </literallayout> | ||
131 | </para> | ||
132 | </answer> | ||
133 | </qandaentry> | ||
134 | </qandaset> | ||
135 | </para> | ||
136 | </section> | ||
137 | </appendix> | ||
138 | <!-- | ||
139 | vim: expandtab tw=80 ts=4 | ||
140 | --> | ||
diff --git a/documentation/kernel-dev/kernel-dev-intro.xml b/documentation/kernel-dev/kernel-dev-intro.xml new file mode 100644 index 0000000..297696c --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-intro.xml | |||
@@ -0,0 +1,147 @@ | |||
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 | |||
5 | <chapter id='kernel-dev-intro'> | ||
6 | <title>Introduction</title> | ||
7 | |||
8 | <!-- | ||
9 | <para> | ||
10 | <emphasis>AR - Darrren Hart:</emphasis> See if the concepts in these | ||
11 | three bullets are adequately covered in somewhere in this manual: | ||
12 | <itemizedlist> | ||
13 | <listitem><para>Do we convey that our kernel Git repositories | ||
14 | have a clear and continuous history, similar to the way the | ||
15 | kernel Git repositories for <filename>kernel.org</filename> | ||
16 | do. | ||
17 | </para></listitem> | ||
18 | <listitem><para>Does the manual note that Yocto Project delivers | ||
19 | a key set of supported kernel types, where | ||
20 | each type is tailored to meet a specific use (e.g. networking, | ||
21 | consumer, devices, and so forth).</para></listitem> | ||
22 | <listitem><para>Do we convey that the Yocto Project uses a | ||
23 | Git branching strategy that, from a | ||
24 | developer's point of view, results in a linear path from the | ||
25 | baseline kernel.org, through a select group of features and | ||
26 | ends with their BSP-specific commits.</para></listitem> | ||
27 | </itemizedlist> | ||
28 | </para> | ||
29 | --> | ||
30 | |||
31 | <section id='kernel-dev-overview'> | ||
32 | <title>Overview</title> | ||
33 | |||
34 | <para> | ||
35 | Regardless of how you intend to make use of the Yocto Project, | ||
36 | chances are you will work with the Linux kernel. | ||
37 | This manual provides background information on the Yocto Linux kernel | ||
38 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>, | ||
39 | describes common tasks you can perform using the kernel tools, | ||
40 | and shows you how to use the kernel Metadata needed to work with | ||
41 | the kernel inside the Yocto Project. | ||
42 | </para> | ||
43 | |||
44 | <para> | ||
45 | Each Yocto Project release has a set of linux-yocto recipes, whose | ||
46 | Git repositories you can view in the Yocto | ||
47 | <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink> under | ||
48 | the "Yocto Linux Kernel" heading. | ||
49 | New recipes for the release track the latest upstream developments | ||
50 | and introduce newly supported platforms. | ||
51 | Previous recipes in the release are refreshed and supported for at | ||
52 | least one additional release. | ||
53 | As they align, these previous releases are updated to include the | ||
54 | latest from the Long Term Support Initiative (LTSI) project. | ||
55 | Also included is a linux-yocto development recipe | ||
56 | (<filename>linux-yocto-dev.bb</filename>) should you want to work | ||
57 | with the very latest in upstream Linux kernel development and | ||
58 | kernel Metadata development. | ||
59 | </para> | ||
60 | |||
61 | <para> | ||
62 | The Yocto Project also provides a powerful set of kernel | ||
63 | tools for managing Linux kernel sources and configuration data. | ||
64 | You can use these tools to make a single configuration change, | ||
65 | apply multiple patches, or work with your own kernel sources. | ||
66 | </para> | ||
67 | |||
68 | <para> | ||
69 | In particular, the kernel tools allow you to generate configuration | ||
70 | fragments that specify only what you must, and nothing more. | ||
71 | Configuration fragments only need to contain the highest level | ||
72 | visible <filename>CONFIG</filename> options as presented by the Linux | ||
73 | kernel <filename>menuconfig</filename> system. | ||
74 | Contrast this against a complete Linux kernel | ||
75 | <filename>.config</filename>, which includes all the automatically | ||
76 | selected <filename>CONFIG</filename> options. | ||
77 | This efficiency reduces your maintenance effort and allows you | ||
78 | to further separate your configuration in ways that make sense for | ||
79 | your project. | ||
80 | A common split separates policy and hardware. | ||
81 | For example, all your kernels might support | ||
82 | the <filename>proc</filename> and <filename>sys</filename> filesystems, | ||
83 | but only specific boards require sound, USB, or specific drivers. | ||
84 | Specifying these configurations individually allows you to aggregate | ||
85 | them together as needed, but maintains them in only one place. | ||
86 | Similar logic applies to separating source changes. | ||
87 | </para> | ||
88 | |||
89 | <para> | ||
90 | If you do not maintain your own kernel sources and need to make | ||
91 | only minimal changes to the sources, the released recipes provide a | ||
92 | vetted base upon which to layer your changes. | ||
93 | Doing so allows you to benefit from the continual kernel | ||
94 | integration and testing performed during development of the | ||
95 | Yocto Project. | ||
96 | </para> | ||
97 | |||
98 | <para> | ||
99 | If, instead, you have a very specific Linux kernel source tree | ||
100 | and are unable to align with one of the official linux-yocto | ||
101 | recipes, an alternative exists by which you can use the Yocto | ||
102 | Project Linux kernel tools with your own kernel sources. | ||
103 | </para> | ||
104 | </section> | ||
105 | |||
106 | <section id='kernel-dev-other-resources'> | ||
107 | <title>Other Resources</title> | ||
108 | |||
109 | <para> | ||
110 | The sections that follow provide instructions for completing | ||
111 | specific Linux kernel development tasks. | ||
112 | These instructions assume you are comfortable working with | ||
113 | <ulink url='http://developer.berlios.de/projects/bitbake/'>BitBake</ulink> | ||
114 | recipes and basic open-source development tools. | ||
115 | Understanding these concepts will facilitate the process of working | ||
116 | with the kernel recipes. | ||
117 | If you find you need some additional background, please be sure to | ||
118 | review and understand the following documentation: | ||
119 | <itemizedlist> | ||
120 | <listitem><para><ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink> | ||
121 | </para></listitem> | ||
122 | <listitem><para>The "<ulink url='&YOCTO_DOCS_DEV_URL;#modifying-temporary-source-code'>Modifying Temporary Source Code</ulink>" | ||
123 | section in the Yocto Project Development Manual | ||
124 | </para></listitem> | ||
125 | <listitem><para>The "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>" section | ||
126 | in the Yocto Project Development Manual</para></listitem> | ||
127 | <listitem><para>The "<ulink url='&YOCTO_DOCS_DEV_URL;#modifying-the-kernel'>Modifying the Kernel</ulink>" section | ||
128 | in the Yocto Project Development Manual.</para></listitem> | ||
129 | </itemizedlist> | ||
130 | </para> | ||
131 | |||
132 | <para> | ||
133 | Finally, while this document focuses on the manual creation of | ||
134 | recipes, patches, and configuration files, the Yocto Project | ||
135 | Board Support Package (BSP) tools are available to automate | ||
136 | this process with existing content and work well to create the | ||
137 | initial framework and boilerplate code. | ||
138 | For details on these tools, see the | ||
139 | "<ulink url='&YOCTO_DOCS_BSP_URL;#using-the-yocto-projects-bsp-tools'>Using the Yocto Project's BSP Tools</ulink>" | ||
140 | section in the Yocto Project Board Support Package (BSP) Developer's | ||
141 | Guide. | ||
142 | </para> | ||
143 | </section> | ||
144 | </chapter> | ||
145 | <!-- | ||
146 | vim: expandtab tw=80 ts=4 | ||
147 | --> | ||
diff --git a/documentation/kernel-dev/kernel-dev-maint-appx.xml b/documentation/kernel-dev/kernel-dev-maint-appx.xml new file mode 100644 index 0000000..a7c144f --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-maint-appx.xml | |||
@@ -0,0 +1,220 @@ | |||
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 | |||
5 | <appendix id='kernel-dev-maint-appx'> | ||
6 | <title>Kernel Maintenance</title> | ||
7 | |||
8 | <section id='tree-construction'> | ||
9 | <title>Tree Construction</title> | ||
10 | <para> | ||
11 | This section describes construction of the Yocto Project kernel source repositories | ||
12 | as accomplished by the Yocto Project team to create kernel repositories. | ||
13 | These kernel repositories are found under the heading "Yocto Linux Kernel" at | ||
14 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi'>&YOCTO_GIT_URL;/cgit.cgi</ulink> | ||
15 | and can be shipped as part of a Yocto Project release. | ||
16 | The team creates these repositories by | ||
17 | compiling and executing the set of feature descriptions for every BSP | ||
18 | and feature in the product. | ||
19 | Those feature descriptions list all necessary patches, | ||
20 | configuration, branching, tagging and feature divisions found in a kernel. | ||
21 | Thus, the Yocto Project kernel repository (or tree) is built. | ||
22 | </para> | ||
23 | <para> | ||
24 | The existence of this tree allows you to access and clone a particular | ||
25 | Yocto Project kernel repository and use it to build images based on their configurations | ||
26 | and features. | ||
27 | </para> | ||
28 | <para> | ||
29 | You can find the files used to describe all the valid features and BSPs | ||
30 | in the Yocto Project kernel in any clone of the Yocto Project kernel source repository | ||
31 | Git tree. | ||
32 | For example, the following command clones the Yocto Project baseline kernel that | ||
33 | branched off of <filename>linux.org</filename> version 3.4: | ||
34 | <literallayout class='monospaced'> | ||
35 | $ git clone git://git.yoctoproject.org/linux-yocto-3.4 | ||
36 | </literallayout> | ||
37 | For another example of how to set up a local Git repository of the Yocto Project | ||
38 | kernel files, see the | ||
39 | "<ulink url='&YOCTO_DOCS_DEV_URL;#local-kernel-files'>Yocto Project Kernel</ulink>" bulleted | ||
40 | item in the Yocto Project Development Manual. | ||
41 | </para> | ||
42 | <para> | ||
43 | Once you have cloned the kernel Git repository on your local machine, you can | ||
44 | switch to the <filename>meta</filename> branch within the repository. | ||
45 | Here is an example that assumes the local Git repository for the kernel is in | ||
46 | a top-level directory named <filename>linux-yocto-3.4</filename>: | ||
47 | <literallayout class='monospaced'> | ||
48 | $ cd linux-yocto-3.4 | ||
49 | $ git checkout -b meta origin/meta | ||
50 | </literallayout> | ||
51 | Once you have checked out and switched to the <filename>meta</filename> branch, | ||
52 | you can see a snapshot of all the kernel configuration and feature descriptions that are | ||
53 | used to build that particular kernel repository. | ||
54 | These descriptions are in the form of <filename>.scc</filename> files. | ||
55 | </para> | ||
56 | <para> | ||
57 | You should realize, however, that browsing your local kernel repository | ||
58 | for feature descriptions and patches is not an effective way to determine what is in a | ||
59 | particular kernel branch. | ||
60 | Instead, you should use Git directly to discover the changes in a branch. | ||
61 | Using Git is an efficient and flexible way to inspect changes to the kernel. | ||
62 | <note> | ||
63 | Ground up reconstruction of the complete kernel tree is an action only taken by the | ||
64 | Yocto Project team during an active development cycle. | ||
65 | When you create a clone of the kernel Git repository, you are simply making it | ||
66 | efficiently available for building and development. | ||
67 | </note> | ||
68 | </para> | ||
69 | <para> | ||
70 | The following steps describe what happens when the Yocto Project Team constructs | ||
71 | the Yocto Project kernel source Git repository (or tree) found at | ||
72 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink> given the | ||
73 | introduction of a new top-level kernel feature or BSP. | ||
74 | These are the actions that effectively create the tree | ||
75 | that includes the new feature, patch or BSP: | ||
76 | <orderedlist> | ||
77 | <listitem><para>A top-level kernel feature is passed to the kernel build subsystem. | ||
78 | Normally, this feature is a BSP for a particular kernel type.</para></listitem> | ||
79 | <listitem><para>The file that describes the top-level feature is located by searching | ||
80 | these system directories: | ||
81 | <itemizedlist> | ||
82 | <listitem><para>The in-tree kernel-cache directories, which are located | ||
83 | in <filename>meta/cfg/kernel-cache</filename></para></listitem> | ||
84 | <listitem><para>Areas pointed to by <filename>SRC_URI</filename> statements | ||
85 | found in recipes</para></listitem> | ||
86 | </itemizedlist> | ||
87 | For a typical build, the target of the search is a | ||
88 | feature description in an <filename>.scc</filename> file | ||
89 | whose name follows this format: | ||
90 | <literallayout class='monospaced'> | ||
91 | <bsp_name>-<kernel_type>.scc | ||
92 | </literallayout> | ||
93 | </para></listitem> | ||
94 | <listitem><para>Once located, the feature description is either compiled into a simple script | ||
95 | of actions, or into an existing equivalent script that is already part of the | ||
96 | shipped kernel.</para></listitem> | ||
97 | <listitem><para>Extra features are appended to the top-level feature description. | ||
98 | These features can come from the | ||
99 | <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'><filename>KERNEL_FEATURES</filename></ulink> | ||
100 | variable in recipes.</para></listitem> | ||
101 | <listitem><para>Each extra feature is located, compiled and appended to the script | ||
102 | as described in step three.</para></listitem> | ||
103 | <listitem><para>The script is executed to produce a series of <filename>meta-*</filename> | ||
104 | directories. | ||
105 | These directories are descriptions of all the branches, tags, patches and configurations that | ||
106 | need to be applied to the base Git repository to completely create the | ||
107 | source (build) branch for the new BSP or feature.</para></listitem> | ||
108 | <listitem><para>The base repository is cloned, and the actions | ||
109 | listed in the <filename>meta-*</filename> directories are applied to the | ||
110 | tree.</para></listitem> | ||
111 | <listitem><para>The Git repository is left with the desired branch checked out and any | ||
112 | required branching, patching and tagging has been performed.</para></listitem> | ||
113 | </orderedlist> | ||
114 | </para> | ||
115 | <para> | ||
116 | The kernel tree is now ready for developer consumption to be locally cloned, | ||
117 | configured, and built into a Yocto Project kernel specific to some target hardware. | ||
118 | <note><para>The generated <filename>meta-*</filename> directories add to the kernel | ||
119 | as shipped with the Yocto Project release. | ||
120 | Any add-ons and configuration data are applied to the end of an existing branch. | ||
121 | The full repository generation that is found in the | ||
122 | official Yocto Project kernel repositories at | ||
123 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi'>http://git.yoctoproject.org/cgit.cgi</ulink> | ||
124 | is the combination of all supported boards and configurations.</para> | ||
125 | <para>The technique the Yocto Project team uses is flexible and allows for seamless | ||
126 | blending of an immutable history with additional patches specific to a | ||
127 | deployment. | ||
128 | Any additions to the kernel become an integrated part of the branches.</para> | ||
129 | </note> | ||
130 | </para> | ||
131 | </section> | ||
132 | |||
133 | <section id='build-strategy'> | ||
134 | <title>Build Strategy</title> | ||
135 | |||
136 | <!-- | ||
137 | <para> | ||
138 | <emphasis>AR - Darrren Hart:</emphasis> Some parts of this section | ||
139 | need to be in the | ||
140 | "<link linkend='using-an-iterative-development-process'>Using an Iterative Development Process</link>" | ||
141 | section. | ||
142 | Darren needs to figure out which parts and identify them. | ||
143 | </para> | ||
144 | --> | ||
145 | |||
146 | <para> | ||
147 | Once a local Git repository of the Yocto Project kernel exists on a development system, | ||
148 | you can consider the compilation phase of kernel development - building a kernel image. | ||
149 | Some prerequisites exist that are validated by the build process before compilation | ||
150 | starts: | ||
151 | </para> | ||
152 | |||
153 | <itemizedlist> | ||
154 | <listitem><para>The | ||
155 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink> points | ||
156 | to the kernel Git repository.</para></listitem> | ||
157 | <listitem><para>A BSP build branch exists. | ||
158 | This branch has the following form: | ||
159 | <literallayout class='monospaced'> | ||
160 | <kernel_type>/<bsp_name> | ||
161 | </literallayout></para></listitem> | ||
162 | </itemizedlist> | ||
163 | |||
164 | <para> | ||
165 | The OpenEmbedded build system makes sure these conditions exist before attempting compilation. | ||
166 | Other means, however, do exist, such as as bootstrapping a BSP. | ||
167 | </para> | ||
168 | |||
169 | <para> | ||
170 | Before building a kernel, the build process verifies the tree | ||
171 | and configures the kernel by processing all of the | ||
172 | configuration "fragments" specified by feature descriptions in the <filename>.scc</filename> | ||
173 | files. | ||
174 | As the features are compiled, associated kernel configuration fragments are noted | ||
175 | and recorded in the <filename>meta-*</filename> series of directories in their compilation order. | ||
176 | The fragments are migrated, pre-processed and passed to the Linux Kernel | ||
177 | Configuration subsystem (<filename>lkc</filename>) as raw input in the form | ||
178 | of a <filename>.config</filename> file. | ||
179 | The <filename>lkc</filename> uses its own internal dependency constraints to do the final | ||
180 | processing of that information and generates the final <filename>.config</filename> file | ||
181 | that is used during compilation. | ||
182 | </para> | ||
183 | |||
184 | <para> | ||
185 | Using the board's architecture and other relevant values from the board's template, | ||
186 | kernel compilation is started and a kernel image is produced. | ||
187 | </para> | ||
188 | |||
189 | <para> | ||
190 | The other thing that you notice once you configure a kernel is that | ||
191 | the build process generates a build tree that is separate from your kernel's local Git | ||
192 | source repository tree. | ||
193 | This build tree has a name that uses the following form, where | ||
194 | <filename>${MACHINE}</filename> is the metadata name of the machine (BSP) and "kernel_type" is one | ||
195 | of the Yocto Project supported kernel types (e.g. "standard"): | ||
196 | <literallayout class='monospaced'> | ||
197 | linux-${MACHINE}-<kernel_type>-build | ||
198 | </literallayout> | ||
199 | </para> | ||
200 | |||
201 | <para> | ||
202 | The existing support in the <filename>kernel.org</filename> tree achieves this | ||
203 | default functionality. | ||
204 | </para> | ||
205 | |||
206 | <para> | ||
207 | This behavior means that all the generated files for a particular machine or BSP are now in | ||
208 | the build tree directory. | ||
209 | The files include the final <filename>.config</filename> file, all the <filename>.o</filename> | ||
210 | files, the <filename>.a</filename> files, and so forth. | ||
211 | Since each machine or BSP has its own separate | ||
212 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
213 | in its own separate branch | ||
214 | of the Git repository, you can easily switch between different builds. | ||
215 | </para> | ||
216 | </section> | ||
217 | </appendix> | ||
218 | <!-- | ||
219 | vim: expandtab tw=80 ts=4 | ||
220 | --> | ||
diff --git a/documentation/kernel-dev/kernel-dev-style.css b/documentation/kernel-dev/kernel-dev-style.css new file mode 100644 index 0000000..6e0c1c7 --- /dev/null +++ b/documentation/kernel-dev/kernel-dev-style.css | |||
@@ -0,0 +1,984 @@ | |||
1 | /* | ||
2 | Generic XHTML / DocBook XHTML CSS Stylesheet. | ||
3 | |||
4 | Browser wrangling and typographic design by | ||
5 | Oyvind Kolas / pippin@gimp.org | ||
6 | |||
7 | Customised for Poky by | ||
8 | Matthew Allum / mallum@o-hand.com | ||
9 | |||
10 | Thanks to: | ||
11 | Liam R. E. Quin | ||
12 | William Skaggs | ||
13 | Jakub Steiner | ||
14 | |||
15 | Structure | ||
16 | --------- | ||
17 | |||
18 | The stylesheet is divided into the following sections: | ||
19 | |||
20 | Positioning | ||
21 | Margins, paddings, width, font-size, clearing. | ||
22 | Decorations | ||
23 | Borders, style | ||
24 | Colors | ||
25 | Colors | ||
26 | Graphics | ||
27 | Graphical backgrounds | ||
28 | Nasty IE tweaks | ||
29 | Workarounds needed to make it work in internet explorer, | ||
30 | currently makes the stylesheet non validating, but up until | ||
31 | this point it is validating. | ||
32 | Mozilla extensions | ||
33 | Transparency for footer | ||
34 | Rounded corners on boxes | ||
35 | |||
36 | */ | ||
37 | |||
38 | |||
39 | /*************** / | ||
40 | / Positioning / | ||
41 | / ***************/ | ||
42 | |||
43 | body { | ||
44 | font-family: Verdana, Sans, sans-serif; | ||
45 | |||
46 | min-width: 640px; | ||
47 | width: 80%; | ||
48 | margin: 0em auto; | ||
49 | padding: 2em 5em 5em 5em; | ||
50 | color: #333; | ||
51 | } | ||
52 | |||
53 | h1,h2,h3,h4,h5,h6,h7 { | ||
54 | font-family: Arial, Sans; | ||
55 | color: #00557D; | ||
56 | clear: both; | ||
57 | } | ||
58 | |||
59 | h1 { | ||
60 | font-size: 2em; | ||
61 | text-align: left; | ||
62 | padding: 0em 0em 0em 0em; | ||
63 | margin: 2em 0em 0em 0em; | ||
64 | } | ||
65 | |||
66 | h2.subtitle { | ||
67 | margin: 0.10em 0em 3.0em 0em; | ||
68 | padding: 0em 0em 0em 0em; | ||
69 | font-size: 1.8em; | ||
70 | padding-left: 20%; | ||
71 | font-weight: normal; | ||
72 | font-style: italic; | ||
73 | } | ||
74 | |||
75 | h2 { | ||
76 | margin: 2em 0em 0.66em 0em; | ||
77 | padding: 0.5em 0em 0em 0em; | ||
78 | font-size: 1.5em; | ||
79 | font-weight: bold; | ||
80 | } | ||
81 | |||
82 | h3.subtitle { | ||
83 | margin: 0em 0em 1em 0em; | ||
84 | padding: 0em 0em 0em 0em; | ||
85 | font-size: 142.14%; | ||
86 | text-align: right; | ||
87 | } | ||
88 | |||
89 | h3 { | ||
90 | margin: 1em 0em 0.5em 0em; | ||
91 | padding: 1em 0em 0em 0em; | ||
92 | font-size: 140%; | ||
93 | font-weight: bold; | ||
94 | } | ||
95 | |||
96 | h4 { | ||
97 | margin: 1em 0em 0.5em 0em; | ||
98 | padding: 1em 0em 0em 0em; | ||
99 | font-size: 120%; | ||
100 | font-weight: bold; | ||
101 | } | ||
102 | |||
103 | h5 { | ||
104 | margin: 1em 0em 0.5em 0em; | ||
105 | padding: 1em 0em 0em 0em; | ||
106 | font-size: 110%; | ||
107 | font-weight: bold; | ||
108 | } | ||
109 | |||
110 | h6 { | ||
111 | margin: 1em 0em 0em 0em; | ||
112 | padding: 1em 0em 0em 0em; | ||
113 | font-size: 110%; | ||
114 | font-weight: bold; | ||
115 | } | ||
116 | |||
117 | .authorgroup { | ||
118 | background-color: transparent; | ||
119 | background-repeat: no-repeat; | ||
120 | padding-top: 256px; | ||
121 | background-image: url("figures/kernel-dev-title.png"); | ||
122 | background-position: left top; | ||
123 | margin-top: -256px; | ||
124 | padding-right: 50px; | ||
125 | margin-left: 0px; | ||
126 | text-align: right; | ||
127 | width: 740px; | ||
128 | } | ||
129 | |||
130 | h3.author { | ||
131 | margin: 0em 0me 0em 0em; | ||
132 | padding: 0em 0em 0em 0em; | ||
133 | font-weight: normal; | ||
134 | font-size: 100%; | ||
135 | color: #333; | ||
136 | clear: both; | ||
137 | } | ||
138 | |||
139 | .author tt.email { | ||
140 | font-size: 66%; | ||
141 | } | ||
142 | |||
143 | .titlepage hr { | ||
144 | width: 0em; | ||
145 | clear: both; | ||
146 | } | ||
147 | |||
148 | .revhistory { | ||
149 | padding-top: 2em; | ||
150 | clear: both; | ||
151 | } | ||
152 | |||
153 | .toc, | ||
154 | .list-of-tables, | ||
155 | .list-of-examples, | ||
156 | .list-of-figures { | ||
157 | padding: 1.33em 0em 2.5em 0em; | ||
158 | color: #00557D; | ||
159 | } | ||
160 | |||
161 | .toc p, | ||
162 | .list-of-tables p, | ||
163 | .list-of-figures p, | ||
164 | .list-of-examples p { | ||
165 | padding: 0em 0em 0em 0em; | ||
166 | padding: 0em 0em 0.3em; | ||
167 | margin: 1.5em 0em 0em 0em; | ||
168 | } | ||
169 | |||
170 | .toc p b, | ||
171 | .list-of-tables p b, | ||
172 | .list-of-figures p b, | ||
173 | .list-of-examples p b{ | ||
174 | font-size: 100.0%; | ||
175 | font-weight: bold; | ||
176 | } | ||
177 | |||
178 | .toc dl, | ||
179 | .list-of-tables dl, | ||
180 | .list-of-figures dl, | ||
181 | .list-of-examples dl { | ||
182 | margin: 0em 0em 0.5em 0em; | ||
183 | padding: 0em 0em 0em 0em; | ||
184 | } | ||
185 | |||
186 | .toc dt { | ||
187 | margin: 0em 0em 0em 0em; | ||
188 | padding: 0em 0em 0em 0em; | ||
189 | } | ||
190 | |||
191 | .toc dd { | ||
192 | margin: 0em 0em 0em 2.6em; | ||
193 | padding: 0em 0em 0em 0em; | ||
194 | } | ||
195 | |||
196 | div.glossary dl, | ||
197 | div.variablelist dl { | ||
198 | } | ||
199 | |||
200 | .glossary dl dt, | ||
201 | .variablelist dl dt, | ||
202 | .variablelist dl dt span.term { | ||
203 | font-weight: normal; | ||
204 | width: 20em; | ||
205 | text-align: right; | ||
206 | } | ||
207 | |||
208 | .variablelist dl dt { | ||
209 | margin-top: 0.5em; | ||
210 | } | ||
211 | |||
212 | .glossary dl dd, | ||
213 | .variablelist dl dd { | ||
214 | margin-top: -1em; | ||
215 | margin-left: 25.5em; | ||
216 | } | ||
217 | |||
218 | .glossary dd p, | ||
219 | .variablelist dd p { | ||
220 | margin-top: 0em; | ||
221 | margin-bottom: 1em; | ||
222 | } | ||
223 | |||
224 | |||
225 | div.calloutlist table td { | ||
226 | padding: 0em 0em 0em 0em; | ||
227 | margin: 0em 0em 0em 0em; | ||
228 | } | ||
229 | |||
230 | div.calloutlist table td p { | ||
231 | margin-top: 0em; | ||
232 | margin-bottom: 1em; | ||
233 | } | ||
234 | |||
235 | div p.copyright { | ||
236 | text-align: left; | ||
237 | } | ||
238 | |||
239 | div.legalnotice p.legalnotice-title { | ||
240 | margin-bottom: 0em; | ||
241 | } | ||
242 | |||
243 | p { | ||
244 | line-height: 1.5em; | ||
245 | margin-top: 0em; | ||
246 | |||
247 | } | ||
248 | |||
249 | dl { | ||
250 | padding-top: 0em; | ||
251 | } | ||
252 | |||
253 | hr { | ||
254 | border: solid 1px; | ||
255 | } | ||
256 | |||
257 | |||
258 | .mediaobject, | ||
259 | .mediaobjectco { | ||
260 | text-align: center; | ||
261 | } | ||
262 | |||
263 | img { | ||
264 | border: none; | ||
265 | } | ||
266 | |||
267 | ul { | ||
268 | padding: 0em 0em 0em 1.5em; | ||
269 | } | ||
270 | |||
271 | ul li { | ||
272 | padding: 0em 0em 0em 0em; | ||
273 | } | ||
274 | |||
275 | ul li p { | ||
276 | text-align: left; | ||
277 | } | ||
278 | |||
279 | table { | ||
280 | width :100%; | ||
281 | } | ||
282 | |||
283 | th { | ||
284 | padding: 0.25em; | ||
285 | text-align: left; | ||
286 | font-weight: normal; | ||
287 | vertical-align: top; | ||
288 | } | ||
289 | |||
290 | td { | ||
291 | padding: 0.25em; | ||
292 | vertical-align: top; | ||
293 | } | ||
294 | |||
295 | p a[id] { | ||
296 | margin: 0px; | ||
297 | padding: 0px; | ||
298 | display: inline; | ||
299 | background-image: none; | ||
300 | } | ||
301 | |||
302 | a { | ||
303 | text-decoration: underline; | ||
304 | color: #444; | ||
305 | } | ||
306 | |||
307 | pre { | ||
308 | overflow: auto; | ||
309 | } | ||
310 | |||
311 | a:hover { | ||
312 | text-decoration: underline; | ||
313 | /*font-weight: bold;*/ | ||
314 | } | ||
315 | |||
316 | /* This style defines how the permalink character | ||
317 | appears by itself and when hovered over with | ||
318 | the mouse. */ | ||
319 | |||
320 | [alt='Permalink'] { color: #eee; } | ||
321 | [alt='Permalink']:hover { color: black; } | ||
322 | |||
323 | |||
324 | div.informalfigure, | ||
325 | div.informalexample, | ||
326 | div.informaltable, | ||
327 | div.figure, | ||
328 | div.table, | ||
329 | div.example { | ||
330 | margin: 1em 0em; | ||
331 | padding: 1em; | ||
332 | page-break-inside: avoid; | ||
333 | } | ||
334 | |||
335 | |||
336 | div.informalfigure p.title b, | ||
337 | div.informalexample p.title b, | ||
338 | div.informaltable p.title b, | ||
339 | div.figure p.title b, | ||
340 | div.example p.title b, | ||
341 | div.table p.title b{ | ||
342 | padding-top: 0em; | ||
343 | margin-top: 0em; | ||
344 | font-size: 100%; | ||
345 | font-weight: normal; | ||
346 | } | ||
347 | |||
348 | .mediaobject .caption, | ||
349 | .mediaobject .caption p { | ||
350 | text-align: center; | ||
351 | font-size: 80%; | ||
352 | padding-top: 0.5em; | ||
353 | padding-bottom: 0.5em; | ||
354 | } | ||
355 | |||
356 | .epigraph { | ||
357 | padding-left: 55%; | ||
358 | margin-bottom: 1em; | ||
359 | } | ||
360 | |||
361 | .epigraph p { | ||
362 | text-align: left; | ||
363 | } | ||
364 | |||
365 | .epigraph .quote { | ||
366 | font-style: italic; | ||
367 | } | ||
368 | .epigraph .attribution { | ||
369 | font-style: normal; | ||
370 | text-align: right; | ||
371 | } | ||
372 | |||
373 | span.application { | ||
374 | font-style: italic; | ||
375 | } | ||
376 | |||
377 | .programlisting { | ||
378 | font-family: monospace; | ||
379 | font-size: 80%; | ||
380 | white-space: pre; | ||
381 | margin: 1.33em 0em; | ||
382 | padding: 1.33em; | ||
383 | } | ||
384 | |||
385 | .tip, | ||
386 | .warning, | ||
387 | .caution, | ||
388 | .note { | ||
389 | margin-top: 1em; | ||
390 | margin-bottom: 1em; | ||
391 | |||
392 | } | ||
393 | |||
394 | /* force full width of table within div */ | ||
395 | .tip table, | ||
396 | .warning table, | ||
397 | .caution table, | ||
398 | .note table { | ||
399 | border: none; | ||
400 | width: 100%; | ||
401 | } | ||
402 | |||
403 | |||
404 | .tip table th, | ||
405 | .warning table th, | ||
406 | .caution table th, | ||
407 | .note table th { | ||
408 | padding: 0.8em 0.0em 0.0em 0.0em; | ||
409 | margin : 0em 0em 0em 0em; | ||
410 | } | ||
411 | |||
412 | .tip p, | ||
413 | .warning p, | ||
414 | .caution p, | ||
415 | .note p { | ||
416 | margin-top: 0.5em; | ||
417 | margin-bottom: 0.5em; | ||
418 | padding-right: 1em; | ||
419 | text-align: left; | ||
420 | } | ||
421 | |||
422 | .acronym { | ||
423 | text-transform: uppercase; | ||
424 | } | ||
425 | |||
426 | b.keycap, | ||
427 | .keycap { | ||
428 | padding: 0.09em 0.3em; | ||
429 | margin: 0em; | ||
430 | } | ||
431 | |||
432 | .itemizedlist li { | ||
433 | clear: none; | ||
434 | } | ||
435 | |||
436 | .filename { | ||
437 | font-size: medium; | ||
438 | font-family: Courier, monospace; | ||
439 | } | ||
440 | |||
441 | |||
442 | div.navheader, div.heading{ | ||
443 | position: absolute; | ||
444 | left: 0em; | ||
445 | top: 0em; | ||
446 | width: 100%; | ||
447 | background-color: #cdf; | ||
448 | width: 100%; | ||
449 | } | ||
450 | |||
451 | div.navfooter, div.footing{ | ||
452 | position: fixed; | ||
453 | left: 0em; | ||
454 | bottom: 0em; | ||
455 | background-color: #eee; | ||
456 | width: 100%; | ||
457 | } | ||
458 | |||
459 | |||
460 | div.navheader td, | ||
461 | div.navfooter td { | ||
462 | font-size: 66%; | ||
463 | } | ||
464 | |||
465 | div.navheader table th { | ||
466 | /*font-family: Georgia, Times, serif;*/ | ||
467 | /*font-size: x-large;*/ | ||
468 | font-size: 80%; | ||
469 | } | ||
470 | |||
471 | div.navheader table { | ||
472 | border-left: 0em; | ||
473 | border-right: 0em; | ||
474 | border-top: 0em; | ||
475 | width: 100%; | ||
476 | } | ||
477 | |||
478 | div.navfooter table { | ||
479 | border-left: 0em; | ||
480 | border-right: 0em; | ||
481 | border-bottom: 0em; | ||
482 | width: 100%; | ||
483 | } | ||
484 | |||
485 | div.navheader table td a, | ||
486 | div.navfooter table td a { | ||
487 | color: #777; | ||
488 | text-decoration: none; | ||
489 | } | ||
490 | |||
491 | /* normal text in the footer */ | ||
492 | div.navfooter table td { | ||
493 | color: black; | ||
494 | } | ||
495 | |||
496 | div.navheader table td a:visited, | ||
497 | div.navfooter table td a:visited { | ||
498 | color: #444; | ||
499 | } | ||
500 | |||
501 | |||
502 | /* links in header and footer */ | ||
503 | div.navheader table td a:hover, | ||
504 | div.navfooter table td a:hover { | ||
505 | text-decoration: underline; | ||
506 | background-color: transparent; | ||
507 | color: #33a; | ||
508 | } | ||
509 | |||
510 | div.navheader hr, | ||
511 | div.navfooter hr { | ||
512 | display: none; | ||
513 | } | ||
514 | |||
515 | |||
516 | .qandaset tr.question td p { | ||
517 | margin: 0em 0em 1em 0em; | ||
518 | padding: 0em 0em 0em 0em; | ||
519 | } | ||
520 | |||
521 | .qandaset tr.answer td p { | ||
522 | margin: 0em 0em 1em 0em; | ||
523 | padding: 0em 0em 0em 0em; | ||
524 | } | ||
525 | .answer td { | ||
526 | padding-bottom: 1.5em; | ||
527 | } | ||
528 | |||
529 | .emphasis { | ||
530 | font-weight: bold; | ||
531 | } | ||
532 | |||
533 | |||
534 | /************* / | ||
535 | / decorations / | ||
536 | / *************/ | ||
537 | |||
538 | .titlepage { | ||
539 | } | ||
540 | |||
541 | .part .title { | ||
542 | } | ||
543 | |||
544 | .subtitle { | ||
545 | border: none; | ||
546 | } | ||
547 | |||
548 | /* | ||
549 | h1 { | ||
550 | border: none; | ||
551 | } | ||
552 | |||
553 | h2 { | ||
554 | border-top: solid 0.2em; | ||
555 | border-bottom: solid 0.06em; | ||
556 | } | ||
557 | |||
558 | h3 { | ||
559 | border-top: 0em; | ||
560 | border-bottom: solid 0.06em; | ||
561 | } | ||
562 | |||
563 | h4 { | ||
564 | border: 0em; | ||
565 | border-bottom: solid 0.06em; | ||
566 | } | ||
567 | |||
568 | h5 { | ||
569 | border: 0em; | ||
570 | } | ||
571 | */ | ||
572 | |||
573 | .programlisting { | ||
574 | border: solid 1px; | ||
575 | } | ||
576 | |||
577 | div.figure, | ||
578 | div.table, | ||
579 | div.informalfigure, | ||
580 | div.informaltable, | ||
581 | div.informalexample, | ||
582 | div.example { | ||
583 | border: 1px solid; | ||
584 | } | ||
585 | |||
586 | |||
587 | |||
588 | .tip, | ||
589 | .warning, | ||
590 | .caution, | ||
591 | .note { | ||
592 | border: 1px solid; | ||
593 | } | ||
594 | |||
595 | .tip table th, | ||
596 | .warning table th, | ||
597 | .caution table th, | ||
598 | .note table th { | ||
599 | border-bottom: 1px solid; | ||
600 | } | ||
601 | |||
602 | .question td { | ||
603 | border-top: 1px solid black; | ||
604 | } | ||
605 | |||
606 | .answer { | ||
607 | } | ||
608 | |||
609 | |||
610 | b.keycap, | ||
611 | .keycap { | ||
612 | border: 1px solid; | ||
613 | } | ||
614 | |||
615 | |||
616 | div.navheader, div.heading{ | ||
617 | border-bottom: 1px solid; | ||
618 | } | ||
619 | |||
620 | |||
621 | div.navfooter, div.footing{ | ||
622 | border-top: 1px solid; | ||
623 | } | ||
624 | |||
625 | /********* / | ||
626 | / colors / | ||
627 | / *********/ | ||
628 | |||
629 | body { | ||
630 | color: #333; | ||
631 | background: white; | ||
632 | } | ||
633 | |||
634 | a { | ||
635 | background: transparent; | ||
636 | } | ||
637 | |||
638 | a:hover { | ||
639 | background-color: #dedede; | ||
640 | } | ||
641 | |||
642 | |||
643 | h1, | ||
644 | h2, | ||
645 | h3, | ||
646 | h4, | ||
647 | h5, | ||
648 | h6, | ||
649 | h7, | ||
650 | h8 { | ||
651 | background-color: transparent; | ||
652 | } | ||
653 | |||
654 | hr { | ||
655 | border-color: #aaa; | ||
656 | } | ||
657 | |||
658 | |||
659 | .tip, .warning, .caution, .note { | ||
660 | border-color: #fff; | ||
661 | } | ||
662 | |||
663 | |||
664 | .tip table th, | ||
665 | .warning table th, | ||
666 | .caution table th, | ||
667 | .note table th { | ||
668 | border-bottom-color: #fff; | ||
669 | } | ||
670 | |||
671 | |||
672 | .warning { | ||
673 | background-color: #f0f0f2; | ||
674 | } | ||
675 | |||
676 | .caution { | ||
677 | background-color: #f0f0f2; | ||
678 | } | ||
679 | |||
680 | .tip { | ||
681 | background-color: #f0f0f2; | ||
682 | } | ||
683 | |||
684 | .note { | ||
685 | background-color: #f0f0f2; | ||
686 | } | ||
687 | |||
688 | .glossary dl dt, | ||
689 | .variablelist dl dt, | ||
690 | .variablelist dl dt span.term { | ||
691 | color: #044; | ||
692 | } | ||
693 | |||
694 | div.figure, | ||
695 | div.table, | ||
696 | div.example, | ||
697 | div.informalfigure, | ||
698 | div.informaltable, | ||
699 | div.informalexample { | ||
700 | border-color: #aaa; | ||
701 | } | ||
702 | |||
703 | pre.programlisting { | ||
704 | color: black; | ||
705 | background-color: #fff; | ||
706 | border-color: #aaa; | ||
707 | border-width: 2px; | ||
708 | } | ||
709 | |||
710 | .guimenu, | ||
711 | .guilabel, | ||
712 | .guimenuitem { | ||
713 | background-color: #eee; | ||
714 | } | ||
715 | |||
716 | |||
717 | b.keycap, | ||
718 | .keycap { | ||
719 | background-color: #eee; | ||
720 | border-color: #999; | ||
721 | } | ||
722 | |||
723 | |||
724 | div.navheader { | ||
725 | border-color: black; | ||
726 | } | ||
727 | |||
728 | |||
729 | div.navfooter { | ||
730 | border-color: black; | ||
731 | } | ||
732 | |||
733 | |||
734 | /*********** / | ||
735 | / graphics / | ||
736 | / ***********/ | ||
737 | |||
738 | /* | ||
739 | body { | ||
740 | background-image: url("images/body_bg.jpg"); | ||
741 | background-attachment: fixed; | ||
742 | } | ||
743 | |||
744 | .navheader, | ||
745 | .note, | ||
746 | .tip { | ||
747 | background-image: url("images/note_bg.jpg"); | ||
748 | background-attachment: fixed; | ||
749 | } | ||
750 | |||
751 | .warning, | ||
752 | .caution { | ||
753 | background-image: url("images/warning_bg.jpg"); | ||
754 | background-attachment: fixed; | ||
755 | } | ||
756 | |||
757 | .figure, | ||
758 | .informalfigure, | ||
759 | .example, | ||
760 | .informalexample, | ||
761 | .table, | ||
762 | .informaltable { | ||
763 | background-image: url("images/figure_bg.jpg"); | ||
764 | background-attachment: fixed; | ||
765 | } | ||
766 | |||
767 | */ | ||
768 | h1, | ||
769 | h2, | ||
770 | h3, | ||
771 | h4, | ||
772 | h5, | ||
773 | h6, | ||
774 | h7{ | ||
775 | } | ||
776 | |||
777 | /* | ||
778 | Example of how to stick an image as part of the title. | ||
779 | |||
780 | div.article .titlepage .title | ||
781 | { | ||
782 | background-image: url("figures/white-on-black.png"); | ||
783 | background-position: center; | ||
784 | background-repeat: repeat-x; | ||
785 | } | ||
786 | */ | ||
787 | |||
788 | div.preface .titlepage .title, | ||
789 | div.colophon .title, | ||
790 | div.chapter .titlepage .title, | ||
791 | div.article .titlepage .title | ||
792 | { | ||
793 | } | ||
794 | |||
795 | div.section div.section .titlepage .title, | ||
796 | div.sect2 .titlepage .title { | ||
797 | background: none; | ||
798 | } | ||
799 | |||
800 | |||
801 | h1.title { | ||
802 | background-color: transparent; | ||
803 | background-repeat: no-repeat; | ||
804 | height: 256px; | ||
805 | text-indent: -9000px; | ||
806 | overflow:hidden; | ||
807 | } | ||
808 | |||
809 | h2.subtitle { | ||
810 | background-color: transparent; | ||
811 | text-indent: -9000px; | ||
812 | overflow:hidden; | ||
813 | width: 0px; | ||
814 | display: none; | ||
815 | } | ||
816 | |||
817 | /*************************************** / | ||
818 | / pippin.gimp.org specific alterations / | ||
819 | / ***************************************/ | ||
820 | |||
821 | /* | ||
822 | div.heading, div.navheader { | ||
823 | color: #777; | ||
824 | font-size: 80%; | ||
825 | padding: 0; | ||
826 | margin: 0; | ||
827 | text-align: left; | ||
828 | position: absolute; | ||
829 | top: 0px; | ||
830 | left: 0px; | ||
831 | width: 100%; | ||
832 | height: 50px; | ||
833 | background: url('/gfx/heading_bg.png') transparent; | ||
834 | background-repeat: repeat-x; | ||
835 | background-attachment: fixed; | ||
836 | border: none; | ||
837 | } | ||
838 | |||
839 | div.heading a { | ||
840 | color: #444; | ||
841 | } | ||
842 | |||
843 | div.footing, div.navfooter { | ||
844 | border: none; | ||
845 | color: #ddd; | ||
846 | font-size: 80%; | ||
847 | text-align:right; | ||
848 | |||
849 | width: 100%; | ||
850 | padding-top: 10px; | ||
851 | position: absolute; | ||
852 | bottom: 0px; | ||
853 | left: 0px; | ||
854 | |||
855 | background: url('/gfx/footing_bg.png') transparent; | ||
856 | } | ||
857 | */ | ||
858 | |||
859 | |||
860 | |||
861 | /****************** / | ||
862 | / nasty ie tweaks / | ||
863 | / ******************/ | ||
864 | |||
865 | /* | ||
866 | div.heading, div.navheader { | ||
867 | width:expression(document.body.clientWidth + "px"); | ||
868 | } | ||
869 | |||
870 | div.footing, div.navfooter { | ||
871 | width:expression(document.body.clientWidth + "px"); | ||
872 | margin-left:expression("-5em"); | ||
873 | } | ||
874 | body { | ||
875 | padding:expression("4em 5em 0em 5em"); | ||
876 | } | ||
877 | */ | ||
878 | |||
879 | /**************************************** / | ||
880 | / mozilla vendor specific css extensions / | ||
881 | / ****************************************/ | ||
882 | /* | ||
883 | div.navfooter, div.footing{ | ||
884 | -moz-opacity: 0.8em; | ||
885 | } | ||
886 | |||
887 | div.figure, | ||
888 | div.table, | ||
889 | div.informalfigure, | ||
890 | div.informaltable, | ||
891 | div.informalexample, | ||
892 | div.example, | ||
893 | .tip, | ||
894 | .warning, | ||
895 | .caution, | ||
896 | .note { | ||
897 | -moz-border-radius: 0.5em; | ||
898 | } | ||
899 | |||
900 | b.keycap, | ||
901 | .keycap { | ||
902 | -moz-border-radius: 0.3em; | ||
903 | } | ||
904 | */ | ||
905 | |||
906 | table tr td table tr td { | ||
907 | display: none; | ||
908 | } | ||
909 | |||
910 | |||
911 | hr { | ||
912 | display: none; | ||
913 | } | ||
914 | |||
915 | table { | ||
916 | border: 0em; | ||
917 | } | ||
918 | |||
919 | .photo { | ||
920 | float: right; | ||
921 | margin-left: 1.5em; | ||
922 | margin-bottom: 1.5em; | ||
923 | margin-top: 0em; | ||
924 | max-width: 17em; | ||
925 | border: 1px solid gray; | ||
926 | padding: 3px; | ||
927 | background: white; | ||
928 | } | ||
929 | .seperator { | ||
930 | padding-top: 2em; | ||
931 | clear: both; | ||
932 | } | ||
933 | |||
934 | #validators { | ||
935 | margin-top: 5em; | ||
936 | text-align: right; | ||
937 | color: #777; | ||
938 | } | ||
939 | @media print { | ||
940 | body { | ||
941 | font-size: 8pt; | ||
942 | } | ||
943 | .noprint { | ||
944 | display: none; | ||
945 | } | ||
946 | } | ||
947 | |||
948 | |||
949 | .tip, | ||
950 | .note { | ||
951 | background: #f0f0f2; | ||
952 | color: #333; | ||
953 | padding: 20px; | ||
954 | margin: 20px; | ||
955 | } | ||
956 | |||
957 | .tip h3, | ||
958 | .note h3 { | ||
959 | padding: 0em; | ||
960 | margin: 0em; | ||
961 | font-size: 2em; | ||
962 | font-weight: bold; | ||
963 | color: #333; | ||
964 | } | ||
965 | |||
966 | .tip a, | ||
967 | .note a { | ||
968 | color: #333; | ||
969 | text-decoration: underline; | ||
970 | } | ||
971 | |||
972 | .footnote { | ||
973 | font-size: small; | ||
974 | color: #333; | ||
975 | } | ||
976 | |||
977 | /* Changes the announcement text */ | ||
978 | .tip h3, | ||
979 | .warning h3, | ||
980 | .caution h3, | ||
981 | .note h3 { | ||
982 | font-size:large; | ||
983 | color: #00557D; | ||
984 | } | ||
diff --git a/documentation/kernel-dev/kernel-dev.xml b/documentation/kernel-dev/kernel-dev.xml new file mode 100644 index 0000000..dddc003 --- /dev/null +++ b/documentation/kernel-dev/kernel-dev.xml | |||
@@ -0,0 +1,105 @@ | |||
1 | <!DOCTYPE book 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 | |||
5 | <book id='kernel-dev' lang='en' | ||
6 | xmlns:xi="http://www.w3.org/2003/XInclude" | ||
7 | xmlns="http://docbook.org/ns/docbook" | ||
8 | > | ||
9 | <bookinfo> | ||
10 | |||
11 | <mediaobject> | ||
12 | <imageobject> | ||
13 | <imagedata fileref='figures/kernel-dev-title.png' | ||
14 | format='SVG' | ||
15 | align='left' scalefit='1' width='100%'/> | ||
16 | </imageobject> | ||
17 | </mediaobject> | ||
18 | |||
19 | <title> | ||
20 | Yocto Project Linux Kernel Development Manual | ||
21 | </title> | ||
22 | |||
23 | <authorgroup> | ||
24 | <author> | ||
25 | <firstname>Darren</firstname> <surname>Hart</surname> | ||
26 | <affiliation> | ||
27 | <orgname>Intel Corporation</orgname> | ||
28 | </affiliation> | ||
29 | <email>darren.hart@intel.com</email> | ||
30 | </author> | ||
31 | </authorgroup> | ||
32 | |||
33 | <revhistory> | ||
34 | <revision> | ||
35 | <revnumber>1.4</revnumber> | ||
36 | <date>April 2013</date> | ||
37 | <revremark>Released with the Yocto Project 1.4 Release.</revremark> | ||
38 | </revision> | ||
39 | <revision> | ||
40 | <revnumber>1.5</revnumber> | ||
41 | <date>October 2013</date> | ||
42 | <revremark>Released with the Yocto Project 1.5 Release.</revremark> | ||
43 | </revision> | ||
44 | <revision> | ||
45 | <revnumber>1.5.1</revnumber> | ||
46 | <date>January 2014</date> | ||
47 | <revremark>Released with the Yocto Project 1.5.1 Release.</revremark> | ||
48 | </revision> | ||
49 | <revision> | ||
50 | <revnumber>1.6</revnumber> | ||
51 | <date>April 2014</date> | ||
52 | <revremark>Released with the Yocto Project 1.6 Release.</revremark> | ||
53 | </revision> | ||
54 | <revision> | ||
55 | <revnumber>1.7</revnumber> | ||
56 | <date>Fall of 2014</date> | ||
57 | <revremark>Released with the Yocto Project 1.7 Release.</revremark> | ||
58 | </revision> | ||
59 | </revhistory> | ||
60 | |||
61 | <copyright> | ||
62 | <year>©RIGHT_YEAR;</year> | ||
63 | <holder>Linux Foundation</holder> | ||
64 | </copyright> | ||
65 | |||
66 | <legalnotice> | ||
67 | <para> | ||
68 | Permission is granted to copy, distribute and/or modify this document under | ||
69 | the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England & Wales</ulink> as published by Creative Commons. | ||
70 | </para> | ||
71 | <note> | ||
72 | For the latest version of this manual associated with this | ||
73 | Yocto Project release, see the | ||
74 | <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink> | ||
75 | from the Yocto Project website. | ||
76 | </note> | ||
77 | </legalnotice> | ||
78 | |||
79 | </bookinfo> | ||
80 | |||
81 | <xi:include href="kernel-dev-intro.xml"/> | ||
82 | |||
83 | <xi:include href="kernel-dev-common.xml"/> | ||
84 | |||
85 | <xi:include href="kernel-dev-advanced.xml"/> | ||
86 | |||
87 | <xi:include href="kernel-dev-concepts-appx.xml"/> | ||
88 | |||
89 | <xi:include href="kernel-dev-maint-appx.xml"/> | ||
90 | |||
91 | <!-- | ||
92 | <xi:include href="kernel-dev-examples.xml"/> | ||
93 | --> | ||
94 | |||
95 | <xi:include href="kernel-dev-faq.xml"/> | ||
96 | |||
97 | <!-- <index id='index'> | ||
98 | <title>Index</title> | ||
99 | </index> | ||
100 | --> | ||
101 | |||
102 | </book> | ||
103 | <!-- | ||
104 | vim: expandtab tw=80 ts=4 | ||
105 | --> | ||
diff --git a/documentation/mega-manual/figures/adt-title.png b/documentation/mega-manual/figures/adt-title.png new file mode 100644 index 0000000..6e71e41 --- /dev/null +++ b/documentation/mega-manual/figures/adt-title.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/analysis-for-package-splitting.png b/documentation/mega-manual/figures/analysis-for-package-splitting.png new file mode 100644 index 0000000..04f2794 --- /dev/null +++ b/documentation/mega-manual/figures/analysis-for-package-splitting.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/app-dev-flow.png b/documentation/mega-manual/figures/app-dev-flow.png new file mode 100644 index 0000000..4927b93 --- /dev/null +++ b/documentation/mega-manual/figures/app-dev-flow.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/bsp-dev-flow.png b/documentation/mega-manual/figures/bsp-dev-flow.png new file mode 100644 index 0000000..540b0ab --- /dev/null +++ b/documentation/mega-manual/figures/bsp-dev-flow.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/bsp-title.png b/documentation/mega-manual/figures/bsp-title.png new file mode 100644 index 0000000..f624dd4 --- /dev/null +++ b/documentation/mega-manual/figures/bsp-title.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/buildhistory-web.png b/documentation/mega-manual/figures/buildhistory-web.png new file mode 100644 index 0000000..f6db86c --- /dev/null +++ b/documentation/mega-manual/figures/buildhistory-web.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/buildhistory.png b/documentation/mega-manual/figures/buildhistory.png new file mode 100644 index 0000000..edf98d9 --- /dev/null +++ b/documentation/mega-manual/figures/buildhistory.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/building-an-image.png b/documentation/mega-manual/figures/building-an-image.png new file mode 100755 index 0000000..1fbea5a --- /dev/null +++ b/documentation/mega-manual/figures/building-an-image.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/configuration-compile-autoreconf.png b/documentation/mega-manual/figures/configuration-compile-autoreconf.png new file mode 100644 index 0000000..a07464f --- /dev/null +++ b/documentation/mega-manual/figures/configuration-compile-autoreconf.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/cross-development-toolchains.png b/documentation/mega-manual/figures/cross-development-toolchains.png new file mode 100644 index 0000000..d36670a --- /dev/null +++ b/documentation/mega-manual/figures/cross-development-toolchains.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/dev-title.png b/documentation/mega-manual/figures/dev-title.png new file mode 100644 index 0000000..d3cac4a --- /dev/null +++ b/documentation/mega-manual/figures/dev-title.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/git-workflow.png b/documentation/mega-manual/figures/git-workflow.png new file mode 100644 index 0000000..e401330 --- /dev/null +++ b/documentation/mega-manual/figures/git-workflow.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/image-generation.png b/documentation/mega-manual/figures/image-generation.png new file mode 100644 index 0000000..ab96258 --- /dev/null +++ b/documentation/mega-manual/figures/image-generation.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/images.png b/documentation/mega-manual/figures/images.png new file mode 100644 index 0000000..d99eac1 --- /dev/null +++ b/documentation/mega-manual/figures/images.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/index-downloads.png b/documentation/mega-manual/figures/index-downloads.png new file mode 100644 index 0000000..c907997 --- /dev/null +++ b/documentation/mega-manual/figures/index-downloads.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/kernel-architecture-overview.png b/documentation/mega-manual/figures/kernel-architecture-overview.png new file mode 100755 index 0000000..2aad172 --- /dev/null +++ b/documentation/mega-manual/figures/kernel-architecture-overview.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/kernel-dev-flow.png b/documentation/mega-manual/figures/kernel-dev-flow.png new file mode 100644 index 0000000..009105d --- /dev/null +++ b/documentation/mega-manual/figures/kernel-dev-flow.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/kernel-dev-title.png b/documentation/mega-manual/figures/kernel-dev-title.png new file mode 100644 index 0000000..7a8dd54 --- /dev/null +++ b/documentation/mega-manual/figures/kernel-dev-title.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/kernel-overview-1.png b/documentation/mega-manual/figures/kernel-overview-1.png new file mode 100644 index 0000000..116c0b9 --- /dev/null +++ b/documentation/mega-manual/figures/kernel-overview-1.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/kernel-overview-2-generic.png b/documentation/mega-manual/figures/kernel-overview-2-generic.png new file mode 100644 index 0000000..889ff1b --- /dev/null +++ b/documentation/mega-manual/figures/kernel-overview-2-generic.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/kernel-title.png b/documentation/mega-manual/figures/kernel-title.png new file mode 100644 index 0000000..59d86c0 --- /dev/null +++ b/documentation/mega-manual/figures/kernel-title.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/kernelshark-all.png b/documentation/mega-manual/figures/kernelshark-all.png new file mode 100644 index 0000000..99b40ba --- /dev/null +++ b/documentation/mega-manual/figures/kernelshark-all.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/kernelshark-choose-events.png b/documentation/mega-manual/figures/kernelshark-choose-events.png new file mode 100644 index 0000000..e8dd62a --- /dev/null +++ b/documentation/mega-manual/figures/kernelshark-choose-events.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/kernelshark-i915-display.png b/documentation/mega-manual/figures/kernelshark-i915-display.png new file mode 100644 index 0000000..bb0edfb --- /dev/null +++ b/documentation/mega-manual/figures/kernelshark-i915-display.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/kernelshark-output-display.png b/documentation/mega-manual/figures/kernelshark-output-display.png new file mode 100644 index 0000000..ae2d0e5 --- /dev/null +++ b/documentation/mega-manual/figures/kernelshark-output-display.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/layer-input.png b/documentation/mega-manual/figures/layer-input.png new file mode 100644 index 0000000..0a4f2e7 --- /dev/null +++ b/documentation/mega-manual/figures/layer-input.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/lttngmain0.png b/documentation/mega-manual/figures/lttngmain0.png new file mode 100644 index 0000000..5f60113 --- /dev/null +++ b/documentation/mega-manual/figures/lttngmain0.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/oprofileui-busybox.png b/documentation/mega-manual/figures/oprofileui-busybox.png new file mode 100644 index 0000000..a8275c6 --- /dev/null +++ b/documentation/mega-manual/figures/oprofileui-busybox.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/oprofileui-copy-to-user.png b/documentation/mega-manual/figures/oprofileui-copy-to-user.png new file mode 100644 index 0000000..deb6470 --- /dev/null +++ b/documentation/mega-manual/figures/oprofileui-copy-to-user.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/oprofileui-downloading.png b/documentation/mega-manual/figures/oprofileui-downloading.png new file mode 100644 index 0000000..57742d6 --- /dev/null +++ b/documentation/mega-manual/figures/oprofileui-downloading.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/oprofileui-processes.png b/documentation/mega-manual/figures/oprofileui-processes.png new file mode 100644 index 0000000..ae54702 --- /dev/null +++ b/documentation/mega-manual/figures/oprofileui-processes.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/package-feeds.png b/documentation/mega-manual/figures/package-feeds.png new file mode 100644 index 0000000..4bc311f --- /dev/null +++ b/documentation/mega-manual/figures/package-feeds.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/patching.png b/documentation/mega-manual/figures/patching.png new file mode 100644 index 0000000..8ecd018 --- /dev/null +++ b/documentation/mega-manual/figures/patching.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-probe-do_fork-profile.png b/documentation/mega-manual/figures/perf-probe-do_fork-profile.png new file mode 100644 index 0000000..1a1070d --- /dev/null +++ b/documentation/mega-manual/figures/perf-probe-do_fork-profile.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-report-cycles-u.png b/documentation/mega-manual/figures/perf-report-cycles-u.png new file mode 100644 index 0000000..68ec6af --- /dev/null +++ b/documentation/mega-manual/figures/perf-report-cycles-u.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-systemwide-libc.png b/documentation/mega-manual/figures/perf-systemwide-libc.png new file mode 100644 index 0000000..2b72869 --- /dev/null +++ b/documentation/mega-manual/figures/perf-systemwide-libc.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-systemwide.png b/documentation/mega-manual/figures/perf-systemwide.png new file mode 100644 index 0000000..12ce244 --- /dev/null +++ b/documentation/mega-manual/figures/perf-systemwide.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-wget-busybox-annotate-menu.png b/documentation/mega-manual/figures/perf-wget-busybox-annotate-menu.png new file mode 100644 index 0000000..ceb34ea --- /dev/null +++ b/documentation/mega-manual/figures/perf-wget-busybox-annotate-menu.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-wget-busybox-annotate-udhcpc.png b/documentation/mega-manual/figures/perf-wget-busybox-annotate-udhcpc.png new file mode 100644 index 0000000..3581e9d --- /dev/null +++ b/documentation/mega-manual/figures/perf-wget-busybox-annotate-udhcpc.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-wget-busybox-debuginfo.png b/documentation/mega-manual/figures/perf-wget-busybox-debuginfo.png new file mode 100644 index 0000000..c317b49 --- /dev/null +++ b/documentation/mega-manual/figures/perf-wget-busybox-debuginfo.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom-menu.png b/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom-menu.png new file mode 100644 index 0000000..1913c86 --- /dev/null +++ b/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom-menu.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom.png b/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom.png new file mode 100644 index 0000000..a1962c4 --- /dev/null +++ b/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-wget-busybox-expanded-stripped.png b/documentation/mega-manual/figures/perf-wget-busybox-expanded-stripped.png new file mode 100644 index 0000000..b642d06 --- /dev/null +++ b/documentation/mega-manual/figures/perf-wget-busybox-expanded-stripped.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-wget-flat-stripped.png b/documentation/mega-manual/figures/perf-wget-flat-stripped.png new file mode 100644 index 0000000..c8f395a --- /dev/null +++ b/documentation/mega-manual/figures/perf-wget-flat-stripped.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png b/documentation/mega-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png new file mode 100644 index 0000000..bb7c764 --- /dev/null +++ b/documentation/mega-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png b/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png new file mode 100644 index 0000000..a799af5 --- /dev/null +++ b/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png b/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png new file mode 100644 index 0000000..e91808a --- /dev/null +++ b/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png b/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png new file mode 100644 index 0000000..812302d --- /dev/null +++ b/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/poky-title.png b/documentation/mega-manual/figures/poky-title.png new file mode 100644 index 0000000..2893d84 --- /dev/null +++ b/documentation/mega-manual/figures/poky-title.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/profile-title.png b/documentation/mega-manual/figures/profile-title.png new file mode 100644 index 0000000..ce5c682 --- /dev/null +++ b/documentation/mega-manual/figures/profile-title.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/pybootchartgui-linux-yocto.png b/documentation/mega-manual/figures/pybootchartgui-linux-yocto.png new file mode 100644 index 0000000..2b6bfda --- /dev/null +++ b/documentation/mega-manual/figures/pybootchartgui-linux-yocto.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/pychart-linux-yocto-rpm-nostrip.png b/documentation/mega-manual/figures/pychart-linux-yocto-rpm-nostrip.png new file mode 100644 index 0000000..444675c --- /dev/null +++ b/documentation/mega-manual/figures/pychart-linux-yocto-rpm-nostrip.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/pychart-linux-yocto-rpm.png b/documentation/mega-manual/figures/pychart-linux-yocto-rpm.png new file mode 100644 index 0000000..8ee3535 --- /dev/null +++ b/documentation/mega-manual/figures/pychart-linux-yocto-rpm.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/recipe-workflow.png b/documentation/mega-manual/figures/recipe-workflow.png new file mode 100644 index 0000000..c0e960b --- /dev/null +++ b/documentation/mega-manual/figures/recipe-workflow.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/sched-wakeup-profile.png b/documentation/mega-manual/figures/sched-wakeup-profile.png new file mode 100644 index 0000000..2f25811 --- /dev/null +++ b/documentation/mega-manual/figures/sched-wakeup-profile.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/sdk-generation.png b/documentation/mega-manual/figures/sdk-generation.png new file mode 100644 index 0000000..c37e274 --- /dev/null +++ b/documentation/mega-manual/figures/sdk-generation.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/sdk.png b/documentation/mega-manual/figures/sdk.png new file mode 100644 index 0000000..a539cc5 --- /dev/null +++ b/documentation/mega-manual/figures/sdk.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/source-fetching.png b/documentation/mega-manual/figures/source-fetching.png new file mode 100644 index 0000000..26aefb5 --- /dev/null +++ b/documentation/mega-manual/figures/source-fetching.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/source-input.png b/documentation/mega-manual/figures/source-input.png new file mode 100644 index 0000000..f751505 --- /dev/null +++ b/documentation/mega-manual/figures/source-input.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/source-repos.png b/documentation/mega-manual/figures/source-repos.png new file mode 100644 index 0000000..65c5f29 --- /dev/null +++ b/documentation/mega-manual/figures/source-repos.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/sysprof-callers.png b/documentation/mega-manual/figures/sysprof-callers.png new file mode 100644 index 0000000..640c8d9 --- /dev/null +++ b/documentation/mega-manual/figures/sysprof-callers.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/sysprof-copy-from-user.png b/documentation/mega-manual/figures/sysprof-copy-from-user.png new file mode 100644 index 0000000..8d31427 --- /dev/null +++ b/documentation/mega-manual/figures/sysprof-copy-from-user.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/sysprof-copy-to-user.png b/documentation/mega-manual/figures/sysprof-copy-to-user.png new file mode 100644 index 0000000..7a5bab7 --- /dev/null +++ b/documentation/mega-manual/figures/sysprof-copy-to-user.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/user-configuration.png b/documentation/mega-manual/figures/user-configuration.png new file mode 100644 index 0000000..f2b3f8e --- /dev/null +++ b/documentation/mega-manual/figures/user-configuration.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/using-a-pre-built-image.png b/documentation/mega-manual/figures/using-a-pre-built-image.png new file mode 100644 index 0000000..b03130d --- /dev/null +++ b/documentation/mega-manual/figures/using-a-pre-built-image.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/yocto-environment-ref.png b/documentation/mega-manual/figures/yocto-environment-ref.png new file mode 100644 index 0000000..650c6c8 --- /dev/null +++ b/documentation/mega-manual/figures/yocto-environment-ref.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/yocto-environment.png b/documentation/mega-manual/figures/yocto-environment.png new file mode 100644 index 0000000..82b7a55 --- /dev/null +++ b/documentation/mega-manual/figures/yocto-environment.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/yocto-project-transp.png b/documentation/mega-manual/figures/yocto-project-transp.png new file mode 100755 index 0000000..31d2b14 --- /dev/null +++ b/documentation/mega-manual/figures/yocto-project-transp.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/figures/yp-download.png b/documentation/mega-manual/figures/yp-download.png new file mode 100644 index 0000000..7f1e5ca --- /dev/null +++ b/documentation/mega-manual/figures/yp-download.png | |||
Binary files differ | |||
diff --git a/documentation/mega-manual/mega-manual-customization.xsl b/documentation/mega-manual/mega-manual-customization.xsl new file mode 100644 index 0000000..eb95240 --- /dev/null +++ b/documentation/mega-manual/mega-manual-customization.xsl | |||
@@ -0,0 +1,34 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> | ||
3 | |||
4 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" /> | ||
5 | |||
6 | <xsl:param name="generate.toc"> | ||
7 | appendix toc | ||
8 | chapter toc | ||
9 | article nop | ||
10 | book nop | ||
11 | part nop | ||
12 | preface nop | ||
13 | qandadiv nop | ||
14 | qandaset nop | ||
15 | reference nop | ||
16 | section nop | ||
17 | set nop | ||
18 | </xsl:param> | ||
19 | |||
20 | <xsl:include href="../template/permalinks.xsl"/> | ||
21 | <xsl:include href="../template/section.title.xsl"/> | ||
22 | <xsl:include href="../template/component.title.xsl"/> | ||
23 | <xsl:include href="../template/division.title.xsl"/> | ||
24 | <xsl:include href="../template/formal.object.heading.xsl"/> | ||
25 | <xsl:include href="../template/gloss-permalinks.xsl"/> | ||
26 | |||
27 | <xsl:param name="html.stylesheet" select="'ref-style.css'" /> | ||
28 | <xsl:param name="chapter.autolabel" select="1" /> | ||
29 | <xsl:param name="appendix.autolabel">A</xsl:param> | ||
30 | <xsl:param name="section.autolabel" select="1" /> | ||
31 | <xsl:param name="section.label.includes.component.label" select="1" /> | ||
32 | <xsl:param name="generate.id.attributes" select="1" /> | ||
33 | |||
34 | </xsl:stylesheet> | ||
diff --git a/documentation/mega-manual/mega-manual.xml b/documentation/mega-manual/mega-manual.xml new file mode 100644 index 0000000..01af789 --- /dev/null +++ b/documentation/mega-manual/mega-manual.xml | |||
@@ -0,0 +1,53 @@ | |||
1 | <!DOCTYPE book 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 | |||
5 | |||
6 | <book id='mega-manual' lang='en' | ||
7 | xmlns:xi="http://www.w3.org/2003/XInclude" | ||
8 | xmlns="http://docbook.org/ns/docbook" | ||
9 | > | ||
10 | |||
11 | <xi:include | ||
12 | xmlns:xi="http://www.w3.org/2003/XInclude" href="../yocto-project-qs/yocto-project-qs.xml"/> | ||
13 | |||
14 | <para><imagedata fileref="figures/dev-title.png" width="100%" align="left" scalefit="1" /></para> | ||
15 | |||
16 | <xi:include | ||
17 | xmlns:xi="http://www.w3.org/2003/XInclude" href="../dev-manual/dev-manual.xml"/> | ||
18 | |||
19 | <para><imagedata fileref="figures/adt-title.png" width="100%" align="left" scalefit="1" /></para> | ||
20 | |||
21 | <xi:include | ||
22 | xmlns:xi="http://www.w3.org/2003/XInclude" href="../adt-manual/adt-manual.xml"/> | ||
23 | |||
24 | <para><imagedata fileref="figures/bsp-title.png" width="100%" align="left" scalefit="1" /></para> | ||
25 | |||
26 | <xi:include | ||
27 | xmlns:xi="http://www.w3.org/2003/XInclude" href="../bsp-guide/bsp-guide.xml"/> | ||
28 | |||
29 | <para><imagedata fileref="figures/kernel-dev-title.png" width="100%" align="left" scalefit="1" /></para> | ||
30 | |||
31 | <xi:include | ||
32 | xmlns:xi="http://www.w3.org/2003/XInclude" href="../kernel-dev/kernel-dev.xml"/> | ||
33 | |||
34 | <para><imagedata fileref="figures/profile-title.png" width="100%" align="left" scalefit="1" /></para> | ||
35 | |||
36 | <xi:include | ||
37 | xmlns:xi="http://www.w3.org/2003/XInclude" href="../profile-manual/profile-manual.xml"/> | ||
38 | |||
39 | <para><imagedata fileref="figures/poky-title.png" width="100%" align="left" scalefit="1" /></para> | ||
40 | |||
41 | <xi:include | ||
42 | xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-manual.xml"/> | ||
43 | |||
44 | <!-- <index id='index'> | ||
45 | <title>Index</title> | ||
46 | </index> | ||
47 | --> | ||
48 | |||
49 | </book> | ||
50 | |||
51 | <!-- | ||
52 | vim: expandtab tw=80 ts=4 | ||
53 | --> | ||
diff --git a/documentation/mega-manual/mega-style.css b/documentation/mega-manual/mega-style.css new file mode 100644 index 0000000..45b77ac --- /dev/null +++ b/documentation/mega-manual/mega-style.css | |||
@@ -0,0 +1,983 @@ | |||
1 | /* | ||
2 | Generic XHTML / DocBook XHTML CSS Stylesheet. | ||
3 | |||
4 | Browser wrangling and typographic design by | ||
5 | Oyvind Kolas / pippin@gimp.org | ||
6 | |||
7 | Customised for Poky by | ||
8 | Matthew Allum / mallum@o-hand.com | ||
9 | |||
10 | Thanks to: | ||
11 | Liam R. E. Quin | ||
12 | William Skaggs | ||
13 | Jakub Steiner | ||
14 | |||
15 | Structure | ||
16 | --------- | ||
17 | |||
18 | The stylesheet is divided into the following sections: | ||
19 | |||
20 | Positioning | ||
21 | Margins, paddings, width, font-size, clearing. | ||
22 | Decorations | ||
23 | Borders, style | ||
24 | Colors | ||
25 | Colors | ||
26 | Graphics | ||
27 | Graphical backgrounds | ||
28 | Nasty IE tweaks | ||
29 | Workarounds needed to make it work in internet explorer, | ||
30 | currently makes the stylesheet non validating, but up until | ||
31 | this point it is validating. | ||
32 | Mozilla extensions | ||
33 | Transparency for footer | ||
34 | Rounded corners on boxes | ||
35 | |||
36 | */ | ||
37 | |||
38 | |||
39 | /*************** / | ||
40 | / Positioning / | ||
41 | / ***************/ | ||
42 | |||
43 | body { | ||
44 | font-family: Verdana, Sans, sans-serif; | ||
45 | |||
46 | min-width: 640px; | ||
47 | width: 80%; | ||
48 | margin: 0em auto; | ||
49 | padding: 2em 5em 5em 5em; | ||
50 | color: #333; | ||
51 | } | ||
52 | |||
53 | h1,h2,h3,h4,h5,h6,h7 { | ||
54 | font-family: Arial, Sans; | ||
55 | color: #00557D; | ||
56 | clear: both; | ||
57 | } | ||
58 | |||
59 | h1 { | ||
60 | font-size: 2em; | ||
61 | text-align: left; | ||
62 | padding: 0em 0em 0em 0em; | ||
63 | margin: 2em 0em 0em 0em; | ||
64 | } | ||
65 | |||
66 | h2.subtitle { | ||
67 | margin: 0.10em 0em 3.0em 0em; | ||
68 | padding: 0em 0em 0em 0em; | ||
69 | font-size: 1.8em; | ||
70 | padding-left: 20%; | ||
71 | font-weight: normal; | ||
72 | font-style: italic; | ||
73 | } | ||
74 | |||
75 | h2 { | ||
76 | margin: 2em 0em 0.66em 0em; | ||
77 | padding: 0.5em 0em 0em 0em; | ||
78 | font-size: 1.5em; | ||
79 | font-weight: bold; | ||
80 | } | ||
81 | |||
82 | h3.subtitle { | ||
83 | margin: 0em 0em 1em 0em; | ||
84 | padding: 0em 0em 0em 0em; | ||
85 | font-size: 142.14%; | ||
86 | text-align: right; | ||
87 | } | ||
88 | |||
89 | h3 { | ||
90 | margin: 1em 0em 0.5em 0em; | ||
91 | padding: 1em 0em 0em 0em; | ||
92 | font-size: 140%; | ||
93 | font-weight: bold; | ||
94 | } | ||
95 | |||
96 | h4 { | ||
97 | margin: 1em 0em 0.5em 0em; | ||
98 | padding: 1em 0em 0em 0em; | ||
99 | font-size: 120%; | ||
100 | font-weight: bold; | ||
101 | } | ||
102 | |||
103 | h5 { | ||
104 | margin: 1em 0em 0.5em 0em; | ||
105 | padding: 1em 0em 0em 0em; | ||
106 | font-size: 110%; | ||
107 | font-weight: bold; | ||
108 | } | ||
109 | |||
110 | h6 { | ||
111 | margin: 1em 0em 0em 0em; | ||
112 | padding: 1em 0em 0em 0em; | ||
113 | font-size: 110%; | ||
114 | font-weight: bold; | ||
115 | } | ||
116 | |||
117 | .authorgroup { | ||
118 | background-color: transparent; | ||
119 | background-repeat: no-repeat; | ||
120 | padding-top: 256px; | ||
121 | background-position: top; | ||
122 | margin-top: -256px; | ||
123 | padding-right: 50px; | ||
124 | margin-left: 50px; | ||
125 | text-align: center; | ||
126 | width: 600px; | ||
127 | } | ||
128 | |||
129 | h3.author { | ||
130 | margin: 0em 0em 0em 0em; | ||
131 | padding: 0em 0em 0em 0em; | ||
132 | font-weight: normal; | ||
133 | font-size: 100%; | ||
134 | color: #333; | ||
135 | clear: both; | ||
136 | } | ||
137 | |||
138 | .author tt.email { | ||
139 | font-size: 66%; | ||
140 | } | ||
141 | |||
142 | .titlepage hr { | ||
143 | width: 0em; | ||
144 | clear: both; | ||
145 | } | ||
146 | |||
147 | .revhistory { | ||
148 | padding-top: 2em; | ||
149 | clear: both; | ||
150 | } | ||
151 | |||
152 | .toc, | ||
153 | .list-of-tables, | ||
154 | .list-of-examples, | ||
155 | .list-of-figures { | ||
156 | padding: 1.33em 0em 2.5em 0em; | ||
157 | color: #00557D; | ||
158 | } | ||
159 | |||
160 | .toc p, | ||
161 | .list-of-tables p, | ||
162 | .list-of-figures p, | ||
163 | .list-of-examples p { | ||
164 | padding: 0em 0em 0em 0em; | ||
165 | padding: 0em 0em 0.3em; | ||
166 | margin: 1.5em 0em 0em 0em; | ||
167 | } | ||
168 | |||
169 | .toc p b, | ||
170 | .list-of-tables p b, | ||
171 | .list-of-figures p b, | ||
172 | .list-of-examples p b{ | ||
173 | font-size: 100.0%; | ||
174 | font-weight: bold; | ||
175 | } | ||
176 | |||
177 | .toc dl, | ||
178 | .list-of-tables dl, | ||
179 | .list-of-figures dl, | ||
180 | .list-of-examples dl { | ||
181 | margin: 0em 0em 0.5em 0em; | ||
182 | padding: 0em 0em 0em 0em; | ||
183 | } | ||
184 | |||
185 | .toc dt { | ||
186 | margin: 0em 0em 0em 0em; | ||
187 | padding: 0em 0em 0em 0em; | ||
188 | } | ||
189 | |||
190 | .toc dd { | ||
191 | margin: 0em 0em 0em 2.6em; | ||
192 | padding: 0em 0em 0em 0em; | ||
193 | } | ||
194 | |||
195 | div.glossary dl, | ||
196 | div.variablelist dl { | ||
197 | } | ||
198 | |||
199 | .glossary dl dt, | ||
200 | .variablelist dl dt, | ||
201 | .variablelist dl dt span.term { | ||
202 | font-weight: normal; | ||
203 | width: 20em; | ||
204 | text-align: right; | ||
205 | } | ||
206 | |||
207 | .variablelist dl dt { | ||
208 | margin-top: 0.5em; | ||
209 | } | ||
210 | |||
211 | .glossary dl dd, | ||
212 | .variablelist dl dd { | ||
213 | margin-top: -1em; | ||
214 | margin-left: 25.5em; | ||
215 | } | ||
216 | |||
217 | .glossary dd p, | ||
218 | .variablelist dd p { | ||
219 | margin-top: 0em; | ||
220 | margin-bottom: 1em; | ||
221 | } | ||
222 | |||
223 | |||
224 | div.calloutlist table td { | ||
225 | padding: 0em 0em 0em 0em; | ||
226 | margin: 0em 0em 0em 0em; | ||
227 | } | ||
228 | |||
229 | div.calloutlist table td p { | ||
230 | margin-top: 0em; | ||
231 | margin-bottom: 1em; | ||
232 | } | ||
233 | |||
234 | div p.copyright { | ||
235 | text-align: left; | ||
236 | } | ||
237 | |||
238 | div.legalnotice p.legalnotice-title { | ||
239 | margin-bottom: 0em; | ||
240 | } | ||
241 | |||
242 | p { | ||
243 | line-height: 1.5em; | ||
244 | margin-top: 0em; | ||
245 | |||
246 | } | ||
247 | |||
248 | dl { | ||
249 | padding-top: 0em; | ||
250 | } | ||
251 | |||
252 | hr { | ||
253 | border: solid 1px; | ||
254 | } | ||
255 | |||
256 | |||
257 | .mediaobject, | ||
258 | .mediaobjectco { | ||
259 | text-align: center; | ||
260 | } | ||
261 | |||
262 | img { | ||
263 | border: none; | ||
264 | } | ||
265 | |||
266 | ul { | ||
267 | padding: 0em 0em 0em 1.5em; | ||
268 | } | ||
269 | |||
270 | ul li { | ||
271 | padding: 0em 0em 0em 0em; | ||
272 | } | ||
273 | |||
274 | ul li p { | ||
275 | text-align: left; | ||
276 | } | ||
277 | |||
278 | table { | ||
279 | width :100%; | ||
280 | } | ||
281 | |||
282 | th { | ||
283 | padding: 0.25em; | ||
284 | text-align: left; | ||
285 | font-weight: normal; | ||
286 | vertical-align: top; | ||
287 | } | ||
288 | |||
289 | td { | ||
290 | padding: 0.25em; | ||
291 | vertical-align: top; | ||
292 | } | ||
293 | |||
294 | p a[id] { | ||
295 | margin: 0px; | ||
296 | padding: 0px; | ||
297 | display: inline; | ||
298 | background-image: none; | ||
299 | } | ||
300 | |||
301 | a { | ||
302 | text-decoration: underline; | ||
303 | color: #444; | ||
304 | } | ||
305 | |||
306 | pre { | ||
307 | overflow: auto; | ||
308 | } | ||
309 | |||
310 | a:hover { | ||
311 | text-decoration: underline; | ||
312 | /*font-weight: bold;*/ | ||
313 | } | ||
314 | |||
315 | /* This style defines how the permalink character | ||
316 | appears by itself and when hovered over with | ||
317 | the mouse. */ | ||
318 | |||
319 | [alt='Permalink'] { color: #eee; } | ||
320 | [alt='Permalink']:hover { color: black; } | ||
321 | |||
322 | |||
323 | div.informalfigure, | ||
324 | div.informalexample, | ||
325 | div.informaltable, | ||
326 | div.figure, | ||
327 | div.table, | ||
328 | div.example { | ||
329 | margin: 1em 0em; | ||
330 | padding: 1em; | ||
331 | page-break-inside: avoid; | ||
332 | } | ||
333 | |||
334 | |||
335 | div.informalfigure p.title b, | ||
336 | div.informalexample p.title b, | ||
337 | div.informaltable p.title b, | ||
338 | div.figure p.title b, | ||
339 | div.example p.title b, | ||
340 | div.table p.title b{ | ||
341 | padding-top: 0em; | ||
342 | margin-top: 0em; | ||
343 | font-size: 100%; | ||
344 | font-weight: normal; | ||
345 | } | ||
346 | |||
347 | .mediaobject .caption, | ||
348 | .mediaobject .caption p { | ||
349 | text-align: center; | ||
350 | font-size: 80%; | ||
351 | padding-top: 0.5em; | ||
352 | padding-bottom: 0.5em; | ||
353 | } | ||
354 | |||
355 | .epigraph { | ||
356 | padding-left: 55%; | ||
357 | margin-bottom: 1em; | ||
358 | } | ||
359 | |||
360 | .epigraph p { | ||
361 | text-align: left; | ||
362 | } | ||
363 | |||
364 | .epigraph .quote { | ||
365 | font-style: italic; | ||
366 | } | ||
367 | .epigraph .attribution { | ||
368 | font-style: normal; | ||
369 | text-align: right; | ||
370 | } | ||
371 | |||
372 | span.application { | ||
373 | font-style: italic; | ||
374 | } | ||
375 | |||
376 | .programlisting { | ||
377 | font-family: monospace; | ||
378 | font-size: 80%; | ||
379 | white-space: pre; | ||
380 | margin: 1.33em 0em; | ||
381 | padding: 1.33em; | ||
382 | } | ||
383 | |||
384 | .tip, | ||
385 | .warning, | ||
386 | .caution, | ||
387 | .note { | ||
388 | margin-top: 1em; | ||
389 | margin-bottom: 1em; | ||
390 | |||
391 | } | ||
392 | |||
393 | /* force full width of table within div */ | ||
394 | .tip table, | ||
395 | .warning table, | ||
396 | .caution table, | ||
397 | .note table { | ||
398 | border: none; | ||
399 | width: 100%; | ||
400 | } | ||
401 | |||
402 | |||
403 | .tip table th, | ||
404 | .warning table th, | ||
405 | .caution table th, | ||
406 | .note table th { | ||
407 | padding: 0.8em 0.0em 0.0em 0.0em; | ||
408 | margin : 0em 0em 0em 0em; | ||
409 | } | ||
410 | |||
411 | .tip p, | ||
412 | .warning p, | ||
413 | .caution p, | ||
414 | .note p { | ||
415 | margin-top: 0.5em; | ||
416 | margin-bottom: 0.5em; | ||
417 | padding-right: 1em; | ||
418 | text-align: left; | ||
419 | } | ||
420 | |||
421 | .acronym { | ||
422 | text-transform: uppercase; | ||
423 | } | ||
424 | |||
425 | b.keycap, | ||
426 | .keycap { | ||
427 | padding: 0.09em 0.3em; | ||
428 | margin: 0em; | ||
429 | } | ||
430 | |||
431 | .itemizedlist li { | ||
432 | clear: none; | ||
433 | } | ||
434 | |||
435 | .filename { | ||
436 | font-size: medium; | ||
437 | font-family: Courier, monospace; | ||
438 | } | ||
439 | |||
440 | |||
441 | div.navheader, div.heading{ | ||
442 | position: absolute; | ||
443 | left: 0em; | ||
444 | top: 0em; | ||
445 | width: 100%; | ||
446 | background-color: #cdf; | ||
447 | width: 100%; | ||
448 | } | ||
449 | |||
450 | div.navfooter, div.footing{ | ||
451 | position: fixed; | ||
452 | left: 0em; | ||
453 | bottom: 0em; | ||
454 | background-color: #eee; | ||
455 | width: 100%; | ||
456 | } | ||
457 | |||
458 | |||
459 | div.navheader td, | ||
460 | div.navfooter td { | ||
461 | font-size: 66%; | ||
462 | } | ||
463 | |||
464 | div.navheader table th { | ||
465 | /*font-family: Georgia, Times, serif;*/ | ||
466 | /*font-size: x-large;*/ | ||
467 | font-size: 80%; | ||
468 | } | ||
469 | |||
470 | div.navheader table { | ||
471 | border-left: 0em; | ||
472 | border-right: 0em; | ||
473 | border-top: 0em; | ||
474 | width: 100%; | ||
475 | } | ||
476 | |||
477 | div.navfooter table { | ||
478 | border-left: 0em; | ||
479 | border-right: 0em; | ||
480 | border-bottom: 0em; | ||
481 | width: 100%; | ||
482 | } | ||
483 | |||
484 | div.navheader table td a, | ||
485 | div.navfooter table td a { | ||
486 | color: #777; | ||
487 | text-decoration: none; | ||
488 | } | ||
489 | |||
490 | /* normal text in the footer */ | ||
491 | div.navfooter table td { | ||
492 | color: black; | ||
493 | } | ||
494 | |||
495 | div.navheader table td a:visited, | ||
496 | div.navfooter table td a:visited { | ||
497 | color: #444; | ||
498 | } | ||
499 | |||
500 | |||
501 | /* links in header and footer */ | ||
502 | div.navheader table td a:hover, | ||
503 | div.navfooter table td a:hover { | ||
504 | text-decoration: underline; | ||
505 | background-color: transparent; | ||
506 | color: #33a; | ||
507 | } | ||
508 | |||
509 | div.navheader hr, | ||
510 | div.navfooter hr { | ||
511 | display: none; | ||
512 | } | ||
513 | |||
514 | |||
515 | .qandaset tr.question td p { | ||
516 | margin: 0em 0em 1em 0em; | ||
517 | padding: 0em 0em 0em 0em; | ||
518 | } | ||
519 | |||
520 | .qandaset tr.answer td p { | ||
521 | margin: 0em 0em 1em 0em; | ||
522 | padding: 0em 0em 0em 0em; | ||
523 | } | ||
524 | .answer td { | ||
525 | padding-bottom: 1.5em; | ||
526 | } | ||
527 | |||
528 | .emphasis { | ||
529 | font-weight: bold; | ||
530 | } | ||
531 | |||
532 | |||
533 | /************* / | ||
534 | / decorations / | ||
535 | / *************/ | ||
536 | |||
537 | .titlepage { | ||
538 | } | ||
539 | |||
540 | .part .title { | ||
541 | } | ||
542 | |||
543 | .subtitle { | ||
544 | border: none; | ||
545 | } | ||
546 | |||
547 | /* | ||
548 | h1 { | ||
549 | border: none; | ||
550 | } | ||
551 | |||
552 | h2 { | ||
553 | border-top: solid 0.2em; | ||
554 | border-bottom: solid 0.06em; | ||
555 | } | ||
556 | |||
557 | h3 { | ||
558 | border-top: 0em; | ||
559 | border-bottom: solid 0.06em; | ||
560 | } | ||
561 | |||
562 | h4 { | ||
563 | border: 0em; | ||
564 | border-bottom: solid 0.06em; | ||
565 | } | ||
566 | |||
567 | h5 { | ||
568 | border: 0em; | ||
569 | } | ||
570 | */ | ||
571 | |||
572 | .programlisting { | ||
573 | border: solid 1px; | ||
574 | } | ||
575 | |||
576 | div.figure, | ||
577 | div.table, | ||
578 | div.informalfigure, | ||
579 | div.informaltable, | ||
580 | div.informalexample, | ||
581 | div.example { | ||
582 | border: 1px solid; | ||
583 | } | ||
584 | |||
585 | |||
586 | |||
587 | .tip, | ||
588 | .warning, | ||
589 | .caution, | ||
590 | .note { | ||
591 | border: 1px solid; | ||
592 | } | ||
593 | |||
594 | .tip table th, | ||
595 | .warning table th, | ||
596 | .caution table th, | ||
597 | .note table th { | ||
598 | border-bottom: 1px solid; | ||
599 | } | ||
600 | |||
601 | .question td { | ||
602 | border-top: 1px solid black; | ||
603 | } | ||
604 | |||
605 | .answer { | ||
606 | } | ||
607 | |||
608 | |||
609 | b.keycap, | ||
610 | .keycap { | ||
611 | border: 1px solid; | ||
612 | } | ||
613 | |||
614 | |||
615 | div.navheader, div.heading{ | ||
616 | border-bottom: 1px solid; | ||
617 | } | ||
618 | |||
619 | |||
620 | div.navfooter, div.footing{ | ||
621 | border-top: 1px solid; | ||
622 | } | ||
623 | |||
624 | /********* / | ||
625 | / colors / | ||
626 | / *********/ | ||
627 | |||
628 | body { | ||
629 | color: #333; | ||
630 | background: white; | ||
631 | } | ||
632 | |||
633 | a { | ||
634 | background: transparent; | ||
635 | } | ||
636 | |||
637 | a:hover { | ||
638 | background-color: #dedede; | ||
639 | } | ||
640 | |||
641 | |||
642 | h1, | ||
643 | h2, | ||
644 | h3, | ||
645 | h4, | ||
646 | h5, | ||
647 | h6, | ||
648 | h7, | ||
649 | h8 { | ||
650 | background-color: transparent; | ||
651 | } | ||
652 | |||
653 | hr { | ||
654 | border-color: #aaa; | ||
655 | } | ||
656 | |||
657 | |||
658 | .tip, .warning, .caution, .note { | ||
659 | border-color: #fff; | ||
660 | } | ||
661 | |||
662 | |||
663 | .tip table th, | ||
664 | .warning table th, | ||
665 | .caution table th, | ||
666 | .note table th { | ||
667 | border-bottom-color: #fff; | ||
668 | } | ||
669 | |||
670 | |||
671 | .warning { | ||
672 | background-color: #f0f0f2; | ||
673 | } | ||
674 | |||
675 | .caution { | ||
676 | background-color: #f0f0f2; | ||
677 | } | ||
678 | |||
679 | .tip { | ||
680 | background-color: #f0f0f2; | ||
681 | } | ||
682 | |||
683 | .note { | ||
684 | background-color: #f0f0f2; | ||
685 | } | ||
686 | |||
687 | .glossary dl dt, | ||
688 | .variablelist dl dt, | ||
689 | .variablelist dl dt span.term { | ||
690 | color: #044; | ||
691 | } | ||
692 | |||
693 | div.figure, | ||
694 | div.table, | ||
695 | div.example, | ||
696 | div.informalfigure, | ||
697 | div.informaltable, | ||
698 | div.informalexample { | ||
699 | border-color: #aaa; | ||
700 | } | ||
701 | |||
702 | pre.programlisting { | ||
703 | color: black; | ||
704 | background-color: #fff; | ||
705 | border-color: #aaa; | ||
706 | border-width: 2px; | ||
707 | } | ||
708 | |||
709 | .guimenu, | ||
710 | .guilabel, | ||
711 | .guimenuitem { | ||
712 | background-color: #eee; | ||
713 | } | ||
714 | |||
715 | |||
716 | b.keycap, | ||
717 | .keycap { | ||
718 | background-color: #eee; | ||
719 | border-color: #999; | ||
720 | } | ||
721 | |||
722 | |||
723 | div.navheader { | ||
724 | border-color: black; | ||
725 | } | ||
726 | |||
727 | |||
728 | div.navfooter { | ||
729 | border-color: black; | ||
730 | } | ||
731 | |||
732 | |||
733 | /*********** / | ||
734 | / graphics / | ||
735 | / ***********/ | ||
736 | |||
737 | /* | ||
738 | body { | ||
739 | background-image: url("images/body_bg.jpg"); | ||
740 | background-attachment: fixed; | ||
741 | } | ||
742 | |||
743 | .navheader, | ||
744 | .note, | ||
745 | .tip { | ||
746 | background-image: url("images/note_bg.jpg"); | ||
747 | background-attachment: fixed; | ||
748 | } | ||
749 | |||
750 | .warning, | ||
751 | .caution { | ||
752 | background-image: url("images/warning_bg.jpg"); | ||
753 | background-attachment: fixed; | ||
754 | } | ||
755 | |||
756 | .figure, | ||
757 | .informalfigure, | ||
758 | .example, | ||
759 | .informalexample, | ||
760 | .table, | ||
761 | .informaltable { | ||
762 | background-image: url("images/figure_bg.jpg"); | ||
763 | background-attachment: fixed; | ||
764 | } | ||
765 | |||
766 | */ | ||
767 | h1, | ||
768 | h2, | ||
769 | h3, | ||
770 | h4, | ||
771 | h5, | ||
772 | h6, | ||
773 | h7{ | ||
774 | } | ||
775 | |||
776 | /* | ||
777 | Example of how to stick an image as part of the title. | ||
778 | |||
779 | div.article .titlepage .title | ||
780 | { | ||
781 | background-image: url("figures/white-on-black.png"); | ||
782 | background-position: center; | ||
783 | background-repeat: repeat-x; | ||
784 | } | ||
785 | */ | ||
786 | |||
787 | div.preface .titlepage .title, | ||
788 | div.colophon .title, | ||
789 | div.chapter .titlepage .title, | ||
790 | div.article .titlepage .title | ||
791 | { | ||
792 | } | ||
793 | |||
794 | div.section div.section .titlepage .title, | ||
795 | div.sect2 .titlepage .title { | ||
796 | background: none; | ||
797 | } | ||
798 | |||
799 | |||
800 | h1.title { | ||
801 | background-color: transparent; | ||
802 | background-repeat: no-repeat; | ||
803 | height: 256px; | ||
804 | text-indent: -9000px; | ||
805 | overflow:hidden; | ||
806 | } | ||
807 | |||
808 | h2.subtitle { | ||
809 | background-color: transparent; | ||
810 | text-indent: -9000px; | ||
811 | overflow:hidden; | ||
812 | width: 0px; | ||
813 | display: none; | ||
814 | } | ||
815 | |||
816 | /*************************************** / | ||
817 | / pippin.gimp.org specific alterations / | ||
818 | / ***************************************/ | ||
819 | |||
820 | /* | ||
821 | div.heading, div.navheader { | ||
822 | color: #777; | ||
823 | font-size: 80%; | ||
824 | padding: 0; | ||
825 | margin: 0; | ||
826 | text-align: left; | ||
827 | position: absolute; | ||
828 | top: 0px; | ||
829 | left: 0px; | ||
830 | width: 100%; | ||
831 | height: 50px; | ||
832 | background: url('/gfx/heading_bg.png') transparent; | ||
833 | background-repeat: repeat-x; | ||
834 | background-attachment: fixed; | ||
835 | border: none; | ||
836 | } | ||
837 | |||
838 | div.heading a { | ||
839 | color: #444; | ||
840 | } | ||
841 | |||
842 | div.footing, div.navfooter { | ||
843 | border: none; | ||
844 | color: #ddd; | ||
845 | font-size: 80%; | ||
846 | text-align:right; | ||
847 | |||
848 | width: 100%; | ||
849 | padding-top: 10px; | ||
850 | position: absolute; | ||
851 | bottom: 0px; | ||
852 | left: 0px; | ||
853 | |||
854 | background: url('/gfx/footing_bg.png') transparent; | ||
855 | } | ||
856 | */ | ||
857 | |||
858 | |||
859 | |||
860 | /****************** / | ||
861 | / nasty ie tweaks / | ||
862 | / ******************/ | ||
863 | |||
864 | /* | ||
865 | div.heading, div.navheader { | ||
866 | width:expression(document.body.clientWidth + "px"); | ||
867 | } | ||
868 | |||
869 | div.footing, div.navfooter { | ||
870 | width:expression(document.body.clientWidth + "px"); | ||
871 | margin-left:expression("-5em"); | ||
872 | } | ||
873 | body { | ||
874 | padding:expression("4em 5em 0em 5em"); | ||
875 | } | ||
876 | */ | ||
877 | |||
878 | /**************************************** / | ||
879 | / mozilla vendor specific css extensions / | ||
880 | / ****************************************/ | ||
881 | /* | ||
882 | div.navfooter, div.footing{ | ||
883 | -moz-opacity: 0.8em; | ||
884 | } | ||
885 | |||
886 | div.figure, | ||
887 | div.table, | ||
888 | div.informalfigure, | ||
889 | div.informaltable, | ||
890 | div.informalexample, | ||
891 | div.example, | ||
892 | .tip, | ||
893 | .warning, | ||
894 | .caution, | ||
895 | .note { | ||
896 | -moz-border-radius: 0.5em; | ||
897 | } | ||
898 | |||
899 | b.keycap, | ||
900 | .keycap { | ||
901 | -moz-border-radius: 0.3em; | ||
902 | } | ||
903 | */ | ||
904 | |||
905 | table tr td table tr td { | ||
906 | display: none; | ||
907 | } | ||
908 | |||
909 | |||
910 | hr { | ||
911 | display: none; | ||
912 | } | ||
913 | |||
914 | table { | ||
915 | border: 0em; | ||
916 | } | ||
917 | |||
918 | .photo { | ||
919 | float: right; | ||
920 | margin-left: 1.5em; | ||
921 | margin-bottom: 1.5em; | ||
922 | margin-top: 0em; | ||
923 | max-width: 17em; | ||
924 | border: 1px solid gray; | ||
925 | padding: 3px; | ||
926 | background: white; | ||
927 | } | ||
928 | .seperator { | ||
929 | padding-top: 2em; | ||
930 | clear: both; | ||
931 | } | ||
932 | |||
933 | #validators { | ||
934 | margin-top: 5em; | ||
935 | text-align: right; | ||
936 | color: #777; | ||
937 | } | ||
938 | @media print { | ||
939 | body { | ||
940 | font-size: 8pt; | ||
941 | } | ||
942 | .noprint { | ||
943 | display: none; | ||
944 | } | ||
945 | } | ||
946 | |||
947 | |||
948 | .tip, | ||
949 | .note { | ||
950 | background: #f0f0f2; | ||
951 | color: #333; | ||
952 | padding: 20px; | ||
953 | margin: 20px; | ||
954 | } | ||
955 | |||
956 | .tip h3, | ||
957 | .note h3 { | ||
958 | padding: 0em; | ||
959 | margin: 0em; | ||
960 | font-size: 2em; | ||
961 | font-weight: bold; | ||
962 | color: #333; | ||
963 | } | ||
964 | |||
965 | .tip a, | ||
966 | .note a { | ||
967 | color: #333; | ||
968 | text-decoration: underline; | ||
969 | } | ||
970 | |||
971 | .footnote { | ||
972 | font-size: small; | ||
973 | color: #333; | ||
974 | } | ||
975 | |||
976 | /* Changes the announcement text */ | ||
977 | .tip h3, | ||
978 | .warning h3, | ||
979 | .caution h3, | ||
980 | .note h3 { | ||
981 | font-size:large; | ||
982 | color: #00557D; | ||
983 | } | ||
diff --git a/documentation/poky.ent b/documentation/poky.ent new file mode 100644 index 0000000..2160158 --- /dev/null +++ b/documentation/poky.ent | |||
@@ -0,0 +1,66 @@ | |||
1 | <!ENTITY DISTRO "1.7"> | ||
2 | <!ENTITY DISTRO_COMPRESSED "17"> | ||
3 | <!ENTITY DISTRO_NAME "tbd"> | ||
4 | <!ENTITY YOCTO_DOC_VERSION "1.7"> | ||
5 | <!ENTITY POKYVERSION "12.0.0"> | ||
6 | <!ENTITY POKYVERSION_COMPRESSED "1100"> | ||
7 | <!ENTITY YOCTO_POKY "poky-&DISTRO_NAME;-&POKYVERSION;"> | ||
8 | <!ENTITY COPYRIGHT_YEAR "2010-2014"> | ||
9 | <!ENTITY YOCTO_DL_URL "http://downloads.yoctoproject.org"> | ||
10 | <!ENTITY YOCTO_HOME_URL "http://www.yoctoproject.org"> | ||
11 | <!ENTITY YOCTO_LISTS_URL "http://lists.yoctoproject.org"> | ||
12 | <!ENTITY YOCTO_BUGZILLA_URL "http://bugzilla.yoctoproject.org"> | ||
13 | <!ENTITY YOCTO_WIKI_URL "https://wiki.yoctoproject.org"> | ||
14 | <!ENTITY YOCTO_AB_URL "http://autobuilder.yoctoproject.org"> | ||
15 | <!ENTITY YOCTO_GIT_URL "http://git.yoctoproject.org"> | ||
16 | <!ENTITY YOCTO_ADTREPO_URL "http://adtrepo.yoctoproject.org"> | ||
17 | <!ENTITY YOCTO_RELEASE_NOTES "&YOCTO_HOME_URL;/download/yocto-project-&DISTRO_COMPRESSED;-poky-&POKYVERSION_COMPRESSED;"> | ||
18 | <!ENTITY OE_HOME_URL "http://www.openembedded.org"> | ||
19 | <!ENTITY OE_LISTS_URL "http://lists.openembedded.org/mailman"> | ||
20 | <!ENTITY OE_DOCS_URL "http://docs.openembedded.org"> | ||
21 | <!ENTITY OH_HOME_URL "http://o-hand.com"> | ||
22 | <!ENTITY BITBAKE_HOME_URL "http://developer.berlios.de/projects/bitbake/"> | ||
23 | <!ENTITY ECLIPSE_MAIN_URL "http://www.eclipse.org/downloads"> | ||
24 | <!ENTITY ECLIPSE_DL_URL "http://download.eclipse.org"> | ||
25 | <!ENTITY ECLIPSE_DL_PLUGIN_URL "&YOCTO_DL_URL;/releases/eclipse-plugin/&DISTRO;"> | ||
26 | <!ENTITY ECLIPSE_UPDATES_URL "&ECLIPSE_DL_URL;/tm/updates/3.3"> | ||
27 | <!ENTITY ECLIPSE_INDIGO_URL "&ECLIPSE_DL_URL;/releases/indigo"> | ||
28 | <!ENTITY ECLIPSE_JUNO_URL "&ECLIPSE_DL_URL;/releases/juno"> | ||
29 | <!ENTITY ECLIPSE_KEPLER_URL "&ECLIPSE_DL_URL;/releases/kepler"> | ||
30 | <!ENTITY ECLIPSE_INDIGO_CDT_URL "&ECLIPSE_DL_URL;tools/cdt/releases/indigo"> | ||
31 | <!ENTITY YOCTO_DOCS_URL "&YOCTO_HOME_URL;/docs"> | ||
32 | <!ENTITY YOCTO_SOURCES_URL "&YOCTO_HOME_URL;/sources/"> | ||
33 | <!ENTITY YOCTO_AB_PORT_URL "&YOCTO_AB_URL;:8010"> | ||
34 | <!ENTITY YOCTO_AB_NIGHTLY_URL "&YOCTO_AB_URL;/nightly/"> | ||
35 | <!ENTITY YOCTO_POKY_URL "&YOCTO_DL_URL;/releases/poky/"> | ||
36 | <!ENTITY YOCTO_RELEASE_DL_URL "&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;"> | ||
37 | <!ENTITY YOCTO_TOOLCHAIN_DL_URL "&YOCTO_RELEASE_DL_URL;/toolchain/"> | ||
38 | <!ENTITY YOCTO_ECLIPSE_DL_URL "&YOCTO_RELEASE_DL_URL;/eclipse-plugin/indigo;"> | ||
39 | <!ENTITY YOCTO_ADTINSTALLER_DL_URL "&YOCTO_RELEASE_DL_URL;/adt-installer"> | ||
40 | <!ENTITY YOCTO_POKY_DL_URL "&YOCTO_RELEASE_DL_URL;/&YOCTO_POKY;.tar.bz2"> | ||
41 | <!ENTITY YOCTO_MACHINES_DL_URL "&YOCTO_RELEASE_DL_URL;/machines"> | ||
42 | <!ENTITY YOCTO_QEMU_DL_URL "&YOCTO_MACHINES_DL_URL;/qemu"> | ||
43 | <!ENTITY YOCTO_PYTHON-i686_DL_URL "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-i686.tar.bz2"> | ||
44 | <!ENTITY YOCTO_PYTHON-x86_64_DL_URL "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-x86_64.tar.bz2"> | ||
45 | <!ENTITY YOCTO_DOCS_QS_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/yocto-project-qs/yocto-project-qs.html"> | ||
46 | <!ENTITY YOCTO_DOCS_ADT_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/adt-manual/adt-manual.html"> | ||
47 | <!ENTITY YOCTO_DOCS_REF_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/ref-manual/ref-manual.html"> | ||
48 | <!ENTITY YOCTO_DOCS_BSP_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/bsp-guide/bsp-guide.html"> | ||
49 | <!ENTITY YOCTO_DOCS_DEV_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/dev-manual/dev-manual.html"> | ||
50 | <!ENTITY YOCTO_DOCS_KERNEL_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/kernel-manual/kernel-manual.html"> | ||
51 | <!ENTITY YOCTO_DOCS_KERNEL_DEV_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/kernel-dev/kernel-dev.html"> | ||
52 | <!ENTITY YOCTO_DOCS_PROF_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/profile-manual/profile-manual.html"> | ||
53 | <!ENTITY YOCTO_DOCS_BB_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/bitbake-user-manual/bitbake-user-manual.html"> | ||
54 | <!ENTITY YOCTO_ADTPATH_DIR "/opt/poky/&DISTRO;"> | ||
55 | <!ENTITY YOCTO_POKY_TARBALL "&YOCTO_POKY;.tar.bz2"> | ||
56 | <!ENTITY OE_INIT_PATH "&YOCTO_POKY;/oe-init-build-env"> | ||
57 | <!ENTITY OE_INIT_FILE "oe-init-build-env"> | ||
58 | <!ENTITY UBUNTU_HOST_PACKAGES_ESSENTIAL "gawk wget git-core diffstat unzip texinfo gcc-multilib \ | ||
59 | build-essential chrpath"> | ||
60 | <!ENTITY FEDORA_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python unzip perl patch \ | ||
61 | diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \ | ||
62 | ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue"> | ||
63 | <!ENTITY OPENSUSE_HOST_PACKAGES_ESSENTIAL "python gcc gcc-c++ git chrpath make wget python-xml \ | ||
64 | diffstat texinfo python-curses patch"> | ||
65 | <!ENTITY CENTOS_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python unzip perl patch \ | ||
66 | diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath"> | ||
diff --git a/documentation/profile-manual/figures/kernelshark-all.png b/documentation/profile-manual/figures/kernelshark-all.png new file mode 100644 index 0000000..99b40ba --- /dev/null +++ b/documentation/profile-manual/figures/kernelshark-all.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/kernelshark-choose-events.png b/documentation/profile-manual/figures/kernelshark-choose-events.png new file mode 100644 index 0000000..e8dd62a --- /dev/null +++ b/documentation/profile-manual/figures/kernelshark-choose-events.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/kernelshark-i915-display.png b/documentation/profile-manual/figures/kernelshark-i915-display.png new file mode 100644 index 0000000..bb0edfb --- /dev/null +++ b/documentation/profile-manual/figures/kernelshark-i915-display.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/kernelshark-output-display.png b/documentation/profile-manual/figures/kernelshark-output-display.png new file mode 100644 index 0000000..ae2d0e5 --- /dev/null +++ b/documentation/profile-manual/figures/kernelshark-output-display.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/lttngmain0.png b/documentation/profile-manual/figures/lttngmain0.png new file mode 100644 index 0000000..5f60113 --- /dev/null +++ b/documentation/profile-manual/figures/lttngmain0.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/oprofileui-busybox.png b/documentation/profile-manual/figures/oprofileui-busybox.png new file mode 100644 index 0000000..a8275c6 --- /dev/null +++ b/documentation/profile-manual/figures/oprofileui-busybox.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/oprofileui-copy-to-user.png b/documentation/profile-manual/figures/oprofileui-copy-to-user.png new file mode 100644 index 0000000..deb6470 --- /dev/null +++ b/documentation/profile-manual/figures/oprofileui-copy-to-user.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/oprofileui-downloading.png b/documentation/profile-manual/figures/oprofileui-downloading.png new file mode 100644 index 0000000..57742d6 --- /dev/null +++ b/documentation/profile-manual/figures/oprofileui-downloading.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/oprofileui-processes.png b/documentation/profile-manual/figures/oprofileui-processes.png new file mode 100644 index 0000000..ae54702 --- /dev/null +++ b/documentation/profile-manual/figures/oprofileui-processes.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-probe-do_fork-profile.png b/documentation/profile-manual/figures/perf-probe-do_fork-profile.png new file mode 100644 index 0000000..1a1070d --- /dev/null +++ b/documentation/profile-manual/figures/perf-probe-do_fork-profile.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-report-cycles-u.png b/documentation/profile-manual/figures/perf-report-cycles-u.png new file mode 100644 index 0000000..68ec6af --- /dev/null +++ b/documentation/profile-manual/figures/perf-report-cycles-u.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-systemwide-libc.png b/documentation/profile-manual/figures/perf-systemwide-libc.png new file mode 100644 index 0000000..2b72869 --- /dev/null +++ b/documentation/profile-manual/figures/perf-systemwide-libc.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-systemwide.png b/documentation/profile-manual/figures/perf-systemwide.png new file mode 100644 index 0000000..12ce244 --- /dev/null +++ b/documentation/profile-manual/figures/perf-systemwide.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-wget-busybox-annotate-menu.png b/documentation/profile-manual/figures/perf-wget-busybox-annotate-menu.png new file mode 100644 index 0000000..ceb34ea --- /dev/null +++ b/documentation/profile-manual/figures/perf-wget-busybox-annotate-menu.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-wget-busybox-annotate-udhcpc.png b/documentation/profile-manual/figures/perf-wget-busybox-annotate-udhcpc.png new file mode 100644 index 0000000..3581e9d --- /dev/null +++ b/documentation/profile-manual/figures/perf-wget-busybox-annotate-udhcpc.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-wget-busybox-debuginfo.png b/documentation/profile-manual/figures/perf-wget-busybox-debuginfo.png new file mode 100644 index 0000000..c317b49 --- /dev/null +++ b/documentation/profile-manual/figures/perf-wget-busybox-debuginfo.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom-menu.png b/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom-menu.png new file mode 100644 index 0000000..1913c86 --- /dev/null +++ b/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom-menu.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom.png b/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom.png new file mode 100644 index 0000000..a1962c4 --- /dev/null +++ b/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-wget-busybox-expanded-stripped.png b/documentation/profile-manual/figures/perf-wget-busybox-expanded-stripped.png new file mode 100644 index 0000000..b642d06 --- /dev/null +++ b/documentation/profile-manual/figures/perf-wget-busybox-expanded-stripped.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-wget-flat-stripped.png b/documentation/profile-manual/figures/perf-wget-flat-stripped.png new file mode 100644 index 0000000..c8f395a --- /dev/null +++ b/documentation/profile-manual/figures/perf-wget-flat-stripped.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png b/documentation/profile-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png new file mode 100644 index 0000000..bb7c764 --- /dev/null +++ b/documentation/profile-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png b/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png new file mode 100644 index 0000000..a799af5 --- /dev/null +++ b/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png b/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png new file mode 100644 index 0000000..e91808a --- /dev/null +++ b/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png b/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png new file mode 100644 index 0000000..812302d --- /dev/null +++ b/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/profile-title.png b/documentation/profile-manual/figures/profile-title.png new file mode 100644 index 0000000..ce5c682 --- /dev/null +++ b/documentation/profile-manual/figures/profile-title.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/pybootchartgui-linux-yocto.png b/documentation/profile-manual/figures/pybootchartgui-linux-yocto.png new file mode 100644 index 0000000..2b6bfda --- /dev/null +++ b/documentation/profile-manual/figures/pybootchartgui-linux-yocto.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/pychart-linux-yocto-rpm-nostrip.png b/documentation/profile-manual/figures/pychart-linux-yocto-rpm-nostrip.png new file mode 100644 index 0000000..444675c --- /dev/null +++ b/documentation/profile-manual/figures/pychart-linux-yocto-rpm-nostrip.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/pychart-linux-yocto-rpm.png b/documentation/profile-manual/figures/pychart-linux-yocto-rpm.png new file mode 100644 index 0000000..8ee3535 --- /dev/null +++ b/documentation/profile-manual/figures/pychart-linux-yocto-rpm.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/sched-wakeup-profile.png b/documentation/profile-manual/figures/sched-wakeup-profile.png new file mode 100644 index 0000000..2f25811 --- /dev/null +++ b/documentation/profile-manual/figures/sched-wakeup-profile.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/sysprof-callers.png b/documentation/profile-manual/figures/sysprof-callers.png new file mode 100644 index 0000000..640c8d9 --- /dev/null +++ b/documentation/profile-manual/figures/sysprof-callers.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/sysprof-copy-from-user.png b/documentation/profile-manual/figures/sysprof-copy-from-user.png new file mode 100644 index 0000000..8d31427 --- /dev/null +++ b/documentation/profile-manual/figures/sysprof-copy-from-user.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/figures/sysprof-copy-to-user.png b/documentation/profile-manual/figures/sysprof-copy-to-user.png new file mode 100644 index 0000000..7a5bab7 --- /dev/null +++ b/documentation/profile-manual/figures/sysprof-copy-to-user.png | |||
Binary files differ | |||
diff --git a/documentation/profile-manual/profile-manual-arch.xml b/documentation/profile-manual/profile-manual-arch.xml new file mode 100644 index 0000000..19d1155 --- /dev/null +++ b/documentation/profile-manual/profile-manual-arch.xml | |||
@@ -0,0 +1,45 @@ | |||
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 | |||
5 | <chapter id='profile-manual-arch'> | ||
6 | |||
7 | <title>Overall Architecture of the Linux Tracing and Profiling Tools</title> | ||
8 | |||
9 | <section id='architecture-of-the-tracing-and-profiling-tools'> | ||
10 | <title>Architecture of the Tracing and Profiling Tools</title> | ||
11 | |||
12 | <para> | ||
13 | It may seem surprising to see a section covering an 'overall architecture' | ||
14 | for what seems to be a random collection of tracing tools that together | ||
15 | make up the Linux tracing and profiling space. | ||
16 | The fact is, however, that in recent years this seemingly disparate | ||
17 | set of tools has started to converge on a 'core' set of underlying | ||
18 | mechanisms: | ||
19 | </para> | ||
20 | |||
21 | <para> | ||
22 | <itemizedlist> | ||
23 | <listitem>static tracepoints</listitem> | ||
24 | <listitem>dynamic tracepoints | ||
25 | <itemizedlist> | ||
26 | <listitem>kprobes</listitem> | ||
27 | <listitem>uprobes</listitem> | ||
28 | </itemizedlist> | ||
29 | </listitem> | ||
30 | <listitem>the perf_events subsystem</listitem> | ||
31 | <listitem>debugfs</listitem> | ||
32 | </itemizedlist> | ||
33 | </para> | ||
34 | |||
35 | <informalexample> | ||
36 | <emphasis>Tying it Together:</emphasis> Rather than enumerating here how each tool makes use of | ||
37 | these common mechanisms, textboxes like this will make note of the | ||
38 | specific usages in each tool as they come up in the course | ||
39 | of the text. | ||
40 | </informalexample> | ||
41 | </section> | ||
42 | </chapter> | ||
43 | <!-- | ||
44 | vim: expandtab tw=80 ts=4 | ||
45 | --> | ||
diff --git a/documentation/profile-manual/profile-manual-customization.xsl b/documentation/profile-manual/profile-manual-customization.xsl new file mode 100644 index 0000000..7775e5b --- /dev/null +++ b/documentation/profile-manual/profile-manual-customization.xsl | |||
@@ -0,0 +1,19 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> | ||
3 | |||
4 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" /> | ||
5 | |||
6 | <xsl:include href="../template/permalinks.xsl"/> | ||
7 | <xsl:include href="../template/section.title.xsl"/> | ||
8 | <xsl:include href="../template/component.title.xsl"/> | ||
9 | <xsl:include href="../template/division.title.xsl"/> | ||
10 | <xsl:include href="../template/formal.object.heading.xsl"/> | ||
11 | |||
12 | <xsl:param name="html.stylesheet" select="'profile-manual-style.css'" /> | ||
13 | <xsl:param name="chapter.autolabel" select="1" /> | ||
14 | <xsl:param name="appendix.autolabel" select="A" /> | ||
15 | <xsl:param name="section.autolabel" select="1" /> | ||
16 | <xsl:param name="section.label.includes.component.label" select="1" /> | ||
17 | <xsl:param name="generate.id.attributes" select="1" /> | ||
18 | |||
19 | </xsl:stylesheet> | ||
diff --git a/documentation/profile-manual/profile-manual-eclipse-customization.xsl b/documentation/profile-manual/profile-manual-eclipse-customization.xsl new file mode 100644 index 0000000..e4ff6e9 --- /dev/null +++ b/documentation/profile-manual/profile-manual-eclipse-customization.xsl | |||
@@ -0,0 +1,27 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet | ||
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
4 | xmlns="http://www.w3.org/1999/xhtml" | ||
5 | xmlns:fo="http://www.w3.org/1999/XSL/Format" | ||
6 | version="1.0"> | ||
7 | |||
8 | <xsl:import | ||
9 | href="http://docbook.sourceforge.net/release/xsl/current/eclipse/eclipse3.xsl" /> | ||
10 | |||
11 | <xsl:param name="chunker.output.indent" select="'yes'"/> | ||
12 | <xsl:param name="chunk.quietly" select="1"/> | ||
13 | <xsl:param name="chunk.first.sections" select="1"/> | ||
14 | <xsl:param name="chunk.section.depth" select="10"/> | ||
15 | <xsl:param name="use.id.as.filename" select="1"/> | ||
16 | <xsl:param name="ulink.target" select="'_self'" /> | ||
17 | <xsl:param name="base.dir" select="'html/profile-manual/'"/> | ||
18 | <xsl:param name="html.stylesheet" select="'../book.css'"/> | ||
19 | <xsl:param name="eclipse.manifest" select="0"/> | ||
20 | <xsl:param name="create.plugin.xml" select="0"/> | ||
21 | <xsl:param name="suppress.navigation" select="1"/> | ||
22 | <xsl:param name="generate.index" select="0"/> | ||
23 | <xsl:param name="chapter.autolabel" select="1" /> | ||
24 | <xsl:param name="appendix.autolabel">A</xsl:param> | ||
25 | <xsl:param name="section.autolabel" select="1" /> | ||
26 | <xsl:param name="section.label.includes.component.label" select="1" /> | ||
27 | </xsl:stylesheet> | ||
diff --git a/documentation/profile-manual/profile-manual-examples.xml b/documentation/profile-manual/profile-manual-examples.xml new file mode 100644 index 0000000..9630c6c --- /dev/null +++ b/documentation/profile-manual/profile-manual-examples.xml | |||
@@ -0,0 +1,39 @@ | |||
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 | |||
5 | <chapter id='profile-manual-examples'> | ||
6 | |||
7 | <title>Real-World Examples</title> | ||
8 | |||
9 | <para> | ||
10 | This chapter contains real-world examples. | ||
11 | </para> | ||
12 | |||
13 | <section id='slow-write-speed-on-live-images'> | ||
14 | <title>Slow Write Speed on Live Images</title> | ||
15 | |||
16 | <para> | ||
17 | In one of our previous releases (denzil), users noticed that booting | ||
18 | off of a live image and writing to disk was noticeably slower. | ||
19 | This included the boot itself, especially the first one, since first | ||
20 | boots tend to do a significant amount of writing due to certain | ||
21 | post-install scripts. | ||
22 | </para> | ||
23 | |||
24 | <para> | ||
25 | The problem (and solution) was discovered by using the Yocto tracing | ||
26 | tools, in this case 'perf stat', 'perf script', 'perf record' | ||
27 | and 'perf report'. | ||
28 | </para> | ||
29 | |||
30 | <para> | ||
31 | See all the unvarnished details of how this bug was diagnosed and | ||
32 | solved here: Yocto Bug #3049 | ||
33 | </para> | ||
34 | </section> | ||
35 | |||
36 | </chapter> | ||
37 | <!-- | ||
38 | vim: expandtab tw=80 ts=4 | ||
39 | --> | ||
diff --git a/documentation/profile-manual/profile-manual-intro.xml b/documentation/profile-manual/profile-manual-intro.xml new file mode 100644 index 0000000..0d3f5a6 --- /dev/null +++ b/documentation/profile-manual/profile-manual-intro.xml | |||
@@ -0,0 +1,102 @@ | |||
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 | |||
5 | <chapter id='profile-manual-intro'> | ||
6 | |||
7 | <title>Yocto Project Profiling and Tracing Manual</title> | ||
8 | <section id='intro'> | ||
9 | <title>Introduction</title> | ||
10 | |||
11 | <para> | ||
12 | Yocto bundles a number of tracing and profiling tools - this 'HOWTO' | ||
13 | describes their basic usage and shows by example how to make use | ||
14 | of them to examine application and system behavior. | ||
15 | </para> | ||
16 | |||
17 | <para> | ||
18 | The tools presented are for the most part completely open-ended and | ||
19 | have quite good and/or extensive documentation of their own which | ||
20 | can be used to solve just about any problem you might come across | ||
21 | in Linux. | ||
22 | Each section that describes a particular tool has links to that | ||
23 | tool's documentation and website. | ||
24 | </para> | ||
25 | |||
26 | <para> | ||
27 | The purpose of this 'HOWTO' is to present a set of common and | ||
28 | generally useful tracing and profiling idioms along with their | ||
29 | application (as appropriate) to each tool, in the context of a | ||
30 | general-purpose 'drill-down' methodology that can be applied | ||
31 | to solving a large number (90%?) of problems. | ||
32 | For help with more advanced usages and problems, please see | ||
33 | the documentation and/or websites listed for each tool. | ||
34 | </para> | ||
35 | |||
36 | <para> | ||
37 | The final section of this 'HOWTO' is a collection of real-world | ||
38 | examples which we'll be continually adding to as we solve more | ||
39 | problems using the tools - feel free to add your own examples | ||
40 | to the list! | ||
41 | </para> | ||
42 | </section> | ||
43 | |||
44 | <section id='profile-manual-general-setup'> | ||
45 | <title>General Setup</title> | ||
46 | |||
47 | <para> | ||
48 | Most of the tools are available only in 'sdk' images or in images | ||
49 | built after adding 'tools-profile' to your local.conf. | ||
50 | So, in order to be able to access all of the tools described here, | ||
51 | please first build and boot an 'sdk' image e.g. | ||
52 | <literallayout class='monospaced'> | ||
53 | $ bitbake core-image-sato-sdk | ||
54 | </literallayout> | ||
55 | or alternatively by adding 'tools-profile' to the | ||
56 | EXTRA_IMAGE_FEATURES line in your local.conf: | ||
57 | <literallayout class='monospaced'> | ||
58 | EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile" | ||
59 | </literallayout> | ||
60 | If you use the 'tools-profile' method, you don't need to build an | ||
61 | sdk image - the tracing and profiling tools will be included in | ||
62 | non-sdk images as well e.g.: | ||
63 | <literallayout class='monospaced'> | ||
64 | $ bitbake core-image-sato | ||
65 | </literallayout> | ||
66 | <note><para> | ||
67 | By default, the Yocto build system strips symbols from the | ||
68 | binaries it packages, which makes it difficult to use some | ||
69 | of the tools. | ||
70 | </para><para>You can prevent that by putting the following | ||
71 | in your local.conf when you build the image: | ||
72 | </para> | ||
73 | </note> | ||
74 | <literallayout class='monospaced'> | ||
75 | INHIBIT_PACKAGE_STRIP = "1" | ||
76 | </literallayout> | ||
77 | The above setting will noticeably increase the size of your image. | ||
78 | </para> | ||
79 | |||
80 | <para> | ||
81 | If you've already built a stripped image, you can generate | ||
82 | debug packages (xxx-dbg) which you can manually install as | ||
83 | needed. | ||
84 | </para> | ||
85 | |||
86 | <para> | ||
87 | To generate debug info for packages, you can add dbg-pkgs to | ||
88 | EXTRA_IMAGE_FEATURES in local.conf. For example: | ||
89 | <literallayout class='monospaced'> | ||
90 | EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile dbg-pkgs" | ||
91 | </literallayout> | ||
92 | Additionally, in order to generate the right type of | ||
93 | debuginfo, we also need to add the following to local.conf: | ||
94 | <literallayout class='monospaced'> | ||
95 | PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory' | ||
96 | </literallayout> | ||
97 | </para> | ||
98 | </section> | ||
99 | </chapter> | ||
100 | <!-- | ||
101 | vim: expandtab tw=80 ts=4 | ||
102 | --> | ||
diff --git a/documentation/profile-manual/profile-manual-style.css b/documentation/profile-manual/profile-manual-style.css new file mode 100644 index 0000000..f3cca85 --- /dev/null +++ b/documentation/profile-manual/profile-manual-style.css | |||
@@ -0,0 +1,984 @@ | |||
1 | /* | ||
2 | Generic XHTML / DocBook XHTML CSS Stylesheet. | ||
3 | |||
4 | Browser wrangling and typographic design by | ||
5 | Oyvind Kolas / pippin@gimp.org | ||
6 | |||
7 | Customised for Poky by | ||
8 | Matthew Allum / mallum@o-hand.com | ||
9 | |||
10 | Thanks to: | ||
11 | Liam R. E. Quin | ||
12 | William Skaggs | ||
13 | Jakub Steiner | ||
14 | |||
15 | Structure | ||
16 | --------- | ||
17 | |||
18 | The stylesheet is divided into the following sections: | ||
19 | |||
20 | Positioning | ||
21 | Margins, paddings, width, font-size, clearing. | ||
22 | Decorations | ||
23 | Borders, style | ||
24 | Colors | ||
25 | Colors | ||
26 | Graphics | ||
27 | Graphical backgrounds | ||
28 | Nasty IE tweaks | ||
29 | Workarounds needed to make it work in internet explorer, | ||
30 | currently makes the stylesheet non validating, but up until | ||
31 | this point it is validating. | ||
32 | Mozilla extensions | ||
33 | Transparency for footer | ||
34 | Rounded corners on boxes | ||
35 | |||
36 | */ | ||
37 | |||
38 | |||
39 | /*************** / | ||
40 | / Positioning / | ||
41 | / ***************/ | ||
42 | |||
43 | body { | ||
44 | font-family: Verdana, Sans, sans-serif; | ||
45 | |||
46 | min-width: 640px; | ||
47 | width: 80%; | ||
48 | margin: 0em auto; | ||
49 | padding: 2em 5em 5em 5em; | ||
50 | color: #333; | ||
51 | } | ||
52 | |||
53 | h1,h2,h3,h4,h5,h6,h7 { | ||
54 | font-family: Arial, Sans; | ||
55 | color: #00557D; | ||
56 | clear: both; | ||
57 | } | ||
58 | |||
59 | h1 { | ||
60 | font-size: 2em; | ||
61 | text-align: left; | ||
62 | padding: 0em 0em 0em 0em; | ||
63 | margin: 2em 0em 0em 0em; | ||
64 | } | ||
65 | |||
66 | h2.subtitle { | ||
67 | margin: 0.10em 0em 3.0em 0em; | ||
68 | padding: 0em 0em 0em 0em; | ||
69 | font-size: 1.8em; | ||
70 | padding-left: 20%; | ||
71 | font-weight: normal; | ||
72 | font-style: italic; | ||
73 | } | ||
74 | |||
75 | h2 { | ||
76 | margin: 2em 0em 0.66em 0em; | ||
77 | padding: 0.5em 0em 0em 0em; | ||
78 | font-size: 1.5em; | ||
79 | font-weight: bold; | ||
80 | } | ||
81 | |||
82 | h3.subtitle { | ||
83 | margin: 0em 0em 1em 0em; | ||
84 | padding: 0em 0em 0em 0em; | ||
85 | font-size: 142.14%; | ||
86 | text-align: right; | ||
87 | } | ||
88 | |||
89 | h3 { | ||
90 | margin: 1em 0em 0.5em 0em; | ||
91 | padding: 1em 0em 0em 0em; | ||
92 | font-size: 140%; | ||
93 | font-weight: bold; | ||
94 | } | ||
95 | |||
96 | h4 { | ||
97 | margin: 1em 0em 0.5em 0em; | ||
98 | padding: 1em 0em 0em 0em; | ||
99 | font-size: 120%; | ||
100 | font-weight: bold; | ||
101 | } | ||
102 | |||
103 | h5 { | ||
104 | margin: 1em 0em 0.5em 0em; | ||
105 | padding: 1em 0em 0em 0em; | ||
106 | font-size: 110%; | ||
107 | font-weight: bold; | ||
108 | } | ||
109 | |||
110 | h6 { | ||
111 | margin: 1em 0em 0em 0em; | ||
112 | padding: 1em 0em 0em 0em; | ||
113 | font-size: 110%; | ||
114 | font-weight: bold; | ||
115 | } | ||
116 | |||
117 | .authorgroup { | ||
118 | background-color: transparent; | ||
119 | background-repeat: no-repeat; | ||
120 | padding-top: 256px; | ||
121 | background-image: url("figures/profile-title.png"); | ||
122 | background-position: left top; | ||
123 | margin-top: -256px; | ||
124 | padding-right: 50px; | ||
125 | margin-left: 0px; | ||
126 | text-align: right; | ||
127 | width: 740px; | ||
128 | } | ||
129 | |||
130 | h3.author { | ||
131 | margin: 0em 0me 0em 0em; | ||
132 | padding: 0em 0em 0em 0em; | ||
133 | font-weight: normal; | ||
134 | font-size: 100%; | ||
135 | color: #333; | ||
136 | clear: both; | ||
137 | } | ||
138 | |||
139 | .author tt.email { | ||
140 | font-size: 66%; | ||
141 | } | ||
142 | |||
143 | .titlepage hr { | ||
144 | width: 0em; | ||
145 | clear: both; | ||
146 | } | ||
147 | |||
148 | .revhistory { | ||
149 | padding-top: 2em; | ||
150 | clear: both; | ||
151 | } | ||
152 | |||
153 | .toc, | ||
154 | .list-of-tables, | ||
155 | .list-of-examples, | ||
156 | .list-of-figures { | ||
157 | padding: 1.33em 0em 2.5em 0em; | ||
158 | color: #00557D; | ||
159 | } | ||
160 | |||
161 | .toc p, | ||
162 | .list-of-tables p, | ||
163 | .list-of-figures p, | ||
164 | .list-of-examples p { | ||
165 | padding: 0em 0em 0em 0em; | ||
166 | padding: 0em 0em 0.3em; | ||
167 | margin: 1.5em 0em 0em 0em; | ||
168 | } | ||
169 | |||
170 | .toc p b, | ||
171 | .list-of-tables p b, | ||
172 | .list-of-figures p b, | ||
173 | .list-of-examples p b{ | ||
174 | font-size: 100.0%; | ||
175 | font-weight: bold; | ||
176 | } | ||
177 | |||
178 | .toc dl, | ||
179 | .list-of-tables dl, | ||
180 | .list-of-figures dl, | ||
181 | .list-of-examples dl { | ||
182 | margin: 0em 0em 0.5em 0em; | ||
183 | padding: 0em 0em 0em 0em; | ||
184 | } | ||
185 | |||
186 | .toc dt { | ||
187 | margin: 0em 0em 0em 0em; | ||
188 | padding: 0em 0em 0em 0em; | ||
189 | } | ||
190 | |||
191 | .toc dd { | ||
192 | margin: 0em 0em 0em 2.6em; | ||
193 | padding: 0em 0em 0em 0em; | ||
194 | } | ||
195 | |||
196 | div.glossary dl, | ||
197 | div.variablelist dl { | ||
198 | } | ||
199 | |||
200 | .glossary dl dt, | ||
201 | .variablelist dl dt, | ||
202 | .variablelist dl dt span.term { | ||
203 | font-weight: normal; | ||
204 | width: 20em; | ||
205 | text-align: right; | ||
206 | } | ||
207 | |||
208 | .variablelist dl dt { | ||
209 | margin-top: 0.5em; | ||
210 | } | ||
211 | |||
212 | .glossary dl dd, | ||
213 | .variablelist dl dd { | ||
214 | margin-top: -1em; | ||
215 | margin-left: 25.5em; | ||
216 | } | ||
217 | |||
218 | .glossary dd p, | ||
219 | .variablelist dd p { | ||
220 | margin-top: 0em; | ||
221 | margin-bottom: 1em; | ||
222 | } | ||
223 | |||
224 | |||
225 | div.calloutlist table td { | ||
226 | padding: 0em 0em 0em 0em; | ||
227 | margin: 0em 0em 0em 0em; | ||
228 | } | ||
229 | |||
230 | div.calloutlist table td p { | ||
231 | margin-top: 0em; | ||
232 | margin-bottom: 1em; | ||
233 | } | ||
234 | |||
235 | div p.copyright { | ||
236 | text-align: left; | ||
237 | } | ||
238 | |||
239 | div.legalnotice p.legalnotice-title { | ||
240 | margin-bottom: 0em; | ||
241 | } | ||
242 | |||
243 | p { | ||
244 | line-height: 1.5em; | ||
245 | margin-top: 0em; | ||
246 | |||
247 | } | ||
248 | |||
249 | dl { | ||
250 | padding-top: 0em; | ||
251 | } | ||
252 | |||
253 | hr { | ||
254 | border: solid 1px; | ||
255 | } | ||
256 | |||
257 | |||
258 | .mediaobject, | ||
259 | .mediaobjectco { | ||
260 | text-align: center; | ||
261 | } | ||
262 | |||
263 | img { | ||
264 | border: none; | ||
265 | } | ||
266 | |||
267 | ul { | ||
268 | padding: 0em 0em 0em 1.5em; | ||
269 | } | ||
270 | |||
271 | ul li { | ||
272 | padding: 0em 0em 0em 0em; | ||
273 | } | ||
274 | |||
275 | ul li p { | ||
276 | text-align: left; | ||
277 | } | ||
278 | |||
279 | table { | ||
280 | width :100%; | ||
281 | } | ||
282 | |||
283 | th { | ||
284 | padding: 0.25em; | ||
285 | text-align: left; | ||
286 | font-weight: normal; | ||
287 | vertical-align: top; | ||
288 | } | ||
289 | |||
290 | td { | ||
291 | padding: 0.25em; | ||
292 | vertical-align: top; | ||
293 | } | ||
294 | |||
295 | p a[id] { | ||
296 | margin: 0px; | ||
297 | padding: 0px; | ||
298 | display: inline; | ||
299 | background-image: none; | ||
300 | } | ||
301 | |||
302 | a { | ||
303 | text-decoration: underline; | ||
304 | color: #444; | ||
305 | } | ||
306 | |||
307 | pre { | ||
308 | overflow: auto; | ||
309 | } | ||
310 | |||
311 | a:hover { | ||
312 | text-decoration: underline; | ||
313 | /*font-weight: bold;*/ | ||
314 | } | ||
315 | |||
316 | /* This style defines how the permalink character | ||
317 | appears by itself and when hovered over with | ||
318 | the mouse. */ | ||
319 | |||
320 | [alt='Permalink'] { color: #eee; } | ||
321 | [alt='Permalink']:hover { color: black; } | ||
322 | |||
323 | |||
324 | div.informalfigure, | ||
325 | div.informalexample, | ||
326 | div.informaltable, | ||
327 | div.figure, | ||
328 | div.table, | ||
329 | div.example { | ||
330 | margin: 1em 0em; | ||
331 | padding: 1em; | ||
332 | page-break-inside: avoid; | ||
333 | } | ||
334 | |||
335 | |||
336 | div.informalfigure p.title b, | ||
337 | div.informalexample p.title b, | ||
338 | div.informaltable p.title b, | ||
339 | div.figure p.title b, | ||
340 | div.example p.title b, | ||
341 | div.table p.title b{ | ||
342 | padding-top: 0em; | ||
343 | margin-top: 0em; | ||
344 | font-size: 100%; | ||
345 | font-weight: normal; | ||
346 | } | ||
347 | |||
348 | .mediaobject .caption, | ||
349 | .mediaobject .caption p { | ||
350 | text-align: center; | ||
351 | font-size: 80%; | ||
352 | padding-top: 0.5em; | ||
353 | padding-bottom: 0.5em; | ||
354 | } | ||
355 | |||
356 | .epigraph { | ||
357 | padding-left: 55%; | ||
358 | margin-bottom: 1em; | ||
359 | } | ||
360 | |||
361 | .epigraph p { | ||
362 | text-align: left; | ||
363 | } | ||
364 | |||
365 | .epigraph .quote { | ||
366 | font-style: italic; | ||
367 | } | ||
368 | .epigraph .attribution { | ||
369 | font-style: normal; | ||
370 | text-align: right; | ||
371 | } | ||
372 | |||
373 | span.application { | ||
374 | font-style: italic; | ||
375 | } | ||
376 | |||
377 | .programlisting { | ||
378 | font-family: monospace; | ||
379 | font-size: 80%; | ||
380 | white-space: pre; | ||
381 | margin: 1.33em 0em; | ||
382 | padding: 1.33em; | ||
383 | } | ||
384 | |||
385 | .tip, | ||
386 | .warning, | ||
387 | .caution, | ||
388 | .note { | ||
389 | margin-top: 1em; | ||
390 | margin-bottom: 1em; | ||
391 | |||
392 | } | ||
393 | |||
394 | /* force full width of table within div */ | ||
395 | .tip table, | ||
396 | .warning table, | ||
397 | .caution table, | ||
398 | .note table { | ||
399 | border: none; | ||
400 | width: 100%; | ||
401 | } | ||
402 | |||
403 | |||
404 | .tip table th, | ||
405 | .warning table th, | ||
406 | .caution table th, | ||
407 | .note table th { | ||
408 | padding: 0.8em 0.0em 0.0em 0.0em; | ||
409 | margin : 0em 0em 0em 0em; | ||
410 | } | ||
411 | |||
412 | .tip p, | ||
413 | .warning p, | ||
414 | .caution p, | ||
415 | .note p { | ||
416 | margin-top: 0.5em; | ||
417 | margin-bottom: 0.5em; | ||
418 | padding-right: 1em; | ||
419 | text-align: left; | ||
420 | } | ||
421 | |||
422 | .acronym { | ||
423 | text-transform: uppercase; | ||
424 | } | ||
425 | |||
426 | b.keycap, | ||
427 | .keycap { | ||
428 | padding: 0.09em 0.3em; | ||
429 | margin: 0em; | ||
430 | } | ||
431 | |||
432 | .itemizedlist li { | ||
433 | clear: none; | ||
434 | } | ||
435 | |||
436 | .filename { | ||
437 | font-size: medium; | ||
438 | font-family: Courier, monospace; | ||
439 | } | ||
440 | |||
441 | |||
442 | div.navheader, div.heading{ | ||
443 | position: absolute; | ||
444 | left: 0em; | ||
445 | top: 0em; | ||
446 | width: 100%; | ||
447 | background-color: #cdf; | ||
448 | width: 100%; | ||
449 | } | ||
450 | |||
451 | div.navfooter, div.footing{ | ||
452 | position: fixed; | ||
453 | left: 0em; | ||
454 | bottom: 0em; | ||
455 | background-color: #eee; | ||
456 | width: 100%; | ||
457 | } | ||
458 | |||
459 | |||
460 | div.navheader td, | ||
461 | div.navfooter td { | ||
462 | font-size: 66%; | ||
463 | } | ||
464 | |||
465 | div.navheader table th { | ||
466 | /*font-family: Georgia, Times, serif;*/ | ||
467 | /*font-size: x-large;*/ | ||
468 | font-size: 80%; | ||
469 | } | ||
470 | |||
471 | div.navheader table { | ||
472 | border-left: 0em; | ||
473 | border-right: 0em; | ||
474 | border-top: 0em; | ||
475 | width: 100%; | ||
476 | } | ||
477 | |||
478 | div.navfooter table { | ||
479 | border-left: 0em; | ||
480 | border-right: 0em; | ||
481 | border-bottom: 0em; | ||
482 | width: 100%; | ||
483 | } | ||
484 | |||
485 | div.navheader table td a, | ||
486 | div.navfooter table td a { | ||
487 | color: #777; | ||
488 | text-decoration: none; | ||
489 | } | ||
490 | |||
491 | /* normal text in the footer */ | ||
492 | div.navfooter table td { | ||
493 | color: black; | ||
494 | } | ||
495 | |||
496 | div.navheader table td a:visited, | ||
497 | div.navfooter table td a:visited { | ||
498 | color: #444; | ||
499 | } | ||
500 | |||
501 | |||
502 | /* links in header and footer */ | ||
503 | div.navheader table td a:hover, | ||
504 | div.navfooter table td a:hover { | ||
505 | text-decoration: underline; | ||
506 | background-color: transparent; | ||
507 | color: #33a; | ||
508 | } | ||
509 | |||
510 | div.navheader hr, | ||
511 | div.navfooter hr { | ||
512 | display: none; | ||
513 | } | ||
514 | |||
515 | |||
516 | .qandaset tr.question td p { | ||
517 | margin: 0em 0em 1em 0em; | ||
518 | padding: 0em 0em 0em 0em; | ||
519 | } | ||
520 | |||
521 | .qandaset tr.answer td p { | ||
522 | margin: 0em 0em 1em 0em; | ||
523 | padding: 0em 0em 0em 0em; | ||
524 | } | ||
525 | .answer td { | ||
526 | padding-bottom: 1.5em; | ||
527 | } | ||
528 | |||
529 | .emphasis { | ||
530 | font-weight: bold; | ||
531 | } | ||
532 | |||
533 | |||
534 | /************* / | ||
535 | / decorations / | ||
536 | / *************/ | ||
537 | |||
538 | .titlepage { | ||
539 | } | ||
540 | |||
541 | .part .title { | ||
542 | } | ||
543 | |||
544 | .subtitle { | ||
545 | border: none; | ||
546 | } | ||
547 | |||
548 | /* | ||
549 | h1 { | ||
550 | border: none; | ||
551 | } | ||
552 | |||
553 | h2 { | ||
554 | border-top: solid 0.2em; | ||
555 | border-bottom: solid 0.06em; | ||
556 | } | ||
557 | |||
558 | h3 { | ||
559 | border-top: 0em; | ||
560 | border-bottom: solid 0.06em; | ||
561 | } | ||
562 | |||
563 | h4 { | ||
564 | border: 0em; | ||
565 | border-bottom: solid 0.06em; | ||
566 | } | ||
567 | |||
568 | h5 { | ||
569 | border: 0em; | ||
570 | } | ||
571 | */ | ||
572 | |||
573 | .programlisting { | ||
574 | border: solid 1px; | ||
575 | } | ||
576 | |||
577 | div.figure, | ||
578 | div.table, | ||
579 | div.informalfigure, | ||
580 | div.informaltable, | ||
581 | div.informalexample, | ||
582 | div.example { | ||
583 | border: 1px solid; | ||
584 | } | ||
585 | |||
586 | |||
587 | |||
588 | .tip, | ||
589 | .warning, | ||
590 | .caution, | ||
591 | .note { | ||
592 | border: 1px solid; | ||
593 | } | ||
594 | |||
595 | .tip table th, | ||
596 | .warning table th, | ||
597 | .caution table th, | ||
598 | .note table th { | ||
599 | border-bottom: 1px solid; | ||
600 | } | ||
601 | |||
602 | .question td { | ||
603 | border-top: 1px solid black; | ||
604 | } | ||
605 | |||
606 | .answer { | ||
607 | } | ||
608 | |||
609 | |||
610 | b.keycap, | ||
611 | .keycap { | ||
612 | border: 1px solid; | ||
613 | } | ||
614 | |||
615 | |||
616 | div.navheader, div.heading{ | ||
617 | border-bottom: 1px solid; | ||
618 | } | ||
619 | |||
620 | |||
621 | div.navfooter, div.footing{ | ||
622 | border-top: 1px solid; | ||
623 | } | ||
624 | |||
625 | /********* / | ||
626 | / colors / | ||
627 | / *********/ | ||
628 | |||
629 | body { | ||
630 | color: #333; | ||
631 | background: white; | ||
632 | } | ||
633 | |||
634 | a { | ||
635 | background: transparent; | ||
636 | } | ||
637 | |||
638 | a:hover { | ||
639 | background-color: #dedede; | ||
640 | } | ||
641 | |||
642 | |||
643 | h1, | ||
644 | h2, | ||
645 | h3, | ||
646 | h4, | ||
647 | h5, | ||
648 | h6, | ||
649 | h7, | ||
650 | h8 { | ||
651 | background-color: transparent; | ||
652 | } | ||
653 | |||
654 | hr { | ||
655 | border-color: #aaa; | ||
656 | } | ||
657 | |||
658 | |||
659 | .tip, .warning, .caution, .note { | ||
660 | border-color: #fff; | ||
661 | } | ||
662 | |||
663 | |||
664 | .tip table th, | ||
665 | .warning table th, | ||
666 | .caution table th, | ||
667 | .note table th { | ||
668 | border-bottom-color: #fff; | ||
669 | } | ||
670 | |||
671 | |||
672 | .warning { | ||
673 | background-color: #f0f0f2; | ||
674 | } | ||
675 | |||
676 | .caution { | ||
677 | background-color: #f0f0f2; | ||
678 | } | ||
679 | |||
680 | .tip { | ||
681 | background-color: #f0f0f2; | ||
682 | } | ||
683 | |||
684 | .note { | ||
685 | background-color: #f0f0f2; | ||
686 | } | ||
687 | |||
688 | .glossary dl dt, | ||
689 | .variablelist dl dt, | ||
690 | .variablelist dl dt span.term { | ||
691 | color: #044; | ||
692 | } | ||
693 | |||
694 | div.figure, | ||
695 | div.table, | ||
696 | div.example, | ||
697 | div.informalfigure, | ||
698 | div.informaltable, | ||
699 | div.informalexample { | ||
700 | border-color: #aaa; | ||
701 | } | ||
702 | |||
703 | pre.programlisting { | ||
704 | color: black; | ||
705 | background-color: #fff; | ||
706 | border-color: #aaa; | ||
707 | border-width: 2px; | ||
708 | } | ||
709 | |||
710 | .guimenu, | ||
711 | .guilabel, | ||
712 | .guimenuitem { | ||
713 | background-color: #eee; | ||
714 | } | ||
715 | |||
716 | |||
717 | b.keycap, | ||
718 | .keycap { | ||
719 | background-color: #eee; | ||
720 | border-color: #999; | ||
721 | } | ||
722 | |||
723 | |||
724 | div.navheader { | ||
725 | border-color: black; | ||
726 | } | ||
727 | |||
728 | |||
729 | div.navfooter { | ||
730 | border-color: black; | ||
731 | } | ||
732 | |||
733 | |||
734 | /*********** / | ||
735 | / graphics / | ||
736 | / ***********/ | ||
737 | |||
738 | /* | ||
739 | body { | ||
740 | background-image: url("images/body_bg.jpg"); | ||
741 | background-attachment: fixed; | ||
742 | } | ||
743 | |||
744 | .navheader, | ||
745 | .note, | ||
746 | .tip { | ||
747 | background-image: url("images/note_bg.jpg"); | ||
748 | background-attachment: fixed; | ||
749 | } | ||
750 | |||
751 | .warning, | ||
752 | .caution { | ||
753 | background-image: url("images/warning_bg.jpg"); | ||
754 | background-attachment: fixed; | ||
755 | } | ||
756 | |||
757 | .figure, | ||
758 | .informalfigure, | ||
759 | .example, | ||
760 | .informalexample, | ||
761 | .table, | ||
762 | .informaltable { | ||
763 | background-image: url("images/figure_bg.jpg"); | ||
764 | background-attachment: fixed; | ||
765 | } | ||
766 | |||
767 | */ | ||
768 | h1, | ||
769 | h2, | ||
770 | h3, | ||
771 | h4, | ||
772 | h5, | ||
773 | h6, | ||
774 | h7{ | ||
775 | } | ||
776 | |||
777 | /* | ||
778 | Example of how to stick an image as part of the title. | ||
779 | |||
780 | div.article .titlepage .title | ||
781 | { | ||
782 | background-image: url("figures/white-on-black.png"); | ||
783 | background-position: center; | ||
784 | background-repeat: repeat-x; | ||
785 | } | ||
786 | */ | ||
787 | |||
788 | div.preface .titlepage .title, | ||
789 | div.colophon .title, | ||
790 | div.chapter .titlepage .title, | ||
791 | div.article .titlepage .title | ||
792 | { | ||
793 | } | ||
794 | |||
795 | div.section div.section .titlepage .title, | ||
796 | div.sect2 .titlepage .title { | ||
797 | background: none; | ||
798 | } | ||
799 | |||
800 | |||
801 | h1.title { | ||
802 | background-color: transparent; | ||
803 | background-repeat: no-repeat; | ||
804 | height: 256px; | ||
805 | text-indent: -9000px; | ||
806 | overflow:hidden; | ||
807 | } | ||
808 | |||
809 | h2.subtitle { | ||
810 | background-color: transparent; | ||
811 | text-indent: -9000px; | ||
812 | overflow:hidden; | ||
813 | width: 0px; | ||
814 | display: none; | ||
815 | } | ||
816 | |||
817 | /*************************************** / | ||
818 | / pippin.gimp.org specific alterations / | ||
819 | / ***************************************/ | ||
820 | |||
821 | /* | ||
822 | div.heading, div.navheader { | ||
823 | color: #777; | ||
824 | font-size: 80%; | ||
825 | padding: 0; | ||
826 | margin: 0; | ||
827 | text-align: left; | ||
828 | position: absolute; | ||
829 | top: 0px; | ||
830 | left: 0px; | ||
831 | width: 100%; | ||
832 | height: 50px; | ||
833 | background: url('/gfx/heading_bg.png') transparent; | ||
834 | background-repeat: repeat-x; | ||
835 | background-attachment: fixed; | ||
836 | border: none; | ||
837 | } | ||
838 | |||
839 | div.heading a { | ||
840 | color: #444; | ||
841 | } | ||
842 | |||
843 | div.footing, div.navfooter { | ||
844 | border: none; | ||
845 | color: #ddd; | ||
846 | font-size: 80%; | ||
847 | text-align:right; | ||
848 | |||
849 | width: 100%; | ||
850 | padding-top: 10px; | ||
851 | position: absolute; | ||
852 | bottom: 0px; | ||
853 | left: 0px; | ||
854 | |||
855 | background: url('/gfx/footing_bg.png') transparent; | ||
856 | } | ||
857 | */ | ||
858 | |||
859 | |||
860 | |||
861 | /****************** / | ||
862 | / nasty ie tweaks / | ||
863 | / ******************/ | ||
864 | |||
865 | /* | ||
866 | div.heading, div.navheader { | ||
867 | width:expression(document.body.clientWidth + "px"); | ||
868 | } | ||
869 | |||
870 | div.footing, div.navfooter { | ||
871 | width:expression(document.body.clientWidth + "px"); | ||
872 | margin-left:expression("-5em"); | ||
873 | } | ||
874 | body { | ||
875 | padding:expression("4em 5em 0em 5em"); | ||
876 | } | ||
877 | */ | ||
878 | |||
879 | /**************************************** / | ||
880 | / mozilla vendor specific css extensions / | ||
881 | / ****************************************/ | ||
882 | /* | ||
883 | div.navfooter, div.footing{ | ||
884 | -moz-opacity: 0.8em; | ||
885 | } | ||
886 | |||
887 | div.figure, | ||
888 | div.table, | ||
889 | div.informalfigure, | ||
890 | div.informaltable, | ||
891 | div.informalexample, | ||
892 | div.example, | ||
893 | .tip, | ||
894 | .warning, | ||
895 | .caution, | ||
896 | .note { | ||
897 | -moz-border-radius: 0.5em; | ||
898 | } | ||
899 | |||
900 | b.keycap, | ||
901 | .keycap { | ||
902 | -moz-border-radius: 0.3em; | ||
903 | } | ||
904 | */ | ||
905 | |||
906 | table tr td table tr td { | ||
907 | display: none; | ||
908 | } | ||
909 | |||
910 | |||
911 | hr { | ||
912 | display: none; | ||
913 | } | ||
914 | |||
915 | table { | ||
916 | border: 0em; | ||
917 | } | ||
918 | |||
919 | .photo { | ||
920 | float: right; | ||
921 | margin-left: 1.5em; | ||
922 | margin-bottom: 1.5em; | ||
923 | margin-top: 0em; | ||
924 | max-width: 17em; | ||
925 | border: 1px solid gray; | ||
926 | padding: 3px; | ||
927 | background: white; | ||
928 | } | ||
929 | .seperator { | ||
930 | padding-top: 2em; | ||
931 | clear: both; | ||
932 | } | ||
933 | |||
934 | #validators { | ||
935 | margin-top: 5em; | ||
936 | text-align: right; | ||
937 | color: #777; | ||
938 | } | ||
939 | @media print { | ||
940 | body { | ||
941 | font-size: 8pt; | ||
942 | } | ||
943 | .noprint { | ||
944 | display: none; | ||
945 | } | ||
946 | } | ||
947 | |||
948 | |||
949 | .tip, | ||
950 | .note { | ||
951 | background: #f0f0f2; | ||
952 | color: #333; | ||
953 | padding: 20px; | ||
954 | margin: 20px; | ||
955 | } | ||
956 | |||
957 | .tip h3, | ||
958 | .note h3 { | ||
959 | padding: 0em; | ||
960 | margin: 0em; | ||
961 | font-size: 2em; | ||
962 | font-weight: bold; | ||
963 | color: #333; | ||
964 | } | ||
965 | |||
966 | .tip a, | ||
967 | .note a { | ||
968 | color: #333; | ||
969 | text-decoration: underline; | ||
970 | } | ||
971 | |||
972 | .footnote { | ||
973 | font-size: small; | ||
974 | color: #333; | ||
975 | } | ||
976 | |||
977 | /* Changes the announcement text */ | ||
978 | .tip h3, | ||
979 | .warning h3, | ||
980 | .caution h3, | ||
981 | .note h3 { | ||
982 | font-size:large; | ||
983 | color: #00557D; | ||
984 | } | ||
diff --git a/documentation/profile-manual/profile-manual-usage.xml b/documentation/profile-manual/profile-manual-usage.xml new file mode 100644 index 0000000..5577b1b --- /dev/null +++ b/documentation/profile-manual/profile-manual-usage.xml | |||
@@ -0,0 +1,3685 @@ | |||
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 | |||
5 | <chapter id='profile-manual-usage'> | ||
6 | |||
7 | <title>Basic Usage (with examples) for each of the Yocto Tracing Tools</title> | ||
8 | |||
9 | <para> | ||
10 | This chapter presents basic usage examples for each of the tracing | ||
11 | tools. | ||
12 | </para> | ||
13 | |||
14 | <section id='profile-manual-perf'> | ||
15 | <title>perf</title> | ||
16 | |||
17 | <para> | ||
18 | The 'perf' tool is the profiling and tracing tool that comes | ||
19 | bundled with the Linux kernel. | ||
20 | </para> | ||
21 | |||
22 | <para> | ||
23 | Don't let the fact that it's part of the kernel fool you into thinking | ||
24 | that it's only for tracing and profiling the kernel - you can indeed | ||
25 | use it to trace and profile just the kernel, but you can also use it | ||
26 | to profile specific applications separately (with or without kernel | ||
27 | context), and you can also use it to trace and profile the kernel | ||
28 | and all applications on the system simultaneously to gain a system-wide | ||
29 | view of what's going on. | ||
30 | </para> | ||
31 | |||
32 | <para> | ||
33 | In many ways, perf aims to be a superset of all the tracing and profiling | ||
34 | tools available in Linux today, including all the other tools covered | ||
35 | in this HOWTO. The past couple of years have seen perf subsume a lot | ||
36 | of the functionality of those other tools and, at the same time, those | ||
37 | other tools have removed large portions of their previous functionality | ||
38 | and replaced it with calls to the equivalent functionality now | ||
39 | implemented by the perf subsystem. Extrapolation suggests that at | ||
40 | some point those other tools will simply become completely redundant | ||
41 | and go away; until then, we'll cover those other tools in these pages | ||
42 | and in many cases show how the same things can be accomplished in | ||
43 | perf and the other tools when it seems useful to do so. | ||
44 | </para> | ||
45 | |||
46 | <para> | ||
47 | The coverage below details some of the most common ways you'll likely | ||
48 | want to apply the tool; full documentation can be found either within | ||
49 | the tool itself or in the man pages at | ||
50 | <ulink url='http://linux.die.net/man/1/perf'>perf(1)</ulink>. | ||
51 | </para> | ||
52 | |||
53 | <section id='perf-setup'> | ||
54 | <title>Setup</title> | ||
55 | |||
56 | <para> | ||
57 | For this section, we'll assume you've already performed the basic | ||
58 | setup outlined in the General Setup section. | ||
59 | </para> | ||
60 | |||
61 | <para> | ||
62 | In particular, you'll get the most mileage out of perf if you | ||
63 | profile an image built with INHIBIT_PACKAGE_STRIP = "1" in your | ||
64 | local.conf. | ||
65 | </para> | ||
66 | |||
67 | <para> | ||
68 | perf runs on the target system for the most part. You can archive | ||
69 | profile data and copy it to the host for analysis, but for the | ||
70 | rest of this document we assume you've ssh'ed to the host and | ||
71 | will be running the perf commands on the target. | ||
72 | </para> | ||
73 | </section> | ||
74 | |||
75 | <section id='perf-basic-usage'> | ||
76 | <title>Basic Usage</title> | ||
77 | |||
78 | <para> | ||
79 | The perf tool is pretty much self-documenting. To remind yourself | ||
80 | of the available commands, simply type 'perf', which will show you | ||
81 | basic usage along with the available perf subcommands: | ||
82 | <literallayout class='monospaced'> | ||
83 | root@crownbay:~# perf | ||
84 | |||
85 | usage: perf [--version] [--help] COMMAND [ARGS] | ||
86 | |||
87 | The most commonly used perf commands are: | ||
88 | annotate Read perf.data (created by perf record) and display annotated code | ||
89 | archive Create archive with object files with build-ids found in perf.data file | ||
90 | bench General framework for benchmark suites | ||
91 | buildid-cache Manage build-id cache. | ||
92 | buildid-list List the buildids in a perf.data file | ||
93 | diff Read two perf.data files and display the differential profile | ||
94 | evlist List the event names in a perf.data file | ||
95 | inject Filter to augment the events stream with additional information | ||
96 | kmem Tool to trace/measure kernel memory(slab) properties | ||
97 | kvm Tool to trace/measure kvm guest os | ||
98 | list List all symbolic event types | ||
99 | lock Analyze lock events | ||
100 | probe Define new dynamic tracepoints | ||
101 | record Run a command and record its profile into perf.data | ||
102 | report Read perf.data (created by perf record) and display the profile | ||
103 | sched Tool to trace/measure scheduler properties (latencies) | ||
104 | script Read perf.data (created by perf record) and display trace output | ||
105 | stat Run a command and gather performance counter statistics | ||
106 | test Runs sanity tests. | ||
107 | timechart Tool to visualize total system behavior during a workload | ||
108 | top System profiling tool. | ||
109 | |||
110 | See 'perf help COMMAND' for more information on a specific command. | ||
111 | </literallayout> | ||
112 | </para> | ||
113 | |||
114 | <section id='using-perf-to-do-basic-profiling'> | ||
115 | <title>Using perf to do Basic Profiling</title> | ||
116 | |||
117 | <para> | ||
118 | As a simple test case, we'll profile the 'wget' of a fairly large | ||
119 | file, which is a minimally interesting case because it has both | ||
120 | file and network I/O aspects, and at least in the case of standard | ||
121 | Yocto images, it's implemented as part of busybox, so the methods | ||
122 | we use to analyze it can be used in a very similar way to the whole | ||
123 | host of supported busybox applets in Yocto. | ||
124 | <literallayout class='monospaced'> | ||
125 | root@crownbay:~# rm linux-2.6.19.2.tar.bz2; \ | ||
126 | wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink> | ||
127 | </literallayout> | ||
128 | The quickest and easiest way to get some basic overall data about | ||
129 | what's going on for a particular workload is to profile it using | ||
130 | 'perf stat'. 'perf stat' basically profiles using a few default | ||
131 | counters and displays the summed counts at the end of the run: | ||
132 | <literallayout class='monospaced'> | ||
133 | root@crownbay:~# perf stat wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink> | ||
134 | Connecting to downloads.yoctoproject.org (140.211.169.59:80) | ||
135 | linux-2.6.19.2.tar.b 100% |***************************************************| 41727k 0:00:00 ETA | ||
136 | |||
137 | Performance counter stats for 'wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>': | ||
138 | |||
139 | 4597.223902 task-clock # 0.077 CPUs utilized | ||
140 | 23568 context-switches # 0.005 M/sec | ||
141 | 68 CPU-migrations # 0.015 K/sec | ||
142 | 241 page-faults # 0.052 K/sec | ||
143 | 3045817293 cycles # 0.663 GHz | ||
144 | <not supported> stalled-cycles-frontend | ||
145 | <not supported> stalled-cycles-backend | ||
146 | 858909167 instructions # 0.28 insns per cycle | ||
147 | 165441165 branches # 35.987 M/sec | ||
148 | 19550329 branch-misses # 11.82% of all branches | ||
149 | |||
150 | 59.836627620 seconds time elapsed | ||
151 | </literallayout> | ||
152 | Many times such a simple-minded test doesn't yield much of | ||
153 | interest, but sometimes it does (see Real-world Yocto bug | ||
154 | (slow loop-mounted write speed)). | ||
155 | </para> | ||
156 | |||
157 | <para> | ||
158 | Also, note that 'perf stat' isn't restricted to a fixed set of | ||
159 | counters - basically any event listed in the output of 'perf list' | ||
160 | can be tallied by 'perf stat'. For example, suppose we wanted to | ||
161 | see a summary of all the events related to kernel memory | ||
162 | allocation/freeing along with cache hits and misses: | ||
163 | <literallayout class='monospaced'> | ||
164 | root@crownbay:~# perf stat -e kmem:* -e cache-references -e cache-misses wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink> | ||
165 | Connecting to downloads.yoctoproject.org (140.211.169.59:80) | ||
166 | linux-2.6.19.2.tar.b 100% |***************************************************| 41727k 0:00:00 ETA | ||
167 | |||
168 | Performance counter stats for 'wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>': | ||
169 | |||
170 | 5566 kmem:kmalloc | ||
171 | 125517 kmem:kmem_cache_alloc | ||
172 | 0 kmem:kmalloc_node | ||
173 | 0 kmem:kmem_cache_alloc_node | ||
174 | 34401 kmem:kfree | ||
175 | 69920 kmem:kmem_cache_free | ||
176 | 133 kmem:mm_page_free | ||
177 | 41 kmem:mm_page_free_batched | ||
178 | 11502 kmem:mm_page_alloc | ||
179 | 11375 kmem:mm_page_alloc_zone_locked | ||
180 | 0 kmem:mm_page_pcpu_drain | ||
181 | 0 kmem:mm_page_alloc_extfrag | ||
182 | 66848602 cache-references | ||
183 | 2917740 cache-misses # 4.365 % of all cache refs | ||
184 | |||
185 | 44.831023415 seconds time elapsed | ||
186 | </literallayout> | ||
187 | So 'perf stat' gives us a nice easy way to get a quick overview of | ||
188 | what might be happening for a set of events, but normally we'd | ||
189 | need a little more detail in order to understand what's going on | ||
190 | in a way that we can act on in a useful way. | ||
191 | </para> | ||
192 | |||
193 | <para> | ||
194 | To dive down into a next level of detail, we can use 'perf | ||
195 | record'/'perf report' which will collect profiling data and | ||
196 | present it to use using an interactive text-based UI (or | ||
197 | simply as text if we specify --stdio to 'perf report'). | ||
198 | </para> | ||
199 | |||
200 | <para> | ||
201 | As our first attempt at profiling this workload, we'll simply | ||
202 | run 'perf record', handing it the workload we want to profile | ||
203 | (everything after 'perf record' and any perf options we hand | ||
204 | it - here none - will be executed in a new shell). perf collects | ||
205 | samples until the process exits and records them in a file named | ||
206 | 'perf.data' in the current working directory. | ||
207 | <literallayout class='monospaced'> | ||
208 | root@crownbay:~# perf record wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink> | ||
209 | |||
210 | Connecting to downloads.yoctoproject.org (140.211.169.59:80) | ||
211 | linux-2.6.19.2.tar.b 100% |************************************************| 41727k 0:00:00 ETA | ||
212 | [ perf record: Woken up 1 times to write data ] | ||
213 | [ perf record: Captured and wrote 0.176 MB perf.data (~7700 samples) ] | ||
214 | </literallayout> | ||
215 | To see the results in a 'text-based UI' (tui), simply run | ||
216 | 'perf report', which will read the perf.data file in the current | ||
217 | working directory and display the results in an interactive UI: | ||
218 | <literallayout class='monospaced'> | ||
219 | root@crownbay:~# perf report | ||
220 | </literallayout> | ||
221 | </para> | ||
222 | |||
223 | <para> | ||
224 | <imagedata fileref="figures/perf-wget-flat-stripped.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
225 | </para> | ||
226 | |||
227 | <para> | ||
228 | The above screenshot displays a 'flat' profile, one entry for | ||
229 | each 'bucket' corresponding to the functions that were profiled | ||
230 | during the profiling run, ordered from the most popular to the | ||
231 | least (perf has options to sort in various orders and keys as | ||
232 | well as display entries only above a certain threshold and so | ||
233 | on - see the perf documentation for details). Note that this | ||
234 | includes both userspace functions (entries containing a [.]) and | ||
235 | kernel functions accounted to the process (entries containing | ||
236 | a [k]). (perf has command-line modifiers that can be used to | ||
237 | restrict the profiling to kernel or userspace, among others). | ||
238 | </para> | ||
239 | |||
240 | <para> | ||
241 | Notice also that the above report shows an entry for 'busybox', | ||
242 | which is the executable that implements 'wget' in Yocto, but that | ||
243 | instead of a useful function name in that entry, it displays | ||
244 | a not-so-friendly hex value instead. The steps below will show | ||
245 | how to fix that problem. | ||
246 | </para> | ||
247 | |||
248 | <para> | ||
249 | Before we do that, however, let's try running a different profile, | ||
250 | one which shows something a little more interesting. The only | ||
251 | difference between the new profile and the previous one is that | ||
252 | we'll add the -g option, which will record not just the address | ||
253 | of a sampled function, but the entire callchain to the sampled | ||
254 | function as well: | ||
255 | <literallayout class='monospaced'> | ||
256 | root@crownbay:~# perf record -g wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink> | ||
257 | Connecting to downloads.yoctoproject.org (140.211.169.59:80) | ||
258 | linux-2.6.19.2.tar.b 100% |************************************************| 41727k 0:00:00 ETA | ||
259 | [ perf record: Woken up 3 times to write data ] | ||
260 | [ perf record: Captured and wrote 0.652 MB perf.data (~28476 samples) ] | ||
261 | |||
262 | |||
263 | root@crownbay:~# perf report | ||
264 | </literallayout> | ||
265 | </para> | ||
266 | |||
267 | <para> | ||
268 | <imagedata fileref="figures/perf-wget-g-copy-to-user-expanded-stripped.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
269 | </para> | ||
270 | |||
271 | <para> | ||
272 | Using the callgraph view, we can actually see not only which | ||
273 | functions took the most time, but we can also see a summary of | ||
274 | how those functions were called and learn something about how the | ||
275 | program interacts with the kernel in the process. | ||
276 | </para> | ||
277 | |||
278 | <para> | ||
279 | Notice that each entry in the above screenshot now contains a '+' | ||
280 | on the left-hand side. This means that we can expand the entry and | ||
281 | drill down into the callchains that feed into that entry. | ||
282 | Pressing 'enter' on any one of them will expand the callchain | ||
283 | (you can also press 'E' to expand them all at the same time or 'C' | ||
284 | to collapse them all). | ||
285 | </para> | ||
286 | |||
287 | <para> | ||
288 | In the screenshot above, we've toggled the __copy_to_user_ll() | ||
289 | entry and several subnodes all the way down. This lets us see | ||
290 | which callchains contributed to the profiled __copy_to_user_ll() | ||
291 | function which contributed 1.77% to the total profile. | ||
292 | </para> | ||
293 | |||
294 | <para> | ||
295 | As a bit of background explanation for these callchains, think | ||
296 | about what happens at a high level when you run wget to get a file | ||
297 | out on the network. Basically what happens is that the data comes | ||
298 | into the kernel via the network connection (socket) and is passed | ||
299 | to the userspace program 'wget' (which is actually a part of | ||
300 | busybox, but that's not important for now), which takes the buffers | ||
301 | the kernel passes to it and writes it to a disk file to save it. | ||
302 | </para> | ||
303 | |||
304 | <para> | ||
305 | The part of this process that we're looking at in the above call | ||
306 | stacks is the part where the kernel passes the data it's read from | ||
307 | the socket down to wget i.e. a copy-to-user. | ||
308 | </para> | ||
309 | |||
310 | <para> | ||
311 | Notice also that here there's also a case where the hex value | ||
312 | is displayed in the callstack, here in the expanded | ||
313 | sys_clock_gettime() function. Later we'll see it resolve to a | ||
314 | userspace function call in busybox. | ||
315 | </para> | ||
316 | |||
317 | <para> | ||
318 | <imagedata fileref="figures/perf-wget-g-copy-from-user-expanded-stripped.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
319 | </para> | ||
320 | |||
321 | <para> | ||
322 | The above screenshot shows the other half of the journey for the | ||
323 | data - from the wget program's userspace buffers to disk. To get | ||
324 | the buffers to disk, the wget program issues a write(2), which | ||
325 | does a copy-from-user to the kernel, which then takes care via | ||
326 | some circuitous path (probably also present somewhere in the | ||
327 | profile data), to get it safely to disk. | ||
328 | </para> | ||
329 | |||
330 | <para> | ||
331 | Now that we've seen the basic layout of the profile data and the | ||
332 | basics of how to extract useful information out of it, let's get | ||
333 | back to the task at hand and see if we can get some basic idea | ||
334 | about where the time is spent in the program we're profiling, | ||
335 | wget. Remember that wget is actually implemented as an applet | ||
336 | in busybox, so while the process name is 'wget', the executable | ||
337 | we're actually interested in is busybox. So let's expand the | ||
338 | first entry containing busybox: | ||
339 | </para> | ||
340 | |||
341 | <para> | ||
342 | <imagedata fileref="figures/perf-wget-busybox-expanded-stripped.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
343 | </para> | ||
344 | |||
345 | <para> | ||
346 | Again, before we expanded we saw that the function was labeled | ||
347 | with a hex value instead of a symbol as with most of the kernel | ||
348 | entries. Expanding the busybox entry doesn't make it any better. | ||
349 | </para> | ||
350 | |||
351 | <para> | ||
352 | The problem is that perf can't find the symbol information for the | ||
353 | busybox binary, which is actually stripped out by the Yocto build | ||
354 | system. | ||
355 | </para> | ||
356 | |||
357 | <para> | ||
358 | One way around that is to put the following in your local.conf | ||
359 | when you build the image: | ||
360 | <literallayout class='monospaced'> | ||
361 | INHIBIT_PACKAGE_STRIP = "1" | ||
362 | </literallayout> | ||
363 | However, we already have an image with the binaries stripped, | ||
364 | so what can we do to get perf to resolve the symbols? Basically | ||
365 | we need to install the debuginfo for the busybox package. | ||
366 | </para> | ||
367 | |||
368 | <para> | ||
369 | To generate the debug info for the packages in the image, we can | ||
370 | add dbg-pkgs to EXTRA_IMAGE_FEATURES in local.conf. For example: | ||
371 | <literallayout class='monospaced'> | ||
372 | EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile dbg-pkgs" | ||
373 | </literallayout> | ||
374 | Additionally, in order to generate the type of debuginfo that | ||
375 | perf understands, we also need to add the following to local.conf: | ||
376 | <literallayout class='monospaced'> | ||
377 | PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory' | ||
378 | </literallayout> | ||
379 | Once we've done that, we can install the debuginfo for busybox. | ||
380 | The debug packages once built can be found in | ||
381 | build/tmp/deploy/rpm/* on the host system. Find the | ||
382 | busybox-dbg-...rpm file and copy it to the target. For example: | ||
383 | <literallayout class='monospaced'> | ||
384 | [trz@empanada core2]$ scp /home/trz/yocto/crownbay-tracing-dbg/build/tmp/deploy/rpm/core2_32/busybox-dbg-1.20.2-r2.core2_32.rpm root@192.168.1.31: | ||
385 | root@192.168.1.31's password: | ||
386 | busybox-dbg-1.20.2-r2.core2_32.rpm 100% 1826KB 1.8MB/s 00:01 | ||
387 | </literallayout> | ||
388 | Now install the debug rpm on the target: | ||
389 | <literallayout class='monospaced'> | ||
390 | root@crownbay:~# rpm -i busybox-dbg-1.20.2-r2.core2_32.rpm | ||
391 | </literallayout> | ||
392 | Now that the debuginfo is installed, we see that the busybox | ||
393 | entries now display their functions symbolically: | ||
394 | </para> | ||
395 | |||
396 | <para> | ||
397 | <imagedata fileref="figures/perf-wget-busybox-debuginfo.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
398 | </para> | ||
399 | |||
400 | <para> | ||
401 | If we expand one of the entries and press 'enter' on a leaf node, | ||
402 | we're presented with a menu of actions we can take to get more | ||
403 | information related to that entry: | ||
404 | </para> | ||
405 | |||
406 | <para> | ||
407 | <imagedata fileref="figures/perf-wget-busybox-dso-zoom-menu.png" width="6in" depth="2in" align="center" scalefit="1" /> | ||
408 | </para> | ||
409 | |||
410 | <para> | ||
411 | One of these actions allows us to show a view that displays a | ||
412 | busybox-centric view of the profiled functions (in this case we've | ||
413 | also expanded all the nodes using the 'E' key): | ||
414 | </para> | ||
415 | |||
416 | <para> | ||
417 | <imagedata fileref="figures/perf-wget-busybox-dso-zoom.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
418 | </para> | ||
419 | |||
420 | <para> | ||
421 | Finally, we can see that now that the busybox debuginfo is | ||
422 | installed, the previously unresolved symbol in the | ||
423 | sys_clock_gettime() entry mentioned previously is now resolved, | ||
424 | and shows that the sys_clock_gettime system call that was the | ||
425 | source of 6.75% of the copy-to-user overhead was initiated by | ||
426 | the handle_input() busybox function: | ||
427 | </para> | ||
428 | |||
429 | <para> | ||
430 | <imagedata fileref="figures/perf-wget-g-copy-to-user-expanded-debuginfo.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
431 | </para> | ||
432 | |||
433 | <para> | ||
434 | At the lowest level of detail, we can dive down to the assembly | ||
435 | level and see which instructions caused the most overhead in a | ||
436 | function. Pressing 'enter' on the 'udhcpc_main' function, we're | ||
437 | again presented with a menu: | ||
438 | </para> | ||
439 | |||
440 | <para> | ||
441 | <imagedata fileref="figures/perf-wget-busybox-annotate-menu.png" width="6in" depth="2in" align="center" scalefit="1" /> | ||
442 | </para> | ||
443 | |||
444 | <para> | ||
445 | Selecting 'Annotate udhcpc_main', we get a detailed listing of | ||
446 | percentages by instruction for the udhcpc_main function. From the | ||
447 | display, we can see that over 50% of the time spent in this | ||
448 | function is taken up by a couple tests and the move of a | ||
449 | constant (1) to a register: | ||
450 | </para> | ||
451 | |||
452 | <para> | ||
453 | <imagedata fileref="figures/perf-wget-busybox-annotate-udhcpc.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
454 | </para> | ||
455 | |||
456 | <para> | ||
457 | As a segue into tracing, let's try another profile using a | ||
458 | different counter, something other than the default 'cycles'. | ||
459 | </para> | ||
460 | |||
461 | <para> | ||
462 | The tracing and profiling infrastructure in Linux has become | ||
463 | unified in a way that allows us to use the same tool with a | ||
464 | completely different set of counters, not just the standard | ||
465 | hardware counters that traditional tools have had to restrict | ||
466 | themselves to (of course the traditional tools can also make use | ||
467 | of the expanded possibilities now available to them, and in some | ||
468 | cases have, as mentioned previously). | ||
469 | </para> | ||
470 | |||
471 | <para> | ||
472 | We can get a list of the available events that can be used to | ||
473 | profile a workload via 'perf list': | ||
474 | <literallayout class='monospaced'> | ||
475 | root@crownbay:~# perf list | ||
476 | |||
477 | List of pre-defined events (to be used in -e): | ||
478 | cpu-cycles OR cycles [Hardware event] | ||
479 | stalled-cycles-frontend OR idle-cycles-frontend [Hardware event] | ||
480 | stalled-cycles-backend OR idle-cycles-backend [Hardware event] | ||
481 | instructions [Hardware event] | ||
482 | cache-references [Hardware event] | ||
483 | cache-misses [Hardware event] | ||
484 | branch-instructions OR branches [Hardware event] | ||
485 | branch-misses [Hardware event] | ||
486 | bus-cycles [Hardware event] | ||
487 | ref-cycles [Hardware event] | ||
488 | |||
489 | cpu-clock [Software event] | ||
490 | task-clock [Software event] | ||
491 | page-faults OR faults [Software event] | ||
492 | minor-faults [Software event] | ||
493 | major-faults [Software event] | ||
494 | context-switches OR cs [Software event] | ||
495 | cpu-migrations OR migrations [Software event] | ||
496 | alignment-faults [Software event] | ||
497 | emulation-faults [Software event] | ||
498 | |||
499 | L1-dcache-loads [Hardware cache event] | ||
500 | L1-dcache-load-misses [Hardware cache event] | ||
501 | L1-dcache-prefetch-misses [Hardware cache event] | ||
502 | L1-icache-loads [Hardware cache event] | ||
503 | L1-icache-load-misses [Hardware cache event] | ||
504 | . | ||
505 | . | ||
506 | . | ||
507 | rNNN [Raw hardware event descriptor] | ||
508 | cpu/t1=v1[,t2=v2,t3 ...]/modifier [Raw hardware event descriptor] | ||
509 | (see 'perf list --help' on how to encode it) | ||
510 | |||
511 | mem:<addr>[:access] [Hardware breakpoint] | ||
512 | |||
513 | sunrpc:rpc_call_status [Tracepoint event] | ||
514 | sunrpc:rpc_bind_status [Tracepoint event] | ||
515 | sunrpc:rpc_connect_status [Tracepoint event] | ||
516 | sunrpc:rpc_task_begin [Tracepoint event] | ||
517 | skb:kfree_skb [Tracepoint event] | ||
518 | skb:consume_skb [Tracepoint event] | ||
519 | skb:skb_copy_datagram_iovec [Tracepoint event] | ||
520 | net:net_dev_xmit [Tracepoint event] | ||
521 | net:net_dev_queue [Tracepoint event] | ||
522 | net:netif_receive_skb [Tracepoint event] | ||
523 | net:netif_rx [Tracepoint event] | ||
524 | napi:napi_poll [Tracepoint event] | ||
525 | sock:sock_rcvqueue_full [Tracepoint event] | ||
526 | sock:sock_exceed_buf_limit [Tracepoint event] | ||
527 | udp:udp_fail_queue_rcv_skb [Tracepoint event] | ||
528 | hda:hda_send_cmd [Tracepoint event] | ||
529 | hda:hda_get_response [Tracepoint event] | ||
530 | hda:hda_bus_reset [Tracepoint event] | ||
531 | scsi:scsi_dispatch_cmd_start [Tracepoint event] | ||
532 | scsi:scsi_dispatch_cmd_error [Tracepoint event] | ||
533 | scsi:scsi_eh_wakeup [Tracepoint event] | ||
534 | drm:drm_vblank_event [Tracepoint event] | ||
535 | drm:drm_vblank_event_queued [Tracepoint event] | ||
536 | drm:drm_vblank_event_delivered [Tracepoint event] | ||
537 | random:mix_pool_bytes [Tracepoint event] | ||
538 | random:mix_pool_bytes_nolock [Tracepoint event] | ||
539 | random:credit_entropy_bits [Tracepoint event] | ||
540 | gpio:gpio_direction [Tracepoint event] | ||
541 | gpio:gpio_value [Tracepoint event] | ||
542 | block:block_rq_abort [Tracepoint event] | ||
543 | block:block_rq_requeue [Tracepoint event] | ||
544 | block:block_rq_issue [Tracepoint event] | ||
545 | block:block_bio_bounce [Tracepoint event] | ||
546 | block:block_bio_complete [Tracepoint event] | ||
547 | block:block_bio_backmerge [Tracepoint event] | ||
548 | . | ||
549 | . | ||
550 | writeback:writeback_wake_thread [Tracepoint event] | ||
551 | writeback:writeback_wake_forker_thread [Tracepoint event] | ||
552 | writeback:writeback_bdi_register [Tracepoint event] | ||
553 | . | ||
554 | . | ||
555 | writeback:writeback_single_inode_requeue [Tracepoint event] | ||
556 | writeback:writeback_single_inode [Tracepoint event] | ||
557 | kmem:kmalloc [Tracepoint event] | ||
558 | kmem:kmem_cache_alloc [Tracepoint event] | ||
559 | kmem:mm_page_alloc [Tracepoint event] | ||
560 | kmem:mm_page_alloc_zone_locked [Tracepoint event] | ||
561 | kmem:mm_page_pcpu_drain [Tracepoint event] | ||
562 | kmem:mm_page_alloc_extfrag [Tracepoint event] | ||
563 | vmscan:mm_vmscan_kswapd_sleep [Tracepoint event] | ||
564 | vmscan:mm_vmscan_kswapd_wake [Tracepoint event] | ||
565 | vmscan:mm_vmscan_wakeup_kswapd [Tracepoint event] | ||
566 | vmscan:mm_vmscan_direct_reclaim_begin [Tracepoint event] | ||
567 | . | ||
568 | . | ||
569 | module:module_get [Tracepoint event] | ||
570 | module:module_put [Tracepoint event] | ||
571 | module:module_request [Tracepoint event] | ||
572 | sched:sched_kthread_stop [Tracepoint event] | ||
573 | sched:sched_wakeup [Tracepoint event] | ||
574 | sched:sched_wakeup_new [Tracepoint event] | ||
575 | sched:sched_process_fork [Tracepoint event] | ||
576 | sched:sched_process_exec [Tracepoint event] | ||
577 | sched:sched_stat_runtime [Tracepoint event] | ||
578 | rcu:rcu_utilization [Tracepoint event] | ||
579 | workqueue:workqueue_queue_work [Tracepoint event] | ||
580 | workqueue:workqueue_execute_end [Tracepoint event] | ||
581 | signal:signal_generate [Tracepoint event] | ||
582 | signal:signal_deliver [Tracepoint event] | ||
583 | timer:timer_init [Tracepoint event] | ||
584 | timer:timer_start [Tracepoint event] | ||
585 | timer:hrtimer_cancel [Tracepoint event] | ||
586 | timer:itimer_state [Tracepoint event] | ||
587 | timer:itimer_expire [Tracepoint event] | ||
588 | irq:irq_handler_entry [Tracepoint event] | ||
589 | irq:irq_handler_exit [Tracepoint event] | ||
590 | irq:softirq_entry [Tracepoint event] | ||
591 | irq:softirq_exit [Tracepoint event] | ||
592 | irq:softirq_raise [Tracepoint event] | ||
593 | printk:console [Tracepoint event] | ||
594 | task:task_newtask [Tracepoint event] | ||
595 | task:task_rename [Tracepoint event] | ||
596 | syscalls:sys_enter_socketcall [Tracepoint event] | ||
597 | syscalls:sys_exit_socketcall [Tracepoint event] | ||
598 | . | ||
599 | . | ||
600 | . | ||
601 | syscalls:sys_enter_unshare [Tracepoint event] | ||
602 | syscalls:sys_exit_unshare [Tracepoint event] | ||
603 | raw_syscalls:sys_enter [Tracepoint event] | ||
604 | raw_syscalls:sys_exit [Tracepoint event] | ||
605 | </literallayout> | ||
606 | </para> | ||
607 | |||
608 | <informalexample> | ||
609 | <emphasis>Tying it Together:</emphasis> These are exactly the same set of events defined | ||
610 | by the trace event subsystem and exposed by | ||
611 | ftrace/tracecmd/kernelshark as files in | ||
612 | /sys/kernel/debug/tracing/events, by SystemTap as | ||
613 | kernel.trace("tracepoint_name") and (partially) accessed by LTTng. | ||
614 | </informalexample> | ||
615 | |||
616 | <para> | ||
617 | Only a subset of these would be of interest to us when looking at | ||
618 | this workload, so let's choose the most likely subsystems | ||
619 | (identified by the string before the colon in the Tracepoint events) | ||
620 | and do a 'perf stat' run using only those wildcarded subsystems: | ||
621 | <literallayout class='monospaced'> | ||
622 | root@crownbay:~# perf stat -e skb:* -e net:* -e napi:* -e sched:* -e workqueue:* -e irq:* -e syscalls:* wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink> | ||
623 | Performance counter stats for 'wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>': | ||
624 | |||
625 | 23323 skb:kfree_skb | ||
626 | 0 skb:consume_skb | ||
627 | 49897 skb:skb_copy_datagram_iovec | ||
628 | 6217 net:net_dev_xmit | ||
629 | 6217 net:net_dev_queue | ||
630 | 7962 net:netif_receive_skb | ||
631 | 2 net:netif_rx | ||
632 | 8340 napi:napi_poll | ||
633 | 0 sched:sched_kthread_stop | ||
634 | 0 sched:sched_kthread_stop_ret | ||
635 | 3749 sched:sched_wakeup | ||
636 | 0 sched:sched_wakeup_new | ||
637 | 0 sched:sched_switch | ||
638 | 29 sched:sched_migrate_task | ||
639 | 0 sched:sched_process_free | ||
640 | 1 sched:sched_process_exit | ||
641 | 0 sched:sched_wait_task | ||
642 | 0 sched:sched_process_wait | ||
643 | 0 sched:sched_process_fork | ||
644 | 1 sched:sched_process_exec | ||
645 | 0 sched:sched_stat_wait | ||
646 | 2106519415641 sched:sched_stat_sleep | ||
647 | 0 sched:sched_stat_iowait | ||
648 | 147453613 sched:sched_stat_blocked | ||
649 | 12903026955 sched:sched_stat_runtime | ||
650 | 0 sched:sched_pi_setprio | ||
651 | 3574 workqueue:workqueue_queue_work | ||
652 | 3574 workqueue:workqueue_activate_work | ||
653 | 0 workqueue:workqueue_execute_start | ||
654 | 0 workqueue:workqueue_execute_end | ||
655 | 16631 irq:irq_handler_entry | ||
656 | 16631 irq:irq_handler_exit | ||
657 | 28521 irq:softirq_entry | ||
658 | 28521 irq:softirq_exit | ||
659 | 28728 irq:softirq_raise | ||
660 | 1 syscalls:sys_enter_sendmmsg | ||
661 | 1 syscalls:sys_exit_sendmmsg | ||
662 | 0 syscalls:sys_enter_recvmmsg | ||
663 | 0 syscalls:sys_exit_recvmmsg | ||
664 | 14 syscalls:sys_enter_socketcall | ||
665 | 14 syscalls:sys_exit_socketcall | ||
666 | . | ||
667 | . | ||
668 | . | ||
669 | 16965 syscalls:sys_enter_read | ||
670 | 16965 syscalls:sys_exit_read | ||
671 | 12854 syscalls:sys_enter_write | ||
672 | 12854 syscalls:sys_exit_write | ||
673 | . | ||
674 | . | ||
675 | . | ||
676 | |||
677 | 58.029710972 seconds time elapsed | ||
678 | </literallayout> | ||
679 | Let's pick one of these tracepoints and tell perf to do a profile | ||
680 | using it as the sampling event: | ||
681 | <literallayout class='monospaced'> | ||
682 | root@crownbay:~# perf record -g -e sched:sched_wakeup wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink> | ||
683 | </literallayout> | ||
684 | </para> | ||
685 | |||
686 | <para> | ||
687 | <imagedata fileref="figures/sched-wakeup-profile.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
688 | </para> | ||
689 | |||
690 | <para> | ||
691 | The screenshot above shows the results of running a profile using | ||
692 | sched:sched_switch tracepoint, which shows the relative costs of | ||
693 | various paths to sched_wakeup (note that sched_wakeup is the | ||
694 | name of the tracepoint - it's actually defined just inside | ||
695 | ttwu_do_wakeup(), which accounts for the function name actually | ||
696 | displayed in the profile: | ||
697 | <literallayout class='monospaced'> | ||
698 | /* | ||
699 | * Mark the task runnable and perform wakeup-preemption. | ||
700 | */ | ||
701 | static void | ||
702 | ttwu_do_wakeup(struct rq *rq, struct task_struct *p, int wake_flags) | ||
703 | { | ||
704 | trace_sched_wakeup(p, true); | ||
705 | . | ||
706 | . | ||
707 | . | ||
708 | } | ||
709 | </literallayout> | ||
710 | A couple of the more interesting callchains are expanded and | ||
711 | displayed above, basically some network receive paths that | ||
712 | presumably end up waking up wget (busybox) when network data is | ||
713 | ready. | ||
714 | </para> | ||
715 | |||
716 | <para> | ||
717 | Note that because tracepoints are normally used for tracing, | ||
718 | the default sampling period for tracepoints is 1 i.e. for | ||
719 | tracepoints perf will sample on every event occurrence (this | ||
720 | can be changed using the -c option). This is in contrast to | ||
721 | hardware counters such as for example the default 'cycles' | ||
722 | hardware counter used for normal profiling, where sampling | ||
723 | periods are much higher (in the thousands) because profiling should | ||
724 | have as low an overhead as possible and sampling on every cycle | ||
725 | would be prohibitively expensive. | ||
726 | </para> | ||
727 | </section> | ||
728 | |||
729 | <section id='using-perf-to-do-basic-tracing'> | ||
730 | <title>Using perf to do Basic Tracing</title> | ||
731 | |||
732 | <para> | ||
733 | Profiling is a great tool for solving many problems or for | ||
734 | getting a high-level view of what's going on with a workload or | ||
735 | across the system. It is however by definition an approximation, | ||
736 | as suggested by the most prominent word associated with it, | ||
737 | 'sampling'. On the one hand, it allows a representative picture of | ||
738 | what's going on in the system to be cheaply taken, but on the other | ||
739 | hand, that cheapness limits its utility when that data suggests a | ||
740 | need to 'dive down' more deeply to discover what's really going | ||
741 | on. In such cases, the only way to see what's really going on is | ||
742 | to be able to look at (or summarize more intelligently) the | ||
743 | individual steps that go into the higher-level behavior exposed | ||
744 | by the coarse-grained profiling data. | ||
745 | </para> | ||
746 | |||
747 | <para> | ||
748 | As a concrete example, we can trace all the events we think might | ||
749 | be applicable to our workload: | ||
750 | <literallayout class='monospaced'> | ||
751 | root@crownbay:~# perf record -g -e skb:* -e net:* -e napi:* -e sched:sched_switch -e sched:sched_wakeup -e irq:* | ||
752 | -e syscalls:sys_enter_read -e syscalls:sys_exit_read -e syscalls:sys_enter_write -e syscalls:sys_exit_write | ||
753 | wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink> | ||
754 | </literallayout> | ||
755 | We can look at the raw trace output using 'perf script' with no | ||
756 | arguments: | ||
757 | <literallayout class='monospaced'> | ||
758 | root@crownbay:~# perf script | ||
759 | |||
760 | perf 1262 [000] 11624.857082: sys_exit_read: 0x0 | ||
761 | perf 1262 [000] 11624.857193: sched_wakeup: comm=migration/0 pid=6 prio=0 success=1 target_cpu=000 | ||
762 | wget 1262 [001] 11624.858021: softirq_raise: vec=1 [action=TIMER] | ||
763 | wget 1262 [001] 11624.858074: softirq_entry: vec=1 [action=TIMER] | ||
764 | wget 1262 [001] 11624.858081: softirq_exit: vec=1 [action=TIMER] | ||
765 | wget 1262 [001] 11624.858166: sys_enter_read: fd: 0x0003, buf: 0xbf82c940, count: 0x0200 | ||
766 | wget 1262 [001] 11624.858177: sys_exit_read: 0x200 | ||
767 | wget 1262 [001] 11624.858878: kfree_skb: skbaddr=0xeb248d80 protocol=0 location=0xc15a5308 | ||
768 | wget 1262 [001] 11624.858945: kfree_skb: skbaddr=0xeb248000 protocol=0 location=0xc15a5308 | ||
769 | wget 1262 [001] 11624.859020: softirq_raise: vec=1 [action=TIMER] | ||
770 | wget 1262 [001] 11624.859076: softirq_entry: vec=1 [action=TIMER] | ||
771 | wget 1262 [001] 11624.859083: softirq_exit: vec=1 [action=TIMER] | ||
772 | wget 1262 [001] 11624.859167: sys_enter_read: fd: 0x0003, buf: 0xb7720000, count: 0x0400 | ||
773 | wget 1262 [001] 11624.859192: sys_exit_read: 0x1d7 | ||
774 | wget 1262 [001] 11624.859228: sys_enter_read: fd: 0x0003, buf: 0xb7720000, count: 0x0400 | ||
775 | wget 1262 [001] 11624.859233: sys_exit_read: 0x0 | ||
776 | wget 1262 [001] 11624.859573: sys_enter_read: fd: 0x0003, buf: 0xbf82c580, count: 0x0200 | ||
777 | wget 1262 [001] 11624.859584: sys_exit_read: 0x200 | ||
778 | wget 1262 [001] 11624.859864: sys_enter_read: fd: 0x0003, buf: 0xb7720000, count: 0x0400 | ||
779 | wget 1262 [001] 11624.859888: sys_exit_read: 0x400 | ||
780 | wget 1262 [001] 11624.859935: sys_enter_read: fd: 0x0003, buf: 0xb7720000, count: 0x0400 | ||
781 | wget 1262 [001] 11624.859944: sys_exit_read: 0x400 | ||
782 | </literallayout> | ||
783 | This gives us a detailed timestamped sequence of events that | ||
784 | occurred within the workload with respect to those events. | ||
785 | </para> | ||
786 | |||
787 | <para> | ||
788 | In many ways, profiling can be viewed as a subset of tracing - | ||
789 | theoretically, if you have a set of trace events that's sufficient | ||
790 | to capture all the important aspects of a workload, you can derive | ||
791 | any of the results or views that a profiling run can. | ||
792 | </para> | ||
793 | |||
794 | <para> | ||
795 | Another aspect of traditional profiling is that while powerful in | ||
796 | many ways, it's limited by the granularity of the underlying data. | ||
797 | Profiling tools offer various ways of sorting and presenting the | ||
798 | sample data, which make it much more useful and amenable to user | ||
799 | experimentation, but in the end it can't be used in an open-ended | ||
800 | way to extract data that just isn't present as a consequence of | ||
801 | the fact that conceptually, most of it has been thrown away. | ||
802 | </para> | ||
803 | |||
804 | <para> | ||
805 | Full-blown detailed tracing data does however offer the opportunity | ||
806 | to manipulate and present the information collected during a | ||
807 | tracing run in an infinite variety of ways. | ||
808 | </para> | ||
809 | |||
810 | <para> | ||
811 | Another way to look at it is that there are only so many ways that | ||
812 | the 'primitive' counters can be used on their own to generate | ||
813 | interesting output; to get anything more complicated than simple | ||
814 | counts requires some amount of additional logic, which is typically | ||
815 | very specific to the problem at hand. For example, if we wanted to | ||
816 | make use of a 'counter' that maps to the value of the time | ||
817 | difference between when a process was scheduled to run on a | ||
818 | processor and the time it actually ran, we wouldn't expect such | ||
819 | a counter to exist on its own, but we could derive one called say | ||
820 | 'wakeup_latency' and use it to extract a useful view of that metric | ||
821 | from trace data. Likewise, we really can't figure out from standard | ||
822 | profiling tools how much data every process on the system reads and | ||
823 | writes, along with how many of those reads and writes fail | ||
824 | completely. If we have sufficient trace data, however, we could | ||
825 | with the right tools easily extract and present that information, | ||
826 | but we'd need something other than pre-canned profiling tools to | ||
827 | do that. | ||
828 | </para> | ||
829 | |||
830 | <para> | ||
831 | Luckily, there is a general-purpose way to handle such needs, | ||
832 | called 'programming languages'. Making programming languages | ||
833 | easily available to apply to such problems given the specific | ||
834 | format of data is called a 'programming language binding' for | ||
835 | that data and language. Perf supports two programming language | ||
836 | bindings, one for Python and one for Perl. | ||
837 | </para> | ||
838 | |||
839 | <informalexample> | ||
840 | <emphasis>Tying it Together:</emphasis> Language bindings for manipulating and | ||
841 | aggregating trace data are of course not a new | ||
842 | idea. One of the first projects to do this was IBM's DProbes | ||
843 | dpcc compiler, an ANSI C compiler which targeted a low-level | ||
844 | assembly language running on an in-kernel interpreter on the | ||
845 | target system. This is exactly analagous to what Sun's DTrace | ||
846 | did, except that DTrace invented its own language for the purpose. | ||
847 | Systemtap, heavily inspired by DTrace, also created its own | ||
848 | one-off language, but rather than running the product on an | ||
849 | in-kernel interpreter, created an elaborate compiler-based | ||
850 | machinery to translate its language into kernel modules written | ||
851 | in C. | ||
852 | </informalexample> | ||
853 | |||
854 | <para> | ||
855 | Now that we have the trace data in perf.data, we can use | ||
856 | 'perf script -g' to generate a skeleton script with handlers | ||
857 | for the read/write entry/exit events we recorded: | ||
858 | <literallayout class='monospaced'> | ||
859 | root@crownbay:~# perf script -g python | ||
860 | generated Python script: perf-script.py | ||
861 | </literallayout> | ||
862 | The skeleton script simply creates a python function for each | ||
863 | event type in the perf.data file. The body of each function simply | ||
864 | prints the event name along with its parameters. For example: | ||
865 | <literallayout class='monospaced'> | ||
866 | def net__netif_rx(event_name, context, common_cpu, | ||
867 | common_secs, common_nsecs, common_pid, common_comm, | ||
868 | skbaddr, len, name): | ||
869 | print_header(event_name, common_cpu, common_secs, common_nsecs, | ||
870 | common_pid, common_comm) | ||
871 | |||
872 | print "skbaddr=%u, len=%u, name=%s\n" % (skbaddr, len, name), | ||
873 | </literallayout> | ||
874 | We can run that script directly to print all of the events | ||
875 | contained in the perf.data file: | ||
876 | <literallayout class='monospaced'> | ||
877 | root@crownbay:~# perf script -s perf-script.py | ||
878 | |||
879 | in trace_begin | ||
880 | syscalls__sys_exit_read 0 11624.857082795 1262 perf nr=3, ret=0 | ||
881 | sched__sched_wakeup 0 11624.857193498 1262 perf comm=migration/0, pid=6, prio=0, success=1, target_cpu=0 | ||
882 | irq__softirq_raise 1 11624.858021635 1262 wget vec=TIMER | ||
883 | irq__softirq_entry 1 11624.858074075 1262 wget vec=TIMER | ||
884 | irq__softirq_exit 1 11624.858081389 1262 wget vec=TIMER | ||
885 | syscalls__sys_enter_read 1 11624.858166434 1262 wget nr=3, fd=3, buf=3213019456, count=512 | ||
886 | syscalls__sys_exit_read 1 11624.858177924 1262 wget nr=3, ret=512 | ||
887 | skb__kfree_skb 1 11624.858878188 1262 wget skbaddr=3945041280, location=3243922184, protocol=0 | ||
888 | skb__kfree_skb 1 11624.858945608 1262 wget skbaddr=3945037824, location=3243922184, protocol=0 | ||
889 | irq__softirq_raise 1 11624.859020942 1262 wget vec=TIMER | ||
890 | irq__softirq_entry 1 11624.859076935 1262 wget vec=TIMER | ||
891 | irq__softirq_exit 1 11624.859083469 1262 wget vec=TIMER | ||
892 | syscalls__sys_enter_read 1 11624.859167565 1262 wget nr=3, fd=3, buf=3077701632, count=1024 | ||
893 | syscalls__sys_exit_read 1 11624.859192533 1262 wget nr=3, ret=471 | ||
894 | syscalls__sys_enter_read 1 11624.859228072 1262 wget nr=3, fd=3, buf=3077701632, count=1024 | ||
895 | syscalls__sys_exit_read 1 11624.859233707 1262 wget nr=3, ret=0 | ||
896 | syscalls__sys_enter_read 1 11624.859573008 1262 wget nr=3, fd=3, buf=3213018496, count=512 | ||
897 | syscalls__sys_exit_read 1 11624.859584818 1262 wget nr=3, ret=512 | ||
898 | syscalls__sys_enter_read 1 11624.859864562 1262 wget nr=3, fd=3, buf=3077701632, count=1024 | ||
899 | syscalls__sys_exit_read 1 11624.859888770 1262 wget nr=3, ret=1024 | ||
900 | syscalls__sys_enter_read 1 11624.859935140 1262 wget nr=3, fd=3, buf=3077701632, count=1024 | ||
901 | syscalls__sys_exit_read 1 11624.859944032 1262 wget nr=3, ret=1024 | ||
902 | </literallayout> | ||
903 | That in itself isn't very useful; after all, we can accomplish | ||
904 | pretty much the same thing by simply running 'perf script' | ||
905 | without arguments in the same directory as the perf.data file. | ||
906 | </para> | ||
907 | |||
908 | <para> | ||
909 | We can however replace the print statements in the generated | ||
910 | function bodies with whatever we want, and thereby make it | ||
911 | infinitely more useful. | ||
912 | </para> | ||
913 | |||
914 | <para> | ||
915 | As a simple example, let's just replace the print statements in | ||
916 | the function bodies with a simple function that does nothing but | ||
917 | increment a per-event count. When the program is run against a | ||
918 | perf.data file, each time a particular event is encountered, | ||
919 | a tally is incremented for that event. For example: | ||
920 | <literallayout class='monospaced'> | ||
921 | def net__netif_rx(event_name, context, common_cpu, | ||
922 | common_secs, common_nsecs, common_pid, common_comm, | ||
923 | skbaddr, len, name): | ||
924 | inc_counts(event_name) | ||
925 | </literallayout> | ||
926 | Each event handler function in the generated code is modified | ||
927 | to do this. For convenience, we define a common function called | ||
928 | inc_counts() that each handler calls; inc_counts() simply tallies | ||
929 | a count for each event using the 'counts' hash, which is a | ||
930 | specialized hash function that does Perl-like autovivification, a | ||
931 | capability that's extremely useful for kinds of multi-level | ||
932 | aggregation commonly used in processing traces (see perf's | ||
933 | documentation on the Python language binding for details): | ||
934 | <literallayout class='monospaced'> | ||
935 | counts = autodict() | ||
936 | |||
937 | def inc_counts(event_name): | ||
938 | try: | ||
939 | counts[event_name] += 1 | ||
940 | except TypeError: | ||
941 | counts[event_name] = 1 | ||
942 | </literallayout> | ||
943 | Finally, at the end of the trace processing run, we want to | ||
944 | print the result of all the per-event tallies. For that, we | ||
945 | use the special 'trace_end()' function: | ||
946 | <literallayout class='monospaced'> | ||
947 | def trace_end(): | ||
948 | for event_name, count in counts.iteritems(): | ||
949 | print "%-40s %10s\n" % (event_name, count) | ||
950 | </literallayout> | ||
951 | The end result is a summary of all the events recorded in the | ||
952 | trace: | ||
953 | <literallayout class='monospaced'> | ||
954 | skb__skb_copy_datagram_iovec 13148 | ||
955 | irq__softirq_entry 4796 | ||
956 | irq__irq_handler_exit 3805 | ||
957 | irq__softirq_exit 4795 | ||
958 | syscalls__sys_enter_write 8990 | ||
959 | net__net_dev_xmit 652 | ||
960 | skb__kfree_skb 4047 | ||
961 | sched__sched_wakeup 1155 | ||
962 | irq__irq_handler_entry 3804 | ||
963 | irq__softirq_raise 4799 | ||
964 | net__net_dev_queue 652 | ||
965 | syscalls__sys_enter_read 17599 | ||
966 | net__netif_receive_skb 1743 | ||
967 | syscalls__sys_exit_read 17598 | ||
968 | net__netif_rx 2 | ||
969 | napi__napi_poll 1877 | ||
970 | syscalls__sys_exit_write 8990 | ||
971 | </literallayout> | ||
972 | Note that this is pretty much exactly the same information we get | ||
973 | from 'perf stat', which goes a little way to support the idea | ||
974 | mentioned previously that given the right kind of trace data, | ||
975 | higher-level profiling-type summaries can be derived from it. | ||
976 | </para> | ||
977 | |||
978 | <para> | ||
979 | Documentation on using the | ||
980 | <ulink url='http://linux.die.net/man/1/perf-script-python'>'perf script' python binding</ulink>. | ||
981 | </para> | ||
982 | </section> | ||
983 | |||
984 | <section id='system-wide-tracing-and-profiling'> | ||
985 | <title>System-Wide Tracing and Profiling</title> | ||
986 | |||
987 | <para> | ||
988 | The examples so far have focused on tracing a particular program or | ||
989 | workload - in other words, every profiling run has specified the | ||
990 | program to profile in the command-line e.g. 'perf record wget ...'. | ||
991 | </para> | ||
992 | |||
993 | <para> | ||
994 | It's also possible, and more interesting in many cases, to run a | ||
995 | system-wide profile or trace while running the workload in a | ||
996 | separate shell. | ||
997 | </para> | ||
998 | |||
999 | <para> | ||
1000 | To do system-wide profiling or tracing, you typically use | ||
1001 | the -a flag to 'perf record'. | ||
1002 | </para> | ||
1003 | |||
1004 | <para> | ||
1005 | To demonstrate this, open up one window and start the profile | ||
1006 | using the -a flag (press Ctrl-C to stop tracing): | ||
1007 | <literallayout class='monospaced'> | ||
1008 | root@crownbay:~# perf record -g -a | ||
1009 | ^C[ perf record: Woken up 6 times to write data ] | ||
1010 | [ perf record: Captured and wrote 1.400 MB perf.data (~61172 samples) ] | ||
1011 | </literallayout> | ||
1012 | In another window, run the wget test: | ||
1013 | <literallayout class='monospaced'> | ||
1014 | root@crownbay:~# wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink> | ||
1015 | Connecting to downloads.yoctoproject.org (140.211.169.59:80) | ||
1016 | linux-2.6.19.2.tar.b 100% |*******************************| 41727k 0:00:00 ETA | ||
1017 | </literallayout> | ||
1018 | Here we see entries not only for our wget load, but for other | ||
1019 | processes running on the system as well: | ||
1020 | </para> | ||
1021 | |||
1022 | <para> | ||
1023 | <imagedata fileref="figures/perf-systemwide.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
1024 | </para> | ||
1025 | |||
1026 | <para> | ||
1027 | In the snapshot above, we can see callchains that originate in | ||
1028 | libc, and a callchain from Xorg that demonstrates that we're | ||
1029 | using a proprietary X driver in userspace (notice the presence | ||
1030 | of 'PVR' and some other unresolvable symbols in the expanded | ||
1031 | Xorg callchain). | ||
1032 | </para> | ||
1033 | |||
1034 | <para> | ||
1035 | Note also that we have both kernel and userspace entries in the | ||
1036 | above snapshot. We can also tell perf to focus on userspace but | ||
1037 | providing a modifier, in this case 'u', to the 'cycles' hardware | ||
1038 | counter when we record a profile: | ||
1039 | <literallayout class='monospaced'> | ||
1040 | root@crownbay:~# perf record -g -a -e cycles:u | ||
1041 | ^C[ perf record: Woken up 2 times to write data ] | ||
1042 | [ perf record: Captured and wrote 0.376 MB perf.data (~16443 samples) ] | ||
1043 | </literallayout> | ||
1044 | </para> | ||
1045 | |||
1046 | <para> | ||
1047 | <imagedata fileref="figures/perf-report-cycles-u.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
1048 | </para> | ||
1049 | |||
1050 | <para> | ||
1051 | Notice in the screenshot above, we see only userspace entries ([.]) | ||
1052 | </para> | ||
1053 | |||
1054 | <para> | ||
1055 | Finally, we can press 'enter' on a leaf node and select the 'Zoom | ||
1056 | into DSO' menu item to show only entries associated with a | ||
1057 | specific DSO. In the screenshot below, we've zoomed into the | ||
1058 | 'libc' DSO which shows all the entries associated with the | ||
1059 | libc-xxx.so DSO. | ||
1060 | </para> | ||
1061 | |||
1062 | <para> | ||
1063 | <imagedata fileref="figures/perf-systemwide-libc.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
1064 | </para> | ||
1065 | |||
1066 | <para> | ||
1067 | We can also use the system-wide -a switch to do system-wide | ||
1068 | tracing. Here we'll trace a couple of scheduler events: | ||
1069 | <literallayout class='monospaced'> | ||
1070 | root@crownbay:~# perf record -a -e sched:sched_switch -e sched:sched_wakeup | ||
1071 | ^C[ perf record: Woken up 38 times to write data ] | ||
1072 | [ perf record: Captured and wrote 9.780 MB perf.data (~427299 samples) ] | ||
1073 | </literallayout> | ||
1074 | We can look at the raw output using 'perf script' with no | ||
1075 | arguments: | ||
1076 | <literallayout class='monospaced'> | ||
1077 | root@crownbay:~# perf script | ||
1078 | |||
1079 | perf 1383 [001] 6171.460045: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001 | ||
1080 | perf 1383 [001] 6171.460066: sched_switch: prev_comm=perf prev_pid=1383 prev_prio=120 prev_state=R+ ==> next_comm=kworker/1:1 next_pid=21 next_prio=120 | ||
1081 | kworker/1:1 21 [001] 6171.460093: sched_switch: prev_comm=kworker/1:1 prev_pid=21 prev_prio=120 prev_state=S ==> next_comm=perf next_pid=1383 next_prio=120 | ||
1082 | swapper 0 [000] 6171.468063: sched_wakeup: comm=kworker/0:3 pid=1209 prio=120 success=1 target_cpu=000 | ||
1083 | swapper 0 [000] 6171.468107: sched_switch: prev_comm=swapper/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=kworker/0:3 next_pid=1209 next_prio=120 | ||
1084 | kworker/0:3 1209 [000] 6171.468143: sched_switch: prev_comm=kworker/0:3 prev_pid=1209 prev_prio=120 prev_state=S ==> next_comm=swapper/0 next_pid=0 next_prio=120 | ||
1085 | perf 1383 [001] 6171.470039: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001 | ||
1086 | perf 1383 [001] 6171.470058: sched_switch: prev_comm=perf prev_pid=1383 prev_prio=120 prev_state=R+ ==> next_comm=kworker/1:1 next_pid=21 next_prio=120 | ||
1087 | kworker/1:1 21 [001] 6171.470082: sched_switch: prev_comm=kworker/1:1 prev_pid=21 prev_prio=120 prev_state=S ==> next_comm=perf next_pid=1383 next_prio=120 | ||
1088 | perf 1383 [001] 6171.480035: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001 | ||
1089 | </literallayout> | ||
1090 | </para> | ||
1091 | |||
1092 | <section id='perf-filtering'> | ||
1093 | <title>Filtering</title> | ||
1094 | |||
1095 | <para> | ||
1096 | Notice that there are a lot of events that don't really have | ||
1097 | anything to do with what we're interested in, namely events | ||
1098 | that schedule 'perf' itself in and out or that wake perf up. | ||
1099 | We can get rid of those by using the '--filter' option - | ||
1100 | for each event we specify using -e, we can add a --filter | ||
1101 | after that to filter out trace events that contain fields | ||
1102 | with specific values: | ||
1103 | <literallayout class='monospaced'> | ||
1104 | root@crownbay:~# perf record -a -e sched:sched_switch --filter 'next_comm != perf && prev_comm != perf' -e sched:sched_wakeup --filter 'comm != perf' | ||
1105 | ^C[ perf record: Woken up 38 times to write data ] | ||
1106 | [ perf record: Captured and wrote 9.688 MB perf.data (~423279 samples) ] | ||
1107 | |||
1108 | |||
1109 | root@crownbay:~# perf script | ||
1110 | |||
1111 | swapper 0 [000] 7932.162180: sched_switch: prev_comm=swapper/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=kworker/0:3 next_pid=1209 next_prio=120 | ||
1112 | kworker/0:3 1209 [000] 7932.162236: sched_switch: prev_comm=kworker/0:3 prev_pid=1209 prev_prio=120 prev_state=S ==> next_comm=swapper/0 next_pid=0 next_prio=120 | ||
1113 | perf 1407 [001] 7932.170048: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001 | ||
1114 | perf 1407 [001] 7932.180044: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001 | ||
1115 | perf 1407 [001] 7932.190038: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001 | ||
1116 | perf 1407 [001] 7932.200044: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001 | ||
1117 | perf 1407 [001] 7932.210044: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001 | ||
1118 | perf 1407 [001] 7932.220044: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001 | ||
1119 | swapper 0 [001] 7932.230111: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001 | ||
1120 | swapper 0 [001] 7932.230146: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=kworker/1:1 next_pid=21 next_prio=120 | ||
1121 | kworker/1:1 21 [001] 7932.230205: sched_switch: prev_comm=kworker/1:1 prev_pid=21 prev_prio=120 prev_state=S ==> next_comm=swapper/1 next_pid=0 next_prio=120 | ||
1122 | swapper 0 [000] 7932.326109: sched_wakeup: comm=kworker/0:3 pid=1209 prio=120 success=1 target_cpu=000 | ||
1123 | swapper 0 [000] 7932.326171: sched_switch: prev_comm=swapper/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=kworker/0:3 next_pid=1209 next_prio=120 | ||
1124 | kworker/0:3 1209 [000] 7932.326214: sched_switch: prev_comm=kworker/0:3 prev_pid=1209 prev_prio=120 prev_state=S ==> next_comm=swapper/0 next_pid=0 next_prio=120 | ||
1125 | </literallayout> | ||
1126 | In this case, we've filtered out all events that have 'perf' | ||
1127 | in their 'comm' or 'comm_prev' or 'comm_next' fields. Notice | ||
1128 | that there are still events recorded for perf, but notice | ||
1129 | that those events don't have values of 'perf' for the filtered | ||
1130 | fields. To completely filter out anything from perf will | ||
1131 | require a bit more work, but for the purpose of demonstrating | ||
1132 | how to use filters, it's close enough. | ||
1133 | </para> | ||
1134 | |||
1135 | <informalexample> | ||
1136 | <emphasis>Tying it Together:</emphasis> These are exactly the same set of event | ||
1137 | filters defined by the trace event subsystem. See the | ||
1138 | ftrace/tracecmd/kernelshark section for more discussion about | ||
1139 | these event filters. | ||
1140 | </informalexample> | ||
1141 | |||
1142 | <informalexample> | ||
1143 | <emphasis>Tying it Together:</emphasis> These event filters are implemented by a | ||
1144 | special-purpose pseudo-interpreter in the kernel and are an | ||
1145 | integral and indispensable part of the perf design as it | ||
1146 | relates to tracing. kernel-based event filters provide a | ||
1147 | mechanism to precisely throttle the event stream that appears | ||
1148 | in user space, where it makes sense to provide bindings to real | ||
1149 | programming languages for postprocessing the event stream. | ||
1150 | This architecture allows for the intelligent and flexible | ||
1151 | partitioning of processing between the kernel and user space. | ||
1152 | Contrast this with other tools such as SystemTap, which does | ||
1153 | all of its processing in the kernel and as such requires a | ||
1154 | special project-defined language in order to accommodate that | ||
1155 | design, or LTTng, where everything is sent to userspace and | ||
1156 | as such requires a super-efficient kernel-to-userspace | ||
1157 | transport mechanism in order to function properly. While | ||
1158 | perf certainly can benefit from for instance advances in | ||
1159 | the design of the transport, it doesn't fundamentally depend | ||
1160 | on them. Basically, if you find that your perf tracing | ||
1161 | application is causing buffer I/O overruns, it probably | ||
1162 | means that you aren't taking enough advantage of the | ||
1163 | kernel filtering engine. | ||
1164 | </informalexample> | ||
1165 | </section> | ||
1166 | </section> | ||
1167 | |||
1168 | <section id='using-dynamic-tracepoints'> | ||
1169 | <title>Using Dynamic Tracepoints</title> | ||
1170 | |||
1171 | <para> | ||
1172 | perf isn't restricted to the fixed set of static tracepoints | ||
1173 | listed by 'perf list'. Users can also add their own 'dynamic' | ||
1174 | tracepoints anywhere in the kernel. For instance, suppose we | ||
1175 | want to define our own tracepoint on do_fork(). We can do that | ||
1176 | using the 'perf probe' perf subcommand: | ||
1177 | <literallayout class='monospaced'> | ||
1178 | root@crownbay:~# perf probe do_fork | ||
1179 | Added new event: | ||
1180 | probe:do_fork (on do_fork) | ||
1181 | |||
1182 | You can now use it in all perf tools, such as: | ||
1183 | |||
1184 | perf record -e probe:do_fork -aR sleep 1 | ||
1185 | </literallayout> | ||
1186 | Adding a new tracepoint via 'perf probe' results in an event | ||
1187 | with all the expected files and format in | ||
1188 | /sys/kernel/debug/tracing/events, just the same as for static | ||
1189 | tracepoints (as discussed in more detail in the trace events | ||
1190 | subsystem section: | ||
1191 | <literallayout class='monospaced'> | ||
1192 | root@crownbay:/sys/kernel/debug/tracing/events/probe/do_fork# ls -al | ||
1193 | drwxr-xr-x 2 root root 0 Oct 28 11:42 . | ||
1194 | drwxr-xr-x 3 root root 0 Oct 28 11:42 .. | ||
1195 | -rw-r--r-- 1 root root 0 Oct 28 11:42 enable | ||
1196 | -rw-r--r-- 1 root root 0 Oct 28 11:42 filter | ||
1197 | -r--r--r-- 1 root root 0 Oct 28 11:42 format | ||
1198 | -r--r--r-- 1 root root 0 Oct 28 11:42 id | ||
1199 | |||
1200 | root@crownbay:/sys/kernel/debug/tracing/events/probe/do_fork# cat format | ||
1201 | name: do_fork | ||
1202 | ID: 944 | ||
1203 | format: | ||
1204 | field:unsigned short common_type; offset:0; size:2; signed:0; | ||
1205 | field:unsigned char common_flags; offset:2; size:1; signed:0; | ||
1206 | field:unsigned char common_preempt_count; offset:3; size:1; signed:0; | ||
1207 | field:int common_pid; offset:4; size:4; signed:1; | ||
1208 | field:int common_padding; offset:8; size:4; signed:1; | ||
1209 | |||
1210 | field:unsigned long __probe_ip; offset:12; size:4; signed:0; | ||
1211 | |||
1212 | print fmt: "(%lx)", REC->__probe_ip | ||
1213 | </literallayout> | ||
1214 | We can list all dynamic tracepoints currently in existence: | ||
1215 | <literallayout class='monospaced'> | ||
1216 | root@crownbay:~# perf probe -l | ||
1217 | probe:do_fork (on do_fork) | ||
1218 | probe:schedule (on schedule) | ||
1219 | </literallayout> | ||
1220 | Let's record system-wide ('sleep 30' is a trick for recording | ||
1221 | system-wide but basically do nothing and then wake up after | ||
1222 | 30 seconds): | ||
1223 | <literallayout class='monospaced'> | ||
1224 | root@crownbay:~# perf record -g -a -e probe:do_fork sleep 30 | ||
1225 | [ perf record: Woken up 1 times to write data ] | ||
1226 | [ perf record: Captured and wrote 0.087 MB perf.data (~3812 samples) ] | ||
1227 | </literallayout> | ||
1228 | Using 'perf script' we can see each do_fork event that fired: | ||
1229 | <literallayout class='monospaced'> | ||
1230 | root@crownbay:~# perf script | ||
1231 | |||
1232 | # ======== | ||
1233 | # captured on: Sun Oct 28 11:55:18 2012 | ||
1234 | # hostname : crownbay | ||
1235 | # os release : 3.4.11-yocto-standard | ||
1236 | # perf version : 3.4.11 | ||
1237 | # arch : i686 | ||
1238 | # nrcpus online : 2 | ||
1239 | # nrcpus avail : 2 | ||
1240 | # cpudesc : Intel(R) Atom(TM) CPU E660 @ 1.30GHz | ||
1241 | # cpuid : GenuineIntel,6,38,1 | ||
1242 | # total memory : 1017184 kB | ||
1243 | # cmdline : /usr/bin/perf record -g -a -e probe:do_fork sleep 30 | ||
1244 | # event : name = probe:do_fork, type = 2, config = 0x3b0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern | ||
1245 | = 0, id = { 5, 6 } | ||
1246 | # HEADER_CPU_TOPOLOGY info available, use -I to display | ||
1247 | # ======== | ||
1248 | # | ||
1249 | matchbox-deskto 1197 [001] 34211.378318: do_fork: (c1028460) | ||
1250 | matchbox-deskto 1295 [001] 34211.380388: do_fork: (c1028460) | ||
1251 | pcmanfm 1296 [000] 34211.632350: do_fork: (c1028460) | ||
1252 | pcmanfm 1296 [000] 34211.639917: do_fork: (c1028460) | ||
1253 | matchbox-deskto 1197 [001] 34217.541603: do_fork: (c1028460) | ||
1254 | matchbox-deskto 1299 [001] 34217.543584: do_fork: (c1028460) | ||
1255 | gthumb 1300 [001] 34217.697451: do_fork: (c1028460) | ||
1256 | gthumb 1300 [001] 34219.085734: do_fork: (c1028460) | ||
1257 | gthumb 1300 [000] 34219.121351: do_fork: (c1028460) | ||
1258 | gthumb 1300 [001] 34219.264551: do_fork: (c1028460) | ||
1259 | pcmanfm 1296 [000] 34219.590380: do_fork: (c1028460) | ||
1260 | matchbox-deskto 1197 [001] 34224.955965: do_fork: (c1028460) | ||
1261 | matchbox-deskto 1306 [001] 34224.957972: do_fork: (c1028460) | ||
1262 | matchbox-termin 1307 [000] 34225.038214: do_fork: (c1028460) | ||
1263 | matchbox-termin 1307 [001] 34225.044218: do_fork: (c1028460) | ||
1264 | matchbox-termin 1307 [000] 34225.046442: do_fork: (c1028460) | ||
1265 | matchbox-deskto 1197 [001] 34237.112138: do_fork: (c1028460) | ||
1266 | matchbox-deskto 1311 [001] 34237.114106: do_fork: (c1028460) | ||
1267 | gaku 1312 [000] 34237.202388: do_fork: (c1028460) | ||
1268 | </literallayout> | ||
1269 | And using 'perf report' on the same file, we can see the | ||
1270 | callgraphs from starting a few programs during those 30 seconds: | ||
1271 | </para> | ||
1272 | |||
1273 | <para> | ||
1274 | <imagedata fileref="figures/perf-probe-do_fork-profile.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
1275 | </para> | ||
1276 | |||
1277 | <informalexample> | ||
1278 | <emphasis>Tying it Together:</emphasis> The trace events subsystem accomodate static | ||
1279 | and dynamic tracepoints in exactly the same way - there's no | ||
1280 | difference as far as the infrastructure is concerned. See the | ||
1281 | ftrace section for more details on the trace event subsystem. | ||
1282 | </informalexample> | ||
1283 | |||
1284 | <informalexample> | ||
1285 | <emphasis>Tying it Together:</emphasis> Dynamic tracepoints are implemented under the | ||
1286 | covers by kprobes and uprobes. kprobes and uprobes are also used | ||
1287 | by and in fact are the main focus of SystemTap. | ||
1288 | </informalexample> | ||
1289 | </section> | ||
1290 | </section> | ||
1291 | |||
1292 | <section id='perf-documentation'> | ||
1293 | <title>Documentation</title> | ||
1294 | |||
1295 | <para> | ||
1296 | Online versions of the man pages for the commands discussed in this | ||
1297 | section can be found here: | ||
1298 | <itemizedlist> | ||
1299 | <listitem><para>The <ulink url='http://linux.die.net/man/1/perf-stat'>'perf stat' manpage</ulink>. | ||
1300 | </para></listitem> | ||
1301 | <listitem><para>The <ulink url='http://linux.die.net/man/1/perf-record'>'perf record' manpage</ulink>. | ||
1302 | </para></listitem> | ||
1303 | <listitem><para>The <ulink url='http://linux.die.net/man/1/perf-report'>'perf report' manpage</ulink>. | ||
1304 | </para></listitem> | ||
1305 | <listitem><para>The <ulink url='http://linux.die.net/man/1/perf-probe'>'perf probe' manpage</ulink>. | ||
1306 | </para></listitem> | ||
1307 | <listitem><para>The <ulink url='http://linux.die.net/man/1/perf-script'>'perf script' manpage</ulink>. | ||
1308 | </para></listitem> | ||
1309 | <listitem><para>Documentation on using the | ||
1310 | <ulink url='http://linux.die.net/man/1/perf-script-python'>'perf script' python binding</ulink>. | ||
1311 | </para></listitem> | ||
1312 | <listitem><para>The top-level | ||
1313 | <ulink url='http://linux.die.net/man/1/perf'>perf(1) manpage</ulink>. | ||
1314 | </para></listitem> | ||
1315 | </itemizedlist> | ||
1316 | </para> | ||
1317 | |||
1318 | <para> | ||
1319 | Normally, you should be able to invoke the man pages via perf | ||
1320 | itself e.g. 'perf help' or 'perf help record'. | ||
1321 | </para> | ||
1322 | |||
1323 | <para> | ||
1324 | However, by default Yocto doesn't install man pages, but perf | ||
1325 | invokes the man pages for most help functionality. This is a bug | ||
1326 | and is being addressed by a Yocto bug: | ||
1327 | <ulink url='https://bugzilla.yoctoproject.org/show_bug.cgi?id=3388'>Bug 3388 - perf: enable man pages for basic 'help' functionality</ulink>. | ||
1328 | </para> | ||
1329 | |||
1330 | <para> | ||
1331 | The man pages in text form, along with some other files, such as | ||
1332 | a set of examples, can be found in the 'perf' directory of the | ||
1333 | kernel tree: | ||
1334 | <literallayout class='monospaced'> | ||
1335 | tools/perf/Documentation | ||
1336 | </literallayout> | ||
1337 | There's also a nice perf tutorial on the perf wiki that goes | ||
1338 | into more detail than we do here in certain areas: | ||
1339 | <ulink url='https://perf.wiki.kernel.org/index.php/Tutorial'>Perf Tutorial</ulink> | ||
1340 | </para> | ||
1341 | </section> | ||
1342 | </section> | ||
1343 | |||
1344 | <section id='profile-manual-ftrace'> | ||
1345 | <title>ftrace</title> | ||
1346 | |||
1347 | <para> | ||
1348 | 'ftrace' literally refers to the 'ftrace function tracer' but in | ||
1349 | reality this encompasses a number of related tracers along with | ||
1350 | the infrastructure that they all make use of. | ||
1351 | </para> | ||
1352 | |||
1353 | <section id='ftrace-setup'> | ||
1354 | <title>Setup</title> | ||
1355 | |||
1356 | <para> | ||
1357 | For this section, we'll assume you've already performed the basic | ||
1358 | setup outlined in the General Setup section. | ||
1359 | </para> | ||
1360 | |||
1361 | <para> | ||
1362 | ftrace, trace-cmd, and kernelshark run on the target system, | ||
1363 | and are ready to go out-of-the-box - no additional setup is | ||
1364 | necessary. For the rest of this section we assume you've ssh'ed | ||
1365 | to the host and will be running ftrace on the target. kernelshark | ||
1366 | is a GUI application and if you use the '-X' option to ssh you | ||
1367 | can have the kernelshark GUI run on the target but display | ||
1368 | remotely on the host if you want. | ||
1369 | </para> | ||
1370 | </section> | ||
1371 | |||
1372 | <section id='basic-ftrace-usage'> | ||
1373 | <title>Basic ftrace usage</title> | ||
1374 | |||
1375 | <para> | ||
1376 | 'ftrace' essentially refers to everything included in | ||
1377 | the /tracing directory of the mounted debugfs filesystem | ||
1378 | (Yocto follows the standard convention and mounts it | ||
1379 | at /sys/kernel/debug). Here's a listing of all the files | ||
1380 | found in /sys/kernel/debug/tracing on a Yocto system: | ||
1381 | <literallayout class='monospaced'> | ||
1382 | root@sugarbay:/sys/kernel/debug/tracing# ls | ||
1383 | README kprobe_events trace | ||
1384 | available_events kprobe_profile trace_clock | ||
1385 | available_filter_functions options trace_marker | ||
1386 | available_tracers per_cpu trace_options | ||
1387 | buffer_size_kb printk_formats trace_pipe | ||
1388 | buffer_total_size_kb saved_cmdlines tracing_cpumask | ||
1389 | current_tracer set_event tracing_enabled | ||
1390 | dyn_ftrace_total_info set_ftrace_filter tracing_on | ||
1391 | enabled_functions set_ftrace_notrace tracing_thresh | ||
1392 | events set_ftrace_pid | ||
1393 | free_buffer set_graph_function | ||
1394 | </literallayout> | ||
1395 | The files listed above are used for various purposes - | ||
1396 | some relate directly to the tracers themselves, others are | ||
1397 | used to set tracing options, and yet others actually contain | ||
1398 | the tracing output when a tracer is in effect. Some of the | ||
1399 | functions can be guessed from their names, others need | ||
1400 | explanation; in any case, we'll cover some of the files we | ||
1401 | see here below but for an explanation of the others, please | ||
1402 | see the ftrace documentation. | ||
1403 | </para> | ||
1404 | |||
1405 | <para> | ||
1406 | We'll start by looking at some of the available built-in | ||
1407 | tracers. | ||
1408 | </para> | ||
1409 | |||
1410 | <para> | ||
1411 | cat'ing the 'available_tracers' file lists the set of | ||
1412 | available tracers: | ||
1413 | <literallayout class='monospaced'> | ||
1414 | root@sugarbay:/sys/kernel/debug/tracing# cat available_tracers | ||
1415 | blk function_graph function nop | ||
1416 | </literallayout> | ||
1417 | The 'current_tracer' file contains the tracer currently in | ||
1418 | effect: | ||
1419 | <literallayout class='monospaced'> | ||
1420 | root@sugarbay:/sys/kernel/debug/tracing# cat current_tracer | ||
1421 | nop | ||
1422 | </literallayout> | ||
1423 | The above listing of current_tracer shows that | ||
1424 | the 'nop' tracer is in effect, which is just another | ||
1425 | way of saying that there's actually no tracer | ||
1426 | currently in effect. | ||
1427 | </para> | ||
1428 | |||
1429 | <para> | ||
1430 | echo'ing one of the available_tracers into current_tracer | ||
1431 | makes the specified tracer the current tracer: | ||
1432 | <literallayout class='monospaced'> | ||
1433 | root@sugarbay:/sys/kernel/debug/tracing# echo function > current_tracer | ||
1434 | root@sugarbay:/sys/kernel/debug/tracing# cat current_tracer | ||
1435 | function | ||
1436 | </literallayout> | ||
1437 | The above sets the current tracer to be the | ||
1438 | 'function tracer'. This tracer traces every function | ||
1439 | call in the kernel and makes it available as the | ||
1440 | contents of the 'trace' file. Reading the 'trace' file | ||
1441 | lists the currently buffered function calls that have been | ||
1442 | traced by the function tracer: | ||
1443 | <literallayout class='monospaced'> | ||
1444 | root@sugarbay:/sys/kernel/debug/tracing# cat trace | less | ||
1445 | |||
1446 | # tracer: function | ||
1447 | # | ||
1448 | # entries-in-buffer/entries-written: 310629/766471 #P:8 | ||
1449 | # | ||
1450 | # _-----=> irqs-off | ||
1451 | # / _----=> need-resched | ||
1452 | # | / _---=> hardirq/softirq | ||
1453 | # || / _--=> preempt-depth | ||
1454 | # ||| / delay | ||
1455 | # TASK-PID CPU# |||| TIMESTAMP FUNCTION | ||
1456 | # | | | |||| | | | ||
1457 | <idle>-0 [004] d..1 470.867169: ktime_get_real <-intel_idle | ||
1458 | <idle>-0 [004] d..1 470.867170: getnstimeofday <-ktime_get_real | ||
1459 | <idle>-0 [004] d..1 470.867171: ns_to_timeval <-intel_idle | ||
1460 | <idle>-0 [004] d..1 470.867171: ns_to_timespec <-ns_to_timeval | ||
1461 | <idle>-0 [004] d..1 470.867172: smp_apic_timer_interrupt <-apic_timer_interrupt | ||
1462 | <idle>-0 [004] d..1 470.867172: native_apic_mem_write <-smp_apic_timer_interrupt | ||
1463 | <idle>-0 [004] d..1 470.867172: irq_enter <-smp_apic_timer_interrupt | ||
1464 | <idle>-0 [004] d..1 470.867172: rcu_irq_enter <-irq_enter | ||
1465 | <idle>-0 [004] d..1 470.867173: rcu_idle_exit_common.isra.33 <-rcu_irq_enter | ||
1466 | <idle>-0 [004] d..1 470.867173: local_bh_disable <-irq_enter | ||
1467 | <idle>-0 [004] d..1 470.867173: add_preempt_count <-local_bh_disable | ||
1468 | <idle>-0 [004] d.s1 470.867174: tick_check_idle <-irq_enter | ||
1469 | <idle>-0 [004] d.s1 470.867174: tick_check_oneshot_broadcast <-tick_check_idle | ||
1470 | <idle>-0 [004] d.s1 470.867174: ktime_get <-tick_check_idle | ||
1471 | <idle>-0 [004] d.s1 470.867174: tick_nohz_stop_idle <-tick_check_idle | ||
1472 | <idle>-0 [004] d.s1 470.867175: update_ts_time_stats <-tick_nohz_stop_idle | ||
1473 | <idle>-0 [004] d.s1 470.867175: nr_iowait_cpu <-update_ts_time_stats | ||
1474 | <idle>-0 [004] d.s1 470.867175: tick_do_update_jiffies64 <-tick_check_idle | ||
1475 | <idle>-0 [004] d.s1 470.867175: _raw_spin_lock <-tick_do_update_jiffies64 | ||
1476 | <idle>-0 [004] d.s1 470.867176: add_preempt_count <-_raw_spin_lock | ||
1477 | <idle>-0 [004] d.s2 470.867176: do_timer <-tick_do_update_jiffies64 | ||
1478 | <idle>-0 [004] d.s2 470.867176: _raw_spin_lock <-do_timer | ||
1479 | <idle>-0 [004] d.s2 470.867176: add_preempt_count <-_raw_spin_lock | ||
1480 | <idle>-0 [004] d.s3 470.867177: ntp_tick_length <-do_timer | ||
1481 | <idle>-0 [004] d.s3 470.867177: _raw_spin_lock_irqsave <-ntp_tick_length | ||
1482 | . | ||
1483 | . | ||
1484 | . | ||
1485 | </literallayout> | ||
1486 | Each line in the trace above shows what was happening in | ||
1487 | the kernel on a given cpu, to the level of detail of | ||
1488 | function calls. Each entry shows the function called, | ||
1489 | followed by its caller (after the arrow). | ||
1490 | </para> | ||
1491 | |||
1492 | <para> | ||
1493 | The function tracer gives you an extremely detailed idea | ||
1494 | of what the kernel was doing at the point in time the trace | ||
1495 | was taken, and is a great way to learn about how the kernel | ||
1496 | code works in a dynamic sense. | ||
1497 | </para> | ||
1498 | |||
1499 | <informalexample> | ||
1500 | <emphasis>Tying it Together:</emphasis> The ftrace function tracer is also | ||
1501 | available from within perf, as the ftrace:function tracepoint. | ||
1502 | </informalexample> | ||
1503 | |||
1504 | <para> | ||
1505 | It is a little more difficult to follow the call chains than | ||
1506 | it needs to be - luckily there's a variant of the function | ||
1507 | tracer that displays the callchains explicitly, called the | ||
1508 | 'function_graph' tracer: | ||
1509 | <literallayout class='monospaced'> | ||
1510 | root@sugarbay:/sys/kernel/debug/tracing# echo function_graph > current_tracer | ||
1511 | root@sugarbay:/sys/kernel/debug/tracing# cat trace | less | ||
1512 | |||
1513 | tracer: function_graph | ||
1514 | |||
1515 | CPU DURATION FUNCTION CALLS | ||
1516 | | | | | | | | | ||
1517 | 7) 0.046 us | pick_next_task_fair(); | ||
1518 | 7) 0.043 us | pick_next_task_stop(); | ||
1519 | 7) 0.042 us | pick_next_task_rt(); | ||
1520 | 7) 0.032 us | pick_next_task_fair(); | ||
1521 | 7) 0.030 us | pick_next_task_idle(); | ||
1522 | 7) | _raw_spin_unlock_irq() { | ||
1523 | 7) 0.033 us | sub_preempt_count(); | ||
1524 | 7) 0.258 us | } | ||
1525 | 7) 0.032 us | sub_preempt_count(); | ||
1526 | 7) + 13.341 us | } /* __schedule */ | ||
1527 | 7) 0.095 us | } /* sub_preempt_count */ | ||
1528 | 7) | schedule() { | ||
1529 | 7) | __schedule() { | ||
1530 | 7) 0.060 us | add_preempt_count(); | ||
1531 | 7) 0.044 us | rcu_note_context_switch(); | ||
1532 | 7) | _raw_spin_lock_irq() { | ||
1533 | 7) 0.033 us | add_preempt_count(); | ||
1534 | 7) 0.247 us | } | ||
1535 | 7) | idle_balance() { | ||
1536 | 7) | _raw_spin_unlock() { | ||
1537 | 7) 0.031 us | sub_preempt_count(); | ||
1538 | 7) 0.246 us | } | ||
1539 | 7) | update_shares() { | ||
1540 | 7) 0.030 us | __rcu_read_lock(); | ||
1541 | 7) 0.029 us | __rcu_read_unlock(); | ||
1542 | 7) 0.484 us | } | ||
1543 | 7) 0.030 us | __rcu_read_lock(); | ||
1544 | 7) | load_balance() { | ||
1545 | 7) | find_busiest_group() { | ||
1546 | 7) 0.031 us | idle_cpu(); | ||
1547 | 7) 0.029 us | idle_cpu(); | ||
1548 | 7) 0.035 us | idle_cpu(); | ||
1549 | 7) 0.906 us | } | ||
1550 | 7) 1.141 us | } | ||
1551 | 7) 0.022 us | msecs_to_jiffies(); | ||
1552 | 7) | load_balance() { | ||
1553 | 7) | find_busiest_group() { | ||
1554 | 7) 0.031 us | idle_cpu(); | ||
1555 | . | ||
1556 | . | ||
1557 | . | ||
1558 | 4) 0.062 us | msecs_to_jiffies(); | ||
1559 | 4) 0.062 us | __rcu_read_unlock(); | ||
1560 | 4) | _raw_spin_lock() { | ||
1561 | 4) 0.073 us | add_preempt_count(); | ||
1562 | 4) 0.562 us | } | ||
1563 | 4) + 17.452 us | } | ||
1564 | 4) 0.108 us | put_prev_task_fair(); | ||
1565 | 4) 0.102 us | pick_next_task_fair(); | ||
1566 | 4) 0.084 us | pick_next_task_stop(); | ||
1567 | 4) 0.075 us | pick_next_task_rt(); | ||
1568 | 4) 0.062 us | pick_next_task_fair(); | ||
1569 | 4) 0.066 us | pick_next_task_idle(); | ||
1570 | ------------------------------------------ | ||
1571 | 4) kworker-74 => <idle>-0 | ||
1572 | ------------------------------------------ | ||
1573 | |||
1574 | 4) | finish_task_switch() { | ||
1575 | 4) | _raw_spin_unlock_irq() { | ||
1576 | 4) 0.100 us | sub_preempt_count(); | ||
1577 | 4) 0.582 us | } | ||
1578 | 4) 1.105 us | } | ||
1579 | 4) 0.088 us | sub_preempt_count(); | ||
1580 | 4) ! 100.066 us | } | ||
1581 | . | ||
1582 | . | ||
1583 | . | ||
1584 | 3) | sys_ioctl() { | ||
1585 | 3) 0.083 us | fget_light(); | ||
1586 | 3) | security_file_ioctl() { | ||
1587 | 3) 0.066 us | cap_file_ioctl(); | ||
1588 | 3) 0.562 us | } | ||
1589 | 3) | do_vfs_ioctl() { | ||
1590 | 3) | drm_ioctl() { | ||
1591 | 3) 0.075 us | drm_ut_debug_printk(); | ||
1592 | 3) | i915_gem_pwrite_ioctl() { | ||
1593 | 3) | i915_mutex_lock_interruptible() { | ||
1594 | 3) 0.070 us | mutex_lock_interruptible(); | ||
1595 | 3) 0.570 us | } | ||
1596 | 3) | drm_gem_object_lookup() { | ||
1597 | 3) | _raw_spin_lock() { | ||
1598 | 3) 0.080 us | add_preempt_count(); | ||
1599 | 3) 0.620 us | } | ||
1600 | 3) | _raw_spin_unlock() { | ||
1601 | 3) 0.085 us | sub_preempt_count(); | ||
1602 | 3) 0.562 us | } | ||
1603 | 3) 2.149 us | } | ||
1604 | 3) 0.133 us | i915_gem_object_pin(); | ||
1605 | 3) | i915_gem_object_set_to_gtt_domain() { | ||
1606 | 3) 0.065 us | i915_gem_object_flush_gpu_write_domain(); | ||
1607 | 3) 0.065 us | i915_gem_object_wait_rendering(); | ||
1608 | 3) 0.062 us | i915_gem_object_flush_cpu_write_domain(); | ||
1609 | 3) 1.612 us | } | ||
1610 | 3) | i915_gem_object_put_fence() { | ||
1611 | 3) 0.097 us | i915_gem_object_flush_fence.constprop.36(); | ||
1612 | 3) 0.645 us | } | ||
1613 | 3) 0.070 us | add_preempt_count(); | ||
1614 | 3) 0.070 us | sub_preempt_count(); | ||
1615 | 3) 0.073 us | i915_gem_object_unpin(); | ||
1616 | 3) 0.068 us | mutex_unlock(); | ||
1617 | 3) 9.924 us | } | ||
1618 | 3) + 11.236 us | } | ||
1619 | 3) + 11.770 us | } | ||
1620 | 3) + 13.784 us | } | ||
1621 | 3) | sys_ioctl() { | ||
1622 | </literallayout> | ||
1623 | As you can see, the function_graph display is much easier to | ||
1624 | follow. Also note that in addition to the function calls and | ||
1625 | associated braces, other events such as scheduler events | ||
1626 | are displayed in context. In fact, you can freely include | ||
1627 | any tracepoint available in the trace events subsystem described | ||
1628 | in the next section by simply enabling those events, and they'll | ||
1629 | appear in context in the function graph display. Quite a | ||
1630 | powerful tool for understanding kernel dynamics. | ||
1631 | </para> | ||
1632 | |||
1633 | <para> | ||
1634 | Also notice that there are various annotations on the left | ||
1635 | hand side of the display. For example if the total time it | ||
1636 | took for a given function to execute is above a certain | ||
1637 | threshold, an exclamation point or plus sign appears on the | ||
1638 | left hand side. Please see the ftrace documentation for | ||
1639 | details on all these fields. | ||
1640 | </para> | ||
1641 | </section> | ||
1642 | |||
1643 | <section id='the-trace-events-subsystem'> | ||
1644 | <title>The 'trace events' Subsystem</title> | ||
1645 | |||
1646 | <para> | ||
1647 | One especially important directory contained within | ||
1648 | the /sys/kernel/debug/tracing directory is the 'events' | ||
1649 | subdirectory, which contains representations of every | ||
1650 | tracepoint in the system. Listing out the contents of | ||
1651 | the 'events' subdirectory, we see mainly another set of | ||
1652 | subdirectories: | ||
1653 | <literallayout class='monospaced'> | ||
1654 | root@sugarbay:/sys/kernel/debug/tracing# cd events | ||
1655 | root@sugarbay:/sys/kernel/debug/tracing/events# ls -al | ||
1656 | drwxr-xr-x 38 root root 0 Nov 14 23:19 . | ||
1657 | drwxr-xr-x 5 root root 0 Nov 14 23:19 .. | ||
1658 | drwxr-xr-x 19 root root 0 Nov 14 23:19 block | ||
1659 | drwxr-xr-x 32 root root 0 Nov 14 23:19 btrfs | ||
1660 | drwxr-xr-x 5 root root 0 Nov 14 23:19 drm | ||
1661 | -rw-r--r-- 1 root root 0 Nov 14 23:19 enable | ||
1662 | drwxr-xr-x 40 root root 0 Nov 14 23:19 ext3 | ||
1663 | drwxr-xr-x 79 root root 0 Nov 14 23:19 ext4 | ||
1664 | drwxr-xr-x 14 root root 0 Nov 14 23:19 ftrace | ||
1665 | drwxr-xr-x 8 root root 0 Nov 14 23:19 hda | ||
1666 | -r--r--r-- 1 root root 0 Nov 14 23:19 header_event | ||
1667 | -r--r--r-- 1 root root 0 Nov 14 23:19 header_page | ||
1668 | drwxr-xr-x 25 root root 0 Nov 14 23:19 i915 | ||
1669 | drwxr-xr-x 7 root root 0 Nov 14 23:19 irq | ||
1670 | drwxr-xr-x 12 root root 0 Nov 14 23:19 jbd | ||
1671 | drwxr-xr-x 14 root root 0 Nov 14 23:19 jbd2 | ||
1672 | drwxr-xr-x 14 root root 0 Nov 14 23:19 kmem | ||
1673 | drwxr-xr-x 7 root root 0 Nov 14 23:19 module | ||
1674 | drwxr-xr-x 3 root root 0 Nov 14 23:19 napi | ||
1675 | drwxr-xr-x 6 root root 0 Nov 14 23:19 net | ||
1676 | drwxr-xr-x 3 root root 0 Nov 14 23:19 oom | ||
1677 | drwxr-xr-x 12 root root 0 Nov 14 23:19 power | ||
1678 | drwxr-xr-x 3 root root 0 Nov 14 23:19 printk | ||
1679 | drwxr-xr-x 8 root root 0 Nov 14 23:19 random | ||
1680 | drwxr-xr-x 4 root root 0 Nov 14 23:19 raw_syscalls | ||
1681 | drwxr-xr-x 3 root root 0 Nov 14 23:19 rcu | ||
1682 | drwxr-xr-x 6 root root 0 Nov 14 23:19 rpm | ||
1683 | drwxr-xr-x 20 root root 0 Nov 14 23:19 sched | ||
1684 | drwxr-xr-x 7 root root 0 Nov 14 23:19 scsi | ||
1685 | drwxr-xr-x 4 root root 0 Nov 14 23:19 signal | ||
1686 | drwxr-xr-x 5 root root 0 Nov 14 23:19 skb | ||
1687 | drwxr-xr-x 4 root root 0 Nov 14 23:19 sock | ||
1688 | drwxr-xr-x 10 root root 0 Nov 14 23:19 sunrpc | ||
1689 | drwxr-xr-x 538 root root 0 Nov 14 23:19 syscalls | ||
1690 | drwxr-xr-x 4 root root 0 Nov 14 23:19 task | ||
1691 | drwxr-xr-x 14 root root 0 Nov 14 23:19 timer | ||
1692 | drwxr-xr-x 3 root root 0 Nov 14 23:19 udp | ||
1693 | drwxr-xr-x 21 root root 0 Nov 14 23:19 vmscan | ||
1694 | drwxr-xr-x 3 root root 0 Nov 14 23:19 vsyscall | ||
1695 | drwxr-xr-x 6 root root 0 Nov 14 23:19 workqueue | ||
1696 | drwxr-xr-x 26 root root 0 Nov 14 23:19 writeback | ||
1697 | </literallayout> | ||
1698 | Each one of these subdirectories corresponds to a | ||
1699 | 'subsystem' and contains yet again more subdirectories, | ||
1700 | each one of those finally corresponding to a tracepoint. | ||
1701 | For example, here are the contents of the 'kmem' subsystem: | ||
1702 | <literallayout class='monospaced'> | ||
1703 | root@sugarbay:/sys/kernel/debug/tracing/events# cd kmem | ||
1704 | root@sugarbay:/sys/kernel/debug/tracing/events/kmem# ls -al | ||
1705 | drwxr-xr-x 14 root root 0 Nov 14 23:19 . | ||
1706 | drwxr-xr-x 38 root root 0 Nov 14 23:19 .. | ||
1707 | -rw-r--r-- 1 root root 0 Nov 14 23:19 enable | ||
1708 | -rw-r--r-- 1 root root 0 Nov 14 23:19 filter | ||
1709 | drwxr-xr-x 2 root root 0 Nov 14 23:19 kfree | ||
1710 | drwxr-xr-x 2 root root 0 Nov 14 23:19 kmalloc | ||
1711 | drwxr-xr-x 2 root root 0 Nov 14 23:19 kmalloc_node | ||
1712 | drwxr-xr-x 2 root root 0 Nov 14 23:19 kmem_cache_alloc | ||
1713 | drwxr-xr-x 2 root root 0 Nov 14 23:19 kmem_cache_alloc_node | ||
1714 | drwxr-xr-x 2 root root 0 Nov 14 23:19 kmem_cache_free | ||
1715 | drwxr-xr-x 2 root root 0 Nov 14 23:19 mm_page_alloc | ||
1716 | drwxr-xr-x 2 root root 0 Nov 14 23:19 mm_page_alloc_extfrag | ||
1717 | drwxr-xr-x 2 root root 0 Nov 14 23:19 mm_page_alloc_zone_locked | ||
1718 | drwxr-xr-x 2 root root 0 Nov 14 23:19 mm_page_free | ||
1719 | drwxr-xr-x 2 root root 0 Nov 14 23:19 mm_page_free_batched | ||
1720 | drwxr-xr-x 2 root root 0 Nov 14 23:19 mm_page_pcpu_drain | ||
1721 | </literallayout> | ||
1722 | Let's see what's inside the subdirectory for a specific | ||
1723 | tracepoint, in this case the one for kmalloc: | ||
1724 | <literallayout class='monospaced'> | ||
1725 | root@sugarbay:/sys/kernel/debug/tracing/events/kmem# cd kmalloc | ||
1726 | root@sugarbay:/sys/kernel/debug/tracing/events/kmem/kmalloc# ls -al | ||
1727 | drwxr-xr-x 2 root root 0 Nov 14 23:19 . | ||
1728 | drwxr-xr-x 14 root root 0 Nov 14 23:19 .. | ||
1729 | -rw-r--r-- 1 root root 0 Nov 14 23:19 enable | ||
1730 | -rw-r--r-- 1 root root 0 Nov 14 23:19 filter | ||
1731 | -r--r--r-- 1 root root 0 Nov 14 23:19 format | ||
1732 | -r--r--r-- 1 root root 0 Nov 14 23:19 id | ||
1733 | </literallayout> | ||
1734 | The 'format' file for the tracepoint describes the event | ||
1735 | in memory, which is used by the various tracing tools | ||
1736 | that now make use of these tracepoint to parse the event | ||
1737 | and make sense of it, along with a 'print fmt' field that | ||
1738 | allows tools like ftrace to display the event as text. | ||
1739 | Here's what the format of the kmalloc event looks like: | ||
1740 | <literallayout class='monospaced'> | ||
1741 | root@sugarbay:/sys/kernel/debug/tracing/events/kmem/kmalloc# cat format | ||
1742 | name: kmalloc | ||
1743 | ID: 313 | ||
1744 | format: | ||
1745 | field:unsigned short common_type; offset:0; size:2; signed:0; | ||
1746 | field:unsigned char common_flags; offset:2; size:1; signed:0; | ||
1747 | field:unsigned char common_preempt_count; offset:3; size:1; signed:0; | ||
1748 | field:int common_pid; offset:4; size:4; signed:1; | ||
1749 | field:int common_padding; offset:8; size:4; signed:1; | ||
1750 | |||
1751 | field:unsigned long call_site; offset:16; size:8; signed:0; | ||
1752 | field:const void * ptr; offset:24; size:8; signed:0; | ||
1753 | field:size_t bytes_req; offset:32; size:8; signed:0; | ||
1754 | field:size_t bytes_alloc; offset:40; size:8; signed:0; | ||
1755 | field:gfp_t gfp_flags; offset:48; size:4; signed:0; | ||
1756 | |||
1757 | print fmt: "call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s", REC->call_site, REC->ptr, REC->bytes_req, REC->bytes_alloc, | ||
1758 | (REC->gfp_flags) ? __print_flags(REC->gfp_flags, "|", {(unsigned long)(((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u) | (( | ||
1759 | gfp_t)0x20000u) | (( gfp_t)0x02u) | (( gfp_t)0x08u)) | (( gfp_t)0x4000u) | (( gfp_t)0x10000u) | (( gfp_t)0x1000u) | (( gfp_t)0x200u) | (( | ||
1760 | gfp_t)0x400000u)), "GFP_TRANSHUGE"}, {(unsigned long)((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u) | (( gfp_t)0x20000u) | (( | ||
1761 | gfp_t)0x02u) | (( gfp_t)0x08u)), "GFP_HIGHUSER_MOVABLE"}, {(unsigned long)((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u) | (( | ||
1762 | gfp_t)0x20000u) | (( gfp_t)0x02u)), "GFP_HIGHUSER"}, {(unsigned long)((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u) | (( | ||
1763 | gfp_t)0x20000u)), "GFP_USER"}, {(unsigned long)((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u) | (( gfp_t)0x80000u)), GFP_TEMPORARY"}, | ||
1764 | {(unsigned long)((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u)), "GFP_KERNEL"}, {(unsigned long)((( gfp_t)0x10u) | (( gfp_t)0x40u)), | ||
1765 | "GFP_NOFS"}, {(unsigned long)((( gfp_t)0x20u)), "GFP_ATOMIC"}, {(unsigned long)((( gfp_t)0x10u)), "GFP_NOIO"}, {(unsigned long)(( | ||
1766 | gfp_t)0x20u), "GFP_HIGH"}, {(unsigned long)(( gfp_t)0x10u), "GFP_WAIT"}, {(unsigned long)(( gfp_t)0x40u), "GFP_IO"}, {(unsigned long)(( | ||
1767 | gfp_t)0x100u), "GFP_COLD"}, {(unsigned long)(( gfp_t)0x200u), "GFP_NOWARN"}, {(unsigned long)(( gfp_t)0x400u), "GFP_REPEAT"}, {(unsigned | ||
1768 | long)(( gfp_t)0x800u), "GFP_NOFAIL"}, {(unsigned long)(( gfp_t)0x1000u), "GFP_NORETRY"}, {(unsigned long)(( gfp_t)0x4000u), "GFP_COMP"}, | ||
1769 | {(unsigned long)(( gfp_t)0x8000u), "GFP_ZERO"}, {(unsigned long)(( gfp_t)0x10000u), "GFP_NOMEMALLOC"}, {(unsigned long)(( gfp_t)0x20000u), | ||
1770 | "GFP_HARDWALL"}, {(unsigned long)(( gfp_t)0x40000u), "GFP_THISNODE"}, {(unsigned long)(( gfp_t)0x80000u), "GFP_RECLAIMABLE"}, {(unsigned | ||
1771 | long)(( gfp_t)0x08u), "GFP_MOVABLE"}, {(unsigned long)(( gfp_t)0), "GFP_NOTRACK"}, {(unsigned long)(( gfp_t)0x400000u), "GFP_NO_KSWAPD"}, | ||
1772 | {(unsigned long)(( gfp_t)0x800000u), "GFP_OTHER_NODE"} ) : "GFP_NOWAIT" | ||
1773 | </literallayout> | ||
1774 | The 'enable' file in the tracepoint directory is what allows | ||
1775 | the user (or tools such as trace-cmd) to actually turn the | ||
1776 | tracepoint on and off. When enabled, the corresponding | ||
1777 | tracepoint will start appearing in the ftrace 'trace' | ||
1778 | file described previously. For example, this turns on the | ||
1779 | kmalloc tracepoint: | ||
1780 | <literallayout class='monospaced'> | ||
1781 | root@sugarbay:/sys/kernel/debug/tracing/events/kmem/kmalloc# echo 1 > enable | ||
1782 | </literallayout> | ||
1783 | At the moment, we're not interested in the function tracer or | ||
1784 | some other tracer that might be in effect, so we first turn | ||
1785 | it off, but if we do that, we still need to turn tracing on in | ||
1786 | order to see the events in the output buffer: | ||
1787 | <literallayout class='monospaced'> | ||
1788 | root@sugarbay:/sys/kernel/debug/tracing# echo nop > current_tracer | ||
1789 | root@sugarbay:/sys/kernel/debug/tracing# echo 1 > tracing_on | ||
1790 | </literallayout> | ||
1791 | Now, if we look at the the 'trace' file, we see nothing | ||
1792 | but the kmalloc events we just turned on: | ||
1793 | <literallayout class='monospaced'> | ||
1794 | root@sugarbay:/sys/kernel/debug/tracing# cat trace | less | ||
1795 | # tracer: nop | ||
1796 | # | ||
1797 | # entries-in-buffer/entries-written: 1897/1897 #P:8 | ||
1798 | # | ||
1799 | # _-----=> irqs-off | ||
1800 | # / _----=> need-resched | ||
1801 | # | / _---=> hardirq/softirq | ||
1802 | # || / _--=> preempt-depth | ||
1803 | # ||| / delay | ||
1804 | # TASK-PID CPU# |||| TIMESTAMP FUNCTION | ||
1805 | # | | | |||| | | | ||
1806 | dropbear-1465 [000] ...1 18154.620753: kmalloc: call_site=ffffffff816650d4 ptr=ffff8800729c3000 bytes_req=2048 bytes_alloc=2048 gfp_flags=GFP_KERNEL | ||
1807 | <idle>-0 [000] ..s3 18154.621640: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC | ||
1808 | <idle>-0 [000] ..s3 18154.621656: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC | ||
1809 | matchbox-termin-1361 [001] ...1 18154.755472: kmalloc: call_site=ffffffff81614050 ptr=ffff88006d5f0e00 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_KERNEL|GFP_REPEAT | ||
1810 | Xorg-1264 [002] ...1 18154.755581: kmalloc: call_site=ffffffff8141abe8 ptr=ffff8800734f4cc0 bytes_req=168 bytes_alloc=192 gfp_flags=GFP_KERNEL|GFP_NOWARN|GFP_NORETRY | ||
1811 | Xorg-1264 [002] ...1 18154.755583: kmalloc: call_site=ffffffff814192a3 ptr=ffff88001f822520 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL|GFP_ZERO | ||
1812 | Xorg-1264 [002] ...1 18154.755589: kmalloc: call_site=ffffffff81419edb ptr=ffff8800721a2f00 bytes_req=64 bytes_alloc=64 gfp_flags=GFP_KERNEL|GFP_ZERO | ||
1813 | matchbox-termin-1361 [001] ...1 18155.354594: kmalloc: call_site=ffffffff81614050 ptr=ffff88006db35400 bytes_req=576 bytes_alloc=1024 gfp_flags=GFP_KERNEL|GFP_REPEAT | ||
1814 | Xorg-1264 [002] ...1 18155.354703: kmalloc: call_site=ffffffff8141abe8 ptr=ffff8800734f4cc0 bytes_req=168 bytes_alloc=192 gfp_flags=GFP_KERNEL|GFP_NOWARN|GFP_NORETRY | ||
1815 | Xorg-1264 [002] ...1 18155.354705: kmalloc: call_site=ffffffff814192a3 ptr=ffff88001f822520 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL|GFP_ZERO | ||
1816 | Xorg-1264 [002] ...1 18155.354711: kmalloc: call_site=ffffffff81419edb ptr=ffff8800721a2f00 bytes_req=64 bytes_alloc=64 gfp_flags=GFP_KERNEL|GFP_ZERO | ||
1817 | <idle>-0 [000] ..s3 18155.673319: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC | ||
1818 | dropbear-1465 [000] ...1 18155.673525: kmalloc: call_site=ffffffff816650d4 ptr=ffff8800729c3000 bytes_req=2048 bytes_alloc=2048 gfp_flags=GFP_KERNEL | ||
1819 | <idle>-0 [000] ..s3 18155.674821: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d554800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC | ||
1820 | <idle>-0 [000] ..s3 18155.793014: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d554800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC | ||
1821 | dropbear-1465 [000] ...1 18155.793219: kmalloc: call_site=ffffffff816650d4 ptr=ffff8800729c3000 bytes_req=2048 bytes_alloc=2048 gfp_flags=GFP_KERNEL | ||
1822 | <idle>-0 [000] ..s3 18155.794147: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC | ||
1823 | <idle>-0 [000] ..s3 18155.936705: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC | ||
1824 | dropbear-1465 [000] ...1 18155.936910: kmalloc: call_site=ffffffff816650d4 ptr=ffff8800729c3000 bytes_req=2048 bytes_alloc=2048 gfp_flags=GFP_KERNEL | ||
1825 | <idle>-0 [000] ..s3 18155.937869: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d554800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC | ||
1826 | matchbox-termin-1361 [001] ...1 18155.953667: kmalloc: call_site=ffffffff81614050 ptr=ffff88006d5f2000 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_KERNEL|GFP_REPEAT | ||
1827 | Xorg-1264 [002] ...1 18155.953775: kmalloc: call_site=ffffffff8141abe8 ptr=ffff8800734f4cc0 bytes_req=168 bytes_alloc=192 gfp_flags=GFP_KERNEL|GFP_NOWARN|GFP_NORETRY | ||
1828 | Xorg-1264 [002] ...1 18155.953777: kmalloc: call_site=ffffffff814192a3 ptr=ffff88001f822520 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL|GFP_ZERO | ||
1829 | Xorg-1264 [002] ...1 18155.953783: kmalloc: call_site=ffffffff81419edb ptr=ffff8800721a2f00 bytes_req=64 bytes_alloc=64 gfp_flags=GFP_KERNEL|GFP_ZERO | ||
1830 | <idle>-0 [000] ..s3 18156.176053: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d554800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC | ||
1831 | dropbear-1465 [000] ...1 18156.176257: kmalloc: call_site=ffffffff816650d4 ptr=ffff8800729c3000 bytes_req=2048 bytes_alloc=2048 gfp_flags=GFP_KERNEL | ||
1832 | <idle>-0 [000] ..s3 18156.177717: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC | ||
1833 | <idle>-0 [000] ..s3 18156.399229: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC | ||
1834 | dropbear-1465 [000] ...1 18156.399434: kmalloc: call_site=ffffffff816650d4 ptr=ffff8800729c3000 bytes_http://rostedt.homelinux.com/kernelshark/req=2048 bytes_alloc=2048 gfp_flags=GFP_KERNEL | ||
1835 | <idle>-0 [000] ..s3 18156.400660: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d554800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC | ||
1836 | matchbox-termin-1361 [001] ...1 18156.552800: kmalloc: call_site=ffffffff81614050 ptr=ffff88006db34800 bytes_req=576 bytes_alloc=1024 gfp_flags=GFP_KERNEL|GFP_REPEAT | ||
1837 | </literallayout> | ||
1838 | To again disable the kmalloc event, we need to send 0 to the | ||
1839 | enable file: | ||
1840 | <literallayout class='monospaced'> | ||
1841 | root@sugarbay:/sys/kernel/debug/tracing/events/kmem/kmalloc# echo 0 > enable | ||
1842 | </literallayout> | ||
1843 | You can enable any number of events or complete subsystems | ||
1844 | (by using the 'enable' file in the subsystem directory) and | ||
1845 | get an arbitrarily fine-grained idea of what's going on in the | ||
1846 | system by enabling as many of the appropriate tracepoints | ||
1847 | as applicable. | ||
1848 | </para> | ||
1849 | |||
1850 | <para> | ||
1851 | A number of the tools described in this HOWTO do just that, | ||
1852 | including trace-cmd and kernelshark in the next section. | ||
1853 | </para> | ||
1854 | |||
1855 | <informalexample> | ||
1856 | <emphasis>Tying it Together:</emphasis> These tracepoints and their representation | ||
1857 | are used not only by ftrace, but by many of the other tools | ||
1858 | covered in this document and they form a central point of | ||
1859 | integration for the various tracers available in Linux. | ||
1860 | They form a central part of the instrumentation for the | ||
1861 | following tools: perf, lttng, ftrace, blktrace and SystemTap | ||
1862 | </informalexample> | ||
1863 | |||
1864 | <informalexample> | ||
1865 | <emphasis>Tying it Together:</emphasis> Eventually all the special-purpose tracers | ||
1866 | currently available in /sys/kernel/debug/tracing will be | ||
1867 | removed and replaced with equivalent tracers based on the | ||
1868 | 'trace events' subsystem. | ||
1869 | </informalexample> | ||
1870 | </section> | ||
1871 | |||
1872 | <section id='trace-cmd-kernelshark'> | ||
1873 | <title>trace-cmd/kernelshark</title> | ||
1874 | |||
1875 | <para> | ||
1876 | trace-cmd is essentially an extensive command-line 'wrapper' | ||
1877 | interface that hides the details of all the individual files | ||
1878 | in /sys/kernel/debug/tracing, allowing users to specify | ||
1879 | specific particular events within the | ||
1880 | /sys/kernel/debug/tracing/events/ subdirectory and to collect | ||
1881 | traces and avoid having to deal with those details directly. | ||
1882 | </para> | ||
1883 | |||
1884 | <para> | ||
1885 | As yet another layer on top of that, kernelshark provides a GUI | ||
1886 | that allows users to start and stop traces and specify sets | ||
1887 | of events using an intuitive interface, and view the | ||
1888 | output as both trace events and as a per-CPU graphical | ||
1889 | display. It directly uses 'trace-cmd' as the plumbing | ||
1890 | that accomplishes all that underneath the covers (and | ||
1891 | actually displays the trace-cmd command it uses, as we'll see). | ||
1892 | </para> | ||
1893 | |||
1894 | <para> | ||
1895 | To start a trace using kernelshark, first start kernelshark: | ||
1896 | <literallayout class='monospaced'> | ||
1897 | root@sugarbay:~# kernelshark | ||
1898 | </literallayout> | ||
1899 | Then bring up the 'Capture' dialog by choosing from the | ||
1900 | kernelshark menu: | ||
1901 | <literallayout class='monospaced'> | ||
1902 | Capture | Record | ||
1903 | </literallayout> | ||
1904 | That will display the following dialog, which allows you to | ||
1905 | choose one or more events (or even one or more complete | ||
1906 | subsystems) to trace: | ||
1907 | </para> | ||
1908 | |||
1909 | <para> | ||
1910 | <imagedata fileref="figures/kernelshark-choose-events.png" width="6in" depth="6in" align="center" scalefit="1" /> | ||
1911 | </para> | ||
1912 | |||
1913 | <para> | ||
1914 | Note that these are exactly the same sets of events described | ||
1915 | in the previous trace events subsystem section, and in fact | ||
1916 | is where trace-cmd gets them for kernelshark. | ||
1917 | </para> | ||
1918 | |||
1919 | <para> | ||
1920 | In the above screenshot, we've decided to explore the | ||
1921 | graphics subsystem a bit and so have chosen to trace all | ||
1922 | the tracepoints contained within the 'i915' and 'drm' | ||
1923 | subsystems. | ||
1924 | </para> | ||
1925 | |||
1926 | <para> | ||
1927 | After doing that, we can start and stop the trace using | ||
1928 | the 'Run' and 'Stop' button on the lower right corner of | ||
1929 | the dialog (the same button will turn into the 'Stop' | ||
1930 | button after the trace has started): | ||
1931 | </para> | ||
1932 | |||
1933 | <para> | ||
1934 | <imagedata fileref="figures/kernelshark-output-display.png" width="6in" depth="6in" align="center" scalefit="1" /> | ||
1935 | </para> | ||
1936 | |||
1937 | <para> | ||
1938 | Notice that the right-hand pane shows the exact trace-cmd | ||
1939 | command-line that's used to run the trace, along with the | ||
1940 | results of the trace-cmd run. | ||
1941 | </para> | ||
1942 | |||
1943 | <para> | ||
1944 | Once the 'Stop' button is pressed, the graphical view magically | ||
1945 | fills up with a colorful per-cpu display of the trace data, | ||
1946 | along with the detailed event listing below that: | ||
1947 | </para> | ||
1948 | |||
1949 | <para> | ||
1950 | <imagedata fileref="figures/kernelshark-i915-display.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
1951 | </para> | ||
1952 | |||
1953 | <para> | ||
1954 | Here's another example, this time a display resulting | ||
1955 | from tracing 'all events': | ||
1956 | </para> | ||
1957 | |||
1958 | <para> | ||
1959 | <imagedata fileref="figures/kernelshark-all.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
1960 | </para> | ||
1961 | |||
1962 | <para> | ||
1963 | The tool is pretty self-explanatory, but for more detailed | ||
1964 | information on navigating through the data, see the | ||
1965 | <ulink url='http://rostedt.homelinux.com/kernelshark/'>kernelshark website</ulink>. | ||
1966 | </para> | ||
1967 | </section> | ||
1968 | |||
1969 | <section id='ftrace-documentation'> | ||
1970 | <title>Documentation</title> | ||
1971 | |||
1972 | <para> | ||
1973 | The documentation for ftrace can be found in the kernel | ||
1974 | Documentation directory: | ||
1975 | <literallayout class='monospaced'> | ||
1976 | Documentation/trace/ftrace.txt | ||
1977 | </literallayout> | ||
1978 | The documentation for the trace event subsystem can also | ||
1979 | be found in the kernel Documentation directory: | ||
1980 | <literallayout class='monospaced'> | ||
1981 | Documentation/trace/events.txt | ||
1982 | </literallayout> | ||
1983 | There is a nice series of articles on using | ||
1984 | ftrace and trace-cmd at LWN: | ||
1985 | <itemizedlist> | ||
1986 | <listitem><para><ulink url='http://lwn.net/Articles/365835/'>Debugging the kernel using Ftrace - part 1</ulink> | ||
1987 | </para></listitem> | ||
1988 | <listitem><para><ulink url='http://lwn.net/Articles/366796/'>Debugging the kernel using Ftrace - part 2</ulink> | ||
1989 | </para></listitem> | ||
1990 | <listitem><para><ulink url='http://lwn.net/Articles/370423/'>Secrets of the Ftrace function tracer</ulink> | ||
1991 | </para></listitem> | ||
1992 | <listitem><para><ulink url='https://lwn.net/Articles/410200/'>trace-cmd: A front-end for Ftrace</ulink> | ||
1993 | </para></listitem> | ||
1994 | </itemizedlist> | ||
1995 | </para> | ||
1996 | |||
1997 | <para> | ||
1998 | There's more detailed documentation kernelshark usage here: | ||
1999 | <ulink url='http://rostedt.homelinux.com/kernelshark/'>KernelShark</ulink> | ||
2000 | </para> | ||
2001 | |||
2002 | <para> | ||
2003 | An amusing yet useful README (a tracing mini-HOWTO) can be | ||
2004 | found in /sys/kernel/debug/tracing/README. | ||
2005 | </para> | ||
2006 | </section> | ||
2007 | </section> | ||
2008 | |||
2009 | <section id='profile-manual-systemtap'> | ||
2010 | <title>systemtap</title> | ||
2011 | |||
2012 | <para> | ||
2013 | SystemTap is a system-wide script-based tracing and profiling tool. | ||
2014 | </para> | ||
2015 | |||
2016 | <para> | ||
2017 | SystemTap scripts are C-like programs that are executed in the | ||
2018 | kernel to gather/print/aggregate data extracted from the context | ||
2019 | they end up being invoked under. | ||
2020 | </para> | ||
2021 | |||
2022 | <para> | ||
2023 | For example, this probe from the | ||
2024 | <ulink url='http://sourceware.org/systemtap/tutorial/'>SystemTap tutorial</ulink> | ||
2025 | simply prints a line every time any process on the system open()s | ||
2026 | a file. For each line, it prints the executable name of the | ||
2027 | program that opened the file, along with its PID, and the name | ||
2028 | of the file it opened (or tried to open), which it extracts | ||
2029 | from the open syscall's argstr. | ||
2030 | <literallayout class='monospaced'> | ||
2031 | probe syscall.open | ||
2032 | { | ||
2033 | printf ("%s(%d) open (%s)\n", execname(), pid(), argstr) | ||
2034 | } | ||
2035 | |||
2036 | probe timer.ms(4000) # after 4 seconds | ||
2037 | { | ||
2038 | exit () | ||
2039 | } | ||
2040 | </literallayout> | ||
2041 | Normally, to execute this probe, you'd simply install | ||
2042 | systemtap on the system you want to probe, and directly run | ||
2043 | the probe on that system e.g. assuming the name of the file | ||
2044 | containing the above text is trace_open.stp: | ||
2045 | <literallayout class='monospaced'> | ||
2046 | # stap trace_open.stp | ||
2047 | </literallayout> | ||
2048 | What systemtap does under the covers to run this probe is 1) | ||
2049 | parse and convert the probe to an equivalent 'C' form, 2) | ||
2050 | compile the 'C' form into a kernel module, 3) insert the | ||
2051 | module into the kernel, which arms it, and 4) collect the data | ||
2052 | generated by the probe and display it to the user. | ||
2053 | </para> | ||
2054 | |||
2055 | <para> | ||
2056 | In order to accomplish steps 1 and 2, the 'stap' program needs | ||
2057 | access to the kernel build system that produced the kernel | ||
2058 | that the probed system is running. In the case of a typical | ||
2059 | embedded system (the 'target'), the kernel build system | ||
2060 | unfortunately isn't typically part of the image running on | ||
2061 | the target. It is normally available on the 'host' system | ||
2062 | that produced the target image however; in such cases, | ||
2063 | steps 1 and 2 are executed on the host system, and steps | ||
2064 | 3 and 4 are executed on the target system, using only the | ||
2065 | systemtap 'runtime'. | ||
2066 | </para> | ||
2067 | |||
2068 | <para> | ||
2069 | The systemtap support in Yocto assumes that only steps | ||
2070 | 3 and 4 are run on the target; it is possible to do | ||
2071 | everything on the target, but this section assumes only | ||
2072 | the typical embedded use-case. | ||
2073 | </para> | ||
2074 | |||
2075 | <para> | ||
2076 | So basically what you need to do in order to run a systemtap | ||
2077 | script on the target is to 1) on the host system, compile the | ||
2078 | probe into a kernel module that makes sense to the target, 2) | ||
2079 | copy the module onto the target system and 3) insert the | ||
2080 | module into the target kernel, which arms it, and 4) collect | ||
2081 | the data generated by the probe and display it to the user. | ||
2082 | </para> | ||
2083 | |||
2084 | <section id='systemtap-setup'> | ||
2085 | <title>Setup</title> | ||
2086 | |||
2087 | <para> | ||
2088 | Those are a lot of steps and a lot of details, but | ||
2089 | fortunately Yocto includes a script called 'crosstap' | ||
2090 | that will take care of those details, allowing you to | ||
2091 | simply execute a systemtap script on the remote target, | ||
2092 | with arguments if necessary. | ||
2093 | </para> | ||
2094 | |||
2095 | <para> | ||
2096 | In order to do this from a remote host, however, you | ||
2097 | need to have access to the build for the image you | ||
2098 | booted. The 'crosstap' script provides details on how | ||
2099 | to do this if you run the script on the host without having | ||
2100 | done a build: | ||
2101 | <note> | ||
2102 | SystemTap, which uses 'crosstap', assumes you can establish an | ||
2103 | ssh connection to the remote target. | ||
2104 | Please refer to the crosstap wiki page for details on verifying | ||
2105 | ssh connections at | ||
2106 | <ulink url='https://wiki.yoctoproject.org/wiki/Tracing_and_Profiling#systemtap'></ulink>. | ||
2107 | Also, the ability to ssh into the target system is not enabled | ||
2108 | by default in *-minimal images. | ||
2109 | </note> | ||
2110 | <literallayout class='monospaced'> | ||
2111 | $ crosstap root@192.168.1.88 trace_open.stp | ||
2112 | |||
2113 | Error: No target kernel build found. | ||
2114 | Did you forget to create a local build of your image? | ||
2115 | |||
2116 | 'crosstap' requires a local sdk build of the target system | ||
2117 | (or a build that includes 'tools-profile') in order to build | ||
2118 | kernel modules that can probe the target system. | ||
2119 | |||
2120 | Practically speaking, that means you need to do the following: | ||
2121 | - If you're running a pre-built image, download the release | ||
2122 | and/or BSP tarballs used to build the image. | ||
2123 | - If you're working from git sources, just clone the metadata | ||
2124 | and BSP layers needed to build the image you'll be booting. | ||
2125 | - Make sure you're properly set up to build a new image (see | ||
2126 | the BSP README and/or the widely available basic documentation | ||
2127 | that discusses how to build images). | ||
2128 | - Build an -sdk version of the image e.g.: | ||
2129 | $ bitbake core-image-sato-sdk | ||
2130 | OR | ||
2131 | - Build a non-sdk image but include the profiling tools: | ||
2132 | [ edit local.conf and add 'tools-profile' to the end of | ||
2133 | the EXTRA_IMAGE_FEATURES variable ] | ||
2134 | $ bitbake core-image-sato | ||
2135 | |||
2136 | Once you've build the image on the host system, you're ready to | ||
2137 | boot it (or the equivalent pre-built image) and use 'crosstap' | ||
2138 | to probe it (you need to source the environment as usual first): | ||
2139 | |||
2140 | $ source oe-init-build-env | ||
2141 | $ cd ~/my/systemtap/scripts | ||
2142 | $ crosstap root@192.168.1.xxx myscript.stp | ||
2143 | </literallayout> | ||
2144 | So essentially what you need to do is build an SDK image or | ||
2145 | image with 'tools-profile' as detailed in the | ||
2146 | "<link linkend='profile-manual-general-setup'>General Setup</link>" | ||
2147 | section of this manual, and boot the resulting target image. | ||
2148 | </para> | ||
2149 | |||
2150 | <note> | ||
2151 | If you have a build directory containing multiple machines, | ||
2152 | you need to have the MACHINE you're connecting to selected | ||
2153 | in local.conf, and the kernel in that machine's build | ||
2154 | directory must match the kernel on the booted system exactly, | ||
2155 | or you'll get the above 'crosstap' message when you try to | ||
2156 | invoke a script. | ||
2157 | </note> | ||
2158 | </section> | ||
2159 | |||
2160 | <section id='running-a-script-on-a-target'> | ||
2161 | <title>Running a Script on a Target</title> | ||
2162 | |||
2163 | <para> | ||
2164 | Once you've done that, you should be able to run a systemtap | ||
2165 | script on the target: | ||
2166 | <literallayout class='monospaced'> | ||
2167 | $ cd /path/to/yocto | ||
2168 | $ source oe-init-build-env | ||
2169 | |||
2170 | ### Shell environment set up for builds. ### | ||
2171 | |||
2172 | You can now run 'bitbake <target>' | ||
2173 | |||
2174 | Common targets are: | ||
2175 | core-image-minimal | ||
2176 | core-image-sato | ||
2177 | meta-toolchain | ||
2178 | adt-installer | ||
2179 | meta-ide-support | ||
2180 | |||
2181 | You can also run generated qemu images with a command like 'runqemu qemux86' | ||
2182 | </literallayout> | ||
2183 | Once you've done that, you can cd to whatever directory | ||
2184 | contains your scripts and use 'crosstap' to run the script: | ||
2185 | <literallayout class='monospaced'> | ||
2186 | $ cd /path/to/my/systemap/script | ||
2187 | $ crosstap root@192.168.7.2 trace_open.stp | ||
2188 | </literallayout> | ||
2189 | If you get an error connecting to the target e.g.: | ||
2190 | <literallayout class='monospaced'> | ||
2191 | $ crosstap root@192.168.7.2 trace_open.stp | ||
2192 | error establishing ssh connection on remote 'root@192.168.7.2' | ||
2193 | </literallayout> | ||
2194 | Try ssh'ing to the target and see what happens: | ||
2195 | <literallayout class='monospaced'> | ||
2196 | $ ssh root@192.168.7.2 | ||
2197 | </literallayout> | ||
2198 | A lot of the time, connection problems are due specifying a | ||
2199 | wrong IP address or having a 'host key verification error'. | ||
2200 | </para> | ||
2201 | |||
2202 | <para> | ||
2203 | If everything worked as planned, you should see something | ||
2204 | like this (enter the password when prompted, or press enter | ||
2205 | if it's set up to use no password): | ||
2206 | <literallayout class='monospaced'> | ||
2207 | $ crosstap root@192.168.7.2 trace_open.stp | ||
2208 | root@192.168.7.2's password: | ||
2209 | matchbox-termin(1036) open ("/tmp/vte3FS2LW", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) | ||
2210 | matchbox-termin(1036) open ("/tmp/vteJMC7LW", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) | ||
2211 | </literallayout> | ||
2212 | </para> | ||
2213 | </section> | ||
2214 | |||
2215 | <section id='systemtap-documentation'> | ||
2216 | <title>Documentation</title> | ||
2217 | |||
2218 | <para> | ||
2219 | The SystemTap language reference can be found here: | ||
2220 | <ulink url='http://sourceware.org/systemtap/langref/'>SystemTap Language Reference</ulink> | ||
2221 | </para> | ||
2222 | |||
2223 | <para> | ||
2224 | Links to other SystemTap documents, tutorials, and examples can be | ||
2225 | found here: | ||
2226 | <ulink url='http://sourceware.org/systemtap/documentation.html'>SystemTap documentation page</ulink> | ||
2227 | </para> | ||
2228 | </section> | ||
2229 | </section> | ||
2230 | |||
2231 | <section id='profile-manual-oprofile'> | ||
2232 | <title>oprofile</title> | ||
2233 | |||
2234 | <para> | ||
2235 | oprofile itself is a command-line application that runs on the | ||
2236 | target system. | ||
2237 | </para> | ||
2238 | |||
2239 | <section id='oprofile-setup'> | ||
2240 | <title>Setup</title> | ||
2241 | |||
2242 | <para> | ||
2243 | For this section, we'll assume you've already performed the | ||
2244 | basic setup outlined in the | ||
2245 | "<link linkend='profile-manual-general-setup'>General Setup</link>" | ||
2246 | section. | ||
2247 | </para> | ||
2248 | |||
2249 | <para> | ||
2250 | For the section that deals with running oprofile from the command-line, | ||
2251 | we assume you've ssh'ed to the host and will be running | ||
2252 | oprofile on the target. | ||
2253 | </para> | ||
2254 | |||
2255 | <para> | ||
2256 | oprofileui (oprofile-viewer) is a GUI-based program that runs | ||
2257 | on the host and interacts remotely with the target. | ||
2258 | See the oprofileui section for the exact steps needed to | ||
2259 | install oprofileui on the host. | ||
2260 | </para> | ||
2261 | </section> | ||
2262 | |||
2263 | <section id='oprofile-basic-usage'> | ||
2264 | <title>Basic Usage</title> | ||
2265 | |||
2266 | <para> | ||
2267 | Oprofile as configured in Yocto is a system-wide profiler | ||
2268 | (i.e. the version in Yocto doesn't yet make use of the | ||
2269 | perf_events interface which would allow it to profile | ||
2270 | specific processes and workloads). It relies on hardware | ||
2271 | counter support in the hardware (but can fall back to a | ||
2272 | timer-based mode), which means that it doesn't take | ||
2273 | advantage of tracepoints or other event sources for example. | ||
2274 | </para> | ||
2275 | |||
2276 | <para> | ||
2277 | It consists of a kernel module that collects samples and a | ||
2278 | userspace daemon that writes the sample data to disk. | ||
2279 | </para> | ||
2280 | |||
2281 | <para> | ||
2282 | The 'opcontrol' shell script is used for transparently | ||
2283 | managing these components and starting and stopping | ||
2284 | profiles, and the 'opreport' command is used to | ||
2285 | display the results. | ||
2286 | </para> | ||
2287 | |||
2288 | <para> | ||
2289 | The oprofile daemon should already be running, but before | ||
2290 | you start profiling, you may need to change some settings | ||
2291 | and some of these settings may require the daemon to not | ||
2292 | be running. One of these settings is the path to the | ||
2293 | vmlinux file, which you'll want to set using the --vmlinux | ||
2294 | option if you want the kernel profiled: | ||
2295 | <literallayout class='monospaced'> | ||
2296 | root@crownbay:~# opcontrol --vmlinux=/boot/vmlinux-`uname -r` | ||
2297 | The profiling daemon is currently active, so changes to the configuration | ||
2298 | will be used the next time you restart oprofile after a --shutdown or --deinit. | ||
2299 | </literallayout> | ||
2300 | You can check if vmlinux file: is set using opcontrol --status: | ||
2301 | <literallayout class='monospaced'> | ||
2302 | root@crownbay:~# opcontrol --status | ||
2303 | Daemon paused: pid 1334 | ||
2304 | Separate options: library | ||
2305 | vmlinux file: none | ||
2306 | Image filter: none | ||
2307 | Call-graph depth: 6 | ||
2308 | </literallayout> | ||
2309 | If it's not, you need to shutdown the daemon, add the setting | ||
2310 | and restart the daemon: | ||
2311 | <literallayout class='monospaced'> | ||
2312 | root@crownbay:~# opcontrol --shutdown | ||
2313 | Killing daemon. | ||
2314 | |||
2315 | root@crownbay:~# opcontrol --vmlinux=/boot/vmlinux-`uname -r` | ||
2316 | root@crownbay:~# opcontrol --start-daemon | ||
2317 | Using default event: CPU_CLK_UNHALTED:100000:0:1:1 | ||
2318 | Using 2.6+ OProfile kernel interface. | ||
2319 | Reading module info. | ||
2320 | Using log file /var/lib/oprofile/samples/oprofiled.log | ||
2321 | Daemon started. | ||
2322 | </literallayout> | ||
2323 | If we check the status again we now see our updated settings: | ||
2324 | <literallayout class='monospaced'> | ||
2325 | root@crownbay:~# opcontrol --status | ||
2326 | Daemon paused: pid 1649 | ||
2327 | Separate options: library | ||
2328 | vmlinux file: /boot/vmlinux-3.4.11-yocto-standard | ||
2329 | Image filter: none | ||
2330 | Call-graph depth: 6 | ||
2331 | </literallayout> | ||
2332 | We're now in a position to run a profile. For that we use | ||
2333 | 'opcontrol --start': | ||
2334 | <literallayout class='monospaced'> | ||
2335 | root@crownbay:~# opcontrol --start | ||
2336 | Profiler running. | ||
2337 | </literallayout> | ||
2338 | In another window, run our wget workload: | ||
2339 | <literallayout class='monospaced'> | ||
2340 | root@crownbay:~# rm linux-2.6.19.2.tar.bz2; wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>; sync | ||
2341 | Connecting to downloads.yoctoproject.org (140.211.169.59:80) | ||
2342 | linux-2.6.19.2.tar.b 100% |*******************************| 41727k 0:00:00 ETA | ||
2343 | </literallayout> | ||
2344 | To stop the profile we use 'opcontrol --shutdown', which not | ||
2345 | only stops the profile but shuts down the daemon as well: | ||
2346 | <literallayout class='monospaced'> | ||
2347 | root@crownbay:~# opcontrol --shutdown | ||
2348 | Stopping profiling. | ||
2349 | Killing daemon. | ||
2350 | </literallayout> | ||
2351 | Oprofile writes sample data to /var/lib/oprofile/samples, | ||
2352 | which you can look at if you're interested in seeing how the | ||
2353 | samples are structured. This is also interesting because | ||
2354 | it's related to how you dive down to get further details | ||
2355 | about specific executables in OProfile. | ||
2356 | </para> | ||
2357 | |||
2358 | <para> | ||
2359 | To see the default display output for a profile, simply type | ||
2360 | 'opreport', which will show the results using the data in | ||
2361 | /var/lib/oprofile/samples: | ||
2362 | <literallayout class='monospaced'> | ||
2363 | root@crownbay:~# opreport | ||
2364 | |||
2365 | WARNING! The OProfile kernel driver reports sample buffer overflows. | ||
2366 | Such overflows can result in incorrect sample attribution, invalid sample | ||
2367 | files and other symptoms. See the oprofiled.log for details. | ||
2368 | You should adjust your sampling frequency to eliminate (or at least minimize) | ||
2369 | these overflows. | ||
2370 | CPU: Intel Architectural Perfmon, speed 1.3e+06 MHz (estimated) | ||
2371 | Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000 | ||
2372 | CPU_CLK_UNHALT...| | ||
2373 | samples| %| | ||
2374 | ------------------ | ||
2375 | 464365 79.8156 vmlinux-3.4.11-yocto-standard | ||
2376 | 65108 11.1908 oprofiled | ||
2377 | CPU_CLK_UNHALT...| | ||
2378 | samples| %| | ||
2379 | ------------------ | ||
2380 | 64416 98.9372 oprofiled | ||
2381 | 692 1.0628 libc-2.16.so | ||
2382 | 36959 6.3526 no-vmlinux | ||
2383 | 4378 0.7525 busybox | ||
2384 | CPU_CLK_UNHALT...| | ||
2385 | samples| %| | ||
2386 | ------------------ | ||
2387 | 2844 64.9612 libc-2.16.so | ||
2388 | 1337 30.5391 busybox | ||
2389 | 193 4.4084 ld-2.16.so | ||
2390 | 2 0.0457 libnss_compat-2.16.so | ||
2391 | 1 0.0228 libnsl-2.16.so | ||
2392 | 1 0.0228 libnss_files-2.16.so | ||
2393 | 4344 0.7467 bash | ||
2394 | CPU_CLK_UNHALT...| | ||
2395 | samples| %| | ||
2396 | ------------------ | ||
2397 | 2657 61.1648 bash | ||
2398 | 1665 38.3287 libc-2.16.so | ||
2399 | 18 0.4144 ld-2.16.so | ||
2400 | 3 0.0691 libtinfo.so.5.9 | ||
2401 | 1 0.0230 libdl-2.16.so | ||
2402 | 3118 0.5359 nf_conntrack | ||
2403 | 686 0.1179 matchbox-terminal | ||
2404 | CPU_CLK_UNHALT...| | ||
2405 | samples| %| | ||
2406 | ------------------ | ||
2407 | 214 31.1953 libglib-2.0.so.0.3200.4 | ||
2408 | 114 16.6181 libc-2.16.so | ||
2409 | 79 11.5160 libcairo.so.2.11200.2 | ||
2410 | 78 11.3703 libgdk-x11-2.0.so.0.2400.8 | ||
2411 | 51 7.4344 libpthread-2.16.so | ||
2412 | 45 6.5598 libgobject-2.0.so.0.3200.4 | ||
2413 | 29 4.2274 libvte.so.9.2800.2 | ||
2414 | 25 3.6443 libX11.so.6.3.0 | ||
2415 | 19 2.7697 libxcb.so.1.1.0 | ||
2416 | 17 2.4781 libgtk-x11-2.0.so.0.2400.8 | ||
2417 | 12 1.7493 librt-2.16.so | ||
2418 | 3 0.4373 libXrender.so.1.3.0 | ||
2419 | 671 0.1153 emgd | ||
2420 | 411 0.0706 nf_conntrack_ipv4 | ||
2421 | 391 0.0672 iptable_nat | ||
2422 | 378 0.0650 nf_nat | ||
2423 | 263 0.0452 Xorg | ||
2424 | CPU_CLK_UNHALT...| | ||
2425 | samples| %| | ||
2426 | ------------------ | ||
2427 | 106 40.3042 Xorg | ||
2428 | 53 20.1521 libc-2.16.so | ||
2429 | 31 11.7871 libpixman-1.so.0.27.2 | ||
2430 | 26 9.8859 emgd_drv.so | ||
2431 | 16 6.0837 libemgdsrv_um.so.1.5.15.3226 | ||
2432 | 11 4.1825 libEMGD2d.so.1.5.15.3226 | ||
2433 | 9 3.4221 libfb.so | ||
2434 | 7 2.6616 libpthread-2.16.so | ||
2435 | 1 0.3802 libudev.so.0.9.3 | ||
2436 | 1 0.3802 libdrm.so.2.4.0 | ||
2437 | 1 0.3802 libextmod.so | ||
2438 | 1 0.3802 mouse_drv.so | ||
2439 | . | ||
2440 | . | ||
2441 | . | ||
2442 | 9 0.0015 connmand | ||
2443 | CPU_CLK_UNHALT...| | ||
2444 | samples| %| | ||
2445 | ------------------ | ||
2446 | 4 44.4444 libglib-2.0.so.0.3200.4 | ||
2447 | 2 22.2222 libpthread-2.16.so | ||
2448 | 1 11.1111 connmand | ||
2449 | 1 11.1111 libc-2.16.so | ||
2450 | 1 11.1111 librt-2.16.so | ||
2451 | 6 0.0010 oprofile-server | ||
2452 | CPU_CLK_UNHALT...| | ||
2453 | samples| %| | ||
2454 | ------------------ | ||
2455 | 3 50.0000 libc-2.16.so | ||
2456 | 1 16.6667 oprofile-server | ||
2457 | 1 16.6667 libpthread-2.16.so | ||
2458 | 1 16.6667 libglib-2.0.so.0.3200.4 | ||
2459 | 5 8.6e-04 gconfd-2 | ||
2460 | CPU_CLK_UNHALT...| | ||
2461 | samples| %| | ||
2462 | ------------------ | ||
2463 | 2 40.0000 libdbus-1.so.3.7.2 | ||
2464 | 2 40.0000 libglib-2.0.so.0.3200.4 | ||
2465 | 1 20.0000 libc-2.16.so | ||
2466 | </literallayout> | ||
2467 | The output above shows the breakdown or samples by both | ||
2468 | number of samples and percentage for each executable. | ||
2469 | Within an executable, the sample counts are broken down | ||
2470 | further into executable and shared libraries (DSOs) used | ||
2471 | by the executable. | ||
2472 | </para> | ||
2473 | |||
2474 | <para> | ||
2475 | To get even more detailed breakdowns by function, we need to | ||
2476 | have the full paths to the DSOs, which we can get by | ||
2477 | using -f with opreport: | ||
2478 | <literallayout class='monospaced'> | ||
2479 | root@crownbay:~# opreport -f | ||
2480 | |||
2481 | CPU: Intel Architectural Perfmon, speed 1.3e+06 MHz (estimated) | ||
2482 | Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000 | ||
2483 | CPU_CLK_UNHALT...| | ||
2484 | samples| %| | ||
2485 | |||
2486 | 464365 79.8156 /boot/vmlinux-3.4.11-yocto-standard | ||
2487 | 65108 11.1908 /usr/bin/oprofiled | ||
2488 | CPU_CLK_UNHALT...| | ||
2489 | samples| %| | ||
2490 | ------------------ | ||
2491 | 64416 98.9372 /usr/bin/oprofiled | ||
2492 | 692 1.0628 /lib/libc-2.16.so | ||
2493 | 36959 6.3526 /no-vmlinux | ||
2494 | 4378 0.7525 /bin/busybox | ||
2495 | CPU_CLK_UNHALT...| | ||
2496 | samples| %| | ||
2497 | ------------------ | ||
2498 | 2844 64.9612 /lib/libc-2.16.so | ||
2499 | 1337 30.5391 /bin/busybox | ||
2500 | 193 4.4084 /lib/ld-2.16.so | ||
2501 | 2 0.0457 /lib/libnss_compat-2.16.so | ||
2502 | 1 0.0228 /lib/libnsl-2.16.so | ||
2503 | 1 0.0228 /lib/libnss_files-2.16.so | ||
2504 | 4344 0.7467 /bin/bash | ||
2505 | CPU_CLK_UNHALT...| | ||
2506 | samples| %| | ||
2507 | ------------------ | ||
2508 | 2657 61.1648 /bin/bash | ||
2509 | 1665 38.3287 /lib/libc-2.16.so | ||
2510 | 18 0.4144 /lib/ld-2.16.so | ||
2511 | 3 0.0691 /lib/libtinfo.so.5.9 | ||
2512 | 1 0.0230 /lib/libdl-2.16.so | ||
2513 | . | ||
2514 | . | ||
2515 | . | ||
2516 | </literallayout> | ||
2517 | Using the paths shown in the above output and the -l option to | ||
2518 | opreport, we can see all the functions that have hits in the | ||
2519 | profile and their sample counts and percentages. Here's a | ||
2520 | portion of what we get for the kernel: | ||
2521 | <literallayout class='monospaced'> | ||
2522 | root@crownbay:~# opreport -l /boot/vmlinux-3.4.11-yocto-standard | ||
2523 | |||
2524 | CPU: Intel Architectural Perfmon, speed 1.3e+06 MHz (estimated) | ||
2525 | Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000 | ||
2526 | samples % symbol name | ||
2527 | 233981 50.3873 intel_idle | ||
2528 | 15437 3.3243 rb_get_reader_page | ||
2529 | 14503 3.1232 ring_buffer_consume | ||
2530 | 14092 3.0347 mutex_spin_on_owner | ||
2531 | 13024 2.8047 read_hpet | ||
2532 | 8039 1.7312 sub_preempt_count | ||
2533 | 7096 1.5281 ioread32 | ||
2534 | 6997 1.5068 add_preempt_count | ||
2535 | 3985 0.8582 rb_advance_reader | ||
2536 | 3488 0.7511 add_event_entry | ||
2537 | 3303 0.7113 get_parent_ip | ||
2538 | 3104 0.6684 rb_buffer_peek | ||
2539 | 2960 0.6374 op_cpu_buffer_read_entry | ||
2540 | 2614 0.5629 sync_buffer | ||
2541 | 2545 0.5481 debug_smp_processor_id | ||
2542 | 2456 0.5289 ohci_irq | ||
2543 | 2397 0.5162 memset | ||
2544 | 2349 0.5059 __copy_to_user_ll | ||
2545 | 2185 0.4705 ring_buffer_event_length | ||
2546 | 1918 0.4130 in_lock_functions | ||
2547 | 1850 0.3984 __schedule | ||
2548 | 1767 0.3805 __copy_from_user_ll_nozero | ||
2549 | 1575 0.3392 rb_event_data_length | ||
2550 | 1256 0.2705 memcpy | ||
2551 | 1233 0.2655 system_call | ||
2552 | 1213 0.2612 menu_select | ||
2553 | </literallayout> | ||
2554 | Notice that above we see an entry for the __copy_to_user_ll() | ||
2555 | function that we've looked at with other profilers as well. | ||
2556 | </para> | ||
2557 | |||
2558 | <para> | ||
2559 | Here's what we get when we do the same thing for the | ||
2560 | busybox executable: | ||
2561 | <literallayout class='monospaced'> | ||
2562 | CPU: Intel Architectural Perfmon, speed 1.3e+06 MHz (estimated) | ||
2563 | Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000 | ||
2564 | samples % image name symbol name | ||
2565 | 349 8.4198 busybox retrieve_file_data | ||
2566 | 308 7.4306 libc-2.16.so _IO_file_xsgetn | ||
2567 | 283 6.8275 libc-2.16.so __read_nocancel | ||
2568 | 235 5.6695 libc-2.16.so syscall | ||
2569 | 233 5.6212 libc-2.16.so clearerr | ||
2570 | 215 5.1870 libc-2.16.so fread | ||
2571 | 181 4.3667 libc-2.16.so __write_nocancel | ||
2572 | 158 3.8118 libc-2.16.so __underflow | ||
2573 | 151 3.6429 libc-2.16.so _dl_addr | ||
2574 | 150 3.6188 busybox progress_meter | ||
2575 | 150 3.6188 libc-2.16.so __poll_nocancel | ||
2576 | 148 3.5706 libc-2.16.so _IO_file_underflow@@GLIBC_2.1 | ||
2577 | 137 3.3052 busybox safe_poll | ||
2578 | 125 3.0157 busybox bb_progress_update | ||
2579 | 122 2.9433 libc-2.16.so __x86.get_pc_thunk.bx | ||
2580 | 95 2.2919 busybox full_write | ||
2581 | 81 1.9542 busybox safe_write | ||
2582 | 77 1.8577 busybox xwrite | ||
2583 | 72 1.7370 libc-2.16.so _IO_file_read | ||
2584 | 71 1.7129 libc-2.16.so _IO_sgetn | ||
2585 | 67 1.6164 libc-2.16.so poll | ||
2586 | 52 1.2545 libc-2.16.so _IO_switch_to_get_mode | ||
2587 | 45 1.0856 libc-2.16.so read | ||
2588 | 34 0.8203 libc-2.16.so write | ||
2589 | 32 0.7720 busybox monotonic_sec | ||
2590 | 25 0.6031 libc-2.16.so vfprintf | ||
2591 | 22 0.5308 busybox get_mono | ||
2592 | 14 0.3378 ld-2.16.so strcmp | ||
2593 | 14 0.3378 libc-2.16.so __x86.get_pc_thunk.cx | ||
2594 | . | ||
2595 | . | ||
2596 | . | ||
2597 | </literallayout> | ||
2598 | Since we recorded the profile with a callchain depth of 6, we | ||
2599 | should be able to see our __copy_to_user_ll() callchains in | ||
2600 | the output, and indeed we can if we search around a bit in | ||
2601 | the 'opreport --callgraph' output: | ||
2602 | <literallayout class='monospaced'> | ||
2603 | root@crownbay:~# opreport --callgraph /boot/vmlinux-3.4.11-yocto-standard | ||
2604 | |||
2605 | 392 6.9639 vmlinux-3.4.11-yocto-standard sock_aio_read | ||
2606 | 736 13.0751 vmlinux-3.4.11-yocto-standard __generic_file_aio_write | ||
2607 | 3255 57.8255 vmlinux-3.4.11-yocto-standard inet_recvmsg | ||
2608 | 785 0.1690 vmlinux-3.4.11-yocto-standard tcp_recvmsg | ||
2609 | 1790 31.7940 vmlinux-3.4.11-yocto-standard local_bh_enable | ||
2610 | 1238 21.9893 vmlinux-3.4.11-yocto-standard __kfree_skb | ||
2611 | 992 17.6199 vmlinux-3.4.11-yocto-standard lock_sock_nested | ||
2612 | 785 13.9432 vmlinux-3.4.11-yocto-standard tcp_recvmsg [self] | ||
2613 | 525 9.3250 vmlinux-3.4.11-yocto-standard release_sock | ||
2614 | 112 1.9893 vmlinux-3.4.11-yocto-standard tcp_cleanup_rbuf | ||
2615 | 72 1.2789 vmlinux-3.4.11-yocto-standard skb_copy_datagram_iovec | ||
2616 | |||
2617 | 170 0.0366 vmlinux-3.4.11-yocto-standard skb_copy_datagram_iovec | ||
2618 | 1491 73.3038 vmlinux-3.4.11-yocto-standard memcpy_toiovec | ||
2619 | 327 16.0767 vmlinux-3.4.11-yocto-standard skb_copy_datagram_iovec | ||
2620 | 170 8.3579 vmlinux-3.4.11-yocto-standard skb_copy_datagram_iovec [self] | ||
2621 | 20 0.9833 vmlinux-3.4.11-yocto-standard copy_to_user | ||
2622 | |||
2623 | 2588 98.2909 vmlinux-3.4.11-yocto-standard copy_to_user | ||
2624 | 2349 0.5059 vmlinux-3.4.11-yocto-standard __copy_to_user_ll | ||
2625 | 2349 89.2138 vmlinux-3.4.11-yocto-standard __copy_to_user_ll [self] | ||
2626 | 166 6.3046 vmlinux-3.4.11-yocto-standard do_page_fault | ||
2627 | </literallayout> | ||
2628 | Remember that by default OProfile sessions are cumulative | ||
2629 | i.e. if you start and stop a profiling session, then start a | ||
2630 | new one, the new one will not erase the previous run(s) but | ||
2631 | will build on it. If you want to restart a profile from scratch, | ||
2632 | you need to reset: | ||
2633 | <literallayout class='monospaced'> | ||
2634 | root@crownbay:~# opcontrol --reset | ||
2635 | </literallayout> | ||
2636 | </para> | ||
2637 | </section> | ||
2638 | |||
2639 | <section id='oprofileui-a-gui-for-oprofile'> | ||
2640 | <title>OProfileUI - A GUI for OProfile</title> | ||
2641 | |||
2642 | <para> | ||
2643 | Yocto also supports a graphical UI for controlling and viewing | ||
2644 | OProfile traces, called OProfileUI. To use it, you first need | ||
2645 | to clone the oprofileui git repo, then configure, build, and | ||
2646 | install it: | ||
2647 | <literallayout class='monospaced'> | ||
2648 | [trz@empanada tmp]$ git clone git://git.yoctoproject.org/oprofileui | ||
2649 | [trz@empanada tmp]$ cd oprofileui | ||
2650 | [trz@empanada oprofileui]$ ./autogen.sh | ||
2651 | [trz@empanada oprofileui]$ sudo make install | ||
2652 | </literallayout> | ||
2653 | OprofileUI replaces the 'opreport' functionality with a GUI, | ||
2654 | and normally doesn't require the user to use 'opcontrol' either. | ||
2655 | If you want to profile the kernel, however, you need to either | ||
2656 | use the UI to specify a vmlinux or use 'opcontrol' to specify | ||
2657 | it on the target: | ||
2658 | </para> | ||
2659 | |||
2660 | <para> | ||
2661 | First, on the target, check if vmlinux file: is set: | ||
2662 | <literallayout class='monospaced'> | ||
2663 | root@crownbay:~# opcontrol --status | ||
2664 | </literallayout> | ||
2665 | If not: | ||
2666 | <literallayout class='monospaced'> | ||
2667 | root@crownbay:~# opcontrol --shutdown | ||
2668 | root@crownbay:~# opcontrol --vmlinux=/boot/vmlinux-`uname -r` | ||
2669 | root@crownbay:~# opcontrol --start-daemon | ||
2670 | </literallayout> | ||
2671 | Now, start the oprofile UI on the host system: | ||
2672 | <literallayout class='monospaced'> | ||
2673 | [trz@empanada oprofileui]$ oprofile-viewer | ||
2674 | </literallayout> | ||
2675 | To run a profile on the remote system, first connect to the | ||
2676 | remote system by pressing the 'Connect' button and supplying | ||
2677 | the IP address and port of the remote system (the default | ||
2678 | port is 4224). | ||
2679 | </para> | ||
2680 | |||
2681 | <para> | ||
2682 | The oprofile server should automatically be started already. | ||
2683 | If not, the connection will fail and you either typed in the | ||
2684 | wrong IP address and port (see below), or you need to start | ||
2685 | the server yourself: | ||
2686 | <literallayout class='monospaced'> | ||
2687 | root@crownbay:~# oprofile-server | ||
2688 | </literallayout> | ||
2689 | Or, to specify a specific port: | ||
2690 | <literallayout class='monospaced'> | ||
2691 | root@crownbay:~# oprofile-server --port 8888 | ||
2692 | </literallayout> | ||
2693 | Once connected, press the 'Start' button and then run the | ||
2694 | wget workload on the remote system: | ||
2695 | <literallayout class='monospaced'> | ||
2696 | root@crownbay:~# rm linux-2.6.19.2.tar.bz2; wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>; sync | ||
2697 | Connecting to downloads.yoctoproject.org (140.211.169.59:80) | ||
2698 | linux-2.6.19.2.tar.b 100% |*******************************| 41727k 0:00:00 ETA | ||
2699 | </literallayout> | ||
2700 | Once the workload completes, press the 'Stop' button. At that | ||
2701 | point the OProfile viewer will download the profile files it's | ||
2702 | collected (this may take some time, especially if the kernel | ||
2703 | was profiled). While it downloads the files, you should see | ||
2704 | something like the following: | ||
2705 | </para> | ||
2706 | |||
2707 | <para> | ||
2708 | <imagedata fileref="figures/oprofileui-downloading.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
2709 | </para> | ||
2710 | |||
2711 | <para> | ||
2712 | Once the profile files have been retrieved, you should see a | ||
2713 | list of the processes that were profiled: | ||
2714 | </para> | ||
2715 | |||
2716 | <para> | ||
2717 | <imagedata fileref="figures/oprofileui-processes.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
2718 | </para> | ||
2719 | |||
2720 | <para> | ||
2721 | If you select one of them, you should see all the symbols that | ||
2722 | were hit during the profile. Selecting one of them will show a | ||
2723 | list of callers and callees of the chosen function in two | ||
2724 | panes below the top pane. For example, here's what we see | ||
2725 | when we select __copy_to_user_ll(): | ||
2726 | </para> | ||
2727 | |||
2728 | <para> | ||
2729 | <imagedata fileref="figures/oprofileui-copy-to-user.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
2730 | </para> | ||
2731 | |||
2732 | <para> | ||
2733 | As another example, we can look at the busybox process and see | ||
2734 | that the progress meter made a system call: | ||
2735 | </para> | ||
2736 | |||
2737 | <para> | ||
2738 | <imagedata fileref="figures/oprofileui-busybox.png" width="6in" depth="7in" align="center" scalefit="1" /> | ||
2739 | </para> | ||
2740 | </section> | ||
2741 | |||
2742 | <section id='oprofile-documentation'> | ||
2743 | <title>Documentation</title> | ||
2744 | |||
2745 | <para> | ||
2746 | Yocto already has some information on setting up and using | ||
2747 | OProfile and oprofileui. As this document doesn't cover | ||
2748 | everything in detail, it may be worth taking a look at the | ||
2749 | "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-oprofile'>Profiling with OProfile</ulink>" | ||
2750 | section in the Yocto Project Development Manual | ||
2751 | </para> | ||
2752 | |||
2753 | <para> | ||
2754 | The OProfile manual can be found here: | ||
2755 | <ulink url='http://oprofile.sourceforge.net/doc/index.html'>OProfile manual</ulink> | ||
2756 | </para> | ||
2757 | |||
2758 | <para> | ||
2759 | The OProfile website contains links to the above manual and | ||
2760 | bunch of other items including an extensive set of examples: | ||
2761 | <ulink url='http://oprofile.sourceforge.net/about/'>About OProfile</ulink> | ||
2762 | </para> | ||
2763 | </section> | ||
2764 | </section> | ||
2765 | |||
2766 | <section id='profile-manual-sysprof'> | ||
2767 | <title>Sysprof</title> | ||
2768 | |||
2769 | <para> | ||
2770 | Sysprof is a very easy to use system-wide profiler that consists | ||
2771 | of a single window with three panes and a few buttons which allow | ||
2772 | you to start, stop, and view the profile from one place. | ||
2773 | </para> | ||
2774 | |||
2775 | <section id='sysprof-setup'> | ||
2776 | <title>Setup</title> | ||
2777 | |||
2778 | <para> | ||
2779 | For this section, we'll assume you've already performed the | ||
2780 | basic setup outlined in the General Setup section. | ||
2781 | </para> | ||
2782 | |||
2783 | <para> | ||
2784 | Sysprof is a GUI-based application that runs on the target | ||
2785 | system. For the rest of this document we assume you've | ||
2786 | ssh'ed to the host and will be running Sysprof on the | ||
2787 | target (you can use the '-X' option to ssh and have the | ||
2788 | Sysprof GUI run on the target but display remotely on the | ||
2789 | host if you want). | ||
2790 | </para> | ||
2791 | </section> | ||
2792 | |||
2793 | <section id='sysprof-basic-usage'> | ||
2794 | <title>Basic Usage</title> | ||
2795 | |||
2796 | <para> | ||
2797 | To start profiling the system, you simply press the 'Start' | ||
2798 | button. To stop profiling and to start viewing the profile data | ||
2799 | in one easy step, press the 'Profile' button. | ||
2800 | </para> | ||
2801 | |||
2802 | <para> | ||
2803 | Once you've pressed the profile button, the three panes will | ||
2804 | fill up with profiling data: | ||
2805 | </para> | ||
2806 | |||
2807 | <para> | ||
2808 | <imagedata fileref="figures/sysprof-copy-to-user.png" width="6in" depth="4in" align="center" scalefit="1" /> | ||
2809 | </para> | ||
2810 | |||
2811 | <para> | ||
2812 | The left pane shows a list of functions and processes. | ||
2813 | Selecting one of those expands that function in the right | ||
2814 | pane, showing all its callees. Note that this caller-oriented | ||
2815 | display is essentially the inverse of perf's default | ||
2816 | callee-oriented callchain display. | ||
2817 | </para> | ||
2818 | |||
2819 | <para> | ||
2820 | In the screenshot above, we're focusing on __copy_to_user_ll() | ||
2821 | and looking up the callchain we can see that one of the callers | ||
2822 | of __copy_to_user_ll is sys_read() and the complete callpath | ||
2823 | between them. Notice that this is essentially a portion of the | ||
2824 | same information we saw in the perf display shown in the perf | ||
2825 | section of this page. | ||
2826 | </para> | ||
2827 | |||
2828 | <para> | ||
2829 | <imagedata fileref="figures/sysprof-copy-from-user.png" width="6in" depth="4in" align="center" scalefit="1" /> | ||
2830 | </para> | ||
2831 | |||
2832 | <para> | ||
2833 | Similarly, the above is a snapshot of the Sysprof display of a | ||
2834 | copy-from-user callchain. | ||
2835 | </para> | ||
2836 | |||
2837 | <para> | ||
2838 | Finally, looking at the third Sysprof pane in the lower left, | ||
2839 | we can see a list of all the callers of a particular function | ||
2840 | selected in the top left pane. In this case, the lower pane is | ||
2841 | showing all the callers of __mark_inode_dirty: | ||
2842 | </para> | ||
2843 | |||
2844 | <para> | ||
2845 | <imagedata fileref="figures/sysprof-callers.png" width="6in" depth="4in" align="center" scalefit="1" /> | ||
2846 | </para> | ||
2847 | |||
2848 | <para> | ||
2849 | Double-clicking on one of those functions will in turn change the | ||
2850 | focus to the selected function, and so on. | ||
2851 | </para> | ||
2852 | |||
2853 | <informalexample> | ||
2854 | <emphasis>Tying it Together:</emphasis> If you like sysprof's 'caller-oriented' | ||
2855 | display, you may be able to approximate it in other tools as | ||
2856 | well. For example, 'perf report' has the -g (--call-graph) | ||
2857 | option that you can experiment with; one of the options is | ||
2858 | 'caller' for an inverted caller-based callgraph display. | ||
2859 | </informalexample> | ||
2860 | </section> | ||
2861 | |||
2862 | <section id='sysprof-documentation'> | ||
2863 | <title>Documentation</title> | ||
2864 | |||
2865 | <para> | ||
2866 | There doesn't seem to be any documentation for Sysprof, but | ||
2867 | maybe that's because it's pretty self-explanatory. | ||
2868 | The Sysprof website, however, is here: | ||
2869 | <ulink url='http://sysprof.com/'>Sysprof, System-wide Performance Profiler for Linux</ulink> | ||
2870 | </para> | ||
2871 | </section> | ||
2872 | </section> | ||
2873 | |||
2874 | <section id='lttng-linux-trace-toolkit-next-generation'> | ||
2875 | <title>LTTng (Linux Trace Toolkit, next generation)</title> | ||
2876 | |||
2877 | <section id='lttng-setup'> | ||
2878 | <title>Setup</title> | ||
2879 | |||
2880 | <para> | ||
2881 | For this section, we'll assume you've already performed the | ||
2882 | basic setup outlined in the General Setup section. | ||
2883 | </para> | ||
2884 | |||
2885 | <para> | ||
2886 | LTTng is run on the target system by ssh'ing to it. | ||
2887 | However, if you want to see the traces graphically, | ||
2888 | install Eclipse as described in section | ||
2889 | "<link linkend='manually-copying-a-trace-to-the-host-and-viewing-it-in-eclipse'>Manually copying a trace to the host and viewing it in Eclipse (i.e. using Eclipse without network support)</link>" | ||
2890 | and follow the directions to manually copy traces to the host and | ||
2891 | view them in Eclipse (i.e. using Eclipse without network support). | ||
2892 | </para> | ||
2893 | |||
2894 | <note> | ||
2895 | Be sure to download and install/run the 'SR1' or later Juno release | ||
2896 | of eclipse e.g.: | ||
2897 | <ulink url='http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/juno/SR1/eclipse-cpp-juno-SR1-linux-gtk-x86_64.tar.gz'>http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/juno/SR1/eclipse-cpp-juno-SR1-linux-gtk-x86_64.tar.gz</ulink> | ||
2898 | </note> | ||
2899 | </section> | ||
2900 | |||
2901 | <section id='collecting-and-viewing-traces'> | ||
2902 | <title>Collecting and Viewing Traces</title> | ||
2903 | |||
2904 | <para> | ||
2905 | Once you've applied the above commits and built and booted your | ||
2906 | image (you need to build the core-image-sato-sdk image or use one of the | ||
2907 | other methods described in the General Setup section), you're | ||
2908 | ready to start tracing. | ||
2909 | </para> | ||
2910 | |||
2911 | <section id='collecting-and-viewing-a-trace-on-the-target-inside-a-shell'> | ||
2912 | <title>Collecting and viewing a trace on the target (inside a shell)</title> | ||
2913 | |||
2914 | <para> | ||
2915 | First, from the host, ssh to the target: | ||
2916 | <literallayout class='monospaced'> | ||
2917 | $ ssh -l root 192.168.1.47 | ||
2918 | The authenticity of host '192.168.1.47 (192.168.1.47)' can't be established. | ||
2919 | RSA key fingerprint is 23:bd:c8:b1:a8:71:52:00:ee:00:4f:64:9e:10:b9:7e. | ||
2920 | Are you sure you want to continue connecting (yes/no)? yes | ||
2921 | Warning: Permanently added '192.168.1.47' (RSA) to the list of known hosts. | ||
2922 | root@192.168.1.47's password: | ||
2923 | </literallayout> | ||
2924 | Once on the target, use these steps to create a trace: | ||
2925 | <literallayout class='monospaced'> | ||
2926 | root@crownbay:~# lttng create | ||
2927 | Spawning a session daemon | ||
2928 | Session auto-20121015-232120 created. | ||
2929 | Traces will be written in /home/root/lttng-traces/auto-20121015-232120 | ||
2930 | </literallayout> | ||
2931 | Enable the events you want to trace (in this case all | ||
2932 | kernel events): | ||
2933 | <literallayout class='monospaced'> | ||
2934 | root@crownbay:~# lttng enable-event --kernel --all | ||
2935 | All kernel events are enabled in channel channel0 | ||
2936 | </literallayout> | ||
2937 | Start the trace: | ||
2938 | <literallayout class='monospaced'> | ||
2939 | root@crownbay:~# lttng start | ||
2940 | Tracing started for session auto-20121015-232120 | ||
2941 | </literallayout> | ||
2942 | And then stop the trace after awhile or after running | ||
2943 | a particular workload that you want to trace: | ||
2944 | <literallayout class='monospaced'> | ||
2945 | root@crownbay:~# lttng stop | ||
2946 | Tracing stopped for session auto-20121015-232120 | ||
2947 | </literallayout> | ||
2948 | You can now view the trace in text form on the target: | ||
2949 | <literallayout class='monospaced'> | ||
2950 | root@crownbay:~# lttng view | ||
2951 | [23:21:56.989270399] (+?.?????????) sys_geteuid: { 1 }, { } | ||
2952 | [23:21:56.989278081] (+0.000007682) exit_syscall: { 1 }, { ret = 0 } | ||
2953 | [23:21:56.989286043] (+0.000007962) sys_pipe: { 1 }, { fildes = 0xB77B9E8C } | ||
2954 | [23:21:56.989321802] (+0.000035759) exit_syscall: { 1 }, { ret = 0 } | ||
2955 | [23:21:56.989329345] (+0.000007543) sys_mmap_pgoff: { 1 }, { addr = 0x0, len = 10485760, prot = 3, flags = 131362, fd = 4294967295, pgoff = 0 } | ||
2956 | [23:21:56.989351694] (+0.000022349) exit_syscall: { 1 }, { ret = -1247805440 } | ||
2957 | [23:21:56.989432989] (+0.000081295) sys_clone: { 1 }, { clone_flags = 0x411, newsp = 0xB5EFFFE4, parent_tid = 0xFFFFFFFF, child_tid = 0x0 } | ||
2958 | [23:21:56.989477129] (+0.000044140) sched_stat_runtime: { 1 }, { comm = "lttng-consumerd", tid = 1193, runtime = 681660, vruntime = 43367983388 } | ||
2959 | [23:21:56.989486697] (+0.000009568) sched_migrate_task: { 1 }, { comm = "lttng-consumerd", tid = 1193, prio = 20, orig_cpu = 1, dest_cpu = 1 } | ||
2960 | [23:21:56.989508418] (+0.000021721) hrtimer_init: { 1 }, { hrtimer = 3970832076, clockid = 1, mode = 1 } | ||
2961 | [23:21:56.989770462] (+0.000262044) hrtimer_cancel: { 1 }, { hrtimer = 3993865440 } | ||
2962 | [23:21:56.989771580] (+0.000001118) hrtimer_cancel: { 0 }, { hrtimer = 3993812192 } | ||
2963 | [23:21:56.989776957] (+0.000005377) hrtimer_expire_entry: { 1 }, { hrtimer = 3993865440, now = 79815980007057, function = 3238465232 } | ||
2964 | [23:21:56.989778145] (+0.000001188) hrtimer_expire_entry: { 0 }, { hrtimer = 3993812192, now = 79815980008174, function = 3238465232 } | ||
2965 | [23:21:56.989791695] (+0.000013550) softirq_raise: { 1 }, { vec = 1 } | ||
2966 | [23:21:56.989795396] (+0.000003701) softirq_raise: { 0 }, { vec = 1 } | ||
2967 | [23:21:56.989800635] (+0.000005239) softirq_raise: { 0 }, { vec = 9 } | ||
2968 | [23:21:56.989807130] (+0.000006495) sched_stat_runtime: { 1 }, { comm = "lttng-consumerd", tid = 1193, runtime = 330710, vruntime = 43368314098 } | ||
2969 | [23:21:56.989809993] (+0.000002863) sched_stat_runtime: { 0 }, { comm = "lttng-sessiond", tid = 1181, runtime = 1015313, vruntime = 36976733240 } | ||
2970 | [23:21:56.989818514] (+0.000008521) hrtimer_expire_exit: { 0 }, { hrtimer = 3993812192 } | ||
2971 | [23:21:56.989819631] (+0.000001117) hrtimer_expire_exit: { 1 }, { hrtimer = 3993865440 } | ||
2972 | [23:21:56.989821866] (+0.000002235) hrtimer_start: { 0 }, { hrtimer = 3993812192, function = 3238465232, expires = 79815981000000, softexpires = 79815981000000 } | ||
2973 | [23:21:56.989822984] (+0.000001118) hrtimer_start: { 1 }, { hrtimer = 3993865440, function = 3238465232, expires = 79815981000000, softexpires = 79815981000000 } | ||
2974 | [23:21:56.989832762] (+0.000009778) softirq_entry: { 1 }, { vec = 1 } | ||
2975 | [23:21:56.989833879] (+0.000001117) softirq_entry: { 0 }, { vec = 1 } | ||
2976 | [23:21:56.989838069] (+0.000004190) timer_cancel: { 1 }, { timer = 3993871956 } | ||
2977 | [23:21:56.989839187] (+0.000001118) timer_cancel: { 0 }, { timer = 3993818708 } | ||
2978 | [23:21:56.989841492] (+0.000002305) timer_expire_entry: { 1 }, { timer = 3993871956, now = 79515980, function = 3238277552 } | ||
2979 | [23:21:56.989842819] (+0.000001327) timer_expire_entry: { 0 }, { timer = 3993818708, now = 79515980, function = 3238277552 } | ||
2980 | [23:21:56.989854831] (+0.000012012) sched_stat_runtime: { 1 }, { comm = "lttng-consumerd", tid = 1193, runtime = 49237, vruntime = 43368363335 } | ||
2981 | [23:21:56.989855949] (+0.000001118) sched_stat_runtime: { 0 }, { comm = "lttng-sessiond", tid = 1181, runtime = 45121, vruntime = 36976778361 } | ||
2982 | [23:21:56.989861257] (+0.000005308) sched_stat_sleep: { 1 }, { comm = "kworker/1:1", tid = 21, delay = 9451318 } | ||
2983 | [23:21:56.989862374] (+0.000001117) sched_stat_sleep: { 0 }, { comm = "kworker/0:0", tid = 4, delay = 9958820 } | ||
2984 | [23:21:56.989868241] (+0.000005867) sched_wakeup: { 0 }, { comm = "kworker/0:0", tid = 4, prio = 120, success = 1, target_cpu = 0 } | ||
2985 | [23:21:56.989869358] (+0.000001117) sched_wakeup: { 1 }, { comm = "kworker/1:1", tid = 21, prio = 120, success = 1, target_cpu = 1 } | ||
2986 | [23:21:56.989877460] (+0.000008102) timer_expire_exit: { 1 }, { timer = 3993871956 } | ||
2987 | [23:21:56.989878577] (+0.000001117) timer_expire_exit: { 0 }, { timer = 3993818708 } | ||
2988 | . | ||
2989 | . | ||
2990 | . | ||
2991 | </literallayout> | ||
2992 | You can now safely destroy the trace session (note that | ||
2993 | this doesn't delete the trace - it's still there | ||
2994 | in ~/lttng-traces): | ||
2995 | <literallayout class='monospaced'> | ||
2996 | root@crownbay:~# lttng destroy | ||
2997 | Session auto-20121015-232120 destroyed at /home/root | ||
2998 | </literallayout> | ||
2999 | Note that the trace is saved in a directory of the same | ||
3000 | name as returned by 'lttng create', under the ~/lttng-traces | ||
3001 | directory (note that you can change this by supplying your | ||
3002 | own name to 'lttng create'): | ||
3003 | <literallayout class='monospaced'> | ||
3004 | root@crownbay:~# ls -al ~/lttng-traces | ||
3005 | drwxrwx--- 3 root root 1024 Oct 15 23:21 . | ||
3006 | drwxr-xr-x 5 root root 1024 Oct 15 23:57 .. | ||
3007 | drwxrwx--- 3 root root 1024 Oct 15 23:21 auto-20121015-232120 | ||
3008 | </literallayout> | ||
3009 | </para> | ||
3010 | </section> | ||
3011 | |||
3012 | <section id='collecting-and-viewing-a-userspace-trace-on-the-target-inside-a-shell'> | ||
3013 | <title>Collecting and viewing a userspace trace on the target (inside a shell)</title> | ||
3014 | |||
3015 | <para> | ||
3016 | For LTTng userspace tracing, you need to have a properly | ||
3017 | instrumented userspace program. For this example, we'll use | ||
3018 | the 'hello' test program generated by the lttng-ust build. | ||
3019 | </para> | ||
3020 | |||
3021 | <para> | ||
3022 | The 'hello' test program isn't installed on the rootfs by | ||
3023 | the lttng-ust build, so we need to copy it over manually. | ||
3024 | First cd into the build directory that contains the hello | ||
3025 | executable: | ||
3026 | <literallayout class='monospaced'> | ||
3027 | $ cd build/tmp/work/core2_32-poky-linux/lttng-ust/2.0.5-r0/git/tests/hello/.libs | ||
3028 | </literallayout> | ||
3029 | Copy that over to the target machine: | ||
3030 | <literallayout class='monospaced'> | ||
3031 | $ scp hello root@192.168.1.20: | ||
3032 | </literallayout> | ||
3033 | You now have the instrumented lttng 'hello world' test | ||
3034 | program on the target, ready to test. | ||
3035 | </para> | ||
3036 | |||
3037 | <para> | ||
3038 | First, from the host, ssh to the target: | ||
3039 | <literallayout class='monospaced'> | ||
3040 | $ ssh -l root 192.168.1.47 | ||
3041 | The authenticity of host '192.168.1.47 (192.168.1.47)' can't be established. | ||
3042 | RSA key fingerprint is 23:bd:c8:b1:a8:71:52:00:ee:00:4f:64:9e:10:b9:7e. | ||
3043 | Are you sure you want to continue connecting (yes/no)? yes | ||
3044 | Warning: Permanently added '192.168.1.47' (RSA) to the list of known hosts. | ||
3045 | root@192.168.1.47's password: | ||
3046 | </literallayout> | ||
3047 | Once on the target, use these steps to create a trace: | ||
3048 | <literallayout class='monospaced'> | ||
3049 | root@crownbay:~# lttng create | ||
3050 | Session auto-20190303-021943 created. | ||
3051 | Traces will be written in /home/root/lttng-traces/auto-20190303-021943 | ||
3052 | </literallayout> | ||
3053 | Enable the events you want to trace (in this case all | ||
3054 | userspace events): | ||
3055 | <literallayout class='monospaced'> | ||
3056 | root@crownbay:~# lttng enable-event --userspace --all | ||
3057 | All UST events are enabled in channel channel0 | ||
3058 | </literallayout> | ||
3059 | Start the trace: | ||
3060 | <literallayout class='monospaced'> | ||
3061 | root@crownbay:~# lttng start | ||
3062 | Tracing started for session auto-20190303-021943 | ||
3063 | </literallayout> | ||
3064 | Run the instrumented hello world program: | ||
3065 | <literallayout class='monospaced'> | ||
3066 | root@crownbay:~# ./hello | ||
3067 | Hello, World! | ||
3068 | Tracing... done. | ||
3069 | </literallayout> | ||
3070 | And then stop the trace after awhile or after running a | ||
3071 | particular workload that you want to trace: | ||
3072 | <literallayout class='monospaced'> | ||
3073 | root@crownbay:~# lttng stop | ||
3074 | Tracing stopped for session auto-20190303-021943 | ||
3075 | </literallayout> | ||
3076 | You can now view the trace in text form on the target: | ||
3077 | <literallayout class='monospaced'> | ||
3078 | root@crownbay:~# lttng view | ||
3079 | [02:31:14.906146544] (+?.?????????) hello:1424 ust_tests_hello:tptest: { cpu_id = 1 }, { intfield = 0, intfield2 = 0x0, longfield = 0, netintfield = 0, netintfieldhex = 0x0, arrfield1 = [ [0] = 1, [1] = 2, [2] = 3 ], arrfield2 = "test", _seqfield1_length = 4, seqfield1 = [ [0] = 116, [1] = 101, [2] = 115, [3] = 116 ], _seqfield2_length = 4, seqfield2 = "test", stringfield = "test", floatfield = 2222, doublefield = 2, boolfield = 1 } | ||
3080 | [02:31:14.906170360] (+0.000023816) hello:1424 ust_tests_hello:tptest: { cpu_id = 1 }, { intfield = 1, intfield2 = 0x1, longfield = 1, netintfield = 1, netintfieldhex = 0x1, arrfield1 = [ [0] = 1, [1] = 2, [2] = 3 ], arrfield2 = "test", _seqfield1_length = 4, seqfield1 = [ [0] = 116, [1] = 101, [2] = 115, [3] = 116 ], _seqfield2_length = 4, seqfield2 = "test", stringfield = "test", floatfield = 2222, doublefield = 2, boolfield = 1 } | ||
3081 | [02:31:14.906183140] (+0.000012780) hello:1424 ust_tests_hello:tptest: { cpu_id = 1 }, { intfield = 2, intfield2 = 0x2, longfield = 2, netintfield = 2, netintfieldhex = 0x2, arrfield1 = [ [0] = 1, [1] = 2, [2] = 3 ], arrfield2 = "test", _seqfield1_length = 4, seqfield1 = [ [0] = 116, [1] = 101, [2] = 115, [3] = 116 ], _seqfield2_length = 4, seqfield2 = "test", stringfield = "test", floatfield = 2222, doublefield = 2, boolfield = 1 } | ||
3082 | [02:31:14.906194385] (+0.000011245) hello:1424 ust_tests_hello:tptest: { cpu_id = 1 }, { intfield = 3, intfield2 = 0x3, longfield = 3, netintfield = 3, netintfieldhex = 0x3, arrfield1 = [ [0] = 1, [1] = 2, [2] = 3 ], arrfield2 = "test", _seqfield1_length = 4, seqfield1 = [ [0] = 116, [1] = 101, [2] = 115, [3] = 116 ], _seqfield2_length = 4, seqfield2 = "test", stringfield = "test", floatfield = 2222, doublefield = 2, boolfield = 1 } | ||
3083 | . | ||
3084 | . | ||
3085 | . | ||
3086 | </literallayout> | ||
3087 | You can now safely destroy the trace session (note that | ||
3088 | this doesn't delete the trace - it's still | ||
3089 | there in ~/lttng-traces): | ||
3090 | <literallayout class='monospaced'> | ||
3091 | root@crownbay:~# lttng destroy | ||
3092 | Session auto-20190303-021943 destroyed at /home/root | ||
3093 | </literallayout> | ||
3094 | </para> | ||
3095 | </section> | ||
3096 | |||
3097 | <section id='manually-copying-a-trace-to-the-host-and-viewing-it-in-eclipse'> | ||
3098 | <title>Manually copying a trace to the host and viewing it in Eclipse (i.e. using Eclipse without network support)</title> | ||
3099 | |||
3100 | <para> | ||
3101 | If you already have an LTTng trace on a remote target and | ||
3102 | would like to view it in Eclipse on the host, you can easily | ||
3103 | copy it from the target to the host and import it into | ||
3104 | Eclipse to view it using the LTTng Eclipse plug-in already | ||
3105 | bundled in the Eclipse (Juno SR1 or greater). | ||
3106 | </para> | ||
3107 | |||
3108 | <para> | ||
3109 | Using the trace we created in the previous section, archive | ||
3110 | it and copy it to your host system: | ||
3111 | <literallayout class='monospaced'> | ||
3112 | root@crownbay:~/lttng-traces# tar zcvf auto-20121015-232120.tar.gz auto-20121015-232120 | ||
3113 | auto-20121015-232120/ | ||
3114 | auto-20121015-232120/kernel/ | ||
3115 | auto-20121015-232120/kernel/metadata | ||
3116 | auto-20121015-232120/kernel/channel0_1 | ||
3117 | auto-20121015-232120/kernel/channel0_0 | ||
3118 | |||
3119 | $ scp root@192.168.1.47:lttng-traces/auto-20121015-232120.tar.gz . | ||
3120 | root@192.168.1.47's password: | ||
3121 | auto-20121015-232120.tar.gz 100% 1566KB 1.5MB/s 00:01 | ||
3122 | </literallayout> | ||
3123 | Unarchive it on the host: | ||
3124 | <literallayout class='monospaced'> | ||
3125 | $ gunzip -c auto-20121015-232120.tar.gz | tar xvf - | ||
3126 | auto-20121015-232120/ | ||
3127 | auto-20121015-232120/kernel/ | ||
3128 | auto-20121015-232120/kernel/metadata | ||
3129 | auto-20121015-232120/kernel/channel0_1 | ||
3130 | auto-20121015-232120/kernel/channel0_0 | ||
3131 | </literallayout> | ||
3132 | We can now import the trace into Eclipse and view it: | ||
3133 | <orderedlist> | ||
3134 | <listitem><para>First, start eclipse and open the | ||
3135 | 'LTTng Kernel' perspective by selecting the following | ||
3136 | menu item: | ||
3137 | <literallayout class='monospaced'> | ||
3138 | Window | Open Perspective | Other... | ||
3139 | </literallayout></para></listitem> | ||
3140 | <listitem><para>In the dialog box that opens, select | ||
3141 | 'LTTng Kernel' from the list.</para></listitem> | ||
3142 | <listitem><para>Back at the main menu, select the | ||
3143 | following menu item: | ||
3144 | <literallayout class='monospaced'> | ||
3145 | File | New | Project... | ||
3146 | </literallayout></para></listitem> | ||
3147 | <listitem><para>In the dialog box that opens, select | ||
3148 | the 'Tracing | Tracing Project' wizard and press | ||
3149 | 'Next>'.</para></listitem> | ||
3150 | <listitem><para>Give the project a name and press | ||
3151 | 'Finish'.</para></listitem> | ||
3152 | <listitem><para>In the 'Project Explorer' pane under | ||
3153 | the project you created, right click on the | ||
3154 | 'Traces' item.</para></listitem> | ||
3155 | <listitem><para>Select 'Import..." and in the dialog | ||
3156 | that's displayed:</para></listitem> | ||
3157 | <listitem><para>Browse the filesystem and find the | ||
3158 | select the 'kernel' directory containing the trace | ||
3159 | you copied from the target | ||
3160 | e.g. auto-20121015-232120/kernel</para></listitem> | ||
3161 | <listitem><para>'Checkmark' the directory in the tree | ||
3162 | that's displayed for the trace</para></listitem> | ||
3163 | <listitem><para>Below that, select 'Common Trace Format: | ||
3164 | Kernel Trace' for the 'Trace Type'</para></listitem> | ||
3165 | <listitem><para>Press 'Finish' to close the dialog | ||
3166 | </para></listitem> | ||
3167 | <listitem><para>Back in the 'Project Explorer' pane, | ||
3168 | double-click on the 'kernel' item for the | ||
3169 | trace you just imported under 'Traces' | ||
3170 | </para></listitem> | ||
3171 | </orderedlist> | ||
3172 | You should now see your trace data displayed graphically | ||
3173 | in several different views in Eclipse: | ||
3174 | </para> | ||
3175 | |||
3176 | <para> | ||
3177 | <imagedata fileref="figures/lttngmain0.png" width="6in" depth="6in" align="center" scalefit="1" /> | ||
3178 | </para> | ||
3179 | |||
3180 | <para> | ||
3181 | You can access extensive help information on how to use | ||
3182 | the LTTng plug-in to search and analyze captured traces via | ||
3183 | the Eclipse help system: | ||
3184 | <literallayout class='monospaced'> | ||
3185 | Help | Help Contents | LTTng Plug-in User Guide | ||
3186 | </literallayout> | ||
3187 | </para> | ||
3188 | </section> | ||
3189 | |||
3190 | <section id='collecting-and-viewing-a-trace-in-eclipse'> | ||
3191 | <title>Collecting and viewing a trace in Eclipse</title> | ||
3192 | |||
3193 | <note> | ||
3194 | This section on collecting traces remotely doesn't currently | ||
3195 | work because of Eclipse 'RSE' connectivity problems. Manually | ||
3196 | tracing on the target, copying the trace files to the host, | ||
3197 | and viewing the trace in Eclipse on the host as outlined in | ||
3198 | previous steps does work however - please use the manual | ||
3199 | steps outlined above to view traces in Eclipse. | ||
3200 | </note> | ||
3201 | |||
3202 | <para> | ||
3203 | In order to trace a remote target, you also need to add | ||
3204 | a 'tracing' group on the target and connect as a user | ||
3205 | who's part of that group e.g: | ||
3206 | <literallayout class='monospaced'> | ||
3207 | # adduser tomz | ||
3208 | # groupadd -r tracing | ||
3209 | # usermod -a -G tracing tomz | ||
3210 | </literallayout> | ||
3211 | <orderedlist> | ||
3212 | <listitem><para>First, start eclipse and open the | ||
3213 | 'LTTng Kernel' perspective by selecting the following | ||
3214 | menu item: | ||
3215 | <literallayout class='monospaced'> | ||
3216 | Window | Open Perspective | Other... | ||
3217 | </literallayout></para></listitem> | ||
3218 | <listitem><para>In the dialog box that opens, select | ||
3219 | 'LTTng Kernel' from the list.</para></listitem> | ||
3220 | <listitem><para>Back at the main menu, select the | ||
3221 | following menu item: | ||
3222 | <literallayout class='monospaced'> | ||
3223 | File | New | Project... | ||
3224 | </literallayout></para></listitem> | ||
3225 | <listitem><para>In the dialog box that opens, select | ||
3226 | the 'Tracing | Tracing Project' wizard and | ||
3227 | press 'Next>'.</para></listitem> | ||
3228 | <listitem><para>Give the project a name and press | ||
3229 | 'Finish'. That should result in an entry in the | ||
3230 | 'Project' subwindow.</para></listitem> | ||
3231 | <listitem><para>In the 'Control' subwindow just below | ||
3232 | it, press 'New Connection'.</para></listitem> | ||
3233 | <listitem><para>Add a new connection, giving it the | ||
3234 | hostname or IP address of the target system. | ||
3235 | </para></listitem> | ||
3236 | <listitem><para>Provide the username and password | ||
3237 | of a qualified user (a member of the 'tracing' group) | ||
3238 | or root account on the target system. | ||
3239 | </para></listitem> | ||
3240 | <listitem><para>Provide appropriate answers to whatever | ||
3241 | else is asked for e.g. 'secure storage password' | ||
3242 | can be anything you want. | ||
3243 | If you get an 'RSE Error' it may be due to proxies. | ||
3244 | It may be possible to get around the problem by | ||
3245 | changing the following setting: | ||
3246 | <literallayout class='monospaced'> | ||
3247 | Window | Preferences | Network Connections | ||
3248 | </literallayout> | ||
3249 | Switch 'Active Provider' to 'Direct' | ||
3250 | </para></listitem> | ||
3251 | </orderedlist> | ||
3252 | </para> | ||
3253 | </section> | ||
3254 | </section> | ||
3255 | |||
3256 | <section id='lltng-documentation'> | ||
3257 | <title>Documentation</title> | ||
3258 | |||
3259 | <para> | ||
3260 | There doesn't seem to be any current documentation covering | ||
3261 | LTTng 2.0, but maybe that's because the project is in transition. | ||
3262 | The LTTng 2.0 website, however, is here: | ||
3263 | <ulink url='http://lttng.org/lttng2.0'>LTTng Project</ulink> | ||
3264 | </para> | ||
3265 | |||
3266 | <para> | ||
3267 | You can access extensive help information on how to use the | ||
3268 | LTTng plug-in to search and analyze captured traces via the | ||
3269 | Eclipse help system: | ||
3270 | <literallayout class='monospaced'> | ||
3271 | Help | Help Contents | LTTng Plug-in User Guide | ||
3272 | </literallayout> | ||
3273 | </para> | ||
3274 | </section> | ||
3275 | </section> | ||
3276 | |||
3277 | <section id='profile-manual-blktrace'> | ||
3278 | <title>blktrace</title> | ||
3279 | |||
3280 | <para> | ||
3281 | blktrace is a tool for tracing and reporting low-level disk I/O. | ||
3282 | blktrace provides the tracing half of the equation; its output can | ||
3283 | be piped into the blkparse program, which renders the data in a | ||
3284 | human-readable form and does some basic analysis: | ||
3285 | </para> | ||
3286 | |||
3287 | <section id='blktrace-setup'> | ||
3288 | <title>Setup</title> | ||
3289 | |||
3290 | <para> | ||
3291 | For this section, we'll assume you've already performed the | ||
3292 | basic setup outlined in the | ||
3293 | "<link linkend='profile-manual-general-setup'>General Setup</link>" | ||
3294 | section. | ||
3295 | </para> | ||
3296 | |||
3297 | <para> | ||
3298 | blktrace is an application that runs on the target system. | ||
3299 | You can run the entire blktrace and blkparse pipeline on the | ||
3300 | target, or you can run blktrace in 'listen' mode on the target | ||
3301 | and have blktrace and blkparse collect and analyze the data on | ||
3302 | the host (see the | ||
3303 | "<link linkend='using-blktrace-remotely'>Using blktrace Remotely</link>" | ||
3304 | section below). | ||
3305 | For the rest of this section we assume you've ssh'ed to the | ||
3306 | host and will be running blkrace on the target. | ||
3307 | </para> | ||
3308 | </section> | ||
3309 | |||
3310 | <section id='blktrace-basic-usage'> | ||
3311 | <title>Basic Usage</title> | ||
3312 | |||
3313 | <para> | ||
3314 | To record a trace, simply run the 'blktrace' command, giving it | ||
3315 | the name of the block device you want to trace activity on: | ||
3316 | <literallayout class='monospaced'> | ||
3317 | root@crownbay:~# blktrace /dev/sdc | ||
3318 | </literallayout> | ||
3319 | In another shell, execute a workload you want to trace. | ||
3320 | <literallayout class='monospaced'> | ||
3321 | root@crownbay:/media/sdc# rm linux-2.6.19.2.tar.bz2; wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>; sync | ||
3322 | Connecting to downloads.yoctoproject.org (140.211.169.59:80) | ||
3323 | linux-2.6.19.2.tar.b 100% |*******************************| 41727k 0:00:00 ETA | ||
3324 | </literallayout> | ||
3325 | Press Ctrl-C in the blktrace shell to stop the trace. It will | ||
3326 | display how many events were logged, along with the per-cpu file | ||
3327 | sizes (blktrace records traces in per-cpu kernel buffers and | ||
3328 | simply dumps them to userspace for blkparse to merge and sort | ||
3329 | later). | ||
3330 | <literallayout class='monospaced'> | ||
3331 | ^C=== sdc === | ||
3332 | CPU 0: 7082 events, 332 KiB data | ||
3333 | CPU 1: 1578 events, 74 KiB data | ||
3334 | Total: 8660 events (dropped 0), 406 KiB data | ||
3335 | </literallayout> | ||
3336 | If you examine the files saved to disk, you see multiple files, | ||
3337 | one per CPU and with the device name as the first part of the | ||
3338 | filename: | ||
3339 | <literallayout class='monospaced'> | ||
3340 | root@crownbay:~# ls -al | ||
3341 | drwxr-xr-x 6 root root 1024 Oct 27 22:39 . | ||
3342 | drwxr-sr-x 4 root root 1024 Oct 26 18:24 .. | ||
3343 | -rw-r--r-- 1 root root 339938 Oct 27 22:40 sdc.blktrace.0 | ||
3344 | -rw-r--r-- 1 root root 75753 Oct 27 22:40 sdc.blktrace.1 | ||
3345 | </literallayout> | ||
3346 | To view the trace events, simply invoke 'blkparse' in the | ||
3347 | directory containing the trace files, giving it the device name | ||
3348 | that forms the first part of the filenames: | ||
3349 | <literallayout class='monospaced'> | ||
3350 | root@crownbay:~# blkparse sdc | ||
3351 | |||
3352 | 8,32 1 1 0.000000000 1225 Q WS 3417048 + 8 [jbd2/sdc-8] | ||
3353 | 8,32 1 2 0.000025213 1225 G WS 3417048 + 8 [jbd2/sdc-8] | ||
3354 | 8,32 1 3 0.000033384 1225 P N [jbd2/sdc-8] | ||
3355 | 8,32 1 4 0.000043301 1225 I WS 3417048 + 8 [jbd2/sdc-8] | ||
3356 | 8,32 1 0 0.000057270 0 m N cfq1225 insert_request | ||
3357 | 8,32 1 0 0.000064813 0 m N cfq1225 add_to_rr | ||
3358 | 8,32 1 5 0.000076336 1225 U N [jbd2/sdc-8] 1 | ||
3359 | 8,32 1 0 0.000088559 0 m N cfq workload slice:150 | ||
3360 | 8,32 1 0 0.000097359 0 m N cfq1225 set_active wl_prio:0 wl_type:1 | ||
3361 | 8,32 1 0 0.000104063 0 m N cfq1225 Not idling. st->count:1 | ||
3362 | 8,32 1 0 0.000112584 0 m N cfq1225 fifo= (null) | ||
3363 | 8,32 1 0 0.000118730 0 m N cfq1225 dispatch_insert | ||
3364 | 8,32 1 0 0.000127390 0 m N cfq1225 dispatched a request | ||
3365 | 8,32 1 0 0.000133536 0 m N cfq1225 activate rq, drv=1 | ||
3366 | 8,32 1 6 0.000136889 1225 D WS 3417048 + 8 [jbd2/sdc-8] | ||
3367 | 8,32 1 7 0.000360381 1225 Q WS 3417056 + 8 [jbd2/sdc-8] | ||
3368 | 8,32 1 8 0.000377422 1225 G WS 3417056 + 8 [jbd2/sdc-8] | ||
3369 | 8,32 1 9 0.000388876 1225 P N [jbd2/sdc-8] | ||
3370 | 8,32 1 10 0.000397886 1225 Q WS 3417064 + 8 [jbd2/sdc-8] | ||
3371 | 8,32 1 11 0.000404800 1225 M WS 3417064 + 8 [jbd2/sdc-8] | ||
3372 | 8,32 1 12 0.000412343 1225 Q WS 3417072 + 8 [jbd2/sdc-8] | ||
3373 | 8,32 1 13 0.000416533 1225 M WS 3417072 + 8 [jbd2/sdc-8] | ||
3374 | 8,32 1 14 0.000422121 1225 Q WS 3417080 + 8 [jbd2/sdc-8] | ||
3375 | 8,32 1 15 0.000425194 1225 M WS 3417080 + 8 [jbd2/sdc-8] | ||
3376 | 8,32 1 16 0.000431968 1225 Q WS 3417088 + 8 [jbd2/sdc-8] | ||
3377 | 8,32 1 17 0.000435251 1225 M WS 3417088 + 8 [jbd2/sdc-8] | ||
3378 | 8,32 1 18 0.000440279 1225 Q WS 3417096 + 8 [jbd2/sdc-8] | ||
3379 | 8,32 1 19 0.000443911 1225 M WS 3417096 + 8 [jbd2/sdc-8] | ||
3380 | 8,32 1 20 0.000450336 1225 Q WS 3417104 + 8 [jbd2/sdc-8] | ||
3381 | 8,32 1 21 0.000454038 1225 M WS 3417104 + 8 [jbd2/sdc-8] | ||
3382 | 8,32 1 22 0.000462070 1225 Q WS 3417112 + 8 [jbd2/sdc-8] | ||
3383 | 8,32 1 23 0.000465422 1225 M WS 3417112 + 8 [jbd2/sdc-8] | ||
3384 | 8,32 1 24 0.000474222 1225 I WS 3417056 + 64 [jbd2/sdc-8] | ||
3385 | 8,32 1 0 0.000483022 0 m N cfq1225 insert_request | ||
3386 | 8,32 1 25 0.000489727 1225 U N [jbd2/sdc-8] 1 | ||
3387 | 8,32 1 0 0.000498457 0 m N cfq1225 Not idling. st->count:1 | ||
3388 | 8,32 1 0 0.000503765 0 m N cfq1225 dispatch_insert | ||
3389 | 8,32 1 0 0.000512914 0 m N cfq1225 dispatched a request | ||
3390 | 8,32 1 0 0.000518851 0 m N cfq1225 activate rq, drv=2 | ||
3391 | . | ||
3392 | . | ||
3393 | . | ||
3394 | 8,32 0 0 58.515006138 0 m N cfq3551 complete rqnoidle 1 | ||
3395 | 8,32 0 2024 58.516603269 3 C WS 3156992 + 16 [0] | ||
3396 | 8,32 0 0 58.516626736 0 m N cfq3551 complete rqnoidle 1 | ||
3397 | 8,32 0 0 58.516634558 0 m N cfq3551 arm_idle: 8 group_idle: 0 | ||
3398 | 8,32 0 0 58.516636933 0 m N cfq schedule dispatch | ||
3399 | 8,32 1 0 58.516971613 0 m N cfq3551 slice expired t=0 | ||
3400 | 8,32 1 0 58.516982089 0 m N cfq3551 sl_used=13 disp=6 charge=13 iops=0 sect=80 | ||
3401 | 8,32 1 0 58.516985511 0 m N cfq3551 del_from_rr | ||
3402 | 8,32 1 0 58.516990819 0 m N cfq3551 put_queue | ||
3403 | |||
3404 | CPU0 (sdc): | ||
3405 | Reads Queued: 0, 0KiB Writes Queued: 331, 26,284KiB | ||
3406 | Read Dispatches: 0, 0KiB Write Dispatches: 485, 40,484KiB | ||
3407 | Reads Requeued: 0 Writes Requeued: 0 | ||
3408 | Reads Completed: 0, 0KiB Writes Completed: 511, 41,000KiB | ||
3409 | Read Merges: 0, 0KiB Write Merges: 13, 160KiB | ||
3410 | Read depth: 0 Write depth: 2 | ||
3411 | IO unplugs: 23 Timer unplugs: 0 | ||
3412 | CPU1 (sdc): | ||
3413 | Reads Queued: 0, 0KiB Writes Queued: 249, 15,800KiB | ||
3414 | Read Dispatches: 0, 0KiB Write Dispatches: 42, 1,600KiB | ||
3415 | Reads Requeued: 0 Writes Requeued: 0 | ||
3416 | Reads Completed: 0, 0KiB Writes Completed: 16, 1,084KiB | ||
3417 | Read Merges: 0, 0KiB Write Merges: 40, 276KiB | ||
3418 | Read depth: 0 Write depth: 2 | ||
3419 | IO unplugs: 30 Timer unplugs: 1 | ||
3420 | |||
3421 | Total (sdc): | ||
3422 | Reads Queued: 0, 0KiB Writes Queued: 580, 42,084KiB | ||
3423 | Read Dispatches: 0, 0KiB Write Dispatches: 527, 42,084KiB | ||
3424 | Reads Requeued: 0 Writes Requeued: 0 | ||
3425 | Reads Completed: 0, 0KiB Writes Completed: 527, 42,084KiB | ||
3426 | Read Merges: 0, 0KiB Write Merges: 53, 436KiB | ||
3427 | IO unplugs: 53 Timer unplugs: 1 | ||
3428 | |||
3429 | Throughput (R/W): 0KiB/s / 719KiB/s | ||
3430 | Events (sdc): 6,592 entries | ||
3431 | Skips: 0 forward (0 - 0.0%) | ||
3432 | Input file sdc.blktrace.0 added | ||
3433 | Input file sdc.blktrace.1 added | ||
3434 | </literallayout> | ||
3435 | The report shows each event that was found in the blktrace data, | ||
3436 | along with a summary of the overall block I/O traffic during | ||
3437 | the run. You can look at the | ||
3438 | <ulink url='http://linux.die.net/man/1/blkparse'>blkparse</ulink> | ||
3439 | manpage to learn the | ||
3440 | meaning of each field displayed in the trace listing. | ||
3441 | </para> | ||
3442 | |||
3443 | <section id='blktrace-live-mode'> | ||
3444 | <title>Live Mode</title> | ||
3445 | |||
3446 | <para> | ||
3447 | blktrace and blkparse are designed from the ground up to | ||
3448 | be able to operate together in a 'pipe mode' where the | ||
3449 | stdout of blktrace can be fed directly into the stdin of | ||
3450 | blkparse: | ||
3451 | <literallayout class='monospaced'> | ||
3452 | root@crownbay:~# blktrace /dev/sdc -o - | blkparse -i - | ||
3453 | </literallayout> | ||
3454 | This enables long-lived tracing sessions to run without | ||
3455 | writing anything to disk, and allows the user to look for | ||
3456 | certain conditions in the trace data in 'real-time' by | ||
3457 | viewing the trace output as it scrolls by on the screen or | ||
3458 | by passing it along to yet another program in the pipeline | ||
3459 | such as grep which can be used to identify and capture | ||
3460 | conditions of interest. | ||
3461 | </para> | ||
3462 | |||
3463 | <para> | ||
3464 | There's actually another blktrace command that implements | ||
3465 | the above pipeline as a single command, so the user doesn't | ||
3466 | have to bother typing in the above command sequence: | ||
3467 | <literallayout class='monospaced'> | ||
3468 | root@crownbay:~# btrace /dev/sdc | ||
3469 | </literallayout> | ||
3470 | </para> | ||
3471 | </section> | ||
3472 | |||
3473 | <section id='using-blktrace-remotely'> | ||
3474 | <title>Using blktrace Remotely</title> | ||
3475 | |||
3476 | <para> | ||
3477 | Because blktrace traces block I/O and at the same time | ||
3478 | normally writes its trace data to a block device, and | ||
3479 | in general because it's not really a great idea to make | ||
3480 | the device being traced the same as the device the tracer | ||
3481 | writes to, blktrace provides a way to trace without | ||
3482 | perturbing the traced device at all by providing native | ||
3483 | support for sending all trace data over the network. | ||
3484 | </para> | ||
3485 | |||
3486 | <para> | ||
3487 | To have blktrace operate in this mode, start blktrace on | ||
3488 | the target system being traced with the -l option, along with | ||
3489 | the device to trace: | ||
3490 | <literallayout class='monospaced'> | ||
3491 | root@crownbay:~# blktrace -l /dev/sdc | ||
3492 | server: waiting for connections... | ||
3493 | </literallayout> | ||
3494 | On the host system, use the -h option to connect to the | ||
3495 | target system, also passing it the device to trace: | ||
3496 | <literallayout class='monospaced'> | ||
3497 | $ blktrace -d /dev/sdc -h 192.168.1.43 | ||
3498 | blktrace: connecting to 192.168.1.43 | ||
3499 | blktrace: connected! | ||
3500 | </literallayout> | ||
3501 | On the target system, you should see this: | ||
3502 | <literallayout class='monospaced'> | ||
3503 | server: connection from 192.168.1.43 | ||
3504 | </literallayout> | ||
3505 | In another shell, execute a workload you want to trace. | ||
3506 | <literallayout class='monospaced'> | ||
3507 | root@crownbay:/media/sdc# rm linux-2.6.19.2.tar.bz2; wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>; sync | ||
3508 | Connecting to downloads.yoctoproject.org (140.211.169.59:80) | ||
3509 | linux-2.6.19.2.tar.b 100% |*******************************| 41727k 0:00:00 ETA | ||
3510 | </literallayout> | ||
3511 | When it's done, do a Ctrl-C on the host system to | ||
3512 | stop the trace: | ||
3513 | <literallayout class='monospaced'> | ||
3514 | ^C=== sdc === | ||
3515 | CPU 0: 7691 events, 361 KiB data | ||
3516 | CPU 1: 4109 events, 193 KiB data | ||
3517 | Total: 11800 events (dropped 0), 554 KiB data | ||
3518 | </literallayout> | ||
3519 | On the target system, you should also see a trace | ||
3520 | summary for the trace just ended: | ||
3521 | <literallayout class='monospaced'> | ||
3522 | server: end of run for 192.168.1.43:sdc | ||
3523 | === sdc === | ||
3524 | CPU 0: 7691 events, 361 KiB data | ||
3525 | CPU 1: 4109 events, 193 KiB data | ||
3526 | Total: 11800 events (dropped 0), 554 KiB data | ||
3527 | </literallayout> | ||
3528 | The blktrace instance on the host will save the target | ||
3529 | output inside a hostname-timestamp directory: | ||
3530 | <literallayout class='monospaced'> | ||
3531 | $ ls -al | ||
3532 | drwxr-xr-x 10 root root 1024 Oct 28 02:40 . | ||
3533 | drwxr-sr-x 4 root root 1024 Oct 26 18:24 .. | ||
3534 | drwxr-xr-x 2 root root 1024 Oct 28 02:40 192.168.1.43-2012-10-28-02:40:56 | ||
3535 | </literallayout> | ||
3536 | cd into that directory to see the output files: | ||
3537 | <literallayout class='monospaced'> | ||
3538 | $ ls -l | ||
3539 | -rw-r--r-- 1 root root 369193 Oct 28 02:44 sdc.blktrace.0 | ||
3540 | -rw-r--r-- 1 root root 197278 Oct 28 02:44 sdc.blktrace.1 | ||
3541 | </literallayout> | ||
3542 | And run blkparse on the host system using the device name: | ||
3543 | <literallayout class='monospaced'> | ||
3544 | $ blkparse sdc | ||
3545 | |||
3546 | 8,32 1 1 0.000000000 1263 Q RM 6016 + 8 [ls] | ||
3547 | 8,32 1 0 0.000036038 0 m N cfq1263 alloced | ||
3548 | 8,32 1 2 0.000039390 1263 G RM 6016 + 8 [ls] | ||
3549 | 8,32 1 3 0.000049168 1263 I RM 6016 + 8 [ls] | ||
3550 | 8,32 1 0 0.000056152 0 m N cfq1263 insert_request | ||
3551 | 8,32 1 0 0.000061600 0 m N cfq1263 add_to_rr | ||
3552 | 8,32 1 0 0.000075498 0 m N cfq workload slice:300 | ||
3553 | . | ||
3554 | . | ||
3555 | . | ||
3556 | 8,32 0 0 177.266385696 0 m N cfq1267 arm_idle: 8 group_idle: 0 | ||
3557 | 8,32 0 0 177.266388140 0 m N cfq schedule dispatch | ||
3558 | 8,32 1 0 177.266679239 0 m N cfq1267 slice expired t=0 | ||
3559 | 8,32 1 0 177.266689297 0 m N cfq1267 sl_used=9 disp=6 charge=9 iops=0 sect=56 | ||
3560 | 8,32 1 0 177.266692649 0 m N cfq1267 del_from_rr | ||
3561 | 8,32 1 0 177.266696560 0 m N cfq1267 put_queue | ||
3562 | |||
3563 | CPU0 (sdc): | ||
3564 | Reads Queued: 0, 0KiB Writes Queued: 270, 21,708KiB | ||
3565 | Read Dispatches: 59, 2,628KiB Write Dispatches: 495, 39,964KiB | ||
3566 | Reads Requeued: 0 Writes Requeued: 0 | ||
3567 | Reads Completed: 90, 2,752KiB Writes Completed: 543, 41,596KiB | ||
3568 | Read Merges: 0, 0KiB Write Merges: 9, 344KiB | ||
3569 | Read depth: 2 Write depth: 2 | ||
3570 | IO unplugs: 20 Timer unplugs: 1 | ||
3571 | CPU1 (sdc): | ||
3572 | Reads Queued: 688, 2,752KiB Writes Queued: 381, 20,652KiB | ||
3573 | Read Dispatches: 31, 124KiB Write Dispatches: 59, 2,396KiB | ||
3574 | Reads Requeued: 0 Writes Requeued: 0 | ||
3575 | Reads Completed: 0, 0KiB Writes Completed: 11, 764KiB | ||
3576 | Read Merges: 598, 2,392KiB Write Merges: 88, 448KiB | ||
3577 | Read depth: 2 Write depth: 2 | ||
3578 | IO unplugs: 52 Timer unplugs: 0 | ||
3579 | |||
3580 | Total (sdc): | ||
3581 | Reads Queued: 688, 2,752KiB Writes Queued: 651, 42,360KiB | ||
3582 | Read Dispatches: 90, 2,752KiB Write Dispatches: 554, 42,360KiB | ||
3583 | Reads Requeued: 0 Writes Requeued: 0 | ||
3584 | Reads Completed: 90, 2,752KiB Writes Completed: 554, 42,360KiB | ||
3585 | Read Merges: 598, 2,392KiB Write Merges: 97, 792KiB | ||
3586 | IO unplugs: 72 Timer unplugs: 1 | ||
3587 | |||
3588 | Throughput (R/W): 15KiB/s / 238KiB/s | ||
3589 | Events (sdc): 9,301 entries | ||
3590 | Skips: 0 forward (0 - 0.0%) | ||
3591 | </literallayout> | ||
3592 | You should see the trace events and summary just as | ||
3593 | you would have if you'd run the same command on the target. | ||
3594 | </para> | ||
3595 | </section> | ||
3596 | |||
3597 | <section id='tracing-block-io-via-ftrace'> | ||
3598 | <title>Tracing Block I/O via 'ftrace'</title> | ||
3599 | |||
3600 | <para> | ||
3601 | It's also possible to trace block I/O using only | ||
3602 | <link linkend='the-trace-events-subsystem'>trace events subsystem</link>, | ||
3603 | which can be useful for casual tracing | ||
3604 | if you don't want to bother dealing with the userspace tools. | ||
3605 | </para> | ||
3606 | |||
3607 | <para> | ||
3608 | To enable tracing for a given device, use | ||
3609 | /sys/block/xxx/trace/enable, where xxx is the device name. | ||
3610 | This for example enables tracing for /dev/sdc: | ||
3611 | <literallayout class='monospaced'> | ||
3612 | root@crownbay:/sys/kernel/debug/tracing# echo 1 > /sys/block/sdc/trace/enable | ||
3613 | </literallayout> | ||
3614 | Once you've selected the device(s) you want to trace, | ||
3615 | selecting the 'blk' tracer will turn the blk tracer on: | ||
3616 | <literallayout class='monospaced'> | ||
3617 | root@crownbay:/sys/kernel/debug/tracing# cat available_tracers | ||
3618 | blk function_graph function nop | ||
3619 | |||
3620 | root@crownbay:/sys/kernel/debug/tracing# echo blk > current_tracer | ||
3621 | </literallayout> | ||
3622 | Execute the workload you're interested in: | ||
3623 | <literallayout class='monospaced'> | ||
3624 | root@crownbay:/sys/kernel/debug/tracing# cat /media/sdc/testfile.txt | ||
3625 | </literallayout> | ||
3626 | And look at the output (note here that we're using | ||
3627 | 'trace_pipe' instead of trace to capture this trace - | ||
3628 | this allows us to wait around on the pipe for data to | ||
3629 | appear): | ||
3630 | <literallayout class='monospaced'> | ||
3631 | root@crownbay:/sys/kernel/debug/tracing# cat trace_pipe | ||
3632 | cat-3587 [001] d..1 3023.276361: 8,32 Q R 1699848 + 8 [cat] | ||
3633 | cat-3587 [001] d..1 3023.276410: 8,32 m N cfq3587 alloced | ||
3634 | cat-3587 [001] d..1 3023.276415: 8,32 G R 1699848 + 8 [cat] | ||
3635 | cat-3587 [001] d..1 3023.276424: 8,32 P N [cat] | ||
3636 | cat-3587 [001] d..2 3023.276432: 8,32 I R 1699848 + 8 [cat] | ||
3637 | cat-3587 [001] d..1 3023.276439: 8,32 m N cfq3587 insert_request | ||
3638 | cat-3587 [001] d..1 3023.276445: 8,32 m N cfq3587 add_to_rr | ||
3639 | cat-3587 [001] d..2 3023.276454: 8,32 U N [cat] 1 | ||
3640 | cat-3587 [001] d..1 3023.276464: 8,32 m N cfq workload slice:150 | ||
3641 | cat-3587 [001] d..1 3023.276471: 8,32 m N cfq3587 set_active wl_prio:0 wl_type:2 | ||
3642 | cat-3587 [001] d..1 3023.276478: 8,32 m N cfq3587 fifo= (null) | ||
3643 | cat-3587 [001] d..1 3023.276483: 8,32 m N cfq3587 dispatch_insert | ||
3644 | cat-3587 [001] d..1 3023.276490: 8,32 m N cfq3587 dispatched a request | ||
3645 | cat-3587 [001] d..1 3023.276497: 8,32 m N cfq3587 activate rq, drv=1 | ||
3646 | cat-3587 [001] d..2 3023.276500: 8,32 D R 1699848 + 8 [cat] | ||
3647 | </literallayout> | ||
3648 | And this turns off tracing for the specified device: | ||
3649 | <literallayout class='monospaced'> | ||
3650 | root@crownbay:/sys/kernel/debug/tracing# echo 0 > /sys/block/sdc/trace/enable | ||
3651 | </literallayout> | ||
3652 | </para> | ||
3653 | </section> | ||
3654 | </section> | ||
3655 | |||
3656 | <section id='blktrace-documentation'> | ||
3657 | <title>Documentation</title> | ||
3658 | |||
3659 | <para> | ||
3660 | Online versions of the man pages for the commands discussed | ||
3661 | in this section can be found here: | ||
3662 | <itemizedlist> | ||
3663 | <listitem><para><ulink url='http://linux.die.net/man/8/blktrace'>http://linux.die.net/man/8/blktrace</ulink> | ||
3664 | </para></listitem> | ||
3665 | <listitem><para><ulink url='http://linux.die.net/man/1/blkparse'>http://linux.die.net/man/1/blkparse</ulink> | ||
3666 | </para></listitem> | ||
3667 | <listitem><para><ulink url='http://linux.die.net/man/8/btrace'>http://linux.die.net/man/8/btrace</ulink> | ||
3668 | </para></listitem> | ||
3669 | </itemizedlist> | ||
3670 | </para> | ||
3671 | |||
3672 | <para> | ||
3673 | The above manpages, along with manpages for the other | ||
3674 | blktrace utilities (btt, blkiomon, etc) can be found in the | ||
3675 | /doc directory of the blktrace tools git repo: | ||
3676 | <literallayout class='monospaced'> | ||
3677 | $ git clone git://git.kernel.dk/blktrace.git | ||
3678 | </literallayout> | ||
3679 | </para> | ||
3680 | </section> | ||
3681 | </section> | ||
3682 | </chapter> | ||
3683 | <!-- | ||
3684 | vim: expandtab tw=80 ts=4 | ||
3685 | --> | ||
diff --git a/documentation/profile-manual/profile-manual.xml b/documentation/profile-manual/profile-manual.xml new file mode 100644 index 0000000..e5b253b --- /dev/null +++ b/documentation/profile-manual/profile-manual.xml | |||
@@ -0,0 +1,95 @@ | |||
1 | <!DOCTYPE book 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 | |||
5 | <book id='profile-manual' lang='en' | ||
6 | xmlns:xi="http://www.w3.org/2003/XInclude" | ||
7 | xmlns="http://docbook.org/ns/docbook" | ||
8 | > | ||
9 | <bookinfo> | ||
10 | |||
11 | <mediaobject> | ||
12 | <imageobject> | ||
13 | <imagedata fileref='figures/profile-title.png' | ||
14 | format='SVG' | ||
15 | align='left' scalefit='1' width='100%'/> | ||
16 | </imageobject> | ||
17 | </mediaobject> | ||
18 | |||
19 | <title> | ||
20 | Yocto Project Profiling and Tracing Manual | ||
21 | </title> | ||
22 | |||
23 | <authorgroup> | ||
24 | <author> | ||
25 | <firstname>Tom</firstname> <surname>Zanussi</surname> | ||
26 | <affiliation> | ||
27 | <orgname>Intel Corporation</orgname> | ||
28 | </affiliation> | ||
29 | <email>tom.zanussi@intel.com</email> | ||
30 | </author> | ||
31 | </authorgroup> | ||
32 | |||
33 | <revhistory> | ||
34 | <revision> | ||
35 | <revnumber>1.4</revnumber> | ||
36 | <date>April 2013</date> | ||
37 | <revremark>Released with the Yocto Project 1.4 Release.</revremark> | ||
38 | </revision> | ||
39 | <revision> | ||
40 | <revnumber>1.5</revnumber> | ||
41 | <date>October 2013</date> | ||
42 | <revremark>Released with the Yocto Project 1.5 Release.</revremark> | ||
43 | </revision> | ||
44 | <revision> | ||
45 | <revnumber>1.5.1</revnumber> | ||
46 | <date>January 2014</date> | ||
47 | <revremark>Released with the Yocto Project 1.5.1 Release.</revremark> | ||
48 | </revision> | ||
49 | <revision> | ||
50 | <revnumber>1.6</revnumber> | ||
51 | <date>April 2014</date> | ||
52 | <revremark>Released with the Yocto Project 1.6 Release.</revremark> | ||
53 | </revision> | ||
54 | <revision> | ||
55 | <revnumber>1.7</revnumber> | ||
56 | <date>Fall of 2014</date> | ||
57 | <revremark>Released with the Yocto Project 1.7 Release.</revremark> | ||
58 | </revision> | ||
59 | </revhistory> | ||
60 | |||
61 | <copyright> | ||
62 | <year>©RIGHT_YEAR;</year> | ||
63 | <holder>Linux Foundation</holder> | ||
64 | </copyright> | ||
65 | |||
66 | <legalnotice> | ||
67 | <para> | ||
68 | Permission is granted to copy, distribute and/or modify this document under | ||
69 | the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/"> | ||
70 | Creative Commons Attribution-Share Alike 2.0 UK: England & Wales</ulink> as published by | ||
71 | Creative Commons. | ||
72 | </para> | ||
73 | |||
74 | <note> | ||
75 | For the latest version of this manual associated with this | ||
76 | Yocto Project release, see the | ||
77 | <ulink url='&YOCTO_DOCS_PROF_URL;'>Yocto Project Profiling and Tracing Manual</ulink> | ||
78 | from the Yocto Project website. | ||
79 | </note> | ||
80 | </legalnotice> | ||
81 | |||
82 | </bookinfo> | ||
83 | |||
84 | <xi:include href="profile-manual-intro.xml"/> | ||
85 | |||
86 | <xi:include href="profile-manual-arch.xml"/> | ||
87 | |||
88 | <xi:include href="profile-manual-usage.xml"/> | ||
89 | |||
90 | <xi:include href="profile-manual-examples.xml"/> | ||
91 | |||
92 | </book> | ||
93 | <!-- | ||
94 | vim: expandtab tw=80 ts=4 | ||
95 | --> | ||
diff --git a/documentation/ref-manual/TODO b/documentation/ref-manual/TODO new file mode 100644 index 0000000..ee0db97 --- /dev/null +++ b/documentation/ref-manual/TODO | |||
@@ -0,0 +1,11 @@ | |||
1 | Handbook Todo List: | ||
2 | |||
3 | * Document adding a new IMAGE_FEATURE to the customising images section | ||
4 | * Add instructions about using zaurus/openmoko emulation | ||
5 | * Add component overview/block diagrams | ||
6 | * Software Deevelopment intro should mention its software development for | ||
7 | intended target and could be a different arch etc and thus special case. | ||
8 | * Expand insane.bbclass documentation to cover tests | ||
9 | * Document remaining classes (see list in ref-classes) | ||
10 | * Document formfactor | ||
11 | |||
diff --git a/documentation/ref-manual/closer-look.xml b/documentation/ref-manual/closer-look.xml new file mode 100644 index 0000000..f0ed967 --- /dev/null +++ b/documentation/ref-manual/closer-look.xml | |||
@@ -0,0 +1,1304 @@ | |||
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 | |||
5 | <chapter id='closer-look'> | ||
6 | <title>A Closer Look at the Yocto Project Development Environment</title> | ||
7 | |||
8 | <para> | ||
9 | This chapter takes a more detailed look at the Yocto Project | ||
10 | development environment. | ||
11 | The following diagram represents the development environment at a | ||
12 | high level. | ||
13 | The remainder of this chapter expands on the fundamental input, output, | ||
14 | process, and | ||
15 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>) blocks | ||
16 | in the Yocto Project development environment. | ||
17 | </para> | ||
18 | |||
19 | <para id='general-yocto-environment-figure'> | ||
20 | <imagedata fileref="figures/yocto-environment-ref.png" align="center" width="8in" depth="4.25in" /> | ||
21 | </para> | ||
22 | |||
23 | <para> | ||
24 | The generalized Yocto Project Development Environment consists of | ||
25 | several functional areas: | ||
26 | <itemizedlist> | ||
27 | <listitem><para><emphasis>User Configuration:</emphasis> | ||
28 | Metadata you can use to control the build process. | ||
29 | </para></listitem> | ||
30 | <listitem><para><emphasis>Metadata Layers:</emphasis> | ||
31 | Various layers that provide software, machine, and | ||
32 | distro Metadata.</para></listitem> | ||
33 | <listitem><para><emphasis>Source Files:</emphasis> | ||
34 | Upstream releases, local projects, and SCMs.</para></listitem> | ||
35 | <listitem><para><emphasis>Build System:</emphasis> | ||
36 | Processes under the control of | ||
37 | <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>. | ||
38 | This block expands on how BitBake fetches source, applies | ||
39 | patches, completes compilation, analyzes output for package | ||
40 | generation, creates and tests packages, generates images, and | ||
41 | generates cross-development tools.</para></listitem> | ||
42 | <listitem><para><emphasis>Package Feeds:</emphasis> | ||
43 | Directories containing output packages (RPM, DEB or IPK), | ||
44 | which are subsequently used in the construction of an image or | ||
45 | SDK, produced by the build system. | ||
46 | These feeds can also be copied and shared using a web server or | ||
47 | other means to facilitate extending or updating existing | ||
48 | images on devices at runtime if runtime package management is | ||
49 | enabled.</para></listitem> | ||
50 | <listitem><para><emphasis>Images:</emphasis> | ||
51 | Images produced by the development process. | ||
52 | </para></listitem> | ||
53 | <listitem><para><emphasis>Application Development SDK:</emphasis> | ||
54 | Cross-development tools that are produced along with an image | ||
55 | or separately with BitBake.</para></listitem> | ||
56 | </itemizedlist> | ||
57 | </para> | ||
58 | |||
59 | <section id="user-configuration"> | ||
60 | <title>User Configuration</title> | ||
61 | |||
62 | <para> | ||
63 | User configuration helps define the build. | ||
64 | Through user configuration, you can tell BitBake the | ||
65 | target architecture for which you are building the image, | ||
66 | where to store downloaded source, and other build properties. | ||
67 | </para> | ||
68 | |||
69 | <para> | ||
70 | The following figure shows an expanded representation of the | ||
71 | "User Configuration" box of the | ||
72 | <link linkend='general-yocto-environment-figure'>general Yocto Project Development Environment figure</link>: | ||
73 | </para> | ||
74 | |||
75 | <para> | ||
76 | <imagedata fileref="figures/user-configuration.png" align="center" width="5.5in" depth="3.5in" /> | ||
77 | </para> | ||
78 | |||
79 | <para> | ||
80 | BitBake needs some basic configuration files in order to complete | ||
81 | a build. | ||
82 | These files are <filename>*.conf</filename> files. | ||
83 | The minimally necessary ones reside as example files in the | ||
84 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
85 | For simplicity, this section refers to the Source Directory as | ||
86 | the "Poky Directory." | ||
87 | </para> | ||
88 | |||
89 | <para> | ||
90 | When you clone the <filename>poky</filename> Git repository or you | ||
91 | download and unpack a Yocto Project release, you can set up the | ||
92 | Source Directory to be named anything you want. | ||
93 | For this discussion, the cloned repository uses the default | ||
94 | name <filename>poky</filename>. | ||
95 | <note> | ||
96 | The Poky repository is primarily an aggregation of existing | ||
97 | repositories. | ||
98 | It is not a canonical upstream source. | ||
99 | </note> | ||
100 | </para> | ||
101 | |||
102 | <para> | ||
103 | The <filename>meta-yocto</filename> layer inside Poky contains | ||
104 | a <filename>conf</filename> directory that has example | ||
105 | configuration files. | ||
106 | These example files are used as a basis for creating actual | ||
107 | configuration files when you source the build environment | ||
108 | script | ||
109 | (i.e. | ||
110 | <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link> | ||
111 | or | ||
112 | <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>). | ||
113 | </para> | ||
114 | |||
115 | <para> | ||
116 | Sourcing the build environment script creates a | ||
117 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
118 | if one does not already exist. | ||
119 | BitBake uses the Build Directory for all its work during builds. | ||
120 | The Build Directory has a <filename>conf</filename> directory that | ||
121 | contains default versions of your <filename>local.conf</filename> | ||
122 | and <filename>bblayers.conf</filename> configuration files. | ||
123 | These default configuration files are created only if versions | ||
124 | do not already exist in the Build Directory at the time you | ||
125 | source the build environment setup script. | ||
126 | </para> | ||
127 | |||
128 | <para> | ||
129 | Because the Poky repository is fundamentally an aggregation of | ||
130 | existing repositories, some users might be familiar with running | ||
131 | the <filename>&OE_INIT_FILE;</filename> or | ||
132 | <filename>oe-init-build-env-memres</filename> script in the context | ||
133 | of separate OpenEmbedded-Core and BitBake repositories rather than a | ||
134 | single Poky repository. | ||
135 | This discussion assumes the script is executed from within a cloned | ||
136 | or unpacked version of Poky. | ||
137 | </para> | ||
138 | |||
139 | <para> | ||
140 | Depending on where the script is sourced, different sub-scripts | ||
141 | are called to set up the Build Directory (Yocto or OpenEmbedded). | ||
142 | Specifically, the script | ||
143 | <filename>scripts/oe-setup-builddir</filename> inside the | ||
144 | poky directory sets up the Build Directory and seeds the directory | ||
145 | (if necessary) with configuration files appropriate for the | ||
146 | Yocto Project development environment. | ||
147 | <note> | ||
148 | The <filename>scripts/oe-setup-builddir</filename> script | ||
149 | uses the <filename>$TEMPLATECONF</filename> variable to | ||
150 | determine which sample configuration files to locate. | ||
151 | </note> | ||
152 | </para> | ||
153 | |||
154 | <para> | ||
155 | The <filename>local.conf</filename> file provides many | ||
156 | basic variables that define a build environment. | ||
157 | Here is a list of a few. | ||
158 | To see the default configurations in a <filename>local.conf</filename> | ||
159 | file created by the build environment script, see the | ||
160 | <filename>local.conf.sample</filename> in the | ||
161 | <filename>meta-yocto</filename> layer: | ||
162 | <itemizedlist> | ||
163 | <listitem><para><emphasis>Parallelism Options:</emphasis> | ||
164 | Controlled by the | ||
165 | <link linkend='var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></link> | ||
166 | and | ||
167 | <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link> | ||
168 | variables.</para></listitem> | ||
169 | <listitem><para><emphasis>Target Machine Selection:</emphasis> | ||
170 | Controlled by the | ||
171 | <link linkend='var-MACHINE'><filename>MACHINE</filename></link> | ||
172 | variable.</para></listitem> | ||
173 | <listitem><para><emphasis>Download Directory:</emphasis> | ||
174 | Controlled by the | ||
175 | <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link> | ||
176 | variable.</para></listitem> | ||
177 | <listitem><para><emphasis>Shared State Directory:</emphasis> | ||
178 | Controlled by the | ||
179 | <link linkend='var-SSTATE_DIR'><filename>SSTATE_DIR</filename></link> | ||
180 | variable.</para></listitem> | ||
181 | <listitem><para><emphasis>Build Output:</emphasis> | ||
182 | Controlled by the | ||
183 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link> | ||
184 | variable.</para></listitem> | ||
185 | </itemizedlist> | ||
186 | <note> | ||
187 | Configurations set in the <filename>conf/local.conf</filename> | ||
188 | file can also be set in the | ||
189 | <filename>conf/site.conf</filename> and | ||
190 | <filename>conf/auto.conf</filename> configuration files. | ||
191 | </note> | ||
192 | </para> | ||
193 | |||
194 | <para> | ||
195 | The <filename>bblayers.conf</filename> file tells BitBake what | ||
196 | layers you want considered during the build. | ||
197 | By default, the layers listed in this file include layers | ||
198 | minimally needed by the build system. | ||
199 | However, you must manually add any custom layers you have created. | ||
200 | You can find more information on working with the | ||
201 | <filename>bblayers.conf</filename> file in the | ||
202 | "<ulink url='&YOCTO_DOCS_DEV_URL;#enabling-your-layer'>Enabling Your Layer</ulink>" | ||
203 | section in the Yocto Project Development Manual. | ||
204 | </para> | ||
205 | |||
206 | <para> | ||
207 | The files <filename>site.conf</filename> and | ||
208 | <filename>auto.conf</filename> are not created by the environment | ||
209 | initialization script. | ||
210 | If you want these configuration files, you must create them | ||
211 | yourself: | ||
212 | <itemizedlist> | ||
213 | <listitem><para><emphasis><filename>site.conf</filename>:</emphasis> | ||
214 | You can use the <filename>conf/site.conf</filename> | ||
215 | configuration file to configure multiple build directories. | ||
216 | For example, suppose you had several build environments and | ||
217 | they shared some common features. | ||
218 | You can set these default build properties here. | ||
219 | A good example is perhaps the level of parallelism you want | ||
220 | to use through the | ||
221 | <link linkend='var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></link> | ||
222 | and | ||
223 | <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link> | ||
224 | variables.</para> | ||
225 | <para>One useful scenario for using the | ||
226 | <filename>conf/site.conf</filename> file is to extend your | ||
227 | <link linkend='var-BBPATH'><filename>BBPATH</filename></link> | ||
228 | variable to include the path to a | ||
229 | <filename>conf/site.conf</filename>. | ||
230 | Then, when BitBake looks for Metadata using | ||
231 | <filename>BBPATH</filename>, it finds the | ||
232 | <filename>conf/site.conf</filename> file and applies your | ||
233 | common configurations found in the file. | ||
234 | To override configurations in a particular build directory, | ||
235 | alter the similar configurations within that build | ||
236 | directory's <filename>conf/local.conf</filename> file. | ||
237 | </para></listitem> | ||
238 | <listitem><para><emphasis><filename>auto.conf</filename>:</emphasis> | ||
239 | This file is not hand-created. | ||
240 | Rather, the file is usually created and written to by | ||
241 | an autobuilder. | ||
242 | The settings put into the file are typically the same as | ||
243 | you would find in the <filename>conf/local.conf</filename> | ||
244 | or the <filename>conf/site.conf</filename> files. | ||
245 | </para></listitem> | ||
246 | </itemizedlist> | ||
247 | </para> | ||
248 | |||
249 | <para> | ||
250 | You can edit all configuration files to further define | ||
251 | any particular build environment. | ||
252 | This process is represented by the "User Configuration Edits" | ||
253 | box in the figure. | ||
254 | </para> | ||
255 | |||
256 | <para> | ||
257 | When you launch your build with the | ||
258 | <filename>bitbake <target></filename> command, BitBake | ||
259 | sorts out the configurations to ultimately define your build | ||
260 | environment. | ||
261 | </para> | ||
262 | </section> | ||
263 | |||
264 | <section id="metadata-machine-configuration-and-policy-configuration"> | ||
265 | <title>Metadata, Machine Configuration, and Policy Configuration</title> | ||
266 | |||
267 | <para> | ||
268 | The previous section described the user configurations that | ||
269 | define BitBake's global behavior. | ||
270 | This section takes a closer look at the layers the build system | ||
271 | uses to further control the build. | ||
272 | These layers provide Metadata for the software, machine, and | ||
273 | policy. | ||
274 | </para> | ||
275 | |||
276 | <para> | ||
277 | In general, three types of layer input exist: | ||
278 | <itemizedlist> | ||
279 | <listitem><para><emphasis>Policy Configuration:</emphasis> | ||
280 | Distribution Layers provide top-level or general | ||
281 | policies for the image or SDK being built. | ||
282 | For example, this layer would dictate whether BitBake | ||
283 | produces RPM or IPK packages.</para></listitem> | ||
284 | <listitem><para><emphasis>Machine Configuration:</emphasis> | ||
285 | Board Support Package (BSP) layers provide machine | ||
286 | configurations. | ||
287 | This type of information is specific to a particular | ||
288 | target architecture.</para></listitem> | ||
289 | <listitem><para><emphasis>Metadata:</emphasis> | ||
290 | Software layers contain user-supplied recipe files, | ||
291 | patches, and append files. | ||
292 | </para></listitem> | ||
293 | </itemizedlist> | ||
294 | </para> | ||
295 | |||
296 | <para> | ||
297 | The following figure shows an expanded representation of the | ||
298 | Metadata, Machine Configuration, and Policy Configuration input | ||
299 | (layers) boxes of the | ||
300 | <link linkend='general-yocto-environment-figure'>general Yocto Project Development Environment figure</link>: | ||
301 | </para> | ||
302 | |||
303 | <para> | ||
304 | <imagedata fileref="figures/layer-input.png" align="center" width="8in" depth="7.5in" /> | ||
305 | </para> | ||
306 | |||
307 | <para> | ||
308 | In general, all layers have a similar structure. | ||
309 | They all contain a licensing file | ||
310 | (e.g. <filename>COPYING</filename>) if the layer is to be | ||
311 | distributed, a <filename>README</filename> file as good practice | ||
312 | and especially if the layer is to be distributed, a | ||
313 | configuration directory, and recipe directories. | ||
314 | </para> | ||
315 | |||
316 | <para> | ||
317 | The Yocto Project has many layers that can be used. | ||
318 | You can see a web-interface listing of them on the | ||
319 | <ulink url="http://git.yoctoproject.org/">Source Repositories</ulink> | ||
320 | page. | ||
321 | The layers are shown at the bottom categorized under | ||
322 | "Yocto Metadata Layers." | ||
323 | These layers are fundamentally a subset of the | ||
324 | <ulink url="http://layers.openembedded.org/layerindex/layers/">OpenEmbedded Metadata Index</ulink>, | ||
325 | which lists all layers provided by the OpenEmbedded community. | ||
326 | <note> | ||
327 | Layers exist in the Yocto Project Source Repositories that | ||
328 | cannot be found in the OpenEmbedded Metadata Index. | ||
329 | These layers are either deprecated or experimental in nature. | ||
330 | </note> | ||
331 | </para> | ||
332 | |||
333 | <para> | ||
334 | BitBake uses the <filename>conf/bblayers.conf</filename> file, | ||
335 | which is part of the user configuration, to find what layers it | ||
336 | should be using as part of the build. | ||
337 | </para> | ||
338 | |||
339 | <para> | ||
340 | For more information on layers, see the | ||
341 | "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>" | ||
342 | section in the Yocto Project Development Manual. | ||
343 | </para> | ||
344 | |||
345 | <section id="distro-layer"> | ||
346 | <title>Distro Layer</title> | ||
347 | |||
348 | <para> | ||
349 | The distribution layer provides policy configurations for your | ||
350 | distribution. | ||
351 | Best practices dictate that you isolate these types of | ||
352 | configurations into their own layer. | ||
353 | Settings you provide in | ||
354 | <filename>conf/distro/<distro>.conf</filename> override | ||
355 | similar | ||
356 | settings that BitBake finds in your | ||
357 | <filename>conf/local.conf</filename> file in the Build | ||
358 | Directory. | ||
359 | </para> | ||
360 | |||
361 | <para> | ||
362 | The following list provides some explanation and references | ||
363 | for what you typically find in the distribution layer: | ||
364 | <itemizedlist> | ||
365 | <listitem><para><emphasis>classes:</emphasis> | ||
366 | Class files (<filename>.bbclass</filename>) hold | ||
367 | common functionality that can be shared among | ||
368 | recipes in the distribution. | ||
369 | When your recipes inherit a class, they take on the | ||
370 | settings and functions for that class. | ||
371 | You can read more about class files in the | ||
372 | "<link linkend='ref-classes'>Classes</link>" section. | ||
373 | </para></listitem> | ||
374 | <listitem><para><emphasis>conf:</emphasis> | ||
375 | This area holds configuration files for the | ||
376 | layer (<filename>conf/layer.conf</filename>), | ||
377 | the distribution | ||
378 | (<filename>conf/distro/<distro>.conf</filename>), | ||
379 | and any distribution-wide include files. | ||
380 | </para></listitem> | ||
381 | <listitem><para><emphasis>recipes-*:</emphasis> | ||
382 | Recipes and append files that affect common | ||
383 | functionality across the distribution. | ||
384 | This area could include recipes and append files | ||
385 | to add distribution-specific configuration, | ||
386 | initialization scripts, custom image recipes, | ||
387 | and so forth.</para></listitem> | ||
388 | </itemizedlist> | ||
389 | </para> | ||
390 | </section> | ||
391 | |||
392 | <section id="bsp-layer"> | ||
393 | <title>BSP Layer</title> | ||
394 | |||
395 | <para> | ||
396 | The BSP Layer provides machine configurations. | ||
397 | Everything in this layer is specific to the machine for which | ||
398 | you are building the image or the SDK. | ||
399 | A common structure or form is defined for BSP layers. | ||
400 | You can learn more about this structure in the | ||
401 | <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>. | ||
402 | <note> | ||
403 | In order for a BSP layer to be considered compliant with the | ||
404 | Yocto Project, it must meet some structural requirements. | ||
405 | </note> | ||
406 | </para> | ||
407 | |||
408 | <para> | ||
409 | The BSP Layer's configuration directory contains | ||
410 | configuration files for the machine | ||
411 | (<filename>conf/machine/<machine>.conf</filename>) and, | ||
412 | of course, the layer (<filename>conf/layer.conf</filename>). | ||
413 | </para> | ||
414 | |||
415 | <para> | ||
416 | The remainder of the layer is dedicated to specific recipes | ||
417 | by function: <filename>recipes-bsp</filename>, | ||
418 | <filename>recipes-core</filename>, | ||
419 | <filename>recipes-graphics</filename>, and | ||
420 | <filename>recipes-kernel</filename>. | ||
421 | Metadata can exist for multiple formfactors, graphics | ||
422 | support systems, and so forth. | ||
423 | <note> | ||
424 | While the figure shows several <filename>recipes-*</filename> | ||
425 | directories, not all these directories appear in all | ||
426 | BSP layers. | ||
427 | </note> | ||
428 | </para> | ||
429 | </section> | ||
430 | |||
431 | <section id="software-layer"> | ||
432 | <title>Software Layer</title> | ||
433 | |||
434 | <para> | ||
435 | The software layer provides the Metadata for additional | ||
436 | software packages used during the build. | ||
437 | This layer does not include Metadata that is specific to the | ||
438 | distribution or the machine, which are found in their | ||
439 | respective layers. | ||
440 | </para> | ||
441 | |||
442 | <para> | ||
443 | This layer contains any new recipes that your project needs | ||
444 | in the form of recipe files. | ||
445 | </para> | ||
446 | </section> | ||
447 | </section> | ||
448 | |||
449 | <section id="sources-dev-environment"> | ||
450 | <title>Sources</title> | ||
451 | |||
452 | <para> | ||
453 | In order for the OpenEmbedded build system to create an image or | ||
454 | any target, it must be able to access source files. | ||
455 | The | ||
456 | <link linkend='general-yocto-environment-figure'>general Yocto Project Development Environment figure</link> | ||
457 | represents source files using the "Upstream Project Releases", | ||
458 | "Local Projects", and "SCMs (optional)" boxes. | ||
459 | The figure represents mirrors, which also play a role in locating | ||
460 | source files, with the "Source Mirror(s)" box. | ||
461 | </para> | ||
462 | |||
463 | <para> | ||
464 | The method by which source files are ultimately organized is | ||
465 | a function of the project. | ||
466 | For example, for released software, projects tend to use tarballs | ||
467 | or other archived files that can capture the state of a release | ||
468 | guaranteeing that it is statically represented. | ||
469 | On the other hand, for a project that is more dynamic or | ||
470 | experimental in nature, a project might keep source files in a | ||
471 | repository controlled by a Source Control Manager (SCM) such as | ||
472 | Git. | ||
473 | Pulling source from a repository allows you to control | ||
474 | the point in the repository (the revision) from which you want to | ||
475 | build software. | ||
476 | Finally, a combination of the two might exist, which would give the | ||
477 | consumer a choice when deciding where to get source files. | ||
478 | </para> | ||
479 | |||
480 | <para> | ||
481 | BitBake uses the | ||
482 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> | ||
483 | variable to point to source files regardless of their location. | ||
484 | Each recipe must have a <filename>SRC_URI</filename> variable | ||
485 | that points to the source. | ||
486 | </para> | ||
487 | |||
488 | <para> | ||
489 | Another area that plays a significant role in where source files | ||
490 | come from is pointed to by the | ||
491 | <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link> | ||
492 | variable. | ||
493 | This area is a cache that can hold previously downloaded source. | ||
494 | You can also instruct the OpenEmbedded build system to create | ||
495 | tarballs from Git repositories, which is not the default behavior, | ||
496 | and store them in the <filename>DL_DIR</filename> by using the | ||
497 | <link linkend='var-BB_GENERATE_MIRROR_TARBALLS'><filename>BB_GENERATE_MIRROR_TARBALLS</filename></link> | ||
498 | variable. | ||
499 | </para> | ||
500 | |||
501 | <para> | ||
502 | Judicious use of a <filename>DL_DIR</filename> directory can | ||
503 | save the build system a trip across the Internet when looking | ||
504 | for files. | ||
505 | A good method for using a download directory is to have | ||
506 | <filename>DL_DIR</filename> point to an area outside of your | ||
507 | Build Directory. | ||
508 | Doing so allows you to safely delete the Build Directory | ||
509 | if needed without fear of removing any downloaded source file. | ||
510 | </para> | ||
511 | |||
512 | <para> | ||
513 | The remainder of this section provides a deeper look into the | ||
514 | source files and the mirrors. | ||
515 | Here is a more detailed look at the source file area of the | ||
516 | base figure: | ||
517 | <imagedata fileref="figures/source-input.png" align="center" width="7in" depth="7.5in" /> | ||
518 | </para> | ||
519 | |||
520 | <section id='upstream-project-releases'> | ||
521 | <title>Upstream Project Releases</title> | ||
522 | |||
523 | <para> | ||
524 | Upstream project releases exist anywhere in the form of an | ||
525 | archived file (e.g. tarball or zip file). | ||
526 | These files correspond to individual recipes. | ||
527 | For example, the figure uses specific releases each for | ||
528 | BusyBox, Qt, and Dbus. | ||
529 | An archive file can be for any released product that can be | ||
530 | built using a recipe. | ||
531 | </para> | ||
532 | </section> | ||
533 | |||
534 | <section id='local-projects'> | ||
535 | <title>Local Projects</title> | ||
536 | |||
537 | <para> | ||
538 | Local projects are custom bits of software the user provides. | ||
539 | These bits reside somewhere local to a project - perhaps | ||
540 | a directory into which the user checks in items (e.g. | ||
541 | a local directory containing a development source tree | ||
542 | used by the group). | ||
543 | </para> | ||
544 | |||
545 | <para> | ||
546 | The canonical method through which to include a local project | ||
547 | is to use the | ||
548 | <link linkend='ref-classes-externalsrc'><filename>externalsrc</filename></link> | ||
549 | class to include that local project. | ||
550 | You use either the <filename>local.conf</filename> or a | ||
551 | recipe's append file to override or set the | ||
552 | recipe to point to the local directory on your disk to pull | ||
553 | in the whole source tree. | ||
554 | </para> | ||
555 | |||
556 | <para> | ||
557 | For information on how to use the | ||
558 | <filename>externalsrc</filename> class, see the | ||
559 | "<link linkend='ref-classes-externalsrc'><filename>externalsrc.bbclass</filename></link>" | ||
560 | section. | ||
561 | </para> | ||
562 | </section> | ||
563 | |||
564 | <section id='scms'> | ||
565 | <title>Source Control Managers (Optional)</title> | ||
566 | |||
567 | <para> | ||
568 | Another place the build system can get source files from is | ||
569 | through an SCM such as Git or Subversion. | ||
570 | In this case, a repository is cloned or checked out. | ||
571 | The | ||
572 | <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link> | ||
573 | task inside BitBake uses | ||
574 | the <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> | ||
575 | variable and the argument's prefix to determine the correct | ||
576 | fetcher module. | ||
577 | </para> | ||
578 | |||
579 | <note> | ||
580 | For information on how to have the OpenEmbedded build system | ||
581 | generate tarballs for Git repositories and place them in the | ||
582 | <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link> | ||
583 | directory, see the | ||
584 | <link linkend='var-BB_GENERATE_MIRROR_TARBALLS'><filename>BB_GENERATE_MIRROR_TARBALLS</filename></link> | ||
585 | variable. | ||
586 | </note> | ||
587 | |||
588 | <para> | ||
589 | When fetching a repository, BitBake uses the | ||
590 | <link linkend='var-SRCREV'><filename>SRCREV</filename></link> | ||
591 | variable to determine the specific revision from which to | ||
592 | build. | ||
593 | </para> | ||
594 | </section> | ||
595 | |||
596 | <section id='source-mirrors'> | ||
597 | <title>Source Mirror(s)</title> | ||
598 | |||
599 | <para> | ||
600 | Two kinds of mirrors exist: pre-mirrors and regular mirrors. | ||
601 | The <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link> | ||
602 | and | ||
603 | <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link> | ||
604 | variables point to these, respectively. | ||
605 | BitBake checks pre-mirrors before looking upstream for any | ||
606 | source files. | ||
607 | Pre-mirrors are appropriate when you have a shared directory | ||
608 | that is not a directory defined by the | ||
609 | <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link> | ||
610 | variable. | ||
611 | A Pre-mirror typically points to a shared directory that is | ||
612 | local to your organization. | ||
613 | </para> | ||
614 | |||
615 | <para> | ||
616 | Regular mirrors can be any site across the Internet that is | ||
617 | used as an alternative location for source code should the | ||
618 | primary site not be functioning for some reason or another. | ||
619 | </para> | ||
620 | </section> | ||
621 | </section> | ||
622 | |||
623 | <section id="package-feeds-dev-environment"> | ||
624 | <title>Package Feeds</title> | ||
625 | |||
626 | <para> | ||
627 | When the OpenEmbedded build system generates an image or an SDK, | ||
628 | it gets the packages from a package feed area located in the | ||
629 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
630 | The | ||
631 | <link linkend='general-yocto-environment-figure'>general Yocto Project Development Environment figure</link> | ||
632 | shows this package feeds area in the upper-right corner. | ||
633 | </para> | ||
634 | |||
635 | <para> | ||
636 | This section looks a little closer into the package feeds area used | ||
637 | by the build system. | ||
638 | Here is a more detailed look at the area: | ||
639 | <imagedata fileref="figures/package-feeds.png" align="center" width="7in" depth="6in" /> | ||
640 | </para> | ||
641 | |||
642 | <para> | ||
643 | Package feeds are an intermediary step in the build process. | ||
644 | BitBake generates packages whose types are defined by the | ||
645 | <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link> | ||
646 | variable. | ||
647 | Before placing the packages into package feeds, | ||
648 | the build process validates them with generated output quality | ||
649 | assurance checks through the | ||
650 | <link linkend='ref-classes-insane'><filename>insane</filename></link> | ||
651 | class. | ||
652 | </para> | ||
653 | |||
654 | <para> | ||
655 | The package feed area resides in | ||
656 | <filename>tmp/deploy</filename> of the Build Directory. | ||
657 | Folders are created that correspond to the package type | ||
658 | (IPK, DEB, or RPM) created. | ||
659 | Further organization is derived through the value of the | ||
660 | <link linkend='var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></link> | ||
661 | variable for each package. | ||
662 | For example, packages can exist for the i586 or qemux86 | ||
663 | architectures. | ||
664 | The package files themselves reside within the appropriate | ||
665 | architecture folder. | ||
666 | </para> | ||
667 | |||
668 | <para> | ||
669 | BitBake uses the <filename>do_package_write_*</filename> tasks to | ||
670 | place generated packages into the package holding area (e.g. | ||
671 | <filename>do_package_write_ipk</filename> for IPK packages). | ||
672 | See the | ||
673 | "<link linkend='ref-tasks-package_write_deb'><filename>do_package_write_deb</filename></link>", | ||
674 | "<link linkend='ref-tasks-package_write_ipk'><filename>do_package_write_ipk</filename></link>", | ||
675 | "<link linkend='ref-tasks-package_write_rpm'><filename>do_package_write_rpm</filename></link>", | ||
676 | and | ||
677 | "<link linkend='ref-tasks-package_write_tar'><filename>do_package_write_tar</filename></link>" | ||
678 | sections for additional information. | ||
679 | </para> | ||
680 | </section> | ||
681 | |||
682 | <section id='bitbake-dev-environment'> | ||
683 | <title>BitBake</title> | ||
684 | |||
685 | <para> | ||
686 | The OpenEmbedded build system uses | ||
687 | <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink> | ||
688 | to produce images. | ||
689 | You can see from the | ||
690 | <link linkend='general-yocto-environment-figure'>general Yocto Project Development Environment figure</link>, | ||
691 | the BitBake area consists of several functional areas. | ||
692 | This section takes a closer look at each of those areas. | ||
693 | </para> | ||
694 | |||
695 | <para> | ||
696 | Separate documentation exists for the BitBake tool. | ||
697 | See the | ||
698 | <ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual'>BitBake User Manual</ulink> | ||
699 | for reference material on BitBake. | ||
700 | </para> | ||
701 | |||
702 | <section id='source-fetching-dev-environment'> | ||
703 | <title>Source Fetching</title> | ||
704 | |||
705 | <para> | ||
706 | The first stages of building a recipe are to fetch and unpack | ||
707 | the source code: | ||
708 | <imagedata fileref="figures/source-fetching.png" align="center" width="6.5in" depth="5in" /> | ||
709 | </para> | ||
710 | |||
711 | <para> | ||
712 | The | ||
713 | <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link> | ||
714 | and | ||
715 | <link linkend='ref-tasks-unpack'><filename>do_unpack</filename></link> | ||
716 | tasks fetch the source files and unpack them into the work | ||
717 | directory. | ||
718 | <note> | ||
719 | For every local file (e.g. <filename>file://</filename>) | ||
720 | that is part of a recipe's | ||
721 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> | ||
722 | statement, the OpenEmbedded build system takes a checksum | ||
723 | of the file for the recipe and inserts the checksum into | ||
724 | the signature for the <filename>do_fetch</filename>. | ||
725 | If any local file has been modified, the | ||
726 | <filename>do_fetch</filename> task and all tasks that | ||
727 | depend on it are re-executed. | ||
728 | </note> | ||
729 | By default, everything is accomplished in the | ||
730 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>, | ||
731 | which has a defined structure. | ||
732 | For additional general information on the Build Directory, | ||
733 | see the | ||
734 | "<link linkend='structure-core-build'><filename>build/</filename></link>" | ||
735 | section. | ||
736 | </para> | ||
737 | |||
738 | <para> | ||
739 | Unpacked source files are pointed to by the | ||
740 | <link linkend='var-S'><filename>S</filename></link> variable. | ||
741 | Each recipe has an area in the Build Directory where the | ||
742 | unpacked source code resides. | ||
743 | The name of that directory for any given recipe is defined from | ||
744 | several different variables. | ||
745 | You can see the variables that define these directories | ||
746 | by looking at the figure: | ||
747 | <itemizedlist> | ||
748 | <listitem><para><link linkend='var-TMPDIR'><filename>TMPDIR</filename></link> - | ||
749 | The base directory where the OpenEmbedded build system | ||
750 | performs all its work during the build. | ||
751 | </para></listitem> | ||
752 | <listitem><para><link linkend='var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></link> - | ||
753 | The architecture of the built package or packages. | ||
754 | </para></listitem> | ||
755 | <listitem><para><link linkend='var-TARGET_OS'><filename>TARGET_OS</filename></link> - | ||
756 | The operating system of the target device. | ||
757 | </para></listitem> | ||
758 | <listitem><para><link linkend='var-PN'><filename>PN</filename></link> - | ||
759 | The name of the built package. | ||
760 | </para></listitem> | ||
761 | <listitem><para><link linkend='var-PV'><filename>PV</filename></link> - | ||
762 | The version of the recipe used to build the package. | ||
763 | </para></listitem> | ||
764 | <listitem><para><link linkend='var-PR'><filename>PR</filename></link> - | ||
765 | The revision of the recipe used to build the package. | ||
766 | </para></listitem> | ||
767 | <listitem><para><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link> - | ||
768 | The location within <filename>TMPDIR</filename> where | ||
769 | a specific package is built. | ||
770 | </para></listitem> | ||
771 | <listitem><para><link linkend='var-S'><filename>S</filename></link> - | ||
772 | Contains the unpacked source files for a given recipe. | ||
773 | </para></listitem> | ||
774 | </itemizedlist> | ||
775 | </para> | ||
776 | </section> | ||
777 | |||
778 | <section id='patching-dev-environment'> | ||
779 | <title>Patching</title> | ||
780 | |||
781 | <para> | ||
782 | Once source code is fetched and unpacked, BitBake locates | ||
783 | patch files and applies them to the source files: | ||
784 | <imagedata fileref="figures/patching.png" align="center" width="6in" depth="5in" /> | ||
785 | </para> | ||
786 | |||
787 | <para> | ||
788 | The | ||
789 | <link linkend='ref-tasks-patch'><filename>do_patch</filename></link> | ||
790 | task processes recipes by | ||
791 | using the | ||
792 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> | ||
793 | variable to locate applicable patch files, which by default | ||
794 | are <filename>*.patch</filename> or | ||
795 | <filename>*.diff</filename> files, or any file if | ||
796 | "apply=yes" is specified for the file in | ||
797 | <filename>SRC_URI</filename>. | ||
798 | </para> | ||
799 | |||
800 | <para> | ||
801 | BitBake finds and applies multiple patches for a single recipe | ||
802 | in the order in which it finds the patches. | ||
803 | Patches are applied to the recipe's source files located in the | ||
804 | <link linkend='var-S'><filename>S</filename></link> directory. | ||
805 | </para> | ||
806 | |||
807 | <para> | ||
808 | For more information on how the source directories are | ||
809 | created, see the | ||
810 | "<link linkend='source-fetching-dev-environment'>Source Fetching</link>" | ||
811 | section. | ||
812 | </para> | ||
813 | </section> | ||
814 | |||
815 | <section id='configuration-and-compilation-dev-environment'> | ||
816 | <title>Configuration and Compilation</title> | ||
817 | |||
818 | <para> | ||
819 | After source code is patched, BitBake executes tasks that | ||
820 | configure and compile the source code: | ||
821 | <imagedata fileref="figures/configuration-compile-autoreconf.png" align="center" width="7in" depth="5in" /> | ||
822 | </para> | ||
823 | |||
824 | <para> | ||
825 | This step in the build process consists of three tasks: | ||
826 | <itemizedlist> | ||
827 | <listitem><para><emphasis><filename>do_configure</filename>:</emphasis> | ||
828 | This task configures the source by enabling and | ||
829 | disabling any build-time and configuration options for | ||
830 | the software being built. | ||
831 | Configurations can come from the recipe itself as well | ||
832 | as from an inherited class. | ||
833 | Additionally, the software itself might configure itself | ||
834 | depending on the target for which it is being built. | ||
835 | </para> | ||
836 | |||
837 | <para>The configurations handled by the | ||
838 | <link linkend='ref-tasks-configure'><filename>do_configure</filename></link> | ||
839 | task are specific | ||
840 | to source code configuration for the source code | ||
841 | being built by the recipe.</para> | ||
842 | |||
843 | <para>If you are using the | ||
844 | <link linkend='ref-classes-autotools'><filename>autotools</filename></link> | ||
845 | class, | ||
846 | you can add additional configuration options by using | ||
847 | the <link linkend='var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></link> | ||
848 | variable. | ||
849 | For information on how this variable works within | ||
850 | that class, see the | ||
851 | <filename>meta/classes/autotools.bbclass</filename> file. | ||
852 | </para></listitem> | ||
853 | <listitem><para><emphasis><filename>do_compile</filename>:</emphasis> | ||
854 | Once a configuration task has been satisfied, BitBake | ||
855 | compiles the source using the | ||
856 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link> | ||
857 | task. | ||
858 | Compilation occurs in the directory pointed to by the | ||
859 | <link linkend='var-B'><filename>B</filename></link> | ||
860 | variable. | ||
861 | Realize that the <filename>B</filename> directory is, by | ||
862 | default, the same as the | ||
863 | <link linkend='var-S'><filename>S</filename></link> | ||
864 | directory.</para></listitem> | ||
865 | <listitem><para><emphasis><filename>do_install</filename>:</emphasis> | ||
866 | Once compilation is done, BitBake executes the | ||
867 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
868 | task. | ||
869 | This task copies files from the <filename>B</filename> | ||
870 | directory and places them in a holding area pointed to | ||
871 | by the | ||
872 | <link linkend='var-D'><filename>D</filename></link> | ||
873 | variable.</para></listitem> | ||
874 | </itemizedlist> | ||
875 | </para> | ||
876 | </section> | ||
877 | |||
878 | <section id='package-splitting-dev-environment'> | ||
879 | <title>Package Splitting</title> | ||
880 | |||
881 | <para> | ||
882 | After source code is configured and compiled, the | ||
883 | OpenEmbedded build system analyzes | ||
884 | the results and splits the output into packages: | ||
885 | <imagedata fileref="figures/analysis-for-package-splitting.png" align="center" width="7in" depth="7in" /> | ||
886 | </para> | ||
887 | |||
888 | <para> | ||
889 | The | ||
890 | <link linkend='ref-tasks-package'><filename>do_package</filename></link> | ||
891 | and | ||
892 | <link linkend='ref-tasks-packagedata'><filename>do_packagedata</filename></link> | ||
893 | tasks combine to analyze | ||
894 | the files found in the | ||
895 | <link linkend='var-D'><filename>D</filename></link> directory | ||
896 | and split them into subsets based on available packages and | ||
897 | files. | ||
898 | The analyzing process involves the following as well as other | ||
899 | items: splitting out debugging symbols, | ||
900 | looking at shared library dependencies between packages, | ||
901 | and looking at package relationships. | ||
902 | The <filename>do_packagedata</filename> task creates package | ||
903 | metadata based on the analysis such that the | ||
904 | OpenEmbedded build system can generate the final packages. | ||
905 | Working, staged, and intermediate results of the analysis | ||
906 | and package splitting process use these areas: | ||
907 | <itemizedlist> | ||
908 | <listitem><para><link linkend='var-PKGD'><filename>PKGD</filename></link> - | ||
909 | The destination directory for packages before they are | ||
910 | split. | ||
911 | </para></listitem> | ||
912 | <listitem><para><link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link> - | ||
913 | A shared, global-state directory that holds data | ||
914 | generated during the packaging process. | ||
915 | </para></listitem> | ||
916 | <listitem><para><link linkend='var-PKGDESTWORK'><filename>PKGDESTWORK</filename></link> - | ||
917 | A temporary work area used by the | ||
918 | <filename>do_package</filename> task. | ||
919 | </para></listitem> | ||
920 | <listitem><para><link linkend='var-PKGDEST'><filename>PKGDEST</filename></link> - | ||
921 | The parent directory for packages after they have | ||
922 | been split. | ||
923 | </para></listitem> | ||
924 | </itemizedlist> | ||
925 | The <link linkend='var-FILES'><filename>FILES</filename></link> | ||
926 | variable defines the files that go into each package in | ||
927 | <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>. | ||
928 | If you want details on how this is accomplished, you can | ||
929 | look at the | ||
930 | <link linkend='ref-classes-package'><filename>package</filename></link> | ||
931 | class. | ||
932 | </para> | ||
933 | |||
934 | <para> | ||
935 | Depending on the type of packages being created (RPM, DEB, or | ||
936 | IPK), the <filename>do_package_write_*</filename> task | ||
937 | creates the actual packages and places them in the | ||
938 | Package Feed area, which is | ||
939 | <filename>${TMPDIR}/deploy</filename>. | ||
940 | You can see the | ||
941 | "<link linkend='package-feeds-dev-environment'>Package Feeds</link>" | ||
942 | section for more detail on that part of the build process. | ||
943 | <note> | ||
944 | Support for creating feeds directly from the | ||
945 | <filename>deploy/*</filename> directories does not exist. | ||
946 | Creating such feeds usually requires some kind of feed | ||
947 | maintenance mechanism that would upload the new packages | ||
948 | into an official package feed (e.g. the | ||
949 | Ångström distribution). | ||
950 | This functionality is highly distribution-specific | ||
951 | and thus is not provided out of the box. | ||
952 | </note> | ||
953 | </para> | ||
954 | </section> | ||
955 | |||
956 | <section id='image-generation-dev-environment'> | ||
957 | <title>Image Generation</title> | ||
958 | |||
959 | <para> | ||
960 | Once packages are split and stored in the Package Feeds area, | ||
961 | the OpenEmbedded build system uses BitBake to generate the | ||
962 | root filesystem image: | ||
963 | <imagedata fileref="figures/image-generation.png" align="center" width="6in" depth="7in" /> | ||
964 | </para> | ||
965 | |||
966 | <para> | ||
967 | The image generation process consists of several stages and | ||
968 | depends on many variables. | ||
969 | The | ||
970 | <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link> | ||
971 | task uses these key variables | ||
972 | to help create the list of packages to actually install: | ||
973 | <itemizedlist> | ||
974 | <listitem><para><link linkend='var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></link>: | ||
975 | Lists out the base set of packages to install from | ||
976 | the Package Feeds area.</para></listitem> | ||
977 | <listitem><para><link linkend='var-PACKAGE_EXCLUDE'><filename>PACKAGE_EXCLUDE</filename></link>: | ||
978 | Specifies packages that should not be installed. | ||
979 | </para></listitem> | ||
980 | <listitem><para><link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>: | ||
981 | Specifies features to include in the image. | ||
982 | Most of these features map to additional packages for | ||
983 | installation.</para></listitem> | ||
984 | <listitem><para><link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>: | ||
985 | Specifies the package backend to use and consequently | ||
986 | helps determine where to locate packages within the | ||
987 | Package Feeds area.</para></listitem> | ||
988 | <listitem><para><link linkend='var-IMAGE_LINGUAS'><filename>IMAGE_LINGUAS</filename></link>: | ||
989 | Determines the language(s) for which additional | ||
990 | language support packages are installed. | ||
991 | </para></listitem> | ||
992 | </itemizedlist> | ||
993 | </para> | ||
994 | |||
995 | <para> | ||
996 | Package installation is under control of the package manager | ||
997 | (e.g. smart/rpm, opkg, or apt/dpkg) regardless of whether or | ||
998 | not package management is enabled for the target. | ||
999 | At the end of the process, if package management is not | ||
1000 | enabled for the target, the package manager's data files | ||
1001 | are deleted from the root filesystem. | ||
1002 | </para> | ||
1003 | |||
1004 | <para> | ||
1005 | During image generation, the build system attempts to run | ||
1006 | all post-installation scripts. | ||
1007 | Any that fail to run on the build host are run on the | ||
1008 | target when the target system is first booted. | ||
1009 | If you are using a | ||
1010 | <ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-read-only-root-filesystem'>read-only root filesystem</ulink>, | ||
1011 | all the post installation scripts must succeed during the | ||
1012 | package installation phase since the root filesystem is | ||
1013 | read-only. | ||
1014 | </para> | ||
1015 | |||
1016 | <para> | ||
1017 | During Optimization, optimizing processes are run across | ||
1018 | the image. | ||
1019 | These processes include <filename>mklibs</filename> and | ||
1020 | <filename>prelink</filename>. | ||
1021 | The <filename>mklibs</filename> process optimizes the size | ||
1022 | of the libraries. | ||
1023 | A <filename>prelink</filename> process optimizes the dynamic | ||
1024 | linking of shared libraries to reduce start up time of | ||
1025 | executables. | ||
1026 | </para> | ||
1027 | |||
1028 | <para> | ||
1029 | Along with writing out the root filesystem image, the | ||
1030 | <filename>do_rootfs</filename> task creates a manifest file | ||
1031 | (<filename>.manifest</filename>) in the same directory as | ||
1032 | the root filesystem image that lists out, line-by-line, the | ||
1033 | installed packages. | ||
1034 | This manifest file is useful for the | ||
1035 | <link linkend='ref-classes-testimage'><filename>testimage</filename></link> | ||
1036 | class, for example, to determine whether or not to run | ||
1037 | specific tests. | ||
1038 | See the | ||
1039 | <link linkend='var-IMAGE_MANIFEST'><filename>IMAGE_MANIFEST</filename></link> | ||
1040 | variable for additional information. | ||
1041 | </para> | ||
1042 | |||
1043 | <para> | ||
1044 | Part of the image generation process includes compressing the | ||
1045 | root filesystem image. | ||
1046 | Compression is accomplished through several optimization | ||
1047 | routines designed to reduce the overall size of the image. | ||
1048 | </para> | ||
1049 | |||
1050 | <para> | ||
1051 | After the root filesystem has been constructed, the image | ||
1052 | generation process turns everything into an image file or | ||
1053 | a set of image files. | ||
1054 | The formats used for the root filesystem depend on the | ||
1055 | <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link> | ||
1056 | variable. | ||
1057 | </para> | ||
1058 | |||
1059 | <note> | ||
1060 | The entire image generation process is run under Pseudo. | ||
1061 | Running under Pseudo ensures that the files in the root | ||
1062 | filesystem have correct ownership. | ||
1063 | </note> | ||
1064 | </section> | ||
1065 | |||
1066 | <section id='sdk-generation-dev-environment'> | ||
1067 | <title>SDK Generation</title> | ||
1068 | |||
1069 | <para> | ||
1070 | The OpenEmbedded build system uses BitBake to generate the | ||
1071 | Software Development Kit (SDK) installer script: | ||
1072 | <imagedata fileref="figures/sdk-generation.png" align="center" width="6in" depth="7in" /> | ||
1073 | </para> | ||
1074 | |||
1075 | <note> | ||
1076 | For more information on the cross-development toolchain | ||
1077 | generation, see the | ||
1078 | "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>" | ||
1079 | section. | ||
1080 | For information on advantages gained when building a | ||
1081 | cross-development toolchain using the | ||
1082 | <link linkend='ref-tasks-populate_sdk'><filename>do_populate_sdk</filename></link> | ||
1083 | task, see the | ||
1084 | "<ulink url='&YOCTO_DOCS_ADT_URL;#optionally-building-a-toolchain-installer'>Optionally Building a Toolchain Installer</ulink>" | ||
1085 | section in the Yocto Project Application Developer's Guide. | ||
1086 | </note> | ||
1087 | |||
1088 | <para> | ||
1089 | Like image generation, the SDK script process consists of | ||
1090 | several stages and depends on many variables. | ||
1091 | The <filename>do_populate_sdk</filename> task uses these | ||
1092 | key variables to help create the list of packages to actually | ||
1093 | install. | ||
1094 | For information on the variables listed in the figure, see the | ||
1095 | "<link linkend='sdk-dev-environment'>Application Development SDK</link>" | ||
1096 | section. | ||
1097 | </para> | ||
1098 | |||
1099 | <para> | ||
1100 | The <filename>do_populate_sdk</filename> task handles two | ||
1101 | parts: a target part and a host part. | ||
1102 | The target part is the part built for the target hardware and | ||
1103 | includes libraries and headers. | ||
1104 | The host part is the part of the SDK that runs on the | ||
1105 | <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>. | ||
1106 | </para> | ||
1107 | |||
1108 | <para> | ||
1109 | Once both parts are constructed, the | ||
1110 | <filename>do_populate_sdk</filename> task performs some cleanup | ||
1111 | on both parts. | ||
1112 | After the cleanup, the task creates a cross-development | ||
1113 | environment setup script and any configuration files that | ||
1114 | might be needed. | ||
1115 | </para> | ||
1116 | |||
1117 | <para> | ||
1118 | The final output of the task is the Cross-development | ||
1119 | toolchain installation script (<filename>.sh</filename> file), | ||
1120 | which includes the environment setup script. | ||
1121 | </para> | ||
1122 | </section> | ||
1123 | </section> | ||
1124 | |||
1125 | <section id='images-dev-environment'> | ||
1126 | <title>Images</title> | ||
1127 | |||
1128 | <para> | ||
1129 | The images produced by the OpenEmbedded build system | ||
1130 | are compressed forms of the | ||
1131 | root filesystem that are ready to boot on a target device. | ||
1132 | You can see from the | ||
1133 | <link linkend='general-yocto-environment-figure'>general Yocto Project Development Environment figure</link> | ||
1134 | that BitBake output, in part, consists of images. | ||
1135 | This section is going to look more closely at this output: | ||
1136 | <imagedata fileref="figures/images.png" align="center" width="5.5in" depth="5.5in" /> | ||
1137 | </para> | ||
1138 | |||
1139 | <para> | ||
1140 | For a list of example images that the Yocto Project provides, | ||
1141 | see the | ||
1142 | "<link linkend='ref-images'>Images</link>" chapter. | ||
1143 | </para> | ||
1144 | |||
1145 | <para> | ||
1146 | Images are written out to the | ||
1147 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
1148 | inside the <filename>tmp/deploy/images/<machine>/</filename> | ||
1149 | folder as shown in the figure. | ||
1150 | This folder contains any files expected to be loaded on the | ||
1151 | target device. | ||
1152 | The | ||
1153 | <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link> | ||
1154 | variable points to the <filename>deploy</filename> directory, | ||
1155 | while the | ||
1156 | <link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link> | ||
1157 | variable points to the appropriate directory containing images for | ||
1158 | the current configuration. | ||
1159 | <itemizedlist> | ||
1160 | <listitem><para><filename><kernel-image></filename>: | ||
1161 | A kernel binary file. | ||
1162 | The <link linkend='var-KERNEL_IMAGETYPE'><filename>KERNEL_IMAGETYPE</filename></link> | ||
1163 | variable setting determines the naming scheme for the | ||
1164 | kernel image file. | ||
1165 | Depending on that variable, the file could begin with | ||
1166 | a variety of naming strings. | ||
1167 | The <filename>deploy/images/<machine></filename> | ||
1168 | directory can contain multiple image files for the | ||
1169 | machine.</para></listitem> | ||
1170 | <listitem><para><filename><root-filesystem-image></filename>: | ||
1171 | Root filesystems for the target device (e.g. | ||
1172 | <filename>*.ext3</filename> or <filename>*.bz2</filename> | ||
1173 | files). | ||
1174 | The <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link> | ||
1175 | variable setting determines the root filesystem image | ||
1176 | type. | ||
1177 | The <filename>deploy/images/<machine></filename> | ||
1178 | directory can contain multiple root filesystems for the | ||
1179 | machine.</para></listitem> | ||
1180 | <listitem><para><filename><kernel-modules></filename>: | ||
1181 | Tarballs that contain all the modules built for the kernel. | ||
1182 | Kernel module tarballs exist for legacy purposes and | ||
1183 | can be suppressed by setting the | ||
1184 | <link linkend='var-MODULE_TARBALL_DEPLOY'><filename>MODULE_TARBALL_DEPLOY</filename></link> | ||
1185 | variable to "0". | ||
1186 | The <filename>deploy/images/<machine></filename> | ||
1187 | directory can contain multiple kernel module tarballs | ||
1188 | for the machine.</para></listitem> | ||
1189 | <listitem><para><filename><bootloaders></filename>: | ||
1190 | Bootloaders supporting the image, if applicable to the | ||
1191 | target machine. | ||
1192 | The <filename>deploy/images/<machine></filename> | ||
1193 | directory can contain multiple bootloaders for the | ||
1194 | machine.</para></listitem> | ||
1195 | <listitem><para><filename><symlinks></filename>: | ||
1196 | The <filename>deploy/images/<machine></filename> | ||
1197 | folder contains | ||
1198 | a symbolic link that points to the most recently built file | ||
1199 | for each machine. | ||
1200 | These links might be useful for external scripts that | ||
1201 | need to obtain the latest version of each file. | ||
1202 | </para></listitem> | ||
1203 | </itemizedlist> | ||
1204 | </para> | ||
1205 | </section> | ||
1206 | |||
1207 | <section id='sdk-dev-environment'> | ||
1208 | <title>Application Development SDK</title> | ||
1209 | |||
1210 | <para> | ||
1211 | In the | ||
1212 | <link linkend='general-yocto-environment-figure'>general Yocto Project Development Environment figure</link>, | ||
1213 | the output labeled "Application Development SDK" represents an | ||
1214 | SDK. | ||
1215 | This section is going to take a closer look at this output: | ||
1216 | <imagedata fileref="figures/sdk.png" align="center" width="5in" depth="4in" /> | ||
1217 | </para> | ||
1218 | |||
1219 | <para> | ||
1220 | The specific form of this output is a self-extracting | ||
1221 | SDK installer (<filename>*.sh</filename>) that, when run, | ||
1222 | installs the SDK, which consists of a cross-development | ||
1223 | toolchain, a set of libraries and headers, and an SDK | ||
1224 | environment setup script. | ||
1225 | Running this installer essentially sets up your | ||
1226 | cross-development environment. | ||
1227 | You can think of the cross-toolchain as the "host" | ||
1228 | part because it runs on the SDK machine. | ||
1229 | You can think of the libraries and headers as the "target" | ||
1230 | part because they are built for the target hardware. | ||
1231 | The setup script is added so that you can initialize the | ||
1232 | environment before using the tools. | ||
1233 | </para> | ||
1234 | |||
1235 | <note> | ||
1236 | <para> | ||
1237 | The Yocto Project supports several methods by which you can | ||
1238 | set up this cross-development environment. | ||
1239 | These methods include downloading pre-built SDK installers, | ||
1240 | building and installing your own SDK installer, or running | ||
1241 | an Application Development Toolkit (ADT) installer to | ||
1242 | install not just cross-development toolchains | ||
1243 | but also additional tools to help in this type of | ||
1244 | development. | ||
1245 | </para> | ||
1246 | |||
1247 | <para> | ||
1248 | For background information on cross-development toolchains | ||
1249 | in the Yocto Project development environment, see the | ||
1250 | "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>" | ||
1251 | section. | ||
1252 | For information on setting up a cross-development | ||
1253 | environment, see the | ||
1254 | "<ulink url='&YOCTO_DOCS_ADT_URL;#installing-the-adt'>Installing the ADT and Toolchains</ulink>" | ||
1255 | section in the Yocto Project Application Developer's Guide. | ||
1256 | </para> | ||
1257 | </note> | ||
1258 | |||
1259 | <para> | ||
1260 | Once built, the SDK installers are written out to the | ||
1261 | <filename>deploy/sdk</filename> folder inside the | ||
1262 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
1263 | as shown in the figure at the beginning of this section. | ||
1264 | Several variables exist that help configure these files: | ||
1265 | <itemizedlist> | ||
1266 | <listitem><para><link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>: | ||
1267 | Points to the <filename>deploy</filename> | ||
1268 | directory.</para></listitem> | ||
1269 | <listitem><para><link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>: | ||
1270 | Specifies the architecture of the machine | ||
1271 | on which the cross-development tools are run to | ||
1272 | create packages for the target hardware. | ||
1273 | </para></listitem> | ||
1274 | <listitem><para><link linkend='var-SDKIMAGE_FEATURES'><filename>SDKIMAGE_FEATURES</filename></link>: | ||
1275 | Lists the features to include in the "target" part | ||
1276 | of the SDK. | ||
1277 | </para></listitem> | ||
1278 | <listitem><para><link linkend='var-TOOLCHAIN_HOST_TASK'><filename>TOOLCHAIN_HOST_TASK</filename></link>: | ||
1279 | Lists packages that make up the host | ||
1280 | part of the SDK (i.e. the part that runs on | ||
1281 | the <filename>SDKMACHINE</filename>). | ||
1282 | When you use | ||
1283 | <filename>bitbake -c populate_sdk <imagename></filename> | ||
1284 | to create the SDK, a set of default packages | ||
1285 | apply. | ||
1286 | This variable allows you to add more packages. | ||
1287 | </para></listitem> | ||
1288 | <listitem><para><link linkend='var-TOOLCHAIN_TARGET_TASK'><filename>TOOLCHAIN_TARGET_TASK</filename></link>: | ||
1289 | Lists packages that make up the target part | ||
1290 | of the SDK (i.e. the part built for the | ||
1291 | target hardware). | ||
1292 | </para></listitem> | ||
1293 | <listitem><para><link linkend='var-SDKPATH'><filename>SDKPATH</filename></link>: | ||
1294 | Defines the default SDK installation path offered by the | ||
1295 | installation script. | ||
1296 | </para></listitem> | ||
1297 | </itemizedlist> | ||
1298 | </para> | ||
1299 | </section> | ||
1300 | |||
1301 | </chapter> | ||
1302 | <!-- | ||
1303 | vim: expandtab tw=80 ts=4 | ||
1304 | --> | ||
diff --git a/documentation/ref-manual/examples/hello-autotools/hello_2.3.bb b/documentation/ref-manual/examples/hello-autotools/hello_2.3.bb new file mode 100644 index 0000000..5dfb0b3 --- /dev/null +++ b/documentation/ref-manual/examples/hello-autotools/hello_2.3.bb | |||
@@ -0,0 +1,8 @@ | |||
1 | DESCRIPTION = "GNU Helloworld application" | ||
2 | SECTION = "examples" | ||
3 | LICENSE = "GPLv3" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=adefda309052235aa5d1e99ce7557010" | ||
5 | |||
6 | SRC_URI = "${GNU_MIRROR}/hello/hello-${PV}.tar.bz2" | ||
7 | |||
8 | inherit autotools | ||
diff --git a/documentation/ref-manual/examples/hello-single/files/helloworld.c b/documentation/ref-manual/examples/hello-single/files/helloworld.c new file mode 100644 index 0000000..fc7169b --- /dev/null +++ b/documentation/ref-manual/examples/hello-single/files/helloworld.c | |||
@@ -0,0 +1,8 @@ | |||
1 | #include <stdio.h> | ||
2 | |||
3 | int main(void) | ||
4 | { | ||
5 | printf("Hello world!\n"); | ||
6 | |||
7 | return 0; | ||
8 | } | ||
diff --git a/documentation/ref-manual/examples/hello-single/hello.bb b/documentation/ref-manual/examples/hello-single/hello.bb new file mode 100644 index 0000000..0812743 --- /dev/null +++ b/documentation/ref-manual/examples/hello-single/hello.bb | |||
@@ -0,0 +1,17 @@ | |||
1 | DESCRIPTION = "Simple helloworld application" | ||
2 | SECTION = "examples" | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
5 | |||
6 | SRC_URI = "file://helloworld.c" | ||
7 | |||
8 | S = "${WORKDIR}" | ||
9 | |||
10 | do_compile() { | ||
11 | ${CC} helloworld.c -o helloworld | ||
12 | } | ||
13 | |||
14 | do_install() { | ||
15 | install -d ${D}${bindir} | ||
16 | install -m 0755 helloworld ${D}${bindir} | ||
17 | } | ||
diff --git a/documentation/ref-manual/examples/libxpm/libxpm_3.5.6.bb b/documentation/ref-manual/examples/libxpm/libxpm_3.5.6.bb new file mode 100644 index 0000000..b58d4d7 --- /dev/null +++ b/documentation/ref-manual/examples/libxpm/libxpm_3.5.6.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | require xorg-lib-common.inc | ||
2 | |||
3 | DESCRIPTION = "X11 Pixmap library" | ||
4 | LICENSE = "X-BSD" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=3e07763d16963c3af12db271a31abaa5" | ||
6 | DEPENDS += "libxext" | ||
7 | PR = "r2" | ||
8 | PE = "1" | ||
9 | |||
10 | XORG_PN = "libXpm" | ||
11 | |||
12 | PACKAGES =+ "sxpm cxpm" | ||
13 | FILES_cxpm = "${bindir}/cxpm" | ||
14 | FILES_sxpm = "${bindir}/sxpm" | ||
diff --git a/documentation/ref-manual/examples/mtd-makefile/mtd-utils_1.0.0.bb b/documentation/ref-manual/examples/mtd-makefile/mtd-utils_1.0.0.bb new file mode 100644 index 0000000..5d05a43 --- /dev/null +++ b/documentation/ref-manual/examples/mtd-makefile/mtd-utils_1.0.0.bb | |||
@@ -0,0 +1,15 @@ | |||
1 | DESCRIPTION = "Tools for managing memory technology devices." | ||
2 | SECTION = "base" | ||
3 | DEPENDS = "zlib" | ||
4 | HOMEPAGE = "http://www.linux-mtd.infradead.org/" | ||
5 | LICENSE = "GPLv2" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ | ||
7 | file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c" | ||
8 | |||
9 | SRC_URI = "ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-${PV}.tar.gz" | ||
10 | |||
11 | CFLAGS_prepend = "-I ${S}/include " | ||
12 | |||
13 | do_install() { | ||
14 | oe_runmake install DESTDIR=${D} | ||
15 | } | ||
diff --git a/documentation/ref-manual/faq.xml b/documentation/ref-manual/faq.xml new file mode 100644 index 0000000..bc147ce --- /dev/null +++ b/documentation/ref-manual/faq.xml | |||
@@ -0,0 +1,690 @@ | |||
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 | |||
5 | <chapter id='faq'> | ||
6 | <title>FAQ</title> | ||
7 | <qandaset> | ||
8 | <qandaentry> | ||
9 | <question> | ||
10 | <para> | ||
11 | How does Poky differ from <ulink url='&OE_HOME_URL;'>OpenEmbedded</ulink>? | ||
12 | </para> | ||
13 | </question> | ||
14 | <answer> | ||
15 | <para> | ||
16 | The term "<ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink>" | ||
17 | refers to the specific reference build system that | ||
18 | the Yocto Project provides. | ||
19 | Poky is based on <ulink url='&YOCTO_DOCS_DEV_URL;#oe-core'>OE-Core</ulink> | ||
20 | and <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>. | ||
21 | Thus, the generic term used here for the build system is | ||
22 | the "OpenEmbedded build system." | ||
23 | Development in the Yocto Project using Poky is closely tied to OpenEmbedded, with | ||
24 | changes always being merged to OE-Core or BitBake first before being pulled back | ||
25 | into Poky. | ||
26 | This practice benefits both projects immediately. | ||
27 | </para> | ||
28 | </answer> | ||
29 | </qandaentry> | ||
30 | |||
31 | <qandaentry> | ||
32 | <question> | ||
33 | <para id='faq-not-meeting-requirements'> | ||
34 | My development system does not meet the | ||
35 | required Git, tar, and Python versions. | ||
36 | In particular, I do not have Python 2.7.3 or greater, or | ||
37 | I do have Python 3.x, which is specifically not supported by | ||
38 | the Yocto Project. | ||
39 | Can I still use the Yocto Project? | ||
40 | </para> | ||
41 | </question> | ||
42 | <answer> | ||
43 | <para> | ||
44 | You can get the required tools on your host development | ||
45 | system a couple different ways (i.e. building a tarball or | ||
46 | downloading a tarball). | ||
47 | See the | ||
48 | "<link linkend='required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</link>" | ||
49 | section for steps on how to update your build tools. | ||
50 | </para> | ||
51 | </answer> | ||
52 | </qandaentry> | ||
53 | |||
54 | <qandaentry> | ||
55 | <question> | ||
56 | <para> | ||
57 | How can you claim Poky / OpenEmbedded-Core is stable? | ||
58 | </para> | ||
59 | </question> | ||
60 | <answer> | ||
61 | <para> | ||
62 | There are three areas that help with stability; | ||
63 | <itemizedlist> | ||
64 | <listitem><para>The Yocto Project team keeps | ||
65 | <ulink url='&YOCTO_DOCS_DEV_URL;#oe-core'>OE-Core</ulink> small | ||
66 | and focused, containing around 830 recipes as opposed to the thousands | ||
67 | available in other OpenEmbedded community layers. | ||
68 | Keeping it small makes it easy to test and maintain.</para></listitem> | ||
69 | <listitem><para>The Yocto Project team runs manual and automated tests | ||
70 | using a small, fixed set of reference hardware as well as emulated | ||
71 | targets.</para></listitem> | ||
72 | <listitem><para>The Yocto Project uses an autobuilder, | ||
73 | which provides continuous build and integration tests.</para></listitem> | ||
74 | </itemizedlist> | ||
75 | </para> | ||
76 | </answer> | ||
77 | </qandaentry> | ||
78 | |||
79 | <qandaentry> | ||
80 | <question> | ||
81 | <para> | ||
82 | How do I get support for my board added to the Yocto Project? | ||
83 | </para> | ||
84 | </question> | ||
85 | <answer> | ||
86 | <para> | ||
87 | Support for an additional board is added by creating a | ||
88 | Board Support Package (BSP) layer for it. | ||
89 | For more information on how to create a BSP layer, see the | ||
90 | "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>" | ||
91 | section in the Yocto Project Development Manual and the | ||
92 | <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>. | ||
93 | </para> | ||
94 | <para> | ||
95 | Usually, if the board is not completely exotic, adding support in | ||
96 | the Yocto Project is fairly straightforward. | ||
97 | </para> | ||
98 | </answer> | ||
99 | </qandaentry> | ||
100 | |||
101 | <qandaentry> | ||
102 | <question> | ||
103 | <para> | ||
104 | Are there any products built using the OpenEmbedded build system? | ||
105 | </para> | ||
106 | </question> | ||
107 | <answer> | ||
108 | <para> | ||
109 | The software running on the <ulink url='http://vernier.com/labquest/'>Vernier LabQuest</ulink> | ||
110 | is built using the OpenEmbedded build system. | ||
111 | See the <ulink url='http://www.vernier.com/products/interfaces/labq/'>Vernier LabQuest</ulink> | ||
112 | website for more information. | ||
113 | There are a number of pre-production devices using the OpenEmbedded build system | ||
114 | and the Yocto Project team | ||
115 | announces them as soon as they are released. | ||
116 | </para> | ||
117 | </answer> | ||
118 | </qandaentry> | ||
119 | |||
120 | <qandaentry> | ||
121 | <question> | ||
122 | <para> | ||
123 | What does the OpenEmbedded build system produce as output? | ||
124 | </para> | ||
125 | </question> | ||
126 | <answer> | ||
127 | <para> | ||
128 | Because you can use the same set of recipes to create output of | ||
129 | various formats, the output of an OpenEmbedded build depends on | ||
130 | how you start it. | ||
131 | Usually, the output is a flashable image ready for the target | ||
132 | device. | ||
133 | </para> | ||
134 | </answer> | ||
135 | </qandaentry> | ||
136 | |||
137 | <qandaentry> | ||
138 | <question> | ||
139 | <para> | ||
140 | How do I add my package to the Yocto Project? | ||
141 | </para> | ||
142 | </question> | ||
143 | <answer> | ||
144 | <para> | ||
145 | To add a package, you need to create a BitBake recipe. | ||
146 | For information on how to create a BitBake recipe, see the | ||
147 | "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-writing-a-new-recipe'>Writing a New Recipe</ulink>" | ||
148 | in the Yocto Project Development Manual. | ||
149 | </para> | ||
150 | </answer> | ||
151 | </qandaentry> | ||
152 | |||
153 | <qandaentry> | ||
154 | <question> | ||
155 | <para> | ||
156 | Do I have to reflash my entire board with a new Yocto Project image when recompiling | ||
157 | a package? | ||
158 | </para> | ||
159 | </question> | ||
160 | <answer> | ||
161 | <para> | ||
162 | The OpenEmbedded build system can build packages in various | ||
163 | formats such as IPK for OPKG, Debian package | ||
164 | (<filename>.deb</filename>), or RPM. | ||
165 | You can then upgrade the packages using the package tools on | ||
166 | the device, much like on a desktop distribution such as | ||
167 | Ubuntu or Fedora. | ||
168 | However, package management on the target is entirely optional. | ||
169 | </para> | ||
170 | </answer> | ||
171 | </qandaentry> | ||
172 | |||
173 | <qandaentry> | ||
174 | <question> | ||
175 | <para> | ||
176 | What is GNOME Mobile and what is the difference between GNOME Mobile and GNOME? | ||
177 | </para> | ||
178 | </question> | ||
179 | <answer> | ||
180 | <para> | ||
181 | GNOME Mobile is a subset of the <ulink url='http://www.gnome.org'>GNOME</ulink> | ||
182 | platform targeted at mobile and embedded devices. | ||
183 | The main difference between GNOME Mobile and standard GNOME is that | ||
184 | desktop-orientated libraries have been removed, along with deprecated libraries, | ||
185 | creating a much smaller footprint. | ||
186 | </para> | ||
187 | </answer> | ||
188 | </qandaentry> | ||
189 | |||
190 | <qandaentry> | ||
191 | <question> | ||
192 | <para> | ||
193 | I see the error '<filename>chmod: XXXXX new permissions are r-xrwxrwx, not r-xr-xr-x</filename>'. | ||
194 | What is wrong? | ||
195 | </para> | ||
196 | </question> | ||
197 | <answer> | ||
198 | <para> | ||
199 | You are probably running the build on an NTFS filesystem. | ||
200 | Use <filename>ext2</filename>, <filename>ext3</filename>, or <filename>ext4</filename> instead. | ||
201 | </para> | ||
202 | </answer> | ||
203 | </qandaentry> | ||
204 | |||
205 | <!-- <qandaentry> | ||
206 | <question> | ||
207 | <para> | ||
208 | How do I make the Yocto Project work in RHEL/CentOS? | ||
209 | </para> | ||
210 | </question> | ||
211 | <answer> | ||
212 | <para> | ||
213 | To get the Yocto Project working under RHEL/CentOS 5.1 you need to first | ||
214 | install some required packages. | ||
215 | The standard CentOS packages needed are: | ||
216 | <itemizedlist> | ||
217 | <listitem><para>"Development tools" (selected during installation)</para></listitem> | ||
218 | <listitem><para><filename>texi2html</filename></para></listitem> | ||
219 | <listitem><para><filename>compat-gcc-34</filename></para></listitem> | ||
220 | </itemizedlist> | ||
221 | On top of these, you need the following external packages: | ||
222 | <itemizedlist> | ||
223 | <listitem><para><filename>python-sqlite2</filename> from | ||
224 | <ulink url='http://dag.wieers.com/rpm/packages/python-sqlite2/'>DAG repository</ulink> | ||
225 | </para></listitem> | ||
226 | <listitem><para><filename>help2man</filename> from | ||
227 | <ulink url='http://centos.karan.org/el4/extras/stable/x86_64/RPMS/repodata/repoview/help2man-0-1.33.1-2.html'>Karan repository</ulink></para></listitem> | ||
228 | </itemizedlist> | ||
229 | </para> | ||
230 | |||
231 | <para> | ||
232 | Once these packages are installed, the OpenEmbedded build system will be able | ||
233 | to build standard images. | ||
234 | However, there might be a problem with the QEMU emulator segfaulting. | ||
235 | You can either disable the generation of binary locales by setting | ||
236 | <filename><link linkend='var-ENABLE_BINARY_LOCALE_GENERATION'>ENABLE_BINARY_LOCALE_GENERATION</link> | ||
237 | </filename> to "0" or by removing the <filename>linux-2.6-execshield.patch</filename> | ||
238 | from the kernel and rebuilding it since that is the patch that causes the problems with QEMU. | ||
239 | </para> | ||
240 | |||
241 | <note> | ||
242 | <para>For information on distributions that the Yocto Project | ||
243 | uses during validation, see the | ||
244 | <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink> | ||
245 | Wiki page.</para> | ||
246 | <para>For notes about using the Yocto Project on a RHEL 4-based | ||
247 | host, see the | ||
248 | <ulink url='&YOCTO_WIKI_URL;/wiki/BuildingOnRHEL4'>Building on RHEL4</ulink> | ||
249 | Wiki page.</para> | ||
250 | </note> | ||
251 | </answer> | ||
252 | </qandaentry> --> | ||
253 | |||
254 | <qandaentry> | ||
255 | <question> | ||
256 | <para> | ||
257 | I see lots of 404 responses for files on | ||
258 | <filename>&YOCTO_HOME_URL;/sources/*</filename>. Is something wrong? | ||
259 | </para> | ||
260 | </question> | ||
261 | <answer> | ||
262 | <para> | ||
263 | Nothing is wrong. | ||
264 | The OpenEmbedded build system checks any configured source mirrors before downloading | ||
265 | from the upstream sources. | ||
266 | The build system does this searching for both source archives and | ||
267 | pre-checked out versions of SCM-managed software. | ||
268 | These checks help in large installations because it can reduce load on the SCM servers | ||
269 | themselves. | ||
270 | The address above is one of the default mirrors configured into the | ||
271 | build system. | ||
272 | Consequently, if an upstream source disappears, the team | ||
273 | can place sources there so builds continue to work. | ||
274 | </para> | ||
275 | </answer> | ||
276 | </qandaentry> | ||
277 | |||
278 | <qandaentry> | ||
279 | <question> | ||
280 | <para> | ||
281 | I have machine-specific data in a package for one machine only but the package is | ||
282 | being marked as machine-specific in all cases, how do I prevent this? | ||
283 | </para> | ||
284 | </question> | ||
285 | <answer> | ||
286 | <para> | ||
287 | Set <filename><link linkend='var-SRC_URI_OVERRIDES_PACKAGE_ARCH'>SRC_URI_OVERRIDES_PACKAGE_ARCH</link> | ||
288 | </filename> = "0" in the <filename>.bb</filename> file but make sure the package is | ||
289 | manually marked as | ||
290 | machine-specific for the case that needs it. | ||
291 | The code that handles | ||
292 | <filename>SRC_URI_OVERRIDES_PACKAGE_ARCH</filename> is in | ||
293 | the <filename>meta/classes/base.bbclass</filename> file. | ||
294 | </para> | ||
295 | </answer> | ||
296 | </qandaentry> | ||
297 | |||
298 | <qandaentry> | ||
299 | <question> | ||
300 | <para> | ||
301 | I'm behind a firewall and need to use a proxy server. How do I do that? | ||
302 | </para> | ||
303 | </question> | ||
304 | <answer> | ||
305 | <para> | ||
306 | Most source fetching by the OpenEmbedded build system is done by <filename>wget</filename> | ||
307 | and you therefore need to specify the proxy settings in a | ||
308 | <filename>.wgetrc</filename> file in your home directory. | ||
309 | Here are some example settings: | ||
310 | <literallayout class='monospaced'> | ||
311 | http_proxy = http://proxy.yoyodyne.com:18023/ | ||
312 | ftp_proxy = http://proxy.yoyodyne.com:18023/ | ||
313 | </literallayout> | ||
314 | The Yocto Project also includes a | ||
315 | <filename>site.conf.sample</filename> file that shows how to | ||
316 | configure CVS and Git proxy servers if needed. | ||
317 | </para> | ||
318 | </answer> | ||
319 | </qandaentry> | ||
320 | |||
321 | <qandaentry> | ||
322 | <question> | ||
323 | <para> | ||
324 | What’s the difference between <filename>foo</filename> and <filename>foo-native</filename>? | ||
325 | </para> | ||
326 | </question> | ||
327 | <answer> | ||
328 | <para> | ||
329 | The <filename>*-native</filename> targets are designed to run on the system | ||
330 | being used for the build. | ||
331 | These are usually tools that are needed to assist the build in some way such as | ||
332 | <filename>quilt-native</filename>, which is used to apply patches. | ||
333 | The non-native version is the one that runs on the target device. | ||
334 | </para> | ||
335 | </answer> | ||
336 | </qandaentry> | ||
337 | |||
338 | <qandaentry> | ||
339 | <question> | ||
340 | <para> | ||
341 | I'm seeing random build failures. Help?! | ||
342 | </para> | ||
343 | </question> | ||
344 | <answer> | ||
345 | <para> | ||
346 | If the same build is failing in totally different and random | ||
347 | ways, the most likely explanation is: | ||
348 | <itemizedlist> | ||
349 | <listitem><para>The hardware you are running the build on | ||
350 | has some problem.</para></listitem> | ||
351 | <listitem><para>You are running the build under | ||
352 | virtualization, in which case the virtualization | ||
353 | probably has bugs.</para></listitem> | ||
354 | </itemizedlist> | ||
355 | The OpenEmbedded build system processes a massive amount of | ||
356 | data that causes lots of network, disk and CPU activity and | ||
357 | is sensitive to even single-bit failures in any of these areas. | ||
358 | True random failures have always been traced back to hardware | ||
359 | or virtualization issues. | ||
360 | </para> | ||
361 | </answer> | ||
362 | </qandaentry> | ||
363 | |||
364 | <qandaentry> | ||
365 | <question> | ||
366 | <para> | ||
367 | What do we need to ship for license compliance? | ||
368 | </para> | ||
369 | </question> | ||
370 | <answer> | ||
371 | <para> | ||
372 | This is a difficult question and you need to consult your lawyer | ||
373 | for the answer for your specific case. | ||
374 | It is worth bearing in mind that for GPL compliance, there needs | ||
375 | to be enough information shipped to allow someone else to | ||
376 | rebuild and produce the same end result you are shipping. | ||
377 | This means sharing the source code, any patches applied to it, | ||
378 | and also any configuration information about how that package | ||
379 | was configured and built. | ||
380 | </para> | ||
381 | |||
382 | <para> | ||
383 | You can find more information on licensing in the | ||
384 | "<ulink url='&YOCTO_DOCS_DEV_URL;#licensing'>Licensing</ulink>" | ||
385 | and "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>" | ||
386 | sections, both of which are in the Yocto Project Development | ||
387 | Manual. | ||
388 | </para> | ||
389 | </answer> | ||
390 | </qandaentry> | ||
391 | |||
392 | <qandaentry> | ||
393 | <question> | ||
394 | <para> | ||
395 | How do I disable the cursor on my touchscreen device? | ||
396 | </para> | ||
397 | </question> | ||
398 | <answer> | ||
399 | <para> | ||
400 | You need to create a form factor file as described in the | ||
401 | "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout-misc-recipes'>Miscellaneous BSP-Specific Recipe Files</ulink>" | ||
402 | section in the Yocto Project Board Support Packages (BSP) | ||
403 | Developer's Guide. | ||
404 | Set the <filename>HAVE_TOUCHSCREEN</filename> variable equal to | ||
405 | one as follows: | ||
406 | <literallayout class='monospaced'> | ||
407 | HAVE_TOUCHSCREEN=1 | ||
408 | </literallayout> | ||
409 | </para> | ||
410 | </answer> | ||
411 | </qandaentry> | ||
412 | |||
413 | <qandaentry> | ||
414 | <question> | ||
415 | <para> | ||
416 | How do I make sure connected network interfaces are brought up by default? | ||
417 | </para> | ||
418 | </question> | ||
419 | <answer> | ||
420 | <para> | ||
421 | The default interfaces file provided by the netbase recipe does not | ||
422 | automatically bring up network interfaces. | ||
423 | Therefore, you will need to add a BSP-specific netbase that includes an interfaces | ||
424 | file. | ||
425 | See the "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout-misc-recipes'>Miscellaneous BSP-Specific Recipe Files</ulink>" | ||
426 | section in the Yocto Project Board Support Packages (BSP) | ||
427 | Developer's Guide for information on creating these types of | ||
428 | miscellaneous recipe files. | ||
429 | </para> | ||
430 | <para> | ||
431 | For example, add the following files to your layer: | ||
432 | <literallayout class='monospaced'> | ||
433 | meta-MACHINE/recipes-bsp/netbase/netbase/MACHINE/interfaces | ||
434 | meta-MACHINE/recipes-bsp/netbase/netbase_5.0.bbappend | ||
435 | </literallayout> | ||
436 | </para> | ||
437 | </answer> | ||
438 | </qandaentry> | ||
439 | |||
440 | <qandaentry> | ||
441 | <question> | ||
442 | <para> | ||
443 | How do I create images with more free space? | ||
444 | </para> | ||
445 | </question> | ||
446 | <answer> | ||
447 | <para> | ||
448 | By default, the OpenEmbedded build system creates images | ||
449 | that are 1.3 times the size of the populated root filesystem. | ||
450 | To affect the image size, you need to set various | ||
451 | configurations: | ||
452 | <itemizedlist> | ||
453 | <listitem><para><emphasis>Image Size:</emphasis> | ||
454 | The OpenEmbedded build system uses the | ||
455 | <link linkend='var-IMAGE_ROOTFS_SIZE'><filename>IMAGE_ROOTFS_SIZE</filename></link> | ||
456 | variable to define the size of the image in Kbytes. | ||
457 | The build system determines the size by taking into | ||
458 | account the initial root filesystem size before any | ||
459 | modifications such as requested size for the image and | ||
460 | any requested additional free disk space to be | ||
461 | added to the image.</para></listitem> | ||
462 | <listitem><para><emphasis>Overhead:</emphasis> | ||
463 | Use the | ||
464 | <link linkend='var-IMAGE_OVERHEAD_FACTOR'><filename>IMAGE_OVERHEAD_FACTOR</filename></link> | ||
465 | variable to define the multiplier that the build system | ||
466 | applies to the initial image size, which is 1.3 by | ||
467 | default.</para></listitem> | ||
468 | <listitem><para><emphasis>Additional Free Space:</emphasis> | ||
469 | Use the | ||
470 | <link linkend='var-IMAGE_ROOTFS_EXTRA_SPACE'><filename>IMAGE_ROOTFS_EXTRA_SPACE</filename></link> | ||
471 | variable to add additional free space to the image. | ||
472 | The build system adds this space to the image after | ||
473 | it determines its | ||
474 | <filename>IMAGE_ROOTFS_SIZE</filename>. | ||
475 | </para></listitem> | ||
476 | </itemizedlist> | ||
477 | </para> | ||
478 | </answer> | ||
479 | </qandaentry> | ||
480 | |||
481 | <qandaentry> | ||
482 | <question> | ||
483 | <para> | ||
484 | Why don't you support directories with spaces in the pathnames? | ||
485 | </para> | ||
486 | </question> | ||
487 | <answer> | ||
488 | <para> | ||
489 | The Yocto Project team has tried to do this before but too | ||
490 | many of the tools the OpenEmbedded build system depends on, | ||
491 | such as <filename>autoconf</filename>, break when they find | ||
492 | spaces in pathnames. | ||
493 | Until that situation changes, the team will not support spaces | ||
494 | in pathnames. | ||
495 | </para> | ||
496 | </answer> | ||
497 | </qandaentry> | ||
498 | |||
499 | <qandaentry> | ||
500 | <question> | ||
501 | <para> | ||
502 | How do I use an external toolchain? | ||
503 | </para> | ||
504 | </question> | ||
505 | <answer> | ||
506 | <para> | ||
507 | The toolchain configuration is very flexible and customizable. | ||
508 | It is primarily controlled with the | ||
509 | <filename><link linkend='var-TCMODE'>TCMODE</link></filename> | ||
510 | variable. | ||
511 | This variable controls which <filename>tcmode-*.inc</filename> | ||
512 | file to include from the | ||
513 | <filename>meta/conf/distro/include</filename> directory within | ||
514 | the | ||
515 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
516 | </para> | ||
517 | |||
518 | <para> | ||
519 | The default value of <filename>TCMODE</filename> is "default", | ||
520 | which tells the OpenEmbedded build system to use its internally | ||
521 | built toolchain (i.e. <filename>tcmode-default.inc</filename>). | ||
522 | However, other patterns are accepted. | ||
523 | In particular, "external-*" refers to external toolchains. | ||
524 | One example is the Sourcery G++ Toolchain. | ||
525 | The support for this toolchain resides in the separate | ||
526 | <filename>meta-sourcery</filename> layer at | ||
527 | <ulink url='http://github.com/MentorEmbedded/meta-sourcery/'></ulink>. | ||
528 | </para> | ||
529 | |||
530 | <para> | ||
531 | In addition to the toolchain configuration, you also need a | ||
532 | corresponding toolchain recipe file. | ||
533 | This recipe file needs to package up any pre-built objects in | ||
534 | the toolchain such as <filename>libgcc</filename>, | ||
535 | <filename>libstdcc++</filename>, any locales, and | ||
536 | <filename>libc</filename>. | ||
537 | </para> | ||
538 | </answer> | ||
539 | </qandaentry> | ||
540 | |||
541 | <qandaentry> | ||
542 | <question> | ||
543 | <para id='how-does-the-yocto-project-obtain-source-code-and-will-it-work-behind-my-firewall-or-proxy-server'> | ||
544 | How does the OpenEmbedded build system obtain source code and | ||
545 | will it work behind my firewall or proxy server? | ||
546 | </para> | ||
547 | </question> | ||
548 | <answer> | ||
549 | <para> | ||
550 | The way the build system obtains source code is highly | ||
551 | configurable. | ||
552 | You can setup the build system to get source code in most | ||
553 | environments if HTTP transport is available. | ||
554 | </para> | ||
555 | <para> | ||
556 | When the build system searches for source code, it first | ||
557 | tries the local download directory. | ||
558 | If that location fails, Poky tries | ||
559 | <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>, | ||
560 | the upstream source, and then | ||
561 | <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link> | ||
562 | in that order. | ||
563 | </para> | ||
564 | <para> | ||
565 | Assuming your distribution is "poky", the OpenEmbedded build | ||
566 | system uses the Yocto Project source | ||
567 | <filename>PREMIRRORS</filename> by default for SCM-based | ||
568 | sources, upstreams for normal tarballs, and then falls back | ||
569 | to a number of other mirrors including the Yocto Project | ||
570 | source mirror if those fail. | ||
571 | </para> | ||
572 | <para> | ||
573 | As an example, you could add a specific server for the | ||
574 | build system to attempt before any others by adding something | ||
575 | like the following to the <filename>local.conf</filename> | ||
576 | configuration file: | ||
577 | <literallayout class='monospaced'> | ||
578 | PREMIRRORS_prepend = "\ | ||
579 | git://.*/.* http://www.yoctoproject.org/sources/ \n \ | ||
580 | ftp://.*/.* http://www.yoctoproject.org/sources/ \n \ | ||
581 | http://.*/.* http://www.yoctoproject.org/sources/ \n \ | ||
582 | https://.*/.* http://www.yoctoproject.org/sources/ \n" | ||
583 | </literallayout> | ||
584 | </para> | ||
585 | <para> | ||
586 | These changes cause the build system to intercept Git, FTP, | ||
587 | HTTP, and HTTPS requests and direct them to the | ||
588 | <filename>http://</filename> sources mirror. | ||
589 | You can use <filename>file://</filename> URLs to point to | ||
590 | local directories or network shares as well. | ||
591 | </para> | ||
592 | <para> | ||
593 | Aside from the previous technique, these options also exist: | ||
594 | <literallayout class='monospaced'> | ||
595 | BB_NO_NETWORK = "1" | ||
596 | </literallayout> | ||
597 | This statement tells BitBake to issue an error instead of | ||
598 | trying to access the Internet. | ||
599 | This technique is useful if you want to ensure code builds | ||
600 | only from local sources. | ||
601 | </para> | ||
602 | <para> | ||
603 | Here is another technique: | ||
604 | <literallayout class='monospaced'> | ||
605 | BB_FETCH_PREMIRRORONLY = "1" | ||
606 | </literallayout> | ||
607 | This statement limits the build system to pulling source | ||
608 | from the <filename>PREMIRRORS</filename> only. | ||
609 | Again, this technique is useful for reproducing builds. | ||
610 | </para> | ||
611 | <para> | ||
612 | Here is another technique: | ||
613 | <literallayout class='monospaced'> | ||
614 | BB_GENERATE_MIRROR_TARBALLS = "1" | ||
615 | </literallayout> | ||
616 | This statement tells the build system to generate mirror | ||
617 | tarballs. | ||
618 | This technique is useful if you want to create a mirror server. | ||
619 | If not, however, the technique can simply waste time during | ||
620 | the build. | ||
621 | </para> | ||
622 | <para> | ||
623 | Finally, consider an example where you are behind an | ||
624 | HTTP-only firewall. | ||
625 | You could make the following changes to the | ||
626 | <filename>local.conf</filename> configuration file as long as | ||
627 | the <filename>PREMIRRORS</filename> server is current: | ||
628 | <literallayout class='monospaced'> | ||
629 | PREMIRRORS_prepend = "\ | ||
630 | ftp://.*/.* http://www.yoctoproject.org/sources/ \n \ | ||
631 | http://.*/.* http://www.yoctoproject.org/sources/ \n \ | ||
632 | https://.*/.* http://www.yoctoproject.org/sources/ \n" | ||
633 | BB_FETCH_PREMIRRORONLY = "1" | ||
634 | </literallayout> | ||
635 | These changes would cause the build system to successfully | ||
636 | fetch source over HTTP and any network accesses to anything | ||
637 | other than the <filename>PREMIRRORS</filename> would fail. | ||
638 | </para> | ||
639 | <para> | ||
640 | The build system also honors the standard shell environment | ||
641 | variables <filename>http_proxy</filename>, | ||
642 | <filename>ftp_proxy</filename>, | ||
643 | <filename>https_proxy</filename>, and | ||
644 | <filename>all_proxy</filename> to redirect requests through | ||
645 | proxy servers. | ||
646 | </para> | ||
647 | <note> | ||
648 | You can find more information on the | ||
649 | "<ulink url='&YOCTO_WIKI_URL;/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>" | ||
650 | Wiki page. | ||
651 | </note> | ||
652 | </answer> | ||
653 | </qandaentry> | ||
654 | |||
655 | <qandaentry> | ||
656 | <question> | ||
657 | <para> | ||
658 | Can I get rid of build output so I can start over? | ||
659 | </para> | ||
660 | </question> | ||
661 | <answer> | ||
662 | <para> | ||
663 | Yes - you can easily do this. | ||
664 | When you use BitBake to build an image, all the build output | ||
665 | goes into the directory created when you run the | ||
666 | build environment setup script (i.e. | ||
667 | <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link> | ||
668 | or | ||
669 | <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>). | ||
670 | By default, this <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
671 | is named <filename>build</filename> but can be named | ||
672 | anything you want. | ||
673 | </para> | ||
674 | |||
675 | <para> | ||
676 | Within the Build Directory, is the <filename>tmp</filename> | ||
677 | directory. | ||
678 | To remove all the build output yet preserve any source code or | ||
679 | downloaded files from previous builds, simply remove the | ||
680 | <filename>tmp</filename> directory. | ||
681 | </para> | ||
682 | </answer> | ||
683 | </qandaentry> | ||
684 | |||
685 | |||
686 | </qandaset> | ||
687 | </chapter> | ||
688 | <!-- | ||
689 | vim: expandtab tw=80 ts=4 | ||
690 | --> | ||
diff --git a/documentation/ref-manual/figures/analysis-for-package-splitting.png b/documentation/ref-manual/figures/analysis-for-package-splitting.png new file mode 100644 index 0000000..04f2794 --- /dev/null +++ b/documentation/ref-manual/figures/analysis-for-package-splitting.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/buildhistory-web.png b/documentation/ref-manual/figures/buildhistory-web.png new file mode 100644 index 0000000..f6db86c --- /dev/null +++ b/documentation/ref-manual/figures/buildhistory-web.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/buildhistory.png b/documentation/ref-manual/figures/buildhistory.png new file mode 100644 index 0000000..edf98d9 --- /dev/null +++ b/documentation/ref-manual/figures/buildhistory.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/configuration-compile-autoreconf.png b/documentation/ref-manual/figures/configuration-compile-autoreconf.png new file mode 100644 index 0000000..a07464f --- /dev/null +++ b/documentation/ref-manual/figures/configuration-compile-autoreconf.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/cross-development-toolchains.png b/documentation/ref-manual/figures/cross-development-toolchains.png new file mode 100644 index 0000000..d36670a --- /dev/null +++ b/documentation/ref-manual/figures/cross-development-toolchains.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/image-generation.png b/documentation/ref-manual/figures/image-generation.png new file mode 100644 index 0000000..ab96258 --- /dev/null +++ b/documentation/ref-manual/figures/image-generation.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/images.png b/documentation/ref-manual/figures/images.png new file mode 100644 index 0000000..d99eac1 --- /dev/null +++ b/documentation/ref-manual/figures/images.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/layer-input.png b/documentation/ref-manual/figures/layer-input.png new file mode 100644 index 0000000..0a4f2e7 --- /dev/null +++ b/documentation/ref-manual/figures/layer-input.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/package-feeds.png b/documentation/ref-manual/figures/package-feeds.png new file mode 100644 index 0000000..4bc311f --- /dev/null +++ b/documentation/ref-manual/figures/package-feeds.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/patching.png b/documentation/ref-manual/figures/patching.png new file mode 100644 index 0000000..8ecd018 --- /dev/null +++ b/documentation/ref-manual/figures/patching.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/poky-title.png b/documentation/ref-manual/figures/poky-title.png new file mode 100644 index 0000000..2893d84 --- /dev/null +++ b/documentation/ref-manual/figures/poky-title.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/sdk-generation.png b/documentation/ref-manual/figures/sdk-generation.png new file mode 100644 index 0000000..c37e274 --- /dev/null +++ b/documentation/ref-manual/figures/sdk-generation.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/sdk.png b/documentation/ref-manual/figures/sdk.png new file mode 100644 index 0000000..a539cc5 --- /dev/null +++ b/documentation/ref-manual/figures/sdk.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/source-fetching.png b/documentation/ref-manual/figures/source-fetching.png new file mode 100644 index 0000000..26aefb5 --- /dev/null +++ b/documentation/ref-manual/figures/source-fetching.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/source-input.png b/documentation/ref-manual/figures/source-input.png new file mode 100644 index 0000000..f751505 --- /dev/null +++ b/documentation/ref-manual/figures/source-input.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/user-configuration.png b/documentation/ref-manual/figures/user-configuration.png new file mode 100644 index 0000000..f2b3f8e --- /dev/null +++ b/documentation/ref-manual/figures/user-configuration.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/figures/yocto-environment-ref.png b/documentation/ref-manual/figures/yocto-environment-ref.png new file mode 100644 index 0000000..650c6c8 --- /dev/null +++ b/documentation/ref-manual/figures/yocto-environment-ref.png | |||
Binary files differ | |||
diff --git a/documentation/ref-manual/introduction.xml b/documentation/ref-manual/introduction.xml new file mode 100644 index 0000000..a61740d --- /dev/null +++ b/documentation/ref-manual/introduction.xml | |||
@@ -0,0 +1,560 @@ | |||
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 | |||
5 | <chapter id='intro'> | ||
6 | <title>Introduction</title> | ||
7 | |||
8 | <section id='intro-welcome'> | ||
9 | <title>Introduction</title> | ||
10 | |||
11 | <para> | ||
12 | This manual provides reference information for the current release of the Yocto Project. | ||
13 | The Yocto Project is an open-source collaboration project focused on embedded Linux | ||
14 | developers. | ||
15 | Amongst other things, the Yocto Project uses the OpenEmbedded build system, which | ||
16 | is based on the Poky project, to construct complete Linux images. | ||
17 | You can find complete introductory and getting started information on the Yocto Project | ||
18 | by reading the | ||
19 | <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink>. | ||
20 | For task-based information using the Yocto Project, see the | ||
21 | <ulink url='&YOCTO_DOCS_DEV_URL;'>Yocto Project Development Manual</ulink> | ||
22 | and the <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>. | ||
23 | For Board Support Package (BSP) structure information, see the | ||
24 | <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>. | ||
25 | You can find information on tracing and profiling in the | ||
26 | <ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual'>Yocto Project Profiling and Tracing Manual</ulink>. | ||
27 | For information on BitBake, which is the task execution tool the | ||
28 | OpenEmbedded build system is based on, see the | ||
29 | <ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual'>BitBake User Manual</ulink>. | ||
30 | Finally, you can also find lots of Yocto Project information on the | ||
31 | <ulink url="&YOCTO_HOME_URL;">Yocto Project website</ulink>. | ||
32 | </para> | ||
33 | </section> | ||
34 | |||
35 | <section id='intro-manualoverview'> | ||
36 | <title>Documentation Overview</title> | ||
37 | <para> | ||
38 | This reference manual consists of the following: | ||
39 | <itemizedlist> | ||
40 | <listitem><para><emphasis> | ||
41 | <link linkend='usingpoky'>Using the Yocto Project</link>:</emphasis> | ||
42 | Provides an overview of the components that make up the Yocto Project | ||
43 | followed by information about debugging images created in the Yocto Project. | ||
44 | </para></listitem> | ||
45 | <listitem><para><emphasis> | ||
46 | <link linkend='closer-look'>A Closer Look at the Yocto Project Development Environment</link>:</emphasis> | ||
47 | Provides a more detailed look at the Yocto Project development | ||
48 | environment within the context of development. | ||
49 | </para></listitem> | ||
50 | <listitem><para><emphasis> | ||
51 | <link linkend='technical-details'>Technical Details</link>:</emphasis> | ||
52 | Describes fundamental Yocto Project components as well as an explanation | ||
53 | behind how the Yocto Project uses shared state (sstate) cache to speed build time. | ||
54 | </para></listitem> | ||
55 | <listitem><para><emphasis> | ||
56 | <link linkend='migration'>Migrating to a Newer Yocto Project Release</link>:</emphasis> | ||
57 | Describes release-specific information that helps you move from | ||
58 | one Yocto Project Release to another. | ||
59 | </para></listitem> | ||
60 | <listitem><para><emphasis> | ||
61 | <link linkend='ref-structure'>Directory Structure</link>:</emphasis> | ||
62 | Describes the | ||
63 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> created | ||
64 | either by unpacking a released Yocto Project tarball on your host development system, | ||
65 | or by cloning the upstream | ||
66 | <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink> Git repository. | ||
67 | </para></listitem> | ||
68 | <listitem><para><emphasis> | ||
69 | <link linkend='ref-classes'>Classes</link>:</emphasis> | ||
70 | Describes the classes used in the Yocto Project.</para></listitem> | ||
71 | <listitem><para><emphasis> | ||
72 | <link linkend='ref-tasks'>Tasks</link>:</emphasis> | ||
73 | Describes the tasks defined by the OpenEmbedded build system. | ||
74 | </para></listitem> | ||
75 | <listitem><para><emphasis> | ||
76 | <link linkend='ref-images'>Images</link>:</emphasis> | ||
77 | Describes the standard images that the Yocto Project supports. | ||
78 | </para></listitem> | ||
79 | <listitem><para><emphasis> | ||
80 | <link linkend='ref-features'>Features</link>:</emphasis> | ||
81 | Describes mechanisms for creating distribution, machine, and image | ||
82 | features during the build process using the OpenEmbedded build system.</para></listitem> | ||
83 | <listitem><para><emphasis> | ||
84 | <link linkend='ref-variables-glos'>Variables Glossary</link>:</emphasis> | ||
85 | Presents most variables used by the OpenEmbedded build system, which | ||
86 | uses BitBake. | ||
87 | Entries describe the function of the variable and how to apply them. | ||
88 | </para></listitem> | ||
89 | <listitem><para><emphasis> | ||
90 | <link linkend='ref-varlocality'>Variable Context</link>:</emphasis> | ||
91 | Provides variable locality or context.</para></listitem> | ||
92 | <listitem><para><emphasis> | ||
93 | <link linkend='faq'>FAQ</link>:</emphasis> | ||
94 | Provides answers for commonly asked questions in the Yocto Project | ||
95 | development environment.</para></listitem> | ||
96 | <listitem><para><emphasis> | ||
97 | <link linkend='resources'>Contributing to the Yocto Project</link>:</emphasis> | ||
98 | Provides guidance on how you can contribute back to the Yocto | ||
99 | Project.</para></listitem> | ||
100 | </itemizedlist> | ||
101 | </para> | ||
102 | </section> | ||
103 | |||
104 | |||
105 | <section id='intro-requirements'> | ||
106 | <title>System Requirements</title> | ||
107 | <para> | ||
108 | For general Yocto Project system requirements, see the | ||
109 | "<ulink url='&YOCTO_DOCS_QS_URL;#yp-resources'>What You Need and How You Get It</ulink>" section | ||
110 | in the Yocto Project Quick Start. | ||
111 | The remainder of this section provides details on system requirements | ||
112 | not covered in the Yocto Project Quick Start. | ||
113 | </para> | ||
114 | |||
115 | <section id='detailed-supported-distros'> | ||
116 | <title>Supported Linux Distributions</title> | ||
117 | |||
118 | <para> | ||
119 | Currently, the Yocto Project is supported on the following | ||
120 | distributions: | ||
121 | <note> | ||
122 | <para> | ||
123 | Yocto Project releases are tested against the stable Linux | ||
124 | distributions in the following list. | ||
125 | The Yocto Project should work on other distributions but | ||
126 | validation is not performed against them. | ||
127 | </para> | ||
128 | |||
129 | <para> | ||
130 | In particular, the Yocto Project does not support | ||
131 | and currently has no plans to support | ||
132 | rolling-releases or development distributions due to their | ||
133 | constantly changing nature. | ||
134 | We welcome patches and bug reports, but keep in mind that | ||
135 | our priority is on the supported platforms listed below. | ||
136 | </para> | ||
137 | |||
138 | <para> | ||
139 | If you encounter problems, please go to | ||
140 | <ulink url='&YOCTO_BUGZILLA_URL;'>Yocto Project Bugzilla</ulink> | ||
141 | and submit a bug. | ||
142 | We are interested in hearing about your experience. | ||
143 | </para> | ||
144 | </note> | ||
145 | <itemizedlist> | ||
146 | <!-- <listitem><para>Ubuntu 10.04</para></listitem> | ||
147 | <listitem><para>Ubuntu 11.10</para></listitem> --> | ||
148 | <listitem><para>Ubuntu 12.04 (LTS)</para></listitem> | ||
149 | <listitem><para>Ubuntu 13.10</para></listitem> | ||
150 | <listitem><para>Ubuntu 14.04 (LTS)</para></listitem> | ||
151 | <!-- <listitem><para>Fedora 16 (Verne)</para></listitem> | ||
152 | <listitem><para>Fedora 17 (Spherical)</para></listitem> --> | ||
153 | <listitem><para>Fedora release 19 (Schrödinger's Cat)</para></listitem> | ||
154 | <listitem><para>Fedora release 20 (Heisenbug)</para></listitem> | ||
155 | <!-- <listitem><para>CentOS release 5.6 (Final)</para></listitem> | ||
156 | <listitem><para>CentOS release 5.7 (Final)</para></listitem> | ||
157 | <listitem><para>CentOS release 5.8 (Final)</para></listitem> | ||
158 | <listitem><para>CentOS release 6.3 (Final)</para></listitem> --> | ||
159 | <listitem><para>CentOS release 6.4</para></listitem> | ||
160 | <listitem><para>CentOS release 6.5</para></listitem> | ||
161 | <!-- <listitem><para>Debian GNU/Linux 6.0 (Squeeze)</para></listitem> --> | ||
162 | <listitem><para>Debian GNU/Linux 7.0 (Wheezy)</para></listitem> | ||
163 | <listitem><para>Debian GNU/Linux 7.1 (Wheezy)</para></listitem> | ||
164 | <listitem><para>Debian GNU/Linux 7.2 (Wheezy)</para></listitem> | ||
165 | <listitem><para>Debian GNU/Linux 7.3 (Wheezy)</para></listitem> | ||
166 | <listitem><para>Debian GNU/Linux 7.4 (Wheezy)</para></listitem> | ||
167 | <!-- <listitem><para>openSUSE 11.4</para></listitem> | ||
168 | <listitem><para>openSUSE 12.1</para></listitem> --> | ||
169 | <listitem><para>openSUSE 12.2</para></listitem> | ||
170 | <listitem><para>openSUSE 12.3</para></listitem> | ||
171 | <listitem><para>openSUSE 13.1</para></listitem> | ||
172 | </itemizedlist> | ||
173 | </para> | ||
174 | |||
175 | <note> | ||
176 | While the Yocto Project Team attempts to ensure all Yocto Project | ||
177 | releases are one hundred percent compatible with each officially | ||
178 | supported Linux distribution, instances might exist where you | ||
179 | encounter a problem while using the Yocto Project on a specific | ||
180 | distribution. | ||
181 | For example, the CentOS 6.4 distribution does not include the | ||
182 | Gtk+ 2.20.0 and PyGtk 2.21.0 (or higher) packages, which are | ||
183 | required to run | ||
184 | <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/hob'>Hob</ulink>. | ||
185 | </note> | ||
186 | </section> | ||
187 | |||
188 | <section id='required-packages-for-the-host-development-system'> | ||
189 | <title>Required Packages for the Host Development System</title> | ||
190 | |||
191 | <para> | ||
192 | The list of packages you need on the host development system can | ||
193 | be large when covering all build scenarios using the Yocto Project. | ||
194 | This section provides required packages according to | ||
195 | Linux distribution and function. | ||
196 | </para> | ||
197 | |||
198 | <section id='ubuntu-packages'> | ||
199 | <title>Ubuntu and Debian</title> | ||
200 | |||
201 | <para> | ||
202 | The following list shows the required packages by function | ||
203 | given a supported Ubuntu or Debian Linux distribution: | ||
204 | <itemizedlist> | ||
205 | <listitem><para><emphasis>Essentials:</emphasis> | ||
206 | Packages needed to build an image on a headless | ||
207 | system: | ||
208 | <literallayout class='monospaced'> | ||
209 | $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL; | ||
210 | </literallayout></para></listitem> | ||
211 | <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis> | ||
212 | Packages recommended if the host system has graphics | ||
213 | support or if you are going to use the Eclipse | ||
214 | IDE: | ||
215 | <literallayout class='monospaced'> | ||
216 | $ sudo apt-get install libsdl1.2-dev xterm | ||
217 | </literallayout></para></listitem> | ||
218 | <listitem><para><emphasis>Documentation:</emphasis> | ||
219 | Packages needed if you are going to build out the | ||
220 | Yocto Project documentation manuals: | ||
221 | <literallayout class='monospaced'> | ||
222 | $ sudo apt-get install make xsltproc docbook-utils fop dblatex xmlto | ||
223 | </literallayout></para></listitem> | ||
224 | <listitem><para><emphasis>ADT Installer Extras:</emphasis> | ||
225 | Packages needed if you are going to be using the | ||
226 | <ulink url='&YOCTO_DOCS_ADT_URL;#using-the-adt-installer'>Application Development Toolkit (ADT) Installer</ulink>: | ||
227 | <literallayout class='monospaced'> | ||
228 | $ sudo apt-get install autoconf automake libtool libglib2.0-dev | ||
229 | </literallayout></para></listitem> | ||
230 | </itemizedlist> | ||
231 | </para> | ||
232 | </section> | ||
233 | |||
234 | <section id='fedora-packages'> | ||
235 | <title>Fedora Packages</title> | ||
236 | |||
237 | <para> | ||
238 | The following list shows the required packages by function | ||
239 | given a supported Fedora Linux distribution: | ||
240 | <itemizedlist> | ||
241 | <listitem><para><emphasis>Essentials:</emphasis> | ||
242 | Packages needed to build an image for a headless | ||
243 | system: | ||
244 | <literallayout class='monospaced'> | ||
245 | $ sudo yum install &FEDORA_HOST_PACKAGES_ESSENTIAL; | ||
246 | </literallayout></para></listitem> | ||
247 | <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis> | ||
248 | Packages recommended if the host system has graphics | ||
249 | support or if you are going to use the Eclipse | ||
250 | IDE: | ||
251 | <literallayout class='monospaced'> | ||
252 | $ sudo yum install SDL-devel xterm perl-Thread-Queue | ||
253 | </literallayout></para></listitem> | ||
254 | <listitem><para><emphasis>Documentation:</emphasis> | ||
255 | Packages needed if you are going to build out the | ||
256 | Yocto Project documentation manuals: | ||
257 | <literallayout class='monospaced'> | ||
258 | $ sudo yum install make docbook-style-dsssl docbook-style-xsl \ | ||
259 | docbook-dtds docbook-utils fop libxslt dblatex xmlto | ||
260 | </literallayout></para></listitem> | ||
261 | <listitem><para><emphasis>ADT Installer Extras:</emphasis> | ||
262 | Packages needed if you are going to be using the | ||
263 | <ulink url='&YOCTO_DOCS_ADT_URL;#using-the-adt-installer'>Application Development Toolkit (ADT) Installer</ulink>: | ||
264 | <literallayout class='monospaced'> | ||
265 | $ sudo yum install autoconf automake libtool glib2-devel | ||
266 | </literallayout></para></listitem> | ||
267 | </itemizedlist> | ||
268 | </para> | ||
269 | </section> | ||
270 | |||
271 | <section id='opensuse-packages'> | ||
272 | <title>openSUSE Packages</title> | ||
273 | |||
274 | <para> | ||
275 | The following list shows the required packages by function | ||
276 | given a supported openSUSE Linux distribution: | ||
277 | <itemizedlist> | ||
278 | <listitem><para><emphasis>Essentials:</emphasis> | ||
279 | Packages needed to build an image for a headless | ||
280 | system: | ||
281 | <literallayout class='monospaced'> | ||
282 | $ sudo zypper install &OPENSUSE_HOST_PACKAGES_ESSENTIAL; | ||
283 | </literallayout></para></listitem> | ||
284 | <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis> | ||
285 | Packages recommended if the host system has graphics | ||
286 | support or if you are going to use the Eclipse | ||
287 | IDE: | ||
288 | <literallayout class='monospaced'> | ||
289 | $ sudo zypper install libSDL-devel xterm | ||
290 | </literallayout></para></listitem> | ||
291 | <listitem><para><emphasis>Documentation:</emphasis> | ||
292 | Packages needed if you are going to build out the | ||
293 | Yocto Project documentation manuals: | ||
294 | <literallayout class='monospaced'> | ||
295 | $ sudo zypper install make fop xsltproc dblatex xmlto | ||
296 | </literallayout></para></listitem> | ||
297 | <listitem><para><emphasis>ADT Installer Extras:</emphasis> | ||
298 | Packages needed if you are going to be using the | ||
299 | <ulink url='&YOCTO_DOCS_ADT_URL;#using-the-adt-installer'>Application Development Toolkit (ADT) Installer</ulink>: | ||
300 | <literallayout class='monospaced'> | ||
301 | $ sudo zypper install autoconf automake libtool glib2-devel | ||
302 | </literallayout></para></listitem> | ||
303 | </itemizedlist> | ||
304 | </para> | ||
305 | </section> | ||
306 | |||
307 | <section id='centos-packages'> | ||
308 | <title>CentOS Packages</title> | ||
309 | |||
310 | <para> | ||
311 | The following list shows the required packages by function | ||
312 | given a supported CentOS Linux distribution: | ||
313 | <note>Depending on the CentOS version you are using, other requirements | ||
314 | and dependencies might exist. | ||
315 | For details, you should look at the CentOS sections on the | ||
316 | <ulink url='https://wiki.yoctoproject.org/wiki/Poky/GettingStarted/Dependencies'>Poky/GettingStarted/Dependencies</ulink> | ||
317 | wiki page. | ||
318 | </note> | ||
319 | <itemizedlist> | ||
320 | <listitem><para><emphasis>Essentials:</emphasis> | ||
321 | Packages needed to build an image for a headless | ||
322 | system: | ||
323 | <literallayout class='monospaced'> | ||
324 | $ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; | ||
325 | </literallayout></para></listitem> | ||
326 | <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis> | ||
327 | Packages recommended if the host system has graphics | ||
328 | support or if you are going to use the Eclipse | ||
329 | IDE: | ||
330 | <literallayout class='monospaced'> | ||
331 | $ sudo yum install SDL-devel xterm | ||
332 | </literallayout></para></listitem> | ||
333 | <listitem><para><emphasis>Documentation:</emphasis> | ||
334 | Packages needed if you are going to build out the | ||
335 | Yocto Project documentation manuals: | ||
336 | <literallayout class='monospaced'> | ||
337 | $ sudo yum install make docbook-style-dsssl docbook-style-xsl \ | ||
338 | docbook-dtds docbook-utils fop libxslt dblatex xmlto | ||
339 | </literallayout></para></listitem> | ||
340 | <listitem><para><emphasis>ADT Installer Extras:</emphasis> | ||
341 | Packages needed if you are going to be using the | ||
342 | <ulink url='&YOCTO_DOCS_ADT_URL;#using-the-adt-installer'>Application Development Toolkit (ADT) Installer</ulink>: | ||
343 | <literallayout class='monospaced'> | ||
344 | $ sudo yum install autoconf automake libtool glib2-devel | ||
345 | </literallayout></para></listitem> | ||
346 | </itemizedlist> | ||
347 | </para> | ||
348 | </section> | ||
349 | </section> | ||
350 | |||
351 | <section id='required-git-tar-and-python-versions'> | ||
352 | <title>Required Git, tar, and Python Versions</title> | ||
353 | |||
354 | <para> | ||
355 | In order to use the build system, your host development system | ||
356 | must meet the following version requirements for Git, tar, and | ||
357 | Python: | ||
358 | <itemizedlist> | ||
359 | <listitem><para>Git 1.7.5 or greater</para></listitem> | ||
360 | <listitem><para>tar 1.24 or greater</para></listitem> | ||
361 | <listitem><para>Python 2.7.3 or greater not including | ||
362 | Python 3.x, which is not supported.</para></listitem> | ||
363 | </itemizedlist> | ||
364 | </para> | ||
365 | |||
366 | <para> | ||
367 | If your host development system does not meet all these requirements, | ||
368 | you can resolve this by installing a <filename>buildtools</filename> | ||
369 | tarball that contains these tools. | ||
370 | You can get the tarball one of two ways: download a pre-built | ||
371 | tarball or use BitBake to build the tarball. | ||
372 | </para> | ||
373 | |||
374 | <section id='downloading-a-pre-built-buildtools-tarball'> | ||
375 | <title>Downloading a Pre-Built <filename>buildtools</filename> Tarball</title> | ||
376 | |||
377 | <para> | ||
378 | Downloading and running a pre-built buildtools installer is | ||
379 | the easiest of the two methods by which you can get these tools: | ||
380 | <orderedlist> | ||
381 | <listitem><para> | ||
382 | Locate and download the <filename>*.sh</filename> at | ||
383 | <ulink url='&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;/buildtools/'></ulink>. | ||
384 | </para></listitem> | ||
385 | <listitem><para> | ||
386 | Execute the installation script. | ||
387 | Here is an example: | ||
388 | <literallayout class='monospaced'> | ||
389 | $ sh poky-eglibc-x86_64-buildtools-tarball-x86_64-buildtools-nativesdk-standalone-&DISTRO;.sh | ||
390 | </literallayout> | ||
391 | During execution, a prompt appears that allows you to | ||
392 | choose the installation directory. | ||
393 | For example, you could choose the following: | ||
394 | <literallayout class='monospaced'> | ||
395 | /home/your-username/buildtools | ||
396 | </literallayout> | ||
397 | </para></listitem> | ||
398 | <listitem><para> | ||
399 | Source the tools environment setup script by using a | ||
400 | command like the following: | ||
401 | <literallayout class='monospaced'> | ||
402 | $ source /home/your-username/buildtools/environment-setup-i586-poky-linux | ||
403 | </literallayout> | ||
404 | Of course, you need to supply your installation directory and be | ||
405 | sure to use the right file (i.e. i585 or x86-64). | ||
406 | </para> | ||
407 | <para> | ||
408 | After you have sourced the setup script, | ||
409 | the tools are added to <filename>PATH</filename> | ||
410 | and any other environment variables required to run the | ||
411 | tools are initialized. | ||
412 | The results are working versions versions of Git, tar, | ||
413 | Python and <filename>chrpath</filename>. | ||
414 | </para></listitem> | ||
415 | </orderedlist> | ||
416 | </para> | ||
417 | </section> | ||
418 | |||
419 | <section id='building-your-own-buildtools-tarball'> | ||
420 | <title>Building Your Own <filename>buildtools</filename> Tarball</title> | ||
421 | |||
422 | <para> | ||
423 | Building and running your own buildtools installer applies | ||
424 | only when you have a build host that can already run BitBake. | ||
425 | In this case, you use that machine to build the | ||
426 | <filename>.sh</filename> file and then | ||
427 | take steps to transfer and run it on a | ||
428 | machine that does not meet the minimal Git, tar, and Python | ||
429 | requirements. | ||
430 | </para> | ||
431 | |||
432 | <para> | ||
433 | Here are the steps to take to build and run your own | ||
434 | buildtools installer: | ||
435 | <orderedlist> | ||
436 | <listitem><para> | ||
437 | On the machine that is able to run BitBake, | ||
438 | be sure you have set up your build environment with | ||
439 | the setup script | ||
440 | (<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link> | ||
441 | or | ||
442 | <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>). | ||
443 | </para></listitem> | ||
444 | <listitem><para> | ||
445 | Run the BitBake command to build the tarball: | ||
446 | <literallayout class='monospaced'> | ||
447 | $ bitbake buildtools-tarball | ||
448 | </literallayout> | ||
449 | <note> | ||
450 | The | ||
451 | <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link> | ||
452 | variable in your <filename>local.conf</filename> file | ||
453 | determines whether you build tools for a 32-bit | ||
454 | or 64-bit system. | ||
455 | </note> | ||
456 | Once the build completes, you can find the | ||
457 | <filename>.sh</filename> file that installs | ||
458 | the tools in the <filename>tmp/deploy/sdk</filename> | ||
459 | subdirectory of the | ||
460 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
461 | The installer file has the string "buildtools" | ||
462 | in the name. | ||
463 | </para></listitem> | ||
464 | <listitem><para> | ||
465 | Transfer the <filename>.sh</filename> file from the | ||
466 | build host to the machine that does not meet the | ||
467 | Git, tar, or Python requirements. | ||
468 | </para></listitem> | ||
469 | <listitem><para> | ||
470 | On the machine that does not meet the requirements, | ||
471 | run the <filename>.sh</filename> file | ||
472 | to install the tools. | ||
473 | Here is an example: | ||
474 | <literallayout class='monospaced'> | ||
475 | $ sh poky-eglibc-x86_64-buildtools-tarball-x86_64-buildtools-nativesdk-standalone-&DISTRO;.sh | ||
476 | </literallayout> | ||
477 | During execution, a prompt appears that allows you to | ||
478 | choose the installation directory. | ||
479 | For example, you could choose the following: | ||
480 | <literallayout class='monospaced'> | ||
481 | /home/your-username/buildtools | ||
482 | </literallayout> | ||
483 | </para></listitem> | ||
484 | <listitem><para> | ||
485 | Source the tools environment setup script by using a | ||
486 | command like the following: | ||
487 | <literallayout class='monospaced'> | ||
488 | $ source /home/your-username/buildtools/environment-setup-i586-poky-linux | ||
489 | </literallayout> | ||
490 | Of course, you need to supply your installation directory and be | ||
491 | sure to use the right file (i.e. i585 or x86-64). | ||
492 | </para> | ||
493 | <para> | ||
494 | After you have sourced the setup script, | ||
495 | the tools are added to <filename>PATH</filename> | ||
496 | and any other environment variables required to run the | ||
497 | tools are initialized. | ||
498 | The results are working versions versions of Git, tar, | ||
499 | Python and <filename>chrpath</filename>. | ||
500 | </para></listitem> | ||
501 | </orderedlist> | ||
502 | </para> | ||
503 | </section> | ||
504 | </section> | ||
505 | </section> | ||
506 | |||
507 | <section id='intro-getit'> | ||
508 | <title>Obtaining the Yocto Project</title> | ||
509 | <para> | ||
510 | The Yocto Project development team makes the Yocto Project available through a number | ||
511 | of methods: | ||
512 | <itemizedlist> | ||
513 | <listitem><para><emphasis>Source Repositories:</emphasis> | ||
514 | Working from a copy of the upstream | ||
515 | <filename>poky</filename> repository is the | ||
516 | preferred method for obtaining and using a Yocto Project | ||
517 | release. | ||
518 | You can view the Yocto Project Source Repositories at | ||
519 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi'></ulink>. | ||
520 | In particular, you can find the | ||
521 | <filename>poky</filename> repository at | ||
522 | <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/'></ulink>. | ||
523 | </para></listitem> | ||
524 | <listitem><para><emphasis>Releases:</emphasis> Stable, tested | ||
525 | releases are available as tarballs through | ||
526 | <ulink url='&YOCTO_DL_URL;/releases/yocto/'/>.</para></listitem> | ||
527 | <listitem><para><emphasis>Nightly Builds:</emphasis> These | ||
528 | tarball releases are available at | ||
529 | <ulink url='http://autobuilder.yoctoproject.org/nightly'/>. | ||
530 | These builds include Yocto Project releases, meta-toolchain | ||
531 | tarball installation scripts, and experimental builds. | ||
532 | </para></listitem> | ||
533 | <listitem><para><emphasis>Yocto Project Website:</emphasis> You can | ||
534 | find tarball releases of the Yocto Project and supported BSPs | ||
535 | at the | ||
536 | <ulink url='&YOCTO_HOME_URL;'>Yocto Project website</ulink>. | ||
537 | Along with these downloads, you can find lots of other | ||
538 | information at this site. | ||
539 | </para></listitem> | ||
540 | </itemizedlist> | ||
541 | </para> | ||
542 | </section> | ||
543 | |||
544 | <section id='intro-getit-dev'> | ||
545 | <title>Development Checkouts</title> | ||
546 | <para> | ||
547 | Development using the Yocto Project requires a local | ||
548 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
549 | You can set up the Source Directory by cloning a copy of the upstream | ||
550 | <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>poky</ulink> Git repository. | ||
551 | For information on how to do this, see the | ||
552 | "<ulink url='&YOCTO_DOCS_DEV_URL;#getting-setup'>Getting Set Up</ulink>" | ||
553 | section in the Yocto Project Development Manual. | ||
554 | </para> | ||
555 | </section> | ||
556 | |||
557 | </chapter> | ||
558 | <!-- | ||
559 | vim: expandtab tw=80 ts=4 | ||
560 | --> | ||
diff --git a/documentation/ref-manual/migration.xml b/documentation/ref-manual/migration.xml new file mode 100644 index 0000000..d51bc4d --- /dev/null +++ b/documentation/ref-manual/migration.xml | |||
@@ -0,0 +1,1697 @@ | |||
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 | |||
5 | <chapter id='migration'> | ||
6 | <title>Migrating to a Newer Yocto Project Release</title> | ||
7 | |||
8 | <para> | ||
9 | This chapter provides information you can use to migrate work to a | ||
10 | newer Yocto Project release. You can find the same information in the | ||
11 | release notes for a given release. | ||
12 | </para> | ||
13 | |||
14 | <section id='general-migration-considerations'> | ||
15 | <title>General Migration Considerations</title> | ||
16 | |||
17 | <para> | ||
18 | Some considerations are not tied to a specific Yocto Project | ||
19 | release. | ||
20 | This section presents information you should consider when | ||
21 | migrating to any new Yocto Project release. | ||
22 | <itemizedlist> | ||
23 | <listitem><para><emphasis>Dealing with Customized Recipes</emphasis>: | ||
24 | Issues could arise if you take older recipes that contain | ||
25 | customizations and simply copy them forward expecting them | ||
26 | to work after you migrate to new Yocto Project metadata. | ||
27 | For example, suppose you have a recipe in your layer that is | ||
28 | a customized version of a core recipe copied from the earlier | ||
29 | release, rather than through the use of an append file. | ||
30 | When you migrate to a newer version of Yocto Project, the | ||
31 | metadata (e.g. perhaps an include file used by the recipe) | ||
32 | could have changed in a way that would break the build. | ||
33 | Say, for example, a function is removed from an include file | ||
34 | and the customized recipe tries to call that function. | ||
35 | </para> | ||
36 | |||
37 | <para>You could "forward-port" all your customizations in your | ||
38 | recipe so that everything works for the new release. | ||
39 | However, this is not the optimal solution as you would have | ||
40 | to repeat this process with each new release if changes | ||
41 | occur that give rise to problems.</para> | ||
42 | |||
43 | <para>The better solution (where practical) is to use append | ||
44 | files (<filename>*.bbappend</filename>) to capture any | ||
45 | customizations you want to make to a recipe. | ||
46 | Doing so, isolates your changes from the main recipe making | ||
47 | them much more manageable. | ||
48 | However, sometimes it is not practical to use an append | ||
49 | file. | ||
50 | A good example of this is when introducing a newer or older | ||
51 | version of a recipe in another layer.</para> | ||
52 | </listitem> | ||
53 | <listitem><para><emphasis>Updating Append Files</emphasis>: | ||
54 | Since append files generally only contain your customizations, | ||
55 | they often do not need to be adjusted for new releases. | ||
56 | However, if the <filename>.bbappend</filename> file is | ||
57 | specific to a particular version of the recipe (i.e. its | ||
58 | name does not use the % wildcard) and the version of the | ||
59 | recipe to which it is appending has changed, then you will | ||
60 | at a minimum need to rename the append file to match the | ||
61 | name of the recipe file. | ||
62 | A mismatch between an append file and its corresponding | ||
63 | recipe file (<filename>.bb</filename>) will | ||
64 | trigger an error during parsing.</para> | ||
65 | <para>Depending on the type of customization the append file | ||
66 | applies, other incompatibilities might occur when you | ||
67 | upgrade. | ||
68 | For example, if your append file applies a patch and the | ||
69 | recipe to which it is appending is updated to a newer | ||
70 | version, the patch might no longer apply. | ||
71 | If this is the case and assuming the patch is still needed, | ||
72 | you must modify the patch file so that it does apply. | ||
73 | </para></listitem> | ||
74 | </itemizedlist> | ||
75 | </para> | ||
76 | </section> | ||
77 | |||
78 | <section id='moving-to-the-yocto-project-1.3-release'> | ||
79 | <title>Moving to the Yocto Project 1.3 Release</title> | ||
80 | |||
81 | <para> | ||
82 | This section provides migration information for moving to the | ||
83 | Yocto Project 1.3 Release from the prior release. | ||
84 | </para> | ||
85 | |||
86 | <section id='1.3-local-configuration'> | ||
87 | <title>Local Configuration</title> | ||
88 | |||
89 | <para> | ||
90 | Differences include changes for | ||
91 | <link linkend='var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></link> | ||
92 | and <filename>bblayers.conf</filename>. | ||
93 | </para> | ||
94 | |||
95 | <section id='migration-1.3-sstate-mirrors'> | ||
96 | <title>SSTATE_MIRRORS</title> | ||
97 | |||
98 | <para> | ||
99 | The shared state cache (sstate-cache), as pointed to by | ||
100 | <link linkend='var-SSTATE_DIR'><filename>SSTATE_DIR</filename></link>, by default | ||
101 | now has two-character subdirectories to prevent issues arising | ||
102 | from too many files in the same directory. | ||
103 | Also, native sstate-cache packages will go into a subdirectory named using | ||
104 | the distro ID string. | ||
105 | If you copy the newly structured sstate-cache to a mirror location | ||
106 | (either local or remote) and then point to it in | ||
107 | <link linkend='var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></link>, | ||
108 | you need to append "PATH" to the end of the mirror URL so that | ||
109 | the path used by BitBake before the mirror substitution is | ||
110 | appended to the path used to access the mirror. | ||
111 | Here is an example: | ||
112 | <literallayout class='monospaced'> | ||
113 | SSTATE_MIRRORS = "file://.* http://someserver.tld/share/sstate/PATH" | ||
114 | </literallayout> | ||
115 | </para> | ||
116 | </section> | ||
117 | |||
118 | <section id='migration-1.3-bblayers-conf'> | ||
119 | <title>bblayers.conf</title> | ||
120 | |||
121 | <para> | ||
122 | The <filename>meta-yocto</filename> layer consists of two parts | ||
123 | that correspond to the Poky reference distribution and the | ||
124 | reference hardware Board Support Packages (BSPs), respectively: | ||
125 | <filename>meta-yocto</filename> and | ||
126 | <filename>meta-yocto-bsp</filename>. | ||
127 | When running BitBake or Hob for the first time after upgrading, | ||
128 | your <filename>conf/bblayers.conf</filename> file will be | ||
129 | updated to handle this change and you will be asked to | ||
130 | re-run or restart for the changes to take effect. | ||
131 | </para> | ||
132 | </section> | ||
133 | </section> | ||
134 | |||
135 | <section id='1.3-recipes'> | ||
136 | <title>Recipes</title> | ||
137 | |||
138 | <para> | ||
139 | Differences include changes for the following: | ||
140 | <itemizedlist> | ||
141 | <listitem><para>Python function whitespace</para></listitem> | ||
142 | <listitem><para><filename>proto=</filename> in <filename>SRC_URI</filename></para></listitem> | ||
143 | <listitem><para><filename>nativesdk</filename></para></listitem> | ||
144 | <listitem><para>Task recipes</para></listitem> | ||
145 | <listitem><para><filename>IMAGE_FEATURES</filename></para></listitem> | ||
146 | <listitem><para>Removed recipes</para></listitem> | ||
147 | </itemizedlist> | ||
148 | </para> | ||
149 | |||
150 | <section id='migration-1.3-python-function-whitespace'> | ||
151 | <title>Python Function Whitespace</title> | ||
152 | |||
153 | <para> | ||
154 | All Python functions must now use four spaces for indentation. | ||
155 | Previously, an inconsistent mix of spaces and tabs existed, | ||
156 | which made extending these functions using | ||
157 | <filename>_append</filename> or <filename>_prepend</filename> | ||
158 | complicated given that Python treats whitespace as | ||
159 | syntactically significant. | ||
160 | If you are defining or extending any Python functions (e.g. | ||
161 | <filename>populate_packages</filename>, <filename>do_unpack</filename>, | ||
162 | <filename>do_patch</filename> and so forth) in custom recipes | ||
163 | or classes, you need to ensure you are using consistent | ||
164 | four-space indentation. | ||
165 | </para> | ||
166 | </section> | ||
167 | |||
168 | <section id='migration-1.3-proto=-in-src-uri'> | ||
169 | <title>proto= in SRC_URI</title> | ||
170 | |||
171 | <para> | ||
172 | Any use of <filename>proto=</filename> in | ||
173 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> | ||
174 | needs to be changed to <filename>protocol=</filename>. | ||
175 | In particular, this applies to the following URIs: | ||
176 | <itemizedlist> | ||
177 | <listitem><para><filename>svn://</filename></para></listitem> | ||
178 | <listitem><para><filename>bzr://</filename></para></listitem> | ||
179 | <listitem><para><filename>hg://</filename></para></listitem> | ||
180 | <listitem><para><filename>osc://</filename></para></listitem> | ||
181 | </itemizedlist> | ||
182 | Other URIs were already using <filename>protocol=</filename>. | ||
183 | This change improves consistency. | ||
184 | </para> | ||
185 | </section> | ||
186 | |||
187 | <section id='migration-1.3-nativesdk'> | ||
188 | <title>nativesdk</title> | ||
189 | |||
190 | <para> | ||
191 | The suffix <filename>nativesdk</filename> is now implemented | ||
192 | as a prefix, which simplifies a lot of the packaging code for | ||
193 | <filename>nativesdk</filename> recipes. | ||
194 | All custom <filename>nativesdk</filename> recipes and any | ||
195 | references need to be updated to use | ||
196 | <filename>nativesdk-*</filename> instead of | ||
197 | <filename>*-nativesdk</filename>. | ||
198 | </para> | ||
199 | </section> | ||
200 | |||
201 | <section id='migration-1.3-task-recipes'> | ||
202 | <title>Task Recipes</title> | ||
203 | |||
204 | <para> | ||
205 | "Task" recipes are now known as "Package groups" and have | ||
206 | been renamed from <filename>task-*.bb</filename> to | ||
207 | <filename>packagegroup-*.bb</filename>. | ||
208 | Existing references to the previous <filename>task-*</filename> | ||
209 | names should work in most cases as there is an automatic | ||
210 | upgrade path for most packages. | ||
211 | However, you should update references in your own recipes and | ||
212 | configurations as they could be removed in future releases. | ||
213 | You should also rename any custom <filename>task-*</filename> | ||
214 | recipes to <filename>packagegroup-*</filename>, and change | ||
215 | them to inherit <filename>packagegroup</filename> instead of | ||
216 | <filename>task</filename>, as well as taking the opportunity | ||
217 | to remove anything now handled by | ||
218 | <filename>packagegroup.bbclass</filename>, such as providing | ||
219 | <filename>-dev</filename> and <filename>-dbg</filename> | ||
220 | packages, setting | ||
221 | <link linkend='var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></link>, | ||
222 | and so forth. | ||
223 | See the | ||
224 | "<link linkend='ref-classes-packagegroup'><filename>packagegroup.bbclass</filename></link>" | ||
225 | section for further details. | ||
226 | </para> | ||
227 | </section> | ||
228 | |||
229 | <section id='migration-1.3-image-features'> | ||
230 | <title>IMAGE_FEATURES</title> | ||
231 | |||
232 | <para> | ||
233 | Image recipes that previously included "apps-console-core" | ||
234 | in <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link> | ||
235 | should now include "splash" instead to enable the boot-up | ||
236 | splash screen. | ||
237 | Retaining "apps-console-core" will still include the splash | ||
238 | screen but generates a warning. | ||
239 | The "apps-x11-core" and "apps-x11-games" | ||
240 | <filename>IMAGE_FEATURES</filename> features have been removed. | ||
241 | </para> | ||
242 | </section> | ||
243 | |||
244 | <section id='migration-1.3-removed-recipes'> | ||
245 | <title>Removed Recipes</title> | ||
246 | |||
247 | <para> | ||
248 | The following recipes have been removed. | ||
249 | For most of them, it is unlikely that you would have any | ||
250 | references to them in your own | ||
251 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>. | ||
252 | However, you should check your metadata against this list to be sure: | ||
253 | <itemizedlist> | ||
254 | <listitem><para><emphasis><filename>libx11-trim</filename></emphasis>: | ||
255 | Replaced by <filename>libx11</filename>, which has a negligible | ||
256 | size difference with modern Xorg.</para></listitem> | ||
257 | <listitem><para><emphasis><filename>xserver-xorg-lite</filename></emphasis>: | ||
258 | Use <filename>xserver-xorg</filename>, which has a negligible | ||
259 | size difference when DRI and GLX modules are not installed.</para></listitem> | ||
260 | <listitem><para><emphasis><filename>xserver-kdrive</filename></emphasis>: | ||
261 | Effectively unmaintained for many years.</para></listitem> | ||
262 | <listitem><para><emphasis><filename>mesa-xlib</filename></emphasis>: | ||
263 | No longer serves any purpose.</para></listitem> | ||
264 | <listitem><para><emphasis><filename>galago</filename></emphasis>: | ||
265 | Replaced by telepathy.</para></listitem> | ||
266 | <listitem><para><emphasis><filename>gail</filename></emphasis>: | ||
267 | Functionality was integrated into GTK+ 2.13.</para></listitem> | ||
268 | <listitem><para><emphasis><filename>eggdbus</filename></emphasis>: | ||
269 | No longer needed.</para></listitem> | ||
270 | <listitem><para><emphasis><filename>gcc-*-intermediate</filename></emphasis>: | ||
271 | The build has been restructured to avoid the need for | ||
272 | this step.</para></listitem> | ||
273 | <listitem><para><emphasis><filename>libgsmd</filename></emphasis>: | ||
274 | Unmaintained for many years. | ||
275 | Functionality now provided by | ||
276 | <filename>ofono</filename> instead.</para></listitem> | ||
277 | <listitem><para><emphasis>contacts, dates, tasks, eds-tools</emphasis>: | ||
278 | Largely unmaintained PIM application suite. | ||
279 | It has been moved to <filename>meta-gnome</filename> | ||
280 | in <filename>meta-openembedded</filename>.</para></listitem> | ||
281 | </itemizedlist> | ||
282 | In addition to the previously listed changes, the | ||
283 | <filename>meta-demoapps</filename> directory has also been removed | ||
284 | because the recipes in it were not being maintained and many | ||
285 | had become obsolete or broken. | ||
286 | Additionally, these recipes were not parsed in the default configuration. | ||
287 | Many of these recipes are already provided in an updated and | ||
288 | maintained form within the OpenEmbedded community layers such as | ||
289 | <filename>meta-oe</filename> and <filename>meta-gnome</filename>. | ||
290 | For the remainder, you can now find them in the | ||
291 | <filename>meta-extras</filename> repository, which is in the | ||
292 | Yocto Project | ||
293 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-repositories'>Source Repositories</ulink>. | ||
294 | </para> | ||
295 | </section> | ||
296 | </section> | ||
297 | |||
298 | <section id='1.3-linux-kernel-naming'> | ||
299 | <title>Linux Kernel Naming</title> | ||
300 | |||
301 | <para> | ||
302 | The naming scheme for kernel output binaries has been changed to | ||
303 | now include | ||
304 | <link linkend='var-PE'><filename>PE</filename></link> as part of the | ||
305 | filename: | ||
306 | <literallayout class='monospaced'> | ||
307 | KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PE}-${PV}-${PR}-${MACHINE}-${DATETIME}" | ||
308 | </literallayout> | ||
309 | </para> | ||
310 | |||
311 | <para> | ||
312 | Because the <filename>PE</filename> variable is not set by default, | ||
313 | these binary files could result with names that include two dash | ||
314 | characters. | ||
315 | Here is an example: | ||
316 | <literallayout class='monospaced'> | ||
317 | bzImage--3.10.9+git0+cd502a8814_7144bcc4b8-r0-qemux86-64-20130830085431.bin | ||
318 | </literallayout> | ||
319 | </para> | ||
320 | </section> | ||
321 | </section> | ||
322 | |||
323 | <section id='moving-to-the-yocto-project-1.4-release'> | ||
324 | <title>Moving to the Yocto Project 1.4 Release</title> | ||
325 | |||
326 | <para> | ||
327 | This section provides migration information for moving to the | ||
328 | Yocto Project 1.4 Release from the prior release. | ||
329 | </para> | ||
330 | |||
331 | <section id='migration-1.4-bitbake'> | ||
332 | <title>BitBake</title> | ||
333 | |||
334 | <para> | ||
335 | Differences include the following: | ||
336 | <itemizedlist> | ||
337 | <listitem><para><emphasis>Comment Continuation:</emphasis> | ||
338 | If a comment ends with a line continuation (\) character, | ||
339 | then the next line must also be a comment. | ||
340 | Any instance where this is not the case, now triggers | ||
341 | a warning. | ||
342 | You must either remove the continuation character, or be | ||
343 | sure the next line is a comment. | ||
344 | </para></listitem> | ||
345 | <listitem><para><emphasis>Package Name Overrides:</emphasis> | ||
346 | The runtime package specific variables | ||
347 | <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>, | ||
348 | <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>, | ||
349 | <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>, | ||
350 | <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>, | ||
351 | <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>, | ||
352 | <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>, | ||
353 | <link linkend='var-FILES'><filename>FILES</filename></link>, | ||
354 | <link linkend='var-ALLOW_EMPTY'><filename>ALLOW_EMPTY</filename></link>, | ||
355 | and the pre, post, install, and uninstall script functions | ||
356 | <filename>pkg_preinst</filename>, | ||
357 | <filename>pkg_postinst</filename>, | ||
358 | <filename>pkg_prerm</filename>, and | ||
359 | <filename>pkg_postrm</filename> should always have a | ||
360 | package name override. | ||
361 | For example, use <filename>RDEPENDS_${PN}</filename> for | ||
362 | the main package instead of <filename>RDEPENDS</filename>. | ||
363 | BitBake uses more strict checks when it parses recipes. | ||
364 | </para></listitem> | ||
365 | </itemizedlist> | ||
366 | </para> | ||
367 | </section> | ||
368 | |||
369 | <section id='migration-1.4-build-behavior'> | ||
370 | <title>Build Behavior</title> | ||
371 | |||
372 | <para> | ||
373 | Differences include the following: | ||
374 | <itemizedlist> | ||
375 | <listitem><para><emphasis>Shared State Code:</emphasis> | ||
376 | The shared state code has been optimized to avoid running | ||
377 | unnecessary tasks. | ||
378 | For example, | ||
379 | <filename>bitbake -c rootfs some-image</filename> from | ||
380 | shared state no longer populates the target sysroot | ||
381 | since that is not necessary. | ||
382 | Instead, the system just needs to extract the output | ||
383 | package contents, re-create the packages, and construct | ||
384 | the root filesystem. | ||
385 | This change is unlikely to cause any problems unless | ||
386 | you have missing declared dependencies. | ||
387 | </para></listitem> | ||
388 | <listitem><para><emphasis>Scanning Directory Names:</emphasis> | ||
389 | When scanning for files in | ||
390 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>, | ||
391 | the build system now uses | ||
392 | <link linkend='var-FILESOVERRIDES'><filename>FILESOVERRIDES</filename></link> | ||
393 | instead of <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link> | ||
394 | for the directory names. | ||
395 | In general, the values previously in | ||
396 | <filename>OVERRIDES</filename> are now in | ||
397 | <filename>FILESOVERRIDES</filename> as well. | ||
398 | However, if you relied upon an additional value | ||
399 | you previously added to <filename>OVERRIDES</filename>, | ||
400 | you might now need to add it to | ||
401 | <filename>FILESOVERRIDES</filename> unless you are already | ||
402 | adding it through the | ||
403 | <link linkend='var-MACHINEOVERRIDES'><filename>MACHINEOVERRIDES</filename></link> | ||
404 | or <link linkend='var-DISTROOVERRIDES'><filename>DISTROOVERRIDES</filename></link> | ||
405 | variables, as appropriate. | ||
406 | For more related changes, see the | ||
407 | "<link linkend='migration-1.4-variables'>Variables</link>" | ||
408 | section. | ||
409 | </para></listitem> | ||
410 | </itemizedlist> | ||
411 | </para> | ||
412 | </section> | ||
413 | |||
414 | |||
415 | <section id='migration-1.4-proxies-and-fetching-source'> | ||
416 | <title>Proxies and Fetching Source</title> | ||
417 | |||
418 | <para> | ||
419 | A new <filename>oe-git-proxy</filename> script has been added to | ||
420 | replace previous methods of handling proxies and fetching source | ||
421 | from Git. | ||
422 | See the <filename>meta-yocto/conf/site.conf.sample</filename> file | ||
423 | for information on how to use this script. | ||
424 | </para> | ||
425 | </section> | ||
426 | |||
427 | <section id='migration-1.4-custom-interfaces-file-netbase-change'> | ||
428 | <title>Custom Interfaces File (netbase change)</title> | ||
429 | |||
430 | <para> | ||
431 | If you have created your own custom | ||
432 | <filename>etc/network/interfaces</filename> file by creating | ||
433 | an append file for the <filename>netbase</filename> recipe, | ||
434 | you now need to create an append file for the | ||
435 | <filename>init-ifupdown</filename> recipe instead, which you can | ||
436 | find in the | ||
437 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
438 | at <filename>meta/recipes-core/init-ifupdown</filename>. | ||
439 | For information on how to use append files, see the | ||
440 | "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files</ulink>" | ||
441 | in the Yocto Project Development Manual. | ||
442 | </para> | ||
443 | </section> | ||
444 | |||
445 | <section id='migration-1.4-remote-debugging'> | ||
446 | <title>Remote Debugging</title> | ||
447 | |||
448 | <para> | ||
449 | Support for remote debugging with the Eclipse IDE is now | ||
450 | separated into an image feature | ||
451 | (<filename>eclipse-debug</filename>) that corresponds to the | ||
452 | <filename>packagegroup-core-eclipse-debug</filename> package group. | ||
453 | Previously, the debugging feature was included through the | ||
454 | <filename>tools-debug</filename> image feature, which corresponds | ||
455 | to the <filename>packagegroup-core-tools-debug</filename> | ||
456 | package group. | ||
457 | </para> | ||
458 | </section> | ||
459 | |||
460 | <section id='migration-1.4-variables'> | ||
461 | <title>Variables</title> | ||
462 | |||
463 | <para> | ||
464 | The following variables have changed: | ||
465 | <itemizedlist> | ||
466 | <listitem><para><emphasis><filename>SANITY_TESTED_DISTROS</filename>:</emphasis> | ||
467 | This variable now uses a distribution ID, which is composed | ||
468 | of the host distributor ID followed by the release. | ||
469 | Previously, | ||
470 | <link linkend='var-SANITY_TESTED_DISTROS'><filename>SANITY_TESTED_DISTROS</filename></link> | ||
471 | was composed of the description field. | ||
472 | For example, "Ubuntu 12.10" becomes "Ubuntu-12.10". | ||
473 | You do not need to worry about this change if you are not | ||
474 | specifically setting this variable, or if you are | ||
475 | specifically setting it to "". | ||
476 | </para></listitem> | ||
477 | <listitem><para><emphasis><filename>SRC_URI</filename>:</emphasis> | ||
478 | The <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename>, | ||
479 | <filename>${</filename><link linkend='var-PF'><filename>PF</filename></link><filename>}</filename>, | ||
480 | <filename>${</filename><link linkend='var-P'><filename>P</filename></link><filename>}</filename>, | ||
481 | and <filename>FILE_DIRNAME</filename> directories have been | ||
482 | dropped from the default value of the | ||
483 | <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link> | ||
484 | variable, which is used as the search path for finding files | ||
485 | referred to in | ||
486 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>. | ||
487 | If you have a recipe that relied upon these directories, | ||
488 | which would be unusual, then you will need to add the | ||
489 | appropriate paths within the recipe or, alternatively, | ||
490 | rearrange the files. | ||
491 | The most common locations are still covered by | ||
492 | <filename>${BP}</filename>, <filename>${BPN}</filename>, | ||
493 | and "files", which all remain in the default value of | ||
494 | <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>. | ||
495 | </para></listitem> | ||
496 | </itemizedlist> | ||
497 | </para> | ||
498 | </section> | ||
499 | |||
500 | <section id='migration-target-package-management-with-rpm'> | ||
501 | <title>Target Package Management with RPM</title> | ||
502 | |||
503 | <para> | ||
504 | If runtime package management is enabled and the RPM backend | ||
505 | is selected, Smart is now installed for package download, dependency | ||
506 | resolution, and upgrades instead of Zypper. | ||
507 | For more information on how to use Smart, run the following command | ||
508 | on the target: | ||
509 | <literallayout class='monospaced'> | ||
510 | smart --help | ||
511 | </literallayout> | ||
512 | </para> | ||
513 | </section> | ||
514 | |||
515 | <section id='migration-1.4-recipes-moved'> | ||
516 | <title>Recipes Moved</title> | ||
517 | |||
518 | <para> | ||
519 | The following recipes were moved from their previous locations | ||
520 | because they are no longer used by anything in | ||
521 | the OpenEmbedded-Core: | ||
522 | <itemizedlist> | ||
523 | <listitem><para><emphasis><filename>clutter-box2d</filename>:</emphasis> | ||
524 | Now resides in the <filename>meta-oe</filename> layer. | ||
525 | </para></listitem> | ||
526 | <listitem><para><emphasis><filename>evolution-data-server</filename>:</emphasis> | ||
527 | Now resides in the <filename>meta-gnome</filename> layer. | ||
528 | </para></listitem> | ||
529 | <listitem><para><emphasis><filename>gthumb</filename>:</emphasis> | ||
530 | Now resides in the <filename>meta-gnome</filename> layer. | ||
531 | </para></listitem> | ||
532 | <listitem><para><emphasis><filename>gtkhtml2</filename>:</emphasis> | ||
533 | Now resides in the <filename>meta-oe</filename> layer. | ||
534 | </para></listitem> | ||
535 | <listitem><para><emphasis><filename>gupnp</filename>:</emphasis> | ||
536 | Now resides in the <filename>meta-multimedia</filename> layer. | ||
537 | </para></listitem> | ||
538 | <listitem><para><emphasis><filename>gypsy</filename>:</emphasis> | ||
539 | Now resides in the <filename>meta-oe</filename> layer. | ||
540 | </para></listitem> | ||
541 | <listitem><para><emphasis><filename>libcanberra</filename>:</emphasis> | ||
542 | Now resides in the <filename>meta-gnome</filename> layer. | ||
543 | </para></listitem> | ||
544 | <listitem><para><emphasis><filename>libgdata</filename>:</emphasis> | ||
545 | Now resides in the <filename>meta-gnome</filename> layer. | ||
546 | </para></listitem> | ||
547 | <listitem><para><emphasis><filename>libmusicbrainz</filename>:</emphasis> | ||
548 | Now resides in the <filename>meta-multimedia</filename> layer. | ||
549 | </para></listitem> | ||
550 | <listitem><para><emphasis><filename>metacity</filename>:</emphasis> | ||
551 | Now resides in the <filename>meta-gnome</filename> layer. | ||
552 | </para></listitem> | ||
553 | <listitem><para><emphasis><filename>polkit</filename>:</emphasis> | ||
554 | Now resides in the <filename>meta-oe</filename> layer. | ||
555 | </para></listitem> | ||
556 | <listitem><para><emphasis><filename>zeroconf</filename>:</emphasis> | ||
557 | Now resides in the <filename>meta-networking</filename> layer. | ||
558 | </para></listitem> | ||
559 | </itemizedlist> | ||
560 | </para> | ||
561 | </section> | ||
562 | |||
563 | <section id='migration-1.4-removals-and-renames'> | ||
564 | <title>Removals and Renames</title> | ||
565 | |||
566 | <para> | ||
567 | The following list shows what has been removed or renamed: | ||
568 | <itemizedlist> | ||
569 | <listitem><para><emphasis><filename>evieext</filename>:</emphasis> | ||
570 | Removed because it has been removed from | ||
571 | <filename>xserver</filename> since 2008. | ||
572 | </para></listitem> | ||
573 | <listitem><para><emphasis>Gtk+ DirectFB:</emphasis> | ||
574 | Removed support because upstream Gtk+ no longer supports it | ||
575 | as of version 2.18. | ||
576 | </para></listitem> | ||
577 | <listitem><para><emphasis><filename>libxfontcache / xfontcacheproto</filename>:</emphasis> | ||
578 | Removed because they were removed from the Xorg server in 2008. | ||
579 | </para></listitem> | ||
580 | <listitem><para><emphasis><filename>libxp / libxprintapputil / libxprintutil / printproto</filename>:</emphasis> | ||
581 | Removed because the XPrint server was removed from | ||
582 | Xorg in 2008. | ||
583 | </para></listitem> | ||
584 | <listitem><para><emphasis><filename>libxtrap / xtrapproto</filename>:</emphasis> | ||
585 | Removed because their functionality was broken upstream. | ||
586 | </para></listitem> | ||
587 | <listitem><para><emphasis>linux-yocto 3.0 kernel:</emphasis> | ||
588 | Removed with linux-yocto 3.8 kernel being added. | ||
589 | The linux-yocto 3.2 and linux-yocto 3.4 kernels remain | ||
590 | as part of the release. | ||
591 | </para></listitem> | ||
592 | <listitem><para><emphasis><filename>lsbsetup</filename>:</emphasis> | ||
593 | Removed with functionality now provided by | ||
594 | <filename>lsbtest</filename>. | ||
595 | </para></listitem> | ||
596 | <listitem><para><emphasis><filename>matchbox-stroke</filename>:</emphasis> | ||
597 | Removed because it was never more than a proof-of-concept. | ||
598 | </para></listitem> | ||
599 | <listitem><para><emphasis><filename>matchbox-wm-2 / matchbox-theme-sato-2</filename>:</emphasis> | ||
600 | Removed because they are not maintained. | ||
601 | However, <filename>matchbox-wm</filename> and | ||
602 | <filename>matchbox-theme-sato</filename> are still | ||
603 | provided. | ||
604 | </para></listitem> | ||
605 | <listitem><para><emphasis><filename>mesa-dri</filename>:</emphasis> | ||
606 | Renamed to <filename>mesa</filename>. | ||
607 | </para></listitem> | ||
608 | <listitem><para><emphasis><filename>mesa-xlib</filename>:</emphasis> | ||
609 | Removed because it was no longer useful. | ||
610 | </para></listitem> | ||
611 | <listitem><para><emphasis><filename>mutter</filename>:</emphasis> | ||
612 | Removed because nothing ever uses it and the recipe is | ||
613 | very old. | ||
614 | </para></listitem> | ||
615 | <listitem><para><emphasis><filename>orinoco-conf</filename>:</emphasis> | ||
616 | Removed because it has become obsolete. | ||
617 | </para></listitem> | ||
618 | <listitem><para><emphasis><filename>update-modules</filename>:</emphasis> | ||
619 | Removed because it is no longer used. | ||
620 | The kernel module <filename>postinstall</filename> and | ||
621 | <filename>postrm</filename> scripts can now do the same | ||
622 | task without the use of this script. | ||
623 | </para></listitem> | ||
624 | <listitem><para><emphasis><filename>web</filename>:</emphasis> | ||
625 | Removed because it is not maintained. Superseded by | ||
626 | <filename>web-webkit</filename>. | ||
627 | </para></listitem> | ||
628 | <listitem><para><emphasis><filename>xf86bigfontproto</filename>:</emphasis> | ||
629 | Removed because upstream it has been disabled by default | ||
630 | since 2007. | ||
631 | Nothing uses <filename>xf86bigfontproto</filename>. | ||
632 | </para></listitem> | ||
633 | <listitem><para><emphasis><filename>xf86rushproto</filename>:</emphasis> | ||
634 | Removed because its dependency in | ||
635 | <filename>xserver</filename> was spurious and it was | ||
636 | removed in 2005. | ||
637 | </para></listitem> | ||
638 | <listitem><para><emphasis><filename>zypper / libzypp / sat-solver</filename>:</emphasis> | ||
639 | Removed and been functionally replaced with Smart | ||
640 | (<filename>python-smartpm</filename>) when RPM packaging | ||
641 | is used and package management is enabled on the target. | ||
642 | </para></listitem> | ||
643 | </itemizedlist> | ||
644 | </para> | ||
645 | </section> | ||
646 | </section> | ||
647 | |||
648 | <section id='moving-to-the-yocto-project-1.5-release'> | ||
649 | <title>Moving to the Yocto Project 1.5 Release</title> | ||
650 | |||
651 | <para> | ||
652 | This section provides migration information for moving to the | ||
653 | Yocto Project 1.5 Release from the prior release. | ||
654 | </para> | ||
655 | |||
656 | <section id='migration-1.5-host-dependency-changes'> | ||
657 | <title>Host Dependency Changes</title> | ||
658 | |||
659 | <para> | ||
660 | The OpenEmbedded build system now has some additional requirements | ||
661 | on the host system: | ||
662 | <itemizedlist> | ||
663 | <listitem><para>Python 2.7.3+</para></listitem> | ||
664 | <listitem><para>Tar 1.24+</para></listitem> | ||
665 | <listitem><para>Git 1.7.5+</para></listitem> | ||
666 | <listitem><para>Patched version of Make if you are using | ||
667 | 3.82. | ||
668 | Most distributions that provide Make 3.82 use the patched | ||
669 | version.</para></listitem> | ||
670 | </itemizedlist> | ||
671 | If the Linux distribution you are using on your build host | ||
672 | does not provide packages for these, you can install and use | ||
673 | the Buildtools tarball, which provides an SDK-like environment | ||
674 | containing them. | ||
675 | </para> | ||
676 | |||
677 | <para> | ||
678 | For more information on this requirement, see the | ||
679 | "<link linkend='required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</link>" | ||
680 | section. | ||
681 | </para> | ||
682 | </section> | ||
683 | |||
684 | <section id='migration-1.5-atom-pc-bsp'> | ||
685 | <title><filename>atom-pc</filename> Board Support Package (BSP)</title> | ||
686 | |||
687 | <para> | ||
688 | The <filename>atom-pc</filename> hardware reference BSP has been | ||
689 | replaced by a <filename>genericx86</filename> BSP. | ||
690 | This BSP is not necessarily guaranteed to work on all x86 | ||
691 | hardware, but it will run on a wider range of systems than the | ||
692 | <filename>atom-pc</filename> did. | ||
693 | <note> | ||
694 | Additionally, a <filename>genericx86-64</filename> BSP has | ||
695 | been added for 64-bit Atom systems. | ||
696 | </note> | ||
697 | </para> | ||
698 | </section> | ||
699 | |||
700 | <section id='migration-1.5-bitbake'> | ||
701 | <title>BitBake</title> | ||
702 | |||
703 | <para> | ||
704 | The following changes have been made that relate to BitBake: | ||
705 | <itemizedlist> | ||
706 | <listitem><para> | ||
707 | BitBake now supports a <filename>_remove</filename> | ||
708 | operator. | ||
709 | The addition of this operator means you will have to | ||
710 | rename any items in recipe space (functions, variables) | ||
711 | whose names currently contain | ||
712 | <filename>_remove_</filename> or end with | ||
713 | <filename>_remove</filename> to avoid unexpected behavior. | ||
714 | </para></listitem> | ||
715 | <listitem><para> | ||
716 | BitBake's global method pool has been removed. | ||
717 | This method is not particularly useful and led to clashes | ||
718 | between recipes containing functions that had the | ||
719 | same name.</para></listitem> | ||
720 | <listitem><para> | ||
721 | The "none" server backend has been removed. | ||
722 | The "process" server backend has been serving well as the | ||
723 | default for a long time now.</para></listitem> | ||
724 | <listitem><para> | ||
725 | The <filename>bitbake-runtask</filename> script has been | ||
726 | removed.</para></listitem> | ||
727 | <listitem><para> | ||
728 | <filename>${</filename><link linkend='var-P'><filename>P</filename></link><filename>}</filename> | ||
729 | and | ||
730 | <filename>${</filename><link linkend='var-PF'><filename>PF</filename></link><filename>}</filename> | ||
731 | are no longer added to | ||
732 | <link linkend='var-PROVIDES'><filename>PROVIDES</filename></link> | ||
733 | by default in <filename>bitbake.conf</filename>. | ||
734 | These version-specific <filename>PROVIDES</filename> | ||
735 | items were seldom used. | ||
736 | Attempting to use them could result in two versions being | ||
737 | built simultaneously rather than just one version due to | ||
738 | the way BitBake resolves dependencies.</para></listitem> | ||
739 | </itemizedlist> | ||
740 | </para> | ||
741 | </section> | ||
742 | |||
743 | <section id='migration-1.5-qa-warnings'> | ||
744 | <title>QA Warnings</title> | ||
745 | |||
746 | <para> | ||
747 | The following changes have been made to the package QA checks: | ||
748 | <itemizedlist> | ||
749 | <listitem><para> | ||
750 | If you have customized | ||
751 | <link linkend='var-ERROR_QA'><filename>ERROR_QA</filename></link> | ||
752 | or <link linkend='var-WARN_QA'><filename>WARN_QA</filename></link> | ||
753 | values in your configuration, check that they contain all of | ||
754 | the issues that you wish to be reported. | ||
755 | Previous Yocto Project versions contained a bug that meant | ||
756 | that any item not mentioned in <filename>ERROR_QA</filename> | ||
757 | or <filename>WARN_QA</filename> would be treated as a | ||
758 | warning. | ||
759 | Consequently, several important items were not already in | ||
760 | the default value of <filename>WARN_QA</filename>. | ||
761 | All of the possible QA checks are now documented in the | ||
762 | "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>" | ||
763 | section.</para></listitem> | ||
764 | <listitem><para> | ||
765 | An additional QA check has been added to check if | ||
766 | <filename>/usr/share/info/dir</filename> is being installed. | ||
767 | Your recipe should delete this file within | ||
768 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
769 | if "make install" is installing it. | ||
770 | </para></listitem> | ||
771 | <listitem><para> | ||
772 | If you are using the buildhistory class, the check for the | ||
773 | package version going backwards is now controlled using a | ||
774 | standard QA check. | ||
775 | Thus, if you have customized your | ||
776 | <filename>ERROR_QA</filename> or | ||
777 | <filename>WARN_QA</filename> values and still wish to have | ||
778 | this check performed, you should add | ||
779 | "version-going-backwards" to your value for one or the | ||
780 | other variables depending on how you wish it to be handled. | ||
781 | See the documented QA checks in the | ||
782 | "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>" | ||
783 | section. | ||
784 | </para></listitem> | ||
785 | </itemizedlist> | ||
786 | </para> | ||
787 | </section> | ||
788 | |||
789 | <section id='migration-1.5-directory-layout-changes'> | ||
790 | <title>Directory Layout Changes</title> | ||
791 | |||
792 | <para> | ||
793 | The following directory changes exist: | ||
794 | <itemizedlist> | ||
795 | <listitem><para> | ||
796 | Output SDK installer files are now named to include the | ||
797 | image name and tuning architecture through the | ||
798 | <link linkend='var-SDK_NAME'><filename>SDK_NAME</filename></link> | ||
799 | variable.</para></listitem> | ||
800 | <listitem><para> | ||
801 | Images and related files are now installed into a directory | ||
802 | that is specific to the machine, instead of a parent | ||
803 | directory containing output files for multiple machines. | ||
804 | The | ||
805 | <link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link> | ||
806 | variable continues to point to the directory containing | ||
807 | images for the current | ||
808 | <link linkend='var-MACHINE'><filename>MACHINE</filename></link> | ||
809 | and should be used anywhere there is a need to refer to | ||
810 | this directory. | ||
811 | The <filename>runqemu</filename> script now uses this | ||
812 | variable to find images and kernel binaries and will use | ||
813 | BitBake to determine the directory. | ||
814 | Alternatively, you can set the | ||
815 | <filename>DEPLOY_DIR_IMAGE</filename> variable in the | ||
816 | external environment.</para></listitem> | ||
817 | <listitem><para> | ||
818 | When buildhistory is enabled, its output is now written | ||
819 | under the | ||
820 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
821 | rather than | ||
822 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>. | ||
823 | Doing so makes it easier to delete | ||
824 | <filename>TMPDIR</filename> and preserve the build history. | ||
825 | Additionally, data for produced SDKs is now split by | ||
826 | <link linkend='var-IMAGE_NAME'><filename>IMAGE_NAME</filename></link>. | ||
827 | </para></listitem> | ||
828 | <listitem><para> | ||
829 | The <filename>pkgdata</filename> directory produced as | ||
830 | part of the packaging process has been collapsed into a | ||
831 | single machine-specific directory. | ||
832 | This directory is located under | ||
833 | <filename>sysroots</filename> and uses a machine-specific | ||
834 | name (i.e. | ||
835 | <filename>tmp/sysroots/<machine>/pkgdata</filename>). | ||
836 | </para></listitem> | ||
837 | </itemizedlist> | ||
838 | </para> | ||
839 | </section> | ||
840 | |||
841 | <section id='migration-1.5-shortened-git-srcrev-values'> | ||
842 | <title>Shortened Git <filename>SRCREV</filename> Values</title> | ||
843 | |||
844 | <para> | ||
845 | BitBake will now shorten revisions from Git repositories from the | ||
846 | normal 40 characters down to 10 characters within | ||
847 | <link linkend='var-SRCPV'><filename>SRCPV</filename></link> | ||
848 | for improved usability in path and file names. | ||
849 | This change should be safe within contexts where these revisions | ||
850 | are used because the chances of spatially close collisions | ||
851 | is very low. | ||
852 | Distant collisions are not a major issue in the way | ||
853 | the values are used. | ||
854 | </para> | ||
855 | </section> | ||
856 | |||
857 | <section id='migration-1.5-image-features'> | ||
858 | <title><filename>IMAGE_FEATURES</filename></title> | ||
859 | |||
860 | <para> | ||
861 | The following changes have been made that relate to | ||
862 | <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>: | ||
863 | <itemizedlist> | ||
864 | <listitem><para> | ||
865 | The value of | ||
866 | <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link> | ||
867 | is now validated to ensure invalid feature items are not | ||
868 | added. | ||
869 | Some users mistakenly add package names to this variable | ||
870 | instead of using | ||
871 | <link linkend='var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></link> | ||
872 | in order to have the package added to the image, which does | ||
873 | not work. | ||
874 | This change is intended to catch those kinds of situations. | ||
875 | Valid <filename>IMAGE_FEATURES</filename> are drawn from | ||
876 | <link linkend='var-PACKAGE_GROUP'><filename>PACKAGE_GROUP</filename></link> | ||
877 | definitions, | ||
878 | <link linkend='var-COMPLEMENTARY_GLOB'><filename>COMPLEMENTARY_GLOB</filename></link> | ||
879 | and a new "validitems" varflag on | ||
880 | <filename>IMAGE_FEATURES</filename>. | ||
881 | The "validitems" varflag change allows additional features | ||
882 | to be added if they are not provided using the previous | ||
883 | two mechanisms. | ||
884 | </para></listitem> | ||
885 | <listitem><para> | ||
886 | The previously deprecated "apps-console-core" | ||
887 | <filename>IMAGE_FEATURES</filename> item is no longer | ||
888 | supported. | ||
889 | Add "splash" to <filename>IMAGE_FEATURES</filename> if you | ||
890 | wish to have the splash screen enabled, since this is | ||
891 | all that apps-console-core was doing.</para></listitem> | ||
892 | </itemizedlist> | ||
893 | </para> | ||
894 | </section> | ||
895 | |||
896 | <section id='migration-1.5-run'> | ||
897 | <title><filename>/run</filename></title> | ||
898 | |||
899 | <para> | ||
900 | The <filename>/run</filename> directory from the Filesystem | ||
901 | Hierarchy Standard 3.0 has been introduced. | ||
902 | You can find some of the implications for this change | ||
903 | <ulink url='http://cgit.openembedded.org/openembedded-core/commit/?id=0e326280a15b0f2c4ef2ef4ec441f63f55b75873'>here</ulink>. | ||
904 | The change also means that recipes that install files to | ||
905 | <filename>/var/run</filename> must be changed. | ||
906 | You can find a guide on how to make these changes | ||
907 | <ulink url='http://permalink.gmane.org/gmane.comp.handhelds.openembedded/58530'>here</ulink>. | ||
908 | </para> | ||
909 | </section> | ||
910 | |||
911 | <section id='migration-1.5-removal-of-package-manager-database-within-image-recipes'> | ||
912 | <title>Removal of Package Manager Database Within Image Recipes</title> | ||
913 | |||
914 | <para> | ||
915 | The image <filename>core-image-minimal</filename> no longer adds | ||
916 | <filename>remove_packaging_data_files</filename> to | ||
917 | <link linkend='var-ROOTFS_POSTPROCESS_COMMAND'><filename>ROOTFS_POSTPROCESS_COMMAND</filename></link>. | ||
918 | This addition is now handled automatically when "package-management" | ||
919 | is not in | ||
920 | <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>. | ||
921 | If you have custom image recipes that make this addition, | ||
922 | you should remove the lines, as they are not needed and might | ||
923 | interfere with correct operation of postinstall scripts. | ||
924 | </para> | ||
925 | </section> | ||
926 | |||
927 | <section id='migration-1.5-images-now-rebuild-only-on-changes-instead-of-every-time'> | ||
928 | <title>Images Now Rebuild Only on Changes Instead of Every Time</title> | ||
929 | |||
930 | <para> | ||
931 | The | ||
932 | <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link> | ||
933 | and other related image | ||
934 | construction tasks are no longer marked as "nostamp". | ||
935 | Consequently, they will only be re-executed when their inputs have | ||
936 | changed. | ||
937 | Previous versions of the OpenEmbedded build system always rebuilt | ||
938 | the image when requested rather when necessary. | ||
939 | </para> | ||
940 | </section> | ||
941 | |||
942 | <section id='migration-1.5-task-recipes'> | ||
943 | <title>Task Recipes</title> | ||
944 | |||
945 | <para> | ||
946 | The previously deprecated <filename>task.bbclass</filename> has | ||
947 | now been dropped. | ||
948 | For recipes that previously inherited from this class, you should | ||
949 | rename them from <filename>task-*</filename> to | ||
950 | <filename>packagegroup-*</filename> and inherit packagegroup | ||
951 | instead. | ||
952 | </para> | ||
953 | |||
954 | <para> | ||
955 | For more information, see the | ||
956 | "<link linkend='ref-classes-packagegroup'><filename>packagegroup.bbclass</filename></link>" | ||
957 | section. | ||
958 | </para> | ||
959 | </section> | ||
960 | |||
961 | <section id='migration-1.5-busybox'> | ||
962 | <title>BusyBox</title> | ||
963 | |||
964 | <para> | ||
965 | By default, we now split BusyBox into two binaries: | ||
966 | one that is suid root for those components that need it, and | ||
967 | another for the rest of the components. | ||
968 | Splitting BusyBox allows for optimization that eliminates the | ||
969 | <filename>tinylogin</filename> recipe as recommended by upstream. | ||
970 | You can disable this split by setting | ||
971 | <link linkend='var-BUSYBOX_SPLIT_SUID'><filename>BUSYBOX_SPLIT_SUID</filename></link> | ||
972 | to "0". | ||
973 | </para> | ||
974 | </section> | ||
975 | |||
976 | <section id='migration-1.5-automated-image-testing'> | ||
977 | <title>Automated Image Testing</title> | ||
978 | |||
979 | <para> | ||
980 | A new automated image testing framework has been added | ||
981 | through the | ||
982 | <link linkend='ref-classes-testimage'><filename>testimage*.bbclass</filename></link> | ||
983 | class. | ||
984 | This framework replaces the older | ||
985 | <filename>imagetest-qemu</filename> framework. | ||
986 | </para> | ||
987 | |||
988 | <para> | ||
989 | You can learn more about performing automated image tests in the | ||
990 | "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>" | ||
991 | section. | ||
992 | </para> | ||
993 | </section> | ||
994 | |||
995 | <section id='migration-1.5-build-history'> | ||
996 | <title>Build History</title> | ||
997 | |||
998 | <para> | ||
999 | Following are changes to Build History: | ||
1000 | <itemizedlist> | ||
1001 | <listitem><para> | ||
1002 | Installed package sizes: | ||
1003 | <filename>installed-package-sizes.txt</filename> for an | ||
1004 | image now records the size of the files installed by each | ||
1005 | package instead of the size of each compressed package | ||
1006 | archive file.</para></listitem> | ||
1007 | <listitem><para> | ||
1008 | The dependency graphs (<filename>depends*.dot</filename>) | ||
1009 | now use the actual package names instead of replacing | ||
1010 | dashes, dots and plus signs with underscores. | ||
1011 | </para></listitem> | ||
1012 | <listitem><para> | ||
1013 | The <filename>buildhistory-diff</filename> and | ||
1014 | <filename>buildhistory-collect-srcrevs</filename> | ||
1015 | utilities have improved command-line handling. | ||
1016 | Use the <filename>‐‐help</filename> option for | ||
1017 | each utility for more information on the new syntax. | ||
1018 | </para></listitem> | ||
1019 | </itemizedlist> | ||
1020 | For more information on Build History, see the | ||
1021 | "<link linkend='maintaining-build-output-quality'>Maintaining Build Output Quality</link>" | ||
1022 | section. | ||
1023 | </para> | ||
1024 | </section> | ||
1025 | |||
1026 | <section id='migration-1.5-udev'> | ||
1027 | <title><filename>udev</filename></title> | ||
1028 | |||
1029 | <para> | ||
1030 | Following are changes to <filename>udev</filename>: | ||
1031 | <itemizedlist> | ||
1032 | <listitem><para> | ||
1033 | <filename>udev</filename> no longer brings in | ||
1034 | <filename>udev-extraconf</filename> automatically | ||
1035 | through | ||
1036 | <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>, | ||
1037 | since this was originally intended to be optional. | ||
1038 | If you need the extra rules, then add | ||
1039 | <filename>udev-extraconf</filename> to your image. | ||
1040 | </para></listitem> | ||
1041 | <listitem><para> | ||
1042 | <filename>udev</filename> no longer brings in | ||
1043 | <filename>pciutils-ids</filename> or | ||
1044 | <filename>usbutils-ids</filename> through | ||
1045 | <filename>RRECOMMENDS</filename>. | ||
1046 | These are not needed by <filename>udev</filename> itself | ||
1047 | and removing them saves around 350KB. | ||
1048 | </para></listitem> | ||
1049 | </itemizedlist> | ||
1050 | </para> | ||
1051 | </section> | ||
1052 | |||
1053 | <section id='migration-1.5-removed-renamed-recipes'> | ||
1054 | <title>Removed and Renamed Recipes</title> | ||
1055 | |||
1056 | <itemizedlist> | ||
1057 | <listitem><para> | ||
1058 | The <filename>linux-yocto</filename> 3.2 kernel has been | ||
1059 | removed.</para></listitem> | ||
1060 | <listitem><para> | ||
1061 | <filename>libtool-nativesdk</filename> has been renamed to | ||
1062 | <filename>nativesdk-libtool</filename>.</para></listitem> | ||
1063 | <listitem><para> | ||
1064 | <filename>tinylogin</filename> has been removed. | ||
1065 | It has been replaced by a suid portion of Busybox. | ||
1066 | See the | ||
1067 | "<link linkend='migration-1.5-busybox'>BusyBox</link>" section | ||
1068 | for more information.</para></listitem> | ||
1069 | <listitem><para> | ||
1070 | <filename>external-python-tarball</filename> has been renamed | ||
1071 | to <filename>buildtools-tarball</filename>. | ||
1072 | </para></listitem> | ||
1073 | <listitem><para> | ||
1074 | <filename>web-webkit</filename> has been removed. | ||
1075 | It has been functionally replaced by | ||
1076 | <filename>midori</filename>.</para></listitem> | ||
1077 | <listitem><para> | ||
1078 | <filename>imake</filename> has been removed. | ||
1079 | It is no longer needed by any other recipe. | ||
1080 | </para></listitem> | ||
1081 | <listitem><para> | ||
1082 | <filename>transfig-native</filename> has been removed. | ||
1083 | It is no longer needed by any other recipe. | ||
1084 | </para></listitem> | ||
1085 | <listitem><para> | ||
1086 | <filename>anjuta-remote-run</filename> has been removed. | ||
1087 | Anjuta IDE integration has not been officially supported for | ||
1088 | several releases.</para></listitem> | ||
1089 | </itemizedlist> | ||
1090 | </section> | ||
1091 | |||
1092 | <section id='migration-1.5-other-changes'> | ||
1093 | <title>Other Changes</title> | ||
1094 | |||
1095 | <para> | ||
1096 | Following is a list of short entries describing other changes: | ||
1097 | <itemizedlist> | ||
1098 | <listitem><para> | ||
1099 | <filename>run-postinsts</filename>: Make this generic. | ||
1100 | </para></listitem> | ||
1101 | <listitem><para> | ||
1102 | <filename>base-files</filename>: Remove the unnecessary | ||
1103 | <filename>media/xxx</filename> directories. | ||
1104 | </para></listitem> | ||
1105 | <listitem><para> | ||
1106 | <filename>alsa-state</filename>: Provide an empty | ||
1107 | <filename>asound.conf</filename> by default. | ||
1108 | </para></listitem> | ||
1109 | <listitem><para> | ||
1110 | <filename>classes/image</filename>: Ensure | ||
1111 | <link linkend='var-BAD_RECOMMENDATIONS'><filename>BAD_RECOMMENDATIONS</filename></link> | ||
1112 | supports pre-renamed package names.</para></listitem> | ||
1113 | <listitem><para> | ||
1114 | <filename>classes/rootfs_rpm</filename>: Implement | ||
1115 | <link linkend='var-BAD_RECOMMENDATIONS'><filename>BAD_RECOMMENDATIONS</filename></link> | ||
1116 | for RPM.</para></listitem> | ||
1117 | <listitem><para> | ||
1118 | <filename>systemd</filename>: Remove | ||
1119 | <filename>systemd_unitdir</filename> if | ||
1120 | <filename>systemd</filename> is not in | ||
1121 | <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>. | ||
1122 | </para></listitem> | ||
1123 | <listitem><para> | ||
1124 | <filename>systemd</filename>: Remove | ||
1125 | <filename>init.d</filename> dir if | ||
1126 | <filename>systemd</filename> unit file is present and | ||
1127 | <filename>sysvinit</filename> is not a distro feature. | ||
1128 | </para></listitem> | ||
1129 | <listitem><para> | ||
1130 | <filename>libpam</filename>: Deny all services for the | ||
1131 | <filename>OTHER</filename> entries. | ||
1132 | </para></listitem> | ||
1133 | <listitem><para> | ||
1134 | <filename>image.bbclass</filename>: Move | ||
1135 | <filename>runtime_mapping_rename</filename> to avoid | ||
1136 | conflict with <filename>multilib</filename>. | ||
1137 | See | ||
1138 | <ulink url='https://bugzilla.yoctoproject.org/show_bug.cgi?id=4993'><filename>YOCTO #4993</filename></ulink> | ||
1139 | in Bugzilla for more information. | ||
1140 | </para></listitem> | ||
1141 | <listitem><para> | ||
1142 | <filename>linux-dtb</filename>: Use kernel build system | ||
1143 | to generate the <filename>dtb</filename> files. | ||
1144 | </para></listitem> | ||
1145 | <listitem><para> | ||
1146 | <filename>kern-tools</filename>: Switch from guilt to | ||
1147 | new <filename>kgit-s2q</filename> tool. | ||
1148 | </para></listitem> | ||
1149 | </itemizedlist> | ||
1150 | </para> | ||
1151 | </section> | ||
1152 | </section> | ||
1153 | |||
1154 | <section id='moving-to-the-yocto-project-1.6-release'> | ||
1155 | <title>Moving to the Yocto Project 1.6 Release</title> | ||
1156 | |||
1157 | <para> | ||
1158 | This section provides migration information for moving to the | ||
1159 | Yocto Project 1.6 Release from the prior release. | ||
1160 | </para> | ||
1161 | |||
1162 | |||
1163 | <section id='migration-1.6-archiver-class'> | ||
1164 | <title><filename>archiver</filename> Class</title> | ||
1165 | |||
1166 | <para> | ||
1167 | The | ||
1168 | <link linkend='ref-classes-archiver'><filename>archiver</filename></link> | ||
1169 | class has been rewritten and its configuration has been simplified. | ||
1170 | For more details on the source archiver, see the | ||
1171 | "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>" | ||
1172 | section in the Yocto Project Development Manual. | ||
1173 | </para> | ||
1174 | </section> | ||
1175 | |||
1176 | <section id='migration-1.6-packaging-changes'> | ||
1177 | <title>Packaging Changes</title> | ||
1178 | |||
1179 | <para> | ||
1180 | The following packaging changes have been made: | ||
1181 | <itemizedlist> | ||
1182 | <listitem><para> | ||
1183 | The <filename>binutils</filename> recipe no longer produces | ||
1184 | a <filename>binutils-symlinks</filename> package. | ||
1185 | <filename>update-alternatives</filename> is now used to | ||
1186 | handle the preferred <filename>binutils</filename> | ||
1187 | variant on the target instead. | ||
1188 | </para></listitem> | ||
1189 | <listitem><para> | ||
1190 | The tc (traffic control) utilities have been split out of | ||
1191 | the main <filename>iproute2</filename> package and put | ||
1192 | into the <filename>iproute2-tc</filename> package. | ||
1193 | </para></listitem> | ||
1194 | <listitem><para> | ||
1195 | The <filename>gtk-engines</filename> schemas have been | ||
1196 | moved to a dedicated | ||
1197 | <filename>gtk-engines-schemas</filename> package. | ||
1198 | </para></listitem> | ||
1199 | <listitem><para> | ||
1200 | The <filename>armv7a</filename> with thumb package | ||
1201 | architecture suffix has changed. | ||
1202 | The suffix for these packages with the thumb | ||
1203 | optimization enabled is "t2" as it should be. | ||
1204 | Use of this suffix was not the case in the 1.5 release. | ||
1205 | Architecture names will change within package feeds as a | ||
1206 | result. | ||
1207 | </para></listitem> | ||
1208 | </itemizedlist> | ||
1209 | </para> | ||
1210 | </section> | ||
1211 | |||
1212 | <section id='migration-1.6-bitbake'> | ||
1213 | <title>BitBake</title> | ||
1214 | |||
1215 | <para> | ||
1216 | The following changes have been made to | ||
1217 | <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>. | ||
1218 | </para> | ||
1219 | |||
1220 | <section id='migration-1.6-matching-branch-requirement-for-git-fetching'> | ||
1221 | <title>Matching Branch Requirement for Git Fetching</title> | ||
1222 | |||
1223 | <para> | ||
1224 | When fetching source from a Git repository using | ||
1225 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>, | ||
1226 | BitBake will now validate the | ||
1227 | <link linkend='var-SRCREV'><filename>SRCREV</filename></link> | ||
1228 | value against the branch. | ||
1229 | You can specify the branch using the following form: | ||
1230 | <literallayout class='monospaced'> | ||
1231 | SRC_URI = "git://server.name/repository;branch=<branchname>" | ||
1232 | </literallayout> | ||
1233 | If you do not specify a branch, BitBake looks | ||
1234 | in the default "master" branch. | ||
1235 | </para> | ||
1236 | |||
1237 | <para> | ||
1238 | Alternatively, if you need to bypass this check (e.g. | ||
1239 | if you are fetching a revision corresponding to a tag that | ||
1240 | is not on any branch), you can add ";nobranch=1" to | ||
1241 | the end of the URL within <filename>SRC_URI</filename>. | ||
1242 | </para> | ||
1243 | </section> | ||
1244 | |||
1245 | <section id='migration-1.6-bitbake-deps'> | ||
1246 | <title>Python Definition substitutions</title> | ||
1247 | |||
1248 | <para> | ||
1249 | BitBake had some previously deprecated Python definitions | ||
1250 | within its <filename>bb</filename> module removed. | ||
1251 | You should use their sub-module counterparts instead: | ||
1252 | <itemizedlist> | ||
1253 | <listitem><para><filename>bb.MalformedUrl</filename>: | ||
1254 | Use <filename>bb.fetch.MalformedUrl</filename>. | ||
1255 | </para></listitem> | ||
1256 | <listitem><para><filename>bb.fetch.encodeurl</filename>: | ||
1257 | Use <filename>bb.fetch.encodeurl</filename>. | ||
1258 | </para></listitem> | ||
1259 | <listitem><para><filename>bb.decodeurl</filename>: | ||
1260 | Use <filename>bb.fetch.decodeurl</filename> | ||
1261 | </para></listitem> | ||
1262 | <listitem><para><filename>bb.mkdirhier</filename>: | ||
1263 | Use <filename>bb.utils.mkdirhier</filename>. | ||
1264 | </para></listitem> | ||
1265 | <listitem><para><filename>bb.movefile</filename>: | ||
1266 | Use <filename>bb.utils.movefile</filename>. | ||
1267 | </para></listitem> | ||
1268 | <listitem><para><filename>bb.copyfile</filename>: | ||
1269 | Use <filename>bb.utils.copyfile</filename>. | ||
1270 | </para></listitem> | ||
1271 | <listitem><para><filename>bb.which</filename>: | ||
1272 | Use <filename>bb.utils.which</filename>. | ||
1273 | </para></listitem> | ||
1274 | <listitem><para><filename>bb.vercmp_string</filename>: | ||
1275 | Use <filename>bb.utils.vercmp_string</filename>. | ||
1276 | </para></listitem> | ||
1277 | <listitem><para><filename>bb.vercmp</filename>: | ||
1278 | Use <filename>bb.utils.vercmp</filename>. | ||
1279 | </para></listitem> | ||
1280 | </itemizedlist> | ||
1281 | </para> | ||
1282 | </section> | ||
1283 | |||
1284 | <section id='migration-1.6-bitbake-fetcher'> | ||
1285 | <title>SVK Fetcher</title> | ||
1286 | |||
1287 | <para> | ||
1288 | The SVK fetcher has been removed from BitBake. | ||
1289 | </para> | ||
1290 | </section> | ||
1291 | |||
1292 | <section id='migration-1.6-bitbake-console-output'> | ||
1293 | <title>Console Output Error Redirection</title> | ||
1294 | |||
1295 | <para> | ||
1296 | The BitBake console UI will now output errors to | ||
1297 | <filename>stderr</filename> instead of | ||
1298 | <filename>stdout</filename>. | ||
1299 | Consequently, if you are piping or redirecting the output of | ||
1300 | <filename>bitbake</filename> to somewhere else, and you wish | ||
1301 | to retain the errors, you will need to add | ||
1302 | <filename>2>&1</filename> (or something similar) to the | ||
1303 | end of your <filename>bitbake</filename> command line. | ||
1304 | </para> | ||
1305 | </section> | ||
1306 | |||
1307 | <section id='migration-1.6-task-taskname-overrides'> | ||
1308 | <title><filename>task-<taskname></filename> Overrides</title> | ||
1309 | |||
1310 | <para> | ||
1311 | <filename>task-<taskname></filename> overrides have been | ||
1312 | adjusted so that tasks whose names contain underscores have the | ||
1313 | underscores replaced by hyphens for the override so that they | ||
1314 | now function properly. | ||
1315 | For example, the task override for | ||
1316 | <link linkend='ref-tasks-populate_sdk'><filename>do_populate_sdk</filename></link> | ||
1317 | is <filename>task-populate-sdk</filename>. | ||
1318 | </para> | ||
1319 | </section> | ||
1320 | </section> | ||
1321 | |||
1322 | <section id='migration-1.6-variable-changes'> | ||
1323 | <title>Changes to Variables</title> | ||
1324 | |||
1325 | <para> | ||
1326 | The following variables have changed. | ||
1327 | For information on the OpenEmbedded build system variables, see the | ||
1328 | "<link linkend='ref-variables-glos'>Variables Glossary</link>" Chapter. | ||
1329 | </para> | ||
1330 | |||
1331 | <section id='migration-1.6-variable-changes-TMPDIR'> | ||
1332 | <title><filename>TMPDIR</filename></title> | ||
1333 | |||
1334 | <para> | ||
1335 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link> | ||
1336 | can no longer be on an NFS mount. | ||
1337 | NFS does not offer full POSIX locking and inode consistency | ||
1338 | and can cause unexpected issues if used to store | ||
1339 | <filename>TMPDIR</filename>. | ||
1340 | </para> | ||
1341 | |||
1342 | <para> | ||
1343 | The check for this occurs on startup. | ||
1344 | If <filename>TMPDIR</filename> is detected on an NFS mount, | ||
1345 | an error occurs. | ||
1346 | </para> | ||
1347 | </section> | ||
1348 | |||
1349 | <section id='migration-1.6-variable-changes-PRINC'> | ||
1350 | <title><filename>PRINC</filename></title> | ||
1351 | |||
1352 | <para> | ||
1353 | The | ||
1354 | <link linkend='var-PRINC'><filename>PRINC</filename></link> | ||
1355 | variable has been deprecated and triggers a warning if | ||
1356 | detected during a build. | ||
1357 | For | ||
1358 | <link linkend='var-PR'><filename>PR</filename></link> | ||
1359 | increments on changes, use the PR service instead. | ||
1360 | You can find out more about this service in the | ||
1361 | "<ulink url='&YOCTO_DOCS_DEV_URL;#working-with-a-pr-service'>Working With a PR Service</ulink>" | ||
1362 | section in the Yocto Project Development Manual. | ||
1363 | </para> | ||
1364 | </section> | ||
1365 | |||
1366 | <section id='migration-1.6-variable-changes-IMAGE_TYPES'> | ||
1367 | <title><filename>IMAGE_TYPES</filename></title> | ||
1368 | |||
1369 | <para> | ||
1370 | The "sum.jffs2" option for | ||
1371 | <link linkend='var-IMAGE_TYPES'><filename>IMAGE_TYPES</filename></link> | ||
1372 | has been replaced by the "jffs2.sum" option, which fits the | ||
1373 | processing order. | ||
1374 | </para> | ||
1375 | </section> | ||
1376 | |||
1377 | <section id='migration-1.6-variable-changes-COPY_LIC_MANIFEST'> | ||
1378 | <title><filename>COPY_LIC_MANIFEST</filename></title> | ||
1379 | |||
1380 | <para> | ||
1381 | The | ||
1382 | <link linkend='var-COPY_LIC_MANIFEST'><filename>COPY_LIC_MANIFEST</filename></link> | ||
1383 | variable must | ||
1384 | now be set to "1" rather than any value in order to enable | ||
1385 | it. | ||
1386 | </para> | ||
1387 | </section> | ||
1388 | |||
1389 | <section id='migration-1.6-variable-changes-COPY_LIC_DIRS'> | ||
1390 | <title><filename>COPY_LIC_DIRS</filename></title> | ||
1391 | |||
1392 | <para> | ||
1393 | The | ||
1394 | <link linkend='var-COPY_LIC_DIRS'><filename>COPY_LIC_DIRS</filename></link> | ||
1395 | variable must | ||
1396 | now be set to "1" rather than any value in order to enable | ||
1397 | it. | ||
1398 | </para> | ||
1399 | </section> | ||
1400 | |||
1401 | <section id='migration-1.6-variable-changes-PACKAGE_GROUP'> | ||
1402 | <title><filename>PACKAGE_GROUP</filename></title> | ||
1403 | |||
1404 | <para> | ||
1405 | The | ||
1406 | <link linkend='var-PACKAGE_GROUP'><filename>PACKAGE_GROUP</filename></link> | ||
1407 | variable has been renamed to | ||
1408 | <link linkend='var-FEATURE_PACKAGES'><filename>FEATURE_PACKAGES</filename></link> | ||
1409 | to more accurately reflect its purpose. | ||
1410 | You can still use <filename>PACKAGE_GROUP</filename> but | ||
1411 | the OpenEmbedded build system produces a warning message when | ||
1412 | it encounters the variable. | ||
1413 | </para> | ||
1414 | </section> | ||
1415 | </section> | ||
1416 | |||
1417 | <section id='migration-1.6-directory-layout-changes'> | ||
1418 | <title>Directory Layout Changes</title> | ||
1419 | |||
1420 | <para> | ||
1421 | The <filename>meta-hob</filename> layer has been removed from | ||
1422 | the top-level of the | ||
1423 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
1424 | The contents of this layer are no longer needed by the Hob | ||
1425 | user interface for building images and toolchains. | ||
1426 | </para> | ||
1427 | </section> | ||
1428 | |||
1429 | <section id='migration-1.6-package-test-ptest'> | ||
1430 | <title>Package Test (ptest)</title> | ||
1431 | |||
1432 | <para> | ||
1433 | Package Tests (ptest) are built but not installed by default. | ||
1434 | For information on using Package Tests, see the | ||
1435 | "<ulink url='&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest'>Setting up and running package test (ptest)</ulink>" | ||
1436 | section in the Yocto Project Development Manual. | ||
1437 | For information on the <filename>ptest</filename> class, see the | ||
1438 | "<link linkend='ref-classes-ptest'><filename>ptest.bbclass</filename></link>" | ||
1439 | section. | ||
1440 | </para> | ||
1441 | </section> | ||
1442 | |||
1443 | <section id='migration-1.6-build-changes'> | ||
1444 | <title>Build Changes</title> | ||
1445 | |||
1446 | <para> | ||
1447 | Separate build and source directories have been enabled | ||
1448 | by default for selected recipes where it is known to work | ||
1449 | (a whitelist) and for all recipes that inherit the | ||
1450 | <link linkend='ref-classes-cmake'><filename>cmake</filename></link> | ||
1451 | class. | ||
1452 | In future releases the | ||
1453 | <link linkend='ref-classes-autotools'><filename>autotools</filename></link> | ||
1454 | class will enable a separate build directory by default as | ||
1455 | well. | ||
1456 | Recipes building Autotools-based | ||
1457 | software that fails to build with a separate build directory | ||
1458 | should be changed to inherit from the | ||
1459 | <link linkend='ref-classes-autotools-brokensep'><filename>autotools-brokensep</filename></link> | ||
1460 | class instead of the <filename>autotools</filename> class. | ||
1461 | </para> | ||
1462 | </section> | ||
1463 | |||
1464 | <section id='migration-1.6-building-qemu-native'> | ||
1465 | <title><filename>qemu-native</filename></title> | ||
1466 | |||
1467 | <para> | ||
1468 | <filename>qemu-native</filename> now builds without | ||
1469 | SDL-based graphical output support by default. | ||
1470 | The following additional lines are needed in your | ||
1471 | <filename>local.conf</filename> to enable it: | ||
1472 | <literallayout class='monospaced'> | ||
1473 | PACKAGECONFIG_pn-qemu-native = "sdl" | ||
1474 | ASSUME_PROVIDED += "libsdl-native" | ||
1475 | </literallayout> | ||
1476 | <note> | ||
1477 | The default <filename>local.conf</filename> | ||
1478 | contains these statements. | ||
1479 | Consequently, if you are building a headless system and using | ||
1480 | a default <filename>local.conf</filename> file, you will need | ||
1481 | comment these two lines out. | ||
1482 | </note> | ||
1483 | </para> | ||
1484 | </section> | ||
1485 | |||
1486 | <section id='migration-1.6-core-image-basic'> | ||
1487 | <title><filename>core-image-basic</filename></title> | ||
1488 | |||
1489 | <para> | ||
1490 | <filename>core-image-basic</filename> has been renamed to | ||
1491 | <filename>core-image-full-cmdline</filename>. | ||
1492 | </para> | ||
1493 | |||
1494 | <para> | ||
1495 | In addition to <filename>core-image-basic</filename> being renamed, | ||
1496 | <filename>packagegroup-core-basic</filename> has been renamed to | ||
1497 | <filename>packagegroup-core-full-cmdline</filename> to match. | ||
1498 | </para> | ||
1499 | </section> | ||
1500 | |||
1501 | <section id='migration-1.6-licensing'> | ||
1502 | <title>Licensing</title> | ||
1503 | |||
1504 | <para> | ||
1505 | The top-level <filename>LICENSE</filename> file has been changed | ||
1506 | to better describe the license of the various components of | ||
1507 | OE-Core. | ||
1508 | However, the licensing itself remains unchanged. | ||
1509 | </para> | ||
1510 | |||
1511 | <para> | ||
1512 | Normally, this change would not cause any side-effects. | ||
1513 | However, some recipes point to this file within | ||
1514 | <link linkend='var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></link> | ||
1515 | (as <filename>${COREBASE}/LICENSE</filename>) and thus the | ||
1516 | accompanying checksum must be changed from | ||
1517 | 3f40d7994397109285ec7b81fdeb3b58 to | ||
1518 | 4d92cd373abda3937c2bc47fbc49d690. | ||
1519 | A better alternative is to have | ||
1520 | <filename>LIC_FILES_CHKSUM</filename> point to a file | ||
1521 | describing the license that is distributed with the source | ||
1522 | that the recipe is building, if possible, rather than pointing | ||
1523 | to <filename>${COREBASE}/LICENSE</filename>. | ||
1524 | </para> | ||
1525 | </section> | ||
1526 | |||
1527 | <section id='migration-1.6-cflags-options'> | ||
1528 | <title><filename>CFLAGS</filename> Options</title> | ||
1529 | |||
1530 | <para> | ||
1531 | The "-fpermissive" option has been removed from the default | ||
1532 | <link linkend='var-CFLAGS'><filename>CFLAGS</filename></link> | ||
1533 | value. | ||
1534 | You need to take action on individual recipes that fail when | ||
1535 | building with this option. | ||
1536 | You need to either patch the recipes to fix the issues reported by | ||
1537 | the compiler, or you need to add "-fpermissive" to | ||
1538 | <filename>CFLAGS</filename> in the recipes. | ||
1539 | </para> | ||
1540 | </section> | ||
1541 | |||
1542 | <section id='migration-1.6-custom-images'> | ||
1543 | <title>Custom Image Output Types</title> | ||
1544 | |||
1545 | <para> | ||
1546 | Custom image output types, as selected using | ||
1547 | <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>, | ||
1548 | must declare their dependencies on other image types (if any) using | ||
1549 | a new | ||
1550 | <link linkend='var-IMAGE_TYPEDEP'><filename>IMAGE_TYPEDEP</filename></link> | ||
1551 | variable. | ||
1552 | </para> | ||
1553 | </section> | ||
1554 | |||
1555 | <section id='migration-1.6-do-package-write-task'> | ||
1556 | <title>Tasks</title> | ||
1557 | |||
1558 | <para> | ||
1559 | The <filename>do_package_write</filename> task has been removed. | ||
1560 | The task is no longer needed. | ||
1561 | </para> | ||
1562 | </section> | ||
1563 | |||
1564 | <section id='migration-1.6-update-alternatives-provider'> | ||
1565 | <title><filename>update-alternative</filename> Provider</title> | ||
1566 | |||
1567 | <para> | ||
1568 | The default <filename>update-alternatives</filename> provider has | ||
1569 | been changed from <filename>opkg</filename> to | ||
1570 | <filename>opkg-utils</filename>. | ||
1571 | This change resolves some troublesome circular dependencies. | ||
1572 | The runtime package has also been renamed from | ||
1573 | <filename>update-alternatives-cworth</filename> | ||
1574 | to <filename>update-alternatives-opkg</filename>. | ||
1575 | </para> | ||
1576 | </section> | ||
1577 | |||
1578 | <section id='migration-1.6-virtclass-overrides'> | ||
1579 | <title><filename>virtclass</filename> Overrides</title> | ||
1580 | |||
1581 | <para> | ||
1582 | The <filename>virtclass</filename> overrides are now deprecated. | ||
1583 | Use the equivalent class overrides instead (e.g. | ||
1584 | <filename>virtclass-native</filename> becomes | ||
1585 | <filename>class-native</filename>.) | ||
1586 | </para> | ||
1587 | </section> | ||
1588 | |||
1589 | <section id='migration-1.6-removed-renamed-recipes'> | ||
1590 | <title>Removed and Renamed Recipes</title> | ||
1591 | |||
1592 | <para> | ||
1593 | The following recipes have been removed: | ||
1594 | <itemizedlist> | ||
1595 | <listitem><para><filename>packagegroup-toolset-native</filename> - | ||
1596 | This recipe is largely unused. | ||
1597 | </para></listitem> | ||
1598 | <listitem><para><filename>linux-yocto-3.8</filename> - | ||
1599 | Support for the Linux yocto 3.8 kernel has been dropped. | ||
1600 | Support for the 3.10 and 3.14 kernels have been added | ||
1601 | with the <filename>linux-yocto-3.10</filename> and | ||
1602 | <filename>linux-yocto-3.14</filename> recipes. | ||
1603 | </para></listitem> | ||
1604 | <listitem><para><filename>ocf-linux</filename> - | ||
1605 | This recipe has been functionally replaced using | ||
1606 | <filename>cryptodev-linux</filename>. | ||
1607 | </para></listitem> | ||
1608 | <listitem><para><filename>genext2fs</filename> - | ||
1609 | <filename>genext2fs</filename> is no longer used by the | ||
1610 | build system and is unmaintained upstream. | ||
1611 | </para></listitem> | ||
1612 | <listitem><para><filename>js</filename> - | ||
1613 | This provided an ancient version of Mozilla's javascript | ||
1614 | engine that is no longer needed. | ||
1615 | </para></listitem> | ||
1616 | <listitem><para><filename>zaurusd</filename> - | ||
1617 | The recipe has been moved to the | ||
1618 | <filename>meta-handheld</filename> layer. | ||
1619 | </para></listitem> | ||
1620 | <listitem><para><filename>eglibc 2.17</filename> - | ||
1621 | Replaced by the <filename>eglibc 2.19</filename> | ||
1622 | recipe. | ||
1623 | </para></listitem> | ||
1624 | <listitem><para><filename>gcc 4.7.2</filename> - | ||
1625 | Replaced by the now stable | ||
1626 | <filename>gcc 4.8.2</filename>. | ||
1627 | </para></listitem> | ||
1628 | <listitem><para><filename>external-sourcery-toolchain</filename> - | ||
1629 | this recipe is now maintained in the | ||
1630 | <filename>meta-sourcery</filename> layer. | ||
1631 | </para></listitem> | ||
1632 | <listitem><para><filename>linux-libc-headers-yocto 3.4+git</filename> - | ||
1633 | Now using version 3.10 of the | ||
1634 | <filename>linux-libc-headers</filename> by default. | ||
1635 | </para></listitem> | ||
1636 | <listitem><para><filename>meta-toolchain-gmae</filename> - | ||
1637 | This recipe is obsolete. | ||
1638 | </para></listitem> | ||
1639 | <listitem><para><filename>packagegroup-core-sdk-gmae</filename> - | ||
1640 | This recipe is obsolete. | ||
1641 | </para></listitem> | ||
1642 | <listitem><para><filename>packagegroup-core-standalone-gmae-sdk-target</filename> - | ||
1643 | This recipe is obsolete. | ||
1644 | </para></listitem> | ||
1645 | </itemizedlist> | ||
1646 | </para> | ||
1647 | </section> | ||
1648 | |||
1649 | <section id='migration-1.6-removed-classes'> | ||
1650 | <title>Removed Classes</title> | ||
1651 | |||
1652 | <para> | ||
1653 | The following classes have become obsolete and have been removed: | ||
1654 | <itemizedlist> | ||
1655 | <listitem><para><filename>module_strip</filename> | ||
1656 | </para></listitem> | ||
1657 | <listitem><para><filename>pkg_metainfo</filename> | ||
1658 | </para></listitem> | ||
1659 | <listitem><para><filename>pkg_distribute</filename> | ||
1660 | </para></listitem> | ||
1661 | <listitem><para><filename>image-empty</filename> | ||
1662 | </para></listitem> | ||
1663 | </itemizedlist> | ||
1664 | </para> | ||
1665 | </section> | ||
1666 | |||
1667 | <section id='migration-1.6-reference-bsps'> | ||
1668 | <title>Reference Board Support Packages (BSPs)</title> | ||
1669 | |||
1670 | <para> | ||
1671 | The following reference BSPs changes occurred: | ||
1672 | <itemizedlist> | ||
1673 | <listitem><para>The BeagleBoard | ||
1674 | (<filename>beagleboard</filename>) ARM reference hardware | ||
1675 | has been replaced by the BeagleBone | ||
1676 | (<filename>beaglebone</filename>) hardware. | ||
1677 | </para></listitem> | ||
1678 | <listitem><para>The RouterStation Pro | ||
1679 | (<filename>routerstationpro</filename>) MIPS reference | ||
1680 | hardware has been replaced by the EdgeRouter Lite | ||
1681 | (<filename>edgerouter</filename>) hardware. | ||
1682 | </para></listitem> | ||
1683 | </itemizedlist> | ||
1684 | The previous reference BSPs for the | ||
1685 | <filename>beagleboard</filename> and | ||
1686 | <filename>routerstationpro</filename> machines are still available | ||
1687 | in a new <filename>meta-yocto-bsp-old</filename> layer in the | ||
1688 | <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink> | ||
1689 | at | ||
1690 | <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/meta-yocto-bsp-old/'>http://git.yoctoproject.org/cgit/cgit.cgi/meta-yocto-bsp-old/</ulink>. | ||
1691 | </para> | ||
1692 | </section> | ||
1693 | </section> | ||
1694 | </chapter> | ||
1695 | <!-- | ||
1696 | vim: expandtab tw=80 ts=4 | ||
1697 | --> | ||
diff --git a/documentation/ref-manual/ref-bitbake.xml b/documentation/ref-manual/ref-bitbake.xml new file mode 100644 index 0000000..28496de --- /dev/null +++ b/documentation/ref-manual/ref-bitbake.xml | |||
@@ -0,0 +1,472 @@ | |||
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 | |||
5 | <chapter id='ref-bitbake'> | ||
6 | |||
7 | <title>BitBake</title> | ||
8 | |||
9 | <para> | ||
10 | BitBake is a program written in Python that interprets the | ||
11 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> used by | ||
12 | the OpenEmbedded build system. | ||
13 | At some point, developers wonder what actually happens when you enter: | ||
14 | <literallayout class='monospaced'> | ||
15 | $ bitbake core-image-sato | ||
16 | </literallayout> | ||
17 | </para> | ||
18 | |||
19 | <para> | ||
20 | This chapter provides an overview of what happens behind the scenes from BitBake's perspective. | ||
21 | </para> | ||
22 | |||
23 | <note> | ||
24 | BitBake strives to be a generic "task" executor that is capable of handling complex dependency relationships. | ||
25 | As such, it has no real knowledge of what the tasks being executed actually do. | ||
26 | BitBake just considers a list of tasks with dependencies and handles | ||
27 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> | ||
28 | consisting of variables in a certain format that get passed to the tasks. | ||
29 | </note> | ||
30 | |||
31 | <section id='ref-bitbake-parsing'> | ||
32 | <title>Parsing</title> | ||
33 | |||
34 | <para> | ||
35 | BitBake parses configuration files, classes, and <filename>.bb</filename> files. | ||
36 | </para> | ||
37 | |||
38 | <para> | ||
39 | The first thing BitBake does is look for the <filename>bitbake.conf</filename> file. | ||
40 | This file resides in the | ||
41 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
42 | within the <filename>meta/conf/</filename> directory. | ||
43 | BitBake finds it by examining its | ||
44 | <link linkend='var-BBPATH'><filename>BBPATH</filename></link> environment | ||
45 | variable and looking for the <filename>meta/conf/</filename> | ||
46 | directory. | ||
47 | </para> | ||
48 | |||
49 | <para> | ||
50 | The <filename>bitbake.conf</filename> file lists other configuration | ||
51 | files to include from a <filename>conf/</filename> | ||
52 | directory below the directories listed in <filename>BBPATH</filename>. | ||
53 | In general, the most important configuration file from a user's perspective | ||
54 | is <filename>local.conf</filename>, which contains a user's customized | ||
55 | settings for the OpenEmbedded build environment. | ||
56 | Other notable configuration files are the distribution | ||
57 | configuration file (set by the | ||
58 | <filename><link linkend='var-DISTRO'>DISTRO</link></filename> variable) | ||
59 | and the machine configuration file | ||
60 | (set by the | ||
61 | <filename><link linkend='var-MACHINE'>MACHINE</link></filename> variable). | ||
62 | The <filename>DISTRO</filename> and <filename>MACHINE</filename> BitBake environment | ||
63 | variables are both usually set in | ||
64 | the <filename>local.conf</filename> file. | ||
65 | Valid distribution | ||
66 | configuration files are available in the <filename>meta/conf/distro/</filename> directory | ||
67 | and valid machine configuration | ||
68 | files in the <filename>meta/conf/machine/</filename> directory. | ||
69 | Within the <filename>meta/conf/machine/include/</filename> | ||
70 | directory are various <filename>tune-*.inc</filename> configuration files that provide common | ||
71 | "tuning" settings specific to and shared between particular architectures and machines. | ||
72 | </para> | ||
73 | |||
74 | <para> | ||
75 | After the parsing of the configuration files, some standard classes are included. | ||
76 | The <filename>base.bbclass</filename> file is always included. | ||
77 | Other classes that are specified in the configuration using the | ||
78 | <filename><link linkend='var-INHERIT'>INHERIT</link></filename> | ||
79 | variable are also included. | ||
80 | Class files are searched for in a <filename>classes</filename> subdirectory | ||
81 | under the paths in <filename>BBPATH</filename> in the same way as | ||
82 | configuration files. | ||
83 | </para> | ||
84 | |||
85 | <para> | ||
86 | After classes are included, the variable | ||
87 | <filename><link linkend='var-BBFILES'>BBFILES</link></filename> | ||
88 | is set, usually in | ||
89 | <filename>local.conf</filename>, and defines the list of places to search for | ||
90 | <filename>.bb</filename> files. | ||
91 | By default, the <filename>BBFILES</filename> variable specifies the | ||
92 | <filename>meta/recipes-*/</filename> directory within Poky. | ||
93 | Adding extra content to <filename>BBFILES</filename> is best achieved through the use of | ||
94 | BitBake layers as described in the | ||
95 | "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and | ||
96 | Creating Layers</ulink>" section of the Yocto Project Development Manual. | ||
97 | </para> | ||
98 | |||
99 | <para> | ||
100 | BitBake parses each <filename>.bb</filename> file in <filename>BBFILES</filename> and | ||
101 | stores the values of various variables. | ||
102 | In summary, for each <filename>.bb</filename> | ||
103 | file the configuration plus the base class of variables are set, followed | ||
104 | by the data in the <filename>.bb</filename> file | ||
105 | itself, followed by any inherit commands that | ||
106 | <filename>.bb</filename> file might contain. | ||
107 | </para> | ||
108 | |||
109 | <para> | ||
110 | Because parsing <filename>.bb</filename> files is a time | ||
111 | consuming process, a cache is kept to speed up subsequent parsing. | ||
112 | This cache is invalid if the timestamp of the <filename>.bb</filename> | ||
113 | file itself changes, or if the timestamps of any of the include, | ||
114 | configuration files or class files on which the | ||
115 | <filename>.bb</filename> file depends change. | ||
116 | </para> | ||
117 | |||
118 | <note> | ||
119 | <para> | ||
120 | You need to be aware of how BitBake parses curly braces. | ||
121 | If a recipe uses a closing curly brace within the function and | ||
122 | the character has no leading spaces, BitBake produces a parsing | ||
123 | error. | ||
124 | If you use a pair of curly brace in a shell function, the | ||
125 | closing curly brace must not be located at the start of the line | ||
126 | without leading spaces. | ||
127 | </para> | ||
128 | |||
129 | <para> | ||
130 | Here is an example that causes BitBake to produce a parsing | ||
131 | error: | ||
132 | <literallayout class='monospaced'> | ||
133 | fakeroot create_shar() { | ||
134 | cat << "EOF" > ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh | ||
135 | usage() | ||
136 | { | ||
137 | echo "test" | ||
138 | ###### The following "}" at the start of the line causes a parsing error ###### | ||
139 | } | ||
140 | EOF | ||
141 | } | ||
142 | </literallayout> | ||
143 | Writing the recipe this way avoids the error: | ||
144 | <literallayout class='monospaced'> | ||
145 | fakeroot create_shar() { | ||
146 | cat << "EOF" > ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh | ||
147 | usage() | ||
148 | { | ||
149 | echo "test" | ||
150 | ######The following "}" with a leading space at the start of the line avoids the error ###### | ||
151 | } | ||
152 | EOF | ||
153 | } | ||
154 | </literallayout> | ||
155 | </para> | ||
156 | </note> | ||
157 | </section> | ||
158 | |||
159 | <section id='ref-bitbake-providers'> | ||
160 | <title>Preferences and Providers</title> | ||
161 | |||
162 | <para> | ||
163 | Once all the <filename>.bb</filename> files have been | ||
164 | parsed, BitBake starts to build the target (<filename>core-image-sato</filename> | ||
165 | in the previous section's example) and looks for providers of that target. | ||
166 | Once a provider is selected, BitBake resolves all the dependencies for | ||
167 | the target. | ||
168 | In the case of <filename>core-image-sato</filename>, it would lead to | ||
169 | <filename>packagegroup-core-x11-sato</filename>, | ||
170 | which in turn leads to recipes like <filename>matchbox-terminal</filename>, | ||
171 | <filename>pcmanfm</filename> and <filename>gthumb</filename>. | ||
172 | These recipes in turn depend on <filename>eglibc</filename> and the toolchain. | ||
173 | </para> | ||
174 | |||
175 | <para> | ||
176 | Sometimes a target might have multiple providers. | ||
177 | A common example is "virtual/kernel", which is provided by each kernel package. | ||
178 | Each machine often selects the best kernel provider by using a line similar to the | ||
179 | following in the machine configuration file: | ||
180 | </para> | ||
181 | |||
182 | <literallayout class='monospaced'> | ||
183 | PREFERRED_PROVIDER_virtual/kernel = "linux-yocto" | ||
184 | </literallayout> | ||
185 | |||
186 | <para> | ||
187 | The default <filename><link linkend='var-PREFERRED_PROVIDER'>PREFERRED_PROVIDER</link></filename> | ||
188 | is the provider with the same name as the target. | ||
189 | </para> | ||
190 | |||
191 | <para> | ||
192 | Understanding how providers are chosen is made complicated by the fact | ||
193 | that multiple versions might exist. | ||
194 | BitBake defaults to the highest version of a provider. | ||
195 | Version comparisons are made using the same method as Debian. | ||
196 | You can use the | ||
197 | <filename><link linkend='var-PREFERRED_VERSION'>PREFERRED_VERSION</link></filename> | ||
198 | variable to specify a particular version (usually in the distro configuration). | ||
199 | You can influence the order by using the | ||
200 | <filename><link linkend='var-DEFAULT_PREFERENCE'>DEFAULT_PREFERENCE</link></filename> | ||
201 | variable. | ||
202 | By default, files have a preference of "0". | ||
203 | Setting the <filename>DEFAULT_PREFERENCE</filename> to "-1" makes the | ||
204 | package unlikely to be used unless it is explicitly referenced. | ||
205 | Setting the <filename>DEFAULT_PREFERENCE</filename> to "1" makes it likely the package is used. | ||
206 | <filename>PREFERRED_VERSION</filename> overrides any <filename>DEFAULT_PREFERENCE</filename> setting. | ||
207 | <filename>DEFAULT_PREFERENCE</filename> is often used to mark newer and more experimental package | ||
208 | versions until they have undergone sufficient testing to be considered stable. | ||
209 | </para> | ||
210 | |||
211 | <para> | ||
212 | In summary, BitBake has created a list of providers, which is prioritized, for each target. | ||
213 | </para> | ||
214 | </section> | ||
215 | |||
216 | <section id='ref-bitbake-dependencies'> | ||
217 | <title>Dependencies</title> | ||
218 | |||
219 | <para> | ||
220 | Each target BitBake builds consists of multiple tasks such as | ||
221 | <filename>fetch</filename>, <filename>unpack</filename>, | ||
222 | <filename>patch</filename>, <filename>configure</filename>, | ||
223 | and <filename>compile</filename>. | ||
224 | For best performance on multi-core systems, BitBake considers each task as an independent | ||
225 | entity with its own set of dependencies. | ||
226 | </para> | ||
227 | |||
228 | <para> | ||
229 | Dependencies are defined through several variables. | ||
230 | You can find information about variables BitBake uses in the BitBake documentation, | ||
231 | which is found in the <filename>bitbake/doc/manual</filename> directory within the | ||
232 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
233 | At a basic level, it is sufficient to know that BitBake uses the | ||
234 | <filename><link linkend='var-DEPENDS'>DEPENDS</link></filename> and | ||
235 | <filename><link linkend='var-RDEPENDS'>RDEPENDS</link></filename> variables when | ||
236 | calculating dependencies. | ||
237 | </para> | ||
238 | </section> | ||
239 | |||
240 | <section id='ref-bitbake-tasklist'> | ||
241 | <title>The Task List</title> | ||
242 | |||
243 | <para> | ||
244 | Based on the generated list of providers and the dependency information, | ||
245 | BitBake can now calculate exactly what tasks it needs to run and in what | ||
246 | order it needs to run them. | ||
247 | The build now starts with BitBake forking off threads up to the limit set in the | ||
248 | <filename><link linkend='var-BB_NUMBER_THREADS'>BB_NUMBER_THREADS</link></filename> variable. | ||
249 | BitBake continues to fork threads as long as there are tasks ready to run, | ||
250 | those tasks have all their dependencies met, and the thread threshold has not been | ||
251 | exceeded. | ||
252 | </para> | ||
253 | |||
254 | <para> | ||
255 | It is worth noting that you can greatly speed up the build time by properly setting | ||
256 | the <filename>BB_NUMBER_THREADS</filename> variable. | ||
257 | See the | ||
258 | "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" | ||
259 | section in the Yocto Project Quick Start for more information. | ||
260 | </para> | ||
261 | |||
262 | <para> | ||
263 | As each task completes, a timestamp is written to the directory specified by the | ||
264 | <filename><link linkend='var-STAMP'>STAMP</link></filename> variable. | ||
265 | On subsequent runs, BitBake looks within the <filename>build/tmp/stamps</filename> | ||
266 | directory and does not rerun | ||
267 | tasks that are already completed unless a timestamp is found to be invalid. | ||
268 | Currently, invalid timestamps are only considered on a per | ||
269 | <filename>.bb</filename> file basis. | ||
270 | So, for example, if the configure stamp has a timestamp greater than the | ||
271 | compile timestamp for a given target, then the compile task would rerun. | ||
272 | Running the compile task again, however, has no effect on other providers | ||
273 | that depend on that target. | ||
274 | This behavior could change or become configurable in future versions of BitBake. | ||
275 | </para> | ||
276 | |||
277 | <note> | ||
278 | Some tasks are marked as "nostamp" tasks. | ||
279 | No timestamp file is created when these tasks are run. | ||
280 | Consequently, "nostamp" tasks are always rerun. | ||
281 | </note> | ||
282 | </section> | ||
283 | |||
284 | <section id='ref-bitbake-runtask'> | ||
285 | <title>Running a Task</title> | ||
286 | |||
287 | <para> | ||
288 | Tasks can either be a shell task or a Python task. | ||
289 | For shell tasks, BitBake writes a shell script to | ||
290 | <filename>${WORKDIR}/temp/run.do_taskname.pid</filename> and then executes the script. | ||
291 | The generated shell script contains all the exported variables, and the shell functions | ||
292 | with all variables expanded. | ||
293 | Output from the shell script goes to the file <filename>${WORKDIR}/temp/log.do_taskname.pid</filename>. | ||
294 | Looking at the expanded shell functions in the run file and the output in the log files | ||
295 | is a useful debugging technique. | ||
296 | </para> | ||
297 | |||
298 | <para> | ||
299 | For Python tasks, BitBake executes the task internally and logs information to the | ||
300 | controlling terminal. | ||
301 | Future versions of BitBake will write the functions to files similar to the way | ||
302 | shell tasks are handled. | ||
303 | Logging will be handled in a way similar to shell tasks as well. | ||
304 | </para> | ||
305 | |||
306 | <para> | ||
307 | Once all the tasks have been completed BitBake exits. | ||
308 | </para> | ||
309 | |||
310 | <para> | ||
311 | When running a task, BitBake tightly controls the execution environment | ||
312 | of the build tasks to make sure unwanted contamination from the build machine | ||
313 | cannot influence the build. | ||
314 | Consequently, if you do want something to get passed into the build | ||
315 | task's environment, you must take a few steps: | ||
316 | <orderedlist> | ||
317 | <listitem><para>Tell BitBake to load what you want from the environment | ||
318 | into the data store. | ||
319 | You can do so through the <filename>BB_ENV_EXTRAWHITE</filename> | ||
320 | variable. | ||
321 | For example, assume you want to prevent the build system from | ||
322 | accessing your <filename>$HOME/.ccache</filename> directory. | ||
323 | The following command tells BitBake to load | ||
324 | <filename>CCACHE_DIR</filename> from the environment into the data | ||
325 | store: | ||
326 | <literallayout class='monospaced'> | ||
327 | export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE CCACHE_DIR" | ||
328 | </literallayout></para></listitem> | ||
329 | <listitem><para>Tell BitBake to export what you have loaded into the | ||
330 | environment store to the task environment of every running task. | ||
331 | Loading something from the environment into the data store | ||
332 | (previous step) only makes it available in the datastore. | ||
333 | To export it to the task environment of every running task, | ||
334 | use a command similar to the following in your | ||
335 | <filename>local.conf</filename> or distro configuration file: | ||
336 | <literallayout class='monospaced'> | ||
337 | export CCACHE_DIR | ||
338 | </literallayout></para></listitem> | ||
339 | </orderedlist> | ||
340 | </para> | ||
341 | |||
342 | <note> | ||
343 | A side effect of the previous steps is that BitBake records the variable | ||
344 | as a dependency of the build process in things like the shared state | ||
345 | checksums. | ||
346 | If doing so results in unnecessary rebuilds of tasks, you can whitelist the | ||
347 | variable so that the shared state code ignores the dependency when it creates | ||
348 | checksums. | ||
349 | For information on this process, see the <filename>BB_HASHBASE_WHITELIST</filename> | ||
350 | example in the "<link linkend='checksums'>Checksums (Signatures)</link>" section. | ||
351 | </note> | ||
352 | </section> | ||
353 | |||
354 | <section id='ref-bitbake-commandline'> | ||
355 | <title>BitBake Command Line</title> | ||
356 | |||
357 | <para> | ||
358 | Following is the BitBake help output: | ||
359 | </para> | ||
360 | |||
361 | <screen> | ||
362 | $ bitbake --help | ||
363 | Usage: bitbake [options] [recipename/target ...] | ||
364 | |||
365 | Executes the specified task (default is 'build') for a given set of target recipes (.bb files). | ||
366 | It is assumed there is a conf/bblayers.conf available in cwd or in BBPATH which | ||
367 | will provide the layer, BBFILES and other configuration information. | ||
368 | |||
369 | Options: | ||
370 | --version show program's version number and exit | ||
371 | -h, --help show this help message and exit | ||
372 | -b BUILDFILE, --buildfile=BUILDFILE | ||
373 | Execute tasks from a specific .bb recipe directly. | ||
374 | WARNING: Does not handle any dependencies from other | ||
375 | recipes. | ||
376 | -k, --continue Continue as much as possible after an error. While the | ||
377 | target that failed and anything depending on it cannot | ||
378 | be built, as much as possible will be built before | ||
379 | stopping. | ||
380 | -a, --tryaltconfigs Continue with builds by trying to use alternative | ||
381 | providers where possible. | ||
382 | -f, --force Force the specified targets/task to run (invalidating | ||
383 | any existing stamp file). | ||
384 | -c CMD, --cmd=CMD Specify the task to execute. The exact options | ||
385 | available depend on the metadata. Some examples might | ||
386 | be 'compile' or 'populate_sysroot' or 'listtasks' may | ||
387 | give a list of the tasks available. | ||
388 | -C INVALIDATE_STAMP, --clear-stamp=INVALIDATE_STAMP | ||
389 | Invalidate the stamp for the specified task such as | ||
390 | 'compile' and then run the default task for the | ||
391 | specified target(s). | ||
392 | -r PREFILE, --read=PREFILE | ||
393 | Read the specified file before bitbake.conf. | ||
394 | -R POSTFILE, --postread=POSTFILE | ||
395 | Read the specified file after bitbake.conf. | ||
396 | -v, --verbose Output more log message data to the terminal. | ||
397 | -D, --debug Increase the debug level. You can specify this more | ||
398 | than once. | ||
399 | -n, --dry-run Don't execute, just go through the motions. | ||
400 | -S, --dump-signatures | ||
401 | Don't execute, just dump out the signature | ||
402 | construction information. | ||
403 | -p, --parse-only Quit after parsing the BB recipes. | ||
404 | -s, --show-versions Show current and preferred versions of all recipes. | ||
405 | -e, --environment Show the global or per-package environment complete | ||
406 | with information about where variables were | ||
407 | set/changed. | ||
408 | -g, --graphviz Save dependency tree information for the specified | ||
409 | targets in the dot syntax. | ||
410 | -I EXTRA_ASSUME_PROVIDED, --ignore-deps=EXTRA_ASSUME_PROVIDED | ||
411 | Assume these dependencies don't exist and are already | ||
412 | provided (equivalent to ASSUME_PROVIDED). Useful to | ||
413 | make dependency graphs more appealing | ||
414 | -l DEBUG_DOMAINS, --log-domains=DEBUG_DOMAINS | ||
415 | Show debug logging for the specified logging domains | ||
416 | -P, --profile Profile the command and save reports. | ||
417 | -u UI, --ui=UI The user interface to use (e.g. knotty, hob, depexp). | ||
418 | -t SERVERTYPE, --servertype=SERVERTYPE | ||
419 | Choose which server to use, process or xmlrpc. | ||
420 | --revisions-changed Set the exit code depending on whether upstream | ||
421 | floating revisions have changed or not. | ||
422 | --server-only Run bitbake without a UI, only starting a server | ||
423 | (cooker) process. | ||
424 | -B BIND, --bind=BIND The name/address for the bitbake server to bind to. | ||
425 | --no-setscene Do not run any setscene tasks. sstate will be ignored | ||
426 | and everything needed, built. | ||
427 | --remote-server=REMOTE_SERVER | ||
428 | Connect to the specified server. | ||
429 | -m, --kill-server Terminate the remote server. | ||
430 | --observe-only Connect to a server as an observing-only client. | ||
431 | </screen> | ||
432 | </section> | ||
433 | |||
434 | <section id='ref-bitbake-fetchers'> | ||
435 | <title>Fetchers</title> | ||
436 | |||
437 | <para> | ||
438 | BitBake also contains a set of "fetcher" modules that allow | ||
439 | retrieval of source code from various types of sources. | ||
440 | For example, BitBake can get source code from a disk with the metadata, from websites, | ||
441 | from remote shell accounts, or from Source Code Management (SCM) systems | ||
442 | like <filename>cvs/subversion/git</filename>. | ||
443 | </para> | ||
444 | |||
445 | <para> | ||
446 | Fetchers are usually triggered by entries in | ||
447 | <filename><link linkend='var-SRC_URI'>SRC_URI</link></filename>. | ||
448 | You can find information about the options and formats of entries for specific | ||
449 | fetchers in the BitBake manual located in the | ||
450 | <filename>bitbake/doc/manual</filename> directory of the | ||
451 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
452 | </para> | ||
453 | |||
454 | <para> | ||
455 | One useful feature for certain Source Code Manager (SCM) fetchers is the ability to | ||
456 | "auto-update" when the upstream SCM changes version. | ||
457 | Since this ability requires certain functionality from the SCM, not all | ||
458 | systems support it. | ||
459 | Currently Subversion, Bazaar and to a limited extent, Git support the ability to "auto-update". | ||
460 | This feature works using the <filename><link linkend='var-SRCREV'>SRCREV</link></filename> | ||
461 | variable. | ||
462 | See the | ||
463 | "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-srcrev'>Using an External SCM</ulink>" section | ||
464 | in the Yocto Project Development Manual for more information. | ||
465 | </para> | ||
466 | |||
467 | </section> | ||
468 | |||
469 | </chapter> | ||
470 | <!-- | ||
471 | vim: expandtab tw=80 ts=4 spell spelllang=en_gb | ||
472 | --> | ||
diff --git a/documentation/ref-manual/ref-classes.xml b/documentation/ref-manual/ref-classes.xml new file mode 100644 index 0000000..e7e9942 --- /dev/null +++ b/documentation/ref-manual/ref-classes.xml | |||
@@ -0,0 +1,3300 @@ | |||
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 | |||
5 | <chapter id='ref-classes'> | ||
6 | <title>Classes</title> | ||
7 | |||
8 | <para> | ||
9 | Class files are used to abstract common functionality and share it amongst | ||
10 | multiple recipe (<filename>.bb</filename>) files. | ||
11 | To use a class file, you simply make sure the recipe inherits the class. | ||
12 | In most cases, when a recipe inherits a class it is enough to enable its | ||
13 | features. | ||
14 | There are cases, however, where in the recipe you might need to set | ||
15 | variables or override some default behavior. | ||
16 | </para> | ||
17 | |||
18 | <para> | ||
19 | Any <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> usually | ||
20 | found in a recipe can also be placed in a class file. | ||
21 | Class files are identified by the extension <filename>.bbclass</filename> | ||
22 | and are usually placed in a <filename>classes/</filename> directory beneath | ||
23 | the <filename>meta*/</filename> directory found in the | ||
24 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
25 | Class files can also be pointed to by | ||
26 | <link linkend='var-BUILDDIR'><filename>BUILDDIR</filename></link> | ||
27 | (e.g. <filename>build/</filename>) in the same way as | ||
28 | <filename>.conf</filename> files in the <filename>conf</filename> directory. | ||
29 | Class files are searched for in | ||
30 | <link linkend='var-BBPATH'><filename>BBPATH</filename></link> | ||
31 | using the same method by which <filename>.conf</filename> files are | ||
32 | searched. | ||
33 | </para> | ||
34 | |||
35 | <para> | ||
36 | This chapter discusses only the most useful and important classes. | ||
37 | Other classes do exist within the <filename>meta/classes</filename> | ||
38 | directory in the | ||
39 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
40 | You can reference the <filename>.bbclass</filename> files directly | ||
41 | for more information. | ||
42 | </para> | ||
43 | |||
44 | <section id='ref-classes-allarch'> | ||
45 | <title><filename>allarch.bbclass</filename></title> | ||
46 | |||
47 | <para> | ||
48 | The <filename>allarch</filename> class is inherited | ||
49 | by recipes that do not produce architecture-specific output. | ||
50 | The class disables functionality that is normally needed for recipes | ||
51 | that produce executable binaries (such as building the cross-compiler | ||
52 | and a C library as pre-requisites, and splitting out of debug symbols | ||
53 | during packaging). | ||
54 | </para> | ||
55 | |||
56 | <para> | ||
57 | By default, all recipes inherit the | ||
58 | <link linkend='ref-classes-base'><filename>base</filename></link> and | ||
59 | <link linkend='ref-classes-package'><filename>package</filename></link> | ||
60 | classes, which enable functionality | ||
61 | needed for recipes that produce executable output. | ||
62 | If your recipe, for example, only produces packages that contain | ||
63 | configuration files, media files, or scripts (e.g. Python and Perl), | ||
64 | then it should inherit the <filename>allarch</filename> class. | ||
65 | </para> | ||
66 | </section> | ||
67 | |||
68 | <section id='ref-classes-archiver'> | ||
69 | <title><filename>archiver.bbclass</filename></title> | ||
70 | |||
71 | <para> | ||
72 | The <filename>archiver</filename> class supports releasing | ||
73 | source code and other materials with the binaries. | ||
74 | </para> | ||
75 | |||
76 | <para> | ||
77 | For more details on the source archiver, see the | ||
78 | "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>" | ||
79 | section in the Yocto Project Development Manual. | ||
80 | </para> | ||
81 | </section> | ||
82 | |||
83 | <section id='ref-classes-autotools'> | ||
84 | <title><filename>autotools.bbclass</filename></title> | ||
85 | |||
86 | <para> | ||
87 | The <filename>autotools</filename> class supports Autotooled | ||
88 | packages. | ||
89 | </para> | ||
90 | |||
91 | <para> | ||
92 | The <filename>autoconf</filename>, <filename>automake</filename>, | ||
93 | and <filename>libtool</filename> bring standardization. | ||
94 | This class defines a set of tasks (configure, compile etc.) that | ||
95 | work for all Autotooled packages. | ||
96 | It should usually be enough to define a few standard variables | ||
97 | and then simply <filename>inherit autotools</filename>. | ||
98 | This class can also work with software that emulates Autotools. | ||
99 | For more information, see the | ||
100 | "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-autotooled-package'>Autotooled Package</ulink>" | ||
101 | section in the Yocto Project Development Manual. | ||
102 | </para> | ||
103 | |||
104 | <para> | ||
105 | It's useful to have some idea of how the tasks defined by this class work | ||
106 | and what they do behind the scenes. | ||
107 | <itemizedlist> | ||
108 | <listitem><para><link linkend='ref-tasks-configure'><filename>do_configure</filename></link> ‐ Regenerates the | ||
109 | configure script (using <filename>autoreconf</filename>) and then launches it | ||
110 | with a standard set of arguments used during cross-compilation. | ||
111 | You can pass additional parameters to <filename>configure</filename> through the | ||
112 | <filename><link linkend='var-EXTRA_OECONF'>EXTRA_OECONF</link></filename> variable. | ||
113 | </para></listitem> | ||
114 | <listitem><para><link linkend='ref-tasks-compile'><filename>do_compile</filename></link> ‐ Runs <filename>make</filename> with | ||
115 | arguments that specify the compiler and linker. | ||
116 | You can pass additional arguments through | ||
117 | the <filename><link linkend='var-EXTRA_OEMAKE'>EXTRA_OEMAKE</link></filename> variable. | ||
118 | </para></listitem> | ||
119 | <listitem><para><link linkend='ref-tasks-install'><filename>do_install</filename></link> ‐ Runs <filename>make install</filename> | ||
120 | and passes in | ||
121 | <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename> | ||
122 | as <filename>DESTDIR</filename>. | ||
123 | </para></listitem> | ||
124 | </itemizedlist> | ||
125 | </para> | ||
126 | |||
127 | <note> | ||
128 | It is planned for future Yocto Project releases that by default, the | ||
129 | <filename>autotools</filename> class supports out-of-tree builds | ||
130 | (<link linkend='var-B'><filename>B</filename></link> != | ||
131 | <link linkend='var-S'><filename>S</filename></link>). | ||
132 | If your recipes do not support out-of-tree builds, you should | ||
133 | have them inherit the | ||
134 | <link linkend='ref-classes-autotools-brokensep'><filename>autotools-brokensep</filename></link> | ||
135 | class. | ||
136 | </note> | ||
137 | </section> | ||
138 | |||
139 | <section id='ref-classes-autotools-brokensep'> | ||
140 | <title><filename>autotools-brokensep.bbclass</filename></title> | ||
141 | |||
142 | <para> | ||
143 | The <filename>autotools-brokensep</filename> class behaves the same | ||
144 | as the | ||
145 | <link linkend='ref-classes-autotools'><filename>autotools</filename></link> | ||
146 | class but builds with | ||
147 | <link linkend='var-B'><filename>B</filename></link> == | ||
148 | <link linkend='var-S'><filename>S</filename></link>. | ||
149 | This method is useful when out-of-tree build support is either not | ||
150 | present or is broken. | ||
151 | <note> | ||
152 | It is recommended that out-of-tree support be fixed and used | ||
153 | if at all possible. | ||
154 | </note> | ||
155 | </para> | ||
156 | </section> | ||
157 | |||
158 | <section id='ref-classes-base'> | ||
159 | <title><filename>base.bbclass</filename></title> | ||
160 | |||
161 | <para> | ||
162 | The <filename>base</filename> class is special in that every | ||
163 | <filename>.bb</filename> file implicitly inherits the class. | ||
164 | This class contains definitions for standard basic | ||
165 | tasks such as fetching, unpacking, configuring (empty by default), | ||
166 | compiling (runs any <filename>Makefile</filename> present), installing | ||
167 | (empty by default) and packaging (empty by default). | ||
168 | These classes are often overridden or extended by other classes | ||
169 | such as the | ||
170 | <link linkend='ref-classes-autotools'><filename>autotools</filename></link> | ||
171 | class or the | ||
172 | <link linkend='ref-classes-package'><filename>package</filename></link> | ||
173 | class. | ||
174 | The class also contains some commonly used functions such as | ||
175 | <filename>oe_runmake</filename>. | ||
176 | </para> | ||
177 | </section> | ||
178 | |||
179 | <section id='ref-classes-bin-package'> | ||
180 | <title><filename>bin_package.bbclass</filename></title> | ||
181 | |||
182 | <para> | ||
183 | The <filename>bin_package</filename> class is a | ||
184 | helper class for recipes that extract the contents of a binary package | ||
185 | (e.g. an RPM) and install those contents rather than building the | ||
186 | binary from source. | ||
187 | The binary package is extracted and new packages in the configured | ||
188 | output package format are created. | ||
189 | <note> | ||
190 | For RPMs and other packages that do not contain a subdirectory, | ||
191 | you should specify a "subdir" parameter. | ||
192 | Here is an example where <filename>${BP}</filename> is used so that | ||
193 | the files are extracted into the subdirectory expected by the | ||
194 | default value of | ||
195 | <link linkend='var-S'><filename>S</filename></link>: | ||
196 | <literallayout class='monospaced'> | ||
197 | SRC_URI = "http://example.com/downloads/somepackage.rpm;subdir=${BP}" | ||
198 | </literallayout> | ||
199 | </note> | ||
200 | </para> | ||
201 | </section> | ||
202 | |||
203 | <section id='ref-classes-binconfig'> | ||
204 | <title><filename>binconfig.bbclass</filename></title> | ||
205 | |||
206 | <para> | ||
207 | The <filename>binconfig</filename> class helps to correct paths in | ||
208 | shell scripts. | ||
209 | </para> | ||
210 | |||
211 | <para> | ||
212 | Before <filename>pkg-config</filename> had become widespread, libraries | ||
213 | shipped shell scripts to give information about the libraries and | ||
214 | include paths needed to build software (usually named | ||
215 | <filename>LIBNAME-config</filename>). | ||
216 | This class assists any recipe using such scripts. | ||
217 | </para> | ||
218 | |||
219 | <para> | ||
220 | During staging, the OpenEmbedded build system installs such scripts | ||
221 | into the <filename>sysroots/</filename> directory. | ||
222 | Inheriting this class results in all paths in these scripts being | ||
223 | changed to point into the <filename>sysroots/</filename> directory so | ||
224 | that all builds that use the script use the correct directories | ||
225 | for the cross compiling layout. | ||
226 | See the | ||
227 | <link linkend='var-BINCONFIG_GLOB'><filename>BINCONFIG_GLOB</filename></link> | ||
228 | variable for more information. | ||
229 | </para> | ||
230 | </section> | ||
231 | |||
232 | <section id='ref-classes-blacklist'> | ||
233 | <title><filename>blacklist.bbclass</filename></title> | ||
234 | |||
235 | <para> | ||
236 | The <filename>blacklist</filename> class prevents | ||
237 | the OpenEmbedded build system from building specific recipes | ||
238 | (blacklists them). | ||
239 | To use this class, inherit the class globally and set | ||
240 | <link linkend='var-PNBLACKLIST'><filename>PNBLACKLIST</filename></link> | ||
241 | for each recipe you wish to blacklist. | ||
242 | Specify the <link linkend='var-PN'><filename>PN</filename></link> | ||
243 | value as a variable flag (varflag) and provide a reason, which is | ||
244 | reported, if the package is requested to be built as the value. | ||
245 | For example, if you want to blacklist a recipe called "exoticware", | ||
246 | you add the following to your <filename>local.conf</filename> | ||
247 | or distribution configuration: | ||
248 | <literallayout class='monospaced'> | ||
249 | INHERIT += "blacklist" | ||
250 | PNBLACKLIST[exoticware] = "Not supported by our organization." | ||
251 | </literallayout> | ||
252 | </para> | ||
253 | </section> | ||
254 | |||
255 | <section id='ref-classes-boot-directdisk'> | ||
256 | <title><filename>boot-directdisk.bbclass</filename></title> | ||
257 | |||
258 | <para> | ||
259 | The <filename>boot-directdisk</filename> class | ||
260 | creates an image that can be placed directly onto a hard disk using | ||
261 | <filename>dd</filename> and then booted. | ||
262 | The image uses SYSLINUX. | ||
263 | </para> | ||
264 | |||
265 | <para> | ||
266 | The end result is a 512 boot sector populated with a | ||
267 | Master Boot Record (MBR) and partition table followed by an MSDOS | ||
268 | FAT16 partition containing SYSLINUX and a Linux kernel completed by | ||
269 | the <filename>ext2</filename> and <filename>ext3</filename> | ||
270 | root filesystems. | ||
271 | </para> | ||
272 | </section> | ||
273 | |||
274 | <section id='ref-classes-bootimg'> | ||
275 | <title><filename>bootimg.bbclass</filename></title> | ||
276 | |||
277 | <para> | ||
278 | The <filename>bootimg</filename> class creates a bootable | ||
279 | image using SYSLINUX, your kernel, and an optional initial RAM disk | ||
280 | (<filename>initrd</filename>). | ||
281 | </para> | ||
282 | |||
283 | <para> | ||
284 | When you use this class, two things happen: | ||
285 | <itemizedlist> | ||
286 | <listitem><para> | ||
287 | A <filename>.hddimg</filename> file is created. | ||
288 | This file is an MSDOS filesystem that contains SYSLINUX, | ||
289 | a kernel, an <filename>initrd</filename>, and a root filesystem | ||
290 | image. | ||
291 | All three of these can be written to hard drives directly and | ||
292 | also booted on a USB flash disks using <filename>dd</filename>. | ||
293 | </para></listitem> | ||
294 | <listitem><para> | ||
295 | A CD <filename>.iso</filename> image is created. | ||
296 | When this file is booted, the <filename>initrd</filename> | ||
297 | boots and processes the label selected in SYSLINUX. | ||
298 | Actions based on the label are then performed (e.g. installing | ||
299 | to a hard drive).</para></listitem> | ||
300 | </itemizedlist> | ||
301 | </para> | ||
302 | |||
303 | <para> | ||
304 | The <filename>bootimg</filename> class supports the | ||
305 | <link linkend='var-INITRD'><filename>INITRD</filename></link>, | ||
306 | <link linkend='var-NOISO'><filename>NOISO</filename></link>, | ||
307 | <link linkend='var-NOHDD'><filename>NOHDD</filename></link>, and | ||
308 | <link linkend='var-ROOTFS'><filename>ROOTFS</filename></link> | ||
309 | variables. | ||
310 | </para> | ||
311 | </section> | ||
312 | |||
313 | <section id='ref-classes-bugzilla'> | ||
314 | <title><filename>bugzilla.bbclass</filename></title> | ||
315 | |||
316 | <para> | ||
317 | The <filename>bugzilla</filename> class supports setting up an | ||
318 | instance of Bugzilla in which you can automatically files bug reports | ||
319 | in response to build failures. | ||
320 | For this class to work, you need to enable the XML-RPC interface in | ||
321 | the instance of Bugzilla. | ||
322 | </para> | ||
323 | </section> | ||
324 | |||
325 | <section id='ref-classes-buildhistory'> | ||
326 | <title><filename>buildhistory.bbclass</filename></title> | ||
327 | |||
328 | <para> | ||
329 | The <filename>buildhistory</filename> class records a | ||
330 | history of build output metadata, which can be used to detect possible | ||
331 | regressions as well as used for analysis of the build output. | ||
332 | For more information on using Build History, see the | ||
333 | "<link linkend='maintaining-build-output-quality'>Maintaining Build Output Quality</link>" | ||
334 | section. | ||
335 | </para> | ||
336 | </section> | ||
337 | |||
338 | <section id='ref-classes-buildstats'> | ||
339 | <title><filename>buildstats.bbclass</filename></title> | ||
340 | |||
341 | <para> | ||
342 | The <filename>buildstats</filename> class records | ||
343 | performance statistics about each task executed during the build | ||
344 | (e.g. elapsed time, CPU usage, and I/O usage). | ||
345 | </para> | ||
346 | |||
347 | <para> | ||
348 | When you use this class, the output goes into the | ||
349 | <link linkend='var-BUILDSTATS_BASE'><filename>BUILDSTATS_BASE</filename></link> | ||
350 | directory, which defaults to <filename>${TMPDIR}/buildstats/</filename>. | ||
351 | You can analyze the elapsed time using | ||
352 | <filename>scripts/pybootchartgui/pybootchartgui.py</filename>, which | ||
353 | produces a cascading chart of the entire build process and can be | ||
354 | useful for highlighting bottlenecks. | ||
355 | </para> | ||
356 | |||
357 | <para> | ||
358 | Collecting build statistics is enabled by default through the | ||
359 | <link linkend='var-USER_CLASSES'><filename>USER_CLASSES</filename></link> | ||
360 | variable from your <filename>local.conf</filename> file. | ||
361 | Consequently, you do not have to do anything to enable the class. | ||
362 | However, if you want to disable the class, simply remove "buildstats" | ||
363 | from the <filename>USER_CLASSES</filename> list. | ||
364 | </para> | ||
365 | </section> | ||
366 | |||
367 | <section id='ref-classes-ccache'> | ||
368 | <title><filename>ccache.bbclass</filename></title> | ||
369 | |||
370 | <para> | ||
371 | The <filename>ccache</filename> class enables the | ||
372 | <ulink url='http://ccache.samba.org/'>C/C++ Compiler Cache</ulink> | ||
373 | for the build. | ||
374 | This class is used to give a minor performance boost during the build. | ||
375 | However, using the class can lead to unexpected side-effects. | ||
376 | Thus, it is recommended that you do not use this class. | ||
377 | See <ulink url='http://ccache.samba.org/'></ulink> for information on | ||
378 | the C/C++ Compiler Cache. | ||
379 | </para> | ||
380 | </section> | ||
381 | |||
382 | <section id='ref-classes-chrpath'> | ||
383 | <title><filename>chrpath.bbclass</filename></title> | ||
384 | |||
385 | <para> | ||
386 | The <filename>chrpath</filename> class | ||
387 | is a wrapper around the "chrpath" utility, which is used during the | ||
388 | build process for <filename>nativesdk</filename>, | ||
389 | <filename>cross</filename>, and | ||
390 | <filename>cross-canadian</filename> recipes to change | ||
391 | <filename>RPATH</filename> records within binaries in order to make | ||
392 | them relocatable. | ||
393 | </para> | ||
394 | </section> | ||
395 | |||
396 | <section id='ref-classes-clutter'> | ||
397 | <title><filename>clutter.bbclass</filename></title> | ||
398 | |||
399 | <para> | ||
400 | The <filename>clutter</filename> class consolidates the | ||
401 | major and minor version naming and other common items used by Clutter | ||
402 | and related recipes. | ||
403 | <note> | ||
404 | Unlike some other classes related to specific libraries, recipes | ||
405 | building other software that uses Clutter do not need to | ||
406 | inherit this class unless they use the same recipe versioning | ||
407 | scheme that the Clutter and related recipes do. | ||
408 | </note> | ||
409 | </para> | ||
410 | </section> | ||
411 | |||
412 | <section id='ref-classes-cmake'> | ||
413 | <title><filename>cmake.bbclass</filename></title> | ||
414 | |||
415 | <para> | ||
416 | The <filename>cmake</filename> class allows for | ||
417 | recipes that need to build software using the CMake build system. | ||
418 | You can use the | ||
419 | <link linkend='var-EXTRA_OECMAKE'><filename>EXTRA_OECMAKE</filename></link> | ||
420 | variable to specify additional configuration options to be passed on | ||
421 | the <filename>cmake</filename> command line. | ||
422 | </para> | ||
423 | </section> | ||
424 | |||
425 | <section id='ref-classes-cml1'> | ||
426 | <title><filename>cml1.bbclass</filename></title> | ||
427 | |||
428 | <para> | ||
429 | The <filename>cml1</filename> class provides basic support for the | ||
430 | Linux kernel style build configuration system. | ||
431 | </para> | ||
432 | </section> | ||
433 | |||
434 | <section id='ref-classes-copyleft_compliance'> | ||
435 | <title><filename>copyleft_compliance.bbclass</filename></title> | ||
436 | |||
437 | <para> | ||
438 | The <filename>copyleft_compliance</filename> class | ||
439 | preserves source code for the purposes of license compliance. | ||
440 | This class is an alternative to the <filename>archiver</filename> | ||
441 | class and is still used by some users even though it has been | ||
442 | deprecated in favor of the | ||
443 | <link linkend='ref-classes-archiver'><filename>archiver</filename></link> | ||
444 | class. | ||
445 | </para> | ||
446 | </section> | ||
447 | |||
448 | <section id='ref-classes-core-image'> | ||
449 | <title><filename>core-image.bbclass</filename></title> | ||
450 | |||
451 | <para> | ||
452 | The <filename>core-image</filename> class | ||
453 | provides common definitions for the | ||
454 | <filename>core-image-*</filename> image recipes, such as support for | ||
455 | additional | ||
456 | <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>. | ||
457 | </para> | ||
458 | </section> | ||
459 | |||
460 | <section id='ref-classes-cpan'> | ||
461 | <title><filename>cpan.bbclass</filename></title> | ||
462 | |||
463 | <para> | ||
464 | The <filename>cpan</filename> class supports Perl modules. | ||
465 | </para> | ||
466 | |||
467 | <para> | ||
468 | Recipes for Perl modules are simple. | ||
469 | These recipes usually only need to point to the source's archive and | ||
470 | then inherit the proper class file. | ||
471 | Building is split into two methods depending on which method the module | ||
472 | authors used. | ||
473 | <itemizedlist> | ||
474 | <listitem><para>Modules that use old | ||
475 | <filename>Makefile.PL</filename>-based build system require | ||
476 | <filename>cpan.bbclass</filename> in their recipes. | ||
477 | </para></listitem> | ||
478 | <listitem><para>Modules that use | ||
479 | <filename>Build.PL</filename>-based build system require | ||
480 | using <filename>cpan_build.bbclass</filename> in their recipes. | ||
481 | </para></listitem> | ||
482 | </itemizedlist> | ||
483 | </para> | ||
484 | </section> | ||
485 | |||
486 | <section id='ref-classes-cross'> | ||
487 | <title><filename>cross.bbclass</filename></title> | ||
488 | |||
489 | <para> | ||
490 | The <filename>cross</filename> class provides support for the recipes | ||
491 | that build the cross-compilation tools. | ||
492 | </para> | ||
493 | </section> | ||
494 | |||
495 | <section id='ref-classes-cross-canadian'> | ||
496 | <title><filename>cross-canadian.bbclass</filename></title> | ||
497 | |||
498 | <para> | ||
499 | The <filename>cross-canadian</filename> class | ||
500 | provides support for the recipes that build the Canadian | ||
501 | Cross-compilation tools for SDKs. | ||
502 | See the | ||
503 | "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>" | ||
504 | section for more discussion on these cross-compilation tools. | ||
505 | </para> | ||
506 | </section> | ||
507 | |||
508 | <section id='ref-classes-crosssdk'> | ||
509 | <title><filename>crosssdk.bbclass</filename></title> | ||
510 | |||
511 | <para> | ||
512 | The <filename>crosssdk</filename> class | ||
513 | provides support for the recipes that build the cross-compilation | ||
514 | tools used for building SDKs. | ||
515 | See the | ||
516 | "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>" | ||
517 | section for more discussion on these cross-compilation tools. | ||
518 | </para> | ||
519 | </section> | ||
520 | |||
521 | <section id='ref-classes-debian'> | ||
522 | <title><filename>debian.bbclass</filename></title> | ||
523 | |||
524 | <para> | ||
525 | The <filename>debian</filename> class renames output packages so that | ||
526 | they follow the Debian naming policy (i.e. <filename>eglibc</filename> | ||
527 | becomes <filename>libc6</filename> and <filename>eglibc-devel</filename> | ||
528 | becomes <filename>libc6-dev</filename>.) | ||
529 | Renaming includes the library name and version as part of the package | ||
530 | name. | ||
531 | </para> | ||
532 | |||
533 | <para> | ||
534 | If a recipe creates packages for multiple libraries | ||
535 | (shared object files of <filename>.so</filename> type), use the | ||
536 | <link linkend='var-LEAD_SONAME'><filename>LEAD_SONAME</filename></link> | ||
537 | variable in the recipe to specify the library on which to apply the | ||
538 | naming scheme. | ||
539 | </para> | ||
540 | </section> | ||
541 | |||
542 | <section id='ref-classes-deploy'> | ||
543 | <title><filename>deploy.bbclass</filename></title> | ||
544 | |||
545 | <para> | ||
546 | The <filename>deploy</filename> class handles deploying files | ||
547 | to the | ||
548 | <link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link> | ||
549 | directory. | ||
550 | The main function of this class is to allow the deploy step to be | ||
551 | accelerated by shared state. | ||
552 | Recipes that inherit this class should define their own | ||
553 | <link linkend='ref-tasks-deploy'><filename>do_deploy</filename></link> | ||
554 | function to copy the files to be deployed to | ||
555 | <link linkend='var-DEPLOYDIR'><filename>DEPLOYDIR</filename></link>, | ||
556 | and use <filename>addtask</filename> to add the task at the appropriate | ||
557 | place, which is usually after | ||
558 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link> | ||
559 | or | ||
560 | <link linkend='ref-tasks-install'><filename>do_install</filename></link>. | ||
561 | The class then takes care of staging the files from | ||
562 | <filename>DEPLOYDIR</filename> to | ||
563 | <filename>DEPLOY_DIR_IMAGE</filename>. | ||
564 | </para> | ||
565 | </section> | ||
566 | |||
567 | <section id='ref-classes-devshell'> | ||
568 | <title><filename>devshell.bbclass</filename></title> | ||
569 | |||
570 | <para> | ||
571 | The <filename>devshell</filename> class adds the | ||
572 | <filename>do_devshell</filename> task. | ||
573 | Distribution policy dictates whether to include this class. | ||
574 | See the | ||
575 | "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-devshell'>Using a Development Shell</ulink>" section | ||
576 | in the Yocto Project Development Manual for more information about | ||
577 | using <filename>devshell</filename>. | ||
578 | </para> | ||
579 | </section> | ||
580 | |||
581 | <section id='ref-classes-distro_features_check'> | ||
582 | <title><filename>distro_features_check.bbclass</filename></title> | ||
583 | |||
584 | <para> | ||
585 | The <filename>distro_features_check</filename> class | ||
586 | allows individual recipes to check for required and conflicting | ||
587 | <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>. | ||
588 | </para> | ||
589 | |||
590 | <para> | ||
591 | This class provides support for the | ||
592 | <link linkend='var-REQUIRED_DISTRO_FEATURES'><filename>REQUIRED_DISTRO_FEATURES</filename></link> | ||
593 | and | ||
594 | <link linkend='var-CONFLICT_DISTRO_FEATURES'><filename>CONFLICT_DISTRO_FEATURES</filename></link> | ||
595 | variables. | ||
596 | If any conditions specified in the recipe using the above variables are | ||
597 | not met, the recipe will be skipped. | ||
598 | </para> | ||
599 | </section> | ||
600 | |||
601 | <section id='ref-classes-distrodata'> | ||
602 | <title><filename>distrodata.bbclass</filename></title> | ||
603 | |||
604 | <para> | ||
605 | The <filename>distrodata</filename> class | ||
606 | provides for automatic checking for upstream recipe updates. | ||
607 | The class creates a comma-separated value (CSV) spreadsheet that | ||
608 | contains information about the recipes. | ||
609 | The information provides the <filename>do_distrodata</filename> and | ||
610 | <filename>do_distro_check</filename> tasks, which do upstream checking | ||
611 | and also verify if a package is used in multiple major distributions. | ||
612 | </para> | ||
613 | |||
614 | <para> | ||
615 | The class is not included by default. | ||
616 | To use it, you must include the following files and set the | ||
617 | <link linkend='var-INHERIT'><filename>INHERIT</filename></link> | ||
618 | variable: | ||
619 | <literallayout class='monospaced'> | ||
620 | include conf/distro/include/distro_alias.inc | ||
621 | include conf/distro/include/recipe_color.inc | ||
622 | include conf/distro/include/maintainers.inc | ||
623 | include conf/distro/include/upstream_tracking.inc | ||
624 | include conf/distro/include/package_regex.inc | ||
625 | INHERIT+= "distrodata" | ||
626 | </literallayout> | ||
627 | </para> | ||
628 | </section> | ||
629 | |||
630 | <section id='ref-classes-distutils'> | ||
631 | <title><filename>distutils.bbclass</filename></title> | ||
632 | |||
633 | <para> | ||
634 | The <filename>distutils</filename> class supports recipes for Python | ||
635 | version 2.x extensions, which are simple. | ||
636 | These recipes usually only need to point to the source's archive and | ||
637 | then inherit the proper class. | ||
638 | Building is split into two methods depending on which method the | ||
639 | module authors used. | ||
640 | <itemizedlist> | ||
641 | <listitem><para>Extensions that use an Autotools-based build system | ||
642 | require Autotools and | ||
643 | <filename>distutils</filename>-based classes in their recipes. | ||
644 | </para></listitem> | ||
645 | <listitem><para>Extensions that use build systems based on | ||
646 | <filename>distutils</filename> require | ||
647 | the <filename>distutils</filename> class in their recipes. | ||
648 | </para></listitem> | ||
649 | <listitem><para>Extensions that use build systems based on | ||
650 | <filename>setuptools</filename> require the | ||
651 | <link linkend='ref-classes-setuptools'><filename>setuptools</filename></link> | ||
652 | class in their recipes. | ||
653 | </para></listitem> | ||
654 | </itemizedlist> | ||
655 | </para> | ||
656 | </section> | ||
657 | |||
658 | <section id='ref-classes-distutils3'> | ||
659 | <title><filename>distutils3.bbclass</filename></title> | ||
660 | |||
661 | <para> | ||
662 | The <filename>distutils3</filename> class supports recipes for Python | ||
663 | version 3.x extensions, which are simple. | ||
664 | These recipes usually only need to point to the source's archive and | ||
665 | then inherit the proper class. | ||
666 | Building is split into two methods depending on which method the | ||
667 | module authors used. | ||
668 | <itemizedlist> | ||
669 | <listitem><para>Extensions that use an Autotools-based build system | ||
670 | require Autotools and | ||
671 | <filename>distutils</filename>-based classes in their recipes. | ||
672 | </para></listitem> | ||
673 | <listitem><para>Extensions that use | ||
674 | <filename>distutils</filename>-based build systems require | ||
675 | the <filename>distutils</filename> class in their recipes. | ||
676 | </para></listitem> | ||
677 | <listitem><para>Extensions that use build systems based on | ||
678 | <filename>setuptools3</filename> require the | ||
679 | <link linkend='ref-classes-setuptools'><filename>setuptools3</filename></link> | ||
680 | class in their recipes. | ||
681 | </para></listitem> | ||
682 | </itemizedlist> | ||
683 | </para> | ||
684 | </section> | ||
685 | |||
686 | <section id='ref-classes-externalsrc'> | ||
687 | <title><filename>externalsrc.bbclass</filename></title> | ||
688 | |||
689 | <para> | ||
690 | The <filename>externalsrc</filename> class supports building software | ||
691 | from source code that is external to the OpenEmbedded build system. | ||
692 | Building software from an external source tree means that the build | ||
693 | system's normal fetch, unpack, and patch process is not used. | ||
694 | </para> | ||
695 | |||
696 | <para> | ||
697 | By default, the OpenEmbedded build system uses the | ||
698 | <link linkend='var-S'><filename>S</filename></link> and | ||
699 | <link linkend='var-B'><filename>B</filename></link> variables to | ||
700 | locate unpacked recipe source code and to build it, respectively. | ||
701 | When your recipe inherits the <filename>externalsrc</filename> class, | ||
702 | you use the | ||
703 | <link linkend='var-EXTERNALSRC'><filename>EXTERNALSRC</filename></link> | ||
704 | and | ||
705 | <link linkend='var-EXTERNALSRC_BUILD'><filename>EXTERNALSRC_BUILD</filename></link> | ||
706 | variables to ultimately define <filename>S</filename> and | ||
707 | <filename>B</filename>. | ||
708 | </para> | ||
709 | |||
710 | <para> | ||
711 | By default, this class expects the source code to support recipe builds | ||
712 | that use the <link linkend='var-B'><filename>B</filename></link> | ||
713 | variable to point to the directory in which the OpenEmbedded build | ||
714 | system places the generated objects built from the recipes. | ||
715 | By default, the <filename>B</filename> directory is set to the | ||
716 | following, which is separate from the source directory | ||
717 | (<filename>S</filename>): | ||
718 | <literallayout class='monospaced'> | ||
719 | ${WORKDIR}/${BPN}/{PV}/ | ||
720 | </literallayout> | ||
721 | See these variables for more information: | ||
722 | <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>, | ||
723 | <link linkend='var-BPN'><filename>BPN</filename></link>, and | ||
724 | <link linkend='var-PV'><filename>PV</filename></link>, | ||
725 | </para> | ||
726 | |||
727 | <para> | ||
728 | For more information on the | ||
729 | <filename>externalsrc</filename> class, see the comments in | ||
730 | <filename>meta/classes/externalsrc.bbclass</filename> in the | ||
731 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
732 | For information on how to use the <filename>externalsrc</filename> | ||
733 | class, see the | ||
734 | "<ulink url='&YOCTO_DOCS_DEV_URL;#building-software-from-an-external-source'>Building Software from an External Source</ulink>" | ||
735 | section in the Yocto Project Development Manual. | ||
736 | </para> | ||
737 | </section> | ||
738 | |||
739 | <section id='ref-classes-extrausers'> | ||
740 | <title><filename>extrausers.bbclass</filename></title> | ||
741 | |||
742 | <para> | ||
743 | The <filename>extrausers</filename> class allows | ||
744 | additional user and group configuration to be applied at the image | ||
745 | level. | ||
746 | Inheriting this class either globally or from an image recipe allows | ||
747 | additional user and group operations to be performed using the | ||
748 | <link linkend='var-EXTRA_USERS_PARAMS'><filename>EXTRA_USERS_PARAMS</filename></link> | ||
749 | variable. | ||
750 | <note> | ||
751 | The user and group operations added using the | ||
752 | <filename>extrausers</filename> class are not tied to a specific | ||
753 | recipe outside of the recipe for the image. | ||
754 | Thus, the operations can be performed across the image as a whole. | ||
755 | Use the | ||
756 | <link linkend='ref-classes-useradd'><filename>useradd</filename></link> | ||
757 | class to add user and group configuration to a specific recipe. | ||
758 | </note> | ||
759 | Here is an example that uses this class in an image recipe: | ||
760 | <literallayout class='monospaced'> | ||
761 | inherit extrausers | ||
762 | EXTRA_USERS_PARAMS = "\ | ||
763 | useradd -p '' tester; \ | ||
764 | groupadd developers; \ | ||
765 | userdel nobody; \ | ||
766 | groupdel -g video; \ | ||
767 | groupmod -g 1020 developers; \ | ||
768 | usermod -s /bin/sh tester; \ | ||
769 | " | ||
770 | </literallayout> | ||
771 | Here is an example that adds two users named "tester-jim" and | ||
772 | "tester-sue" and assigns passwords: | ||
773 | <literallayout class='monospaced'> | ||
774 | inherit extrausers | ||
775 | EXTRA_USERS_PARAMS = "\ | ||
776 | useradd -P tester01 tester-jim; \ | ||
777 | useradd -P tester01 tester-sue; \ | ||
778 | " | ||
779 | </literallayout> | ||
780 | Finally, here is an example that sets the root password to | ||
781 | "1876*18": | ||
782 | <literallayout class='monospaced'> | ||
783 | inherit extrausers | ||
784 | EXTRA_USERS_PARAMS = "\ | ||
785 | useradd -P 1876*18 root; \ | ||
786 | " | ||
787 | </literallayout> | ||
788 | </para> | ||
789 | </section> | ||
790 | |||
791 | <section id='ref-classes-fontcache'> | ||
792 | <title><filename>fontcache.bbclass</filename></title> | ||
793 | |||
794 | <para> | ||
795 | The <filename>fontcache</filename> class generates the | ||
796 | proper post-install and post-remove (postinst and postrm) | ||
797 | scriptlets for font packages. | ||
798 | These scriptlets call <filename>fc-cache</filename> (part of | ||
799 | <filename>Fontconfig</filename>) to add the fonts to the font | ||
800 | information cache. | ||
801 | Since the cache files are architecture-specific, | ||
802 | <filename>fc-cache</filename> runs using QEMU if the postinst | ||
803 | scriptlets need to be run on the build host during image creation. | ||
804 | </para> | ||
805 | |||
806 | <para> | ||
807 | If the fonts being installed are in packages other than the main | ||
808 | package, set | ||
809 | <link linkend='var-FONT_PACKAGES'><filename>FONT_PACKAGES</filename></link> | ||
810 | to specify the packages containing the fonts. | ||
811 | </para> | ||
812 | </section> | ||
813 | |||
814 | <section id='ref-classes-gconf'> | ||
815 | <title><filename>gconf.bbclass</filename></title> | ||
816 | |||
817 | <para> | ||
818 | The <filename>gconf</filename> class provides common | ||
819 | functionality for recipes that need to install GConf schemas. | ||
820 | The schemas will be put into a separate package | ||
821 | (<filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}-gconf</filename>) | ||
822 | that is created automatically when this class is inherited. | ||
823 | This package uses the appropriate post-install and post-remove | ||
824 | (postinst/postrm) scriptlets to register and unregister the schemas | ||
825 | in the target image. | ||
826 | </para> | ||
827 | </section> | ||
828 | |||
829 | <section id='ref-classes-gettext'> | ||
830 | <title><filename>gettext.bbclass</filename></title> | ||
831 | |||
832 | <para> | ||
833 | The <filename>gettext</filename> class provides support for | ||
834 | building software that uses the GNU <filename>gettext</filename> | ||
835 | internationalization and localization system. | ||
836 | All recipes building software that use | ||
837 | <filename>gettext</filename> should inherit this class. | ||
838 | </para> | ||
839 | </section> | ||
840 | |||
841 | <section id='ref-classes-gnome'> | ||
842 | <title><filename>gnome.bbclass</filename></title> | ||
843 | |||
844 | <para> | ||
845 | The <filename>gnome</filename> class supports recipes that | ||
846 | build software from the GNOME stack. | ||
847 | This class inherits the | ||
848 | <link linkend='ref-classes-gnomebase'><filename>gnomebase</filename></link>, | ||
849 | <link linkend='ref-classes-gtk-icon-cache'><filename>gtk-icon-cache</filename></link>, | ||
850 | <link linkend='ref-classes-gconf'><filename>gconf</filename></link> and | ||
851 | <link linkend='ref-classes-mime'><filename>mime</filename></link> classes. | ||
852 | The class also disables GObject introspection where applicable. | ||
853 | </para> | ||
854 | </section> | ||
855 | |||
856 | <section id='ref-classes-gnomebase'> | ||
857 | <title><filename>gnomebase.bbclass</filename></title> | ||
858 | |||
859 | <para> | ||
860 | The <filename>gnomebase</filename> class is the base | ||
861 | class for recipes that build software from the GNOME stack. | ||
862 | This class sets | ||
863 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> to | ||
864 | download the source from the GNOME mirrors as well as extending | ||
865 | <link linkend='var-FILES'><filename>FILES</filename></link> | ||
866 | with the typical GNOME installation paths. | ||
867 | </para> | ||
868 | </section> | ||
869 | |||
870 | <section id='ref-classes-grub-efi'> | ||
871 | <title><filename>grub-efi.bbclass</filename></title> | ||
872 | |||
873 | <para> | ||
874 | The <filename>grub-efi</filename> | ||
875 | class provides <filename>grub-efi</filename>-specific functions for | ||
876 | building bootable images. | ||
877 | </para> | ||
878 | |||
879 | <para> | ||
880 | This class supports several variables: | ||
881 | <itemizedlist> | ||
882 | <listitem><para> | ||
883 | <link linkend='var-INITRD'><filename>INITRD</filename></link>: | ||
884 | Indicates a filesystem image to use as an initrd (optional). | ||
885 | </para></listitem> | ||
886 | <listitem><para> | ||
887 | <link linkend='var-ROOTFS'><filename>ROOTFS</filename></link>: | ||
888 | Indicates a filesystem image to include as the root filesystem | ||
889 | (optional).</para></listitem> | ||
890 | <listitem><para> | ||
891 | <link linkend='var-GRUB_GFXSERIAL'><filename>GRUB_GFXSERIAL</filename></link>: | ||
892 | Set this to "1" to have graphics and serial in the boot menu. | ||
893 | </para></listitem> | ||
894 | <listitem><para> | ||
895 | <link linkend='var-LABELS'><filename>LABELS</filename></link>: | ||
896 | A list of targets for the automatic configuration. | ||
897 | </para></listitem> | ||
898 | <listitem><para> | ||
899 | <link linkend='var-APPEND'><filename>APPEND</filename></link>: | ||
900 | An override list of append strings for each | ||
901 | <filename>LABEL</filename>. | ||
902 | </para></listitem> | ||
903 | <listitem><para> | ||
904 | <link linkend='var-GRUB_OPTS'><filename>GRUB_OPTS</filename></link>: | ||
905 | Additional options to add to the configuration (optional). | ||
906 | Options are delimited using semi-colon characters | ||
907 | (<filename>;</filename>).</para></listitem> | ||
908 | <listitem><para> | ||
909 | <link linkend='var-GRUB_TIMEOUT'><filename>GRUB_TIMEOUT</filename></link>: | ||
910 | Timeout before executing the default <filename>LABEL</filename> | ||
911 | (optional). | ||
912 | </para></listitem> | ||
913 | </itemizedlist> | ||
914 | </para> | ||
915 | </section> | ||
916 | |||
917 | <section id='ref-classes-gsettings'> | ||
918 | <title><filename>gsettings.bbclass</filename></title> | ||
919 | |||
920 | <para> | ||
921 | The <filename>gsettings</filename> class | ||
922 | provides common functionality for recipes that need to install | ||
923 | GSettings (glib) schemas. | ||
924 | The schemas are assumed to be part of the main package. | ||
925 | Appropriate post-install and post-remove (postinst/postrm) | ||
926 | scriptlets are added to register and unregister the schemas in the | ||
927 | target image. | ||
928 | </para> | ||
929 | </section> | ||
930 | |||
931 | <section id='ref-classes-gtk-doc'> | ||
932 | <title><filename>gtk-doc.bbclass</filename></title> | ||
933 | |||
934 | <para> | ||
935 | The <filename>gtk-doc</filename> class | ||
936 | is a helper class to pull in the appropriate | ||
937 | <filename>gtk-doc</filename> dependencies and disable | ||
938 | <filename>gtk-doc</filename>. | ||
939 | </para> | ||
940 | </section> | ||
941 | |||
942 | <section id='ref-classes-gtk-icon-cache'> | ||
943 | <title><filename>gtk-icon-cache.bbclass</filename></title> | ||
944 | |||
945 | <para> | ||
946 | The <filename>gtk-icon-cache</filename> class | ||
947 | generates the proper post-install and post-remove (postinst/postrm) | ||
948 | scriptlets for packages that use GTK+ and install icons. | ||
949 | These scriptlets call <filename>gtk-update-icon-cache</filename> to add | ||
950 | the fonts to GTK+'s icon cache. | ||
951 | Since the cache files are architecture-specific, | ||
952 | <filename>gtk-update-icon-cache</filename> is run using QEMU if the | ||
953 | postinst scriptlets need to be run on the build host during image | ||
954 | creation. | ||
955 | </para> | ||
956 | </section> | ||
957 | |||
958 | <section id='ref-classes-gtk-immodules-cache'> | ||
959 | <title><filename>gtk-immodules-cache.bbclass</filename></title> | ||
960 | |||
961 | <para> | ||
962 | The <filename>gtk-immodules-cache</filename> class | ||
963 | generates the proper post-install and post-remove (postinst/postrm) | ||
964 | scriptlets for packages that install GTK+ input method modules for | ||
965 | virtual keyboards. | ||
966 | These scriptlets call <filename>gtk-update-icon-cache</filename> to add | ||
967 | the input method modules to the cache. | ||
968 | Since the cache files are architecture-specific, | ||
969 | <filename>gtk-update-icon-cache</filename> is run using QEMU if the | ||
970 | postinst scriptlets need to be run on the build host during image | ||
971 | creation. | ||
972 | </para> | ||
973 | |||
974 | <para> | ||
975 | If the input method modules being installed are in packages other than | ||
976 | the main package, set | ||
977 | <link linkend='var-GTKIMMODULES_PACKAGES'><filename>GTKIMMODULES_PACKAGES</filename></link> | ||
978 | to specify the packages containing the modules. | ||
979 | </para> | ||
980 | </section> | ||
981 | |||
982 | <section id='ref-classes-gzipnative'> | ||
983 | <title><filename>gzipnative.bbclass</filename></title> | ||
984 | |||
985 | <para> | ||
986 | The <filename>gzipnative</filename> | ||
987 | class enables the use of native versions of <filename>gzip</filename> | ||
988 | and <filename>pigz</filename> rather than the versions of these tools | ||
989 | from the build host. | ||
990 | </para> | ||
991 | </section> | ||
992 | |||
993 | <section id='ref-classes-icecc'> | ||
994 | <title><filename>icecc.bbclass</filename></title> | ||
995 | |||
996 | <para> | ||
997 | The <filename>icecc</filename> class supports | ||
998 | <ulink url='https://github.com/icecc/icecream'>Icecream</ulink>, which | ||
999 | facilitates taking compile jobs and distributing them among remote | ||
1000 | machines. | ||
1001 | </para> | ||
1002 | |||
1003 | <para> | ||
1004 | The class stages directories with symlinks from <filename>gcc</filename> | ||
1005 | and <filename>g++</filename> to <filename>icecc</filename>, for both | ||
1006 | native and cross compilers. | ||
1007 | Depending on each configure or compile, the OpenEmbedded build system | ||
1008 | adds the directories at the head of the <filename>PATH</filename> list | ||
1009 | and then sets the <filename>ICECC_CXX</filename> and | ||
1010 | <filename>ICEC_CC</filename> variables, which are the paths to the | ||
1011 | <filename>g++</filename> and <filename>gcc</filename> compilers, | ||
1012 | respectively. | ||
1013 | </para> | ||
1014 | |||
1015 | <para> | ||
1016 | For the cross compiler, the class creates a <filename>tar.gz</filename> | ||
1017 | file that contains the Yocto Project toolchain and sets | ||
1018 | <filename>ICECC_VERSION</filename>, which is the version of the | ||
1019 | cross-compiler used in the cross-development toolchain, accordingly. | ||
1020 | </para> | ||
1021 | |||
1022 | <para> | ||
1023 | The class handles all three different compile stages | ||
1024 | (i.e native ,cross-kernel and target) and creates the necessary | ||
1025 | environment <filename>tar.gz</filename> file to be used by the remote | ||
1026 | machines. | ||
1027 | The class also supports SDK generation. | ||
1028 | </para> | ||
1029 | |||
1030 | <para> | ||
1031 | If <link linkend='var-ICECC_PATH'><filename>ICECC_PATH</filename></link> | ||
1032 | is not set in your <filename>local.conf</filename> file, then the | ||
1033 | class tries to locate the <filename>icecc</filename> binary | ||
1034 | using <filename>which</filename>. | ||
1035 | |||
1036 | If | ||
1037 | <link linkend='var-ICECC_ENV_EXEC'><filename>ICECC_ENV_EXEC</filename></link> | ||
1038 | is set in your <filename>local.conf</filename> file, the variable should | ||
1039 | point to the <filename>icecc-create-env</filename> script | ||
1040 | provided by the user. | ||
1041 | If you do not point to a user-provided script, the build system | ||
1042 | uses the default script provided by the recipe | ||
1043 | <filename>icecc-create-env-native.bb</filename>. | ||
1044 | <note> | ||
1045 | This script is a modified version and not the one that comes with | ||
1046 | <filename>icecc</filename>. | ||
1047 | </note> | ||
1048 | </para> | ||
1049 | |||
1050 | <para> | ||
1051 | If you do not want the Icecream distributed compile support to apply | ||
1052 | to specific recipes or classes, you can effectively "blacklist" them | ||
1053 | by listing the recipes and classes using the | ||
1054 | <link linkend='var-ICECC_USER_PACKAGE_BL'><filename>ICECC_USER_PACKAGE_BL</filename></link> | ||
1055 | and | ||
1056 | <link linkend='var-ICECC_USER_CLASS_BL'><filename>ICECC_USER_CLASS_BL</filename></link>, | ||
1057 | variables, respectively, in your <filename>local.conf</filename> file. | ||
1058 | Doing so causes the OpenEmbedded build system to handle these | ||
1059 | compilations locally. | ||
1060 | </para> | ||
1061 | |||
1062 | <para> | ||
1063 | Additionally, you can list recipes using the | ||
1064 | <link linkend='var-ICECC_USER_PACKAGE_WL'><filename>ICECC_USER_PACKAGE_WL</filename></link> | ||
1065 | variable in your <filename>local.conf</filename> file to force | ||
1066 | <filename>icecc</filename> to be enabled for recipes using an empty | ||
1067 | <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link> | ||
1068 | variable. | ||
1069 | </para> | ||
1070 | |||
1071 | <para> | ||
1072 | Inheriting the <filename>icecc</filename> class changes all sstate | ||
1073 | signatures. | ||
1074 | Consequently, if a development team has a dedicated build system | ||
1075 | that populates | ||
1076 | <link linkend='var-SSTATE_MIRRORS'><filename>STATE_MIRRORS</filename></link> | ||
1077 | and they want to reuse sstate from | ||
1078 | <filename>STATE_MIRRORS</filename>, then all developers and the | ||
1079 | build system need to either inherit the <filename>icecc</filename> | ||
1080 | class or nobody should. | ||
1081 | </para> | ||
1082 | |||
1083 | <para> | ||
1084 | At the distribution level, you can inherit the | ||
1085 | <filename>icecc</filename> class to be sure that all builders start | ||
1086 | with the same sstate signatures. | ||
1087 | After inheriting the class, you can then disable the feature by setting | ||
1088 | the | ||
1089 | <link linkend='var-ICECC_DISABLED'><filename>ICECC_DISABLED</filename></link> | ||
1090 | variable to "1" as follows: | ||
1091 | <literallayout class='monospaced'> | ||
1092 | INHERIT_DISTRO += "icecc" | ||
1093 | ICECC_DISABLED ??= "1" | ||
1094 | </literallayout> | ||
1095 | This practice makes sure everyone is using the same signatures but also | ||
1096 | requires individuals that do want to use Icecream to enable the feature | ||
1097 | individually as follows in your <filename>local.conf</filename> file: | ||
1098 | <literallayout class='monospaced'> | ||
1099 | ICECC_DISABLED = "" | ||
1100 | </literallayout> | ||
1101 | </para> | ||
1102 | </section> | ||
1103 | |||
1104 | <section id='ref-classes-image'> | ||
1105 | <title><filename>image.bbclass</filename></title> | ||
1106 | |||
1107 | <para> | ||
1108 | The <filename>image</filename> class helps support creating images | ||
1109 | in different formats. | ||
1110 | First, the root filesystem is created from packages using | ||
1111 | one of the <filename>rootfs*.bbclass</filename> | ||
1112 | files (depending on the package format used) and then one or more image | ||
1113 | files are created. | ||
1114 | <itemizedlist> | ||
1115 | <listitem><para>The | ||
1116 | <filename><link linkend='var-IMAGE_FSTYPES'>IMAGE_FSTYPES</link></filename> | ||
1117 | variable controls the types of images to generate. | ||
1118 | </para></listitem> | ||
1119 | <listitem><para>The | ||
1120 | <filename><link linkend='var-IMAGE_INSTALL'>IMAGE_INSTALL</link></filename> | ||
1121 | variable controls the list of packages to install into the | ||
1122 | image.</para></listitem> | ||
1123 | </itemizedlist> | ||
1124 | For information on customizing images, see the | ||
1125 | "<ulink url='&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage'>Customizing Images</ulink>" | ||
1126 | section in the Yocto Project Development Manual. | ||
1127 | For information on how images are created, see the | ||
1128 | "<link linkend='images-dev-environment'>Images</link>" section elsewhere | ||
1129 | in this manual. | ||
1130 | </para> | ||
1131 | </section> | ||
1132 | |||
1133 | <section id='ref-classes-image_types'> | ||
1134 | <title><filename>image_types.bbclass</filename></title> | ||
1135 | |||
1136 | <para> | ||
1137 | The <filename>image_types</filename> class defines all of | ||
1138 | the standard image output types that you can enable through the | ||
1139 | <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link> | ||
1140 | variable. | ||
1141 | You can use this class as a reference on how to add support for custom | ||
1142 | image output types. | ||
1143 | </para> | ||
1144 | |||
1145 | <para> | ||
1146 | By default, this class is enabled through the | ||
1147 | <link linkend='var-IMAGE_CLASSES'><filename>IMAGE_CLASSES</filename></link> | ||
1148 | variable in | ||
1149 | <link linkend='ref-classes-image'><filename>image.bbclass</filename></link>. | ||
1150 | If you define your own image types using a custom BitBake class and | ||
1151 | then use <filename>IMAGE_CLASSES</filename> to enable it, the custom | ||
1152 | class must either inherit <filename>image_types</filename> or | ||
1153 | <filename>image_types</filename> must also appear in | ||
1154 | <filename>IMAGE_CLASSES</filename>. | ||
1155 | </para> | ||
1156 | </section> | ||
1157 | |||
1158 | <section id='ref-classes-image_types_uboot'> | ||
1159 | <title><filename>image_types_uboot.bbclass</filename></title> | ||
1160 | |||
1161 | <para> | ||
1162 | The <filename>image_types_uboot</filename> class | ||
1163 | defines additional image types specifically for the U-Boot bootloader. | ||
1164 | </para> | ||
1165 | </section> | ||
1166 | |||
1167 | <section id='ref-classes-image-live'> | ||
1168 | <title><filename>image-live.bbclass</filename></title> | ||
1169 | |||
1170 | <para> | ||
1171 | The <filename>image-live</filename> class supports building "live" | ||
1172 | images. | ||
1173 | </para> | ||
1174 | |||
1175 | <para> | ||
1176 | Normally, you do not use this class directly. | ||
1177 | Instead, you add "live" to | ||
1178 | <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>. | ||
1179 | For example, if you were building an ISO image, you would add "live" | ||
1180 | to <filename>IMAGE_FSTYPES</filename>, set the | ||
1181 | <link linkend='var-NOISO'><filename>NOISO</filename></link> variable to | ||
1182 | "0" and the build system would use the <filename>image-live</filename> | ||
1183 | class to build the ISO image. | ||
1184 | </para> | ||
1185 | </section> | ||
1186 | |||
1187 | <section id='ref-classes-image-mklibs'> | ||
1188 | <title><filename>image-mklibs.bbclass</filename></title> | ||
1189 | |||
1190 | <para> | ||
1191 | The <filename>image-mklibs</filename> class | ||
1192 | enables the use of the <filename>mklibs</filename> utility during the | ||
1193 | <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link> | ||
1194 | task, which optimizes the size of | ||
1195 | libraries contained in the image. | ||
1196 | </para> | ||
1197 | |||
1198 | <para> | ||
1199 | By default, the class is enabled in the | ||
1200 | <filename>local.conf.template</filename> using the | ||
1201 | <link linkend='var-USER_CLASSES'><filename>USER_CLASSES</filename></link> | ||
1202 | variable as follows: | ||
1203 | <literallayout class='monospaced'> | ||
1204 | USER_CLASSES ?= "buildstats image-mklibs image-prelink" | ||
1205 | </literallayout> | ||
1206 | </para> | ||
1207 | </section> | ||
1208 | |||
1209 | <section id='ref-classes-image-prelink'> | ||
1210 | <title><filename>image-prelink.bbclass</filename></title> | ||
1211 | |||
1212 | <para> | ||
1213 | The <filename>image-prelink</filename> class | ||
1214 | enables the use of the <filename>prelink</filename> utility during | ||
1215 | the | ||
1216 | <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link> | ||
1217 | task, which optimizes the dynamic | ||
1218 | linking of shared libraries to reduce executable startup time. | ||
1219 | </para> | ||
1220 | |||
1221 | <para> | ||
1222 | By default, the class is enabled in the | ||
1223 | <filename>local.conf.template</filename> using the | ||
1224 | <link linkend='var-USER_CLASSES'><filename>USER_CLASSES</filename></link> | ||
1225 | variable as follows: | ||
1226 | <literallayout class='monospaced'> | ||
1227 | USER_CLASSES ?= "buildstats image-mklibs image-prelink" | ||
1228 | </literallayout> | ||
1229 | </para> | ||
1230 | </section> | ||
1231 | |||
1232 | <section id='ref-classes-image-swab'> | ||
1233 | <title><filename>image-swab.bbclass</filename></title> | ||
1234 | |||
1235 | <para> | ||
1236 | The <filename>image-swab</filename> class enables the | ||
1237 | <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/swabber'>Swabber</ulink> | ||
1238 | tool in order to detect and log accesses to the host system during | ||
1239 | the OpenEmbedded build process. | ||
1240 | <note> | ||
1241 | This class is currently unmaintained. | ||
1242 | </note> | ||
1243 | </para> | ||
1244 | </section> | ||
1245 | |||
1246 | <section id='ref-classes-image-vmdk'> | ||
1247 | <title><filename>image-vmdk.bbclass</filename></title> | ||
1248 | |||
1249 | <para> | ||
1250 | The <filename>image-vmdk</filename> class supports building VMware | ||
1251 | VMDK images. | ||
1252 | Normally, you do not use this class directly. | ||
1253 | Instead, you add "vmdk" to | ||
1254 | <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>. | ||
1255 | </para> | ||
1256 | </section> | ||
1257 | |||
1258 | <section id='ref-classes-insane'> | ||
1259 | <title><filename>insane.bbclass</filename></title> | ||
1260 | |||
1261 | <para> | ||
1262 | The <filename>insane</filename> class adds a step to the package | ||
1263 | generation process so that output quality assurance checks are | ||
1264 | generated by the OpenEmbedded build system. | ||
1265 | A range of checks are performed that check the build's output | ||
1266 | for common problems that show up during runtime. | ||
1267 | Distribution policy usually dictates whether to include this class. | ||
1268 | </para> | ||
1269 | |||
1270 | <para> | ||
1271 | You can configure the sanity checks so that specific test failures | ||
1272 | either raise a warning or an error message. | ||
1273 | Typically, failures for new tests generate a warning. | ||
1274 | Subsequent failures for the same test would then generate an error | ||
1275 | message once the metadata is in a known and good condition. | ||
1276 | See the | ||
1277 | "<link linkend='ref-qa-checks'>QA Error and Warning Messages</link>" | ||
1278 | Chapter for a list of all the warning and error messages | ||
1279 | you might encounter using a default configuration. | ||
1280 | </para> | ||
1281 | |||
1282 | <para> | ||
1283 | Use the | ||
1284 | <link linkend='var-WARN_QA'><filename>WARN_QA</filename></link> and | ||
1285 | <link linkend='var-ERROR_QA'><filename>ERROR_QA</filename></link> | ||
1286 | variables to control the behavior of | ||
1287 | these checks at the global level (i.e. in your custom distro | ||
1288 | configuration). | ||
1289 | However, to skip one or more checks in recipes, you should use | ||
1290 | <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link>. | ||
1291 | For example, to skip the check for symbolic link | ||
1292 | <filename>.so</filename> files in the main package of a recipe, | ||
1293 | add the following to the recipe. | ||
1294 | You need to realize that the package name override, in this example | ||
1295 | <filename>${PN}</filename>, must be used: | ||
1296 | <literallayout class='monospaced'> | ||
1297 | INSANE_SKIP_${PN} += "dev-so" | ||
1298 | </literallayout> | ||
1299 | Please keep in mind that the QA checks exist in order to detect real | ||
1300 | or potential problems in the packaged output. | ||
1301 | So exercise caution when disabling these checks. | ||
1302 | </para> | ||
1303 | |||
1304 | <para> | ||
1305 | The following list shows the tests you can list with the | ||
1306 | <filename>WARN_QA</filename> and <filename>ERROR_QA</filename> | ||
1307 | variables: | ||
1308 | <itemizedlist> | ||
1309 | <listitem><para><emphasis><filename>already-stripped:</filename></emphasis> | ||
1310 | Checks that produced binaries have not already been | ||
1311 | stripped prior to the build system extracting debug symbols. | ||
1312 | It is common for upstream software projects to default to | ||
1313 | stripping debug symbols for output binaries. | ||
1314 | In order for debugging to work on the target using | ||
1315 | <filename>-dbg</filename> packages, this stripping must be | ||
1316 | disabled. | ||
1317 | </para></listitem> | ||
1318 | <listitem><para><emphasis><filename>arch:</filename></emphasis> | ||
1319 | Checks the Executable and Linkable Format (ELF) type, bit size, | ||
1320 | and endianness of any binaries to ensure they match the target | ||
1321 | architecture. | ||
1322 | This test fails if any binaries do not match the type since | ||
1323 | there would be an incompatibility. | ||
1324 | The test could indicate that the | ||
1325 | wrong compiler or compiler options have been used. | ||
1326 | Sometimes software, like bootloaders, might need to bypass | ||
1327 | this check. | ||
1328 | </para></listitem> | ||
1329 | <listitem><para><emphasis><filename>buildpaths:</filename></emphasis> | ||
1330 | Checks for paths to locations on the build host inside the | ||
1331 | output files. | ||
1332 | Currently, this test triggers too many false positives and | ||
1333 | thus is not normally enabled. | ||
1334 | </para></listitem> | ||
1335 | <listitem><para><emphasis><filename>compile-host-path:</filename></emphasis> | ||
1336 | Checks the | ||
1337 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link> | ||
1338 | log for indications | ||
1339 | that paths to locations on the build host were used. | ||
1340 | Using such paths might result in host contamination of the | ||
1341 | build output. | ||
1342 | </para></listitem> | ||
1343 | <listitem><para><emphasis><filename>debug-deps:</filename></emphasis> | ||
1344 | Checks that all packages except <filename>-dbg</filename> | ||
1345 | packages do not depend on <filename>-dbg</filename> | ||
1346 | packages, which would cause a packaging bug. | ||
1347 | </para></listitem> | ||
1348 | <listitem><para><emphasis><filename>debug-files:</filename></emphasis> | ||
1349 | Checks for <filename>.debug</filename> directories in anything but the | ||
1350 | <filename>-dbg</filename> package. | ||
1351 | The debug files should all be in the <filename>-dbg</filename> package. | ||
1352 | Thus, anything packaged elsewhere is incorrect packaging.</para></listitem> | ||
1353 | <listitem><para><emphasis><filename>dep-cmp:</filename></emphasis> | ||
1354 | Checks for invalid version comparison statements in runtime | ||
1355 | dependency relationships between packages (i.e. in | ||
1356 | <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>, | ||
1357 | <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>, | ||
1358 | <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>, | ||
1359 | <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>, | ||
1360 | <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>, | ||
1361 | and | ||
1362 | <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link> | ||
1363 | variable values). | ||
1364 | Any invalid comparisons might trigger failures or undesirable | ||
1365 | behavior when passed to the package manager. | ||
1366 | </para></listitem> | ||
1367 | <listitem><para><emphasis><filename>desktop:</filename></emphasis> | ||
1368 | Runs the <filename>desktop-file-validate</filename> program | ||
1369 | against any <filename>.desktop</filename> files to validate | ||
1370 | their contents against the specification for | ||
1371 | <filename>.desktop</filename> files.</para></listitem> | ||
1372 | <listitem><para><emphasis><filename>dev-deps:</filename></emphasis> | ||
1373 | Checks that all packages except <filename>-dev</filename> | ||
1374 | or <filename>-staticdev</filename> packages do not depend on | ||
1375 | <filename>-dev</filename> packages, which would be a | ||
1376 | packaging bug.</para></listitem> | ||
1377 | <listitem><para><emphasis><filename>dev-so:</filename></emphasis> | ||
1378 | Checks that the <filename>.so</filename> symbolic links are in the | ||
1379 | <filename>-dev</filename> package and not in any of the other packages. | ||
1380 | In general, these symlinks are only useful for development purposes. | ||
1381 | Thus, the <filename>-dev</filename> package is the correct location for | ||
1382 | them. | ||
1383 | Some very rare cases do exist for dynamically loaded modules where | ||
1384 | these symlinks are needed instead in the main package. | ||
1385 | </para></listitem> | ||
1386 | <listitem><para><emphasis><filename>files-invalid:</filename></emphasis> | ||
1387 | Checks for | ||
1388 | <link linkend='var-FILES'><filename>FILES</filename></link> | ||
1389 | variable values that contain "//", which is invalid. | ||
1390 | </para></listitem> | ||
1391 | <listitem><para><emphasis><filename>incompatible-license:</filename></emphasis> | ||
1392 | Report when packages are excluded from being created due to | ||
1393 | being marked with a license that is in | ||
1394 | <link linkend='var-INCOMPATIBLE_LICENSE'><filename>INCOMPATIBLE_LICENSE</filename></link>. | ||
1395 | </para></listitem> | ||
1396 | <listitem><para><emphasis><filename>install-host-path:</filename></emphasis> | ||
1397 | Checks the | ||
1398 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
1399 | log for indications | ||
1400 | that paths to locations on the build host were used. | ||
1401 | Using such paths might result in host contamination of the | ||
1402 | build output. | ||
1403 | </para></listitem> | ||
1404 | <listitem><para><emphasis><filename>installed-vs-shipped:</filename></emphasis> | ||
1405 | Reports when files have been installed within | ||
1406 | <filename>do_install</filename> but have not been included in | ||
1407 | any package by way of the | ||
1408 | <link linkend='var-FILES'><filename>FILES</filename></link> | ||
1409 | variable. | ||
1410 | Files that do not appear in any package cannot be present in | ||
1411 | an image later on in the build process. | ||
1412 | Ideally, all installed files should be packaged or not | ||
1413 | installed at all. | ||
1414 | These files can be deleted at the end of | ||
1415 | <filename>do_install</filename> if the files are not | ||
1416 | needed in any package. | ||
1417 | </para></listitem> | ||
1418 | <listitem><para><emphasis><filename>la:</filename></emphasis> | ||
1419 | Checks <filename>.la</filename> files for any <filename>TMPDIR</filename> | ||
1420 | paths. | ||
1421 | Any <filename>.la</filename> file containing these paths is incorrect since | ||
1422 | <filename>libtool</filename> adds the correct sysroot prefix when using the | ||
1423 | files automatically itself.</para></listitem> | ||
1424 | <listitem><para><emphasis><filename>ldflags:</filename></emphasis> | ||
1425 | Ensures that the binaries were linked with the | ||
1426 | <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link> | ||
1427 | options provided by the build system. | ||
1428 | If this test fails, check that the <filename>LDFLAGS</filename> variable | ||
1429 | is being passed to the linker command.</para></listitem> | ||
1430 | <listitem><para><emphasis><filename>libdir:</filename></emphasis> | ||
1431 | Checks for libraries being installed into incorrect | ||
1432 | (possibly hardcoded) installation paths. | ||
1433 | For example, this test will catch recipes that install | ||
1434 | <filename>/lib/bar.so</filename> when | ||
1435 | <filename>${base_libdir}</filename> is "lib32". | ||
1436 | Another example is when recipes install | ||
1437 | <filename>/usr/lib64/foo.so</filename> when | ||
1438 | <filename>${libdir}</filename> is "/usr/lib". | ||
1439 | </para></listitem> | ||
1440 | <listitem><para><emphasis><filename>libexec:</filename></emphasis> | ||
1441 | Checks if a package contains files in | ||
1442 | <filename>/usr/libexec</filename>. | ||
1443 | This check is not performed if the | ||
1444 | <filename>libexecdir</filename> variable has been set | ||
1445 | explicitly to <filename>/usr/libexec</filename>. | ||
1446 | </para></listitem> | ||
1447 | <listitem><para><emphasis><filename>packages-list:</filename></emphasis> | ||
1448 | Checks for the same package being listed multiple times through | ||
1449 | the <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link> | ||
1450 | variable value. | ||
1451 | Installing the package in this manner can cause errors during | ||
1452 | packaging. | ||
1453 | </para></listitem> | ||
1454 | <listitem><para><emphasis><filename>perm-config:</filename></emphasis> | ||
1455 | Reports lines in <filename>fs-perms.txt</filename> that have | ||
1456 | an invalid format. | ||
1457 | </para></listitem> | ||
1458 | <listitem><para><emphasis><filename>perm-line:</filename></emphasis> | ||
1459 | Reports lines in <filename>fs-perms.txt</filename> that have | ||
1460 | an invalid format. | ||
1461 | </para></listitem> | ||
1462 | <listitem><para><emphasis><filename>perm-link:</filename></emphasis> | ||
1463 | Reports lines in <filename>fs-perms.txt</filename> that | ||
1464 | specify 'link' where the specified target already exists. | ||
1465 | </para></listitem> | ||
1466 | <listitem><para><emphasis><filename>perms:</filename></emphasis> | ||
1467 | Currently, this check is unused but reserved. | ||
1468 | </para></listitem> | ||
1469 | <listitem><para><emphasis><filename>pkgconfig:</filename></emphasis> | ||
1470 | Checks <filename>.pc</filename> files for any | ||
1471 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>/<link linkend='var-WORKDIR'><filename>WORKDIR</filename></link> | ||
1472 | paths. | ||
1473 | Any <filename>.pc</filename> file containing these paths is incorrect | ||
1474 | since <filename>pkg-config</filename> itself adds the correct sysroot prefix | ||
1475 | when the files are accessed.</para></listitem> | ||
1476 | <listitem><para><emphasis><filename>pkgname:</filename></emphasis> | ||
1477 | Checks that all packages in | ||
1478 | <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link> | ||
1479 | have names that do not contain invalid characters (i.e. | ||
1480 | characters other than 0-9, a-z, ., +, and -). | ||
1481 | </para></listitem> | ||
1482 | <listitem><para><emphasis><filename>pkgv-undefined:</filename></emphasis> | ||
1483 | Checks to see if the <filename>PKGV</filename> variable | ||
1484 | is undefined during | ||
1485 | <link linkend='ref-tasks-package'><filename>do_package</filename></link>. | ||
1486 | </para></listitem> | ||
1487 | <listitem><para><emphasis><filename>pkgvarcheck:</filename></emphasis> | ||
1488 | Checks through the variables | ||
1489 | <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>, | ||
1490 | <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>, | ||
1491 | <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>, | ||
1492 | <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>, | ||
1493 | <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>, | ||
1494 | <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>, | ||
1495 | <link linkend='var-FILES'><filename>FILES</filename></link>, | ||
1496 | <link linkend='var-ALLOW_EMPTY'><filename>ALLOW_EMPTY</filename></link>, | ||
1497 | <filename>pkg_preinst</filename>, | ||
1498 | <filename>pkg_postinst</filename>, | ||
1499 | <filename>pkg_prerm</filename> | ||
1500 | and <filename>pkg_postrm</filename>, and reports if there are | ||
1501 | variable sets that are not package-specific. | ||
1502 | Using these variables without a package suffix is bad practice, | ||
1503 | and might unnecessarily complicate dependencies of other packages | ||
1504 | within the same recipe or have other unintended consequences. | ||
1505 | </para></listitem> | ||
1506 | <listitem><para><emphasis><filename>pn-overrides:</filename></emphasis> | ||
1507 | Checks that a recipe does not have a name | ||
1508 | (<link linkend='var-PN'><filename>PN</filename></link>) value | ||
1509 | that appears in | ||
1510 | <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>. | ||
1511 | If a recipe is named such that its <filename>PN</filename> | ||
1512 | value matches something already in | ||
1513 | <filename>OVERRIDES</filename> (e.g. <filename>PN</filename> | ||
1514 | happens to be the same as | ||
1515 | <link linkend='var-MACHINE'><filename>MACHINE</filename></link> | ||
1516 | or | ||
1517 | <link linkend='var-DISTRO'><filename>DISTRO</filename></link>), | ||
1518 | it can have unexpected consequences. | ||
1519 | For example, assignments such as | ||
1520 | <filename>FILES_${PN} = "xyz"</filename> effectively turn into | ||
1521 | <filename>FILES = "xyz"</filename>. | ||
1522 | </para></listitem> | ||
1523 | <listitem><para><emphasis><filename>rpaths:</filename></emphasis> | ||
1524 | Checks for rpaths in the binaries that contain build system paths such | ||
1525 | as <filename>TMPDIR</filename>. | ||
1526 | If this test fails, bad <filename>-rpath</filename> options are being | ||
1527 | passed to the linker commands and your binaries have potential security | ||
1528 | issues.</para></listitem> | ||
1529 | <listitem><para><emphasis><filename>split-strip:</filename></emphasis> | ||
1530 | Reports that splitting or stripping debug symbols from binaries | ||
1531 | has failed. | ||
1532 | </para></listitem> | ||
1533 | <listitem><para><emphasis><filename>staticdev:</filename></emphasis> | ||
1534 | Checks for static library files (<filename>*.a</filename>) in | ||
1535 | non-<filename>staticdev</filename> packages. | ||
1536 | </para></listitem> | ||
1537 | <listitem><para><emphasis><filename>symlink-to-sysroot:</filename></emphasis> | ||
1538 | Checks for symlinks in packages that point into | ||
1539 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link> | ||
1540 | on the host. | ||
1541 | Such symlinks will work on the host, but are clearly invalid | ||
1542 | when running on the target. | ||
1543 | </para></listitem> | ||
1544 | <listitem><para><emphasis><filename>textrel:</filename></emphasis> | ||
1545 | Checks for ELF binaries that contain relocations in their | ||
1546 | <filename>.text</filename> sections, which can result in a | ||
1547 | performance impact at runtime.</para></listitem> | ||
1548 | <listitem><para><emphasis><filename>unsafe-references-in-binaries:</filename></emphasis> | ||
1549 | Reports when a binary installed in | ||
1550 | <filename>${base_libdir}</filename>, | ||
1551 | <filename>${base_bindir}</filename>, or | ||
1552 | <filename>${base_sbindir}</filename>, depends on another | ||
1553 | binary installed under <filename>${exec_prefix}</filename>. | ||
1554 | This dependency is a concern if you want the system to remain | ||
1555 | basically operable if <filename>/usr</filename> is mounted | ||
1556 | separately and is not mounted. | ||
1557 | <note> | ||
1558 | Defaults for binaries installed in | ||
1559 | <filename>${base_libdir}</filename>, | ||
1560 | <filename>${base_bindir}</filename>, and | ||
1561 | <filename>${base_sbindir}</filename> are | ||
1562 | <filename>/lib</filename>, <filename>/bin</filename>, and | ||
1563 | <filename>/sbin</filename>, respectively. | ||
1564 | The default for a binary installed | ||
1565 | under <filename>${exec_prefix}</filename> is | ||
1566 | <filename>/usr</filename>. | ||
1567 | </note> | ||
1568 | </para></listitem> | ||
1569 | <listitem><para><emphasis><filename>unsafe-references-in-scripts:</filename></emphasis> | ||
1570 | Reports when a script file installed in | ||
1571 | <filename>${base_libdir}</filename>, | ||
1572 | <filename>${base_bindir}</filename>, or | ||
1573 | <filename>${base_sbindir}</filename>, depends on files | ||
1574 | installed under <filename>${exec_prefix}</filename>. | ||
1575 | This dependency is a concern if you want the system to remain | ||
1576 | basically operable if <filename>/usr</filename> is mounted | ||
1577 | separately and is not mounted. | ||
1578 | <note> | ||
1579 | Defaults for binaries installed in | ||
1580 | <filename>${base_libdir}</filename>, | ||
1581 | <filename>${base_bindir}</filename>, and | ||
1582 | <filename>${base_sbindir}</filename> are | ||
1583 | <filename>/lib</filename>, <filename>/bin</filename>, and | ||
1584 | <filename>/sbin</filename>, respectively. | ||
1585 | The default for a binary installed | ||
1586 | under <filename>${exec_prefix}</filename> is | ||
1587 | <filename>/usr</filename>. | ||
1588 | </note> | ||
1589 | </para></listitem> | ||
1590 | <listitem><para><emphasis><filename>useless-rpaths:</filename></emphasis> | ||
1591 | Checks for dynamic library load paths (rpaths) in the binaries that | ||
1592 | by default on a standard system are searched by the linker (e.g. | ||
1593 | <filename>/lib</filename> and <filename>/usr/lib</filename>). | ||
1594 | While these paths will not cause any breakage, they do waste space and | ||
1595 | are unnecessary.</para></listitem> | ||
1596 | <listitem><para><emphasis><filename>var-undefined:</filename></emphasis> | ||
1597 | Reports when variables fundamental to packaging (i.e. | ||
1598 | <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>, | ||
1599 | <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>, | ||
1600 | <link linkend='var-D'><filename>D</filename></link>, | ||
1601 | <link linkend='var-PN'><filename>PN</filename></link>, and | ||
1602 | <link linkend='var-PKGD'><filename>PKGD</filename></link>) are | ||
1603 | undefined during | ||
1604 | <link linkend='ref-tasks-package'><filename>do_package</filename></link>. | ||
1605 | </para></listitem> | ||
1606 | <listitem><para><emphasis><filename>version-going-backwards:</filename></emphasis> | ||
1607 | If Build History is enabled, reports when a package | ||
1608 | being written out has a lower version than the previously | ||
1609 | written package under the same name. | ||
1610 | If you are placing output packages into a feed and | ||
1611 | upgrading packages on a target system using that feed, the | ||
1612 | version of a package going backwards can result in the target | ||
1613 | system not correctly upgrading to the "new" version of the | ||
1614 | package. | ||
1615 | <note> | ||
1616 | If you are not using runtime package management on your | ||
1617 | target system, then you do not need to worry about | ||
1618 | this situation. | ||
1619 | </note> | ||
1620 | </para></listitem> | ||
1621 | <listitem><para><emphasis><filename>xorg-driver-abi:</filename></emphasis> | ||
1622 | Checks that all packages containing Xorg drivers have ABI | ||
1623 | dependencies. | ||
1624 | The <filename>xserver-xorg</filename> recipe provides driver | ||
1625 | ABI names. | ||
1626 | All drivers should depend on the ABI versions that they have | ||
1627 | been built against. | ||
1628 | Driver recipes that include | ||
1629 | <filename>xorg-driver-input.inc</filename> | ||
1630 | or <filename>xorg-driver-video.inc</filename> will | ||
1631 | automatically get these versions. | ||
1632 | Consequently, you should only need to explicitly add | ||
1633 | dependencies to binary driver recipes. | ||
1634 | </para></listitem> | ||
1635 | </itemizedlist> | ||
1636 | </para> | ||
1637 | </section> | ||
1638 | |||
1639 | <section id='ref-classes-insserv'> | ||
1640 | <title><filename>insserv.bbclass</filename></title> | ||
1641 | |||
1642 | <para> | ||
1643 | The <filename>insserv</filename> class | ||
1644 | uses the <filename>insserv</filename> utility to update the order of | ||
1645 | symbolic links in <filename>/etc/rc?.d/</filename> within an image | ||
1646 | based on dependencies specified by LSB headers in the | ||
1647 | <filename>init.d</filename> scripts themselves. | ||
1648 | </para> | ||
1649 | </section> | ||
1650 | |||
1651 | <section id='ref-classes-kernel'> | ||
1652 | <title><filename>kernel.bbclass</filename></title> | ||
1653 | |||
1654 | <para> | ||
1655 | The <filename>kernel</filename> class handles building Linux kernels. | ||
1656 | The class contains code to build all kernel trees. | ||
1657 | All needed headers are staged into the | ||
1658 | <filename><link linkend='var-STAGING_KERNEL_DIR'>STAGING_KERNEL_DIR</link></filename> | ||
1659 | directory to allow out-of-tree module builds using | ||
1660 | the | ||
1661 | <link linkend='ref-classes-module'><filename>module</filename></link> | ||
1662 | class. | ||
1663 | </para> | ||
1664 | |||
1665 | <para> | ||
1666 | This means that each built kernel module is packaged separately and inter-module | ||
1667 | dependencies are created by parsing the <filename>modinfo</filename> output. | ||
1668 | If all modules are required, then installing the <filename>kernel-modules</filename> | ||
1669 | package installs all packages with modules and various other kernel packages | ||
1670 | such as <filename>kernel-vmlinux</filename>. | ||
1671 | </para> | ||
1672 | |||
1673 | <para> | ||
1674 | Various other classes are used by the <filename>kernel</filename> | ||
1675 | and <filename>module</filename> classes internally including the | ||
1676 | <link linkend='ref-classes-kernel-arch'><filename>kernel-arch</filename></link>, | ||
1677 | <link linkend='ref-classes-module-base'><filename>module-base</filename></link>, | ||
1678 | and | ||
1679 | <link linkend='ref-classes-linux-kernel-base'><filename>linux-kernel-base</filename></link> | ||
1680 | classes. | ||
1681 | </para> | ||
1682 | </section> | ||
1683 | |||
1684 | <section id='ref-classes-kernel-arch'> | ||
1685 | <title><filename>kernel-arch.bbclass</filename></title> | ||
1686 | |||
1687 | <para> | ||
1688 | The <filename>kernel-arch</filename> class | ||
1689 | sets the <filename>ARCH</filename> environment variable for Linux | ||
1690 | kernel compilation (including modules). | ||
1691 | </para> | ||
1692 | </section> | ||
1693 | |||
1694 | <section id='ref-classes-kernel-module-split'> | ||
1695 | <title><filename>kernel-module-split.bbclass</filename></title> | ||
1696 | |||
1697 | <para> | ||
1698 | The <filename>kernel-module-split</filename> class | ||
1699 | provides common functionality for splitting Linux kernel modules into | ||
1700 | separate packages. | ||
1701 | </para> | ||
1702 | </section> | ||
1703 | |||
1704 | <section id='ref-classes-kernel-yocto'> | ||
1705 | <title><filename>kernel-yocto.bbclass</filename></title> | ||
1706 | |||
1707 | <para> | ||
1708 | The <filename>kernel-yocto</filename> class | ||
1709 | provides common functionality for building from linux-yocto style | ||
1710 | kernel source repositories. | ||
1711 | </para> | ||
1712 | </section> | ||
1713 | |||
1714 | <section id='ref-classes-lib_package'> | ||
1715 | <title><filename>lib_package.bbclass</filename></title> | ||
1716 | |||
1717 | <para> | ||
1718 | The <filename>lib_package</filename> class | ||
1719 | supports recipes that build libraries and produce executable | ||
1720 | binaries, where those binaries should not be installed by default | ||
1721 | along with the library. | ||
1722 | Instead, the binaries are added to a separate | ||
1723 | <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}-bin</filename> | ||
1724 | package to make their installation optional. | ||
1725 | </para> | ||
1726 | </section> | ||
1727 | |||
1728 | <section id='ref-classes-license'> | ||
1729 | <title><filename>license.bbclass</filename></title> | ||
1730 | |||
1731 | <para> | ||
1732 | The <filename>license</filename> class provides license | ||
1733 | manifest creation and license exclusion. | ||
1734 | This class is enabled by default using the default value for the | ||
1735 | <link linkend='var-INHERIT_DISTRO'><filename>INHERIT_DISTRO</filename></link> | ||
1736 | variable. | ||
1737 | </para> | ||
1738 | </section> | ||
1739 | |||
1740 | <section id='ref-classes-linux-kernel-base'> | ||
1741 | <title><filename>linux-kernel-base.bbclass</filename></title> | ||
1742 | |||
1743 | <para> | ||
1744 | The <filename>linux-kernel-base</filename> class | ||
1745 | provides common functionality for recipes that build out of the Linux | ||
1746 | kernel source tree. | ||
1747 | These builds goes beyond the kernel itself. | ||
1748 | For example, the Perf recipe also inherits this class. | ||
1749 | </para> | ||
1750 | </section> | ||
1751 | |||
1752 | <section id='ref-classes-logging'> | ||
1753 | <title><filename>logging.bbclass</filename></title> | ||
1754 | |||
1755 | <para> | ||
1756 | The <filename>logging</filename> class provides the standard | ||
1757 | shell functions used to log messages for various BitBake severity levels | ||
1758 | (i.e. <filename>bbplain</filename>, <filename>bbnote</filename>, | ||
1759 | <filename>bbwarn</filename>, <filename>bberror</filename>, | ||
1760 | <filename>bbfatal</filename>, and <filename>bbdebug</filename>). | ||
1761 | </para> | ||
1762 | |||
1763 | <para> | ||
1764 | This class is enabled by default since it is inherited by | ||
1765 | the <filename>base</filename> class. | ||
1766 | </para> | ||
1767 | </section> | ||
1768 | |||
1769 | <section id='ref-classes-meta'> | ||
1770 | <title><filename>meta.bbclass</filename></title> | ||
1771 | |||
1772 | <para> | ||
1773 | The <filename>meta</filename> class is inherited by recipes | ||
1774 | that do not build any output packages themselves, but act as a "meta" | ||
1775 | target for building other recipes. | ||
1776 | </para> | ||
1777 | </section> | ||
1778 | |||
1779 | <section id='ref-classes-metadata_scm'> | ||
1780 | <title><filename>metadata_scm.bbclass</filename></title> | ||
1781 | |||
1782 | <para> | ||
1783 | The <filename>metadata_scm</filename> class provides functionality for | ||
1784 | querying the branch and revision of a Source Code Manager (SCM) | ||
1785 | repository. | ||
1786 | </para> | ||
1787 | |||
1788 | <para> | ||
1789 | The <link linkend='ref-classes-base'><filename>base</filename></link> | ||
1790 | class uses this class to print the revisions of each layer before | ||
1791 | starting every build. | ||
1792 | The <filename>metadata_scm</filename> class is enabled by default | ||
1793 | because it is inherited by the <filename>base</filename> class. | ||
1794 | </para> | ||
1795 | </section> | ||
1796 | |||
1797 | <section id='ref-classes-mime'> | ||
1798 | <title><filename>mime.bbclass</filename></title> | ||
1799 | |||
1800 | <para> | ||
1801 | The <filename>mime</filename> class generates the proper | ||
1802 | post-install and post-remove (postinst/postrm) scriptlets for packages | ||
1803 | that install MIME type files. | ||
1804 | These scriptlets call <filename>update-mime-database</filename> to add | ||
1805 | the MIME types to the shared database. | ||
1806 | </para> | ||
1807 | </section> | ||
1808 | |||
1809 | <section id='ref-classes-mirrors'> | ||
1810 | <title><filename>mirrors.bbclass</filename></title> | ||
1811 | |||
1812 | <para> | ||
1813 | The <filename>mirrors</filename> class sets up some standard | ||
1814 | <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link> entries | ||
1815 | for source code mirrors. | ||
1816 | These mirrors provide a fall-back path in case the upstream source | ||
1817 | specified in | ||
1818 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> | ||
1819 | within recipes is unavailable. | ||
1820 | </para> | ||
1821 | |||
1822 | <para> | ||
1823 | This class is enabled by default since it is inherited by the | ||
1824 | <link linkend='ref-classes-base'><filename>base</filename></link> class. | ||
1825 | </para> | ||
1826 | </section> | ||
1827 | |||
1828 | <section id='ref-classes-module'> | ||
1829 | <title><filename>module.bbclass</filename></title> | ||
1830 | |||
1831 | <para> | ||
1832 | The <filename>module</filename> class provides support for building | ||
1833 | out-of-tree Linux kernel modules. | ||
1834 | The class inherits the | ||
1835 | <link linkend='ref-classes-module-base'><filename>module-base</filename></link> | ||
1836 | and | ||
1837 | <link linkend='ref-classes-kernel-module-split'><filename>kernel-module-split</filename></link> | ||
1838 | classes, and implements the | ||
1839 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link> | ||
1840 | and | ||
1841 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
1842 | tasks. | ||
1843 | The class provides everything needed to build and package a kernel | ||
1844 | module. | ||
1845 | </para> | ||
1846 | |||
1847 | <para> | ||
1848 | For general information on out-of-tree Linux kernel modules, see the | ||
1849 | "<ulink url='&YOCTO_DOCS_KERNEL_URL;#incorporating-out-of-tree-modules'>Incorporating Out-of-Tree Modules</ulink>" | ||
1850 | section in the Yocto Project Linux Kernel Development Manual. | ||
1851 | </para> | ||
1852 | </section> | ||
1853 | |||
1854 | <section id='ref-classes-module-base'> | ||
1855 | <title><filename>module-base.bbclass</filename></title> | ||
1856 | |||
1857 | <para> | ||
1858 | The <filename>module-base</filename> class provides the base | ||
1859 | functionality for building Linux kernel modules. | ||
1860 | Typically, a recipe that builds software that includes one or | ||
1861 | more kernel modules and has its own means of building | ||
1862 | the module inherits this class as opposed to inheriting the | ||
1863 | <link linkend='ref-classes-module'><filename>module</filename></link> | ||
1864 | class. | ||
1865 | </para> | ||
1866 | </section> | ||
1867 | |||
1868 | <section id='ref-classes-multilib*'> | ||
1869 | <title><filename>multilib*.bbclass</filename></title> | ||
1870 | |||
1871 | <para> | ||
1872 | The <filename>multilib*</filename> classes provide support | ||
1873 | for building libraries with different target optimizations or target | ||
1874 | architectures and installing them side-by-side in the same image. | ||
1875 | </para> | ||
1876 | |||
1877 | <para> | ||
1878 | For more information on using the Multilib feature, see the | ||
1879 | "<ulink url='&YOCTO_DOCS_DEV_URL;#combining-multiple-versions-library-files-into-one-image'>Combining Multiple Versions of Library Files into One Image</ulink>" | ||
1880 | section in the Yocto Project Development Manual. | ||
1881 | </para> | ||
1882 | </section> | ||
1883 | |||
1884 | <section id='ref-classes-native'> | ||
1885 | <title><filename>native.bbclass</filename></title> | ||
1886 | |||
1887 | <para> | ||
1888 | The <filename>native</filename> class provides common | ||
1889 | functionality for recipes that wish to build tools to run on the build | ||
1890 | host (i.e. tools that use the compiler or other tools from the | ||
1891 | build host). | ||
1892 | </para> | ||
1893 | |||
1894 | <para> | ||
1895 | You can create a recipe that builds tools that run natively on the | ||
1896 | host a couple different ways: | ||
1897 | <itemizedlist> | ||
1898 | <listitem><para>Create a <filename>myrecipe-native.bb</filename> | ||
1899 | that inherits the <filename>native</filename> class. | ||
1900 | If you use this method, you must order the inherit statement | ||
1901 | in the recipe after all other inherit statements so that the | ||
1902 | <filename>native</filename> class is inherited last. | ||
1903 | </para></listitem> | ||
1904 | <listitem><para>Create or modify a target recipe that has adds | ||
1905 | the following: | ||
1906 | <literallayout class='monospaced'> | ||
1907 | <link linkend='var-BBCLASSEXTEND'><filename>BBCLASSEXTEND</filename></link> = "native" | ||
1908 | </literallayout> | ||
1909 | Inside the recipe, use <filename>_class-native</filename> and | ||
1910 | <filename>_class-target</filename> overrides to specify any | ||
1911 | functionality specific to the respective native or target | ||
1912 | case.</para></listitem> | ||
1913 | </itemizedlist> | ||
1914 | </para> | ||
1915 | |||
1916 | <para> | ||
1917 | Although applied differently, the <filename>native</filename> class is | ||
1918 | used with both methods. | ||
1919 | The advantage of the second method is that you do not need to have two | ||
1920 | separate recipes (assuming you need both) for native and target. | ||
1921 | All common parts of the recipe are automatically shared. | ||
1922 | </para> | ||
1923 | </section> | ||
1924 | |||
1925 | <section id='ref-classes-nativesdk'> | ||
1926 | <title><filename>nativesdk.bbclass</filename></title> | ||
1927 | |||
1928 | <para> | ||
1929 | The <filename>nativesdk</filename> class provides common | ||
1930 | functionality for recipes that wish to build tools to run as part of | ||
1931 | an SDK (i.e. tools that run on | ||
1932 | <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>). | ||
1933 | </para> | ||
1934 | |||
1935 | <para> | ||
1936 | You can create a recipe that builds tools that run on the SDK machine | ||
1937 | a couple different ways: | ||
1938 | <itemizedlist> | ||
1939 | <listitem><para>Create a <filename>myrecipe-nativesdk.bb</filename> | ||
1940 | recipe that inherits the <filename>nativesdk</filename> class. | ||
1941 | If you use this method, you must order the inherit statement | ||
1942 | in the recipe after all other inherit statements so that the | ||
1943 | <filename>nativesdk</filename> class is inherited last. | ||
1944 | </para></listitem> | ||
1945 | <listitem><para>Create a <filename>nativesdk</filename> variant | ||
1946 | of any recipe by adding the following: | ||
1947 | <literallayout class='monospaced'> | ||
1948 | <link linkend='var-BBCLASSEXTEND'><filename>BBCLASSEXTEND</filename></link> = "nativesdk" | ||
1949 | </literallayout> | ||
1950 | Inside the recipe, use <filename>_class-nativesdk</filename> and | ||
1951 | <filename>_class-target</filename> overrides to specify any | ||
1952 | functionality specific to the respective SDK machine or target | ||
1953 | case.</para></listitem> | ||
1954 | </itemizedlist> | ||
1955 | </para> | ||
1956 | |||
1957 | <para> | ||
1958 | Although applied differently, the <filename>nativesdk</filename> class | ||
1959 | is used with both methods. | ||
1960 | The advantage of the second method is that you do not need to have two | ||
1961 | separate recipes (assuming you need both) for the SDK machine and the | ||
1962 | target. | ||
1963 | All common parts of the recipe are automatically shared. | ||
1964 | </para> | ||
1965 | </section> | ||
1966 | |||
1967 | <section id='ref-classes-oelint'> | ||
1968 | <title><filename>oelint.bbclass</filename></title> | ||
1969 | |||
1970 | <para> | ||
1971 | The <filename>oelint</filename> class is an | ||
1972 | obsolete lint checking tool that exists in | ||
1973 | <filename>meta/classes</filename> in the | ||
1974 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
1975 | </para> | ||
1976 | |||
1977 | <para> | ||
1978 | A number of classes exist that are could be generally useful in | ||
1979 | OE-Core but are never actually used within OE-Core itself. | ||
1980 | The <filename>oelint</filename> class is one such example. | ||
1981 | However, being aware of this class can reduce the proliferation of | ||
1982 | different versions of similar classes across multiple layers. | ||
1983 | </para> | ||
1984 | </section> | ||
1985 | |||
1986 | <section id='ref-classes-own-mirrors'> | ||
1987 | <title><filename>own-mirrors.bbclass</filename></title> | ||
1988 | |||
1989 | <para> | ||
1990 | The <filename>own-mirrors</filename> class makes it | ||
1991 | easier to set up your own | ||
1992 | <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link> | ||
1993 | from which to first fetch source before attempting to fetch it from the | ||
1994 | upstream specified in | ||
1995 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> | ||
1996 | within each recipe. | ||
1997 | </para> | ||
1998 | |||
1999 | <para> | ||
2000 | To use this class, inherit it globally and specify | ||
2001 | <link linkend='var-SOURCE_MIRROR_URL'><filename>SOURCE_MIRROR_URL</filename></link>. | ||
2002 | Here is an example: | ||
2003 | <literallayout class='monospaced'> | ||
2004 | INHERIT += "own-mirrors" | ||
2005 | SOURCE_MIRROR_URL = "http://example.com/my-source-mirror" | ||
2006 | </literallayout> | ||
2007 | You can specify only a single URL in | ||
2008 | <filename>SOURCE_MIRROR_URL</filename>. | ||
2009 | </para> | ||
2010 | </section> | ||
2011 | |||
2012 | <section id='ref-classes-package'> | ||
2013 | <title><filename>package.bbclass</filename></title> | ||
2014 | |||
2015 | <para> | ||
2016 | The <filename>package</filename> class supports generating | ||
2017 | packages from a build's output. | ||
2018 | The core generic functionality is in | ||
2019 | <filename>package.bbclass</filename>. | ||
2020 | The code specific to particular package types resides in these | ||
2021 | package-specific classes: | ||
2022 | <link linkend='ref-classes-package_deb'><filename>package_deb</filename></link>, | ||
2023 | <link linkend='ref-classes-package_rpm'><filename>package_rpm</filename></link>, | ||
2024 | <link linkend='ref-classes-package_ipk'><filename>package_ipk</filename></link>, | ||
2025 | and | ||
2026 | <link linkend='ref-classes-package_tar'><filename>package_tar</filename></link>. | ||
2027 | </para> | ||
2028 | |||
2029 | <para> | ||
2030 | You can control the list of resulting package formats by using the | ||
2031 | <filename><link linkend='var-PACKAGE_CLASSES'>PACKAGE_CLASSES</link></filename> | ||
2032 | variable defined in your <filename>conf/local.conf</filename> | ||
2033 | configuration file, which is located in the | ||
2034 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
2035 | When defining the variable, you can specify one or more package types. | ||
2036 | Since images are generated from packages, a packaging class is | ||
2037 | needed to enable image generation. | ||
2038 | The first class listed in this variable is used for image generation. | ||
2039 | </para> | ||
2040 | |||
2041 | <para> | ||
2042 | If you take the optional step to set up a repository (package feed) | ||
2043 | on the development host that can be used by Smart, you can | ||
2044 | install packages from the feed while you are running the image | ||
2045 | on the target (i.e. runtime installation of packages). | ||
2046 | For more information, see the | ||
2047 | "<ulink url='&YOCTO_DOCS_DEV_URL;#using-runtime-package-management'>Using Runtime Package Management</ulink>" | ||
2048 | section in the Yocto Project Development Manual. | ||
2049 | </para> | ||
2050 | |||
2051 | <para> | ||
2052 | The package-specific class you choose can affect build-time performance | ||
2053 | and has space ramifications. | ||
2054 | In general, building a package with IPK takes about thirty percent less | ||
2055 | time as compared to using RPM to build the same or similar package. | ||
2056 | This comparison takes into account a complete build of the package with | ||
2057 | all dependencies previously built. | ||
2058 | The reason for this discrepancy is because the RPM package manager | ||
2059 | creates and processes more | ||
2060 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> than the | ||
2061 | IPK package manager. | ||
2062 | Consequently, you might consider setting | ||
2063 | <filename>PACKAGE_CLASSES</filename> to "package_ipk" if you are | ||
2064 | building smaller systems. | ||
2065 | </para> | ||
2066 | |||
2067 | <para> | ||
2068 | Before making your package manager decision, however, you should | ||
2069 | consider some further things about using RPM: | ||
2070 | <itemizedlist> | ||
2071 | <listitem><para> | ||
2072 | RPM starts to provide more abilities than IPK due to | ||
2073 | the fact that it processes more Metadata. | ||
2074 | For example, this information includes individual file types, | ||
2075 | file checksum generation and evaluation on install, sparse file | ||
2076 | support, conflict detection and resolution for Multilib systems, | ||
2077 | ACID style upgrade, and repackaging abilities for rollbacks. | ||
2078 | </para></listitem> | ||
2079 | <listitem><para> | ||
2080 | For smaller systems, the extra space used for the Berkeley | ||
2081 | Database and the amount of metadata when using RPM can affect | ||
2082 | your ability to perform on-device upgrades. | ||
2083 | </para></listitem> | ||
2084 | </itemizedlist> | ||
2085 | </para> | ||
2086 | |||
2087 | <para> | ||
2088 | You can find additional information on the effects of the package | ||
2089 | class at these two Yocto Project mailing list links: | ||
2090 | <itemizedlist> | ||
2091 | <listitem><para><ulink url='&YOCTO_LISTS_URL;/pipermail/poky/2011-May/006362.html'> | ||
2092 | https://lists.yoctoproject.org/pipermail/poky/2011-May/006362.html</ulink></para></listitem> | ||
2093 | <listitem><para><ulink url='&YOCTO_LISTS_URL;/pipermail/poky/2011-May/006363.html'> | ||
2094 | https://lists.yoctoproject.org/pipermail/poky/2011-May/006363.html</ulink></para></listitem> | ||
2095 | </itemizedlist> | ||
2096 | </para> | ||
2097 | </section> | ||
2098 | |||
2099 | <section id='ref-classes-package_deb'> | ||
2100 | <title><filename>package_deb.bbclass</filename></title> | ||
2101 | |||
2102 | <para> | ||
2103 | The <filename>package_deb</filename> class | ||
2104 | provides support for creating packages that use the | ||
2105 | <filename>.deb</filename> file format. | ||
2106 | The class ensures the packages are written out to the | ||
2107 | <filename>${</filename><link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link><filename>}/deb</filename> | ||
2108 | directory in a <filename>.deb</filename> file format. | ||
2109 | </para> | ||
2110 | |||
2111 | <para> | ||
2112 | This class inherits the | ||
2113 | <link linkend='ref-classes-package'><filename>package</filename></link> | ||
2114 | class and is enabled through the | ||
2115 | <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link> | ||
2116 | variable in the <filename>local.conf</filename> file. | ||
2117 | </para> | ||
2118 | </section> | ||
2119 | |||
2120 | <section id='ref-classes-package_ipk'> | ||
2121 | <title><filename>package_ipk.bbclass</filename></title> | ||
2122 | |||
2123 | <para> | ||
2124 | The <filename>package_ipk</filename> class | ||
2125 | provides support for creating packages that use the | ||
2126 | <filename>.ipk</filename> file format. | ||
2127 | The class ensures the packages are written out to the | ||
2128 | <filename>${</filename><link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link><filename>}/ipk</filename> | ||
2129 | directory in a <filename>.ipk</filename> file format. | ||
2130 | </para> | ||
2131 | |||
2132 | <para> | ||
2133 | This class inherits the | ||
2134 | <link linkend='ref-classes-package'><filename>package</filename></link> | ||
2135 | class and is enabled through the | ||
2136 | <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link> | ||
2137 | variable in the <filename>local.conf</filename> file. | ||
2138 | </para> | ||
2139 | </section> | ||
2140 | |||
2141 | <section id='ref-classes-package_rpm'> | ||
2142 | <title><filename>package_rpm.bbclass</filename></title> | ||
2143 | |||
2144 | <para> | ||
2145 | The <filename>package_deb</filename> class | ||
2146 | provides support for creating packages that use the | ||
2147 | <filename>.rpm</filename> file format. | ||
2148 | The class ensures the packages are written out to the | ||
2149 | <filename>${</filename><link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link><filename>}/rpm</filename> | ||
2150 | directory in a <filename>.rpm</filename> file format. | ||
2151 | </para> | ||
2152 | |||
2153 | <para> | ||
2154 | This class inherits the | ||
2155 | <link linkend='ref-classes-package'><filename>package</filename></link> | ||
2156 | class and is enabled through the | ||
2157 | <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link> | ||
2158 | variable in the <filename>local.conf</filename> file. | ||
2159 | </para> | ||
2160 | </section> | ||
2161 | |||
2162 | <section id='ref-classes-package_tar'> | ||
2163 | <title><filename>package_tar.bbclass</filename></title> | ||
2164 | |||
2165 | <para> | ||
2166 | The <filename>package_tar</filename> | ||
2167 | class provides support for creating packages that use the | ||
2168 | <filename>.tar</filename> file format. | ||
2169 | The class ensures the packages are written out to the | ||
2170 | <filename>${</filename><link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link><filename>}/tar</filename> | ||
2171 | directory in a <filename>.tar</filename> file format. | ||
2172 | </para> | ||
2173 | |||
2174 | <para> | ||
2175 | This class inherits the | ||
2176 | <link linkend='ref-classes-package'><filename>package</filename></link> | ||
2177 | class and is enabled through the | ||
2178 | <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link> | ||
2179 | variable in the <filename>local.conf</filename> file. | ||
2180 | <note> | ||
2181 | You cannot specify the <filename>package_tar</filename> class | ||
2182 | first using the <filename>PACKAGE_CLASSES</filename> variable. | ||
2183 | You must use <filename>.deb</filename>, | ||
2184 | <filename>.ipk</filename>, or <filename>.rpm</filename> file | ||
2185 | formats for your image or SDK. | ||
2186 | </note> | ||
2187 | </para> | ||
2188 | </section> | ||
2189 | |||
2190 | <section id='ref-classes-packagedata'> | ||
2191 | <title><filename>packagedata.bbclass</filename></title> | ||
2192 | |||
2193 | <para> | ||
2194 | The <filename>packagedata</filename> class provides | ||
2195 | common functionality for reading <filename>pkgdata</filename> files | ||
2196 | found in | ||
2197 | <link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link>. | ||
2198 | These files contain information about each output package produced by | ||
2199 | the OpenEmbedded build system. | ||
2200 | </para> | ||
2201 | |||
2202 | <para> | ||
2203 | This class is enabled by default because it is inherited by the | ||
2204 | <link linkend='ref-classes-package'><filename>package</filename></link> | ||
2205 | class. | ||
2206 | </para> | ||
2207 | </section> | ||
2208 | |||
2209 | <section id='ref-classes-packagegroup'> | ||
2210 | <title><filename>packagegroup.bbclass</filename></title> | ||
2211 | |||
2212 | <para> | ||
2213 | The <filename>packagegroup</filename> class sets default values | ||
2214 | appropriate for package group recipes (e.g. | ||
2215 | <filename><link linkend='var-PACKAGES'>PACKAGES</link></filename>, | ||
2216 | <filename><link linkend='var-PACKAGE_ARCH'>PACKAGE_ARCH</link></filename>, | ||
2217 | <filename><link linkend='var-ALLOW_EMPTY'>ALLOW_EMPTY</link></filename>, | ||
2218 | and so forth). | ||
2219 | It is highly recommended that all package group recipes inherit this class. | ||
2220 | </para> | ||
2221 | |||
2222 | <para> | ||
2223 | For information on how to use this class, see the | ||
2224 | "<ulink url='&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage-customtasks'>Customizing Images Using Custom Package Groups</ulink>" | ||
2225 | section in the Yocto Project Development Manual. | ||
2226 | </para> | ||
2227 | |||
2228 | <para> | ||
2229 | Previously, this class was called the <filename>task</filename> class. | ||
2230 | </para> | ||
2231 | </section> | ||
2232 | |||
2233 | <section id='ref-classes-packageinfo'> | ||
2234 | <title><filename>packageinfo.bbclass</filename></title> | ||
2235 | |||
2236 | <para> | ||
2237 | The <filename>packageinfo</filename> class | ||
2238 | gives a BitBake user interface the ability to retrieve information | ||
2239 | about output packages from the <filename>pkgdata</filename> files. | ||
2240 | </para> | ||
2241 | |||
2242 | <para> | ||
2243 | This class is enabled automatically when using the | ||
2244 | <ulink url='&YOCTO_HOME_URL;/tools-resources/projects/hob'>Hob</ulink> | ||
2245 | user interface. | ||
2246 | </para> | ||
2247 | </section> | ||
2248 | |||
2249 | <section id='ref-classes-patch'> | ||
2250 | <title><filename>patch.bbclass</filename></title> | ||
2251 | |||
2252 | <para> | ||
2253 | The <filename>patch</filename> class provides all functionality for | ||
2254 | applying patches during the | ||
2255 | <link linkend='ref-tasks-patch'><filename>do_patch</filename></link> | ||
2256 | task. | ||
2257 | </para> | ||
2258 | |||
2259 | <para> | ||
2260 | This class is enabled by default because it is inherited by the | ||
2261 | <link linkend='ref-classes-base'><filename>base</filename></link> | ||
2262 | class. | ||
2263 | </para> | ||
2264 | </section> | ||
2265 | |||
2266 | <section id='ref-classes-perlnative'> | ||
2267 | <title><filename>perlnative.bbclass</filename></title> | ||
2268 | |||
2269 | <para> | ||
2270 | When inherited by a recipe, the <filename>perlnative</filename> class | ||
2271 | supports using the native version of Perl built by the build system | ||
2272 | rather than using the version provided by the build host. | ||
2273 | </para> | ||
2274 | </section> | ||
2275 | |||
2276 | <section id='ref-classes-pixbufcache'> | ||
2277 | <title><filename>pixbufcache.bbclass</filename></title> | ||
2278 | |||
2279 | <para> | ||
2280 | The <filename>pixbufcache</filename> class generates the proper | ||
2281 | post-install and post-remove (postinst/postrm) scriptlets for packages | ||
2282 | that install pixbuf loaders, which are used with | ||
2283 | <filename>gdk-pixbuf</filename>. | ||
2284 | These scriptlets call <filename>update_pixbuf_cache</filename> | ||
2285 | to add the pixbuf loaders to the cache. | ||
2286 | Since the cache files are architecture-specific, | ||
2287 | <filename>update_pixbuf_cache</filename> is run using QEMU if the | ||
2288 | postinst scriptlets need to be run on the build host during image | ||
2289 | creation. | ||
2290 | </para> | ||
2291 | |||
2292 | <para> | ||
2293 | If the pixbuf loaders being installed are in packages other | ||
2294 | than the recipe's main package, set | ||
2295 | <link linkend='var-PIXBUF_PACKAGES'><filename>PIXBUF_PACKAGES</filename></link> | ||
2296 | to specify the packages containing the loaders. | ||
2297 | </para> | ||
2298 | </section> | ||
2299 | |||
2300 | <section id='ref-classes-pkgconfig'> | ||
2301 | <title><filename>pkgconfig.bbclass</filename></title> | ||
2302 | |||
2303 | <para> | ||
2304 | The <filename>pkg-config</filename> class provides a standard way to get | ||
2305 | header and library information. | ||
2306 | This class aims to smooth integration of | ||
2307 | <filename>pkg-config</filename> into libraries that use it. | ||
2308 | </para> | ||
2309 | |||
2310 | <para> | ||
2311 | During staging, BitBake installs <filename>pkg-config</filename> data into the | ||
2312 | <filename>sysroots/</filename> directory. | ||
2313 | By making use of sysroot functionality within <filename>pkg-config</filename>, | ||
2314 | this class no longer has to manipulate the files. | ||
2315 | </para> | ||
2316 | </section> | ||
2317 | |||
2318 | <section id='ref-classes-populate-sdk'> | ||
2319 | <title><filename>populate_sdk.bbclass</filename></title> | ||
2320 | |||
2321 | <para> | ||
2322 | The <filename>populate_sdk</filename> class provides support for | ||
2323 | SDK-only recipes. | ||
2324 | For information on advantages gained when building a cross-development | ||
2325 | toolchain using the | ||
2326 | <link linkend='ref-tasks-populate_sdk'><filename>do_populate_sdk</filename></link> | ||
2327 | task, see the | ||
2328 | "<ulink url='&YOCTO_DOCS_ADT_URL;#optionally-building-a-toolchain-installer'>Optionally Building a Toolchain Installer</ulink>" | ||
2329 | section in the Yocto Project Application Developer's Guide. | ||
2330 | </para> | ||
2331 | </section> | ||
2332 | |||
2333 | <section id='ref-classes-populate-sdk-*'> | ||
2334 | <title><filename>populate_sdk_*.bbclass</filename></title> | ||
2335 | |||
2336 | <para> | ||
2337 | The <filename>populate_sdk_*</filename> classes support SDK creation | ||
2338 | and consist of the following classes: | ||
2339 | <itemizedlist> | ||
2340 | <listitem><para><emphasis><filename>populate_sdk_base</filename>:</emphasis> | ||
2341 | The base class supporting SDK creation under all package | ||
2342 | managers (i.e. DEB, RPM, and IPK).</para></listitem> | ||
2343 | <listitem><para><emphasis><filename>populate_sdk_deb</filename>:</emphasis> | ||
2344 | Supports creation of the SDK given the Debian package manager. | ||
2345 | </para></listitem> | ||
2346 | <listitem><para><emphasis><filename>populate_sdk_rpm</filename>:</emphasis> | ||
2347 | Supports creation of the SDK given the RPM package manager. | ||
2348 | </para></listitem> | ||
2349 | <listitem><para><emphasis><filename>populate_sdk_ipk</filename>:</emphasis> | ||
2350 | Supports creation of the SDK given the IPK package manager. | ||
2351 | </para></listitem> | ||
2352 | </itemizedlist> | ||
2353 | </para> | ||
2354 | |||
2355 | <para> | ||
2356 | The <filename>populate_sdk_base</filename> package inherits the | ||
2357 | appropriate <filename>populate_sdk_*</filename> (i.e. | ||
2358 | <filename>deb</filename>, <filename>rpm</filename>, and | ||
2359 | <filename>ipk</filename>) based on | ||
2360 | <link linkend='var-IMAGE_PKGTYPE'><filename>IMAGE_PKGTYPE</filename></link>. | ||
2361 | </para> | ||
2362 | |||
2363 | <para> | ||
2364 | The base class ensures all source and destination directories are | ||
2365 | established and then populates the SDK. | ||
2366 | After populating the SDK, the <filename>populate_sdk_base</filename> | ||
2367 | class constructs two images: | ||
2368 | <link linkend='var-SDK_ARCH'><filename>SDK_ARCH</filename></link><filename>-nativesdk</filename>, | ||
2369 | which contains the cross-compiler and associated tooling, and the | ||
2370 | target, which contains a target root filesystem that is configured for | ||
2371 | the SDK usage. | ||
2372 | These two images reside in | ||
2373 | <link linkend='var-SDK_OUTPUT'><filename>SDK_OUTPUT</filename></link>, | ||
2374 | which consists of the following: | ||
2375 | <literallayout class='monospaced'> | ||
2376 | ${SDK_OUTPUT}/<sdk_arch-nativesdk pkgs> | ||
2377 | ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/<target pkgs> | ||
2378 | </literallayout> | ||
2379 | </para> | ||
2380 | |||
2381 | <para> | ||
2382 | Finally, the base populate SDK class creates the toolchain | ||
2383 | environment setup script, the tarball of the SDK, and the installer. | ||
2384 | </para> | ||
2385 | |||
2386 | <para> | ||
2387 | The respective <filename>populate_sdk_deb</filename>, | ||
2388 | <filename>populate_sdk_rpm</filename>, and | ||
2389 | <filename>populate_sdk_ipk</filename> classes each support the | ||
2390 | specific type of SDK. | ||
2391 | These classes are inherited by and used with the | ||
2392 | <filename>populate_sdk_base</filename> class. | ||
2393 | </para> | ||
2394 | |||
2395 | <para> | ||
2396 | For more information on the cross-development toolchain | ||
2397 | generation, see the | ||
2398 | "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>" | ||
2399 | section. | ||
2400 | For information on advantages gained when building a | ||
2401 | cross-development toolchain using the | ||
2402 | <link linkend='ref-tasks-populate_sdk'><filename>do_populate_sdk</filename></link> | ||
2403 | task, see the | ||
2404 | "<ulink url='&YOCTO_DOCS_ADT_URL;#optionally-building-a-toolchain-installer'>Optionally Building a Toolchain Installer</ulink>" | ||
2405 | section in the Yocto Project Application Developer's Guide. | ||
2406 | </para> | ||
2407 | </section> | ||
2408 | |||
2409 | <section id='ref-classes-prexport'> | ||
2410 | <title><filename>prexport.bbclass</filename></title> | ||
2411 | |||
2412 | <para> | ||
2413 | The <filename>prexport</filename> class provides functionality for | ||
2414 | exporting | ||
2415 | <link linkend='var-PR'><filename>PR</filename></link> values. | ||
2416 | <note> | ||
2417 | This class is not intended to be used directly. | ||
2418 | Rather, it is enabled when using | ||
2419 | "<filename>bitbake-prserv-tool export</filename>". | ||
2420 | </note> | ||
2421 | </para> | ||
2422 | </section> | ||
2423 | |||
2424 | <section id='ref-classes-primport'> | ||
2425 | <title><filename>primport.bbclass</filename></title> | ||
2426 | |||
2427 | <para> | ||
2428 | The <filename>primport</filename> class provides functionality for | ||
2429 | importing | ||
2430 | <link linkend='var-PR'><filename>PR</filename></link> values. | ||
2431 | <note> | ||
2432 | This class is not intended to be used directly. | ||
2433 | Rather, it is enabled when using | ||
2434 | "<filename>bitbake-prserv-tool import</filename>". | ||
2435 | </note> | ||
2436 | </para> | ||
2437 | </section> | ||
2438 | |||
2439 | <section id='ref-classes-prserv'> | ||
2440 | <title><filename>prserv.bbclass</filename></title> | ||
2441 | |||
2442 | <para> | ||
2443 | The <filename>prserv</filename> class provides functionality for | ||
2444 | using a | ||
2445 | <ulink url='&YOCTO_DOCS_DEV_URL;#working-with-a-pr-service'>PR service</ulink> | ||
2446 | in order to automatically manage the incrementing of the | ||
2447 | <link linkend='var-PR'><filename>PR</filename></link> variable for | ||
2448 | each recipe. | ||
2449 | </para> | ||
2450 | |||
2451 | <para> | ||
2452 | This class is enabled by default because it is inherited by the | ||
2453 | <link linkend='ref-classes-package'><filename>package</filename></link> | ||
2454 | class. | ||
2455 | However, the OpenEmbedded build system will not enable the | ||
2456 | functionality of this class unless | ||
2457 | <link linkend='var-PRSERV_HOST'><filename>PRSERV_HOST</filename></link> | ||
2458 | has been set. | ||
2459 | </para> | ||
2460 | </section> | ||
2461 | |||
2462 | <section id='ref-classes-ptest'> | ||
2463 | <title><filename>ptest.bbclass</filename></title> | ||
2464 | |||
2465 | <para> | ||
2466 | The <filename>ptest</filename> class provides functionality for | ||
2467 | packaging and installing runtime tests for recipes that build software | ||
2468 | that provides these tests. | ||
2469 | </para> | ||
2470 | |||
2471 | <para> | ||
2472 | This class is intended to be inherited by individual recipes. | ||
2473 | However, the class' functionality is largely disabled unless "ptest" | ||
2474 | appears in | ||
2475 | <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>. | ||
2476 | See the | ||
2477 | "<ulink url='&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest'>Testing Packages With ptest</ulink>" | ||
2478 | section in the Yocto Project Development Manual for more information | ||
2479 | on ptest. | ||
2480 | </para> | ||
2481 | </section> | ||
2482 | |||
2483 | <section id='ref-classes-python-dir'> | ||
2484 | <title><filename>python-dir.bbclass</filename></title> | ||
2485 | |||
2486 | <para> | ||
2487 | The <filename>python-dir</filename> class provides the base version, | ||
2488 | location, and site package location for Python. | ||
2489 | </para> | ||
2490 | </section> | ||
2491 | |||
2492 | <section id='ref-classes-pythonnative'> | ||
2493 | <title><filename>pythonnative.bbclass</filename></title> | ||
2494 | |||
2495 | <para> | ||
2496 | When inherited by a recipe, the <filename>pythonnative</filename> class | ||
2497 | supports using the native version of Python built by the build system | ||
2498 | rather than using the version provided by the build host. | ||
2499 | </para> | ||
2500 | </section> | ||
2501 | |||
2502 | <section id='ref-classes-qemu'> | ||
2503 | <title><filename>qemu.bbclass</filename></title> | ||
2504 | |||
2505 | <para> | ||
2506 | The <filename>qemu</filename> class provides functionality for recipes | ||
2507 | that either need QEMU or test for the existence of QEMU. | ||
2508 | Typically, this class is used to run programs for a target system on | ||
2509 | the build host using QEMU's application emulation mode. | ||
2510 | </para> | ||
2511 | </section> | ||
2512 | |||
2513 | <section id='ref-classes-qmake*'> | ||
2514 | <title><filename>qmake*.bbclass</filename></title> | ||
2515 | |||
2516 | <para> | ||
2517 | The <filename>qmake*</filename> classes support recipes that | ||
2518 | need to build software that uses Qt's <filename>qmake</filename> | ||
2519 | build system and are comprised of the following: | ||
2520 | <itemizedlist> | ||
2521 | <listitem><para><emphasis><filename>qmake_base</filename>:</emphasis> | ||
2522 | Provides base functionality for all versions of | ||
2523 | <filename>qmake</filename>.</para></listitem> | ||
2524 | <listitem><para><emphasis><filename>qmake2</filename>:</emphasis> | ||
2525 | Extends base functionality for <filename>qmake</filename> 2.x as | ||
2526 | used by Qt 4.x.</para></listitem> | ||
2527 | </itemizedlist> | ||
2528 | </para> | ||
2529 | |||
2530 | <para> | ||
2531 | If you need to set any configuration variables or pass any options to | ||
2532 | <filename>qmake</filename>, you can add these to the | ||
2533 | <link linkend='var-EXTRA_QMAKEVARS_PRE'><filename>EXTRA_QMAKEVARS_PRE</filename></link> | ||
2534 | or | ||
2535 | <link linkend='var-EXTRA_QMAKEVARS_POST'><filename>EXTRA_QMAKEVARS_POST</filename></link> | ||
2536 | variables, depending on whether the arguments need to be before or | ||
2537 | after the <filename>.pro</filename> file list on the command line, | ||
2538 | respectively. | ||
2539 | </para> | ||
2540 | |||
2541 | <para> | ||
2542 | By default, all <filename>.pro</filename> files are built. | ||
2543 | If you want to specify your own subset of <filename>.pro</filename> | ||
2544 | files to be built, specify them in the | ||
2545 | <link linkend='var-QMAKE_PROFILES'><filename>QMAKE_PROFILES</filename></link> | ||
2546 | variable. | ||
2547 | </para> | ||
2548 | </section> | ||
2549 | |||
2550 | <section id='ref-classes-qt4*'> | ||
2551 | <title><filename>qt4*.bbclass</filename></title> | ||
2552 | |||
2553 | <para> | ||
2554 | The <filename>qt4*</filename> classes support recipes that need to | ||
2555 | build software that uses the Qt development framework version 4.x | ||
2556 | and consist of the following: | ||
2557 | <itemizedlist> | ||
2558 | <listitem><para><emphasis><filename>qt4e</filename>:</emphasis> | ||
2559 | Supports building against Qt/Embedded, which uses the | ||
2560 | framebuffer for graphical output.</para></listitem> | ||
2561 | <listitem><para><emphasis><filename>qt4x11</filename>:</emphasis> | ||
2562 | Supports building against Qt/X11.</para></listitem> | ||
2563 | </itemizedlist> | ||
2564 | </para> | ||
2565 | |||
2566 | <para> | ||
2567 | The classes inherit the | ||
2568 | <link linkend='ref-classes-qmake*'><filename>qmake2</filename></link> | ||
2569 | class. | ||
2570 | </para> | ||
2571 | </section> | ||
2572 | |||
2573 | <section id='ref-classes-relocatable'> | ||
2574 | <title><filename>relocatable.bbclass</filename></title> | ||
2575 | |||
2576 | <para> | ||
2577 | The <filename>relocatable</filename> class enables relocation of | ||
2578 | binaries when they are installed into the sysroot. | ||
2579 | </para> | ||
2580 | |||
2581 | <para> | ||
2582 | This class makes use of the | ||
2583 | <link linkend='ref-classes-chrpath'><filename>chrpath</filename></link> | ||
2584 | class and is used by both the | ||
2585 | <link linkend='ref-classes-cross'><filename>cross</filename></link> | ||
2586 | and | ||
2587 | <link linkend='ref-classes-native'><filename>native</filename></link> | ||
2588 | classes. | ||
2589 | </para> | ||
2590 | </section> | ||
2591 | |||
2592 | <section id='ref-classes-report-error'> | ||
2593 | <title><filename>report-error.bbclass</filename></title> | ||
2594 | |||
2595 | <para> | ||
2596 | The <filename>report-error</filename> class supports enabling the | ||
2597 | <ulink url='&YOCTO_DOCS_DEV_URL;#using-the-error-reporting-tool'>error reporting tool</ulink>, | ||
2598 | which allows you to submit build error information to a central | ||
2599 | database. | ||
2600 | </para> | ||
2601 | |||
2602 | <para> | ||
2603 | The class collects debug information for recipe, recipe version, task, | ||
2604 | machine, distro, build system, target system, host distro, branch, | ||
2605 | commit, and log. | ||
2606 | From the information, report files using a JSON format are created and | ||
2607 | stored in | ||
2608 | <filename>${</filename><link linkend='var-LOG_DIR'><filename>LOG_DIR</filename></link><filename>}/error-report</filename>. | ||
2609 | </para> | ||
2610 | </section> | ||
2611 | |||
2612 | <section id='ref-classes-rm-work'> | ||
2613 | <title><filename>rm_work.bbclass</filename></title> | ||
2614 | |||
2615 | <para> | ||
2616 | The <filename>rm_work</filename> class supports deletion of temporary | ||
2617 | workspace, which can ease your hard drive demands during builds. | ||
2618 | </para> | ||
2619 | |||
2620 | <para> | ||
2621 | The OpenEmbedded build system can use a substantial amount of disk | ||
2622 | space during the build process. | ||
2623 | A portion of this space is the work files under the | ||
2624 | <filename>${TMPDIR}/work</filename> directory for each recipe. | ||
2625 | Once the build system generates the packages for a recipe, the work | ||
2626 | files for that recipe are no longer needed. | ||
2627 | However, by default, the build system preserves these files | ||
2628 | for inspection and possible debugging purposes. | ||
2629 | If you would rather have these files deleted to save disk space | ||
2630 | as the build progresses, you can enable <filename>rm_work</filename> | ||
2631 | by adding the following to your <filename>local.conf</filename> file, | ||
2632 | which is found in the | ||
2633 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
2634 | <literallayout class='monospaced'> | ||
2635 | INHERIT += "rm_work" | ||
2636 | </literallayout> | ||
2637 | If you are modifying and building source code out of the work directory | ||
2638 | for a recipe, enabling <filename>rm_work</filename> will potentially | ||
2639 | result in your changes to the source being lost. | ||
2640 | To exclude some recipes from having their work directories deleted by | ||
2641 | <filename>rm_work</filename>, you can add the names of the recipe or | ||
2642 | recipes you are working on to the <filename>RM_WORK_EXCLUDE</filename> | ||
2643 | variable, which can also be set in your <filename>local.conf</filename> | ||
2644 | file. | ||
2645 | Here is an example: | ||
2646 | <literallayout class='monospaced'> | ||
2647 | RM_WORK_EXCLUDE += "busybox eglibc" | ||
2648 | </literallayout> | ||
2649 | </para> | ||
2650 | </section> | ||
2651 | |||
2652 | <section id='ref-classes-rootfs*'> | ||
2653 | <title><filename>rootfs*.bbclass</filename></title> | ||
2654 | |||
2655 | <para> | ||
2656 | The <filename>rootfs*</filename> classes support creating | ||
2657 | the root filesystem for an image and consist of the following classes: | ||
2658 | <itemizedlist> | ||
2659 | <listitem><para> | ||
2660 | The <filename>rootfs_deb</filename> class, which supports | ||
2661 | creation of root filesystems for images built using | ||
2662 | <filename>.deb</filename> packages.</para></listitem> | ||
2663 | <listitem><para> | ||
2664 | The <filename>rootfs_rpm</filename> class, which supports | ||
2665 | creation of root filesystems for images built using | ||
2666 | <filename>.rpm</filename> packages.</para></listitem> | ||
2667 | <listitem><para> | ||
2668 | The <filename>rootfs_ipk</filename> class, which supports | ||
2669 | creation of root filesystems for images built using | ||
2670 | <filename>.ipk</filename> packages.</para></listitem> | ||
2671 | </itemizedlist> | ||
2672 | </para> | ||
2673 | |||
2674 | <para> | ||
2675 | The root filesystem is created from packages using one of the | ||
2676 | <filename>rootfs*.bbclass</filename> files as determined by the | ||
2677 | <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link> | ||
2678 | variable. | ||
2679 | </para> | ||
2680 | |||
2681 | <para> | ||
2682 | For information on how root filesystem images are created, see the | ||
2683 | "<link linkend='image-generation-dev-environment'>Image Generation</link>" | ||
2684 | section. | ||
2685 | </para> | ||
2686 | </section> | ||
2687 | |||
2688 | <section id='ref-classes-sanity'> | ||
2689 | <title><filename>sanity.bbclass</filename></title> | ||
2690 | |||
2691 | <para> | ||
2692 | The <filename>sanity</filename> class checks to see if prerequisite | ||
2693 | software is present on the host system so that users can be notified | ||
2694 | of potential problems that might affect their build. | ||
2695 | The class also performs basic user configuration checks from | ||
2696 | the <filename>local.conf</filename> configuration file to | ||
2697 | prevent common mistakes that cause build failures. | ||
2698 | Distribution policy usually determines whether to include this class. | ||
2699 | </para> | ||
2700 | </section> | ||
2701 | |||
2702 | <section id='ref-classes-scons'> | ||
2703 | <title><filename>scons.bbclass</filename></title> | ||
2704 | |||
2705 | <para> | ||
2706 | The <filename>scons</filename> class supports recipes that need to | ||
2707 | build software that uses the SCons build system. | ||
2708 | You can use the | ||
2709 | <link linkend='var-EXTRA_OESCONS'><filename>EXTRA_OESCONS</filename></link> | ||
2710 | variable to specify additional configuration options you want to pass | ||
2711 | SCons command line. | ||
2712 | </para> | ||
2713 | </section> | ||
2714 | |||
2715 | <section id='ref-classes-sdl'> | ||
2716 | <title><filename>sdl.bbclass</filename></title> | ||
2717 | |||
2718 | <para> | ||
2719 | The <filename>sdl</filename> class supports recipes that need to build | ||
2720 | software that uses the Simple DirectMedia Layer (SDL) library. | ||
2721 | </para> | ||
2722 | </section> | ||
2723 | |||
2724 | <section id='ref-classes-setuptools'> | ||
2725 | <title><filename>setuptools.bbclass</filename></title> | ||
2726 | |||
2727 | <para> | ||
2728 | The <filename>setuptools</filename> class supports Python | ||
2729 | version 2.x extensions that use build systems based on | ||
2730 | <filename>setuptools</filename>. | ||
2731 | If your recipe uses these build systems, the recipe needs to | ||
2732 | inherit the <filename>setuptools</filename> class. | ||
2733 | </para> | ||
2734 | </section> | ||
2735 | |||
2736 | <section id='ref-classes-setuptools3'> | ||
2737 | <title><filename>setuptools3.bbclass</filename></title> | ||
2738 | |||
2739 | <para> | ||
2740 | The <filename>setuptools3</filename> class supports Python | ||
2741 | version 3.x extensions that use build systems based on | ||
2742 | <filename>setuptools3</filename>. | ||
2743 | If your recipe uses these build systems, the recipe needs to | ||
2744 | inherit the <filename>setuptools3</filename> class. | ||
2745 | </para> | ||
2746 | </section> | ||
2747 | |||
2748 | <section id='ref-classes-sip'> | ||
2749 | <title><filename>sip.bbclass</filename></title> | ||
2750 | |||
2751 | <para> | ||
2752 | The <filename>sip</filename> class | ||
2753 | supports recipes that build or package SIP-based Python bindings. | ||
2754 | </para> | ||
2755 | </section> | ||
2756 | |||
2757 | <section id='ref-classes-siteconfig'> | ||
2758 | <title><filename>siteconfig.bbclass</filename></title> | ||
2759 | |||
2760 | <para> | ||
2761 | The <filename>siteconfig</filename> class | ||
2762 | provides functionality for handling site configuration. | ||
2763 | The class is used by the | ||
2764 | <link linkend='ref-classes-autotools'><filename>autotools</filename></link> | ||
2765 | class to accelerate the | ||
2766 | <link linkend='ref-tasks-configure'><filename>do_configure</filename></link> | ||
2767 | task. | ||
2768 | </para> | ||
2769 | </section> | ||
2770 | |||
2771 | <section id='ref-classes-siteinfo'> | ||
2772 | <title><filename>siteinfo.bbclass</filename></title> | ||
2773 | |||
2774 | <para> | ||
2775 | The <filename>siteinfo</filename> class provides information about | ||
2776 | the targets that might be needed by other classes or recipes. | ||
2777 | </para> | ||
2778 | |||
2779 | <para> | ||
2780 | As an example, consider Autotools, which can require tests that must | ||
2781 | execute on the target hardware. | ||
2782 | Since this is not possible in general when cross compiling, site | ||
2783 | information is used to provide cached test results so these tests can | ||
2784 | be skipped over but still make the correct values available. | ||
2785 | The | ||
2786 | <filename><link linkend='structure-meta-site'>meta/site directory</link></filename> | ||
2787 | contains test results sorted into different categories such as | ||
2788 | architecture, endianness, and the <filename>libc</filename> used. | ||
2789 | Site information provides a list of files containing data relevant to | ||
2790 | the current build in the | ||
2791 | <filename><link linkend='var-CONFIG_SITE'>CONFIG_SITE</link></filename> variable | ||
2792 | that Autotools automatically picks up. | ||
2793 | </para> | ||
2794 | |||
2795 | <para> | ||
2796 | The class also provides variables like | ||
2797 | <filename><link linkend='var-SITEINFO_ENDIANNESS'>SITEINFO_ENDIANNESS</link></filename> | ||
2798 | and <filename><link linkend='var-SITEINFO_BITS'>SITEINFO_BITS</link></filename> | ||
2799 | that can be used elsewhere in the metadata. | ||
2800 | </para> | ||
2801 | |||
2802 | <para> | ||
2803 | Because the | ||
2804 | <link linkend='ref-classes-base'><filename>base</filename></link> class | ||
2805 | includes the <filename>siteinfo</filename> class, it is always active. | ||
2806 | </para> | ||
2807 | </section> | ||
2808 | |||
2809 | <section id='ref-classes-spdx'> | ||
2810 | <title><filename>spdx.bbclass</filename></title> | ||
2811 | |||
2812 | <para> | ||
2813 | The <filename>spdx</filename> class integrates real-time license | ||
2814 | scanning, generation of SPDX standard output, and verification | ||
2815 | of license information during the build. | ||
2816 | <note> | ||
2817 | This class is currently at the prototype stage in the 1.6 | ||
2818 | release. | ||
2819 | </note> | ||
2820 | </para> | ||
2821 | </section> | ||
2822 | |||
2823 | <section id='ref-classes-sstate'> | ||
2824 | <title><filename>sstate.bbclass</filename></title> | ||
2825 | |||
2826 | <para> | ||
2827 | The <filename>sstate</filename> class provides support for Shared | ||
2828 | State (sstate). | ||
2829 | By default, the class is enabled through the | ||
2830 | <link linkend='var-INHERIT_DISTRO'><filename>INHERIT_DISTRO</filename></link> | ||
2831 | variable's default value. | ||
2832 | </para> | ||
2833 | |||
2834 | <para> | ||
2835 | For more information on sstate, see the | ||
2836 | "<link linkend='shared-state-cache'>Shared State Cache</link>" | ||
2837 | section. | ||
2838 | </para> | ||
2839 | </section> | ||
2840 | |||
2841 | <section id='ref-classes-staging'> | ||
2842 | <title><filename>staging.bbclass</filename></title> | ||
2843 | |||
2844 | <para> | ||
2845 | The <filename>staging</filename> class provides support for staging | ||
2846 | files into the sysroot during the | ||
2847 | <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link> | ||
2848 | task. | ||
2849 | The class is enabled by default because it is inherited by the | ||
2850 | <link linkend='ref-classes-base'><filename>base</filename></link> | ||
2851 | class. | ||
2852 | </para> | ||
2853 | </section> | ||
2854 | |||
2855 | <section id='ref-classes-syslinux'> | ||
2856 | <title><filename>syslinux.bbclass</filename></title> | ||
2857 | |||
2858 | <para> | ||
2859 | The <filename>syslinux</filename> class provides syslinux-specific | ||
2860 | functions for building bootable images. | ||
2861 | </para> | ||
2862 | |||
2863 | <para> | ||
2864 | The class supports the following variables: | ||
2865 | <itemizedlist> | ||
2866 | <listitem><para><emphasis><link linkend='var-INITRD'><filename>INITRD</filename></link>:</emphasis> | ||
2867 | Indicates a filesystem image to use as an initial RAM disk | ||
2868 | (initrd). | ||
2869 | This variable is optional.</para></listitem> | ||
2870 | <listitem><para><emphasis><link linkend='var-ROOTFS'><filename>ROOTFS</filename></link>:</emphasis> | ||
2871 | Indicates a filesystem image to include as the root filesystem. | ||
2872 | This variable is optional.</para></listitem> | ||
2873 | <listitem><para><emphasis><link linkend='var-AUTO_SYSLINUXMENU'><filename>AUTO_SYSLINUXMENU</filename></link>:</emphasis> | ||
2874 | Enables creating an automatic menu when set to "1". | ||
2875 | </para></listitem> | ||
2876 | <listitem><para><emphasis><link linkend='var-LABELS'><filename>LABELS</filename></link>:</emphasis> | ||
2877 | Lists targets for automatic configuration. | ||
2878 | </para></listitem> | ||
2879 | <listitem><para><emphasis><link linkend='var-APPEND'><filename>APPEND</filename></link>:</emphasis> | ||
2880 | Lists append string overrides for each label. | ||
2881 | </para></listitem> | ||
2882 | <listitem><para><emphasis><link linkend='var-SYSLINUX_OPTS'><filename>SYSLINUX_OPTS</filename></link>:</emphasis> | ||
2883 | Lists additional options to add to the syslinux file. | ||
2884 | Semicolon characters separate multiple options. | ||
2885 | </para></listitem> | ||
2886 | <listitem><para><emphasis><link linkend='var-SYSLINUX_SPLASH'><filename>SYSLINUX_SPLASH</filename></link>:</emphasis> | ||
2887 | Lists a background for the VGA boot menu when you are using the | ||
2888 | boot menu.</para></listitem> | ||
2889 | <listitem><para><emphasis><link linkend='var-SYSLINUX_DEFAULT_CONSOLE'><filename>SYSLINUX_DEFAULT_CONSOLE</filename></link>:</emphasis> | ||
2890 | Set to "console=ttyX" to change kernel boot default console. | ||
2891 | </para></listitem> | ||
2892 | <listitem><para><emphasis><link linkend='var-SYSLINUX_SERIAL'><filename>SYSLINUX_SERIAL</filename></link>:</emphasis> | ||
2893 | Sets an alternate serial port. | ||
2894 | Or, turns off serial when the variable is set with an | ||
2895 | empty string.</para></listitem> | ||
2896 | <listitem><para><emphasis><link linkend='var-SYSLINUX_SERIAL_TTY'><filename>SYSLINUX_SERIAL_TTY</filename></link>:</emphasis> | ||
2897 | Sets an alternate "console=tty..." kernel boot argument. | ||
2898 | </para></listitem> | ||
2899 | </itemizedlist> | ||
2900 | </para> | ||
2901 | </section> | ||
2902 | |||
2903 | <section id='ref-classes-systemd'> | ||
2904 | <title><filename>systemd.bbclass</filename></title> | ||
2905 | |||
2906 | <para> | ||
2907 | The <filename>systemd</filename> class provides support for recipes | ||
2908 | that install systemd unit files. | ||
2909 | </para> | ||
2910 | |||
2911 | <para> | ||
2912 | The functionality for this class is disabled unless you have "systemd" | ||
2913 | in | ||
2914 | <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>. | ||
2915 | </para> | ||
2916 | |||
2917 | <para> | ||
2918 | Under this class, the recipe or Makefile (i.e. whatever the recipe is | ||
2919 | calling during the | ||
2920 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
2921 | task) installs unit files into | ||
2922 | <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}${systemd_unitdir}/system</filename>. | ||
2923 | If the unit files being installed go into packages other than the | ||
2924 | main package, you need to set | ||
2925 | <link linkend='var-SYSTEMD_PACKAGES'><filename>SYSTEMD_PACKAGES</filename></link> | ||
2926 | in your recipe to identify the packages in which the files will be | ||
2927 | installed. | ||
2928 | </para> | ||
2929 | |||
2930 | <para> | ||
2931 | You should set | ||
2932 | <link linkend='var-SYSTEMD_SERVICE'><filename>SYSTEMD_SERVICE</filename></link> | ||
2933 | to the name of the service file. | ||
2934 | You should also use a package name override to indicate the package | ||
2935 | to which the value applies. | ||
2936 | If the value applies to the recipe's main package, use | ||
2937 | <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename>. | ||
2938 | Here is an example from the connman recipe: | ||
2939 | <literallayout class='monospaced'> | ||
2940 | SYSTEMD_SERVICE_${PN} = "connman.service" | ||
2941 | </literallayout> | ||
2942 | Services are set up to start on boot automatically unless | ||
2943 | you have set | ||
2944 | <link linkend='var-SYSTEMD_AUTO_ENABLE'><filename>SYSTEMD_AUTO_ENABLE</filename></link> | ||
2945 | to "disable". | ||
2946 | </para> | ||
2947 | |||
2948 | <para> | ||
2949 | For more information on <filename>systemd</filename>, see the | ||
2950 | "<ulink url='&YOCTO_DOCS_DEV_URL;#selecting-an-initialization-manager'>Selecting an Initialization Manager</ulink>" | ||
2951 | section in the Yocto Project Development Manual. | ||
2952 | </para> | ||
2953 | </section> | ||
2954 | |||
2955 | <section id='ref-classes-terminal'> | ||
2956 | <title><filename>terminal.bbclass</filename></title> | ||
2957 | |||
2958 | <para> | ||
2959 | The <filename>terminal</filename> class provides support for starting | ||
2960 | a terminal session. | ||
2961 | The | ||
2962 | <link linkend='var-OE_TERMINAL'><filename>OE_TERMINAL</filename></link> | ||
2963 | variable controls which terminal emulator is used for the session. | ||
2964 | </para> | ||
2965 | |||
2966 | <para> | ||
2967 | Other classes use the <filename>terminal</filename> class anywhere a | ||
2968 | separate terminal session needs to be started. | ||
2969 | For example, the | ||
2970 | <link linkend='ref-classes-patch'><filename>patch</filename></link> | ||
2971 | class assuming | ||
2972 | <link linkend='var-PATCHRESOLVE'><filename>PATCHRESOLVE</filename></link> | ||
2973 | is set to "user", the | ||
2974 | <link linkend='ref-classes-cml1'><filename>cml1</filename></link> | ||
2975 | class, and the | ||
2976 | <link linkend='ref-classes-devshell'><filename>devshell</filename></link> | ||
2977 | class all use the <filename>terminal</filename> class. | ||
2978 | </para> | ||
2979 | </section> | ||
2980 | |||
2981 | <section id='ref-classes-testimage'> | ||
2982 | <title><filename>testimage.bbclass</filename></title> | ||
2983 | |||
2984 | <para> | ||
2985 | The <filename>testimage</filename> class supports running automated | ||
2986 | tests against images using QEMU and on actual hardware. | ||
2987 | The class handles loading the tests and starting the image. | ||
2988 | </para> | ||
2989 | |||
2990 | <para> | ||
2991 | To use the class, you need to perform steps to set up the | ||
2992 | environment. | ||
2993 | The tests are commands that run on the target system over | ||
2994 | <filename>ssh</filename>. | ||
2995 | they are written in Python and make use of the | ||
2996 | <filename>unittest</filename> module. | ||
2997 | </para> | ||
2998 | |||
2999 | <para> | ||
3000 | For information on how to enable, run, and create new tests, see the | ||
3001 | "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>" | ||
3002 | section. | ||
3003 | </para> | ||
3004 | </section> | ||
3005 | |||
3006 | <section id='ref-classes-tinderclient'> | ||
3007 | <title><filename>tinderclient.bbclass</filename></title> | ||
3008 | |||
3009 | <para> | ||
3010 | The <filename>tinderclient</filename> class submits build results to | ||
3011 | an external Tinderbox instance. | ||
3012 | <note> | ||
3013 | This class is currently unmaintained. | ||
3014 | </note> | ||
3015 | </para> | ||
3016 | </section> | ||
3017 | |||
3018 | <section id='ref-classes-toaster'> | ||
3019 | <title><filename>toaster.bbclass</filename></title> | ||
3020 | |||
3021 | <para> | ||
3022 | The <filename>toaster</filename> class collects information about | ||
3023 | packages and images and sends them as events that the BitBake | ||
3024 | user interface can receive. | ||
3025 | The class is enabled when the Toaster user interface is running. | ||
3026 | </para> | ||
3027 | |||
3028 | <para> | ||
3029 | This class is not intended to be used directly. | ||
3030 | </para> | ||
3031 | </section> | ||
3032 | |||
3033 | <section id='ref-classes-toolchain-scripts'> | ||
3034 | <title><filename>toolchain-scripts.bbclass</filename></title> | ||
3035 | |||
3036 | <para> | ||
3037 | The <filename>toolchain-scripts</filename> class provides the scripts | ||
3038 | used for setting up the environment for installed SDKs. | ||
3039 | </para> | ||
3040 | </section> | ||
3041 | |||
3042 | <section id='ref-classes-typecheck'> | ||
3043 | <title><filename>typecheck.bbclass</filename></title> | ||
3044 | |||
3045 | <para> | ||
3046 | The <filename>typecheck</filename> class provides support for | ||
3047 | validating the values of variables set at the configuration level | ||
3048 | against their defined types. | ||
3049 | The OpenEmbedded build system allows you to define the type of a | ||
3050 | variable using the "type" varflag. | ||
3051 | Here is an example: | ||
3052 | <literallayout class='monospaced'> | ||
3053 | IMAGE_FEATURES[type] = "list" | ||
3054 | </literallayout> | ||
3055 | </para> | ||
3056 | </section> | ||
3057 | |||
3058 | <section id='ref-classes-uboot-config'> | ||
3059 | <title><filename>uboot-config.bbclass</filename></title> | ||
3060 | |||
3061 | <para> | ||
3062 | The <filename>uboot-config</filename> class provides support for | ||
3063 | U-Boot configuration for a machine. | ||
3064 | Specify the machine in your recipe as follows: | ||
3065 | <literallayout class='monospaced'> | ||
3066 | UBOOT_CONFIG ??= <default> | ||
3067 | UBOOT_CONFIG[foo] = "config,images" | ||
3068 | </literallayout> | ||
3069 | You can also specify the machine using this method: | ||
3070 | <literallayout class='monospaced'> | ||
3071 | UBOOT_MACHINE = "config" | ||
3072 | </literallayout> | ||
3073 | See the | ||
3074 | <link linkend='var-UBOOT_CONFIG'><filename>UBOOT_CONFIG</filename></link> | ||
3075 | and | ||
3076 | <link linkend='var-UBOOT_MACHINE'><filename>UBOOT_MACHINE</filename></link> | ||
3077 | variables for additional information. | ||
3078 | </para> | ||
3079 | </section> | ||
3080 | |||
3081 | <section id='ref-classes-update-alternatives'> | ||
3082 | <title><filename>update-alternatives.bbclass</filename></title> | ||
3083 | |||
3084 | <para> | ||
3085 | The <filename>update-alternatives</filename> class helps the | ||
3086 | alternatives system when multiple sources provide the same command. | ||
3087 | This situation occurs when several programs that have the same or | ||
3088 | similar function are installed with the same name. | ||
3089 | For example, the <filename>ar</filename> command is available from the | ||
3090 | <filename>busybox</filename>, <filename>binutils</filename> and | ||
3091 | <filename>elfutils</filename> packages. | ||
3092 | The <filename>update-alternatives</filename> class handles | ||
3093 | renaming the binaries so that multiple packages can be installed | ||
3094 | without conflicts. | ||
3095 | The <filename>ar</filename> command still works regardless of which | ||
3096 | packages are installed or subsequently removed. | ||
3097 | The class renames the conflicting binary in each package and symlinks | ||
3098 | the highest priority binary during installation or removal of packages. | ||
3099 | </para> | ||
3100 | |||
3101 | <para> | ||
3102 | To use this class, you need to define a number of variables: | ||
3103 | <itemizedlist> | ||
3104 | <listitem><para><link linkend='var-ALTERNATIVE'><filename>ALTERNATIVE</filename></link> | ||
3105 | </para></listitem> | ||
3106 | <listitem><para><link linkend='var-ALTERNATIVE_LINK_NAME'><filename>ALTERNATIVE_LINK_NAME</filename></link> | ||
3107 | </para></listitem> | ||
3108 | <listitem><para><link linkend='var-ALTERNATIVE_TARGET'><filename>ALTERNATIVE_TARGET</filename></link> | ||
3109 | </para></listitem> | ||
3110 | <listitem><para><link linkend='var-ALTERNATIVE_PRIORITY'><filename>ALTERNATIVE_PRIORITY</filename></link> | ||
3111 | </para></listitem> | ||
3112 | </itemizedlist> | ||
3113 | These variables list alternative commands needed by a package, | ||
3114 | provide pathnames for links, default links for targets, and | ||
3115 | so forth. | ||
3116 | For details on how to use this class, see the comments in the | ||
3117 | <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/classes/update-alternatives.bbclass'><filename>update-alternatives.bbclass</filename></ulink>. | ||
3118 | </para> | ||
3119 | |||
3120 | <note> | ||
3121 | You can use the <filename>update-alternatives</filename> command | ||
3122 | directly in your recipes. | ||
3123 | However, this class simplifies things in most cases. | ||
3124 | </note> | ||
3125 | </section> | ||
3126 | |||
3127 | <section id='ref-classes-update-rc.d'> | ||
3128 | <title><filename>update-rc.d.bbclass</filename></title> | ||
3129 | |||
3130 | <para> | ||
3131 | The <filename>update-rc.d</filename> class uses | ||
3132 | <filename>update-rc.d</filename> to safely install an | ||
3133 | initialization script on behalf of the package. | ||
3134 | The OpenEmbedded build system takes care of details such as making | ||
3135 | sure the script is stopped before a package is removed and started when | ||
3136 | the package is installed. | ||
3137 | </para> | ||
3138 | |||
3139 | <para> | ||
3140 | Three variables control this class: | ||
3141 | <filename><link linkend='var-INITSCRIPT_PACKAGES'>INITSCRIPT_PACKAGES</link></filename>, | ||
3142 | <filename><link linkend='var-INITSCRIPT_NAME'>INITSCRIPT_NAME</link></filename> and | ||
3143 | <filename><link linkend='var-INITSCRIPT_PARAMS'>INITSCRIPT_PARAMS</link></filename>. | ||
3144 | See the variable links for details. | ||
3145 | </para> | ||
3146 | </section> | ||
3147 | |||
3148 | <section id='ref-classes-useradd'> | ||
3149 | <title><filename>useradd.bbclass</filename></title> | ||
3150 | |||
3151 | <para> | ||
3152 | The <filename>useradd</filename> class supports the addition of users | ||
3153 | or groups for usage by the package on the target. | ||
3154 | For example, if you have packages that contain system services that | ||
3155 | should be run under their own user or group, you can use this class to | ||
3156 | enable creation of the user or group. | ||
3157 | The <filename>meta-skeleton/recipes-skeleton/useradd/useradd-example.bb</filename> | ||
3158 | recipe in the <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
3159 | provides a simple example that shows how to add three | ||
3160 | users and groups to two packages. | ||
3161 | See the <filename>useradd-example.bb</filename> recipe for more | ||
3162 | information on how to use this class. | ||
3163 | </para> | ||
3164 | |||
3165 | <para> | ||
3166 | The <filename>useradd</filename> class supports the | ||
3167 | <link linkend='var-USERADD_PACKAGES'><filename>USERADD_PACKAGES</filename></link>, | ||
3168 | <link linkend='var-USERADD_PARAM'><filename>USERADD_PARAM</filename></link>, | ||
3169 | <link linkend='var-GROUPADD_PARAM'><filename>GROUPADD_PARAM</filename></link>, | ||
3170 | and | ||
3171 | <link linkend='var-GROUPMEMS_PARAM'><filename>GROUPMEMS_PARAM</filename></link> | ||
3172 | variables. | ||
3173 | </para> | ||
3174 | </section> | ||
3175 | |||
3176 | <section id='ref-classes-useradd-staticids'> | ||
3177 | <title><filename>useradd-staticids.bbclass</filename></title> | ||
3178 | |||
3179 | <para> | ||
3180 | The <filename>useradd-staticids</filename> class supports the addition | ||
3181 | of users or groups that have static user identification | ||
3182 | (<filename>uid</filename>) and group identification | ||
3183 | (<filename>gid</filename>) values. | ||
3184 | </para> | ||
3185 | |||
3186 | <para> | ||
3187 | The default behavior of the OpenEmbedded build system for assigning | ||
3188 | <filename>uid</filename> and <filename>gid</filename> values when | ||
3189 | packages add users and groups during package install time is to | ||
3190 | add them dynamically. | ||
3191 | This works fine for programs that do not care what the values of the | ||
3192 | resulting users and groups become. | ||
3193 | In these cases, the order of the installation determines the final | ||
3194 | <filename>uid</filename> and <filename>gid</filename> values. | ||
3195 | However, if non-deterministic | ||
3196 | <filename>uid</filename> and <filename>gid</filename> values are a | ||
3197 | problem, you can override the default, dynamic application of these | ||
3198 | values by setting static values. | ||
3199 | When you set static values, the OpenEmbedded build system looks in | ||
3200 | <link linkend='var-BBPATH'><filename>BBPATH</filename></link> for | ||
3201 | <filename>files/passwd</filename> and <filename>files/group</filename> | ||
3202 | files for the values. | ||
3203 | </para> | ||
3204 | |||
3205 | <para> | ||
3206 | To use static <filename>uid</filename> and <filename>gid</filename> | ||
3207 | values, you need to set some variables. | ||
3208 | See the | ||
3209 | <link linkend='var-USERADDEXTENSION'><filename>USERADDEXTENSION</filename></link>, | ||
3210 | <link linkend='var-USERADD_UID_TABLES'><filename>USERADD_UID_TABLES</filename></link>, | ||
3211 | <link linkend='var-USERADD_GID_TABLES'><filename>USERADD_GID_TABLES</filename></link>, | ||
3212 | and | ||
3213 | <link linkend='var-USERADD_ERROR_DYNAMIC'><filename>USERADD_ERROR_DYNAMIC</filename></link> | ||
3214 | variables. | ||
3215 | You can also see the | ||
3216 | <link linkend='ref-classes-useradd'><filename>useradd</filename></link> | ||
3217 | class for additional information. | ||
3218 | </para> | ||
3219 | |||
3220 | <note><title>Notes</title> | ||
3221 | You do not use this class directly. | ||
3222 | You either enable or disable the class by setting the | ||
3223 | <filename>USERADDEXTENSION</filename> variable. | ||
3224 | If you enable or disable the class in a configured system, | ||
3225 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link> | ||
3226 | might contain incorrect <filename>uid</filename> and | ||
3227 | <filename>gid</filename> values. | ||
3228 | Deleting the <filename>TMPDIR</filename> directory | ||
3229 | will correct this condition. | ||
3230 | </note> | ||
3231 | </section> | ||
3232 | |||
3233 | <section id='ref-classes-utility-tasks'> | ||
3234 | <title><filename>utility-tasks.bbclass</filename></title> | ||
3235 | |||
3236 | <para> | ||
3237 | The <filename>utility-tasks</filename> class provides support for | ||
3238 | various "utility" type tasks that are applicable to all recipes, | ||
3239 | such as | ||
3240 | <link linkend='ref-tasks-clean'><filename>do_clean</filename></link> and | ||
3241 | <link linkend='ref-tasks-listtasks'><filename>do_listtasks</filename></link>. | ||
3242 | </para> | ||
3243 | |||
3244 | <para> | ||
3245 | This class is enabled by default because it is inherited by | ||
3246 | the | ||
3247 | <link linkend='ref-classes-base'><filename>base</filename></link> | ||
3248 | class. | ||
3249 | </para> | ||
3250 | </section> | ||
3251 | |||
3252 | <section id='ref-classes-utils'> | ||
3253 | <title><filename>utils.bbclass</filename></title> | ||
3254 | |||
3255 | <para> | ||
3256 | The <filename>utils</filename> class provides some useful Python | ||
3257 | functions that are typically used in inline Python expressions | ||
3258 | (e.g. <filename>${@...}</filename>). | ||
3259 | One example use is for <filename>bb.utils.contains()</filename>. | ||
3260 | </para> | ||
3261 | |||
3262 | <para> | ||
3263 | This class is enabled by default because it is inherited by the | ||
3264 | <link linkend='ref-classes-base'><filename>base</filename></link> | ||
3265 | class. | ||
3266 | </para> | ||
3267 | </section> | ||
3268 | |||
3269 | <section id='ref-classes-vala'> | ||
3270 | <title><filename>vala.bbclass</filename></title> | ||
3271 | |||
3272 | <para> | ||
3273 | The <filename>vala</filename> class supports recipes that need to | ||
3274 | build software written using the Vala programming language. | ||
3275 | </para> | ||
3276 | </section> | ||
3277 | |||
3278 | <section id='ref-classes-waf'> | ||
3279 | <title><filename>waf.bbclass</filename></title> | ||
3280 | |||
3281 | <para> | ||
3282 | The <filename>waf</filename> class supports recipes that need to build | ||
3283 | software that uses the Waf build system. | ||
3284 | You can use the | ||
3285 | <link linkend='var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></link> | ||
3286 | variable to specify additional configuration options to be passed on | ||
3287 | the Waf command line. | ||
3288 | </para> | ||
3289 | </section> | ||
3290 | |||
3291 | <!-- Undocumented classes are: | ||
3292 | image-empty.bbclass (possibly being dropped) | ||
3293 | migrate_localcount.bbclass (still need a description) | ||
3294 | --> | ||
3295 | |||
3296 | |||
3297 | </chapter> | ||
3298 | <!-- | ||
3299 | vim: expandtab tw=80 ts=4 | ||
3300 | --> | ||
diff --git a/documentation/ref-manual/ref-features.xml b/documentation/ref-manual/ref-features.xml new file mode 100644 index 0000000..4aafaea --- /dev/null +++ b/documentation/ref-manual/ref-features.xml | |||
@@ -0,0 +1,346 @@ | |||
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 | |||
5 | <chapter id='ref-features'> | ||
6 | <title>Features</title> | ||
7 | |||
8 | <para> | ||
9 | This chapter provides a reference of shipped machine and distro features | ||
10 | you can include as part of the image, a reference on image types you can | ||
11 | build, and a reference on feature backfilling. | ||
12 | </para> | ||
13 | |||
14 | <para> | ||
15 | Features provide a mechanism for working out which packages | ||
16 | should be included in the generated images. | ||
17 | Distributions can select which features they want to support through the | ||
18 | <filename><link linkend='var-DISTRO_FEATURES'>DISTRO_FEATURES</link></filename> | ||
19 | variable, which is set in the <filename>poky.conf</filename> distribution configuration file. | ||
20 | Machine features are set in the | ||
21 | <filename><link linkend='var-MACHINE_FEATURES'>MACHINE_FEATURES</link></filename> | ||
22 | variable, which is set in the machine configuration file and | ||
23 | specifies the hardware features for a given machine. | ||
24 | </para> | ||
25 | |||
26 | <para> | ||
27 | These two variables combine to work out which kernel modules, | ||
28 | utilities, and other packages to include. | ||
29 | A given distribution can support a selected subset of features so some machine features might not | ||
30 | be included if the distribution itself does not support them. | ||
31 | </para> | ||
32 | |||
33 | <para> | ||
34 | One method you can use to determine which recipes are checking to see if a | ||
35 | particular feature is contained or not is to <filename>grep</filename> through | ||
36 | the <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> | ||
37 | for the feature. | ||
38 | Here is an example that discovers the recipes whose build is potentially | ||
39 | changed based on a given feature: | ||
40 | <literallayout class='monospaced'> | ||
41 | $ cd poky | ||
42 | $ git grep 'contains.*MACHINE_FEATURES.*<feature>' | ||
43 | </literallayout> | ||
44 | </para> | ||
45 | |||
46 | <section id='ref-features-machine'> | ||
47 | <title>Machine Features</title> | ||
48 | |||
49 | <para> | ||
50 | The items below are features you can use with | ||
51 | <link linkend='var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></link>. | ||
52 | Features do not have a one-to-one correspondence to packages, and they can | ||
53 | go beyond simply controlling the installation of a package or packages. | ||
54 | Sometimes a feature can influence how certain recipes are built. | ||
55 | For example, a feature might determine whether a particular configure option | ||
56 | is specified within the | ||
57 | <link linkend='ref-tasks-configure'><filename>do_configure</filename></link> | ||
58 | task for a particular recipe. | ||
59 | </para> | ||
60 | |||
61 | <para> | ||
62 | This feature list only represents features as shipped with the Yocto Project metadata: | ||
63 | <itemizedlist> | ||
64 | <listitem><para><emphasis>acpi:</emphasis> Hardware has ACPI (x86/x86_64 only) | ||
65 | </para></listitem> | ||
66 | <listitem><para><emphasis>alsa:</emphasis> Hardware has ALSA audio drivers | ||
67 | </para></listitem> | ||
68 | <listitem><para><emphasis>apm:</emphasis> Hardware uses APM (or APM emulation) | ||
69 | </para></listitem> | ||
70 | <listitem><para><emphasis>bluetooth:</emphasis> Hardware has integrated BT | ||
71 | </para></listitem> | ||
72 | <listitem><para><emphasis>ext2:</emphasis> Hardware HDD or Microdrive | ||
73 | </para></listitem> | ||
74 | <listitem><para><emphasis>irda:</emphasis> Hardware has IrDA support | ||
75 | </para></listitem> | ||
76 | <listitem><para><emphasis>keyboard:</emphasis> Hardware has a keyboard | ||
77 | </para></listitem> | ||
78 | <listitem><para><emphasis>pci:</emphasis> Hardware has a PCI bus | ||
79 | </para></listitem> | ||
80 | <listitem><para><emphasis>pcmcia:</emphasis> Hardware has PCMCIA or CompactFlash sockets | ||
81 | </para></listitem> | ||
82 | <listitem><para><emphasis>screen:</emphasis> Hardware has a screen | ||
83 | </para></listitem> | ||
84 | <listitem><para><emphasis>serial:</emphasis> Hardware has serial support (usually RS232) | ||
85 | </para></listitem> | ||
86 | <listitem><para><emphasis>touchscreen:</emphasis> Hardware has a touchscreen | ||
87 | </para></listitem> | ||
88 | <listitem><para><emphasis>usbgadget:</emphasis> Hardware is USB gadget device capable | ||
89 | </para></listitem> | ||
90 | <listitem><para><emphasis>usbhost:</emphasis> Hardware is USB Host capable | ||
91 | </para></listitem> | ||
92 | <listitem><para><emphasis>wifi:</emphasis> Hardware has integrated WiFi | ||
93 | </para></listitem> | ||
94 | </itemizedlist> | ||
95 | </para> | ||
96 | </section> | ||
97 | |||
98 | <section id='ref-features-distro'> | ||
99 | <title>Distro Features</title> | ||
100 | |||
101 | <para> | ||
102 | The items below are features you can use with | ||
103 | <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link> | ||
104 | to enable features across your distribution. | ||
105 | Features do not have a one-to-one correspondence to packages, | ||
106 | and they can go beyond simply controlling the installation of a | ||
107 | package or packages. | ||
108 | In most cases, the presence or absence of a feature translates to | ||
109 | the appropriate option supplied to the configure script during the | ||
110 | <link linkend='ref-tasks-configure'><filename>do_configure</filename></link> | ||
111 | task for the recipes that optionally | ||
112 | support the feature. | ||
113 | </para> | ||
114 | |||
115 | <para> | ||
116 | Some distro features are also machine features. | ||
117 | These select features make sense to be controlled both at | ||
118 | the machine and distribution configuration level. | ||
119 | See the | ||
120 | <ulink url='&YOCTO_DOCS_REF_URL;#var-COMBINED_FEATURES'><filename>COMBINED_FEATURES</filename></ulink> | ||
121 | variable for more information. | ||
122 | </para> | ||
123 | |||
124 | <para> | ||
125 | This list only represents features as shipped with the Yocto Project metadata: | ||
126 | <itemizedlist> | ||
127 | <listitem><para><emphasis>alsa:</emphasis> Include ALSA support | ||
128 | (OSS compatibility kernel modules installed if available). | ||
129 | </para></listitem> | ||
130 | <listitem><para><emphasis>bluetooth:</emphasis> Include | ||
131 | bluetooth support (integrated BT only).</para></listitem> | ||
132 | <listitem><para><emphasis>cramfs:</emphasis> Include CramFS | ||
133 | support.</para></listitem> | ||
134 | <listitem><para><emphasis>directfb:</emphasis> | ||
135 | Include DirectFB support. | ||
136 | </para></listitem> | ||
137 | <listitem><para><emphasis>ext2:</emphasis> Include tools for | ||
138 | supporting for devices with internal HDD/Microdrive for | ||
139 | storing files (instead of Flash only devices). | ||
140 | </para></listitem> | ||
141 | <listitem><para><emphasis>ipsec:</emphasis> Include IPSec | ||
142 | support.</para></listitem> | ||
143 | <listitem><para><emphasis>ipv6:</emphasis> Include IPv6 support. | ||
144 | </para></listitem> | ||
145 | <listitem><para><emphasis>irda:</emphasis> Include IrDA support. | ||
146 | </para></listitem> | ||
147 | <listitem><para><emphasis>keyboard:</emphasis> Include keyboard | ||
148 | support (e.g. keymaps will be loaded during boot). | ||
149 | </para></listitem> | ||
150 | <listitem><para><emphasis>nfs:</emphasis> Include NFS client | ||
151 | support (for mounting NFS exports on device). | ||
152 | </para></listitem> | ||
153 | <listitem><para><emphasis>opengl:</emphasis> | ||
154 | Include the Open Graphics Library, which is a | ||
155 | cross-language, multi-platform application programming | ||
156 | interface used for rendering two and three-dimensional | ||
157 | graphics.</para></listitem> | ||
158 | <listitem><para><emphasis>pci:</emphasis> Include PCI bus | ||
159 | support.</para></listitem> | ||
160 | <listitem><para><emphasis>pcmcia:</emphasis> Include | ||
161 | PCMCIA/CompactFlash support.</para></listitem> | ||
162 | <listitem><para><emphasis>ppp:</emphasis> Include PPP dialup | ||
163 | support.</para></listitem> | ||
164 | <listitem><para><emphasis>smbfs:</emphasis> Include SMB networks | ||
165 | client support (for mounting Samba/Microsoft Windows shares | ||
166 | on device).</para></listitem> | ||
167 | <listitem><para><emphasis>systemd:</emphasis> Include support | ||
168 | for this <filename>init</filename> manager, which is a full | ||
169 | replacement of for <filename>init</filename> with parallel | ||
170 | starting of services, reduced shell overhead, and other | ||
171 | features. | ||
172 | This <filename>init</filename> manager is used by many | ||
173 | distributions.</para></listitem> | ||
174 | <listitem><para><emphasis>usbgadget:</emphasis> Include USB | ||
175 | Gadget Device support (for USB networking/serial/storage). | ||
176 | </para></listitem> | ||
177 | <listitem><para><emphasis>usbhost:</emphasis> Include USB Host | ||
178 | support (allows to connect external keyboard, mouse, | ||
179 | storage, network etc).</para></listitem> | ||
180 | <listitem><para><emphasis>wayland:</emphasis> Include the | ||
181 | Wayland display server protocol and the library that | ||
182 | supports it.</para></listitem> | ||
183 | <listitem><para><emphasis>wifi:</emphasis> Include WiFi support | ||
184 | (integrated only).</para></listitem> | ||
185 | <listitem><para><emphasis>x11:</emphasis> Include the X server | ||
186 | and libraries.</para></listitem> | ||
187 | </itemizedlist> | ||
188 | </para> | ||
189 | </section> | ||
190 | |||
191 | <section id='ref-features-image'> | ||
192 | <title>Image Features</title> | ||
193 | |||
194 | <para> | ||
195 | The contents of images generated by the OpenEmbedded build system can be controlled by the | ||
196 | <filename><link linkend='var-IMAGE_FEATURES'>IMAGE_FEATURES</link></filename> | ||
197 | and <filename><link linkend='var-EXTRA_IMAGE_FEATURES'>EXTRA_IMAGE_FEATURES</link></filename> | ||
198 | variables that you typically configure in your image recipes. | ||
199 | Through these variables, you can add several different | ||
200 | predefined packages such as development utilities or packages with debug | ||
201 | information needed to investigate application problems or profile applications. | ||
202 | </para> | ||
203 | |||
204 | <para> | ||
205 | Current list of | ||
206 | <filename>IMAGE_FEATURES</filename> contains the following: | ||
207 | <itemizedlist> | ||
208 | <listitem><para><emphasis>dbg-pkgs:</emphasis> Installs debug symbol packages for all packages | ||
209 | installed in a given image.</para></listitem> | ||
210 | <listitem><para><emphasis>dev-pkgs:</emphasis> Installs development packages (headers and | ||
211 | extra library links) for all packages installed in a given image.</para></listitem> | ||
212 | <listitem><para><emphasis>doc-pkgs:</emphasis> Installs documentation packages for all packages | ||
213 | installed in a given image.</para></listitem> | ||
214 | <listitem><para><emphasis>nfs-server:</emphasis> Installs an NFS server.</para></listitem> | ||
215 | <listitem><para><emphasis>read-only-rootfs:</emphasis> Creates | ||
216 | an image whose root filesystem is read-only. | ||
217 | See the | ||
218 | "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-read-only-root-filesystem'>Creating a Read-Only Root Filesystem</ulink>" | ||
219 | section in the Yocto Project Development Manual for more | ||
220 | information.</para></listitem> | ||
221 | <listitem><para><emphasis>splash:</emphasis> Enables showing a splash screen during boot. | ||
222 | By default, this screen is provided by <filename>psplash</filename>, which does | ||
223 | allow customization. | ||
224 | If you prefer to use an alternative splash screen package, you can do so by | ||
225 | setting the <filename>SPLASH</filename> variable | ||
226 | to a different package name (or names) within the image recipe or at the distro | ||
227 | configuration level.</para></listitem> | ||
228 | <listitem><para><emphasis>ssh-server-dropbear:</emphasis> Installs the Dropbear minimal | ||
229 | SSH server. | ||
230 | </para></listitem> | ||
231 | <listitem><para><emphasis>ssh-server-openssh:</emphasis> Installs the OpenSSH SSH server, | ||
232 | which is more full-featured than Dropbear. | ||
233 | Note that if both the OpenSSH SSH server and the Dropbear minimal SSH server | ||
234 | are present in <filename>IMAGE_FEATURES</filename>, then OpenSSH will take | ||
235 | precedence and Dropbear will not be installed.</para></listitem> | ||
236 | <listitem><para><emphasis>staticdev-pkgs:</emphasis> Installs static development | ||
237 | packages (i.e. static libraries containing <filename>*.a</filename> files) for all | ||
238 | packages installed in a given image.</para></listitem> | ||
239 | <listitem><para><emphasis>tools-debug:</emphasis> Installs debugging tools such as | ||
240 | <filename>strace</filename> and <filename>gdb</filename>. | ||
241 | For information on GDB, see the | ||
242 | "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-gdb-remotedebug'>Debugging With the GNU Project Debugger (GDB) Remotely</ulink>" | ||
243 | section in the Yocto Project Development Manual. | ||
244 | For information on tracing and profiling, see the | ||
245 | <ulink url='&YOCTO_DOCS_PROF_URL;'>Yocto Project Profiling and Tracing Manual</ulink>. | ||
246 | </para></listitem> | ||
247 | <listitem><para><emphasis>tools-profile:</emphasis> Installs profiling tools such as | ||
248 | <filename>oprofile</filename>, <filename>exmap</filename>, and | ||
249 | <filename>LTTng</filename>. | ||
250 | For general information on user-space tools, see the | ||
251 | "<ulink url='&YOCTO_DOCS_ADT_URL;#user-space-tools'>User-Space Tools</ulink>" | ||
252 | section in the Yocto Project Application Developer's Guide.</para></listitem> | ||
253 | <listitem><para><emphasis>tools-sdk:</emphasis> Installs a full SDK that runs on the device. | ||
254 | </para></listitem> | ||
255 | <listitem><para><emphasis>tools-testapps:</emphasis> Installs device testing tools (e.g. | ||
256 | touchscreen debugging).</para></listitem> | ||
257 | <listitem><para><emphasis>x11:</emphasis> Installs the X server</para></listitem> | ||
258 | <listitem><para><emphasis>x11-base:</emphasis> Installs the X server with a | ||
259 | minimal environment.</para></listitem> | ||
260 | <listitem><para><emphasis>x11-sato:</emphasis> Installs the OpenedHand Sato environment. | ||
261 | </para></listitem> | ||
262 | </itemizedlist> | ||
263 | </para> | ||
264 | </section> | ||
265 | |||
266 | <section id='ref-features-backfill'> | ||
267 | <title>Feature Backfilling</title> | ||
268 | |||
269 | <para> | ||
270 | Sometimes it is necessary in the OpenEmbedded build system to extend | ||
271 | <link linkend='var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></link> | ||
272 | or <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link> | ||
273 | to control functionality that was previously enabled and not able | ||
274 | to be disabled. | ||
275 | For these cases, we need to add an | ||
276 | additional feature item to appear in one of these variables, | ||
277 | but we do not want to force developers who have existing values | ||
278 | of the variables in their configuration to add the new feature | ||
279 | in order to retain the same overall level of functionality. | ||
280 | Thus, the OpenEmbedded build system has a mechanism to | ||
281 | automatically "backfill" these added features into existing | ||
282 | distro or machine configurations. | ||
283 | You can see the list of features for which this is done by | ||
284 | finding the | ||
285 | <link linkend='var-DISTRO_FEATURES_BACKFILL'><filename>DISTRO_FEATURES_BACKFILL</filename></link> | ||
286 | and <link linkend='var-MACHINE_FEATURES_BACKFILL'><filename>MACHINE_FEATURES_BACKFILL</filename></link> | ||
287 | variables in the <filename>meta/conf/bitbake.conf</filename> file. | ||
288 | </para> | ||
289 | |||
290 | <para> | ||
291 | Because such features are backfilled by default into all | ||
292 | configurations as described in the previous paragraph, developers | ||
293 | who wish to disable the new features need to be able to selectively | ||
294 | prevent the backfilling from occurring. | ||
295 | They can do this by adding the undesired feature or features to the | ||
296 | <link linkend='var-DISTRO_FEATURES_BACKFILL_CONSIDERED'><filename>DISTRO_FEATURES_BACKFILL_CONSIDERED</filename></link> | ||
297 | or <link linkend='var-MACHINE_FEATURES_BACKFILL_CONSIDERED'><filename>MACHINE_FEATURES_BACKFILL_CONSIDERED</filename></link> | ||
298 | variables for distro features and machine features respectively. | ||
299 | </para> | ||
300 | |||
301 | <para> | ||
302 | Here are two examples to help illustrate feature backfilling: | ||
303 | <itemizedlist> | ||
304 | <listitem><para><emphasis>The "pulseaudio" distro feature option</emphasis>: | ||
305 | Previously, PulseAudio support was enabled within the Qt and | ||
306 | GStreamer frameworks. | ||
307 | Because of this, the feature is backfilled and thus | ||
308 | enabled for all distros through the | ||
309 | <filename>DISTRO_FEATURES_BACKFILL</filename> | ||
310 | variable in the <filename>meta/conf/bitbake.conf</filename> file. | ||
311 | However, your distro needs to disable the feature. | ||
312 | You can disable the feature without affecting | ||
313 | other existing distro configurations that need PulseAudio support | ||
314 | by adding "pulseaudio" to | ||
315 | <filename>DISTRO_FEATURES_BACKFILL_CONSIDERED</filename> | ||
316 | in your distro's <filename>.conf</filename> file. | ||
317 | Adding the feature to this variable when it also | ||
318 | exists in the <filename>DISTRO_FEATURES_BACKFILL</filename> | ||
319 | variable prevents the build system from adding the feature to | ||
320 | your configuration's <filename>DISTRO_FEATURES</filename>, effectively disabling | ||
321 | the feature for that particular distro.</para></listitem> | ||
322 | <listitem><para><emphasis>The "rtc" machine feature option</emphasis>: | ||
323 | Previously, real time clock (RTC) support was enabled for all | ||
324 | target devices. | ||
325 | Because of this, the feature is backfilled and thus enabled | ||
326 | for all machines through the <filename>MACHINE_FEATURES_BACKFILL</filename> | ||
327 | variable in the <filename>meta/conf/bitbake.conf</filename> file. | ||
328 | However, your target device does not have this capability. | ||
329 | You can disable RTC support for your device without | ||
330 | affecting other machines that need RTC support | ||
331 | by adding the feature to your machine's | ||
332 | <filename>MACHINE_FEATURES_BACKFILL_CONSIDERED</filename> | ||
333 | list in the machine's <filename>.conf</filename> file. | ||
334 | Adding the feature to this variable when it also | ||
335 | exists in the <filename>MACHINE_FEATURES_BACKFILL</filename> | ||
336 | variable prevents the build system from adding the feature to | ||
337 | your configuration's <filename>MACHINE_FEATURES</filename>, effectively | ||
338 | disabling RTC support for that particular machine.</para></listitem> | ||
339 | </itemizedlist> | ||
340 | </para> | ||
341 | </section> | ||
342 | </chapter> | ||
343 | |||
344 | <!-- | ||
345 | vim: expandtab tw=80 ts=4 spell spelllang=en_gb | ||
346 | --> | ||
diff --git a/documentation/ref-manual/ref-images.xml b/documentation/ref-manual/ref-images.xml new file mode 100644 index 0000000..7727e0a --- /dev/null +++ b/documentation/ref-manual/ref-images.xml | |||
@@ -0,0 +1,166 @@ | |||
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 | |||
5 | <chapter id='ref-images'> | ||
6 | <title>Images</title> | ||
7 | |||
8 | <para> | ||
9 | The OpenEmbedded build system provides several example | ||
10 | images to satisfy different needs. | ||
11 | When you issue the <filename>bitbake</filename> command you provide a “top-level” recipe | ||
12 | that essentially begins the build for the type of image you want. | ||
13 | </para> | ||
14 | |||
15 | <note> | ||
16 | Building an image without GNU General Public License Version 3 (GPLv3) components | ||
17 | is only supported for minimal and base images. | ||
18 | Furthermore, if you are going to build an image using non-GPLv3 components, | ||
19 | you must make the following changes in the <filename>local.conf</filename> file | ||
20 | before using the BitBake command to build the minimal or base image: | ||
21 | <literallayout class='monospaced'> | ||
22 | 1. Comment out the EXTRA_IMAGE_FEATURES line | ||
23 | 2. Set INCOMPATIBLE_LICENSE = "GPLv3" | ||
24 | </literallayout> | ||
25 | </note> | ||
26 | |||
27 | <para> | ||
28 | From within the <filename>poky</filename> Git repository, use the following command to list | ||
29 | the supported images: | ||
30 | <literallayout class='monospaced'> | ||
31 | $ ls meta*/recipes*/images/*.bb | ||
32 | </literallayout> | ||
33 | These recipes reside in the <filename>meta/recipes-core/images</filename>, | ||
34 | <filename>meta/recipes-extended/images</filename>, | ||
35 | <filename>meta/recipes-graphics/images</filename>, | ||
36 | <filename>meta/recipes-qt/images</filename>, | ||
37 | <filename>meta/recipes-rt/images</filename>, | ||
38 | <filename>meta/recipes-sato/images</filename>, and | ||
39 | <filename>meta-skeleton/recipes-multilib/images</filename> directories | ||
40 | within the <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
41 | Although the recipe names are somewhat explanatory, here is a list that describes them: | ||
42 | </para> | ||
43 | |||
44 | <itemizedlist> | ||
45 | <listitem><para><emphasis><filename>build-appliance-image</filename>:</emphasis> | ||
46 | An example virtual machine that contains all the pieces required to | ||
47 | run builds using the build system as well as the build system itself. | ||
48 | You can boot and run the image using either the | ||
49 | <ulink url='http://www.vmware.com/products/player/overview.html'>VMware Player</ulink> | ||
50 | or <ulink url='http://www.vmware.com/products/workstation/overview.html'>VMware Workstation</ulink>. | ||
51 | For more information on this image, see the | ||
52 | <ulink url='&YOCTO_HOME_URL;/documentation/build-appliance'>Build Appliance</ulink> page on | ||
53 | the Yocto Project website.</para></listitem> | ||
54 | <listitem><para><emphasis><filename>core-image-base</filename>:</emphasis> | ||
55 | A console-only image that fully supports the target device hardware.</para></listitem> | ||
56 | <listitem><para><emphasis><filename>core-image-minimal</filename>:</emphasis> | ||
57 | A small image just capable of allowing a device to boot.</para></listitem> | ||
58 | <listitem><para><emphasis><filename>core-image-minimal-dev</filename>:</emphasis> | ||
59 | A <filename>core-image-minimal</filename> image suitable for development work | ||
60 | using the host. | ||
61 | The image includes headers and libraries you can use in a host development | ||
62 | environment. | ||
63 | </para></listitem> | ||
64 | <listitem><para id='images-core-image-minimal-initramfs'><emphasis><filename>core-image-minimal-initramfs</filename>:</emphasis> | ||
65 | A <filename>core-image-minimal</filename> image that has the Minimal RAM-based | ||
66 | Initial Root Filesystem (initramfs) as part of the kernel, | ||
67 | which allows the system to find the first “init” program more efficiently. | ||
68 | See the | ||
69 | <link linkend='var-PACKAGE_INSTALL'><filename>PACKAGE_INSTALL</filename></link> | ||
70 | variable for additional information helpful when working with | ||
71 | initramfs images. | ||
72 | </para></listitem> | ||
73 | <listitem><para><emphasis><filename>core-image-minimal-mtdutils</filename>:</emphasis> | ||
74 | A <filename>core-image-minimal</filename> image that has support | ||
75 | for the Minimal MTD Utilities, which let the user interact with the | ||
76 | MTD subsystem in the kernel to perform operations on flash devices. | ||
77 | </para></listitem> | ||
78 | <listitem><para><emphasis><filename>core-image-full-cmdline</filename>:</emphasis> | ||
79 | A console-only image with more full-featured Linux system | ||
80 | functionality installed.</para></listitem> | ||
81 | <listitem><para><emphasis><filename>core-image-lsb</filename>:</emphasis> | ||
82 | An image that conforms to the Linux Standard Base (LSB) | ||
83 | specification. | ||
84 | This image requires a distribution configuration that | ||
85 | enables LSB compliance (e.g. <filename>poky-lsb</filename>). | ||
86 | If you build <filename>core-image-lsb</filename> without that | ||
87 | configuration, the image will not be LSB-compliant. | ||
88 | </para></listitem> | ||
89 | <listitem><para><emphasis><filename>core-image-lsb-dev</filename>:</emphasis> | ||
90 | A <filename>core-image-lsb</filename> image that is suitable for development work | ||
91 | using the host. | ||
92 | The image includes headers and libraries you can use in a host development | ||
93 | environment. | ||
94 | This image requires a distribution configuration that | ||
95 | enables LSB compliance (e.g. <filename>poky-lsb</filename>). | ||
96 | If you build <filename>core-image-lsb-dev</filename> without that | ||
97 | configuration, the image will not be LSB-compliant. | ||
98 | </para></listitem> | ||
99 | <listitem><para><emphasis><filename>core-image-lsb-sdk</filename>:</emphasis> | ||
100 | A <filename>core-image-lsb</filename> that includes everything in | ||
101 | meta-toolchain but also includes development headers and libraries | ||
102 | to form a complete standalone SDK. | ||
103 | This image requires a distribution configuration that | ||
104 | enables LSB compliance (e.g. <filename>poky-lsb</filename>). | ||
105 | If you build <filename>core-image-lsb-sdk</filename> without that | ||
106 | configuration, the image will not be LSB-compliant. | ||
107 | This image is suitable for development using the target.</para></listitem> | ||
108 | <listitem><para><emphasis><filename>core-image-testmaster</filename>:</emphasis> | ||
109 | A "master" image designed to be used for automated runtime testing. | ||
110 | Provides a "known good" image that is deployed to a separate | ||
111 | partition so that you can boot into it and use it to deploy a | ||
112 | second image to be tested. | ||
113 | You can find more information about runtime testing in the | ||
114 | "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>" | ||
115 | section in the Yocto Project Development Manual. | ||
116 | </para></listitem> | ||
117 | <listitem><para><emphasis><filename>core-image-clutter</filename>:</emphasis> | ||
118 | An image with support for the Open GL-based toolkit Clutter, which enables development of | ||
119 | rich and animated graphical user interfaces.</para></listitem> | ||
120 | <listitem><para><emphasis><filename>core-image-directfb</filename>:</emphasis> | ||
121 | An image that uses <filename>directfb</filename> instead of X11. | ||
122 | </para></listitem> | ||
123 | <listitem><para><emphasis><filename>core-image-x11</filename>:</emphasis> | ||
124 | A very basic X11 image with a terminal. | ||
125 | </para></listitem> | ||
126 | <listitem><para><emphasis><filename>core-image-weston</filename>:</emphasis> | ||
127 | A very basic Wayland image with a terminal. | ||
128 | This image provides the Wayland protocol libraries and the | ||
129 | reference Weston compositor. | ||
130 | For more information, see the | ||
131 | "<link linkend='wayland'>Wayland</link>" section. | ||
132 | </para></listitem> | ||
133 | <listitem><para><emphasis><filename>qt4e-demo-image</filename>:</emphasis> | ||
134 | An image that launches into the demo application for the embedded | ||
135 | (not based on X11) version of Qt.</para></listitem> | ||
136 | <listitem><para><emphasis><filename>core-image-rt</filename>:</emphasis> | ||
137 | A <filename>core-image-minimal</filename> image plus a real-time test suite and | ||
138 | tools appropriate for real-time use.</para></listitem> | ||
139 | <listitem><para><emphasis><filename>core-image-rt-sdk</filename>:</emphasis> | ||
140 | A <filename>core-image-rt</filename> image that includes everything in | ||
141 | <filename>meta-toolchain</filename>. | ||
142 | The image also includes development headers and libraries to form a complete | ||
143 | stand-alone SDK and is suitable for development using the target. | ||
144 | </para></listitem> | ||
145 | <listitem><para><emphasis><filename>core-image-sato</filename>:</emphasis> | ||
146 | An image with Sato support, a mobile environment and visual style that works well | ||
147 | with mobile devices. | ||
148 | The image supports X11 with a Sato theme and applications such as | ||
149 | a terminal, editor, file manager, media player, and so forth. | ||
150 | </para></listitem> | ||
151 | <listitem><para><emphasis><filename>core-image-sato-dev</filename>:</emphasis> | ||
152 | A <filename>core-image-sato</filename> image suitable for development | ||
153 | using the host. | ||
154 | The image includes libraries needed to build applications on the device itself, | ||
155 | testing and profiling tools, and debug symbols. | ||
156 | This image was formerly <filename>core-image-sdk</filename>. | ||
157 | </para></listitem> | ||
158 | <listitem><para><emphasis><filename>core-image-sato-sdk</filename>:</emphasis> | ||
159 | A <filename>core-image-sato</filename> image that includes everything in meta-toolchain. | ||
160 | The image also includes development headers and libraries to form a complete standalone SDK | ||
161 | and is suitable for development using the target.</para></listitem> | ||
162 | </itemizedlist> | ||
163 | </chapter> | ||
164 | <!-- | ||
165 | vim: expandtab tw=80 ts=4 | ||
166 | --> | ||
diff --git a/documentation/ref-manual/ref-manual-customization.xsl b/documentation/ref-manual/ref-manual-customization.xsl new file mode 100644 index 0000000..05c9b97 --- /dev/null +++ b/documentation/ref-manual/ref-manual-customization.xsl | |||
@@ -0,0 +1,20 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> | ||
3 | |||
4 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" /> | ||
5 | |||
6 | <xsl:include href="../template/permalinks.xsl"/> | ||
7 | <xsl:include href="../template/section.title.xsl"/> | ||
8 | <xsl:include href="../template/component.title.xsl"/> | ||
9 | <xsl:include href="../template/division.title.xsl"/> | ||
10 | <xsl:include href="../template/formal.object.heading.xsl"/> | ||
11 | <xsl:include href="../template/gloss-permalinks.xsl"/> | ||
12 | |||
13 | <xsl:param name="html.stylesheet" select="'ref-style.css'" /> | ||
14 | <xsl:param name="chapter.autolabel" select="1" /> | ||
15 | <xsl:param name="appendix.autolabel" select="A" /> | ||
16 | <xsl:param name="section.autolabel" select="1" /> | ||
17 | <xsl:param name="section.label.includes.component.label" select="1" /> | ||
18 | <xsl:param name="generate.id.attributes" select="1" /> | ||
19 | |||
20 | </xsl:stylesheet> | ||
diff --git a/documentation/ref-manual/ref-manual-eclipse-customization.xsl b/documentation/ref-manual/ref-manual-eclipse-customization.xsl new file mode 100644 index 0000000..4e6b799 --- /dev/null +++ b/documentation/ref-manual/ref-manual-eclipse-customization.xsl | |||
@@ -0,0 +1,27 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet | ||
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
4 | xmlns="http://www.w3.org/1999/xhtml" | ||
5 | xmlns:fo="http://www.w3.org/1999/XSL/Format" | ||
6 | version="1.0"> | ||
7 | |||
8 | <xsl:import | ||
9 | href="http://docbook.sourceforge.net/release/xsl/current/eclipse/eclipse3.xsl" /> | ||
10 | |||
11 | <xsl:param name="chunker.output.indent" select="'yes'"/> | ||
12 | <xsl:param name="chunk.quietly" select="1"/> | ||
13 | <xsl:param name="chunk.first.sections" select="1"/> | ||
14 | <xsl:param name="chunk.section.depth" select="10"/> | ||
15 | <xsl:param name="use.id.as.filename" select="1"/> | ||
16 | <xsl:param name="ulink.target" select="'_self'" /> | ||
17 | <xsl:param name="base.dir" select="'html/ref-manual/'"/> | ||
18 | <xsl:param name="html.stylesheet" select="'../book.css'"/> | ||
19 | <xsl:param name="eclipse.manifest" select="0"/> | ||
20 | <xsl:param name="create.plugin.xml" select="0"/> | ||
21 | <xsl:param name="suppress.navigation" select="1"/> | ||
22 | <xsl:param name="generate.index" select="0"/> | ||
23 | <xsl:param name="chapter.autolabel" select="1" /> | ||
24 | <xsl:param name="appendix.autolabel">A</xsl:param> | ||
25 | <xsl:param name="section.autolabel" select="1" /> | ||
26 | <xsl:param name="section.label.includes.component.label" select="1" /> | ||
27 | </xsl:stylesheet> | ||
diff --git a/documentation/ref-manual/ref-manual.xml b/documentation/ref-manual/ref-manual.xml new file mode 100644 index 0000000..3eff7de --- /dev/null +++ b/documentation/ref-manual/ref-manual.xml | |||
@@ -0,0 +1,150 @@ | |||
1 | <!DOCTYPE book 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 | |||
5 | <book id='ref-manual' lang='en' | ||
6 | xmlns:xi="http://www.w3.org/2003/XInclude" | ||
7 | xmlns="http://docbook.org/ns/docbook" | ||
8 | > | ||
9 | <bookinfo> | ||
10 | |||
11 | <mediaobject> | ||
12 | <imageobject> | ||
13 | <imagedata fileref='figures/poky-title.png' | ||
14 | format='SVG' | ||
15 | align='left' scalefit='1' width='100%'/> | ||
16 | </imageobject> | ||
17 | </mediaobject> | ||
18 | |||
19 | <title> | ||
20 | Yocto Project Reference Manual | ||
21 | </title> | ||
22 | |||
23 | <authorgroup> | ||
24 | <author> | ||
25 | <firstname>Richard</firstname> <surname>Purdie</surname> | ||
26 | <affiliation> | ||
27 | <orgname>Linux Foundation</orgname> | ||
28 | </affiliation> | ||
29 | <email>richard.purdie@linuxfoundation.org</email> | ||
30 | </author> | ||
31 | |||
32 | </authorgroup> | ||
33 | |||
34 | <revhistory> | ||
35 | <revision> | ||
36 | <revnumber>4.0+git</revnumber> | ||
37 | <date>24 November 2010</date> | ||
38 | <revremark>Released with the Yocto Project 0.9 Release</revremark> | ||
39 | </revision> | ||
40 | <revision> | ||
41 | <revnumber>1.0</revnumber> | ||
42 | <date>6 April 2011</date> | ||
43 | <revremark>Released with the Yocto Project 1.0 Release.</revremark> | ||
44 | </revision> | ||
45 | <revision> | ||
46 | <revnumber>1.0.1</revnumber> | ||
47 | <date>23 May 2011</date> | ||
48 | <revremark>Released with the Yocto Project 1.0.1 Release.</revremark> | ||
49 | </revision> | ||
50 | <revision> | ||
51 | <revnumber>1.1</revnumber> | ||
52 | <date>6 October 2011</date> | ||
53 | <revremark>Released with the Yocto Project 1.1 Release.</revremark> | ||
54 | </revision> | ||
55 | <revision> | ||
56 | <revnumber>1.2</revnumber> | ||
57 | <date>April 2012</date> | ||
58 | <revremark>Released with the Yocto Project 1.2 Release.</revremark> | ||
59 | </revision> | ||
60 | <revision> | ||
61 | <revnumber>1.3</revnumber> | ||
62 | <date>October 2012</date> | ||
63 | <revremark>Released with the Yocto Project 1.3 Release.</revremark> | ||
64 | </revision> | ||
65 | <revision> | ||
66 | <revnumber>1.4</revnumber> | ||
67 | <date>April 2013</date> | ||
68 | <revremark>Released with the Yocto Project 1.4 Release.</revremark> | ||
69 | </revision> | ||
70 | <revision> | ||
71 | <revnumber>1.5</revnumber> | ||
72 | <date>October 2013</date> | ||
73 | <revremark>Released with the Yocto Project 1.5 Release.</revremark> | ||
74 | </revision> | ||
75 | <revision> | ||
76 | <revnumber>1.5.1</revnumber> | ||
77 | <date>January 2014</date> | ||
78 | <revremark>Released with the Yocto Project 1.5.1 Release.</revremark> | ||
79 | </revision> | ||
80 | <revision> | ||
81 | <revnumber>1.6</revnumber> | ||
82 | <date>April 2014</date> | ||
83 | <revremark>Released with the Yocto Project 1.6 Release.</revremark> | ||
84 | </revision> | ||
85 | <revision> | ||
86 | <revnumber>1.7</revnumber> | ||
87 | <date>Fall of 2014</date> | ||
88 | <revremark>Released with the Yocto Project 1.7 Release.</revremark> | ||
89 | </revision> | ||
90 | </revhistory> | ||
91 | |||
92 | <copyright> | ||
93 | <year>©RIGHT_YEAR;</year> | ||
94 | <holder>Linux Foundation</holder> | ||
95 | </copyright> | ||
96 | |||
97 | <legalnotice> | ||
98 | <para> | ||
99 | Permission is granted to copy, distribute and/or modify this document under | ||
100 | the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England & Wales</ulink> as published by Creative Commons. | ||
101 | </para> | ||
102 | <note> | ||
103 | For the latest version of this manual associated with this | ||
104 | Yocto Project release, see the | ||
105 | <ulink url='&YOCTO_DOCS_REF_URL;'>Yocto Project Reference Manual</ulink> | ||
106 | from the Yocto Project website. | ||
107 | </note> | ||
108 | </legalnotice> | ||
109 | |||
110 | </bookinfo> | ||
111 | |||
112 | <xi:include href="introduction.xml"/> | ||
113 | |||
114 | <xi:include href="usingpoky.xml"/> | ||
115 | |||
116 | <xi:include href="closer-look.xml"/> | ||
117 | |||
118 | <xi:include href="technical-details.xml"/> | ||
119 | |||
120 | <xi:include href="migration.xml"/> | ||
121 | |||
122 | <xi:include href="ref-structure.xml"/> | ||
123 | |||
124 | <xi:include href="ref-classes.xml"/> | ||
125 | |||
126 | <xi:include href="ref-tasks.xml"/> | ||
127 | |||
128 | <xi:include href="ref-qa-checks.xml"/> | ||
129 | |||
130 | <xi:include href="ref-images.xml"/> | ||
131 | |||
132 | <xi:include href="ref-features.xml"/> | ||
133 | |||
134 | <xi:include href="ref-variables.xml"/> | ||
135 | |||
136 | <xi:include href="ref-varlocality.xml"/> | ||
137 | |||
138 | <xi:include href="faq.xml"/> | ||
139 | |||
140 | <xi:include href="resources.xml"/> | ||
141 | |||
142 | <!-- <index id='index'> | ||
143 | <title>Index</title> | ||
144 | </index> | ||
145 | --> | ||
146 | |||
147 | </book> | ||
148 | <!-- | ||
149 | vim: expandtab tw=80 ts=4 | ||
150 | --> | ||
diff --git a/documentation/ref-manual/ref-qa-checks.xml b/documentation/ref-manual/ref-qa-checks.xml new file mode 100644 index 0000000..43a0bd0 --- /dev/null +++ b/documentation/ref-manual/ref-qa-checks.xml | |||
@@ -0,0 +1,1151 @@ | |||
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 | |||
5 | <chapter id='ref-qa-checks'> | ||
6 | <title>QA Error and Warning Messages</title> | ||
7 | |||
8 | <section id='qa-introduction'> | ||
9 | <title>Introduction</title> | ||
10 | |||
11 | <para> | ||
12 | When building a recipe, the OpenEmbedded build system performs | ||
13 | various QA checks on the output to ensure that common issues are | ||
14 | detected and reported. | ||
15 | Sometimes when you create a new recipe to build new software, | ||
16 | it will build with no problems. | ||
17 | When this is not the case, or when you have QA issues building any | ||
18 | software, it could take a little time to resolve them. | ||
19 | </para> | ||
20 | |||
21 | <para> | ||
22 | While it is tempting to ignore a QA message or even to | ||
23 | disable QA checks, it is best to try and resolve any | ||
24 | reported QA issues. | ||
25 | This chapter provides a list of the QA messages and brief explanations | ||
26 | of the issues you could encounter so that you can properly resolve | ||
27 | problems. | ||
28 | </para> | ||
29 | |||
30 | <para> | ||
31 | The next section provides a list of all QA error and warning | ||
32 | messages based on a default configuration. | ||
33 | Each entry provides the message or error form along with an | ||
34 | explanation. | ||
35 | <note> | ||
36 | <title>Notes</title> | ||
37 | <itemizedlist> | ||
38 | <listitem><para> | ||
39 | At the end of each message, the name of the associated | ||
40 | QA test (as listed in the | ||
41 | "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>" | ||
42 | section) appears within square brackets. | ||
43 | </para></listitem> | ||
44 | <listitem><para> | ||
45 | As mentioned, this list of error and warning messages is for | ||
46 | QA checks only. | ||
47 | The list does not cover all possible build errors or | ||
48 | warnings you could encounter. | ||
49 | </para></listitem> | ||
50 | <listitem><para> | ||
51 | Because some QA checks are disabled by default, this list | ||
52 | does not include all possible QA check errors and warnings. | ||
53 | </para></listitem> | ||
54 | </itemizedlist> | ||
55 | </note> | ||
56 | </para> | ||
57 | </section> | ||
58 | |||
59 | <section id='qa-errors-and-warnings'> | ||
60 | <title>Errors and Warnings</title> | ||
61 | |||
62 | <para> | ||
63 | <itemizedlist> | ||
64 | <listitem> | ||
65 | <para> | ||
66 | <code> | ||
67 | <packagename>: <path> is using libexec please relocate to <libexecdir> [libexec] | ||
68 | </code> | ||
69 | </para> | ||
70 | |||
71 | <para> | ||
72 | The specified package contains files in | ||
73 | <filename>/usr/libexec</filename>. | ||
74 | By default, <filename>libexecdir</filename> is set to | ||
75 | "${libdir}/${BPN}" rather than to "/usr/libexec". | ||
76 | Thus, installing to <filename>/usr/libexec</filename> | ||
77 | is likely not desirable. | ||
78 | </para> | ||
79 | |||
80 | <para> | ||
81 | | ||
82 | </para> | ||
83 | </listitem> | ||
84 | </itemizedlist> | ||
85 | </para> | ||
86 | |||
87 | <para> | ||
88 | <itemizedlist> | ||
89 | <listitem> | ||
90 | <para> | ||
91 | <code> | ||
92 | package <packagename> contains bad RPATH <rpath> in file <file> [rpaths] | ||
93 | </code> | ||
94 | </para> | ||
95 | |||
96 | <para> | ||
97 | The specified binary produced by the recipe contains dynamic | ||
98 | library load paths (rpaths) that contain build system paths | ||
99 | such as | ||
100 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>, | ||
101 | which are incorrect for the target and could potentially | ||
102 | be a security issue. | ||
103 | Check for bad <filename>-rpath</filename> options being | ||
104 | passed to the linker in your | ||
105 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link> | ||
106 | log. | ||
107 | Depending on the build system used by the software being | ||
108 | built, there might be a configure option to disable rpath | ||
109 | usage completely within the build of the software. | ||
110 | </para> | ||
111 | |||
112 | <para> | ||
113 | | ||
114 | </para> | ||
115 | </listitem> | ||
116 | </itemizedlist> | ||
117 | </para> | ||
118 | |||
119 | <para> | ||
120 | <itemizedlist> | ||
121 | <listitem> | ||
122 | <para> | ||
123 | <code> | ||
124 | <packagename>: <file> contains probably-redundant RPATH <rpath> [useless-rpaths] | ||
125 | </code> | ||
126 | </para> | ||
127 | |||
128 | <para> | ||
129 | The specified binary produced by the recipe contains dynamic | ||
130 | library load paths (rpaths) that on a standard system are | ||
131 | searched by default by the linker (e.g. | ||
132 | <filename>/lib</filename> and <filename>/usr/lib</filename>). | ||
133 | While these paths will not cause any breakage, they do waste | ||
134 | space and are unnecessary. | ||
135 | Depending on the build system used by the software being | ||
136 | built, there might be a configure option to disable rpath | ||
137 | usage completely within the build of the software. | ||
138 | </para> | ||
139 | |||
140 | <para> | ||
141 | | ||
142 | </para> | ||
143 | </listitem> | ||
144 | </itemizedlist> | ||
145 | </para> | ||
146 | |||
147 | <para> | ||
148 | <itemizedlist> | ||
149 | <listitem> | ||
150 | <para> | ||
151 | <code> | ||
152 | non -dev/-dbg/-nativesdk package contains symlink .so: <packagename> path '<path>' [dev-so] | ||
153 | </code> | ||
154 | </para> | ||
155 | |||
156 | <para> | ||
157 | Symlink <filename>.so</filename> files are for development | ||
158 | only, and should therefore go into the | ||
159 | <filename>-dev</filename> package. | ||
160 | This situation might occur if you add | ||
161 | <filename>*.so*</filename> rather than | ||
162 | <filename>*.so.*</filename> to a non-dev package. | ||
163 | Change | ||
164 | <link linkend='var-FILES'><filename>FILES</filename></link> | ||
165 | (and possibly | ||
166 | <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>) | ||
167 | such that the specified <filename>.so</filename> file goes | ||
168 | into an appropriate <filename>-dev</filename> package. | ||
169 | </para> | ||
170 | |||
171 | <para> | ||
172 | | ||
173 | </para> | ||
174 | </listitem> | ||
175 | </itemizedlist> | ||
176 | </para> | ||
177 | |||
178 | <para> | ||
179 | <itemizedlist> | ||
180 | <listitem> | ||
181 | <para> | ||
182 | <code> | ||
183 | non -staticdev package contains static .a library: <packagename> path '<path>' [staticdev] | ||
184 | </code> | ||
185 | </para> | ||
186 | |||
187 | <para> | ||
188 | Static <filename>.a</filename> library files should go into | ||
189 | a <filename>-staticdev</filename> package. | ||
190 | Change | ||
191 | <link linkend='var-FILES'><filename>FILES</filename></link> | ||
192 | (and possibly | ||
193 | <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>) | ||
194 | such that the specified <filename>.a</filename> file goes | ||
195 | into an appropriate <filename>-staticdev</filename> package. | ||
196 | </para> | ||
197 | |||
198 | <para> | ||
199 | | ||
200 | </para> | ||
201 | </listitem> | ||
202 | </itemizedlist> | ||
203 | </para> | ||
204 | |||
205 | <para> | ||
206 | <itemizedlist> | ||
207 | <listitem> | ||
208 | <para> | ||
209 | <code> | ||
210 | <packagename>: found library in wrong location [libdir] | ||
211 | </code> | ||
212 | </para> | ||
213 | |||
214 | <para> | ||
215 | The specified file may have been installed into an incorrect | ||
216 | (possibly hardcoded) installation path. | ||
217 | For example, this test will catch recipes that install | ||
218 | <filename>/lib/bar.so</filename> when | ||
219 | <filename>${base_libdir}</filename> is "lib32". | ||
220 | Another example is when recipes install | ||
221 | <filename>/usr/lib64/foo.so</filename> when | ||
222 | <filename>${libdir}</filename> is "/usr/lib". | ||
223 | False positives occasionally exist. | ||
224 | For these cases add "libdir" to | ||
225 | <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link> | ||
226 | for the package. | ||
227 | </para> | ||
228 | |||
229 | <para> | ||
230 | | ||
231 | </para> | ||
232 | </listitem> | ||
233 | </itemizedlist> | ||
234 | </para> | ||
235 | |||
236 | <para> | ||
237 | <itemizedlist> | ||
238 | <listitem> | ||
239 | <para> | ||
240 | <code> | ||
241 | non debug package contains .debug directory: <packagename> path <path> [debug-files] | ||
242 | </code> | ||
243 | </para> | ||
244 | |||
245 | <para> | ||
246 | The specified package contains a | ||
247 | <filename>.debug</filename> directory, which should not | ||
248 | appear in anything but the <filename>-dbg</filename> | ||
249 | package. | ||
250 | This situation might occur if you add a path which contains | ||
251 | a <filename>.debug</filename> directory and do not | ||
252 | explicitly add the <filename>.debug</filename> directory | ||
253 | to the <filename>-dbg</filename> package. | ||
254 | If this is the case, add the <filename>.debug</filename> | ||
255 | directory explicitly to | ||
256 | <filename>FILES_${PN}-dbg</filename>. | ||
257 | See | ||
258 | <link linkend='var-FILES'><filename>FILES</filename></link> | ||
259 | for additional information on <filename>FILES</filename>. | ||
260 | </para> | ||
261 | |||
262 | <para> | ||
263 | | ||
264 | </para> | ||
265 | </listitem> | ||
266 | </itemizedlist> | ||
267 | </para> | ||
268 | |||
269 | <para> | ||
270 | <itemizedlist> | ||
271 | <listitem> | ||
272 | <para> | ||
273 | <code> | ||
274 | Architecture did not match (<machine_arch> to <file_arch>) on <file> | ||
275 | </code> | ||
276 | </para> | ||
277 | |||
278 | <para> | ||
279 | By default, the OpenEmbedded build system checks the | ||
280 | Executable and Linkable Format (ELF) type, bit size, and | ||
281 | endianness of any binaries to ensure they match the | ||
282 | target architecture. | ||
283 | This test fails if any binaries do not match the type since | ||
284 | there would be an incompatibility. | ||
285 | The test could indicate that the wrong compiler or compiler | ||
286 | options have been used. | ||
287 | Sometimes software, like bootloaders, might need to | ||
288 | bypass this check. | ||
289 | If the file you receive the error for is firmware | ||
290 | that is not intended to be executed within the target | ||
291 | operating system or is intended to run on a separate | ||
292 | processor within the device, you can add "arch" to | ||
293 | <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link> | ||
294 | for the package. | ||
295 | Another option is to check the | ||
296 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link> | ||
297 | log and verify that the compiler options being used | ||
298 | are correct. | ||
299 | </para> | ||
300 | |||
301 | <para> | ||
302 | | ||
303 | </para> | ||
304 | </listitem> | ||
305 | </itemizedlist> | ||
306 | </para> | ||
307 | |||
308 | <para> | ||
309 | <itemizedlist> | ||
310 | <listitem> | ||
311 | <para> | ||
312 | <code> | ||
313 | Bit size did not match (<machine_bits> to <file_bits>) <recipe> on <file> | ||
314 | </code> | ||
315 | </para> | ||
316 | |||
317 | <para> | ||
318 | By default, the OpenEmbedded build system checks | ||
319 | the Executable and Linkable Format (ELF) type, | ||
320 | bit size, and endianness of any binaries to ensure | ||
321 | they match the target architecture. | ||
322 | This test fails if any binaries do not match the type since | ||
323 | there would be an incompatibility. | ||
324 | The test could indicate that the wrong compiler or compiler | ||
325 | options have been used. | ||
326 | Sometimes software, like bootloaders, might need to | ||
327 | bypass this check. | ||
328 | If the file you receive the error for is firmware that | ||
329 | is not intended to be executed within the target | ||
330 | operating system or is intended to run on a separate | ||
331 | processor within the device, you can add "arch" to | ||
332 | <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link> | ||
333 | for the package. | ||
334 | Another option is to check the | ||
335 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link> | ||
336 | log and verify that the compiler options being used are | ||
337 | correct. | ||
338 | </para> | ||
339 | |||
340 | <para> | ||
341 | | ||
342 | </para> | ||
343 | </listitem> | ||
344 | </itemizedlist> | ||
345 | </para> | ||
346 | |||
347 | <para> | ||
348 | <itemizedlist> | ||
349 | <listitem> | ||
350 | <para> | ||
351 | <code> | ||
352 | Endianness did not match (<machine_endianness> to <file_endianness>) on <file> [arch] | ||
353 | </code> | ||
354 | </para> | ||
355 | |||
356 | <para> | ||
357 | By default, the OpenEmbedded build system checks | ||
358 | the Executable and Linkable Format (ELF) type, bit | ||
359 | size, and endianness of any binaries to ensure they | ||
360 | match the target architecture. | ||
361 | This test fails if any binaries do not match the type since | ||
362 | there would be an incompatibility. | ||
363 | The test could indicate that the wrong compiler or compiler | ||
364 | options have been used. | ||
365 | Sometimes software, like bootloaders, might need to | ||
366 | bypass this check. | ||
367 | If the file you receive the error for is firmware | ||
368 | that is not intended to be executed within the target | ||
369 | operating system or is intended to run on a separate | ||
370 | processor within the device, you can add "arch" to | ||
371 | <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link> | ||
372 | for the package. | ||
373 | Another option is to check the | ||
374 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link> | ||
375 | log and verify that the compiler options being used | ||
376 | are correct. | ||
377 | </para> | ||
378 | |||
379 | <para> | ||
380 | | ||
381 | </para> | ||
382 | </listitem> | ||
383 | </itemizedlist> | ||
384 | </para> | ||
385 | |||
386 | <para> | ||
387 | <itemizedlist> | ||
388 | <listitem> | ||
389 | <para> | ||
390 | <code> | ||
391 | ELF binary '<file>' has relocations in .text [textrel] | ||
392 | </code> | ||
393 | </para> | ||
394 | |||
395 | <para> | ||
396 | The specified ELF binary contains relocations in its | ||
397 | <filename>.text</filename> sections. | ||
398 | This situation can result in a performance impact | ||
399 | at runtime. | ||
400 | <note> | ||
401 | A bug currently exists that causes this | ||
402 | warning to appear erroneously. | ||
403 | See | ||
404 | <ulink url='https://bugzilla.yoctoproject.org/show_bug.cgi?id=6104'></ulink> | ||
405 | for more information. | ||
406 | </note> | ||
407 | </para> | ||
408 | |||
409 | <para> | ||
410 | | ||
411 | </para> | ||
412 | </listitem> | ||
413 | </itemizedlist> | ||
414 | </para> | ||
415 | |||
416 | <para> | ||
417 | <itemizedlist> | ||
418 | <listitem> | ||
419 | <para> | ||
420 | <code> | ||
421 | No GNU_HASH in the elf binary: '<file>' [ldflags] | ||
422 | </code> | ||
423 | </para> | ||
424 | |||
425 | <para> | ||
426 | This indicates that binaries produced when building the | ||
427 | recipe have not been linked with the | ||
428 | <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link> | ||
429 | options provided by the build system. | ||
430 | Check to be sure that the <filename>LDFLAGS</filename> | ||
431 | variable is being passed to the linker command. | ||
432 | A common workaround for this situation is to pass in | ||
433 | <filename>LDFLAGS</filename> using | ||
434 | <link linkend='var-TARGET_CC_ARCH'><filename>TARGET_CC_ARCH</filename></link> | ||
435 | within the recipe as follows: | ||
436 | <literallayout class='monospaced'> | ||
437 | TARGET_CC_ARCH += "${LDFLAGS}" | ||
438 | </literallayout> | ||
439 | </para> | ||
440 | |||
441 | <para> | ||
442 | | ||
443 | </para> | ||
444 | </listitem> | ||
445 | </itemizedlist> | ||
446 | </para> | ||
447 | |||
448 | <para> | ||
449 | <itemizedlist> | ||
450 | <listitem> | ||
451 | <para> | ||
452 | <code> | ||
453 | Package <packagename> contains Xorg driver (<driver>) but no xorg-abi- dependencies [xorg-driver-abi] | ||
454 | </code> | ||
455 | </para> | ||
456 | |||
457 | <para> | ||
458 | The specified package contains an Xorg driver, but does not | ||
459 | have a corresponding ABI package dependency. | ||
460 | The xserver-xorg recipe provides driver ABI names. | ||
461 | All drivers should depend on the ABI versions that they have | ||
462 | been built against. | ||
463 | Driver recipes that include | ||
464 | <filename>xorg-driver-input.inc</filename> or | ||
465 | <filename>xorg-driver-video.inc</filename> will | ||
466 | automatically get these versions. | ||
467 | Consequently, you should only need to explicitly add | ||
468 | dependencies to binary driver recipes. | ||
469 | </para> | ||
470 | |||
471 | <para> | ||
472 | | ||
473 | </para> | ||
474 | </listitem> | ||
475 | </itemizedlist> | ||
476 | </para> | ||
477 | |||
478 | <para> | ||
479 | <itemizedlist> | ||
480 | <listitem> | ||
481 | <para> | ||
482 | <code> | ||
483 | The /usr/share/info/dir file is not meant to be shipped in a particular package. [infodir] | ||
484 | </code> | ||
485 | </para> | ||
486 | |||
487 | <para> | ||
488 | The <filename>/usr/share/info/dir</filename> should not be | ||
489 | packaged. | ||
490 | Add the following line to your | ||
491 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
492 | task or to your <filename>do_install_append</filename> | ||
493 | within the recipe as follows: | ||
494 | <literallayout class='monospaced'> | ||
495 | rm ${D}${infodir}/dir | ||
496 | </literallayout> | ||
497 | </para> | ||
498 | |||
499 | <para> | ||
500 | | ||
501 | </para> | ||
502 | </listitem> | ||
503 | </itemizedlist> | ||
504 | </para> | ||
505 | |||
506 | <para> | ||
507 | <itemizedlist> | ||
508 | <listitem> | ||
509 | <para> | ||
510 | <code> | ||
511 | Symlink <path> in <packagename> points to TMPDIR [symlink-to-sysroot] | ||
512 | </code> | ||
513 | </para> | ||
514 | |||
515 | <para> | ||
516 | The specified symlink points into | ||
517 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link> | ||
518 | on the host. | ||
519 | Such symlinks will work on the host. | ||
520 | However, they are clearly invalid when running on | ||
521 | the target. | ||
522 | You should either correct the symlink to use a relative | ||
523 | path or remove the symlink. | ||
524 | </para> | ||
525 | |||
526 | <para> | ||
527 | | ||
528 | </para> | ||
529 | </listitem> | ||
530 | </itemizedlist> | ||
531 | </para> | ||
532 | |||
533 | <para> | ||
534 | <itemizedlist> | ||
535 | <listitem> | ||
536 | <para> | ||
537 | <code> | ||
538 | <file> failed sanity test (workdir) in path <path> [la] | ||
539 | </code> | ||
540 | </para> | ||
541 | |||
542 | <para> | ||
543 | The specified <filename>.la</filename> file contains | ||
544 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link> | ||
545 | paths. | ||
546 | Any <filename>.la</filename> file containing these paths | ||
547 | is incorrect since <filename>libtool</filename> adds the | ||
548 | correct sysroot prefix when using the files automatically | ||
549 | itself. | ||
550 | </para> | ||
551 | |||
552 | <para> | ||
553 | | ||
554 | </para> | ||
555 | </listitem> | ||
556 | </itemizedlist> | ||
557 | </para> | ||
558 | |||
559 | <para> | ||
560 | <itemizedlist> | ||
561 | <listitem> | ||
562 | <para> | ||
563 | <code> | ||
564 | <file> failed sanity test (tmpdir) in path <path> [pkgconfig] | ||
565 | </code> | ||
566 | </para> | ||
567 | |||
568 | <para> | ||
569 | The specified <filename>.pc</filename> file contains | ||
570 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link><filename>/</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link> | ||
571 | paths. | ||
572 | Any <filename>.pc</filename> file containing these paths is | ||
573 | incorrect since <filename>pkg-config</filename> itself adds | ||
574 | the correct sysroot prefix when the files are accessed. | ||
575 | </para> | ||
576 | |||
577 | <para> | ||
578 | | ||
579 | </para> | ||
580 | </listitem> | ||
581 | </itemizedlist> | ||
582 | </para> | ||
583 | |||
584 | <para> | ||
585 | <itemizedlist> | ||
586 | <listitem> | ||
587 | <para> | ||
588 | <code> | ||
589 | <packagename> rdepends on <debug_packagename> [debug-deps] | ||
590 | </code> | ||
591 | </para> | ||
592 | |||
593 | <para> | ||
594 | A dependency exists between the specified non-dbg package | ||
595 | (i.e. a package whose name does not end in | ||
596 | <filename>-dbg</filename>) and a package that is a | ||
597 | <filename>dbg</filename> package. | ||
598 | The <filename>dbg</filename> packages contain | ||
599 | debug symbols and are brought in using several | ||
600 | different methods: | ||
601 | <itemizedlist> | ||
602 | <listitem><para> | ||
603 | Using the <filename>dbg-pkgs</filename> | ||
604 | <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link> | ||
605 | value. | ||
606 | </para></listitem> | ||
607 | <listitem><para> | ||
608 | Using | ||
609 | <link linkend='var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></link>. | ||
610 | </para></listitem> | ||
611 | <listitem><para> | ||
612 | As a dependency of another | ||
613 | <filename>dbg</filename> package that was brought | ||
614 | in using one of the above methods. | ||
615 | </para></listitem> | ||
616 | </itemizedlist> | ||
617 | The dependency might have been automatically added | ||
618 | because the <filename>dbg</filename> package erroneously | ||
619 | contains files that it should not contain (e.g. a | ||
620 | non-symlink <filename>.so</filename> file) or it might | ||
621 | have been added manually (e.g. by adding to | ||
622 | <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>). | ||
623 | </para> | ||
624 | |||
625 | <para> | ||
626 | | ||
627 | </para> | ||
628 | </listitem> | ||
629 | </itemizedlist> | ||
630 | </para> | ||
631 | |||
632 | <para> | ||
633 | <itemizedlist> | ||
634 | <listitem> | ||
635 | <para> | ||
636 | <code> | ||
637 | <packagename> rdepends on <dev_packagename> [dev-deps] | ||
638 | </code> | ||
639 | </para> | ||
640 | |||
641 | <para> | ||
642 | A dependency exists between the specified non-dev package | ||
643 | (a package whose name does not end in | ||
644 | <filename>-dev</filename>) and a package that is a | ||
645 | <filename>dev</filename> package. | ||
646 | The <filename>dev</filename> packages contain development | ||
647 | headers and are usually brought in using several different | ||
648 | methods: | ||
649 | <itemizedlist> | ||
650 | <listitem><para> | ||
651 | Using the <filename>dev-pkgs</filename> | ||
652 | <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link> | ||
653 | value. | ||
654 | </para></listitem> | ||
655 | <listitem><para> | ||
656 | Using | ||
657 | <link linkend='var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></link>. | ||
658 | </para></listitem> | ||
659 | <listitem><para> | ||
660 | As a dependency of another | ||
661 | <filename>dev</filename> package that was brought | ||
662 | in using one of the above methods. | ||
663 | </para></listitem> | ||
664 | </itemizedlist> | ||
665 | The dependency might have been automatically added (because | ||
666 | the <filename>dev</filename> package erroneously contains | ||
667 | files that it should not have (e.g. a non-symlink | ||
668 | <filename>.so</filename> file) or it might have been added | ||
669 | manually (e.g. by adding to | ||
670 | <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>. | ||
671 | </para> | ||
672 | |||
673 | <para> | ||
674 | | ||
675 | </para> | ||
676 | </listitem> | ||
677 | </itemizedlist> | ||
678 | </para> | ||
679 | |||
680 | <para> | ||
681 | <itemizedlist> | ||
682 | <listitem> | ||
683 | <para> | ||
684 | <code> | ||
685 | <var>_<packagename> is invalid: <comparison> (<value>) only comparisons <, =, >, <=, and >= are allowed [dep-cmp] | ||
686 | </code> | ||
687 | </para> | ||
688 | |||
689 | <para> | ||
690 | If you are adding a versioned dependency relationship to one | ||
691 | of the dependency variables | ||
692 | (<link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>, | ||
693 | <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>, | ||
694 | <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>, | ||
695 | <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>, | ||
696 | <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>, | ||
697 | or | ||
698 | <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>), | ||
699 | you must only use the named comparison operators. | ||
700 | Change the versioned dependency values you are adding | ||
701 | to match those listed in the message. | ||
702 | </para> | ||
703 | |||
704 | <para> | ||
705 | | ||
706 | </para> | ||
707 | </listitem> | ||
708 | </itemizedlist> | ||
709 | </para> | ||
710 | |||
711 | <para> | ||
712 | <itemizedlist> | ||
713 | <listitem> | ||
714 | <para> | ||
715 | <code> | ||
716 | <recipename>: The compile log indicates that host include and/or library paths were used. Please check the log '<logfile>' for more information. [compile-host-path] | ||
717 | </code> | ||
718 | </para> | ||
719 | |||
720 | <para> | ||
721 | The log for the | ||
722 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link> | ||
723 | task indicates that paths on the host were searched | ||
724 | for files, which is not appropriate when cross-compiling. | ||
725 | Look for "is unsafe for cross-compilation" or "CROSS COMPILE | ||
726 | Badness" in the specified log file. | ||
727 | </para> | ||
728 | |||
729 | <para> | ||
730 | | ||
731 | </para> | ||
732 | </listitem> | ||
733 | </itemizedlist> | ||
734 | </para> | ||
735 | |||
736 | <para> | ||
737 | <itemizedlist> | ||
738 | <listitem> | ||
739 | <para> | ||
740 | <code> | ||
741 | <recipename>: The install log indicates that host include and/or library paths were used. Please check the log '<logfile>' for more information. [install-host-path] | ||
742 | </code> | ||
743 | </para> | ||
744 | |||
745 | <para> | ||
746 | The log for the | ||
747 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
748 | task indicates that paths on the host were searched | ||
749 | for files, which is not appropriate when cross-compiling. | ||
750 | Look for "is unsafe for cross-compilation" | ||
751 | or "CROSS COMPILE Badness" in the specified log file. | ||
752 | </para> | ||
753 | |||
754 | <para> | ||
755 | | ||
756 | </para> | ||
757 | </listitem> | ||
758 | </itemizedlist> | ||
759 | </para> | ||
760 | |||
761 | <para> | ||
762 | <itemizedlist> | ||
763 | <listitem> | ||
764 | <para> | ||
765 | <code> | ||
766 | This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities. Rerun configure task after fixing this. The path was '<path>' | ||
767 | </code> | ||
768 | </para> | ||
769 | |||
770 | <para> | ||
771 | The log for the | ||
772 | <link linkend='ref-tasks-configure'><filename>do_configure</filename></link> | ||
773 | task indicates that paths on the host were searched | ||
774 | for files, which is not appropriate when cross-compiling. | ||
775 | Look for "is unsafe for cross-compilation" or | ||
776 | "CROSS COMPILE Badness" in the specified log file. | ||
777 | </para> | ||
778 | |||
779 | <para> | ||
780 | | ||
781 | </para> | ||
782 | </listitem> | ||
783 | </itemizedlist> | ||
784 | </para> | ||
785 | |||
786 | <para> | ||
787 | <itemizedlist> | ||
788 | <listitem> | ||
789 | <para> | ||
790 | <code> | ||
791 | <packagename> doesn't match the [a-z0-9.+-]+ regex [pkgname] | ||
792 | </code> | ||
793 | </para> | ||
794 | |||
795 | <para> | ||
796 | The convention within the OpenEmbedded build system | ||
797 | (sometimes enforced by the package manager itself) is to | ||
798 | require that package names are all lower case | ||
799 | and to allow a restricted set of characters. | ||
800 | If your recipe name does not match this, or you add | ||
801 | packages to | ||
802 | <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link> | ||
803 | that do not conform to the convention, then you | ||
804 | will receive this error. | ||
805 | Rename your recipe. | ||
806 | Or, if you have added a non-conforming package name to | ||
807 | <filename>PACKAGES</filename>, change the package name | ||
808 | appropriately. | ||
809 | </para> | ||
810 | |||
811 | <para> | ||
812 | | ||
813 | </para> | ||
814 | </listitem> | ||
815 | </itemizedlist> | ||
816 | </para> | ||
817 | |||
818 | <para> | ||
819 | <itemizedlist> | ||
820 | <listitem> | ||
821 | <para> | ||
822 | <code> | ||
823 | <recipe>: configure was passed unrecognized options: <options> [unknown-configure-option] | ||
824 | </code> | ||
825 | </para> | ||
826 | |||
827 | <para> | ||
828 | The configure script is reporting that the specified | ||
829 | options are unrecognized. | ||
830 | This situation could be because the options | ||
831 | were previously valid but have been removed from the | ||
832 | configure script. | ||
833 | Or, there was a mistake when the options were added | ||
834 | and there is another option that should be used instead. | ||
835 | If you are unsure, consult the upstream build | ||
836 | documentation, the | ||
837 | <filename>./configure ‐‐help</filename> output, | ||
838 | and the upstream change log or release notes. | ||
839 | Once you have worked out what the appropriate | ||
840 | change is, you can update | ||
841 | <link linkend='var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></link> | ||
842 | or the individual | ||
843 | <link linkend='var-PACKAGECONFIG'><filename>PACKAGECONFIG</filename></link> | ||
844 | option values accordingly. | ||
845 | </para> | ||
846 | |||
847 | <para> | ||
848 | | ||
849 | </para> | ||
850 | </listitem> | ||
851 | </itemizedlist> | ||
852 | </para> | ||
853 | |||
854 | <para> | ||
855 | <itemizedlist> | ||
856 | <listitem> | ||
857 | <para> | ||
858 | <code> | ||
859 | Recipe <recipefile> has PN of "<recipename>" which is in OVERRIDES, this can result in unexpected behavior. [pn-overrides] | ||
860 | </code> | ||
861 | </para> | ||
862 | |||
863 | <para> | ||
864 | The specified recipe has a name | ||
865 | (<link linkend='var-PN'><filename>PN</filename></link>) | ||
866 | value that appears in | ||
867 | <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>. | ||
868 | If a recipe is named such that its <filename>PN</filename> | ||
869 | value matches something already in | ||
870 | <filename>OVERRIDES</filename> (e.g. <filename>PN</filename> | ||
871 | happens to be the same as | ||
872 | <link linkend='var-MACHINE'><filename>MACHINE</filename></link> | ||
873 | or | ||
874 | <link linkend='var-DISTRO'><filename>DISTRO</filename></link>), | ||
875 | it can have unexpected consequences. | ||
876 | For example, assignments such as | ||
877 | <filename>FILES_${PN} = "xyz"</filename> effectively | ||
878 | turn into <filename>FILES = "xyz"</filename>. | ||
879 | Rename your recipe (or if <filename>PN</filename> is being | ||
880 | set explicitly, change the <filename>PN</filename> value) so | ||
881 | that the conflict does not occur. | ||
882 | See | ||
883 | <link linkend='var-FILES'><filename>FILES</filename></link> | ||
884 | for additional information. | ||
885 | </para> | ||
886 | |||
887 | <para> | ||
888 | | ||
889 | </para> | ||
890 | </listitem> | ||
891 | </itemizedlist> | ||
892 | </para> | ||
893 | |||
894 | <para> | ||
895 | <itemizedlist> | ||
896 | <listitem> | ||
897 | <para> | ||
898 | <code> | ||
899 | <recipefile>: Variable <variable> is set as not being package specific, please fix this. [pkgvarcheck] | ||
900 | </code> | ||
901 | </para> | ||
902 | |||
903 | <para> | ||
904 | Certain variables | ||
905 | (<link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>, | ||
906 | <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>, | ||
907 | <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>, | ||
908 | <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>, | ||
909 | <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>, | ||
910 | <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>, | ||
911 | <link linkend='var-FILES'><filename>FILES</filename></link>, | ||
912 | <filename>pkg_preinst</filename>, | ||
913 | <filename>pkg_postinst</filename>, | ||
914 | <filename>pkg_prerm</filename>, | ||
915 | <filename>pkg_postrm</filename>, and | ||
916 | <link linkend='var-ALLOW_EMPTY'><filename>ALLOW_EMPTY</filename></link>) | ||
917 | should always be set specific to a package (i.e. they | ||
918 | should be set with a package name override such as | ||
919 | <filename>RDEPENDS_${PN} = "value"</filename> rather than | ||
920 | <filename>RDEPENDS = "value"</filename>). | ||
921 | If you receive this error, correct any assignments to these | ||
922 | variables within your recipe. | ||
923 | </para> | ||
924 | |||
925 | <para> | ||
926 | | ||
927 | </para> | ||
928 | </listitem> | ||
929 | </itemizedlist> | ||
930 | </para> | ||
931 | |||
932 | <para> | ||
933 | <itemizedlist> | ||
934 | <listitem> | ||
935 | <para> | ||
936 | <code> | ||
937 | File '<file>' from <recipename> was already stripped, this will prevent future debugging! [already-stripped] | ||
938 | </code> | ||
939 | </para> | ||
940 | |||
941 | <para> | ||
942 | Produced binaries have already been stripped prior to the | ||
943 | build system extracting debug symbols. | ||
944 | It is common for upstream software projects to default to | ||
945 | stripping debug symbols for output binaries. | ||
946 | In order for debugging to work on the target using | ||
947 | <filename>-dbg</filename> packages, this stripping must be | ||
948 | disabled. | ||
949 | Depending on the build system used by the software being | ||
950 | built, disabling this stripping could be as easy as | ||
951 | specifying an additional configure option. | ||
952 | If not, disabling stripping might involve patching | ||
953 | the build scripts. | ||
954 | <note> | ||
955 | Disabling stripping here does not mean that the final | ||
956 | packaged binaries will be unstripped. | ||
957 | Once the OpenEmbedded build system splits out debug | ||
958 | symbols to the <filename>-dbg</filename> package, | ||
959 | it will then strip the symbols from the binaries. | ||
960 | </note> | ||
961 | </para> | ||
962 | |||
963 | <para> | ||
964 | | ||
965 | </para> | ||
966 | </listitem> | ||
967 | </itemizedlist> | ||
968 | </para> | ||
969 | |||
970 | <para> | ||
971 | <itemizedlist> | ||
972 | <listitem> | ||
973 | <para> | ||
974 | <code> | ||
975 | <packagename> is listed in PACKAGES multiple times, this leads to packaging errors. [packages-list] | ||
976 | </code> | ||
977 | </para> | ||
978 | |||
979 | <para> | ||
980 | Package names must appear only once in the | ||
981 | <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link> | ||
982 | variable. | ||
983 | You might receive this error if you are attempting to add a | ||
984 | package to <filename>PACKAGES</filename> that is | ||
985 | already in the variable's value. | ||
986 | </para> | ||
987 | |||
988 | <para> | ||
989 | | ||
990 | </para> | ||
991 | </listitem> | ||
992 | </itemizedlist> | ||
993 | </para> | ||
994 | |||
995 | <para> | ||
996 | <itemizedlist> | ||
997 | <listitem> | ||
998 | <para> | ||
999 | <code> | ||
1000 | FILES variable for package <packagename> contains '//' which is invalid. Attempting to fix this but you should correct the metadata. [files-invalid] | ||
1001 | </code> | ||
1002 | </para> | ||
1003 | |||
1004 | <para> | ||
1005 | The string "//" is invalid in a Unix path. | ||
1006 | Correct all occurrences where this string appears in a | ||
1007 | <link linkend='var-FILES'><filename>FILES</filename></link> | ||
1008 | variable so that there is only a single "/". | ||
1009 | </para> | ||
1010 | |||
1011 | <para> | ||
1012 | | ||
1013 | </para> | ||
1014 | </listitem> | ||
1015 | </itemizedlist> | ||
1016 | </para> | ||
1017 | |||
1018 | <para> | ||
1019 | <itemizedlist> | ||
1020 | <listitem> | ||
1021 | <para> | ||
1022 | <code> | ||
1023 | <recipename>: Files/directories were installed but not shipped [installed-vs-shipped] | ||
1024 | </code> | ||
1025 | </para> | ||
1026 | |||
1027 | <para> | ||
1028 | Files have been installed within the | ||
1029 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
1030 | task but have not been included in any package by way of the | ||
1031 | <link linkend='var-FILES'><filename>FILES</filename></link> | ||
1032 | variable. | ||
1033 | Files that do not appear in any package cannot be present in | ||
1034 | an image later on in the build process. | ||
1035 | You need to do one of the following: | ||
1036 | <itemizedlist> | ||
1037 | <listitem><para> | ||
1038 | Add the files to <filename>FILES</filename> for the | ||
1039 | package you want them to appear in (e.g. | ||
1040 | <filename>FILES_${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename> for the main | ||
1041 | package). | ||
1042 | </para></listitem> | ||
1043 | <listitem><para> | ||
1044 | Delete the files at the end of the | ||
1045 | <filename>do_install</filename> task if the files | ||
1046 | are not needed in any package. | ||
1047 | </para></listitem> | ||
1048 | </itemizedlist> | ||
1049 | </para> | ||
1050 | |||
1051 | <para> | ||
1052 | | ||
1053 | </para> | ||
1054 | </listitem> | ||
1055 | </itemizedlist> | ||
1056 | </para> | ||
1057 | |||
1058 | <para> | ||
1059 | <itemizedlist> | ||
1060 | <listitem> | ||
1061 | <para> | ||
1062 | <code> | ||
1063 | <oldpackage>-<oldpkgversion> was registered as shlib provider for <library>, changing it to <newpackage>-<newpkgversion> because it was built later | ||
1064 | </code> | ||
1065 | </para> | ||
1066 | |||
1067 | <para> | ||
1068 | This message means that both | ||
1069 | <filename><oldpackage></filename> and | ||
1070 | <filename><newpackage></filename> provide the specified | ||
1071 | shared library. | ||
1072 | You can expect this message when a recipe has been renamed. | ||
1073 | However, if that is not the case, the message might indicate | ||
1074 | that a private version of a library is being erroneously | ||
1075 | picked up as the provider for a common library. | ||
1076 | If that is the case, you should add the library's | ||
1077 | <filename>.so</filename> file name to | ||
1078 | <link linkend='var-PRIVATE_LIBS'><filename>PRIVATE_LIBS</filename></link> | ||
1079 | in the recipe that provides | ||
1080 | the private version of the library. | ||
1081 | </para> | ||
1082 | </listitem> | ||
1083 | </itemizedlist> | ||
1084 | </para> | ||
1085 | |||
1086 | <!-- | ||
1087 | Here are some messages that might be documented in the future. | ||
1088 | Right now we are not documenting them because the QA checks are not | ||
1089 | enabled by default: | ||
1090 | |||
1091 | <para> | ||
1092 | <itemizedlist> | ||
1093 | <listitem><para> | ||
1094 | <literallayout class='monospaced'> | ||
1095 | Desktop file issue: <error> [desktop] | ||
1096 | </literallayout> | ||
1097 | NEED A DESCRIPTION AND SOLUTION | ||
1098 | </para></listitem> | ||
1099 | </itemizedlist> | ||
1100 | </para> | ||
1101 | |||
1102 | <para> | ||
1103 | <itemizedlist> | ||
1104 | <listitem><para> | ||
1105 | <literallayout class='monospaced'> | ||
1106 | <packagename>: <file>, installed in the base_prefix, requires a shared library under exec_prefix (<exec_prefix&t;g) [unsafe-references-in-binaries] | ||
1107 | </literallayout> | ||
1108 | NEED A DESCRIPTION AND SOLUTION | ||
1109 | </para></listitem> | ||
1110 | </itemizedlist> | ||
1111 | </para> | ||
1112 | |||
1113 | <para> | ||
1114 | <itemizedlist> | ||
1115 | <listitem><para> | ||
1116 | <literallayout class='monospaced'> | ||
1117 | <packagename>: Found a reference to <exec_prefix>/ in <path> - Shell scripts in base_bindir and base_sbindir should not reference anything in exec_prefix [unsafe-references-in-scripts] | ||
1118 | </literallayout> | ||
1119 | NEED A DESCRIPTION AND SOLUTION | ||
1120 | </para></listitem> | ||
1121 | </itemizedlist> | ||
1122 | </para> | ||
1123 | --> | ||
1124 | </section> | ||
1125 | |||
1126 | <section id='configuring-and-disabling-qa-checks'> | ||
1127 | <title>Configuring and Disabling QA Checks</title> | ||
1128 | |||
1129 | <para> | ||
1130 | You can configure the QA checks globally so that specific check | ||
1131 | failures either raise a warning or an error message, using the | ||
1132 | <link linkend='var-WARN_QA'><filename>WARN_QA</filename></link> and | ||
1133 | <link linkend='var-ERROR_QA'><filename>ERROR_QA</filename></link> | ||
1134 | variables, respectively. | ||
1135 | You can also disable checks within a particular recipe using | ||
1136 | <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link>. | ||
1137 | For information on how to work with the QA checks, see the | ||
1138 | "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>" | ||
1139 | section. | ||
1140 | <note><title>Tip</title> | ||
1141 | Please keep in mind that the QA checks exist in order to | ||
1142 | detect real or potential problems in the packaged output. | ||
1143 | So exercise caution when disabling these checks. | ||
1144 | </note> | ||
1145 | </para> | ||
1146 | </section> | ||
1147 | |||
1148 | </chapter> | ||
1149 | <!-- | ||
1150 | vim: expandtab tw=80 ts=4 | ||
1151 | --> | ||
diff --git a/documentation/ref-manual/ref-structure.xml b/documentation/ref-manual/ref-structure.xml new file mode 100644 index 0000000..389e75a --- /dev/null +++ b/documentation/ref-manual/ref-structure.xml | |||
@@ -0,0 +1,1130 @@ | |||
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 | |||
5 | <chapter id='ref-structure'> | ||
6 | |||
7 | <title>Source Directory Structure</title> | ||
8 | |||
9 | <para> | ||
10 | The <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> consists of several components. | ||
11 | Understanding them and knowing where they are located is key to using the Yocto Project well. | ||
12 | This chapter describes the Source Directory and gives information about the various | ||
13 | files and directories. | ||
14 | </para> | ||
15 | |||
16 | <para> | ||
17 | For information on how to establish a local Source Directory on your development system, see the | ||
18 | "<ulink url='&YOCTO_DOCS_DEV_URL;#getting-setup'>Getting Set Up</ulink>" | ||
19 | section in the Yocto Project Development Manual. | ||
20 | </para> | ||
21 | |||
22 | <note> | ||
23 | The OpenEmbedded build system does not support file or directory names that | ||
24 | contain spaces. | ||
25 | Be sure that the Source Directory you use does not contain these types | ||
26 | of names. | ||
27 | </note> | ||
28 | |||
29 | <section id='structure-core'> | ||
30 | <title>Top-Level Core Components</title> | ||
31 | |||
32 | <para> | ||
33 | This section describes the top-level components of the | ||
34 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
35 | </para> | ||
36 | |||
37 | <section id='structure-core-bitbake'> | ||
38 | <title><filename>bitbake/</filename></title> | ||
39 | |||
40 | <para> | ||
41 | This directory includes a copy of BitBake for ease of use. | ||
42 | The copy usually matches the current stable BitBake release from | ||
43 | the BitBake project. | ||
44 | BitBake, a | ||
45 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> | ||
46 | interpreter, reads the Yocto Project Metadata and runs the tasks | ||
47 | defined by that data. | ||
48 | Failures are usually from the Metadata and not from BitBake itself. | ||
49 | Consequently, most users do not need to worry about BitBake. | ||
50 | </para> | ||
51 | |||
52 | <para> | ||
53 | When you run the <filename>bitbake</filename> command, the | ||
54 | main BitBake executable, which resides in the | ||
55 | <filename>bitbake/bin/</filename> directory, starts. | ||
56 | Sourcing an environment setup script (e.g. | ||
57 | <link linkend="structure-core-script"><filename>&OE_INIT_FILE;</filename></link> | ||
58 | or | ||
59 | <link linkend="structure-memres-core-script"><filename>oe-init-build-env-memres</filename></link>) | ||
60 | places the <filename>scripts</filename> and | ||
61 | <filename>bitbake/bin</filename> directories (in that order) into | ||
62 | the shell's <filename>PATH</filename> environment variable. | ||
63 | </para> | ||
64 | |||
65 | <para> | ||
66 | For more information on BitBake, see the BitBake documentation | ||
67 | included in the <filename>bitbake/doc/manual</filename> directory of the | ||
68 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
69 | </para> | ||
70 | </section> | ||
71 | |||
72 | <section id='structure-core-build'> | ||
73 | <title><filename>build/</filename></title> | ||
74 | |||
75 | <para> | ||
76 | This directory contains user configuration files and the output | ||
77 | generated by the OpenEmbedded build system in its standard configuration where | ||
78 | the source tree is combined with the output. | ||
79 | The <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
80 | is created initially when you <filename>source</filename> | ||
81 | the OpenEmbedded build environment setup script | ||
82 | (i.e. | ||
83 | <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link> | ||
84 | or | ||
85 | <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>). | ||
86 | </para> | ||
87 | |||
88 | <para> | ||
89 | It is also possible to place output and configuration | ||
90 | files in a directory separate from the | ||
91 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
92 | by providing a directory name when you <filename>source</filename> | ||
93 | the setup script. | ||
94 | For information on separating output from your local | ||
95 | Source Directory files, see the | ||
96 | "<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link> | ||
97 | and | ||
98 | "<link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>" | ||
99 | sections. | ||
100 | </para> | ||
101 | </section> | ||
102 | |||
103 | <section id='handbook'> | ||
104 | <title><filename>documentation/</filename></title> | ||
105 | |||
106 | <para> | ||
107 | This directory holds the source for the Yocto Project documentation | ||
108 | as well as templates and tools that allow you to generate PDF and HTML | ||
109 | versions of the manuals. | ||
110 | Each manual is contained in a sub-folder. | ||
111 | For example, the files for this manual reside in | ||
112 | the <filename>ref-manual/</filename> directory. | ||
113 | </para> | ||
114 | </section> | ||
115 | |||
116 | <section id='structure-core-meta'> | ||
117 | <title><filename>meta/</filename></title> | ||
118 | |||
119 | <para> | ||
120 | This directory contains the OpenEmbedded Core metadata. | ||
121 | The directory holds recipes, common classes, and machine | ||
122 | configuration for emulated targets (<filename>qemux86</filename>, | ||
123 | <filename>qemuarm</filename>, and so forth.) | ||
124 | </para> | ||
125 | </section> | ||
126 | |||
127 | <section id='structure-core-meta-yocto'> | ||
128 | <title><filename>meta-yocto/</filename></title> | ||
129 | |||
130 | <para> | ||
131 | This directory contains the configuration for the Poky | ||
132 | reference distribution. | ||
133 | </para> | ||
134 | </section> | ||
135 | |||
136 | <section id='structure-core-meta-yocto-bsp'> | ||
137 | <title><filename>meta-yocto-bsp/</filename></title> | ||
138 | |||
139 | <para> | ||
140 | This directory contains the Yocto Project reference | ||
141 | hardware Board Support Packages (BSPs). | ||
142 | For more information on BSPs, see the | ||
143 | <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support | ||
144 | Package (BSP) Developer's Guide</ulink>. | ||
145 | </para> | ||
146 | </section> | ||
147 | |||
148 | <section id='structure-meta-selftest'> | ||
149 | <title><filename>meta-selftest/</filename></title> | ||
150 | |||
151 | <para> | ||
152 | This directory adds additional recipes and append files | ||
153 | used by the OpenEmbedded selftests to verify the behavior | ||
154 | of the build system. | ||
155 | </para> | ||
156 | |||
157 | <para> | ||
158 | You do not have to add this layer to your | ||
159 | <filename>bblayers.conf</filename> file unless you want to run the | ||
160 | selftests. | ||
161 | </para> | ||
162 | </section> | ||
163 | |||
164 | <section id='structure-meta-skeleton'> | ||
165 | <title><filename>meta-skeleton/</filename></title> | ||
166 | |||
167 | <para> | ||
168 | This directory contains template recipes for BSP and kernel development. | ||
169 | </para> | ||
170 | </section> | ||
171 | |||
172 | <section id='structure-core-scripts'> | ||
173 | <title><filename>scripts/</filename></title> | ||
174 | |||
175 | <para> | ||
176 | This directory contains various integration scripts that implement | ||
177 | extra functionality in the Yocto Project environment (e.g. QEMU scripts). | ||
178 | The <link linkend="structure-core-script"><filename>&OE_INIT_FILE;</filename></link> | ||
179 | and | ||
180 | <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link> | ||
181 | scripts append this directory to the shell's | ||
182 | <filename>PATH</filename> environment variable. | ||
183 | </para> | ||
184 | |||
185 | <para> | ||
186 | The <filename>scripts</filename> directory has useful scripts that assist in contributing | ||
187 | back to the Yocto Project, such as <filename>create-pull-request</filename> and | ||
188 | <filename>send-pull-request</filename>. | ||
189 | </para> | ||
190 | </section> | ||
191 | |||
192 | <section id='structure-core-script'> | ||
193 | <title><filename>&OE_INIT_FILE;</filename></title> | ||
194 | |||
195 | <para> | ||
196 | This script is one of two scripts that set up the OpenEmbedded build | ||
197 | environment. | ||
198 | For information on the other script, see the | ||
199 | "<link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>" | ||
200 | section. | ||
201 | </para> | ||
202 | |||
203 | <para> | ||
204 | Running this script with the <filename>source</filename> command in | ||
205 | a shell makes changes to <filename>PATH</filename> and sets other | ||
206 | core BitBake variables based on the current working directory. | ||
207 | You need to run an environment setup script before running BitBake | ||
208 | commands. | ||
209 | The script uses other scripts within the | ||
210 | <filename>scripts</filename> directory to do the bulk of the work. | ||
211 | </para> | ||
212 | |||
213 | <para> | ||
214 | When you run this script, your Yocto Project environment is set | ||
215 | up, a | ||
216 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
217 | is created, your working directory becomes the Build Directory, | ||
218 | and you are presented with a list of common BitBake targets. | ||
219 | Here is an example: | ||
220 | <literallayout class='monospaced'> | ||
221 | $ source oe-init-build-env | ||
222 | |||
223 | ### Shell environment set up for builds. ### | ||
224 | |||
225 | You can now run 'bitbake <target>' | ||
226 | |||
227 | Common targets are: | ||
228 | core-image-minimal | ||
229 | core-image-sato | ||
230 | meta-toolchain | ||
231 | adt-installer | ||
232 | meta-ide-support | ||
233 | |||
234 | You can also run generated qemu images with a command like 'runqemu qemux86' | ||
235 | </literallayout> | ||
236 | The script gets its default list of common targets from the | ||
237 | <filename>conf-notes.txt</filename> file, which is found in the | ||
238 | <filename>meta-yocto</filename> directory within the | ||
239 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
240 | Should you have custom distributions, it is very easy to modify | ||
241 | this configuration file to include your targets for your | ||
242 | distribution. | ||
243 | See the | ||
244 | "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-custom-template-configuration-directory'>Creating a Custom Template Configuration Directory</ulink>" | ||
245 | section in the Yocto Project Development Manual for more | ||
246 | information. | ||
247 | </para> | ||
248 | |||
249 | <para> | ||
250 | By default, running this script without a | ||
251 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
252 | argument creates the <filename>build</filename> directory | ||
253 | in your current working directory. | ||
254 | If you provide a Build Directory argument when you | ||
255 | <filename>source</filename> the script, you direct the OpenEmbedded | ||
256 | build system to create a Build Directory of your choice. | ||
257 | For example, the following command creates a Build Directory named | ||
258 | <filename>mybuilds</filename> that is outside of the | ||
259 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>: | ||
260 | <literallayout class='monospaced'> | ||
261 | $ source &OE_INIT_FILE; ~/mybuilds | ||
262 | </literallayout> | ||
263 | The OpenEmbedded build system uses the template configuration | ||
264 | files, which are found by default in the | ||
265 | <filename>meta-yocto/conf</filename> directory in the | ||
266 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
267 | See the | ||
268 | "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-custom-template-configuration-directory'>Creating a Custom Template Configuration Directory</ulink>" | ||
269 | section in the Yocto Project Development Manual for more | ||
270 | information. | ||
271 | <note> | ||
272 | The OpenEmbedded build system does not support file or directory names that | ||
273 | contain spaces. | ||
274 | If you attempt to run the <filename>&OE_INIT_FILE;</filename> script | ||
275 | from a Source Directory that contains spaces in either the filenames | ||
276 | or directory names, the script returns an error indicating no such | ||
277 | file or directory. | ||
278 | Be sure to use a Source Directory free of names containing spaces. | ||
279 | </note> | ||
280 | </para> | ||
281 | </section> | ||
282 | |||
283 | <section id='structure-memres-core-script'> | ||
284 | <title><filename>oe-init-build-env-memres</filename></title> | ||
285 | |||
286 | <para> | ||
287 | This script is one of two scripts that set up the OpenEmbedded | ||
288 | build environment. | ||
289 | Aside from setting up the environment, this script starts a | ||
290 | memory-resident BitBake server. | ||
291 | For information on the other setup script, see the | ||
292 | "<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>" | ||
293 | section. | ||
294 | </para> | ||
295 | |||
296 | <para> | ||
297 | Memory-resident BitBake resides in memory until you specifically | ||
298 | remove it using the following BitBake command: | ||
299 | <literallayout class='monospaced'> | ||
300 | $ bitbake -m | ||
301 | </literallayout> | ||
302 | </para> | ||
303 | |||
304 | <para> | ||
305 | Running this script with the <filename>source</filename> command in | ||
306 | a shell makes changes to <filename>PATH</filename> and sets other | ||
307 | core BitBake variables based on the current working directory. | ||
308 | One of these variables is the | ||
309 | <link linkend='var-BBSERVER'><filename>BBSERVER</filename></link> | ||
310 | variable, which allows the OpenEmbedded build system to locate | ||
311 | the server that is running BitBake. | ||
312 | </para> | ||
313 | |||
314 | <para> | ||
315 | You need to run an environment setup script before using BitBake | ||
316 | commands. | ||
317 | Following is the script syntax: | ||
318 | <literallayout class='monospaced'> | ||
319 | $ source oe-init-build-env-memres <port_number> <build_dir> | ||
320 | </literallayout> | ||
321 | The script uses other scripts within the | ||
322 | <filename>scripts</filename> directory to do the bulk of the work. | ||
323 | </para> | ||
324 | |||
325 | <para> | ||
326 | If you do not provide a port number with the script, the | ||
327 | BitBake server at port "12345" is started. | ||
328 | </para> | ||
329 | |||
330 | <para> | ||
331 | When you run this script, your Yocto Project environment is set | ||
332 | up, a | ||
333 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
334 | is created, your working directory becomes the Build Directory, | ||
335 | and you are presented with a list of common BitBake targets. | ||
336 | Here is an example: | ||
337 | <literallayout class='monospaced'> | ||
338 | $ source oe-init-build-env-memres | ||
339 | No port specified, using dynamically selected port | ||
340 | |||
341 | ### Shell environment set up for builds. ### | ||
342 | |||
343 | You can now run 'bitbake <target>' | ||
344 | |||
345 | Common targets are: | ||
346 | core-image-minimal | ||
347 | core-image-sato | ||
348 | meta-toolchain | ||
349 | adt-installer | ||
350 | meta-ide-support | ||
351 | |||
352 | You can also run generated qemu images with a command like 'runqemu qemux86' | ||
353 | Bitbake server started on demand as needed, use bitbake -m to shut it down | ||
354 | </literallayout> | ||
355 | The script gets its default list of common targets from the | ||
356 | <filename>conf-notes.txt</filename> file, which is found in the | ||
357 | <filename>meta-yocto</filename> directory within the | ||
358 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
359 | Should you have custom distributions, it is very easy to modify | ||
360 | this configuration file to include your targets for your | ||
361 | distribution. | ||
362 | See the | ||
363 | "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-custom-template-configuration-directory'>Creating a Custom Template Configuration Directory</ulink>" | ||
364 | section in the Yocto Project Development Manual for more | ||
365 | information. | ||
366 | </para> | ||
367 | |||
368 | <para> | ||
369 | By default, running this script without a | ||
370 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
371 | argument creates a build directory named | ||
372 | <filename>build</filename>. | ||
373 | If you provide a Build Directory argument when you | ||
374 | <filename>source</filename> the script, the Build Directory is | ||
375 | created using that name. | ||
376 | For example, the following command starts the BitBake server using | ||
377 | the default port "12345" and creates a Build Directory named | ||
378 | <filename>mybuilds</filename> that is outside of the | ||
379 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>: | ||
380 | <literallayout class='monospaced'> | ||
381 | $ source oe-init-build-env-memres ~/mybuilds | ||
382 | </literallayout> | ||
383 | The OpenEmbedded build system uses the template configuration | ||
384 | files, which are found by default in the | ||
385 | <filename>meta-yocto/conf</filename> directory in the | ||
386 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
387 | See the | ||
388 | "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-custom-template-configuration-directory'>Creating a Custom Template Configuration Directory</ulink>" | ||
389 | section in the Yocto Project Development Manual for more | ||
390 | information. | ||
391 | <note> | ||
392 | The OpenEmbedded build system does not support file or | ||
393 | directory names that contain spaces. | ||
394 | If you attempt to run the | ||
395 | <filename>oe-init-build-env-memres</filename> script | ||
396 | from a Source Directory that contains spaces in either the | ||
397 | filenames or directory names, the script returns an error | ||
398 | indicating no such file or directory. | ||
399 | Be sure to use a Source Directory free of names containing | ||
400 | spaces. | ||
401 | </note> | ||
402 | </para> | ||
403 | </section> | ||
404 | |||
405 | <section id='structure-basic-top-level'> | ||
406 | <title><filename>LICENSE, README, and README.hardware</filename></title> | ||
407 | |||
408 | <para> | ||
409 | These files are standard top-level files. | ||
410 | </para> | ||
411 | </section> | ||
412 | </section> | ||
413 | |||
414 | <section id='structure-build'> | ||
415 | <title>The Build Directory - <filename>build/</filename></title> | ||
416 | |||
417 | <para> | ||
418 | The OpenEmbedded build system creates the | ||
419 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
420 | when you run one of the build environment setup scripts (i.e. | ||
421 | <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link> | ||
422 | or | ||
423 | <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>). | ||
424 | </para> | ||
425 | |||
426 | <para> | ||
427 | If you do not give the Build Directory a specific name when you run | ||
428 | a setup script, the name defaults to <filename>build</filename>. | ||
429 | </para> | ||
430 | |||
431 | <para> | ||
432 | The | ||
433 | <link linkend='var-TOPDIR'><filename>TOPDIR</filename></link> variable | ||
434 | points to the Build Directory. | ||
435 | </para> | ||
436 | |||
437 | <section id='structure-build-buildhistory'> | ||
438 | <title><filename>build/buildhistory</filename></title> | ||
439 | |||
440 | <para> | ||
441 | The OpenEmbedded build system creates this directory when you | ||
442 | enable the build history feature. | ||
443 | The directory tracks build information into image, packages, and | ||
444 | SDK subdirectories. | ||
445 | For information on the build history feature, see the | ||
446 | "<link linkend='maintaining-build-output-quality'>Maintaining Build Output Quality</link>" | ||
447 | section. | ||
448 | </para> | ||
449 | </section> | ||
450 | |||
451 | <section id='structure-build-conf-local.conf'> | ||
452 | <title><filename>build/conf/local.conf</filename></title> | ||
453 | |||
454 | <para> | ||
455 | This configuration file contains all the local user configurations | ||
456 | for your build environment. | ||
457 | The <filename>local.conf</filename> file contains documentation on | ||
458 | the various configuration options. | ||
459 | Any variable set here overrides any variable set elsewhere within | ||
460 | the environment unless that variable is hard-coded within a file | ||
461 | (e.g. by using '=' instead of '?='). | ||
462 | Some variables are hard-coded for various reasons but these | ||
463 | variables are relatively rare. | ||
464 | </para> | ||
465 | |||
466 | <para> | ||
467 | Edit this file to set the | ||
468 | <filename><link linkend='var-MACHINE'>MACHINE</link></filename> | ||
469 | for which you want to build, which package types you wish to use | ||
470 | (<link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>), | ||
471 | the location from which you want to access downloaded files | ||
472 | (<filename><link linkend='var-DL_DIR'>DL_DIR</link></filename>), | ||
473 | and how you want your host machine to use resources | ||
474 | (<link linkend='var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></link> | ||
475 | and | ||
476 | <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link>). | ||
477 | </para> | ||
478 | |||
479 | <para> | ||
480 | If <filename>local.conf</filename> is not present when you | ||
481 | start the build, the OpenEmbedded build system creates it from | ||
482 | <filename>local.conf.sample</filename> when | ||
483 | you <filename>source</filename> the top-level build environment | ||
484 | setup script (i.e. | ||
485 | <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link> | ||
486 | or | ||
487 | <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>). | ||
488 | </para> | ||
489 | |||
490 | <para> | ||
491 | The source <filename>local.conf.sample</filename> file used | ||
492 | depends on the <filename>$TEMPLATECONF</filename> script variable, | ||
493 | which defaults to <filename>meta-yocto/conf</filename> | ||
494 | when you are building from the Yocto Project development | ||
495 | environment and defaults to <filename>meta/conf</filename> when | ||
496 | you are building from the OpenEmbedded Core environment. | ||
497 | Because the script variable points to the source of the | ||
498 | <filename>local.conf.sample</filename> file, this implies that | ||
499 | you can configure your build environment from any layer by setting | ||
500 | the variable in the top-level build environment setup script as | ||
501 | follows: | ||
502 | <literallayout class='monospaced'> | ||
503 | TEMPLATECONF=<your_layer>/conf | ||
504 | </literallayout> | ||
505 | Once the build process gets the sample file, it uses | ||
506 | <filename>sed</filename> to substitute final | ||
507 | <filename>${</filename><link linkend='var-OEROOT'><filename>OEROOT</filename></link><filename>}</filename> | ||
508 | values for all <filename>##OEROOT##</filename> values. | ||
509 | <note> | ||
510 | You can see how the <filename>TEMPLATECONF</filename> variable | ||
511 | is used by looking at the | ||
512 | <filename>scripts/oe-setup-builddir</filename> script in the | ||
513 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
514 | You can find the Yocto Project version of the | ||
515 | <filename>local.conf.sample</filename> file in the | ||
516 | <filename>meta-yocto/conf</filename> directory. | ||
517 | </note> | ||
518 | </para> | ||
519 | </section> | ||
520 | |||
521 | <section id='structure-build-conf-bblayers.conf'> | ||
522 | <title><filename>build/conf/bblayers.conf</filename></title> | ||
523 | |||
524 | <para> | ||
525 | This configuration file defines | ||
526 | <ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>layers</ulink>, | ||
527 | which are directory trees, traversed (or walked) by BitBake. | ||
528 | The <filename>bblayers.conf</filename> file uses the | ||
529 | <link linkend='var-BBLAYERS'><filename>BBLAYERS</filename></link> | ||
530 | variable to list the layers BitBake tries to find, and uses the | ||
531 | <link linkend='var-BBLAYERS_NON_REMOVABLE'><filename>BBLAYERS_NON_REMOVABLE</filename></link> | ||
532 | variable to list layers that must not be removed. | ||
533 | </para> | ||
534 | |||
535 | <para> | ||
536 | If <filename>bblayers.conf</filename> is not present when you | ||
537 | start the build, the OpenEmbedded build system creates it from | ||
538 | <filename>bblayers.conf.sample</filename> when | ||
539 | you <filename>source</filename> the top-level build environment | ||
540 | setup script (i.e. | ||
541 | <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link> | ||
542 | or | ||
543 | <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>). | ||
544 | </para> | ||
545 | |||
546 | <para> | ||
547 | The source <filename>bblayers.conf.sample</filename> file used | ||
548 | depends on the <filename>$TEMPLATECONF</filename> script variable, | ||
549 | which defaults to <filename>meta-yocto/conf</filename> | ||
550 | when you are building from the Yocto Project development | ||
551 | environment and defaults to <filename>meta/conf</filename> when | ||
552 | you are building from the OpenEmbedded Core environment. | ||
553 | Because the script variable points to the source of the | ||
554 | <filename>bblayers.conf.sample</filename> file, this implies that | ||
555 | you can base your build from any layer by setting the variable in | ||
556 | the top-level build environment setup script as follows: | ||
557 | <literallayout class='monospaced'> | ||
558 | TEMPLATECONF=<your_layer>/conf | ||
559 | </literallayout> | ||
560 | Once the build process gets the sample file, it uses | ||
561 | <filename>sed</filename> to substitute final | ||
562 | <filename>${</filename><link linkend='var-OEROOT'><filename>OEROOT</filename></link><filename>}</filename> | ||
563 | values for all <filename>##OEROOT##</filename> values. | ||
564 | <note> | ||
565 | You can see how the <filename>TEMPLATECONF</filename> variable | ||
566 | <filename>scripts/oe-setup-builddir</filename> script in the | ||
567 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
568 | You can find the Yocto Project version of the | ||
569 | <filename>bblayers.conf.sample</filename> file in the | ||
570 | <filename>meta-yocto/conf</filename> directory. | ||
571 | </note> | ||
572 | </para> | ||
573 | </section> | ||
574 | |||
575 | <section id='structure-build-conf-sanity_info'> | ||
576 | <title><filename>build/conf/sanity_info</filename></title> | ||
577 | |||
578 | <para> | ||
579 | This file indicates the state of the sanity checks and is created | ||
580 | during the build. | ||
581 | </para> | ||
582 | </section> | ||
583 | |||
584 | <section id='structure-build-downloads'> | ||
585 | <title><filename>build/downloads/</filename></title> | ||
586 | |||
587 | <para> | ||
588 | This directory contains downloaded upstream source tarballs. | ||
589 | You can reuse the directory for multiple builds or move | ||
590 | the directory to another location. | ||
591 | You can control the location of this directory through the | ||
592 | <filename><link linkend='var-DL_DIR'>DL_DIR</link></filename> variable. | ||
593 | </para> | ||
594 | </section> | ||
595 | |||
596 | <section id='structure-build-sstate-cache'> | ||
597 | <title><filename>build/sstate-cache/</filename></title> | ||
598 | |||
599 | <para> | ||
600 | This directory contains the shared state cache. | ||
601 | You can reuse the directory for multiple builds or move | ||
602 | the directory to another location. | ||
603 | You can control the location of this directory through the | ||
604 | <filename><link linkend='var-SSTATE_DIR'>SSTATE_DIR</link></filename> variable. | ||
605 | </para> | ||
606 | </section> | ||
607 | |||
608 | <section id='structure-build-tmp'> | ||
609 | <title><filename>build/tmp/</filename></title> | ||
610 | |||
611 | <para> | ||
612 | The OpenEmbedded build system creates and uses this directory | ||
613 | for all the build system's output. | ||
614 | The | ||
615 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link> | ||
616 | variable points to this directory. | ||
617 | </para> | ||
618 | |||
619 | <para> | ||
620 | BitBake creates this directory if it does not exist. | ||
621 | As a last resort, to clean up a build and start it from scratch | ||
622 | (other than the downloads), you can remove everything in the | ||
623 | <filename>tmp</filename> directory or get rid of the | ||
624 | directory completely. | ||
625 | If you do, you should also completely remove the | ||
626 | <filename>build/sstate-cache</filename> directory. | ||
627 | </para> | ||
628 | </section> | ||
629 | |||
630 | <section id='structure-build-tmp-buildstats'> | ||
631 | <title><filename>build/tmp/buildstats/</filename></title> | ||
632 | |||
633 | <para> | ||
634 | This directory stores the build statistics. | ||
635 | </para> | ||
636 | </section> | ||
637 | |||
638 | <section id='structure-build-tmp-cache'> | ||
639 | <title><filename>build/tmp/cache/</filename></title> | ||
640 | |||
641 | <para> | ||
642 | When BitBake parses the metadata, it creates a cache file of the result that can | ||
643 | be used when subsequently running commands. | ||
644 | BitBake stores these results here on a per-machine basis. | ||
645 | </para> | ||
646 | </section> | ||
647 | |||
648 | <section id='structure-build-tmp-deploy'> | ||
649 | <title><filename>build/tmp/deploy/</filename></title> | ||
650 | |||
651 | <para> | ||
652 | This directory contains any "end result" output from the | ||
653 | OpenEmbedded build process. | ||
654 | The <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link> | ||
655 | variable points to this directory. | ||
656 | For more detail on the contents of the <filename>deploy</filename> | ||
657 | directory, see the | ||
658 | "<link linkend='images-dev-environment'>Images</link>" and | ||
659 | "<link linkend='sdk-dev-environment'>Application Development SDK</link>" | ||
660 | sections. | ||
661 | </para> | ||
662 | </section> | ||
663 | |||
664 | <section id='structure-build-tmp-deploy-deb'> | ||
665 | <title><filename>build/tmp/deploy/deb/</filename></title> | ||
666 | |||
667 | <para> | ||
668 | This directory receives any <filename>.deb</filename> packages produced by | ||
669 | the build process. | ||
670 | The packages are sorted into feeds for different architecture types. | ||
671 | </para> | ||
672 | </section> | ||
673 | |||
674 | <section id='structure-build-tmp-deploy-rpm'> | ||
675 | <title><filename>build/tmp/deploy/rpm/</filename></title> | ||
676 | |||
677 | <para> | ||
678 | This directory receives any <filename>.rpm</filename> packages produced by | ||
679 | the build process. | ||
680 | The packages are sorted into feeds for different architecture types. | ||
681 | </para> | ||
682 | </section> | ||
683 | |||
684 | <section id='structure-build-tmp-deploy-ipk'> | ||
685 | <title><filename>build/tmp/deploy/ipk/</filename></title> | ||
686 | |||
687 | <para> | ||
688 | This directory receives <filename>.ipk</filename> packages produced by | ||
689 | the build process. | ||
690 | </para> | ||
691 | </section> | ||
692 | |||
693 | <section id='structure-build-tmp-deploy-licenses'> | ||
694 | <title><filename>build/tmp/deploy/licenses/</filename></title> | ||
695 | |||
696 | <para> | ||
697 | This directory receives package licensing information. | ||
698 | For example, the directory contains sub-directories for <filename>bash</filename>, | ||
699 | <filename>busybox</filename>, and <filename>eglibc</filename> (among others) that in turn | ||
700 | contain appropriate <filename>COPYING</filename> license files with other licensing information. | ||
701 | For information on licensing, see the | ||
702 | "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>" | ||
703 | section. | ||
704 | </para> | ||
705 | </section> | ||
706 | |||
707 | <section id='structure-build-tmp-deploy-images'> | ||
708 | <title><filename>build/tmp/deploy/images/</filename></title> | ||
709 | |||
710 | <para> | ||
711 | This directory receives complete filesystem images. | ||
712 | If you want to flash the resulting image from a build onto a device, look here for the image. | ||
713 | </para> | ||
714 | |||
715 | <para> | ||
716 | Be careful when deleting files in this directory. | ||
717 | You can safely delete old images from this directory (e.g. | ||
718 | <filename>core-image-*</filename>, <filename>hob-image-*</filename>, | ||
719 | etc.). | ||
720 | However, the kernel (<filename>*zImage*</filename>, <filename>*uImage*</filename>, etc.), | ||
721 | bootloader and other supplementary files might be deployed here prior to building an | ||
722 | image. | ||
723 | Because these files are not directly produced from the image, if you | ||
724 | delete them they will not be automatically re-created when you build the image again. | ||
725 | </para> | ||
726 | |||
727 | <para> | ||
728 | If you do accidentally delete files here, you will need to force them to be | ||
729 | re-created. | ||
730 | In order to do that, you will need to know the target that produced them. | ||
731 | For example, these commands rebuild and re-create the kernel files: | ||
732 | <literallayout class='monospaced'> | ||
733 | $ bitbake -c clean virtual/kernel | ||
734 | $ bitbake virtual/kernel | ||
735 | </literallayout> | ||
736 | </para> | ||
737 | </section> | ||
738 | |||
739 | <section id='structure-build-tmp-deploy-sdk'> | ||
740 | <title><filename>build/tmp/deploy/sdk/</filename></title> | ||
741 | |||
742 | <para> | ||
743 | The OpenEmbedded build system creates this directory to hold | ||
744 | toolchain installer scripts, which when executed, install the | ||
745 | sysroot that matches your target hardware. | ||
746 | You can find out more about these installers in the | ||
747 | "<ulink url='&YOCTO_DOCS_ADT_URL;#optionally-building-a-toolchain-installer'>Optionally Building a Toolchain Installer</ulink>" | ||
748 | section in the Yocto Project Application Developer's Guide. | ||
749 | </para> | ||
750 | </section> | ||
751 | |||
752 | <section id='structure-build-tmp-sstate-control'> | ||
753 | <title><filename>build/tmp/sstate-control/</filename></title> | ||
754 | |||
755 | <para> | ||
756 | The OpenEmbedded build system uses this directory for the | ||
757 | shared state manifest files. | ||
758 | The shared state code uses these files to record the files | ||
759 | installed by each sstate task so that the files can be removed | ||
760 | when cleaning the recipe or when a newer version is about to | ||
761 | be installed. | ||
762 | The build system also uses the manifests to detect and produce | ||
763 | a warning when files from one task are overwriting those from | ||
764 | another. | ||
765 | </para> | ||
766 | </section> | ||
767 | |||
768 | <section id='structure-build-tmp-sysroots'> | ||
769 | <title><filename>build/tmp/sysroots/</filename></title> | ||
770 | |||
771 | <para> | ||
772 | This directory contains shared header files and libraries as well as other shared | ||
773 | data. | ||
774 | Packages that need to share output with other packages do so within this directory. | ||
775 | The directory is subdivided by architecture so multiple builds can run within | ||
776 | the one Build Directory. | ||
777 | </para> | ||
778 | </section> | ||
779 | |||
780 | <section id='structure-build-tmp-stamps'> | ||
781 | <title><filename>build/tmp/stamps/</filename></title> | ||
782 | |||
783 | <para> | ||
784 | This directory holds information that BitBake uses for accounting purposes | ||
785 | to track what tasks have run and when they have run. | ||
786 | The directory is sub-divided by architecture, package name, and | ||
787 | version. | ||
788 | Following is an example: | ||
789 | <literallayout class='monospaced'> | ||
790 | stamps/all-poky-linux/distcc-config/1.0-r0.do_build-2fdd....2do | ||
791 | </literallayout> | ||
792 | Although the files in the directory are empty of data, | ||
793 | BitBake uses the filenames and timestamps for tracking purposes. | ||
794 | </para> | ||
795 | </section> | ||
796 | |||
797 | <section id='structure-build-tmp-log'> | ||
798 | <title><filename>build/tmp/log/</filename></title> | ||
799 | |||
800 | <para> | ||
801 | This directory contains general logs that are not otherwise placed using the | ||
802 | package's <filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>. | ||
803 | Examples of logs are the output from the | ||
804 | <filename>do_check_pkg</filename> or | ||
805 | <filename>do_distro_check</filename> tasks. | ||
806 | Running a build does not necessarily mean this directory is created. | ||
807 | </para> | ||
808 | </section> | ||
809 | |||
810 | <section id='structure-build-tmp-work'> | ||
811 | <title><filename>build/tmp/work/</filename></title> | ||
812 | |||
813 | <para> | ||
814 | This directory contains architecture-specific work sub-directories | ||
815 | for packages built by BitBake. | ||
816 | All tasks execute from the appropriate work directory. | ||
817 | For example, the source for a particular package is unpacked, | ||
818 | patched, configured and compiled all within its own work directory. | ||
819 | Within the work directory, organization is based on the package group | ||
820 | and version for which the source is being compiled | ||
821 | as defined by the | ||
822 | <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>. | ||
823 | </para> | ||
824 | |||
825 | <para> | ||
826 | It is worth considering the structure of a typical work directory. | ||
827 | As an example, consider <filename>linux-yocto-kernel-3.0</filename> | ||
828 | on the machine <filename>qemux86</filename> | ||
829 | built within the Yocto Project. | ||
830 | For this package, a work directory of | ||
831 | <filename>tmp/work/qemux86-poky-linux/linux-yocto/3.0+git1+<.....></filename>, | ||
832 | referred to as the | ||
833 | <filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>, is created. | ||
834 | Within this directory, the source is unpacked to | ||
835 | <filename>linux-qemux86-standard-build</filename> and then patched by Quilt. | ||
836 | (See the | ||
837 | "<ulink url='&YOCTO_DOCS_DEV_URL;#using-a-quilt-workflow'>Using a Quilt Flow</ulink>" | ||
838 | section in the Yocto Project Development Manual for more information.) | ||
839 | Within the <filename>linux-qemux86-standard-build</filename> directory, | ||
840 | standard Quilt directories <filename>linux-3.0/patches</filename> | ||
841 | and <filename>linux-3.0/.pc</filename> are created, | ||
842 | and standard Quilt commands can be used. | ||
843 | </para> | ||
844 | |||
845 | <para> | ||
846 | There are other directories generated within <filename>WORKDIR</filename>. | ||
847 | The most important directory is <filename>WORKDIR/temp/</filename>, | ||
848 | which has log files for each task (<filename>log.do_*.pid</filename>) | ||
849 | and contains the scripts BitBake runs for each task | ||
850 | (<filename>run.do_*.pid</filename>). | ||
851 | The <filename>WORKDIR/image/</filename> directory is where "make | ||
852 | install" places its output that is then split into sub-packages | ||
853 | within <filename>WORKDIR/packages-split/</filename>. | ||
854 | </para> | ||
855 | </section> | ||
856 | |||
857 | <section id='structure-build-work-shared'> | ||
858 | <title><filename>build/tmp/work-shared/</filename></title> | ||
859 | |||
860 | <para> | ||
861 | For efficiency, the OpenEmbedded build system creates and uses | ||
862 | this directory to hold recipes that share a work directory with | ||
863 | other recipes. | ||
864 | In practice, this is only used for <filename>gcc</filename> | ||
865 | and its variants (e.g. <filename>gcc-cross</filename>, | ||
866 | <filename>libgcc</filename>, <filename>gcc-runtime</filename>, | ||
867 | and so forth). | ||
868 | </para> | ||
869 | </section> | ||
870 | </section> | ||
871 | |||
872 | <section id='structure-meta'> | ||
873 | <title>The Metadata - <filename>meta/</filename></title> | ||
874 | |||
875 | <para> | ||
876 | As mentioned previously, | ||
877 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> is the core | ||
878 | of the Yocto Project. | ||
879 | Metadata has several important subdivisions: | ||
880 | </para> | ||
881 | |||
882 | <section id='structure-meta-classes'> | ||
883 | <title><filename>meta/classes/</filename></title> | ||
884 | |||
885 | <para> | ||
886 | This directory contains the <filename>*.bbclass</filename> files. | ||
887 | Class files are used to abstract common code so it can be reused by multiple | ||
888 | packages. | ||
889 | Every package inherits the <filename>base.bbclass</filename> file. | ||
890 | Examples of other important classes are <filename>autotools.bbclass</filename>, which | ||
891 | in theory allows any Autotool-enabled package to work with the Yocto Project with minimal effort. | ||
892 | Another example is <filename>kernel.bbclass</filename> that contains common code and functions | ||
893 | for working with the Linux kernel. | ||
894 | Functions like image generation or packaging also have their specific class files | ||
895 | such as <filename>image.bbclass</filename>, <filename>rootfs_*.bbclass</filename> and | ||
896 | <filename>package*.bbclass</filename>. | ||
897 | </para> | ||
898 | |||
899 | <para> | ||
900 | For reference information on classes, see the | ||
901 | "<link linkend='ref-classes'>Classes</link>" chapter. | ||
902 | </para> | ||
903 | </section> | ||
904 | |||
905 | <section id='structure-meta-conf'> | ||
906 | <title><filename>meta/conf/</filename></title> | ||
907 | |||
908 | <para> | ||
909 | This directory contains the core set of configuration files that start from | ||
910 | <filename>bitbake.conf</filename> and from which all other configuration | ||
911 | files are included. | ||
912 | See the include statements at the end of the | ||
913 | <filename>bitbake.conf</filename> file and you will note that even | ||
914 | <filename>local.conf</filename> is loaded from there. | ||
915 | While <filename>bitbake.conf</filename> sets up the defaults, you can often override | ||
916 | these by using the (<filename>local.conf</filename>) file, machine file or | ||
917 | the distribution configuration file. | ||
918 | </para> | ||
919 | </section> | ||
920 | |||
921 | <section id='structure-meta-conf-machine'> | ||
922 | <title><filename>meta/conf/machine/</filename></title> | ||
923 | |||
924 | <para> | ||
925 | This directory contains all the machine configuration files. | ||
926 | If you set <filename>MACHINE = "qemux86"</filename>, | ||
927 | the OpenEmbedded build system looks for a <filename>qemux86.conf</filename> file in this | ||
928 | directory. | ||
929 | The <filename>include</filename> directory contains various data common to multiple machines. | ||
930 | If you want to add support for a new machine to the Yocto Project, look in this directory. | ||
931 | </para> | ||
932 | </section> | ||
933 | |||
934 | <section id='structure-meta-conf-distro'> | ||
935 | <title><filename>meta/conf/distro/</filename></title> | ||
936 | |||
937 | <para> | ||
938 | The contents of this directory controls any distribution-specific | ||
939 | configurations. | ||
940 | For the Yocto Project, the <filename>defaultsetup.conf</filename> is the main file here. | ||
941 | This directory includes the versions and the | ||
942 | <filename>SRCDATE</filename> definitions for applications that are configured here. | ||
943 | An example of an alternative configuration might be <filename>poky-bleeding.conf</filename>. | ||
944 | Although this file mainly inherits its configuration from Poky. | ||
945 | </para> | ||
946 | </section> | ||
947 | |||
948 | <section id='structure-meta-conf-machine-sdk'> | ||
949 | <title><filename>meta/conf/machine-sdk/</filename></title> | ||
950 | |||
951 | <para> | ||
952 | The OpenEmbedded build system searches this directory for | ||
953 | configuration files that correspond to the value of | ||
954 | <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>. | ||
955 | By default, 32-bit and 64-bit x86 files ship with the Yocto | ||
956 | Project that support some SDK hosts. | ||
957 | However, it is possible to extend that support to other SDK hosts | ||
958 | by adding additional configuration files in this subdirectory | ||
959 | within another layer. | ||
960 | </para> | ||
961 | </section> | ||
962 | |||
963 | <section id='structure-meta-files'> | ||
964 | <title><filename>meta/files/</filename></title> | ||
965 | |||
966 | <para> | ||
967 | This directory contains common license files and several text files | ||
968 | used by the build system. | ||
969 | The text files contain minimal device information and | ||
970 | lists of files and directories with known permissions. | ||
971 | </para> | ||
972 | </section> | ||
973 | |||
974 | <section id='structure-meta-lib'> | ||
975 | <title><filename>meta/lib/</filename></title> | ||
976 | |||
977 | <para> | ||
978 | This directory contains OpenEmbedded Python library code | ||
979 | used during the build process. | ||
980 | </para> | ||
981 | </section> | ||
982 | |||
983 | <section id='structure-meta-recipes-bsp'> | ||
984 | <title><filename>meta/recipes-bsp/</filename></title> | ||
985 | |||
986 | <para> | ||
987 | This directory contains anything linking to specific hardware or hardware | ||
988 | configuration information such as "u-boot" and "grub". | ||
989 | </para> | ||
990 | </section> | ||
991 | |||
992 | <section id='structure-meta-recipes-connectivity'> | ||
993 | <title><filename>meta/recipes-connectivity/</filename></title> | ||
994 | |||
995 | <para> | ||
996 | This directory contains libraries and applications related to communication with other devices. | ||
997 | </para> | ||
998 | </section> | ||
999 | |||
1000 | <section id='structure-meta-recipes-core'> | ||
1001 | <title><filename>meta/recipes-core/</filename></title> | ||
1002 | |||
1003 | <para> | ||
1004 | This directory contains what is needed to build a basic working Linux image | ||
1005 | including commonly used dependencies. | ||
1006 | </para> | ||
1007 | </section> | ||
1008 | |||
1009 | <section id='structure-meta-recipes-devtools'> | ||
1010 | <title><filename>meta/recipes-devtools/</filename></title> | ||
1011 | |||
1012 | <para> | ||
1013 | This directory contains tools that are primarily used by the build system. | ||
1014 | The tools, however, can also be used on targets. | ||
1015 | </para> | ||
1016 | </section> | ||
1017 | |||
1018 | <section id='structure-meta-recipes-extended'> | ||
1019 | <title><filename>meta/recipes-extended/</filename></title> | ||
1020 | |||
1021 | <para> | ||
1022 | This directory contains non-essential applications that add features compared to the | ||
1023 | alternatives in core. | ||
1024 | You might need this directory for full tool functionality or for Linux Standard Base (LSB) | ||
1025 | compliance. | ||
1026 | </para> | ||
1027 | </section> | ||
1028 | |||
1029 | <section id='structure-meta-recipes-gnome'> | ||
1030 | <title><filename>meta/recipes-gnome/</filename></title> | ||
1031 | |||
1032 | <para> | ||
1033 | This directory contains all things related to the GTK+ application framework. | ||
1034 | </para> | ||
1035 | </section> | ||
1036 | |||
1037 | <section id='structure-meta-recipes-graphics'> | ||
1038 | <title><filename>meta/recipes-graphics/</filename></title> | ||
1039 | |||
1040 | <para> | ||
1041 | This directory contains X and other graphically related system libraries | ||
1042 | </para> | ||
1043 | </section> | ||
1044 | |||
1045 | <section id='structure-meta-recipes-kernel'> | ||
1046 | <title><filename>meta/recipes-kernel/</filename></title> | ||
1047 | |||
1048 | <para> | ||
1049 | This directory contains the kernel and generic applications and libraries that | ||
1050 | have strong kernel dependencies. | ||
1051 | </para> | ||
1052 | </section> | ||
1053 | |||
1054 | <section id='structure-meta-recipes-lsb4'> | ||
1055 | <title><filename>meta/recipes-lsb4/</filename></title> | ||
1056 | |||
1057 | <para> | ||
1058 | This directory contains recipes specifically added to support | ||
1059 | the Linux Standard Base (LSB) version 4.x. | ||
1060 | </para> | ||
1061 | </section> | ||
1062 | |||
1063 | <section id='structure-meta-recipes-multimedia'> | ||
1064 | <title><filename>meta/recipes-multimedia/</filename></title> | ||
1065 | |||
1066 | <para> | ||
1067 | This directory contains codecs and support utilities for audio, images and video. | ||
1068 | </para> | ||
1069 | </section> | ||
1070 | |||
1071 | <section id='structure-meta-recipes-qt'> | ||
1072 | <title><filename>meta/recipes-qt/</filename></title> | ||
1073 | |||
1074 | <para> | ||
1075 | This directory contains all things related to the Qt application framework. | ||
1076 | </para> | ||
1077 | </section> | ||
1078 | |||
1079 | <section id='structure-meta-recipes-rt'> | ||
1080 | <title><filename>meta/recipes-rt/</filename></title> | ||
1081 | |||
1082 | <para> | ||
1083 | This directory contains package and image recipes for using and testing | ||
1084 | the <filename>PREEMPT_RT</filename> kernel. | ||
1085 | </para> | ||
1086 | </section> | ||
1087 | |||
1088 | <section id='structure-meta-recipes-sato'> | ||
1089 | <title><filename>meta/recipes-sato/</filename></title> | ||
1090 | |||
1091 | <para> | ||
1092 | This directory contains the Sato demo/reference UI/UX and its associated applications | ||
1093 | and configuration data. | ||
1094 | </para> | ||
1095 | </section> | ||
1096 | |||
1097 | <section id='structure-meta-recipes-support'> | ||
1098 | <title><filename>meta/recipes-support/</filename></title> | ||
1099 | |||
1100 | <para> | ||
1101 | This directory contains recipes used by other recipes, but that are | ||
1102 | not directly included in images (i.e. dependencies of other | ||
1103 | recipes). | ||
1104 | </para> | ||
1105 | </section> | ||
1106 | |||
1107 | <section id='structure-meta-site'> | ||
1108 | <title><filename>meta/site/</filename></title> | ||
1109 | |||
1110 | <para> | ||
1111 | This directory contains a list of cached results for various architectures. | ||
1112 | Because certain "autoconf" test results cannot be determined when cross-compiling due to | ||
1113 | the tests not able to run on a live system, the information in this directory is | ||
1114 | passed to "autoconf" for the various architectures. | ||
1115 | </para> | ||
1116 | </section> | ||
1117 | |||
1118 | <section id='structure-meta-recipes-txt'> | ||
1119 | <title><filename>meta/recipes.txt</filename></title> | ||
1120 | |||
1121 | <para> | ||
1122 | This file is a description of the contents of <filename>recipes-*</filename>. | ||
1123 | </para> | ||
1124 | </section> | ||
1125 | </section> | ||
1126 | |||
1127 | </chapter> | ||
1128 | <!-- | ||
1129 | vim: expandtab tw=80 ts=4 | ||
1130 | --> | ||
diff --git a/documentation/ref-manual/ref-style.css b/documentation/ref-manual/ref-style.css new file mode 100644 index 0000000..e04b500 --- /dev/null +++ b/documentation/ref-manual/ref-style.css | |||
@@ -0,0 +1,985 @@ | |||
1 | /* | ||
2 | Generic XHTML / DocBook XHTML CSS Stylesheet. | ||
3 | |||
4 | Browser wrangling and typographic design by | ||
5 | Oyvind Kolas / pippin@gimp.org | ||
6 | |||
7 | Customised for Poky by | ||
8 | Matthew Allum / mallum@o-hand.com | ||
9 | |||
10 | Thanks to: | ||
11 | Liam R. E. Quin | ||
12 | William Skaggs | ||
13 | Jakub Steiner | ||
14 | |||
15 | Structure | ||
16 | --------- | ||
17 | |||
18 | The stylesheet is divided into the following sections: | ||
19 | |||
20 | Positioning | ||
21 | Margins, paddings, width, font-size, clearing. | ||
22 | Decorations | ||
23 | Borders, style | ||
24 | Colors | ||
25 | Colors | ||
26 | Graphics | ||
27 | Graphical backgrounds | ||
28 | Nasty IE tweaks | ||
29 | Workarounds needed to make it work in internet explorer, | ||
30 | currently makes the stylesheet non validating, but up until | ||
31 | this point it is validating. | ||
32 | Mozilla extensions | ||
33 | Transparency for footer | ||
34 | Rounded corners on boxes | ||
35 | |||
36 | */ | ||
37 | |||
38 | |||
39 | /*************** / | ||
40 | / Positioning / | ||
41 | / ***************/ | ||
42 | |||
43 | body { | ||
44 | font-family: Verdana, Sans, sans-serif; | ||
45 | |||
46 | min-width: 640px; | ||
47 | width: 80%; | ||
48 | margin: 0em auto; | ||
49 | padding: 2em 5em 5em 5em; | ||
50 | color: #333; | ||
51 | } | ||
52 | |||
53 | h1,h2,h3,h4,h5,h6,h7 { | ||
54 | font-family: Arial, Sans; | ||
55 | color: #00557D; | ||
56 | clear: both; | ||
57 | } | ||
58 | |||
59 | h1 { | ||
60 | font-size: 2em; | ||
61 | text-align: left; | ||
62 | padding: 0em 0em 0em 0em; | ||
63 | margin: 2em 0em 0em 0em; | ||
64 | } | ||
65 | |||
66 | h2.subtitle { | ||
67 | margin: 0.10em 0em 3.0em 0em; | ||
68 | padding: 0em 0em 0em 0em; | ||
69 | font-size: 1.8em; | ||
70 | padding-left: 20%; | ||
71 | font-weight: normal; | ||
72 | font-style: italic; | ||
73 | } | ||
74 | |||
75 | h2 { | ||
76 | margin: 2em 0em 0.66em 0em; | ||
77 | padding: 0.5em 0em 0em 0em; | ||
78 | font-size: 1.5em; | ||
79 | font-weight: bold; | ||
80 | } | ||
81 | |||
82 | h3.subtitle { | ||
83 | margin: 0em 0em 1em 0em; | ||
84 | padding: 0em 0em 0em 0em; | ||
85 | font-size: 142.14%; | ||
86 | text-align: right; | ||
87 | } | ||
88 | |||
89 | h3 { | ||
90 | margin: 1em 0em 0.5em 0em; | ||
91 | padding: 1em 0em 0em 0em; | ||
92 | font-size: 140%; | ||
93 | font-weight: bold; | ||
94 | } | ||
95 | |||
96 | h4 { | ||
97 | margin: 1em 0em 0.5em 0em; | ||
98 | padding: 1em 0em 0em 0em; | ||
99 | font-size: 120%; | ||
100 | font-weight: bold; | ||
101 | } | ||
102 | |||
103 | h5 { | ||
104 | margin: 1em 0em 0.5em 0em; | ||
105 | padding: 1em 0em 0em 0em; | ||
106 | font-size: 110%; | ||
107 | font-weight: bold; | ||
108 | } | ||
109 | |||
110 | h6 { | ||
111 | margin: 1em 0em 0em 0em; | ||
112 | padding: 1em 0em 0em 0em; | ||
113 | font-size: 110%; | ||
114 | font-weight: bold; | ||
115 | } | ||
116 | |||
117 | .authorgroup { | ||
118 | background-color: transparent; | ||
119 | background-repeat: no-repeat; | ||
120 | padding-top: 256px; | ||
121 | background-image: url("figures/poky-title.png"); | ||
122 | background-position: left top; | ||
123 | margin-top: -256px; | ||
124 | padding-right: 50px; | ||
125 | margin-left: 0px; | ||
126 | text-align: right; | ||
127 | width: 740px; | ||
128 | } | ||
129 | |||
130 | h3.author { | ||
131 | margin: 0em 0me 0em 0em; | ||
132 | padding: 0em 0em 0em 0em; | ||
133 | font-weight: normal; | ||
134 | font-size: 100%; | ||
135 | color: #333; | ||
136 | clear: both; | ||
137 | } | ||
138 | |||
139 | .author tt.email { | ||
140 | font-size: 66%; | ||
141 | } | ||
142 | |||
143 | .titlepage hr { | ||
144 | width: 0em; | ||
145 | clear: both; | ||
146 | } | ||
147 | |||
148 | .revhistory { | ||
149 | padding-top: 2em; | ||
150 | clear: both; | ||
151 | } | ||
152 | |||
153 | .toc, | ||
154 | .list-of-tables, | ||
155 | .list-of-examples, | ||
156 | .list-of-figures { | ||
157 | padding: 1.33em 0em 2.5em 0em; | ||
158 | color: #00557D; | ||
159 | } | ||
160 | |||
161 | .toc p, | ||
162 | .list-of-tables p, | ||
163 | .list-of-figures p, | ||
164 | .list-of-examples p { | ||
165 | padding: 0em 0em 0em 0em; | ||
166 | padding: 0em 0em 0.3em; | ||
167 | margin: 1.5em 0em 0em 0em; | ||
168 | } | ||
169 | |||
170 | .toc p b, | ||
171 | .list-of-tables p b, | ||
172 | .list-of-figures p b, | ||
173 | .list-of-examples p b{ | ||
174 | font-size: 100.0%; | ||
175 | font-weight: bold; | ||
176 | } | ||
177 | |||
178 | .toc dl, | ||
179 | .list-of-tables dl, | ||
180 | .list-of-figures dl, | ||
181 | .list-of-examples dl { | ||
182 | margin: 0em 0em 0.5em 0em; | ||
183 | padding: 0em 0em 0em 0em; | ||
184 | } | ||
185 | |||
186 | .toc dt { | ||
187 | margin: 0em 0em 0em 0em; | ||
188 | padding: 0em 0em 0em 0em; | ||
189 | } | ||
190 | |||
191 | .toc dd { | ||
192 | margin: 0em 0em 0em 2.6em; | ||
193 | padding: 0em 0em 0em 0em; | ||
194 | } | ||
195 | |||
196 | div.glossary dl, | ||
197 | div.variablelist dl { | ||
198 | } | ||
199 | |||
200 | .glossary dl dt, | ||
201 | .variablelist dl dt, | ||
202 | .variablelist dl dt span.term { | ||
203 | font-weight: normal; | ||
204 | width: 20em; | ||
205 | text-align: right; | ||
206 | } | ||
207 | |||
208 | .variablelist dl dt { | ||
209 | margin-top: 0.5em; | ||
210 | } | ||
211 | |||
212 | .glossary dl dd, | ||
213 | .variablelist dl dd { | ||
214 | margin-top: -1em; | ||
215 | margin-left: 25.5em; | ||
216 | } | ||
217 | |||
218 | .glossary dd p, | ||
219 | .variablelist dd p { | ||
220 | margin-top: 0em; | ||
221 | margin-bottom: 1em; | ||
222 | } | ||
223 | |||
224 | |||
225 | div.calloutlist table td { | ||
226 | padding: 0em 0em 0em 0em; | ||
227 | margin: 0em 0em 0em 0em; | ||
228 | } | ||
229 | |||
230 | div.calloutlist table td p { | ||
231 | margin-top: 0em; | ||
232 | margin-bottom: 1em; | ||
233 | } | ||
234 | |||
235 | div p.copyright { | ||
236 | text-align: left; | ||
237 | } | ||
238 | |||
239 | div.legalnotice p.legalnotice-title { | ||
240 | margin-bottom: 0em; | ||
241 | } | ||
242 | |||
243 | p { | ||
244 | line-height: 1.5em; | ||
245 | margin-top: 0em; | ||
246 | |||
247 | } | ||
248 | |||
249 | dl { | ||
250 | padding-top: 0em; | ||
251 | } | ||
252 | |||
253 | hr { | ||
254 | border: solid 1px; | ||
255 | } | ||
256 | |||
257 | |||
258 | .mediaobject, | ||
259 | .mediaobjectco { | ||
260 | text-align: center; | ||
261 | } | ||
262 | |||
263 | img { | ||
264 | border: none; | ||
265 | } | ||
266 | |||
267 | ul { | ||
268 | padding: 0em 0em 0em 1.5em; | ||
269 | } | ||
270 | |||
271 | ul li { | ||
272 | padding: 0em 0em 0em 0em; | ||
273 | } | ||
274 | |||
275 | ul li p { | ||
276 | text-align: left; | ||
277 | } | ||
278 | |||
279 | table { | ||
280 | width :100%; | ||
281 | } | ||
282 | |||
283 | th { | ||
284 | padding: 0.25em; | ||
285 | text-align: left; | ||
286 | font-weight: normal; | ||
287 | vertical-align: top; | ||
288 | } | ||
289 | |||
290 | td { | ||
291 | padding: 0.25em; | ||
292 | vertical-align: top; | ||
293 | } | ||
294 | |||
295 | p a[id] { | ||
296 | margin: 0px; | ||
297 | padding: 0px; | ||
298 | display: inline; | ||
299 | background-image: none; | ||
300 | } | ||
301 | |||
302 | a { | ||
303 | text-decoration: underline; | ||
304 | color: #444; | ||
305 | } | ||
306 | |||
307 | pre { | ||
308 | overflow: auto; | ||
309 | } | ||
310 | |||
311 | a:hover { | ||
312 | text-decoration: underline; | ||
313 | /*font-weight: bold;*/ | ||
314 | } | ||
315 | |||
316 | /* This style defines how the permalink character | ||
317 | appears by itself and when hovered over with | ||
318 | the mouse. */ | ||
319 | |||
320 | [alt='Permalink'] { color: #eee; } | ||
321 | [alt='Permalink']:hover { color: black; } | ||
322 | |||
323 | |||
324 | div.informalfigure, | ||
325 | div.informalexample, | ||
326 | div.informaltable, | ||
327 | div.figure, | ||
328 | div.table, | ||
329 | div.example { | ||
330 | margin: 1em 0em; | ||
331 | padding: 1em; | ||
332 | page-break-inside: avoid; | ||
333 | } | ||
334 | |||
335 | |||
336 | div.informalfigure p.title b, | ||
337 | div.informalexample p.title b, | ||
338 | div.informaltable p.title b, | ||
339 | div.figure p.title b, | ||
340 | div.example p.title b, | ||
341 | div.table p.title b{ | ||
342 | padding-top: 0em; | ||
343 | margin-top: 0em; | ||
344 | font-size: 100%; | ||
345 | font-weight: normal; | ||
346 | } | ||
347 | |||
348 | .mediaobject .caption, | ||
349 | .mediaobject .caption p { | ||
350 | text-align: center; | ||
351 | font-size: 80%; | ||
352 | padding-top: 0.5em; | ||
353 | padding-bottom: 0.5em; | ||
354 | } | ||
355 | |||
356 | .epigraph { | ||
357 | padding-left: 55%; | ||
358 | margin-bottom: 1em; | ||
359 | } | ||
360 | |||
361 | .epigraph p { | ||
362 | text-align: left; | ||
363 | } | ||
364 | |||
365 | .epigraph .quote { | ||
366 | font-style: italic; | ||
367 | } | ||
368 | .epigraph .attribution { | ||
369 | font-style: normal; | ||
370 | text-align: right; | ||
371 | } | ||
372 | |||
373 | span.application { | ||
374 | font-style: italic; | ||
375 | } | ||
376 | |||
377 | .programlisting { | ||
378 | font-family: monospace; | ||
379 | font-size: 80%; | ||
380 | white-space: pre; | ||
381 | margin: 1.33em 0em; | ||
382 | padding: 1.33em; | ||
383 | } | ||
384 | |||
385 | .tip, | ||
386 | .warning, | ||
387 | .caution, | ||
388 | .note { | ||
389 | margin-top: 1em; | ||
390 | margin-bottom: 1em; | ||
391 | |||
392 | } | ||
393 | |||
394 | /* force full width of table within div */ | ||
395 | .tip table, | ||
396 | .warning table, | ||
397 | .caution table, | ||
398 | .note table { | ||
399 | border: none; | ||
400 | width: 100%; | ||
401 | } | ||
402 | |||
403 | |||
404 | .tip table th, | ||
405 | .warning table th, | ||
406 | .caution table th, | ||
407 | .note table th { | ||
408 | padding: 0.8em 0.0em 0.0em 0.0em; | ||
409 | margin : 0em 0em 0em 0em; | ||
410 | } | ||
411 | |||
412 | .tip p, | ||
413 | .warning p, | ||
414 | .caution p, | ||
415 | .note p { | ||
416 | margin-top: 0.5em; | ||
417 | margin-bottom: 0.5em; | ||
418 | padding-right: 1em; | ||
419 | text-align: left; | ||
420 | } | ||
421 | |||
422 | .acronym { | ||
423 | text-transform: uppercase; | ||
424 | } | ||
425 | |||
426 | b.keycap, | ||
427 | .keycap { | ||
428 | padding: 0.09em 0.3em; | ||
429 | margin: 0em; | ||
430 | } | ||
431 | |||
432 | .itemizedlist li { | ||
433 | clear: none; | ||
434 | } | ||
435 | |||
436 | .filename { | ||
437 | font-size: medium; | ||
438 | font-family: Courier, monospace; | ||
439 | } | ||
440 | |||
441 | |||
442 | div.navheader, div.heading{ | ||
443 | position: absolute; | ||
444 | left: 0em; | ||
445 | top: 0em; | ||
446 | width: 100%; | ||
447 | background-color: #cdf; | ||
448 | width: 100%; | ||
449 | } | ||
450 | |||
451 | div.navfooter, div.footing{ | ||
452 | position: fixed; | ||
453 | left: 0em; | ||
454 | bottom: 0em; | ||
455 | background-color: #eee; | ||
456 | width: 100%; | ||
457 | } | ||
458 | |||
459 | |||
460 | div.navheader td, | ||
461 | div.navfooter td { | ||
462 | font-size: 66%; | ||
463 | } | ||
464 | |||
465 | div.navheader table th { | ||
466 | /*font-family: Georgia, Times, serif;*/ | ||
467 | /*font-size: x-large;*/ | ||
468 | font-size: 80%; | ||
469 | } | ||
470 | |||
471 | div.navheader table { | ||
472 | border-left: 0em; | ||
473 | border-right: 0em; | ||
474 | border-top: 0em; | ||
475 | width: 100%; | ||
476 | } | ||
477 | |||
478 | div.navfooter table { | ||
479 | border-left: 0em; | ||
480 | border-right: 0em; | ||
481 | border-bottom: 0em; | ||
482 | width: 100%; | ||
483 | } | ||
484 | |||
485 | div.navheader table td a, | ||
486 | div.navfooter table td a { | ||
487 | color: #777; | ||
488 | text-decoration: none; | ||
489 | } | ||
490 | |||
491 | /* normal text in the footer */ | ||
492 | div.navfooter table td { | ||
493 | color: black; | ||
494 | } | ||
495 | |||
496 | div.navheader table td a:visited, | ||
497 | div.navfooter table td a:visited { | ||
498 | color: #444; | ||
499 | } | ||
500 | |||
501 | |||
502 | /* links in header and footer */ | ||
503 | div.navheader table td a:hover, | ||
504 | div.navfooter table td a:hover { | ||
505 | text-decoration: underline; | ||
506 | background-color: transparent; | ||
507 | color: #33a; | ||
508 | } | ||
509 | |||
510 | div.navheader hr, | ||
511 | div.navfooter hr { | ||
512 | display: none; | ||
513 | } | ||
514 | |||
515 | |||
516 | .qandaset tr.question td p { | ||
517 | margin: 0em 0em 1em 0em; | ||
518 | padding: 0em 0em 0em 0em; | ||
519 | } | ||
520 | |||
521 | .qandaset tr.answer td p { | ||
522 | margin: 0em 0em 1em 0em; | ||
523 | padding: 0em 0em 0em 0em; | ||
524 | } | ||
525 | .answer td { | ||
526 | padding-bottom: 1.5em; | ||
527 | } | ||
528 | |||
529 | .emphasis { | ||
530 | font-weight: bold; | ||
531 | } | ||
532 | |||
533 | |||
534 | /************* / | ||
535 | / decorations / | ||
536 | / *************/ | ||
537 | |||
538 | .titlepage { | ||
539 | } | ||
540 | |||
541 | .part .title { | ||
542 | } | ||
543 | |||
544 | .subtitle { | ||
545 | border: none; | ||
546 | } | ||
547 | |||
548 | /* | ||
549 | h1 { | ||
550 | border: none; | ||
551 | } | ||
552 | |||
553 | h2 { | ||
554 | border-top: solid 0.2em; | ||
555 | border-bottom: solid 0.06em; | ||
556 | } | ||
557 | |||
558 | h3 { | ||
559 | border-top: 0em; | ||
560 | border-bottom: solid 0.06em; | ||
561 | } | ||
562 | |||
563 | h4 { | ||
564 | border: 0em; | ||
565 | border-bottom: solid 0.06em; | ||
566 | } | ||
567 | |||
568 | h5 { | ||
569 | border: 0em; | ||
570 | } | ||
571 | */ | ||
572 | |||
573 | .programlisting { | ||
574 | border: solid 1px; | ||
575 | } | ||
576 | |||
577 | div.figure, | ||
578 | div.table, | ||
579 | div.informalfigure, | ||
580 | div.informaltable, | ||
581 | div.informalexample, | ||
582 | div.example { | ||
583 | border: 1px solid; | ||
584 | } | ||
585 | |||
586 | |||
587 | |||
588 | .tip, | ||
589 | .warning, | ||
590 | .caution, | ||
591 | .note { | ||
592 | border: 1px solid; | ||
593 | } | ||
594 | |||
595 | .tip table th, | ||
596 | .warning table th, | ||
597 | .caution table th, | ||
598 | .note table th { | ||
599 | border-bottom: 1px solid; | ||
600 | } | ||
601 | |||
602 | .question td { | ||
603 | border-top: 1px solid black; | ||
604 | } | ||
605 | |||
606 | .answer { | ||
607 | } | ||
608 | |||
609 | |||
610 | b.keycap, | ||
611 | .keycap { | ||
612 | border: 1px solid; | ||
613 | } | ||
614 | |||
615 | |||
616 | div.navheader, div.heading{ | ||
617 | border-bottom: 1px solid; | ||
618 | } | ||
619 | |||
620 | |||
621 | div.navfooter, div.footing{ | ||
622 | border-top: 1px solid; | ||
623 | } | ||
624 | |||
625 | /********* / | ||
626 | / colors / | ||
627 | / *********/ | ||
628 | |||
629 | body { | ||
630 | color: #333; | ||
631 | background: white; | ||
632 | } | ||
633 | |||
634 | a { | ||
635 | background: transparent; | ||
636 | } | ||
637 | |||
638 | a:hover { | ||
639 | background-color: #dedede; | ||
640 | } | ||
641 | |||
642 | |||
643 | h1, | ||
644 | h2, | ||
645 | h3, | ||
646 | h4, | ||
647 | h5, | ||
648 | h6, | ||
649 | h7, | ||
650 | h8 { | ||
651 | background-color: transparent; | ||
652 | } | ||
653 | |||
654 | hr { | ||
655 | border-color: #aaa; | ||
656 | } | ||
657 | |||
658 | |||
659 | .tip, .warning, .caution, .note { | ||
660 | border-color: #fff; | ||
661 | } | ||
662 | |||
663 | |||
664 | .tip table th, | ||
665 | .warning table th, | ||
666 | .caution table th, | ||
667 | .note table th { | ||
668 | border-bottom-color: #fff; | ||
669 | } | ||
670 | |||
671 | |||
672 | .warning { | ||
673 | background-color: #f0f0f2; | ||
674 | } | ||
675 | |||
676 | .caution { | ||
677 | background-color: #f0f0f2; | ||
678 | } | ||
679 | |||
680 | .tip { | ||
681 | background-color: #f0f0f2; | ||
682 | } | ||
683 | |||
684 | .note { | ||
685 | background-color: #f0f0f2; | ||
686 | } | ||
687 | |||
688 | .glossary dl dt, | ||
689 | .variablelist dl dt, | ||
690 | .variablelist dl dt span.term { | ||
691 | color: #044; | ||
692 | } | ||
693 | |||
694 | div.figure, | ||
695 | div.table, | ||
696 | div.example, | ||
697 | div.informalfigure, | ||
698 | div.informaltable, | ||
699 | div.informalexample { | ||
700 | border-color: #aaa; | ||
701 | } | ||
702 | |||
703 | pre.programlisting { | ||
704 | color: black; | ||
705 | background-color: #fff; | ||
706 | border-color: #aaa; | ||
707 | border-width: 2px; | ||
708 | } | ||
709 | |||
710 | .guimenu, | ||
711 | .guilabel, | ||
712 | .guimenuitem { | ||
713 | background-color: #eee; | ||
714 | } | ||
715 | |||
716 | |||
717 | b.keycap, | ||
718 | .keycap { | ||
719 | background-color: #eee; | ||
720 | border-color: #999; | ||
721 | } | ||
722 | |||
723 | |||
724 | div.navheader { | ||
725 | border-color: black; | ||
726 | } | ||
727 | |||
728 | |||
729 | div.navfooter { | ||
730 | border-color: black; | ||
731 | } | ||
732 | |||
733 | |||
734 | /*********** / | ||
735 | / graphics / | ||
736 | / ***********/ | ||
737 | |||
738 | /* | ||
739 | body { | ||
740 | background-image: url("images/body_bg.jpg"); | ||
741 | background-attachment: fixed; | ||
742 | } | ||
743 | |||
744 | .navheader, | ||
745 | .note, | ||
746 | .tip { | ||
747 | background-image: url("images/note_bg.jpg"); | ||
748 | background-attachment: fixed; | ||
749 | } | ||
750 | |||
751 | .warning, | ||
752 | .caution { | ||
753 | background-image: url("images/warning_bg.jpg"); | ||
754 | background-attachment: fixed; | ||
755 | } | ||
756 | |||
757 | .figure, | ||
758 | .informalfigure, | ||
759 | .example, | ||
760 | .informalexample, | ||
761 | .table, | ||
762 | .informaltable { | ||
763 | background-image: url("images/figure_bg.jpg"); | ||
764 | background-attachment: fixed; | ||
765 | } | ||
766 | |||
767 | */ | ||
768 | h1, | ||
769 | h2, | ||
770 | h3, | ||
771 | h4, | ||
772 | h5, | ||
773 | h6, | ||
774 | h7{ | ||
775 | } | ||
776 | |||
777 | /* | ||
778 | Example of how to stick an image as part of the title. | ||
779 | |||
780 | div.article .titlepage .title | ||
781 | { | ||
782 | background-image: url("figures/white-on-black.png"); | ||
783 | background-position: center; | ||
784 | background-repeat: repeat-x; | ||
785 | } | ||
786 | */ | ||
787 | |||
788 | div.preface .titlepage .title, | ||
789 | div.colophon .title, | ||
790 | div.chapter .titlepage .title, | ||
791 | div.article .titlepage .title | ||
792 | { | ||
793 | } | ||
794 | |||
795 | div.section div.section .titlepage .title, | ||
796 | div.sect2 .titlepage .title { | ||
797 | background: none; | ||
798 | } | ||
799 | |||
800 | |||
801 | h1.title { | ||
802 | background-color: transparent; | ||
803 | background-image: url("figures/poky-title.png"); | ||
804 | background-repeat: no-repeat; | ||
805 | height: 256px; | ||
806 | text-indent: -9000px; | ||
807 | overflow:hidden; | ||
808 | } | ||
809 | |||
810 | h2.subtitle { | ||
811 | background-color: transparent; | ||
812 | text-indent: -9000px; | ||
813 | overflow:hidden; | ||
814 | width: 0px; | ||
815 | display: none; | ||
816 | } | ||
817 | |||
818 | /*************************************** / | ||
819 | / pippin.gimp.org specific alterations / | ||
820 | / ***************************************/ | ||
821 | |||
822 | /* | ||
823 | div.heading, div.navheader { | ||
824 | color: #777; | ||
825 | font-size: 80%; | ||
826 | padding: 0; | ||
827 | margin: 0; | ||
828 | text-align: left; | ||
829 | position: absolute; | ||
830 | top: 0px; | ||
831 | left: 0px; | ||
832 | width: 100%; | ||
833 | height: 50px; | ||
834 | background: url('/gfx/heading_bg.png') transparent; | ||
835 | background-repeat: repeat-x; | ||
836 | background-attachment: fixed; | ||
837 | border: none; | ||
838 | } | ||
839 | |||
840 | div.heading a { | ||
841 | color: #444; | ||
842 | } | ||
843 | |||
844 | div.footing, div.navfooter { | ||
845 | border: none; | ||
846 | color: #ddd; | ||
847 | font-size: 80%; | ||
848 | text-align:right; | ||
849 | |||
850 | width: 100%; | ||
851 | padding-top: 10px; | ||
852 | position: absolute; | ||
853 | bottom: 0px; | ||
854 | left: 0px; | ||
855 | |||
856 | background: url('/gfx/footing_bg.png') transparent; | ||
857 | } | ||
858 | */ | ||
859 | |||
860 | |||
861 | |||
862 | /****************** / | ||
863 | / nasty ie tweaks / | ||
864 | / ******************/ | ||
865 | |||
866 | /* | ||
867 | div.heading, div.navheader { | ||
868 | width:expression(document.body.clientWidth + "px"); | ||
869 | } | ||
870 | |||
871 | div.footing, div.navfooter { | ||
872 | width:expression(document.body.clientWidth + "px"); | ||
873 | margin-left:expression("-5em"); | ||
874 | } | ||
875 | body { | ||
876 | padding:expression("4em 5em 0em 5em"); | ||
877 | } | ||
878 | */ | ||
879 | |||
880 | /**************************************** / | ||
881 | / mozilla vendor specific css extensions / | ||
882 | / ****************************************/ | ||
883 | /* | ||
884 | div.navfooter, div.footing{ | ||
885 | -moz-opacity: 0.8em; | ||
886 | } | ||
887 | |||
888 | div.figure, | ||
889 | div.table, | ||
890 | div.informalfigure, | ||
891 | div.informaltable, | ||
892 | div.informalexample, | ||
893 | div.example, | ||
894 | .tip, | ||
895 | .warning, | ||
896 | .caution, | ||
897 | .note { | ||
898 | -moz-border-radius: 0.5em; | ||
899 | } | ||
900 | |||
901 | b.keycap, | ||
902 | .keycap { | ||
903 | -moz-border-radius: 0.3em; | ||
904 | } | ||
905 | */ | ||
906 | |||
907 | table tr td table tr td { | ||
908 | display: none; | ||
909 | } | ||
910 | |||
911 | |||
912 | hr { | ||
913 | display: none; | ||
914 | } | ||
915 | |||
916 | table { | ||
917 | border: 0em; | ||
918 | } | ||
919 | |||
920 | .photo { | ||
921 | float: right; | ||
922 | margin-left: 1.5em; | ||
923 | margin-bottom: 1.5em; | ||
924 | margin-top: 0em; | ||
925 | max-width: 17em; | ||
926 | border: 1px solid gray; | ||
927 | padding: 3px; | ||
928 | background: white; | ||
929 | } | ||
930 | .seperator { | ||
931 | padding-top: 2em; | ||
932 | clear: both; | ||
933 | } | ||
934 | |||
935 | #validators { | ||
936 | margin-top: 5em; | ||
937 | text-align: right; | ||
938 | color: #777; | ||
939 | } | ||
940 | @media print { | ||
941 | body { | ||
942 | font-size: 8pt; | ||
943 | } | ||
944 | .noprint { | ||
945 | display: none; | ||
946 | } | ||
947 | } | ||
948 | |||
949 | |||
950 | .tip, | ||
951 | .note { | ||
952 | background: #f0f0f2; | ||
953 | color: #333; | ||
954 | padding: 20px; | ||
955 | margin: 20px; | ||
956 | } | ||
957 | |||
958 | .tip h3, | ||
959 | .note h3 { | ||
960 | padding: 0em; | ||
961 | margin: 0em; | ||
962 | font-size: 2em; | ||
963 | font-weight: bold; | ||
964 | color: #333; | ||
965 | } | ||
966 | |||
967 | .tip a, | ||
968 | .note a { | ||
969 | color: #333; | ||
970 | text-decoration: underline; | ||
971 | } | ||
972 | |||
973 | .footnote { | ||
974 | font-size: small; | ||
975 | color: #333; | ||
976 | } | ||
977 | |||
978 | /* Changes the announcement text */ | ||
979 | .tip h3, | ||
980 | .warning h3, | ||
981 | .caution h3, | ||
982 | .note h3 { | ||
983 | font-size:large; | ||
984 | color: #00557D; | ||
985 | } | ||
diff --git a/documentation/ref-manual/ref-tasks.xml b/documentation/ref-manual/ref-tasks.xml new file mode 100644 index 0000000..fc23a7b --- /dev/null +++ b/documentation/ref-manual/ref-tasks.xml | |||
@@ -0,0 +1,684 @@ | |||
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 | |||
5 | <chapter id='ref-tasks'> | ||
6 | <title>Tasks</title> | ||
7 | |||
8 | <para> | ||
9 | Tasks are units of execution for BitBake. | ||
10 | Recipes (<filename>.bb</filename> files) use tasks to complete | ||
11 | configuring, compiling, and packaging software. | ||
12 | This chapter provides a reference of the tasks defined in the | ||
13 | OpenEmbedded build system. | ||
14 | </para> | ||
15 | |||
16 | <section id='normal-recipe-build-tasks'> | ||
17 | <title>Normal Recipe Build Tasks</title> | ||
18 | |||
19 | <para> | ||
20 | The following sections describe normal tasks associated with building | ||
21 | a recipe. | ||
22 | </para> | ||
23 | |||
24 | <section id='ref-tasks-build'> | ||
25 | <title><filename>do_build</filename></title> | ||
26 | |||
27 | <para> | ||
28 | The default task for all recipes. | ||
29 | This task depends on all other normal tasks | ||
30 | required to build a recipe. | ||
31 | </para> | ||
32 | </section> | ||
33 | |||
34 | <section id='ref-tasks-compile'> | ||
35 | <title><filename>do_compile</filename></title> | ||
36 | |||
37 | <para> | ||
38 | Compiles the source in the compilation directory, which is pointed | ||
39 | to by the | ||
40 | <link linkend='var-B'><filename>B</filename></link> variable. | ||
41 | </para> | ||
42 | </section> | ||
43 | |||
44 | <section id='ref-tasks-compile_ptest_base'> | ||
45 | <title><filename>do_compile_ptest_base</filename></title> | ||
46 | |||
47 | <para> | ||
48 | Compiles the runtime test suite included in the software being | ||
49 | built. | ||
50 | </para> | ||
51 | </section> | ||
52 | |||
53 | <section id='ref-tasks-configure'> | ||
54 | <title><filename>do_configure</filename></title> | ||
55 | |||
56 | <para> | ||
57 | Configures the source by enabling and disabling any build-time and | ||
58 | configuration options for the software being built. | ||
59 | </para> | ||
60 | </section> | ||
61 | |||
62 | <section id='ref-tasks-configure_ptest_base'> | ||
63 | <title><filename>do_configure_ptest_base</filename></title> | ||
64 | |||
65 | <para> | ||
66 | Configures the runtime test suite included in the software being | ||
67 | built. | ||
68 | </para> | ||
69 | </section> | ||
70 | |||
71 | <section id='ref-tasks-deploy'> | ||
72 | <title><filename>do_deploy</filename></title> | ||
73 | |||
74 | <para> | ||
75 | Writes output files that are to be deployed to the deploy | ||
76 | directory, which is defined by the | ||
77 | <link linkend='var-DEPLOYDIR'><filename>DEPLOYDIR</filename></link> | ||
78 | variable. | ||
79 | </para> | ||
80 | |||
81 | <para> | ||
82 | The <filename>do_deploy</filename> task is a | ||
83 | shared state (sstate) task, which means that the task can | ||
84 | be accelerated through sstate use. | ||
85 | Realize also that if the task is re-executed, any previous output | ||
86 | is removed (i.e. "cleaned"). | ||
87 | </para> | ||
88 | </section> | ||
89 | |||
90 | <section id='ref-tasks-fetch'> | ||
91 | <title><filename>do_fetch</filename></title> | ||
92 | |||
93 | <para> | ||
94 | Fetches the source code. | ||
95 | This task uses the | ||
96 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> | ||
97 | variable and the argument's prefix to determine the correct | ||
98 | fetcher module. | ||
99 | </para> | ||
100 | </section> | ||
101 | |||
102 | <section id='ref-tasks-install'> | ||
103 | <title><filename>do_install</filename></title> | ||
104 | |||
105 | <para> | ||
106 | Copies files from the compilation directory, which is defined by | ||
107 | the | ||
108 | <link linkend='var-B'><filename>B</filename></link> variable, | ||
109 | to a holding area defined by the | ||
110 | <link linkend='var-D'><filename>D</filename></link> variable. | ||
111 | </para> | ||
112 | </section> | ||
113 | |||
114 | <section id='ref-tasks-install_ptest_base'> | ||
115 | <title><filename>do_install_ptest_base</filename></title> | ||
116 | |||
117 | <para> | ||
118 | Copies the runtime test suite files from the compilation directory | ||
119 | to a holding area. | ||
120 | </para> | ||
121 | </section> | ||
122 | |||
123 | <section id='ref-tasks-package'> | ||
124 | <title><filename>do_package</filename></title> | ||
125 | |||
126 | <para> | ||
127 | Analyzes the content of the holding area and splits it into subsets | ||
128 | based on available packages and files. | ||
129 | </para> | ||
130 | </section> | ||
131 | |||
132 | <section id='ref-tasks-package_write_deb'> | ||
133 | <title><filename>do_package_write_deb</filename></title> | ||
134 | |||
135 | <para> | ||
136 | Creates the actual DEB packages and places them in the | ||
137 | <link linkend='package-feeds-dev-environment'>Package Feeds</link> | ||
138 | area. | ||
139 | </para> | ||
140 | </section> | ||
141 | |||
142 | <section id='ref-tasks-package_write_ipk'> | ||
143 | <title><filename>do_package_write_ipk</filename></title> | ||
144 | |||
145 | <para> | ||
146 | Creates the actual IPK packages and places them in the | ||
147 | <link linkend='package-feeds-dev-environment'>Package Feeds</link> | ||
148 | area. | ||
149 | </para> | ||
150 | </section> | ||
151 | |||
152 | <section id='ref-tasks-package_write_rpm'> | ||
153 | <title><filename>do_package_write_rpm</filename></title> | ||
154 | |||
155 | <para> | ||
156 | Creates the actual RPM packages and places them in the | ||
157 | <link linkend='package-feeds-dev-environment'>Package Feeds</link> | ||
158 | area. | ||
159 | </para> | ||
160 | </section> | ||
161 | |||
162 | <section id='ref-tasks-package_write_tar'> | ||
163 | <title><filename>do_package_write_tar</filename></title> | ||
164 | |||
165 | <para> | ||
166 | Creates tar archives for packages and places them in the | ||
167 | <link linkend='package-feeds-dev-environment'>Package Feeds</link> | ||
168 | area. | ||
169 | </para> | ||
170 | </section> | ||
171 | |||
172 | <section id='ref-tasks-packagedata'> | ||
173 | <title><filename>do_packagedata</filename></title> | ||
174 | |||
175 | <para> | ||
176 | Creates package metadata used by the build system to generate the | ||
177 | final packages. | ||
178 | </para> | ||
179 | </section> | ||
180 | |||
181 | <section id='ref-tasks-patch'> | ||
182 | <title><filename>do_patch</filename></title> | ||
183 | |||
184 | <para> | ||
185 | Locates patch files and applies them to the source code. | ||
186 | See the | ||
187 | "<link linkend='patching-dev-environment'>Patching</link>" | ||
188 | section for more information. | ||
189 | </para> | ||
190 | </section> | ||
191 | |||
192 | <section id='ref-tasks-populate_lic'> | ||
193 | <title><filename>do_populate_lic</filename></title> | ||
194 | |||
195 | <para> | ||
196 | Writes license information for the recipe that is collected later | ||
197 | when the image is constructed. | ||
198 | </para> | ||
199 | </section> | ||
200 | |||
201 | <section id='ref-tasks-populate_sdk'> | ||
202 | <title><filename>do_populate_sdk</filename></title> | ||
203 | |||
204 | <para> | ||
205 | Creates the file and directory structure for an installable SDK. | ||
206 | See the | ||
207 | "<link linkend='sdk-generation-dev-environment'>SDK Generation</link>" | ||
208 | section for more information. | ||
209 | </para> | ||
210 | </section> | ||
211 | |||
212 | <section id='ref-tasks-populate_sysroot'> | ||
213 | <title><filename>do_populate_sysroot</filename></title> | ||
214 | |||
215 | <para> | ||
216 | Copies a subset of files installed by the | ||
217 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
218 | task into the sysroot in order to make them available to other | ||
219 | recipes. | ||
220 | </para> | ||
221 | |||
222 | <para> | ||
223 | The <filename>do_populate_sysroot</filename> task is a | ||
224 | shared state (sstate) task, which means that the task can | ||
225 | be accelerated through sstate use. | ||
226 | Realize also that if the task is re-executed, any previous output | ||
227 | is removed (i.e. "cleaned"). | ||
228 | </para> | ||
229 | </section> | ||
230 | |||
231 | <section id='ref-tasks-rm_work'> | ||
232 | <title><filename>do_rm_work</filename></title> | ||
233 | |||
234 | <para> | ||
235 | Removes work files after the OpenEmbedded build system has | ||
236 | finished with them. | ||
237 | You can learn more by looking at the | ||
238 | "<link linkend='ref-classes-rm-work'><filename>rm_work.bbclass</filename></link>" | ||
239 | section. | ||
240 | </para> | ||
241 | </section> | ||
242 | |||
243 | <section id='ref-tasks-rm_work_all'> | ||
244 | <title><filename>do_rm_work_all</filename></title> | ||
245 | |||
246 | <para> | ||
247 | Top-level task for removing work files after the build system has | ||
248 | finished with them. | ||
249 | </para> | ||
250 | </section> | ||
251 | |||
252 | <section id='ref-tasks-unpack'> | ||
253 | <title><filename>do_unpack</filename></title> | ||
254 | |||
255 | <para> | ||
256 | Unpacks the source code into a working directory pointed to | ||
257 | by | ||
258 | <filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}</filename>. | ||
259 | The | ||
260 | <link linkend='var-S'><filename>S</filename></link> variable also | ||
261 | plays a role in where unpacked source files ultimately reside. | ||
262 | For more information on how source files are unpacked, see the | ||
263 | "<link linkend='source-fetching-dev-environment'>Source Fetching</link>" | ||
264 | section and the <filename>WORKDIR</filename> and | ||
265 | <filename>S</filename> variable descriptions. | ||
266 | </para> | ||
267 | </section> | ||
268 | </section> | ||
269 | |||
270 | <section id='manually-called-tasks'> | ||
271 | <title>Manually Called Tasks</title> | ||
272 | |||
273 | <para> | ||
274 | These tasks are typically manually triggered (e.g. by using the | ||
275 | <filename>bitbake -c</filename> command-line option): | ||
276 | </para> | ||
277 | |||
278 | <section id='ref-tasks-checkuri'> | ||
279 | <title><filename>do_checkuri</filename></title> | ||
280 | |||
281 | <para> | ||
282 | Validates the | ||
283 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> | ||
284 | value. | ||
285 | </para> | ||
286 | </section> | ||
287 | |||
288 | <section id='ref-tasks-checkuriall'> | ||
289 | <title><filename>do_checkuriall</filename></title> | ||
290 | |||
291 | <para> | ||
292 | Validates the | ||
293 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> | ||
294 | value for all recipes required to build a target. | ||
295 | </para> | ||
296 | </section> | ||
297 | |||
298 | <section id='ref-tasks-clean'> | ||
299 | <title><filename>do_clean</filename></title> | ||
300 | |||
301 | <para> | ||
302 | Removes all output files for a target from the | ||
303 | <link linkend='ref-tasks-unpack'><filename>do_unpack</filename></link> | ||
304 | task forward (i.e. | ||
305 | <link linkend='ref-tasks-patch'><filename>do_unpack</filename></link>, | ||
306 | <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>, | ||
307 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>, | ||
308 | <link linkend='ref-tasks-install'><filename>do_install</filename></link>, | ||
309 | and | ||
310 | <link linkend='ref-tasks-package'><filename>do_package</filename></link>). | ||
311 | </para> | ||
312 | |||
313 | <para> | ||
314 | You can run this task using BitBake as follows: | ||
315 | <literallayout class='monospaced'> | ||
316 | $ bitbake -c clean <recipe> | ||
317 | </literallayout> | ||
318 | </para> | ||
319 | |||
320 | <para> | ||
321 | Running this task does not remove the | ||
322 | <link linkend='shared-state-cache'>sstate</link>) cache | ||
323 | files. | ||
324 | Consequently, if no changes have been made and the recipe is | ||
325 | rebuilt after cleaning, output files are simply restored from the | ||
326 | sstate cache. | ||
327 | If you want to remove the sstate cache files for the recipe, | ||
328 | you need to use the | ||
329 | <link linkend='ref-tasks-cleansstate'><filename>do_cleansstate</filename></link> | ||
330 | task instead (i.e. <filename>bitbake -c cleansstate <recipe></filename>). | ||
331 | </para> | ||
332 | </section> | ||
333 | |||
334 | <section id='ref-tasks-cleanall'> | ||
335 | <title><filename>do_cleanall</filename></title> | ||
336 | |||
337 | <para> | ||
338 | Removes all output files, shared state | ||
339 | (<link linkend='shared-state-cache'>sstate</link>) cache, and | ||
340 | downloaded source files for a target (i.e. the contents of | ||
341 | <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>). | ||
342 | Essentially, the <filename>do_cleanall</filename> task is | ||
343 | identical to the | ||
344 | <link linkend='ref-tasks-cleansstate'><filename>do_cleansstate</filename></link> | ||
345 | task with the added removal of downloaded source files. | ||
346 | </para> | ||
347 | |||
348 | <para> | ||
349 | You can run this task using BitBake as follows: | ||
350 | <literallayout class='monospaced'> | ||
351 | $ bitbake -c cleanall <recipe> | ||
352 | </literallayout> | ||
353 | </para> | ||
354 | |||
355 | <para> | ||
356 | Typically, you would not normally use the | ||
357 | <filename>cleanall</filename> task. | ||
358 | Do so only if you want to start fresh with the | ||
359 | <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link> | ||
360 | task. | ||
361 | </para> | ||
362 | </section> | ||
363 | |||
364 | <section id='ref-tasks-cleansstate'> | ||
365 | <title><filename>do_cleansstate</filename></title> | ||
366 | |||
367 | <para> | ||
368 | Removes all output files and shared state | ||
369 | (<link linkend='shared-state-cache'>sstate</link>) | ||
370 | cache for a target. | ||
371 | Essentially, the <filename>do_cleansstate</filename> task is | ||
372 | identical to the | ||
373 | <link linkend='ref-tasks-clean'><filename>do_clean</filename></link> | ||
374 | task with the added removal of shared state | ||
375 | (<link linkend='shared-state-cache'>sstate</link>) cache. | ||
376 | </para> | ||
377 | |||
378 | <para> | ||
379 | You can run this task using BitBake as follows: | ||
380 | <literallayout class='monospaced'> | ||
381 | $ bitbake -c cleansstate <recipe> | ||
382 | </literallayout> | ||
383 | </para> | ||
384 | |||
385 | <para> | ||
386 | When you run the <filename>do_cleansstate</filename> task, | ||
387 | the OpenEmbedded build system no longer uses any | ||
388 | sstate. | ||
389 | Consequently, building the recipe from scratch is guaranteed. | ||
390 | <note> | ||
391 | The <filename>do_cleansstate</filename> task cannot remove | ||
392 | sstate from a remote sstate mirror. | ||
393 | If you need to build a target from scratch using remote | ||
394 | mirrors, use the "-f" option as follows: | ||
395 | <literallayout class='monospaced'> | ||
396 | $ bitbake -f -c do_cleansstate <target> | ||
397 | </literallayout> | ||
398 | </note> | ||
399 | </para> | ||
400 | </section> | ||
401 | |||
402 | <section id='ref-tasks-devshell'> | ||
403 | <title><filename>do_devshell</filename></title> | ||
404 | |||
405 | <para> | ||
406 | Starts a shell whose environment is set up for | ||
407 | development, debugging, or both. | ||
408 | See the | ||
409 | "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-devshell'>Using a Development Shell</ulink>" | ||
410 | section in the Yocto Project Development Manual for more | ||
411 | information about using <filename>devshell</filename>. | ||
412 | </para> | ||
413 | </section> | ||
414 | |||
415 | <section id='ref-tasks-fetchall'> | ||
416 | <title><filename>do_fetchall</filename></title> | ||
417 | |||
418 | <para> | ||
419 | Fetches all remote sources required to build a target. | ||
420 | </para> | ||
421 | </section> | ||
422 | |||
423 | <section id='ref-tasks-listtasks'> | ||
424 | <title><filename>do_listtasks</filename></title> | ||
425 | |||
426 | <para> | ||
427 | Lists all defined tasks for a target. | ||
428 | </para> | ||
429 | </section> | ||
430 | |||
431 | <section id='ref-tasks-package_index'> | ||
432 | <title><filename>do_package_index</filename></title> | ||
433 | |||
434 | <para> | ||
435 | Creates or updates the index in the | ||
436 | <link linkend='package-feeds-dev-environment'>Package Feeds</link> | ||
437 | area. | ||
438 | <note> | ||
439 | This task is not triggered with the | ||
440 | <filename>bitbake -c</filename> command-line option as | ||
441 | are the other tasks in this section. | ||
442 | Because this task is specifically for the | ||
443 | <filename>package-index</filename> recipe, | ||
444 | you run it using | ||
445 | <filename>bitbake package-index</filename>. | ||
446 | </note> | ||
447 | </para> | ||
448 | </section> | ||
449 | </section> | ||
450 | |||
451 | <section id='image-related-tasks'> | ||
452 | <title>Image-Related Tasks</title> | ||
453 | |||
454 | <para> | ||
455 | The following tasks are applicable to image recipes. | ||
456 | </para> | ||
457 | |||
458 | <section id='ref-tasks-bootimg'> | ||
459 | <title><filename>do_bootimg</filename></title> | ||
460 | |||
461 | <para> | ||
462 | Creates a bootable live image. | ||
463 | See the | ||
464 | <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link> | ||
465 | variable for additional information on live image types. | ||
466 | </para> | ||
467 | </section> | ||
468 | |||
469 | <section id='ref-tasks-bundle_initramfs'> | ||
470 | <title><filename>do_bundle_initramfs</filename></title> | ||
471 | |||
472 | <para> | ||
473 | Combines an initial RAM disk (initramfs) image and kernel | ||
474 | together to form a single image. | ||
475 | The | ||
476 | <link linkend='var-CONFIG_INITRAMFS_SOURCE'><filename>CONFIG_INITRAMFS_SOURCE</filename></link> | ||
477 | variable has some more information about these types of images. | ||
478 | </para> | ||
479 | </section> | ||
480 | |||
481 | <section id='ref-tasks-rootfs'> | ||
482 | <title><filename>do_rootfs</filename></title> | ||
483 | |||
484 | <para> | ||
485 | Creates the root filesystem (file and directory structure) for an | ||
486 | image. | ||
487 | See the | ||
488 | "<link linkend='image-generation-dev-environment'>Image Generation</link>" | ||
489 | section for more information on how the root filesystem is created. | ||
490 | </para> | ||
491 | </section> | ||
492 | |||
493 | <section id='ref-tasks-testimage'> | ||
494 | <title><filename>do_testimage</filename></title> | ||
495 | |||
496 | <para> | ||
497 | Boots an image and performs runtime tests within the image. | ||
498 | For information on automatically testing images, see the | ||
499 | "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>" | ||
500 | section in the Yocto Project Development Manual. | ||
501 | </para> | ||
502 | </section> | ||
503 | |||
504 | <section id='ref-tasks-testimage_auto'> | ||
505 | <title><filename>do_testimage_auto</filename></title> | ||
506 | |||
507 | <para> | ||
508 | Boots an image and performs runtime tests within the image | ||
509 | immediately after it has been built. | ||
510 | This task is enabled when you set | ||
511 | <link linkend='var-TEST_IMAGE'><filename>TEST_IMAGE</filename></link> | ||
512 | equal to "1". | ||
513 | </para> | ||
514 | |||
515 | <para> | ||
516 | For information on automatically testing images, see the | ||
517 | "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>" | ||
518 | section in the Yocto Project Development Manual. | ||
519 | </para> | ||
520 | </section> | ||
521 | |||
522 | <section id='ref-tasks-vmdkimg'> | ||
523 | <title><filename>do_vmdkimg</filename></title> | ||
524 | |||
525 | <para> | ||
526 | Creates a <filename>.vmdk</filename> image for use with | ||
527 | <ulink url='http://www.vmware.com/'>VMware</ulink> | ||
528 | and compatible virtual machine hosts. | ||
529 | </para> | ||
530 | </section> | ||
531 | </section> | ||
532 | |||
533 | <section id='kernel-related-tasks'> | ||
534 | <title>Kernel-Related Tasks</title> | ||
535 | |||
536 | <para> | ||
537 | The following tasks are applicable to kernel recipes. | ||
538 | Some of these tasks (e.g. the | ||
539 | <link linkend='ref-tasks-menuconfig'><filename>do_menuconfig</filename></link> | ||
540 | task) are also applicable to recipes that use | ||
541 | Linux kernel style configuration such as the BusyBox recipe. | ||
542 | </para> | ||
543 | |||
544 | <section id='ref-tasks-compile_kernelmodules'> | ||
545 | <title><filename>do_compile_kernelmodules</filename></title> | ||
546 | |||
547 | <para> | ||
548 | Compiles loadable modules for the Linux kernel. | ||
549 | </para> | ||
550 | </section> | ||
551 | |||
552 | <section id='ref-tasks-diffconfig'> | ||
553 | <title><filename>do_diffconfig</filename></title> | ||
554 | |||
555 | <para> | ||
556 | Compares the old and new config files after running the | ||
557 | <link linkend='ref-tasks-menuconfig'><filename>do_menuconfig</filename></link> | ||
558 | task for the kernel. | ||
559 | </para> | ||
560 | </section> | ||
561 | |||
562 | <section id='ref-tasks-kernel_checkout'> | ||
563 | <title><filename>do_kernel_checkout</filename></title> | ||
564 | |||
565 | <para> | ||
566 | Checks out source/meta branches for a linux-yocto style kernel. | ||
567 | </para> | ||
568 | </section> | ||
569 | |||
570 | <section id='ref-tasks-kernel_configcheck'> | ||
571 | <title><filename>do_kernel_configcheck</filename></title> | ||
572 | |||
573 | <para> | ||
574 | Validates the kernel configuration for a linux-yocto style kernel. | ||
575 | </para> | ||
576 | </section> | ||
577 | |||
578 | <section id='ref-tasks-kernel_configme'> | ||
579 | <title><filename>do_kernel_configme</filename></title> | ||
580 | |||
581 | <para> | ||
582 | Assembles the kernel configuration for a linux-yocto style kernel. | ||
583 | </para> | ||
584 | </section> | ||
585 | |||
586 | <section id='ref-tasks-kernel_link_vmlinux'> | ||
587 | <title><filename>do_kernel_link_vmlinux</filename></title> | ||
588 | |||
589 | <para> | ||
590 | Creates a symbolic link in | ||
591 | <filename>arch/$arch/boot</filename> for vmlinux kernel | ||
592 | images. | ||
593 | </para> | ||
594 | </section> | ||
595 | |||
596 | <section id='ref-tasks-menuconfig'> | ||
597 | <title><filename>do_menuconfig</filename></title> | ||
598 | |||
599 | <para> | ||
600 | Runs <filename>make menuconfig</filename> for the kernel. | ||
601 | For information on <filename>menuconfig</filename>, see the | ||
602 | "<ulink url='&YOCTO_DOCS_DEV_URL;#using-menuconfig'>Using <filename>menuconfig</filename></ulink>" | ||
603 | section in the Yocto Project Development Manual. | ||
604 | </para> | ||
605 | </section> | ||
606 | |||
607 | <section id='ref-tasks-savedefconfig'> | ||
608 | <title><filename>do_savedefconfig</filename></title> | ||
609 | |||
610 | <para> | ||
611 | Creates a minimal Linux kernel configuration file. | ||
612 | </para> | ||
613 | </section> | ||
614 | |||
615 | <section id='ref-tasks-sizecheck'> | ||
616 | <title><filename>do_sizecheck</filename></title> | ||
617 | |||
618 | <para> | ||
619 | Checks the size of the kernel image against | ||
620 | <filename>KERNEL_IMAGE_MAXSIZE</filename> when set. | ||
621 | </para> | ||
622 | </section> | ||
623 | |||
624 | <section id='ref-tasks-strip'> | ||
625 | <title><filename>do_strip</filename></title> | ||
626 | |||
627 | <para> | ||
628 | Strips unneeded sections out of the Linux kernel image. | ||
629 | </para> | ||
630 | </section> | ||
631 | |||
632 | <section id='ref-tasks-uboot_mkimage'> | ||
633 | <title><filename>do_uboot_mkimage</filename></title> | ||
634 | |||
635 | <para> | ||
636 | Creates a uImage file from the kernel for the U-Boot bootloader. | ||
637 | </para> | ||
638 | </section> | ||
639 | |||
640 | <section id='ref-tasks-validate_branches'> | ||
641 | <title><filename>do_validate_branches</filename></title> | ||
642 | |||
643 | <para> | ||
644 | Ensures that the source, metadata (or both) branches are on the | ||
645 | locations specified by their | ||
646 | <link linkend='var-SRCREV'><filename>SRCREV</filename></link> | ||
647 | values for a linux-yocto style kernel. | ||
648 | </para> | ||
649 | </section> | ||
650 | </section> | ||
651 | |||
652 | <section id='miscellaneous-tasks'> | ||
653 | <title>Miscellaneous Tasks</title> | ||
654 | |||
655 | <para> | ||
656 | The following sections describe miscellaneous tasks. | ||
657 | </para> | ||
658 | |||
659 | <section id='ref-tasks-generate_qt_config_file'> | ||
660 | <title><filename>do_generate_qt_config_file</filename></title> | ||
661 | |||
662 | <para> | ||
663 | Writes a <filename>qt.conf</filename> configuration | ||
664 | file used for building a Qt-based application. | ||
665 | </para> | ||
666 | </section> | ||
667 | |||
668 | <section id='ref-tasks-spdx'> | ||
669 | <title><filename>do_spdx</filename></title> | ||
670 | |||
671 | <para> | ||
672 | A build stage that takes the source code and scans it on a remote | ||
673 | FOSSOLOGY server in order to produce an SPDX document. | ||
674 | This task applies only to the | ||
675 | <link linkend='ref-classes-spdx'><filename>spdx</filename></link> | ||
676 | class. | ||
677 | </para> | ||
678 | </section> | ||
679 | </section> | ||
680 | |||
681 | </chapter> | ||
682 | <!-- | ||
683 | vim: expandtab tw=80 ts=4 | ||
684 | --> | ||
diff --git a/documentation/ref-manual/ref-variables.xml b/documentation/ref-manual/ref-variables.xml new file mode 100644 index 0000000..c34188d --- /dev/null +++ b/documentation/ref-manual/ref-variables.xml | |||
@@ -0,0 +1,9714 @@ | |||
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 | |||
5 | <!-- Dummy chapter --> | ||
6 | <chapter id='ref-variables-glos'> | ||
7 | |||
8 | <title>Variables Glossary</title> | ||
9 | |||
10 | <para> | ||
11 | This chapter lists common variables used in the OpenEmbedded build system and gives an overview | ||
12 | of their function and contents. | ||
13 | </para> | ||
14 | |||
15 | <glossary id='ref-variables-glossary'> | ||
16 | |||
17 | |||
18 | <para> | ||
19 | <link linkend='var-ABIEXTENSION'>A</link> | ||
20 | <link linkend='var-B'>B</link> | ||
21 | <link linkend='var-CFLAGS'>C</link> | ||
22 | <link linkend='var-D'>D</link> | ||
23 | <link linkend='var-ENABLE_BINARY_LOCALE_GENERATION'>E</link> | ||
24 | <link linkend='var-FEATURE_PACKAGES'>F</link> | ||
25 | <link linkend='var-GROUPADD_PARAM'>G</link> | ||
26 | <link linkend='var-HOMEPAGE'>H</link> | ||
27 | <link linkend='var-ICECC_DISABLED'>I</link> | ||
28 | <!-- <link linkend='var-glossary-j'>J</link> --> | ||
29 | <link linkend='var-KARCH'>K</link> | ||
30 | <link linkend='var-LABELS'>L</link> | ||
31 | <link linkend='var-MACHINE'>M</link> | ||
32 | <!-- <link linkend='var-glossary-n'>N</link> --> | ||
33 | <link linkend='var-OE_BINCONFIG_EXTRA_MANGLE'>O</link> | ||
34 | <link linkend='var-P'>P</link> | ||
35 | <link linkend='var-QMAKE_PROFILES'>Q</link> | ||
36 | <link linkend='var-RCONFLICTS'>R</link> | ||
37 | <link linkend='var-S'>S</link> | ||
38 | <link linkend='var-T'>T</link> | ||
39 | <link linkend='var-UBOOT_CONFIG'>U</link> | ||
40 | <!-- <link linkend='var-glossary-v'>V</link> --> | ||
41 | <link linkend='var-WARN_QA'>W</link> | ||
42 | <!-- <link linkend='var-glossary-x'>X</link> --> | ||
43 | <!-- <link linkend='var-glossary-y'>Y</link> --> | ||
44 | <!-- <link linkend='var-glossary-z'>Z</link>--> | ||
45 | </para> | ||
46 | |||
47 | <glossdiv id='var-glossary-a'><title>A</title> | ||
48 | |||
49 | <glossentry id='var-ABIEXTENSION'><glossterm>ABIEXTENSION</glossterm> | ||
50 | <glossdef> | ||
51 | <para> | ||
52 | Extension to the Application Binary Interface (ABI) | ||
53 | field of the GNU canonical architecture name | ||
54 | (e.g. "eabi"). | ||
55 | </para> | ||
56 | |||
57 | <para> | ||
58 | ABI extensions are set in the machine include files. | ||
59 | For example, the | ||
60 | <filename>meta/conf/machine/include/arm/arch-arm.inc</filename> | ||
61 | file sets the following extension: | ||
62 | <literallayout class='monospaced'> | ||
63 | ABIEXTENSION = "eabi" | ||
64 | </literallayout> | ||
65 | </para> | ||
66 | </glossdef> | ||
67 | </glossentry> | ||
68 | |||
69 | <glossentry id='var-ALLOW_EMPTY'><glossterm>ALLOW_EMPTY</glossterm> | ||
70 | <glossdef> | ||
71 | <para> | ||
72 | Specifies if an output package should still be produced if it is empty. | ||
73 | By default, BitBake does not produce empty packages. | ||
74 | This default behavior can cause issues when there is an | ||
75 | <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link> or | ||
76 | some other hard runtime requirement on the existence of the package. | ||
77 | </para> | ||
78 | |||
79 | <para> | ||
80 | Like all package-controlling variables, you must always use them in | ||
81 | conjunction with a package name override, as in: | ||
82 | <literallayout class='monospaced'> | ||
83 | ALLOW_EMPTY_${PN} = "1" | ||
84 | ALLOW_EMPTY_${PN}-dev = "1" | ||
85 | ALLOW_EMPTY_${PN}-staticdev = "1" | ||
86 | </literallayout> | ||
87 | </para> | ||
88 | </glossdef> | ||
89 | </glossentry> | ||
90 | |||
91 | <glossentry id='var-ALTERNATIVE'><glossterm>ALTERNATIVE</glossterm> | ||
92 | <glossdef> | ||
93 | <para> | ||
94 | Lists commands in a package that need an alternative | ||
95 | binary naming scheme. | ||
96 | Sometimes the same command is provided in multiple packages. | ||
97 | When this occurs, the OpenEmbedded build system needs to | ||
98 | use the alternatives system to create a different binary | ||
99 | naming scheme so the commands can co-exist. | ||
100 | </para> | ||
101 | |||
102 | <para> | ||
103 | To use the variable, list out the package's commands | ||
104 | that also exist as part of another package. | ||
105 | For example, if the <filename>busybox</filename> package | ||
106 | has four commands that also exist as part of another | ||
107 | package, you identify them as follows: | ||
108 | <literallayout class='monospaced'> | ||
109 | ALTERNATIVE_busybox = "sh sed test bracket" | ||
110 | </literallayout> | ||
111 | For more information on the alternatives system, see the | ||
112 | "<link linkend='ref-classes-update-alternatives'><filename>update-alternatives.bbclass</filename></link>" | ||
113 | section. | ||
114 | </para> | ||
115 | </glossdef> | ||
116 | </glossentry> | ||
117 | |||
118 | <glossentry id='var-ALTERNATIVE_LINK_NAME'><glossterm>ALTERNATIVE_LINK_NAME</glossterm> | ||
119 | <glossdef> | ||
120 | <para> | ||
121 | Used by the alternatives system to map duplicated commands | ||
122 | to actual locations. | ||
123 | For example, if the <filename>bracket</filename> command | ||
124 | provided by the <filename>busybox</filename> package is | ||
125 | duplicated through another package, you must use the | ||
126 | <filename>ALTERNATIVE_LINK_NAME</filename> variable to | ||
127 | specify the actual location: | ||
128 | <literallayout class='monospaced'> | ||
129 | ALTERNATIVE_LINK_NAME[bracket] = "/usr/bin/[" | ||
130 | </literallayout> | ||
131 | In this example, the binary for the | ||
132 | <filename>bracket</filename> command (i.e. | ||
133 | <filename>[</filename>) from the | ||
134 | <filename>busybox</filename> package resides in | ||
135 | <filename>/usr/bin/</filename>. | ||
136 | <note> | ||
137 | If <filename>ALTERNATIVE_LINK_NAME</filename> is not | ||
138 | defined, it defaults to | ||
139 | <filename>${bindir}/<name></filename>. | ||
140 | </note> | ||
141 | </para> | ||
142 | |||
143 | <para> | ||
144 | For more information on the alternatives system, see the | ||
145 | "<link linkend='ref-classes-update-alternatives'><filename>update-alternatives.bbclass</filename></link>" | ||
146 | section. | ||
147 | </para> | ||
148 | </glossdef> | ||
149 | </glossentry> | ||
150 | |||
151 | <glossentry id='var-ALTERNATIVE_PRIORITY'><glossterm>ALTERNATIVE_PRIORITY</glossterm> | ||
152 | <glossdef> | ||
153 | <para> | ||
154 | Used by the alternatives system to create default | ||
155 | priorities for duplicated commands. | ||
156 | You can use the variable to create a single default | ||
157 | regardless of the command name or package, a default for | ||
158 | specific duplicated commands regardless of the package, or | ||
159 | a default for specific commands tied to particular packages. | ||
160 | Here are the available syntax forms: | ||
161 | <literallayout class='monospaced'> | ||
162 | ALTERNATIVE_PRIORITY = "<priority>" | ||
163 | ALTERNATIVE_PRIORITY[<name>] = "<priority>" | ||
164 | ALTERNATIVE_PRIORITY_<pkg>[<name>] = "<priority>" | ||
165 | </literallayout> | ||
166 | </para> | ||
167 | |||
168 | <para> | ||
169 | For more information on the alternatives system, see the | ||
170 | "<link linkend='ref-classes-update-alternatives'><filename>update-alternatives.bbclass</filename></link>" | ||
171 | section. | ||
172 | </para> | ||
173 | </glossdef> | ||
174 | </glossentry> | ||
175 | |||
176 | <glossentry id='var-ALTERNATIVE_TARGET'><glossterm>ALTERNATIVE_TARGET</glossterm> | ||
177 | <glossdef> | ||
178 | <para> | ||
179 | Used by the alternatives system to create default link | ||
180 | locations for duplicated commands. | ||
181 | You can use the variable to create a single default | ||
182 | location for all duplicated commands regardless of the | ||
183 | command name or package, a default for | ||
184 | specific duplicated commands regardless of the package, or | ||
185 | a default for specific commands tied to particular packages. | ||
186 | Here are the available syntax forms: | ||
187 | <literallayout class='monospaced'> | ||
188 | ALTERNATIVE_TARGET = "<target>" | ||
189 | ALTERNATIVE_TARGET[<name>] = "<target>" | ||
190 | ALTERNATIVE_TARGET_<pkg>[<name>] = "<target>" | ||
191 | </literallayout> | ||
192 | <note> | ||
193 | <para> | ||
194 | If <filename>ALTERNATIVE_TARGET</filename> is not | ||
195 | defined, it inherits the value from the | ||
196 | <link linkend='var-ALTERNATIVE_LINK_NAME'><filename>ALTERNATIVE_LINK_NAME</filename></link> | ||
197 | variable. | ||
198 | </para> | ||
199 | |||
200 | <para> | ||
201 | If <filename>ALTERNATIVE_LINK_NAME</filename> and | ||
202 | <filename>ALTERNATIVE_TARGET</filename> are the | ||
203 | same, the target for | ||
204 | <filename>ALTERNATIVE_TARGET</filename> | ||
205 | has "<filename>.{BPN}</filename>" appended to it. | ||
206 | </para> | ||
207 | |||
208 | <para> | ||
209 | Finally, if the file referenced has not been | ||
210 | renamed, the alternatives system will rename it to | ||
211 | avoid the need to rename alternative files in the | ||
212 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
213 | task while | ||
214 | retaining support for the command if necessary. | ||
215 | </para> | ||
216 | </note> | ||
217 | </para> | ||
218 | |||
219 | <para> | ||
220 | For more information on the alternatives system, see the | ||
221 | "<link linkend='ref-classes-update-alternatives'><filename>update-alternatives.bbclass</filename></link>" | ||
222 | section. | ||
223 | </para> | ||
224 | </glossdef> | ||
225 | </glossentry> | ||
226 | |||
227 | <glossentry id='var-APPEND'><glossterm>APPEND</glossterm> | ||
228 | <glossdef> | ||
229 | <para> | ||
230 | An override list of append strings for each | ||
231 | <link linkend='var-LABELS'><filename>LABEL</filename></link>. | ||
232 | </para> | ||
233 | |||
234 | <para> | ||
235 | See the | ||
236 | <link linkend='ref-classes-grub-efi'><filename>grub-efi</filename></link> | ||
237 | class for more information on how this variable is used. | ||
238 | </para> | ||
239 | </glossdef> | ||
240 | </glossentry> | ||
241 | |||
242 | <glossentry id='var-AUTHOR'><glossterm>AUTHOR</glossterm> | ||
243 | <glossdef> | ||
244 | <para>The email address used to contact the original author | ||
245 | or authors in order to send patches and forward bugs.</para> | ||
246 | </glossdef> | ||
247 | </glossentry> | ||
248 | |||
249 | <glossentry id='var-AUTO_SYSLINUXMENU'><glossterm>AUTO_SYSLINUXMENU</glossterm> | ||
250 | <glossdef> | ||
251 | <para> | ||
252 | Enables creating an automatic menu. | ||
253 | You must set this in your recipe. | ||
254 | The | ||
255 | <link linkend='ref-classes-syslinux'><filename>syslinux</filename></link> | ||
256 | class checks this variable. | ||
257 | </para> | ||
258 | </glossdef> | ||
259 | </glossentry> | ||
260 | |||
261 | <glossentry id='var-AUTOREV'><glossterm>AUTOREV</glossterm> | ||
262 | <glossdef> | ||
263 | <para>When <filename><link linkend='var-SRCREV'>SRCREV</link></filename> | ||
264 | is set to the value of this variable, it specifies to use the latest | ||
265 | source revision in the repository. | ||
266 | Here is an example: | ||
267 | <literallayout class='monospaced'> | ||
268 | SRCREV = "${AUTOREV}" | ||
269 | </literallayout> | ||
270 | </para> | ||
271 | </glossdef> | ||
272 | </glossentry> | ||
273 | |||
274 | <glossentry id='var-AVAILTUNES'><glossterm>AVAILTUNES</glossterm> | ||
275 | <glossdef> | ||
276 | <para> | ||
277 | The list of defined CPU and Application Binary Interface | ||
278 | (ABI) tunings (i.e. "tunes") available for use by the | ||
279 | OpenEmbedded build system. | ||
280 | </para> | ||
281 | |||
282 | <para> | ||
283 | The list simply presents the tunes that are available. | ||
284 | Not all tunes may be compatible with a particular | ||
285 | machine configuration, or with each other in a | ||
286 | <ulink url='&YOCTO_DOCS_DEV_URL;#combining-multiple-versions-library-files-into-one-image'>Multilib</ulink> | ||
287 | configuration. | ||
288 | </para> | ||
289 | |||
290 | <para> | ||
291 | To add a tune to the list, be sure to append it with | ||
292 | spaces using the "+=" BitBake operator. | ||
293 | Do not simply replace the list by using the "=" operator. | ||
294 | See the | ||
295 | "<ulink url='&YOCTO_DOCS_BB_URL;#basic-syntax'>Basic Syntax</ulink>" | ||
296 | section in the BitBake User Manual for more information. | ||
297 | </para> | ||
298 | </glossdef> | ||
299 | </glossentry> | ||
300 | |||
301 | |||
302 | </glossdiv> | ||
303 | |||
304 | <glossdiv id='var-glossary-b'><title>B</title> | ||
305 | |||
306 | <glossentry id='var-B'><glossterm>B</glossterm> | ||
307 | <glossdef> | ||
308 | <para> | ||
309 | The directory within the | ||
310 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
311 | in which the OpenEmbedded build system places generated | ||
312 | objects during a recipe's build process. | ||
313 | By default, this directory is the same as the <link linkend='var-S'><filename>S</filename></link> | ||
314 | directory, which is defined as: | ||
315 | <literallayout class='monospaced'> | ||
316 | S = "${WORKDIR}/${BP}/" | ||
317 | </literallayout> | ||
318 | You can separate the (<filename>S</filename>) directory | ||
319 | and the directory pointed to by the <filename>B</filename> | ||
320 | variable. | ||
321 | Most Autotools-based recipes support separating these | ||
322 | directories. | ||
323 | The build system defaults to using separate directories for | ||
324 | <filename>gcc</filename> and some kernel recipes. | ||
325 | </para> | ||
326 | </glossdef> | ||
327 | </glossentry> | ||
328 | |||
329 | <glossentry id='var-BAD_RECOMMENDATIONS'><glossterm>BAD_RECOMMENDATIONS</glossterm> | ||
330 | <glossdef> | ||
331 | <para> | ||
332 | Lists "recommended-only" packages to not install. | ||
333 | Recommended-only packages are packages installed only | ||
334 | through the | ||
335 | <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link> | ||
336 | variable. | ||
337 | You can prevent any of these "recommended" packages from | ||
338 | being installed by listing them with the | ||
339 | <filename>BAD_RECOMMENDATIONS</filename> variable: | ||
340 | <literallayout class='monospaced'> | ||
341 | BAD_RECOMMENDATIONS = "<package_name> <package_name> <package_name> ..." | ||
342 | </literallayout> | ||
343 | You can set this variable globally in your | ||
344 | <filename>local.conf</filename> file or you can attach it to | ||
345 | a specific image recipe by using the recipe name override: | ||
346 | <literallayout class='monospaced'> | ||
347 | BAD_RECOMMENDATIONS_pn-<target_image> = "<package_name>" | ||
348 | </literallayout> | ||
349 | </para> | ||
350 | |||
351 | <para> | ||
352 | It is important to realize that if you choose to not install | ||
353 | packages using this variable and some other packages are | ||
354 | dependent on them (i.e. listed in a recipe's | ||
355 | <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link> | ||
356 | variable), the OpenEmbedded build system ignores your | ||
357 | request and will install the packages to avoid dependency | ||
358 | errors. | ||
359 | </para> | ||
360 | |||
361 | <para> | ||
362 | Support for this variable exists only when using the | ||
363 | IPK and RPM packaging backend. | ||
364 | Support does not exist for DEB. | ||
365 | </para> | ||
366 | |||
367 | <para> | ||
368 | See the | ||
369 | <link linkend='var-NO_RECOMMENDATIONS'><filename>NO_RECOMMENDATIONS</filename></link> | ||
370 | and the | ||
371 | <link linkend='var-PACKAGE_EXCLUDE'><filename>PACKAGE_EXCLUDE</filename></link> | ||
372 | variables for related information. | ||
373 | </para> | ||
374 | </glossdef> | ||
375 | </glossentry> | ||
376 | |||
377 | <glossentry id='var-BASE_LIB'><glossterm>BASE_LIB</glossterm> | ||
378 | <glossdef> | ||
379 | <para> | ||
380 | The library directory name for the CPU or Application | ||
381 | Binary Interface (ABI) tune. | ||
382 | The <filename>BASE_LIB</filename> applies only in the | ||
383 | Multilib context. | ||
384 | See the | ||
385 | "<ulink url='&YOCTO_DOCS_DEV_URL;#combining-multiple-versions-library-files-into-one-image'>Combining Multiple Versions of Library Files into One Image</ulink>" | ||
386 | section in the Yocto Project Development Manual for | ||
387 | information on Multilib. | ||
388 | </para> | ||
389 | |||
390 | <para> | ||
391 | The <filename>BASE_LIB</filename> variable is defined in | ||
392 | the machine include files in the | ||
393 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
394 | If Multilib is not being used, the value defaults to "lib". | ||
395 | </para> | ||
396 | </glossdef> | ||
397 | </glossentry> | ||
398 | |||
399 | <glossentry id='var-BB_DANGLINGAPPENDS_WARNONLY'><glossterm>BB_DANGLINGAPPENDS_WARNONLY</glossterm> | ||
400 | <glossdef> | ||
401 | <para> | ||
402 | Defines how BitBake handles situations where an append | ||
403 | file (<filename>.bbappend</filename>) has no | ||
404 | corresponding recipe file (<filename>.bb</filename>). | ||
405 | This condition often occurs when layers get out of sync | ||
406 | (e.g. <filename>oe-core</filename> bumps a | ||
407 | recipe version and the old recipe no longer exists and the | ||
408 | other layer has not been updated to the new version | ||
409 | of the recipe yet). | ||
410 | </para> | ||
411 | |||
412 | <para> | ||
413 | The default fatal behavior is safest because it is | ||
414 | the sane reaction given something is out of sync. | ||
415 | It is important to realize when your changes are no longer | ||
416 | being applied. | ||
417 | </para> | ||
418 | |||
419 | <para> | ||
420 | You can change the default behavior by setting this | ||
421 | variable to "1", "yes", or "true" | ||
422 | in your <filename>local.conf</filename> file, which is | ||
423 | located in the | ||
424 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>: | ||
425 | Here is an example: | ||
426 | <literallayout class='monospaced'> | ||
427 | BB_DANGLINGAPPENDS_WARNONLY = "1" | ||
428 | </literallayout> | ||
429 | </para> | ||
430 | </glossdef> | ||
431 | </glossentry> | ||
432 | |||
433 | <glossentry id='var-BB_DISKMON_DIRS'><glossterm>BB_DISKMON_DIRS</glossterm> | ||
434 | <glossdef> | ||
435 | <para> | ||
436 | Monitors disk space and available inodes during the build | ||
437 | and allows you to control the build based on these | ||
438 | parameters. | ||
439 | </para> | ||
440 | |||
441 | <para> | ||
442 | Disk space monitoring is disabled by default. | ||
443 | To enable monitoring, add the <filename>BB_DISKMON_DIRS</filename> | ||
444 | variable to your <filename>conf/local.conf</filename> file found in the | ||
445 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
446 | Use the following form: | ||
447 | <literallayout class='monospaced'> | ||
448 | BB_DISKMON_DIRS = "<action>,<dir>,<threshold> [...]" | ||
449 | |||
450 | where: | ||
451 | |||
452 | <action> is: | ||
453 | ABORT: Immediately abort the build when | ||
454 | a threshold is broken. | ||
455 | STOPTASKS: Stop the build after the currently | ||
456 | executing tasks have finished when | ||
457 | a threshold is broken. | ||
458 | WARN: Issue a warning but continue the | ||
459 | build when a threshold is broken. | ||
460 | Subsequent warnings are issued as | ||
461 | defined by the | ||
462 | <link linkend='var-BB_DISKMON_WARNINTERVAL'>BB_DISKMON_WARNINTERVAL</link> variable, | ||
463 | which must be defined in the | ||
464 | conf/local.conf file. | ||
465 | |||
466 | <dir> is: | ||
467 | Any directory you choose. You can specify one or | ||
468 | more directories to monitor by separating the | ||
469 | groupings with a space. If two directories are | ||
470 | on the same device, only the first directory | ||
471 | is monitored. | ||
472 | |||
473 | <threshold> is: | ||
474 | Either the minimum available disk space, | ||
475 | the minimum number of free inodes, or | ||
476 | both. You must specify at least one. To | ||
477 | omit one or the other, simply omit the value. | ||
478 | Specify the threshold using G, M, K for Gbytes, | ||
479 | Mbytes, and Kbytes, respectively. If you do | ||
480 | not specify G, M, or K, Kbytes is assumed by | ||
481 | default. Do not use GB, MB, or KB. | ||
482 | </literallayout> | ||
483 | </para> | ||
484 | |||
485 | <para> | ||
486 | Here are some examples: | ||
487 | <literallayout class='monospaced'> | ||
488 | BB_DISKMON_DIRS = "ABORT,${TMPDIR},1G,100K WARN,${SSTATE_DIR},1G,100K" | ||
489 | BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},1G" | ||
490 | BB_DISKMON_DIRS = "ABORT,${TMPDIR},,100K" | ||
491 | </literallayout> | ||
492 | The first example works only if you also provide | ||
493 | the <link linkend='var-BB_DISKMON_WARNINTERVAL'><filename>BB_DISKMON_WARNINTERVAL</filename></link> variable | ||
494 | in the <filename>conf/local.conf</filename>. | ||
495 | This example causes the build system to immediately | ||
496 | abort when either the disk space in <filename>${TMPDIR}</filename> drops | ||
497 | below 1 Gbyte or the available free inodes drops below | ||
498 | 100 Kbytes. | ||
499 | Because two directories are provided with the variable, the | ||
500 | build system also issue a | ||
501 | warning when the disk space in the | ||
502 | <filename>${SSTATE_DIR}</filename> directory drops | ||
503 | below 1 Gbyte or the number of free inodes drops | ||
504 | below 100 Kbytes. | ||
505 | Subsequent warnings are issued during intervals as | ||
506 | defined by the <filename>BB_DISKMON_WARNINTERVAL</filename> | ||
507 | variable. | ||
508 | </para> | ||
509 | |||
510 | <para> | ||
511 | The second example stops the build after all currently | ||
512 | executing tasks complete when the minimum disk space | ||
513 | in the <filename>${<link linkend='var-TMPDIR'>TMPDIR</link>}</filename> | ||
514 | directory drops below 1 Gbyte. | ||
515 | No disk monitoring occurs for the free inodes in this case. | ||
516 | </para> | ||
517 | |||
518 | <para> | ||
519 | The final example immediately aborts the build when the | ||
520 | number of free inodes in the <filename>${TMPDIR}</filename> directory | ||
521 | drops below 100 Kbytes. | ||
522 | No disk space monitoring for the directory itself occurs | ||
523 | in this case. | ||
524 | </para> | ||
525 | </glossdef> | ||
526 | </glossentry> | ||
527 | |||
528 | <glossentry id='var-BB_DISKMON_WARNINTERVAL'><glossterm>BB_DISKMON_WARNINTERVAL</glossterm> | ||
529 | <glossdef> | ||
530 | <para> | ||
531 | Defines the disk space and free inode warning intervals. | ||
532 | To set these intervals, define the variable in your | ||
533 | <filename>conf/local.conf</filename> file in the | ||
534 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
535 | </para> | ||
536 | |||
537 | <para> | ||
538 | If you are going to use the | ||
539 | <filename>BB_DISKMON_WARNINTERVAL</filename> variable, you must | ||
540 | also use the | ||
541 | <link linkend='var-BB_DISKMON_DIRS'><filename>BB_DISKMON_DIRS</filename></link> variable | ||
542 | and define its action as "WARN". | ||
543 | During the build, subsequent warnings are issued each time | ||
544 | disk space or number of free inodes further reduces by | ||
545 | the respective interval. | ||
546 | </para> | ||
547 | |||
548 | <para> | ||
549 | If you do not provide a <filename>BB_DISKMON_WARNINTERVAL</filename> | ||
550 | variable and you do use <filename>BB_DISKMON_DIRS</filename> with | ||
551 | the "WARN" action, the disk monitoring interval defaults to | ||
552 | the following: | ||
553 | <literallayout class='monospaced'> | ||
554 | BB_DISKMON_WARNINTERVAL = "50M,5K" | ||
555 | </literallayout> | ||
556 | </para> | ||
557 | |||
558 | <para> | ||
559 | When specifying the variable in your configuration file, | ||
560 | use the following form: | ||
561 | <literallayout class='monospaced'> | ||
562 | BB_DISKMON_WARNINTERVAL = "<disk_space_interval>,<disk_inode_interval>" | ||
563 | |||
564 | where: | ||
565 | |||
566 | <disk_space_interval> is: | ||
567 | An interval of memory expressed in either | ||
568 | G, M, or K for Gbytes, Mbytes, or Kbytes, | ||
569 | respectively. You cannot use GB, MB, or KB. | ||
570 | |||
571 | <disk_inode_interval> is: | ||
572 | An interval of free inodes expressed in either | ||
573 | G, M, or K for Gbytes, Mbytes, or Kbytes, | ||
574 | respectively. You cannot use GB, MB, or KB. | ||
575 | </literallayout> | ||
576 | </para> | ||
577 | |||
578 | <para> | ||
579 | Here is an example: | ||
580 | <literallayout class='monospaced'> | ||
581 | BB_DISKMON_DIRS = "WARN,${SSTATE_DIR},1G,100K" | ||
582 | BB_DISKMON_WARNINTERVAL = "50M,5K" | ||
583 | </literallayout> | ||
584 | These variables cause the OpenEmbedded build system to | ||
585 | issue subsequent warnings each time the available | ||
586 | disk space further reduces by 50 Mbytes or the number | ||
587 | of free inodes further reduces by 5 Kbytes in the | ||
588 | <filename>${SSTATE_DIR}</filename> directory. | ||
589 | Subsequent warnings based on the interval occur each time | ||
590 | a respective interval is reached beyond the initial warning | ||
591 | (i.e. 1 Gbytes and 100 Kbytes). | ||
592 | </para> | ||
593 | </glossdef> | ||
594 | </glossentry> | ||
595 | |||
596 | <glossentry id='var-BB_GENERATE_MIRROR_TARBALLS'><glossterm>BB_GENERATE_MIRROR_TARBALLS</glossterm> | ||
597 | <glossdef> | ||
598 | <para> | ||
599 | Causes tarballs of the Git repositories, including the | ||
600 | Git metadata, to be placed in the | ||
601 | <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link> | ||
602 | directory. | ||
603 | </para> | ||
604 | |||
605 | <para> | ||
606 | For performance reasons, creating and placing tarballs of | ||
607 | the Git repositories is not the default action by the | ||
608 | OpenEmbedded build system. | ||
609 | <literallayout class='monospaced'> | ||
610 | BB_GENERATE_MIRROR_TARBALLS = "1" | ||
611 | </literallayout> | ||
612 | Set this variable in your <filename>local.conf</filename> | ||
613 | file in the | ||
614 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
615 | </para> | ||
616 | </glossdef> | ||
617 | </glossentry> | ||
618 | |||
619 | <glossentry id='var-BB_NUMBER_THREADS'><glossterm>BB_NUMBER_THREADS</glossterm> | ||
620 | <glossdef> | ||
621 | <para> | ||
622 | The maximum number of tasks BitBake should run in parallel | ||
623 | at any one time. | ||
624 | If your host development system supports multiple cores, | ||
625 | a good rule of thumb is to set this variable to twice the | ||
626 | number of cores. | ||
627 | </para> | ||
628 | |||
629 | <para> | ||
630 | The default value for <filename>BB_NUMBER_THREADS</filename> | ||
631 | is equal to the number of cores your build system has. | ||
632 | </para> | ||
633 | </glossdef> | ||
634 | </glossentry> | ||
635 | |||
636 | <glossentry id='var-BBCLASSEXTEND'><glossterm>BBCLASSEXTEND</glossterm> | ||
637 | <glossdef> | ||
638 | <para> | ||
639 | Allows you to extend a recipe so that it builds variants of the software. | ||
640 | Common variants for recipes exist such as "natives" like <filename>quilt-native</filename>, | ||
641 | which is a copy of Quilt built to run on the build system; | ||
642 | "crosses" such as <filename>gcc-cross</filename>, | ||
643 | which is a compiler built to run on the build machine but produces binaries | ||
644 | that run on the target <link linkend='var-MACHINE'><filename>MACHINE</filename></link>; | ||
645 | "nativesdk", which targets the SDK machine instead of <filename>MACHINE</filename>; | ||
646 | and "mulitlibs" in the form "<filename>multilib:<multilib_name></filename>". | ||
647 | </para> | ||
648 | |||
649 | <para> | ||
650 | To build a different variant of the recipe with a minimal amount of code, it usually | ||
651 | is as simple as adding the following to your recipe: | ||
652 | <literallayout class='monospaced'> | ||
653 | BBCLASSEXTEND =+ "native nativesdk" | ||
654 | BBCLASSEXTEND =+ "multilib:<multilib_name>" | ||
655 | </literallayout> | ||
656 | </para> | ||
657 | </glossdef> | ||
658 | </glossentry> | ||
659 | |||
660 | <glossentry id='var-BBFILE_COLLECTIONS'><glossterm>BBFILE_COLLECTIONS</glossterm> | ||
661 | <glossdef> | ||
662 | <para>Lists the names of configured layers. | ||
663 | These names are used to find the other <filename>BBFILE_*</filename> | ||
664 | variables. | ||
665 | Typically, each layer will append its name to this variable in its | ||
666 | <filename>conf/layer.conf</filename> file. | ||
667 | </para> | ||
668 | </glossdef> | ||
669 | </glossentry> | ||
670 | |||
671 | <glossentry id='var-BBFILE_PATTERN'><glossterm>BBFILE_PATTERN</glossterm> | ||
672 | <glossdef> | ||
673 | <para>Variable that expands to match files from | ||
674 | <link linkend='var-BBFILES'><filename>BBFILES</filename></link> | ||
675 | in a particular layer. | ||
676 | This variable is used in the <filename>conf/layer.conf</filename> file and must | ||
677 | be suffixed with the name of the specific layer (e.g. | ||
678 | <filename>BBFILE_PATTERN_emenlow</filename>).</para> | ||
679 | </glossdef> | ||
680 | </glossentry> | ||
681 | |||
682 | <glossentry id='var-BBFILE_PRIORITY'><glossterm>BBFILE_PRIORITY</glossterm> | ||
683 | <glossdef> | ||
684 | <para>Assigns the priority for recipe files in each layer.</para> | ||
685 | <para>This variable is useful in situations where the same recipe appears in | ||
686 | more than one layer. | ||
687 | Setting this variable allows you to prioritize a | ||
688 | layer against other layers that contain the same recipe - effectively | ||
689 | letting you control the precedence for the multiple layers. | ||
690 | The precedence established through this variable stands regardless of a | ||
691 | recipe's version | ||
692 | (<link linkend='var-PV'><filename>PV</filename></link> variable). | ||
693 | For example, a layer that has a recipe with a higher <filename>PV</filename> value but for | ||
694 | which the <filename>BBFILE_PRIORITY</filename> is set to have a lower precedence still has a | ||
695 | lower precedence.</para> | ||
696 | <para>A larger value for the <filename>BBFILE_PRIORITY</filename> variable results in a higher | ||
697 | precedence. | ||
698 | For example, the value 6 has a higher precedence than the value 5. | ||
699 | If not specified, the <filename>BBFILE_PRIORITY</filename> variable is set based on layer | ||
700 | dependencies (see the | ||
701 | <filename><link linkend='var-LAYERDEPENDS'>LAYERDEPENDS</link></filename> variable for | ||
702 | more information. | ||
703 | The default priority, if unspecified | ||
704 | for a layer with no dependencies, is the lowest defined priority + 1 | ||
705 | (or 1 if no priorities are defined).</para> | ||
706 | <tip> | ||
707 | You can use the command <filename>bitbake-layers show-layers</filename> to list | ||
708 | all configured layers along with their priorities. | ||
709 | </tip> | ||
710 | </glossdef> | ||
711 | </glossentry> | ||
712 | |||
713 | <glossentry id='var-BBFILES'><glossterm>BBFILES</glossterm> | ||
714 | <glossdef> | ||
715 | <para>List of recipe files used by BitBake to build software.</para> | ||
716 | </glossdef> | ||
717 | </glossentry> | ||
718 | |||
719 | <glossentry id='var-BBINCLUDELOGS'><glossterm>BBINCLUDELOGS</glossterm> | ||
720 | <glossdef> | ||
721 | <para>Variable that controls how BitBake displays logs on build failure.</para> | ||
722 | </glossdef> | ||
723 | </glossentry> | ||
724 | |||
725 | <glossentry id='var-BBLAYERS'><glossterm>BBLAYERS</glossterm> | ||
726 | <glossdef> | ||
727 | <para>Lists the layers to enable during the build. | ||
728 | This variable is defined in the <filename>bblayers.conf</filename> configuration | ||
729 | file in the <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
730 | Here is an example: | ||
731 | <literallayout class='monospaced'> | ||
732 | BBLAYERS = " \ | ||
733 | /home/scottrif/poky/meta \ | ||
734 | /home/scottrif/poky/meta-yocto \ | ||
735 | /home/scottrif/poky/meta-yocto-bsp \ | ||
736 | /home/scottrif/poky/meta-mykernel \ | ||
737 | " | ||
738 | |||
739 | BBLAYERS_NON_REMOVABLE ?= " \ | ||
740 | /home/scottrif/poky/meta \ | ||
741 | /home/scottrif/poky/meta-yocto \ | ||
742 | " | ||
743 | </literallayout> | ||
744 | This example enables four layers, one of which is a custom, user-defined layer | ||
745 | named <filename>meta-mykernel</filename>. | ||
746 | </para> | ||
747 | </glossdef> | ||
748 | </glossentry> | ||
749 | |||
750 | <glossentry id='var-BBLAYERS_NON_REMOVABLE'><glossterm>BBLAYERS_NON_REMOVABLE</glossterm> | ||
751 | <glossdef> | ||
752 | <para>Lists core layers that cannot be removed from the | ||
753 | <filename>bblayers.conf</filename> file during a build | ||
754 | using the | ||
755 | <ulink url='https://www.yoctoproject.org/tools-resources/projects/hob'>Hob</ulink>. | ||
756 | <note> | ||
757 | When building an image outside of Hob, this variable | ||
758 | is ignored. | ||
759 | </note> | ||
760 | In order for BitBake to build your image using Hob, your | ||
761 | <filename>bblayers.conf</filename> file must include the | ||
762 | <filename>meta</filename> and <filename>meta-yocto</filename> | ||
763 | core layers. | ||
764 | Here is an example that shows these two layers listed in | ||
765 | the <filename>BBLAYERS_NON_REMOVABLE</filename> statement: | ||
766 | <literallayout class='monospaced'> | ||
767 | BBLAYERS = " \ | ||
768 | /home/scottrif/poky/meta \ | ||
769 | /home/scottrif/poky/meta-yocto \ | ||
770 | /home/scottrif/poky/meta-yocto-bsp \ | ||
771 | /home/scottrif/poky/meta-mykernel \ | ||
772 | " | ||
773 | |||
774 | BBLAYERS_NON_REMOVABLE ?= " \ | ||
775 | /home/scottrif/poky/meta \ | ||
776 | /home/scottrif/poky/meta-yocto \ | ||
777 | " | ||
778 | </literallayout> | ||
779 | </para> | ||
780 | </glossdef> | ||
781 | </glossentry> | ||
782 | |||
783 | <glossentry id='var-BBMASK'><glossterm>BBMASK</glossterm> | ||
784 | <glossdef> | ||
785 | <para> | ||
786 | Prevents BitBake from processing recipes and recipe | ||
787 | append files. | ||
788 | Use the <filename>BBMASK</filename> variable from within the | ||
789 | <filename>conf/local.conf</filename> file found | ||
790 | in the | ||
791 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
792 | </para> | ||
793 | |||
794 | <para> | ||
795 | You can use the <filename>BBMASK</filename> variable | ||
796 | to "hide" these <filename>.bb</filename> and | ||
797 | <filename>.bbappend</filename> files. | ||
798 | BitBake ignores any recipe or recipe append files that | ||
799 | match the expression. | ||
800 | It is as if BitBake does not see them at all. | ||
801 | Consequently, matching files are not parsed or otherwise | ||
802 | used by BitBake.</para> | ||
803 | <para> | ||
804 | The value you provide is passed to Python's regular | ||
805 | expression compiler. | ||
806 | The expression is compared against the full paths to | ||
807 | the files. | ||
808 | For complete syntax information, see Python's | ||
809 | documentation at | ||
810 | <ulink url='http://docs.python.org/release/2.3/lib/re-syntax.html'></ulink>. | ||
811 | </para> | ||
812 | |||
813 | <para> | ||
814 | The following example uses a complete regular expression | ||
815 | to tell BitBake to ignore all recipe and recipe append | ||
816 | files in the <filename>meta-ti/recipes-misc/</filename> | ||
817 | directory: | ||
818 | <literallayout class='monospaced'> | ||
819 | BBMASK = "meta-ti/recipes-misc/" | ||
820 | </literallayout> | ||
821 | If you want to mask out multiple directories or recipes, | ||
822 | use the vertical bar to separate the regular expression | ||
823 | fragments. | ||
824 | This next example masks out multiple directories and | ||
825 | individual recipes: | ||
826 | <literallayout class='monospaced'> | ||
827 | BBMASK = "meta-ti/recipes-misc/|meta-ti/recipes-ti/packagegroup/" | ||
828 | BBMASK .= "|.*meta-oe/recipes-support/" | ||
829 | BBMASK .= "|.*openldap" | ||
830 | BBMASK .= "|.*opencv" | ||
831 | BBMASK .= "|.*lzma" | ||
832 | </literallayout> | ||
833 | Notice how the vertical bar is used to append the fragments. | ||
834 | <note> | ||
835 | When specifying a directory name, use the trailing | ||
836 | slash character to ensure you match just that directory | ||
837 | name. | ||
838 | </note> | ||
839 | </para> | ||
840 | </glossdef> | ||
841 | </glossentry> | ||
842 | |||
843 | <glossentry id='var-BBPATH'><glossterm>BBPATH</glossterm> | ||
844 | <glossdef> | ||
845 | <para> | ||
846 | Used by BitBake to locate | ||
847 | <filename>.bbclass</filename> and configuration files. | ||
848 | This variable is analogous to the | ||
849 | <filename>PATH</filename> variable. | ||
850 | <note> | ||
851 | If you run BitBake from a directory outside of the | ||
852 | <ulink url='&YOCTO_DOCS_DEV_URL;build-directory'>Build Directory</ulink>, | ||
853 | you must be sure to set | ||
854 | <filename>BBPATH</filename> to point to the | ||
855 | Build Directory. | ||
856 | Set the variable as you would any environment variable | ||
857 | and then run BitBake: | ||
858 | <literallayout class='monospaced'> | ||
859 | $ BBPATH = "<build_directory>" | ||
860 | $ export BBPATH | ||
861 | $ bitbake <target> | ||
862 | </literallayout> | ||
863 | </note> | ||
864 | </para> | ||
865 | </glossdef> | ||
866 | </glossentry> | ||
867 | |||
868 | <glossentry id='var-BBSERVER'><glossterm>BBSERVER</glossterm> | ||
869 | <glossdef> | ||
870 | <para> | ||
871 | Points to the server that runs memory-resident BitBake. | ||
872 | This variable is set by the | ||
873 | <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link> | ||
874 | setup script and should not be hand-edited. | ||
875 | The variable is only used when you employ memory-resident | ||
876 | BitBake. | ||
877 | The setup script exports the value as follows: | ||
878 | <literallayout class='monospaced'> | ||
879 | export BBSERVER=localhost:$port | ||
880 | </literallayout> | ||
881 | For more information on how the | ||
882 | <filename>BBSERVER</filename> is used, see the | ||
883 | <filename>oe-init-build-env-memres</filename> script, which | ||
884 | is located in the | ||
885 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
886 | </para> | ||
887 | </glossdef> | ||
888 | </glossentry> | ||
889 | |||
890 | <glossentry id='var-BINCONFIG_GLOB'><glossterm>BINCONFIG_GLOB</glossterm> | ||
891 | <glossdef> | ||
892 | <para> | ||
893 | When inheriting <filename>binconfig.bbclass</filename> | ||
894 | from a recipe, this variable specifies a wildcard for | ||
895 | configuration scripts that need editing. | ||
896 | The scripts are edited to correct any paths that have been | ||
897 | set up during compilation so that they are correct for | ||
898 | use when installed into the sysroot and called by the | ||
899 | build processes of other recipes. | ||
900 | </para> | ||
901 | |||
902 | <para> | ||
903 | For more information on how this variable works, see | ||
904 | <filename>meta/classes/binconfig.bbclass</filename> in the | ||
905 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
906 | You can also find general information on the class in the | ||
907 | "<link linkend='ref-classes-binconfig'><filename>binconfig.bbclass</filename></link>" | ||
908 | section. | ||
909 | </para> | ||
910 | </glossdef> | ||
911 | </glossentry> | ||
912 | |||
913 | <glossentry id='var-BP'><glossterm>BP</glossterm> | ||
914 | <glossdef> | ||
915 | <para>The base recipe name and version but without any special | ||
916 | recipe name suffix (i.e. <filename>-native</filename>, <filename>lib64-</filename>, | ||
917 | and so forth). | ||
918 | <filename>BP</filename> is comprised of the following: | ||
919 | <literallayout class="monospaced"> | ||
920 | ${BPN}-${PV} | ||
921 | </literallayout></para> | ||
922 | </glossdef> | ||
923 | </glossentry> | ||
924 | |||
925 | <glossentry id='var-BPN'><glossterm>BPN</glossterm> | ||
926 | <glossdef> | ||
927 | <para>The bare name of the recipe. | ||
928 | This variable is a version of the <link linkend='var-PN'><filename>PN</filename></link> variable | ||
929 | but removes common suffixes such as "-native" and "-cross" as well | ||
930 | as removes common prefixes such as multilib's "lib64-" and "lib32-". | ||
931 | The exact list of suffixes removed is specified by the | ||
932 | <link linkend='var-SPECIAL_PKGSUFFIX'><filename>SPECIAL_PKGSUFFIX</filename></link> variable. | ||
933 | The exact list of prefixes removed is specified by the | ||
934 | <link linkend='var-MLPREFIX'><filename>MLPREFIX</filename></link> variable. | ||
935 | Prefixes are removed for <filename>multilib</filename> | ||
936 | and <filename>nativesdk</filename> cases.</para> | ||
937 | </glossdef> | ||
938 | </glossentry> | ||
939 | |||
940 | <glossentry id='var-BUGTRACKER'><glossterm>BUGTRACKER</glossterm> | ||
941 | <glossdef> | ||
942 | <para> | ||
943 | Specifies a URL for an upstream bug tracking website for | ||
944 | a recipe. | ||
945 | The OpenEmbedded build system does not use this variable. | ||
946 | Rather, the variable is a useful pointer in case a bug | ||
947 | in the software being built needs to be manually reported. | ||
948 | </para> | ||
949 | </glossdef> | ||
950 | </glossentry> | ||
951 | |||
952 | <glossentry id='var-BUILD_CFLAGS'><glossterm>BUILD_CFLAGS</glossterm> | ||
953 | <glossdef> | ||
954 | <para> | ||
955 | Specifies the flags to pass to the C compiler when building | ||
956 | for the build host. | ||
957 | When building in the <filename>-native</filename> context, | ||
958 | <link linkend='var-CFLAGS'><filename>CFLAGS</filename></link> | ||
959 | is set to the value of this variable by default. | ||
960 | </para> | ||
961 | </glossdef> | ||
962 | </glossentry> | ||
963 | |||
964 | <glossentry id='var-BUILD_CPPFLAGS'><glossterm>BUILD_CPPFLAGS</glossterm> | ||
965 | <glossdef> | ||
966 | <para> | ||
967 | Specifies the flags to pass to the C pre-processor | ||
968 | (i.e. to both the C and the C++ compilers) when building | ||
969 | for the build host. | ||
970 | When building in the <filename>native</filename> context, | ||
971 | <link linkend='var-CPPFLAGS'><filename>CPPFLAGS</filename></link> | ||
972 | is set to the value of this variable by default. | ||
973 | </para> | ||
974 | </glossdef> | ||
975 | </glossentry> | ||
976 | |||
977 | <glossentry id='var-BUILD_CXXFLAGS'><glossterm>BUILD_CXXFLAGS</glossterm> | ||
978 | <glossdef> | ||
979 | <para> | ||
980 | Specifies the flags to pass to the C++ compiler when | ||
981 | building for the build host. | ||
982 | When building in the <filename>native</filename> context, | ||
983 | <link linkend='var-CXXFLAGS'><filename>CXXFLAGS</filename></link> | ||
984 | is set to the value of this variable by default. | ||
985 | </para> | ||
986 | </glossdef> | ||
987 | </glossentry> | ||
988 | |||
989 | <glossentry id='var-BUILD_LDFLAGS'><glossterm>BUILD_LDFLAGS</glossterm> | ||
990 | <glossdef> | ||
991 | <para> | ||
992 | Specifies the flags to pass to the linker when building | ||
993 | for the build host. | ||
994 | When building in the <filename>-native</filename> context, | ||
995 | <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link> | ||
996 | is set to the value of this variable by default. | ||
997 | </para> | ||
998 | </glossdef> | ||
999 | </glossentry> | ||
1000 | |||
1001 | <glossentry id='var-BUILD_OPTIMIZATION'><glossterm>BUILD_OPTIMIZATION</glossterm> | ||
1002 | <glossdef> | ||
1003 | <para> | ||
1004 | Specifies the optimization flags passed to the C compiler | ||
1005 | when building for the build host or the SDK. | ||
1006 | The flags are passed through the | ||
1007 | <link linkend='var-BUILD_CFLAGS'><filename>BUILD_CFLAGS</filename></link> | ||
1008 | and | ||
1009 | <link linkend='var-BUILDSDK_CFLAGS'><filename>BUILDSDK_CFLAGS</filename></link> | ||
1010 | default values. | ||
1011 | </para> | ||
1012 | |||
1013 | <para> | ||
1014 | The default value of the | ||
1015 | <filename>BUILD_OPTIMIZATION</filename> variable is | ||
1016 | "-O2 -pipe". | ||
1017 | </para> | ||
1018 | </glossdef> | ||
1019 | </glossentry> | ||
1020 | |||
1021 | <glossentry id='var-BUILDDIR'><glossterm>BUILDDIR</glossterm> | ||
1022 | <glossdef> | ||
1023 | <para> | ||
1024 | Points to the location of the | ||
1025 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
1026 | You can define this directory indirectly through the | ||
1027 | <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link> | ||
1028 | and | ||
1029 | <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link> | ||
1030 | scripts by passing in a Build Directory path when you run | ||
1031 | the scripts. | ||
1032 | If you run the scripts and do not provide a Build Directory | ||
1033 | path, the <filename>BUILDDIR</filename> defaults to | ||
1034 | <filename>build</filename> in the current directory. | ||
1035 | </para> | ||
1036 | </glossdef> | ||
1037 | </glossentry> | ||
1038 | |||
1039 | <glossentry id='var-BUILDHISTORY_COMMIT'><glossterm>BUILDHISTORY_COMMIT</glossterm> | ||
1040 | <glossdef> | ||
1041 | <para> | ||
1042 | When inheriting the | ||
1043 | <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link> | ||
1044 | class, specifies whether or not to commit the build | ||
1045 | history output in a local Git repository. | ||
1046 | If set to "1", this local repository will be maintained | ||
1047 | automatically by the | ||
1048 | <filename>buildhistory</filename> | ||
1049 | class and a commit will be created on every | ||
1050 | build for changes to each top-level subdirectory of the | ||
1051 | build history output (images, packages, and sdk). | ||
1052 | If you want to track changes to build history over | ||
1053 | time, you should set this value to "1". | ||
1054 | </para> | ||
1055 | |||
1056 | <para> | ||
1057 | By default, the <filename>buildhistory</filename> class | ||
1058 | does not commit the build history output in a local | ||
1059 | Git repository: | ||
1060 | <literallayout class='monospaced'> | ||
1061 | BUILDHISTORY_COMMIT ?= "0" | ||
1062 | </literallayout> | ||
1063 | </para> | ||
1064 | </glossdef> | ||
1065 | </glossentry> | ||
1066 | |||
1067 | <glossentry id='var-BUILDHISTORY_COMMIT_AUTHOR'><glossterm>BUILDHISTORY_COMMIT_AUTHOR</glossterm> | ||
1068 | <glossdef> | ||
1069 | <para> | ||
1070 | When inheriting the | ||
1071 | <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link> | ||
1072 | class, specifies the author to use for each Git commit. | ||
1073 | In order for the <filename>BUILDHISTORY_COMMIT_AUTHOR</filename> | ||
1074 | variable to work, the | ||
1075 | <link linkend='var-BUILDHISTORY_COMMIT'><filename>BUILDHISTORY_COMMIT</filename></link> | ||
1076 | variable must be set to "1". | ||
1077 | </para> | ||
1078 | |||
1079 | <para> | ||
1080 | Git requires that the value you provide for the | ||
1081 | <filename>BUILDHISTORY_COMMIT_AUTHOR</filename> variable | ||
1082 | takes the form of "name <email@host>". | ||
1083 | Providing an email address or host that is not valid does | ||
1084 | not produce an error. | ||
1085 | </para> | ||
1086 | |||
1087 | <para> | ||
1088 | By default, the <filename>buildhistory</filename> class | ||
1089 | sets the variable as follows: | ||
1090 | <literallayout class='monospaced'> | ||
1091 | BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory <buildhistory@${DISTRO}>" | ||
1092 | </literallayout> | ||
1093 | </para> | ||
1094 | </glossdef> | ||
1095 | </glossentry> | ||
1096 | |||
1097 | <glossentry id='var-BUILDHISTORY_DIR'><glossterm>BUILDHISTORY_DIR</glossterm> | ||
1098 | <glossdef> | ||
1099 | <para> | ||
1100 | When inheriting the | ||
1101 | <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link> | ||
1102 | class, specifies the directory in which build history | ||
1103 | information is kept. | ||
1104 | For more information on how the variable works, see the | ||
1105 | <filename>buildhistory.class</filename>. | ||
1106 | </para> | ||
1107 | |||
1108 | <para> | ||
1109 | By default, the <filename>buildhistory</filename> class | ||
1110 | sets the directory as follows: | ||
1111 | <literallayout class='monospaced'> | ||
1112 | BUILDHISTORY_DIR ?= "${TOPDIR}/buildhistory" | ||
1113 | </literallayout> | ||
1114 | </para> | ||
1115 | </glossdef> | ||
1116 | </glossentry> | ||
1117 | |||
1118 | <glossentry id='var-BUILDHISTORY_FEATURES'><glossterm>BUILDHISTORY_FEATURES</glossterm> | ||
1119 | <glossdef> | ||
1120 | <para> | ||
1121 | When inheriting the | ||
1122 | <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link> | ||
1123 | class, specifies the build history features to be enabled. | ||
1124 | For more information on how build history works, see the | ||
1125 | "<link linkend='maintaining-build-output-quality'>Maintaining Build Output Quality</link>" | ||
1126 | section. | ||
1127 | </para> | ||
1128 | |||
1129 | <para> | ||
1130 | You can specify three features in the form of a | ||
1131 | space-separated list: | ||
1132 | <itemizedlist> | ||
1133 | <listitem><para><emphasis>image:</emphasis> | ||
1134 | Analysis of the contents of images, which | ||
1135 | includes the list of installed packages among other | ||
1136 | things. | ||
1137 | </para></listitem> | ||
1138 | <listitem><para><emphasis>package:</emphasis> | ||
1139 | Analysis of the contents of individual packages. | ||
1140 | </para></listitem> | ||
1141 | <listitem><para><emphasis>sdk:</emphasis> | ||
1142 | Analysis of the contents of the software | ||
1143 | development kit (SDK). | ||
1144 | </para></listitem> | ||
1145 | </itemizedlist> | ||
1146 | </para> | ||
1147 | |||
1148 | <para> | ||
1149 | By default, the <filename>buildhistory</filename> class | ||
1150 | enables all three features: | ||
1151 | <literallayout class='monospaced'> | ||
1152 | BUILDHISTORY_FEATURES ?= "image package sdk" | ||
1153 | </literallayout> | ||
1154 | </para> | ||
1155 | </glossdef> | ||
1156 | </glossentry> | ||
1157 | |||
1158 | <glossentry id='var-BUILDHISTORY_IMAGE_FILES'><glossterm>BUILDHISTORY_IMAGE_FILES</glossterm> | ||
1159 | <glossdef> | ||
1160 | <para> | ||
1161 | When inheriting the | ||
1162 | <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link> | ||
1163 | class, specifies a list of paths to files copied from the | ||
1164 | image contents into the build history directory under | ||
1165 | an "image-files" directory in the directory for | ||
1166 | the image, so that you can track the contents of each file. | ||
1167 | The default is to copy <filename>/etc/passwd</filename> | ||
1168 | and <filename>/etc/group</filename>, which allows you to | ||
1169 | monitor for changes in user and group entries. | ||
1170 | You can modify the list to include any file. | ||
1171 | Specifying an invalid path does not produce an error. | ||
1172 | Consequently, you can include files that might | ||
1173 | not always be present. | ||
1174 | </para> | ||
1175 | |||
1176 | <para> | ||
1177 | By default, the <filename>buildhistory</filename> class | ||
1178 | provides paths to the following files: | ||
1179 | <literallayout class='monospaced'> | ||
1180 | BUILDHISTORY_IMAGE_FILES ?= "/etc/passwd /etc/group" | ||
1181 | </literallayout> | ||
1182 | </para> | ||
1183 | </glossdef> | ||
1184 | </glossentry> | ||
1185 | |||
1186 | <glossentry id='var-BUILDHISTORY_PUSH_REPO'><glossterm>BUILDHISTORY_PUSH_REPO</glossterm> | ||
1187 | <glossdef> | ||
1188 | <para> | ||
1189 | When inheriting the | ||
1190 | <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link> | ||
1191 | class, optionally specifies a remote repository | ||
1192 | to which build history pushes Git changes. | ||
1193 | In order for <filename>BUILDHISTORY_PUSH_REPO</filename> | ||
1194 | to work, | ||
1195 | <link linkend='var-BUILDHISTORY_COMMIT'><filename>BUILDHISTORY_COMMIT</filename></link> | ||
1196 | must be set to "1". | ||
1197 | </para> | ||
1198 | |||
1199 | <para> | ||
1200 | The repository should correspond to a remote | ||
1201 | address that specifies a repository as understood by | ||
1202 | Git, or alternatively to a remote name that you have | ||
1203 | set up manually using <filename>git remote</filename> | ||
1204 | within the local repository. | ||
1205 | </para> | ||
1206 | |||
1207 | <para> | ||
1208 | By default, the <filename>buildhistory</filename> class | ||
1209 | sets the variable as follows: | ||
1210 | <literallayout class='monospaced'> | ||
1211 | BUILDHISTORY_PUSH_REPO ?= "" | ||
1212 | </literallayout> | ||
1213 | </para> | ||
1214 | </glossdef> | ||
1215 | </glossentry> | ||
1216 | |||
1217 | <glossentry id='var-BUILDSDK_CFLAGS'><glossterm>BUILDSDK_CFLAGS</glossterm> | ||
1218 | <glossdef> | ||
1219 | <para> | ||
1220 | Specifies the flags to pass to the C compiler when building | ||
1221 | for the SDK. | ||
1222 | When building in the <filename>nativesdk</filename> | ||
1223 | context, | ||
1224 | <link linkend='var-CFLAGS'><filename>CFLAGS</filename></link> | ||
1225 | is set to the value of this variable by default. | ||
1226 | </para> | ||
1227 | </glossdef> | ||
1228 | </glossentry> | ||
1229 | |||
1230 | <glossentry id='var-BUILDSDK_CPPFLAGS'><glossterm>BUILDSDK_CPPFLAGS</glossterm> | ||
1231 | <glossdef> | ||
1232 | <para> | ||
1233 | Specifies the flags to pass to the C pre-processor | ||
1234 | (i.e. to both the C and the C++ compilers) when building | ||
1235 | for the SDK. | ||
1236 | When building in the <filename>nativesdk</filename> | ||
1237 | context, | ||
1238 | <link linkend='var-CPPFLAGS'><filename>CPPFLAGS</filename></link> | ||
1239 | is set to the value of this variable by default. | ||
1240 | </para> | ||
1241 | </glossdef> | ||
1242 | </glossentry> | ||
1243 | |||
1244 | <glossentry id='var-BUILDSDK_CXXFLAGS'><glossterm>BUILDSDK_CXXFLAGS</glossterm> | ||
1245 | <glossdef> | ||
1246 | <para> | ||
1247 | Specifies the flags to pass to the C++ compiler when | ||
1248 | building for the SDK. | ||
1249 | When building in the <filename>nativesdk</filename> | ||
1250 | context, | ||
1251 | <link linkend='var-CXXFLAGS'><filename>CXXFLAGS</filename></link> | ||
1252 | is set to the value of this variable by default. | ||
1253 | </para> | ||
1254 | </glossdef> | ||
1255 | </glossentry> | ||
1256 | |||
1257 | <glossentry id='var-BUILDSDK_LDFLAGS'><glossterm>BUILDSDK_LDFLAGS</glossterm> | ||
1258 | <glossdef> | ||
1259 | <para> | ||
1260 | Specifies the flags to pass to the linker when building | ||
1261 | for the SDK. | ||
1262 | When building in the <filename>nativesdk-</filename> | ||
1263 | context, | ||
1264 | <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link> | ||
1265 | is set to the value of this variable by default. | ||
1266 | </para> | ||
1267 | </glossdef> | ||
1268 | </glossentry> | ||
1269 | |||
1270 | <glossentry id='var-BUILDSTATS_BASE'><glossterm>BUILDSTATS_BASE</glossterm> | ||
1271 | <glossdef> | ||
1272 | <para> | ||
1273 | Points to the location of the directory that holds build | ||
1274 | statistics when you use and enable the | ||
1275 | <link linkend='ref-classes-buildstats'><filename>buildstats</filename></link> | ||
1276 | class. | ||
1277 | The <filename>BUILDSTATS_BASE</filename> directory defaults | ||
1278 | to | ||
1279 | <filename>${</filename><link linkend='var-TMPDIR'><filename>TMPDIR</filename></link><filename>}/buildstats/</filename>. | ||
1280 | </para> | ||
1281 | </glossdef> | ||
1282 | </glossentry> | ||
1283 | |||
1284 | <glossentry id='var-BUSYBOX_SPLIT_SUID'><glossterm>BUSYBOX_SPLIT_SUID</glossterm> | ||
1285 | <glossdef> | ||
1286 | <para> | ||
1287 | For the BusyBox recipe, specifies whether to split the | ||
1288 | output executable file into two parts: one for features | ||
1289 | that require <filename>setuid root</filename>, and one for | ||
1290 | the remaining features (i.e. those that do not require | ||
1291 | <filename>setuid root</filename>). | ||
1292 | </para> | ||
1293 | |||
1294 | <para> | ||
1295 | The <filename>BUSYBOX_SPLIT_SUID</filename> variable | ||
1296 | defaults to "1", which results in a single output | ||
1297 | executable file. | ||
1298 | Set the variable to "0" to split the output file. | ||
1299 | </para> | ||
1300 | </glossdef> | ||
1301 | </glossentry> | ||
1302 | |||
1303 | </glossdiv> | ||
1304 | |||
1305 | <glossdiv id='var-glossary-c'><title>C</title> | ||
1306 | |||
1307 | <glossentry id='var-CFLAGS'><glossterm>CFLAGS</glossterm> | ||
1308 | <glossdef> | ||
1309 | <para> | ||
1310 | Specifies the flags to pass to the C compiler. | ||
1311 | This variable is exported to an environment | ||
1312 | variable and thus made visible to the software being | ||
1313 | built during the compilation step. | ||
1314 | </para> | ||
1315 | |||
1316 | <para> | ||
1317 | Default initialization for <filename>CFLAGS</filename> | ||
1318 | varies depending on what is being built: | ||
1319 | <itemizedlist> | ||
1320 | <listitem><para> | ||
1321 | <link linkend='var-TARGET_CFLAGS'><filename>TARGET_CFLAGS</filename></link> | ||
1322 | when building for the target | ||
1323 | </para></listitem> | ||
1324 | <listitem><para> | ||
1325 | <link linkend='var-BUILD_CFLAGS'><filename>BUILD_CFLAGS</filename></link> | ||
1326 | when building for the build host (i.e. | ||
1327 | <filename>-native</filename>) | ||
1328 | </para></listitem> | ||
1329 | <listitem><para> | ||
1330 | <link linkend='var-BUILDSDK_CFLAGS'><filename>BUILDSDK_CFLAGS</filename></link> | ||
1331 | when building for an SDK (i.e. | ||
1332 | <filename>nativesdk-</filename>) | ||
1333 | </para></listitem> | ||
1334 | </itemizedlist> | ||
1335 | </para> | ||
1336 | </glossdef> | ||
1337 | </glossentry> | ||
1338 | |||
1339 | <glossentry id='var-CLASSOVERRIDE'><glossterm>CLASSOVERRIDE</glossterm> | ||
1340 | <glossdef> | ||
1341 | <para> | ||
1342 | An internal variable specifying the special class override | ||
1343 | that should currently apply (e.g. "class-target", | ||
1344 | "class-native", and so forth). | ||
1345 | The classes that use this variable set it to | ||
1346 | appropriate values. | ||
1347 | </para> | ||
1348 | |||
1349 | <para> | ||
1350 | You do not normally directly interact with this variable. | ||
1351 | The value for the <filename>CLASSOVERRIDE</filename> | ||
1352 | variable goes into | ||
1353 | <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link> | ||
1354 | and then can be used as an override. | ||
1355 | Here is an example where "python-native" is added to | ||
1356 | <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link> | ||
1357 | only when building for the native case: | ||
1358 | <literallayout class='monospaced'> | ||
1359 | DEPENDS_append_class-native = " python-native" | ||
1360 | </literallayout> | ||
1361 | </para> | ||
1362 | </glossdef> | ||
1363 | </glossentry> | ||
1364 | |||
1365 | <glossentry id='var-COMBINED_FEATURES'><glossterm>COMBINED_FEATURES</glossterm> | ||
1366 | <glossdef> | ||
1367 | <para> | ||
1368 | Provides a list of hardware features that are enabled in | ||
1369 | both | ||
1370 | <link linkend='var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></link> | ||
1371 | and | ||
1372 | <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>. | ||
1373 | This select list of features contains features that make | ||
1374 | sense to be controlled both at the machine and distribution | ||
1375 | configuration level. | ||
1376 | For example, the "bluetooth" feature requires hardware | ||
1377 | support but should also be optional at the distribution | ||
1378 | level, in case the hardware supports Bluetooth but you | ||
1379 | do not ever intend to use it. | ||
1380 | </para> | ||
1381 | |||
1382 | <para> | ||
1383 | For more information, see the | ||
1384 | <link linkend='var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></link> | ||
1385 | and <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link> | ||
1386 | variables. | ||
1387 | </para> | ||
1388 | </glossdef> | ||
1389 | </glossentry> | ||
1390 | |||
1391 | <glossentry id='var-COMMON_LICENSE_DIR'><glossterm>COMMON_LICENSE_DIR</glossterm> | ||
1392 | <glossdef> | ||
1393 | <para> | ||
1394 | Points to <filename>meta/files/common-licenses</filename> | ||
1395 | in the | ||
1396 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>, | ||
1397 | which is where generic license files reside. | ||
1398 | </para> | ||
1399 | </glossdef> | ||
1400 | </glossentry> | ||
1401 | |||
1402 | <glossentry id='var-COMPATIBLE_HOST'><glossterm>COMPATIBLE_HOST</glossterm> | ||
1403 | <glossdef> | ||
1404 | <para>A regular expression that resolves to one or more hosts | ||
1405 | (when the recipe is native) or one or more targets (when | ||
1406 | the recipe is non-native) with which a recipe is compatible. | ||
1407 | The regular expression is matched against | ||
1408 | <link linkend="var-HOST_SYS"><filename>HOST_SYS</filename></link>. | ||
1409 | You can use the variable to stop recipes from being built | ||
1410 | for classes of systems with which the recipes are not | ||
1411 | compatible. | ||
1412 | Stopping these builds is particularly useful with kernels. | ||
1413 | The variable also helps to increase parsing speed | ||
1414 | since the build system skips parsing recipes not | ||
1415 | compatible with the current system.</para> | ||
1416 | </glossdef> | ||
1417 | </glossentry> | ||
1418 | |||
1419 | <glossentry id='var-COMPATIBLE_MACHINE'><glossterm>COMPATIBLE_MACHINE</glossterm> | ||
1420 | <glossdef> | ||
1421 | <para>A regular expression that resolves to one or more | ||
1422 | target machines with which a recipe is compatible. | ||
1423 | The regular expression is matched against | ||
1424 | <link linkend="var-MACHINEOVERRIDES"><filename>MACHINEOVERRIDES</filename></link>. | ||
1425 | You can use the variable to stop recipes from being built | ||
1426 | for machines with which the recipes are not compatible. | ||
1427 | Stopping these builds is particularly useful with kernels. | ||
1428 | The variable also helps to increase parsing speed | ||
1429 | since the build system skips parsing recipes not | ||
1430 | compatible with the current machine.</para> | ||
1431 | </glossdef> | ||
1432 | </glossentry> | ||
1433 | |||
1434 | <glossentry id='var-COMPLEMENTARY_GLOB'><glossterm>COMPLEMENTARY_GLOB</glossterm> | ||
1435 | <glossdef> | ||
1436 | <para> | ||
1437 | Defines wildcards to match when installing a list of | ||
1438 | complementary packages for all the packages explicitly | ||
1439 | (or implicitly) installed in an image. | ||
1440 | The resulting list of complementary packages is associated | ||
1441 | with an item that can be added to | ||
1442 | <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>. | ||
1443 | An example usage of this is the "dev-pkgs" item that when | ||
1444 | added to <filename>IMAGE_FEATURES</filename> will | ||
1445 | install -dev packages (containing headers and other | ||
1446 | development files) for every package in the image. | ||
1447 | </para> | ||
1448 | |||
1449 | <para> | ||
1450 | To add a new feature item pointing to a wildcard, use a | ||
1451 | variable flag to specify the feature item name and | ||
1452 | use the value to specify the wildcard. | ||
1453 | Here is an example: | ||
1454 | <literallayout class='monospaced'> | ||
1455 | COMPLEMENTARY_GLOB[dev-pkgs] = '*-dev' | ||
1456 | </literallayout> | ||
1457 | </para> | ||
1458 | </glossdef> | ||
1459 | </glossentry> | ||
1460 | |||
1461 | <glossentry id='var-CONFFILES'><glossterm>CONFFILES</glossterm> | ||
1462 | <glossdef> | ||
1463 | <para> | ||
1464 | Identifies editable or configurable files that are part of a package. | ||
1465 | If the Package Management System (PMS) is being used to update | ||
1466 | packages on the target system, it is possible that | ||
1467 | configuration files you have changed after the original installation | ||
1468 | and that you now want to remain unchanged are overwritten. | ||
1469 | In other words, editable files might exist in the package that you do not | ||
1470 | want reset as part of the package update process. | ||
1471 | You can use the <filename>CONFFILES</filename> variable to list the files in the | ||
1472 | package that you wish to prevent the PMS from overwriting during this update process. | ||
1473 | </para> | ||
1474 | |||
1475 | <para> | ||
1476 | To use the <filename>CONFFILES</filename> variable, provide a package name | ||
1477 | override that identifies the resulting package. | ||
1478 | Then, provide a space-separated list of files. | ||
1479 | Here is an example: | ||
1480 | <literallayout class='monospaced'> | ||
1481 | CONFFILES_${PN} += "${sysconfdir}/file1 \ | ||
1482 | ${sysconfdir}/file2 ${sysconfdir}/file3" | ||
1483 | </literallayout> | ||
1484 | </para> | ||
1485 | |||
1486 | <para> | ||
1487 | A relationship exists between the <filename>CONFFILES</filename> and | ||
1488 | <filename><link linkend='var-FILES'>FILES</link></filename> variables. | ||
1489 | The files listed within <filename>CONFFILES</filename> must be a subset of | ||
1490 | the files listed within <filename>FILES</filename>. | ||
1491 | Because the configuration files you provide with <filename>CONFFILES</filename> | ||
1492 | are simply being identified so that the PMS will not overwrite them, | ||
1493 | it makes sense that | ||
1494 | the files must already be included as part of the package through the | ||
1495 | <filename>FILES</filename> variable. | ||
1496 | </para> | ||
1497 | |||
1498 | <note> | ||
1499 | When specifying paths as part of the <filename>CONFFILES</filename> variable, | ||
1500 | it is good practice to use appropriate path variables. | ||
1501 | For example, <filename>${sysconfdir}</filename> rather than | ||
1502 | <filename>/etc</filename> or <filename>${bindir}</filename> rather | ||
1503 | than <filename>/usr/bin</filename>. | ||
1504 | You can find a list of these variables at the top of the | ||
1505 | <filename>meta/conf/bitbake.conf</filename> file in the | ||
1506 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
1507 | </note> | ||
1508 | </glossdef> | ||
1509 | </glossentry> | ||
1510 | |||
1511 | <glossentry id='var-CONFIG_INITRAMFS_SOURCE'><glossterm>CONFIG_INITRAMFS_SOURCE</glossterm> | ||
1512 | <glossdef> | ||
1513 | <para> | ||
1514 | Identifies the initial RAM disk (initramfs) source files. | ||
1515 | The OpenEmbedded build system receives and uses | ||
1516 | this kernel Kconfig variable as an environment variable. | ||
1517 | By default, the variable is set to null (""). | ||
1518 | </para> | ||
1519 | |||
1520 | <para> | ||
1521 | The <filename>CONFIG_INITRAMFS_SOURCE</filename> can be | ||
1522 | either a single cpio archive with a | ||
1523 | <filename>.cpio</filename> suffix or a | ||
1524 | space-separated list of directories and files for building | ||
1525 | the initramfs image. | ||
1526 | A cpio archive should contain a filesystem archive | ||
1527 | to be used as an initramfs image. | ||
1528 | Directories should contain a filesystem layout to be | ||
1529 | included in the initramfs image. | ||
1530 | Files should contain entries according to the format | ||
1531 | described by the | ||
1532 | <filename>usr/gen_init_cpio</filename> program in the | ||
1533 | kernel tree. | ||
1534 | </para> | ||
1535 | |||
1536 | <para> | ||
1537 | If you specify multiple directories and files, the | ||
1538 | initramfs image will be the aggregate of all of them. | ||
1539 | </para> | ||
1540 | </glossdef> | ||
1541 | </glossentry> | ||
1542 | |||
1543 | <glossentry id='var-CONFIG_SITE'><glossterm>CONFIG_SITE</glossterm> | ||
1544 | <glossdef> | ||
1545 | <para> | ||
1546 | A list of files that contains <filename>autoconf</filename> test results relevant | ||
1547 | to the current build. | ||
1548 | This variable is used by the Autotools utilities when running | ||
1549 | <filename>configure</filename>. | ||
1550 | </para> | ||
1551 | </glossdef> | ||
1552 | </glossentry> | ||
1553 | |||
1554 | <glossentry id='var-CONFLICT_DISTRO_FEATURES'><glossterm>CONFLICT_DISTRO_FEATURES</glossterm> | ||
1555 | <glossdef> | ||
1556 | <para> | ||
1557 | When a recipe inherits the | ||
1558 | <filename>distro_features_check</filename> class, this | ||
1559 | variable identifies distribution features that would | ||
1560 | be in conflict should the recipe | ||
1561 | be built. | ||
1562 | In other words, if the | ||
1563 | <filename>CONFLICT_DISTRO_FEATURES</filename> variable | ||
1564 | lists a feature that also appears in | ||
1565 | <filename>DISTRO_FEATURES</filename> within the | ||
1566 | current configuration, an error occurs and the | ||
1567 | build stops. | ||
1568 | </para> | ||
1569 | </glossdef> | ||
1570 | </glossentry> | ||
1571 | |||
1572 | <glossentry id='var-COPY_LIC_DIRS'><glossterm>COPY_LIC_DIRS</glossterm> | ||
1573 | <glossdef> | ||
1574 | <para> | ||
1575 | If set to "1" along with the | ||
1576 | <link linkend='var-COPY_LIC_MANIFEST'><filename>COPY_LIC_MANIFEST</filename></link> | ||
1577 | variable, the OpenEmbedded build system copies | ||
1578 | into the image the license files, which are located in | ||
1579 | <filename>/usr/share/common-licenses</filename>, | ||
1580 | for each package. | ||
1581 | The license files are placed | ||
1582 | in directories within the image itself. | ||
1583 | </para> | ||
1584 | </glossdef> | ||
1585 | </glossentry> | ||
1586 | |||
1587 | <glossentry id='var-COPY_LIC_MANIFEST'><glossterm>COPY_LIC_MANIFEST</glossterm> | ||
1588 | <glossdef> | ||
1589 | <para> | ||
1590 | If set to "1", the OpenEmbedded build system copies | ||
1591 | the license manifest for the image to | ||
1592 | <filename>/usr/share/common-licenses/license.manifest</filename> | ||
1593 | within the image itself. | ||
1594 | </para> | ||
1595 | </glossdef> | ||
1596 | </glossentry> | ||
1597 | |||
1598 | <glossentry id='var-CORE_IMAGE_EXTRA_INSTALL'><glossterm>CORE_IMAGE_EXTRA_INSTALL</glossterm> | ||
1599 | <glossdef> | ||
1600 | <para> | ||
1601 | Specifies the list of packages to be added to the image. | ||
1602 | You should only set this variable in the | ||
1603 | <filename>local.conf</filename> configuration file found | ||
1604 | in the | ||
1605 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
1606 | </para> | ||
1607 | |||
1608 | <para> | ||
1609 | This variable replaces <filename>POKY_EXTRA_INSTALL</filename>, which is no longer supported. | ||
1610 | </para> | ||
1611 | </glossdef> | ||
1612 | </glossentry> | ||
1613 | |||
1614 | <glossentry id='var-COREBASE'><glossterm>COREBASE</glossterm> | ||
1615 | <glossdef> | ||
1616 | <para> | ||
1617 | Specifies the parent directory of the OpenEmbedded | ||
1618 | Core Metadata layer (i.e. <filename>meta</filename>). | ||
1619 | </para> | ||
1620 | |||
1621 | <para> | ||
1622 | It is an important distinction that | ||
1623 | <filename>COREBASE</filename> points to the parent of this | ||
1624 | layer and not the layer itself. | ||
1625 | Consider an example where you have cloned the Poky Git | ||
1626 | repository and retained the <filename>poky</filename> | ||
1627 | name for your local copy of the repository. | ||
1628 | In this case, <filename>COREBASE</filename> points to | ||
1629 | the <filename>poky</filename> folder because it is the | ||
1630 | parent directory of the <filename>poky/meta</filename> | ||
1631 | layer. | ||
1632 | </para> | ||
1633 | </glossdef> | ||
1634 | </glossentry> | ||
1635 | |||
1636 | <glossentry id='var-CPPFLAGS'><glossterm>CPPFLAGS</glossterm> | ||
1637 | <glossdef> | ||
1638 | <para> | ||
1639 | Specifies the flags to pass to the C pre-processor | ||
1640 | (i.e. to both the C and the C++ compilers). | ||
1641 | This variable is exported to an environment | ||
1642 | variable and thus made visible to the software being | ||
1643 | built during the compilation step. | ||
1644 | </para> | ||
1645 | |||
1646 | <para> | ||
1647 | Default initialization for <filename>CPPFLAGS</filename> | ||
1648 | varies depending on what is being built: | ||
1649 | <itemizedlist> | ||
1650 | <listitem><para> | ||
1651 | <link linkend='var-TARGET_CPPFLAGS'><filename>TARGET_CPPFLAGS</filename></link> | ||
1652 | when building for the target | ||
1653 | </para></listitem> | ||
1654 | <listitem><para> | ||
1655 | <link linkend='var-BUILD_CPPFLAGS'><filename>BUILD_CPPFLAGS</filename></link> | ||
1656 | when building for the build host (i.e. | ||
1657 | <filename>-native</filename>) | ||
1658 | </para></listitem> | ||
1659 | <listitem><para> | ||
1660 | <link linkend='var-BUILDSDK_CPPFLAGS'><filename>BUILDSDK_CPPFLAGS</filename></link> | ||
1661 | when building for an SDK (i.e. | ||
1662 | <filename>nativesdk-</filename>) | ||
1663 | </para></listitem> | ||
1664 | </itemizedlist> | ||
1665 | </para> | ||
1666 | </glossdef> | ||
1667 | </glossentry> | ||
1668 | |||
1669 | <glossentry id='var-CXXFLAGS'><glossterm>CXXFLAGS</glossterm> | ||
1670 | <glossdef> | ||
1671 | <para> | ||
1672 | Specifies the flags to pass to the C++ compiler. | ||
1673 | This variable is exported to an environment | ||
1674 | variable and thus made visible to the software being | ||
1675 | built during the compilation step. | ||
1676 | </para> | ||
1677 | |||
1678 | <para> | ||
1679 | Default initialization for <filename>CXXFLAGS</filename> | ||
1680 | varies depending on what is being built: | ||
1681 | <itemizedlist> | ||
1682 | <listitem><para> | ||
1683 | <link linkend='var-TARGET_CXXFLAGS'><filename>TARGET_CXXFLAGS</filename></link> | ||
1684 | when building for the target | ||
1685 | </para></listitem> | ||
1686 | <listitem><para> | ||
1687 | <link linkend='var-BUILD_CXXFLAGS'><filename>BUILD_CXXFLAGS</filename></link> | ||
1688 | when building for the build host (i.e. | ||
1689 | <filename>-native</filename>) | ||
1690 | </para></listitem> | ||
1691 | <listitem><para> | ||
1692 | <link linkend='var-BUILDSDK_CXXFLAGS'><filename>BUILDSDK_CXXFLAGS</filename></link> | ||
1693 | when building for an SDK (i.e. | ||
1694 | <filename>nativesdk</filename>) | ||
1695 | </para></listitem> | ||
1696 | </itemizedlist> | ||
1697 | </para> | ||
1698 | </glossdef> | ||
1699 | </glossentry> | ||
1700 | |||
1701 | </glossdiv> | ||
1702 | |||
1703 | <glossdiv id='var-glossary-d'><title>D</title> | ||
1704 | |||
1705 | <glossentry id='var-D'><glossterm>D</glossterm> | ||
1706 | <glossdef> | ||
1707 | <para> | ||
1708 | The destination directory. | ||
1709 | The location in the <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
1710 | where components are installed by the | ||
1711 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
1712 | task. | ||
1713 | This location defaults to: | ||
1714 | <literallayout class='monospaced'> | ||
1715 | ${WORKDIR}/image | ||
1716 | </literallayout> | ||
1717 | </para> | ||
1718 | </glossdef> | ||
1719 | </glossentry> | ||
1720 | |||
1721 | <glossentry id='var-DATETIME'><glossterm>DATETIME</glossterm> | ||
1722 | <glossdef> | ||
1723 | <para> | ||
1724 | The date and time on which the current build started. | ||
1725 | The format is suitable for timestamps. | ||
1726 | </para> | ||
1727 | </glossdef> | ||
1728 | </glossentry> | ||
1729 | |||
1730 | <glossentry id='var-DEBUG_BUILD'><glossterm>DEBUG_BUILD</glossterm> | ||
1731 | <glossdef> | ||
1732 | <para> | ||
1733 | Specifies to build packages with debugging information. | ||
1734 | This influences the value of the | ||
1735 | <filename><link linkend='var-SELECTED_OPTIMIZATION'>SELECTED_OPTIMIZATION</link></filename> | ||
1736 | variable. | ||
1737 | </para> | ||
1738 | </glossdef> | ||
1739 | </glossentry> | ||
1740 | |||
1741 | <glossentry id='var-DEBUG_OPTIMIZATION'><glossterm>DEBUG_OPTIMIZATION</glossterm> | ||
1742 | <glossdef> | ||
1743 | <para> | ||
1744 | The options to pass in | ||
1745 | <filename><link linkend='var-TARGET_CFLAGS'>TARGET_CFLAGS</link></filename> | ||
1746 | and <filename><link linkend='var-CFLAGS'>CFLAGS</link></filename> when compiling | ||
1747 | a system for debugging. | ||
1748 | This variable defaults to "-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe". | ||
1749 | </para> | ||
1750 | </glossdef> | ||
1751 | </glossentry> | ||
1752 | |||
1753 | <glossentry id='var-DEFAULT_PREFERENCE'><glossterm>DEFAULT_PREFERENCE</glossterm> | ||
1754 | <glossdef> | ||
1755 | <para> | ||
1756 | Specifies a weak bias for recipe selection priority. | ||
1757 | </para> | ||
1758 | <para> | ||
1759 | The most common usage of this is variable is to set | ||
1760 | it to "-1" within a recipe for a development version of a | ||
1761 | piece of software. | ||
1762 | Using the variable in this way causes the stable version | ||
1763 | of the recipe to build by default in the absence of | ||
1764 | <filename><link linkend='var-PREFERRED_VERSION'>PREFERRED_VERSION</link></filename> | ||
1765 | being used to build the development version. | ||
1766 | </para> | ||
1767 | <note> | ||
1768 | The bias provided by <filename>DEFAULT_PREFERENCE</filename> | ||
1769 | is weak and is overridden by | ||
1770 | <filename><link linkend='var-BBFILE_PRIORITY'>BBFILE_PRIORITY</link></filename> | ||
1771 | if that variable is different between two layers | ||
1772 | that contain different versions of the same recipe. | ||
1773 | </note> | ||
1774 | </glossdef> | ||
1775 | </glossentry> | ||
1776 | |||
1777 | <glossentry id='var-DEFAULTTUNE'><glossterm>DEFAULTTUNE</glossterm> | ||
1778 | <glossdef> | ||
1779 | <para> | ||
1780 | The default CPU and Application Binary Interface (ABI) | ||
1781 | tunings (i.e. the "tune") used by the OpenEmbedded build | ||
1782 | system. | ||
1783 | The <filename>DEFAULTTUNE</filename> helps define | ||
1784 | <link linkend='var-TUNE_FEATURES'><filename>TUNE_FEATURES</filename></link>. | ||
1785 | </para> | ||
1786 | |||
1787 | <para> | ||
1788 | The default tune is either implicitly or explicitly set | ||
1789 | by the machine | ||
1790 | (<link linkend='var-MACHINE'><filename>MACHINE</filename></link>). | ||
1791 | However, you can override the setting using available tunes | ||
1792 | as defined with | ||
1793 | <link linkend='var-AVAILTUNES'><filename>AVAILTUNES</filename></link>. | ||
1794 | </para> | ||
1795 | </glossdef> | ||
1796 | </glossentry> | ||
1797 | |||
1798 | <glossentry id='var-DEPENDS'><glossterm>DEPENDS</glossterm> | ||
1799 | <glossdef> | ||
1800 | <para> | ||
1801 | Lists a recipe's build-time dependencies | ||
1802 | (i.e. other recipe files). | ||
1803 | The system ensures that all the dependencies listed | ||
1804 | have been built and have their contents in the appropriate | ||
1805 | sysroots before the recipe's configure task is executed. | ||
1806 | </para> | ||
1807 | |||
1808 | <para> | ||
1809 | Consider this simple example for two recipes named "a" and | ||
1810 | "b" that produce similarly named packages. | ||
1811 | In this example, the <filename>DEPENDS</filename> | ||
1812 | statement appears in the "a" recipe: | ||
1813 | <literallayout class='monospaced'> | ||
1814 | DEPENDS = "b" | ||
1815 | </literallayout> | ||
1816 | Here, the dependency is such that the | ||
1817 | <link linkend='ref-tasks-configure'><filename>do_configure</filename></link> | ||
1818 | task for recipe "a" depends on the | ||
1819 | <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link> | ||
1820 | task of recipe "b". | ||
1821 | This means anything that recipe "b" puts into sysroot | ||
1822 | is available when recipe "a" is configuring itself. | ||
1823 | </para> | ||
1824 | |||
1825 | <para> | ||
1826 | For information on runtime dependencies, see the | ||
1827 | <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link> | ||
1828 | variable. | ||
1829 | </para> | ||
1830 | </glossdef> | ||
1831 | </glossentry> | ||
1832 | |||
1833 | <glossentry id='var-DEPLOY_DIR'><glossterm>DEPLOY_DIR</glossterm> | ||
1834 | <glossdef> | ||
1835 | <para> | ||
1836 | Points to the general area that the OpenEmbedded build | ||
1837 | system uses to place images, packages, SDKs and other output | ||
1838 | files that are ready to be used outside of the build system. | ||
1839 | By default, this directory resides within the | ||
1840 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
1841 | as <filename>${TMPDIR}/deploy</filename>. | ||
1842 | </para> | ||
1843 | |||
1844 | <para> | ||
1845 | For more information on the structure of the Build | ||
1846 | Directory, see | ||
1847 | "<link linkend='structure-build'>The Build Directory - <filename>build/</filename></link>" | ||
1848 | section. | ||
1849 | For more detail on the contents of the | ||
1850 | <filename>deploy</filename> directory, see the | ||
1851 | "<link linkend='images-dev-environment'>Images</link>" and | ||
1852 | "<link linkend='sdk-dev-environment'>Application Development SDK</link>" | ||
1853 | sections. | ||
1854 | </para> | ||
1855 | </glossdef> | ||
1856 | </glossentry> | ||
1857 | |||
1858 | <glossentry id='var-DEPLOY_DIR_IMAGE'><glossterm>DEPLOY_DIR_IMAGE</glossterm> | ||
1859 | <glossdef> | ||
1860 | <para> | ||
1861 | Points to the area that the OpenEmbedded build system uses | ||
1862 | to place images and other associated output files that are | ||
1863 | ready to be deployed onto the target machine. | ||
1864 | The directory is machine-specific as it contains the | ||
1865 | <filename>${MACHINE}</filename> name. | ||
1866 | By default, this directory resides within the | ||
1867 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
1868 | as <filename>${DEPLOY_DIR}/images/${MACHINE}/</filename>. | ||
1869 | </para> | ||
1870 | |||
1871 | <para> | ||
1872 | For more information on the structure of the Build | ||
1873 | Directory, see | ||
1874 | "<link linkend='structure-build'>The Build Directory - <filename>build/</filename></link>" | ||
1875 | section. | ||
1876 | For more detail on the contents of the | ||
1877 | <filename>deploy</filename> directory, see the | ||
1878 | "<link linkend='images-dev-environment'>Images</link>" and | ||
1879 | "<link linkend='sdk-dev-environment'>Application Development SDK</link>" | ||
1880 | sections. | ||
1881 | </para> | ||
1882 | </glossdef> | ||
1883 | </glossentry> | ||
1884 | |||
1885 | <glossentry id='var-DEPLOYDIR'><glossterm>DEPLOYDIR</glossterm> | ||
1886 | <glossdef> | ||
1887 | <para> | ||
1888 | For recipes that inherit the | ||
1889 | <link linkend='ref-classes-deploy'><filename>deploy</filename></link> | ||
1890 | class, the <filename>DEPLOYDIR</filename> points to a | ||
1891 | temporary work area for deployed files that is set in the | ||
1892 | <filename>deploy</filename> class as follows: | ||
1893 | <literallayout class='monospaced'> | ||
1894 | DEPLOYDIR = "${WORKDIR}/deploy-${<link linkend='var-PN'><filename>PN</filename></link>}" | ||
1895 | </literallayout> | ||
1896 | Recipes inheriting the <filename>deploy</filename> class | ||
1897 | should copy files to be deployed into | ||
1898 | <filename>DEPLOYDIR</filename>, and the class will take | ||
1899 | care of copying them into | ||
1900 | <link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link> | ||
1901 | afterwards. | ||
1902 | </para> | ||
1903 | </glossdef> | ||
1904 | </glossentry> | ||
1905 | |||
1906 | <glossentry id='var-DESCRIPTION'><glossterm>DESCRIPTION</glossterm> | ||
1907 | <glossdef> | ||
1908 | <para>The package description used by package managers. | ||
1909 | If not set, <filename>DESCRIPTION</filename> takes | ||
1910 | the value of the | ||
1911 | <link linkend='var-SUMMARY'><filename>SUMMARY</filename></link> | ||
1912 | variable. | ||
1913 | </para> | ||
1914 | </glossdef> | ||
1915 | </glossentry> | ||
1916 | |||
1917 | <glossentry id='var-DISK_SIGNATURE'><glossterm>DISK_SIGNATURE</glossterm> | ||
1918 | <glossdef> | ||
1919 | <para> | ||
1920 | A 32-bit MBR disk signature used by | ||
1921 | <filename>directdisk</filename> images. | ||
1922 | </para> | ||
1923 | |||
1924 | <para> | ||
1925 | By default, the signature is set to an automatically | ||
1926 | generated random value that allows the OpenEmbedded | ||
1927 | build system to create a boot loader. | ||
1928 | You can override the signature in the image recipe | ||
1929 | by setting <filename>DISK_SIGNATURE</filename> to an | ||
1930 | 8-digit hex string. | ||
1931 | You might want to override | ||
1932 | <filename>DISK_SIGNATURE</filename> if you want the disk | ||
1933 | signature to remain constant between image builds. | ||
1934 | </para> | ||
1935 | |||
1936 | <para> | ||
1937 | When using Linux 3.8 or later, you can use | ||
1938 | <filename>DISK_SIGNATURE</filename> to specify the root | ||
1939 | by UUID to allow the kernel to locate the root device | ||
1940 | even if the device name changes due to differences in | ||
1941 | hardware configuration. | ||
1942 | By default, <filename>SYSLINUX_ROOT</filename> is set | ||
1943 | as follows: | ||
1944 | <literallayout class='monospaced'> | ||
1945 | SYSLINUX_ROOT = "root=/dev/sda2" | ||
1946 | </literallayout> | ||
1947 | However, you can change this to locate the root device | ||
1948 | using the disk signature instead: | ||
1949 | <literallayout class='monospaced'> | ||
1950 | SYSLINUX_ROOT = "root=PARTUUID=${DISK_SIGNATURE}-02" | ||
1951 | </literallayout> | ||
1952 | </para> | ||
1953 | |||
1954 | <para> | ||
1955 | As previously mentioned, it is possible to set the | ||
1956 | <filename>DISK_SIGNATURE</filename> variable in your | ||
1957 | <filename>local.conf</filename> file to a fixed | ||
1958 | value if you do not want <filename>syslinux.cfg</filename> | ||
1959 | changing for each build. | ||
1960 | You might find this useful when you want to upgrade the | ||
1961 | root filesystem on a device without having to recreate or | ||
1962 | modify the master boot record. | ||
1963 | </para> | ||
1964 | </glossdef> | ||
1965 | </glossentry> | ||
1966 | |||
1967 | <glossentry id='var-DISTRO'><glossterm>DISTRO</glossterm> | ||
1968 | <glossdef> | ||
1969 | <para> | ||
1970 | The short name of the distribution. | ||
1971 | This variable corresponds to a distribution | ||
1972 | configuration file whose root name is the same as the | ||
1973 | variable's argument and whose filename extension is | ||
1974 | <filename>.conf</filename>. | ||
1975 | For example, the distribution configuration file for the | ||
1976 | Poky distribution is named <filename>poky.conf</filename> | ||
1977 | and resides in the | ||
1978 | <filename>meta-yocto/conf/distro</filename> directory of | ||
1979 | the | ||
1980 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
1981 | </para> | ||
1982 | |||
1983 | <para> | ||
1984 | Within that <filename>poky.conf</filename> file, the | ||
1985 | <filename>DISTRO</filename> variable is set as follows: | ||
1986 | <literallayout class='monospaced'> | ||
1987 | DISTRO = "poky" | ||
1988 | </literallayout> | ||
1989 | </para> | ||
1990 | |||
1991 | <para> | ||
1992 | Distribution configuration files are located in a | ||
1993 | <filename>conf/distro</filename> directory within the | ||
1994 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> | ||
1995 | that contains the distribution configuration. | ||
1996 | The value for <filename>DISTRO</filename> must not contain | ||
1997 | spaces, and is typically all lower-case. | ||
1998 | <note> | ||
1999 | If the <filename>DISTRO</filename> variable is blank, a set | ||
2000 | of default configurations are used, which are specified | ||
2001 | within | ||
2002 | <filename>meta/conf/distro/defaultsetup.conf</filename> | ||
2003 | also in the Source Directory. | ||
2004 | </note> | ||
2005 | </para> | ||
2006 | </glossdef> | ||
2007 | </glossentry> | ||
2008 | |||
2009 | <glossentry id='var-DISTRO_EXTRA_RDEPENDS'><glossterm>DISTRO_EXTRA_RDEPENDS</glossterm> | ||
2010 | <glossdef> | ||
2011 | <para> | ||
2012 | Specifies a list of distro-specific packages to add to all images. | ||
2013 | This variable takes affect through | ||
2014 | <filename>packagegroup-base</filename> so the | ||
2015 | variable only really applies to the more full-featured | ||
2016 | images that include <filename>packagegroup-base</filename>. | ||
2017 | You can use this variable to keep distro policy out of | ||
2018 | generic images. | ||
2019 | As with all other distro variables, you set this variable | ||
2020 | in the distro <filename>.conf</filename> file. | ||
2021 | </para> | ||
2022 | </glossdef> | ||
2023 | </glossentry> | ||
2024 | |||
2025 | <glossentry id='var-DISTRO_EXTRA_RRECOMMENDS'><glossterm>DISTRO_EXTRA_RRECOMMENDS</glossterm> | ||
2026 | <glossdef> | ||
2027 | <para> | ||
2028 | Specifies a list of distro-specific packages to add to all images | ||
2029 | if the packages exist. | ||
2030 | The packages might not exist or be empty (e.g. kernel modules). | ||
2031 | The list of packages are automatically installed but you can | ||
2032 | remove them. | ||
2033 | </para> | ||
2034 | </glossdef> | ||
2035 | </glossentry> | ||
2036 | |||
2037 | <glossentry id='var-DISTRO_FEATURES'><glossterm>DISTRO_FEATURES</glossterm> | ||
2038 | <glossdef> | ||
2039 | <para> | ||
2040 | The software support you want in your distribution for | ||
2041 | various features. | ||
2042 | You define your distribution features in the distribution | ||
2043 | configuration file. | ||
2044 | </para> | ||
2045 | |||
2046 | <para> | ||
2047 | In most cases, the presence or absence of a feature in | ||
2048 | <filename>DISTRO_FEATURES</filename> is translated to the | ||
2049 | appropriate option supplied to the configure script | ||
2050 | during the | ||
2051 | <link linkend='ref-tasks-configure'><filename>do_configure</filename></link> | ||
2052 | task for recipes that optionally support the feature. | ||
2053 | For example, specifying "x11" in | ||
2054 | <filename>DISTRO_FEATURES</filename>, causes | ||
2055 | every piece of software built for the target that can | ||
2056 | optionally support X11 to have its X11 support enabled. | ||
2057 | </para> | ||
2058 | |||
2059 | <para> | ||
2060 | Two more examples are Bluetooth and NFS support. | ||
2061 | For a more complete list of features that ships with the | ||
2062 | Yocto Project and that you can provide with this variable, | ||
2063 | see the | ||
2064 | "<link linkend='ref-features-distro'>Distro Features</link>" | ||
2065 | section. | ||
2066 | </para> | ||
2067 | </glossdef> | ||
2068 | </glossentry> | ||
2069 | |||
2070 | <glossentry id='var-DISTRO_FEATURES_BACKFILL'><glossterm>DISTRO_FEATURES_BACKFILL</glossterm> | ||
2071 | <glossdef> | ||
2072 | <para>Features to be added to | ||
2073 | <filename><link linkend='var-DISTRO_FEATURES'>DISTRO_FEATURES</link></filename> | ||
2074 | if not also present in | ||
2075 | <filename><link linkend='var-DISTRO_FEATURES_BACKFILL_CONSIDERED'>DISTRO_FEATURES_BACKFILL_CONSIDERED</link></filename>. | ||
2076 | </para> | ||
2077 | |||
2078 | <para> | ||
2079 | This variable is set in the <filename>meta/conf/bitbake.conf</filename> file. | ||
2080 | It is not intended to be user-configurable. | ||
2081 | It is best to just reference the variable to see which distro features are | ||
2082 | being backfilled for all distro configurations. | ||
2083 | See the <link linkend='ref-features-backfill'>Feature backfilling</link> section for | ||
2084 | more information. | ||
2085 | </para> | ||
2086 | </glossdef> | ||
2087 | </glossentry> | ||
2088 | |||
2089 | <glossentry id='var-DISTRO_FEATURES_BACKFILL_CONSIDERED'><glossterm>DISTRO_FEATURES_BACKFILL_CONSIDERED</glossterm> | ||
2090 | <glossdef> | ||
2091 | <para>Features from | ||
2092 | <filename><link linkend='var-DISTRO_FEATURES_BACKFILL'>DISTRO_FEATURES_BACKFILL</link></filename> | ||
2093 | that should not be backfilled (i.e. added to | ||
2094 | <filename><link linkend='var-DISTRO_FEATURES'>DISTRO_FEATURES</link></filename>) | ||
2095 | during the build. | ||
2096 | See the "<link linkend='ref-features-backfill'>Feature Backfilling</link>" section for | ||
2097 | more information. | ||
2098 | </para> | ||
2099 | </glossdef> | ||
2100 | </glossentry> | ||
2101 | |||
2102 | <glossentry id='var-DISTRO_NAME'><glossterm>DISTRO_NAME</glossterm> | ||
2103 | <glossdef> | ||
2104 | <para>The long name of the distribution.</para> | ||
2105 | </glossdef> | ||
2106 | </glossentry> | ||
2107 | |||
2108 | <glossentry id='var-DISTRO_PN_ALIAS'><glossterm>DISTRO_PN_ALIAS</glossterm> | ||
2109 | <glossdef> | ||
2110 | <para>Alias names used for the recipe in various Linux distributions.</para> | ||
2111 | <para>See the | ||
2112 | "<ulink url='&YOCTO_DOCS_DEV_URL;#usingpoky-configuring-DISTRO_PN_ALIAS'>Handling | ||
2113 | a Package Name Alias</ulink>" section in the Yocto Project Development | ||
2114 | Manual for more information.</para> | ||
2115 | </glossdef> | ||
2116 | </glossentry> | ||
2117 | |||
2118 | <glossentry id='var-DISTRO_VERSION'><glossterm>DISTRO_VERSION</glossterm> | ||
2119 | <glossdef> | ||
2120 | <para>The version of the distribution.</para> | ||
2121 | </glossdef> | ||
2122 | </glossentry> | ||
2123 | |||
2124 | <glossentry id='var-DISTROOVERRIDES'><glossterm>DISTROOVERRIDES</glossterm> | ||
2125 | <glossdef> | ||
2126 | <para> | ||
2127 | This variable lists overrides specific to the current | ||
2128 | distribution. | ||
2129 | By default, the variable list includes the value of the | ||
2130 | <filename><link linkend='var-DISTRO'>DISTRO</link></filename> | ||
2131 | variable. | ||
2132 | You can extend the variable to apply any variable overrides | ||
2133 | you want as part of the distribution and are not | ||
2134 | already in <filename>OVERRIDES</filename> through | ||
2135 | some other means. | ||
2136 | </para> | ||
2137 | </glossdef> | ||
2138 | </glossentry> | ||
2139 | |||
2140 | <glossentry id='var-DL_DIR'><glossterm>DL_DIR</glossterm> | ||
2141 | <glossdef> | ||
2142 | <para> | ||
2143 | The central download directory used by the build process to | ||
2144 | store downloads. | ||
2145 | By default, <filename>DL_DIR</filename> gets files | ||
2146 | suitable for mirroring for everything except Git | ||
2147 | repositories. | ||
2148 | If you want tarballs of Git repositories, use the | ||
2149 | <link linkend='var-BB_GENERATE_MIRROR_TARBALLS'><filename>BB_GENERATE_MIRROR_TARBALLS</filename></link> | ||
2150 | variable. | ||
2151 | </para> | ||
2152 | |||
2153 | <para> | ||
2154 | You can set this directory by defining the | ||
2155 | <filename>DL_DIR</filename> variable in the | ||
2156 | <filename>conf/local.conf</filename> file. | ||
2157 | This directory is self-maintaining and you should not have | ||
2158 | to touch it. | ||
2159 | By default, the directory is <filename>downloads</filename> | ||
2160 | in the | ||
2161 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
2162 | <literallayout class='monospaced'> | ||
2163 | #DL_DIR ?= "${TOPDIR}/downloads" | ||
2164 | </literallayout> | ||
2165 | To specify a different download directory, simply remove | ||
2166 | the comment from the line and provide your directory. | ||
2167 | </para> | ||
2168 | |||
2169 | <para> | ||
2170 | During a first build, the system downloads many different | ||
2171 | source code tarballs from various upstream projects. | ||
2172 | Downloading can take a while, particularly if your network | ||
2173 | connection is slow. | ||
2174 | Tarballs are all stored in the directory defined by | ||
2175 | <filename>DL_DIR</filename> and the build system looks there | ||
2176 | first to find source tarballs. | ||
2177 | <note> | ||
2178 | When wiping and rebuilding, you can preserve this | ||
2179 | directory to speed up this part of subsequent | ||
2180 | builds. | ||
2181 | </note> | ||
2182 | </para> | ||
2183 | |||
2184 | <para> | ||
2185 | You can safely share this directory between multiple builds | ||
2186 | on the same development machine. | ||
2187 | For additional information on how the build process gets | ||
2188 | source files when working behind a firewall or proxy server, | ||
2189 | see this specific question in the | ||
2190 | "<link linkend='how-does-the-yocto-project-obtain-source-code-and-will-it-work-behind-my-firewall-or-proxy-server'>FAQ</link>" | ||
2191 | chapter. | ||
2192 | </para> | ||
2193 | </glossdef> | ||
2194 | |||
2195 | </glossentry> | ||
2196 | </glossdiv> | ||
2197 | |||
2198 | <glossdiv id='var-glossary-e'><title>E</title> | ||
2199 | |||
2200 | <glossentry id='var-ENABLE_BINARY_LOCALE_GENERATION'><glossterm>ENABLE_BINARY_LOCALE_GENERATION</glossterm> | ||
2201 | <glossdef> | ||
2202 | <para></para> | ||
2203 | <para>Variable that controls which locales for | ||
2204 | <filename>eglibc</filename> are generated during the | ||
2205 | build (useful if the target device has 64Mbytes | ||
2206 | of RAM or less).</para> | ||
2207 | </glossdef> | ||
2208 | </glossentry> | ||
2209 | |||
2210 | <glossentry id='var-ERROR_QA'><glossterm>ERROR_QA</glossterm> | ||
2211 | <glossdef> | ||
2212 | <para> | ||
2213 | Specifies the quality assurance checks whose failures are | ||
2214 | reported as errors by the OpenEmbedded build system. | ||
2215 | You set this variable in your distribution configuration | ||
2216 | file. | ||
2217 | For a list of the checks you can control with this variable, | ||
2218 | see the | ||
2219 | "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>" | ||
2220 | section. | ||
2221 | </para> | ||
2222 | </glossdef> | ||
2223 | </glossentry> | ||
2224 | |||
2225 | <glossentry id='var-ERR_REPORT_DIR'><glossterm>ERR_REPORT_DIR</glossterm> | ||
2226 | <glossdef> | ||
2227 | <para> | ||
2228 | When used with the | ||
2229 | <link linkend='ref-classes-report-error'><filename>report-error</filename></link> | ||
2230 | class, specifies the path used for storing the debug files | ||
2231 | created by the | ||
2232 | <ulink url='&YOCTO_DOCS_DEV_URL;#using-the-error-reporting-tool'>error reporting tool</ulink>, | ||
2233 | which allows you to submit build errors you encounter to a | ||
2234 | central database. | ||
2235 | By default, the value of this variable is | ||
2236 | <filename>${</filename><link linkend='var-LOG_DIR'><filename>LOG_DIR</filename></link><filename>}/error-report</filename>. | ||
2237 | </para> | ||
2238 | |||
2239 | <para> | ||
2240 | You can set <filename>ERR_REPORT_DIR</filename> to the path | ||
2241 | you want the error reporting tool to store the debug files | ||
2242 | as follows in your <filename>local.conf</filename> file: | ||
2243 | <literallayout class='monospaced'> | ||
2244 | ERR_REPORT_DIR = "path" | ||
2245 | </literallayout> | ||
2246 | </para> | ||
2247 | </glossdef> | ||
2248 | </glossentry> | ||
2249 | |||
2250 | <glossentry id='var-EXCLUDE_FROM_WORLD'><glossterm>EXCLUDE_FROM_WORLD</glossterm> | ||
2251 | <glossdef> | ||
2252 | <para> | ||
2253 | Directs BitBake to exclude a recipe from world builds (i.e. | ||
2254 | <filename>bitbake world</filename>). | ||
2255 | During world builds, BitBake locates, parses and builds all | ||
2256 | recipes found in every layer exposed in the | ||
2257 | <filename>bblayers.conf</filename> configuration file. | ||
2258 | </para> | ||
2259 | |||
2260 | <para> | ||
2261 | To exclude a recipe from a world build using this variable, | ||
2262 | set the variable to "1" in the recipe. | ||
2263 | </para> | ||
2264 | |||
2265 | <note> | ||
2266 | Recipes added to <filename>EXCLUDE_FROM_WORLD</filename> | ||
2267 | may still be built during a world build in order to satisfy | ||
2268 | dependencies of other recipes. | ||
2269 | Adding a recipe to <filename>EXCLUDE_FROM_WORLD</filename> | ||
2270 | only ensures that the recipe is not explicitly added | ||
2271 | to the list of build targets in a world build. | ||
2272 | </note> | ||
2273 | </glossdef> | ||
2274 | </glossentry> | ||
2275 | |||
2276 | <glossentry id='var-EXTENDPE'><glossterm>EXTENDPE</glossterm> | ||
2277 | <glossdef> | ||
2278 | <para> | ||
2279 | Used with file and pathnames to create a prefix for a recipe's | ||
2280 | version based on the recipe's | ||
2281 | <link linkend='var-PE'><filename>PE</filename></link> value. | ||
2282 | If <filename>PE</filename> is set and greater than zero for a recipe, | ||
2283 | <filename>EXTENDPE</filename> becomes that value (e.g if | ||
2284 | <filename>PE</filename> is equal to "1" then <filename>EXTENDPE</filename> | ||
2285 | becomes "1_"). | ||
2286 | If a recipe's <filename>PE</filename> is not set (the default) or is equal to | ||
2287 | zero, <filename>EXTENDPE</filename> becomes "".</para> | ||
2288 | <para>See the <link linkend='var-STAMP'><filename>STAMP</filename></link> | ||
2289 | variable for an example. | ||
2290 | </para> | ||
2291 | </glossdef> | ||
2292 | </glossentry> | ||
2293 | |||
2294 | <glossentry id='var-EXTENDPKGV'><glossterm>EXTENDPKGV</glossterm> | ||
2295 | <glossdef> | ||
2296 | <para> | ||
2297 | The full package version specification as it appears on the | ||
2298 | final packages produced by a recipe. | ||
2299 | The variable's value is normally used to fix a runtime | ||
2300 | dependency to the exact same version of another package | ||
2301 | in the same recipe: | ||
2302 | <literallayout class='monospaced'> | ||
2303 | RDEPENDS_${PN}-additional-module = "${PN} (= ${EXTENDPKGV})" | ||
2304 | </literallayout> | ||
2305 | </para> | ||
2306 | |||
2307 | <para> | ||
2308 | The dependency relationships are intended to force the | ||
2309 | package manager to upgrade these types of packages in | ||
2310 | lock-step. | ||
2311 | </para> | ||
2312 | </glossdef> | ||
2313 | </glossentry> | ||
2314 | |||
2315 | <glossentry id='var-EXTERNALSRC'><glossterm>EXTERNALSRC</glossterm> | ||
2316 | <glossdef> | ||
2317 | <para> | ||
2318 | If <filename>externalsrc.bbclass</filename> is inherited, | ||
2319 | this variable points to the source tree, which is | ||
2320 | outside of the OpenEmbedded build system. | ||
2321 | When set, this variable sets the | ||
2322 | <link linkend='var-S'><filename>S</filename></link> | ||
2323 | variable, which is what the OpenEmbedded build system uses | ||
2324 | to locate unpacked recipe source code. | ||
2325 | </para> | ||
2326 | |||
2327 | <para> | ||
2328 | For more information on | ||
2329 | <filename>externalsrc.bbclass</filename>, see the | ||
2330 | "<link linkend='ref-classes-externalsrc'><filename>externalsrc.bbclass</filename></link>" | ||
2331 | section. | ||
2332 | You can also find information on how to use this variable | ||
2333 | in the | ||
2334 | "<ulink url='&YOCTO_DOCS_DEV_URL;#building-software-from-an-external-source'>Building Software from an External Source</ulink>" | ||
2335 | section in the Yocto Project Development Manual. | ||
2336 | </para> | ||
2337 | </glossdef> | ||
2338 | </glossentry> | ||
2339 | |||
2340 | <glossentry id='var-EXTERNALSRC_BUILD'><glossterm>EXTERNALSRC_BUILD</glossterm> | ||
2341 | <glossdef> | ||
2342 | <para> | ||
2343 | If <filename>externalsrc.bbclass</filename> is inherited, | ||
2344 | this variable points to the directory in which the recipe's | ||
2345 | source code is built, | ||
2346 | which is outside of the OpenEmbedded build system. | ||
2347 | When set, this variable sets the | ||
2348 | <link linkend='var-B'><filename>B</filename></link> | ||
2349 | variable, which is what the OpenEmbedded build system uses | ||
2350 | to locate the Build Directory. | ||
2351 | </para> | ||
2352 | |||
2353 | <para> | ||
2354 | For more information on | ||
2355 | <filename>externalsrc.bbclass</filename>, see the | ||
2356 | "<link linkend='ref-classes-externalsrc'><filename>externalsrc.bbclass</filename></link>" | ||
2357 | section. | ||
2358 | You can also find information on how to use this variable | ||
2359 | in the | ||
2360 | "<ulink url='&YOCTO_DOCS_DEV_URL;#building-software-from-an-external-source'>Building Software from an External Source</ulink>" | ||
2361 | section in the Yocto Project Development Manual. | ||
2362 | </para> | ||
2363 | </glossdef> | ||
2364 | </glossentry> | ||
2365 | |||
2366 | <glossentry id='var-EXTRA_IMAGE_FEATURES'><glossterm>EXTRA_IMAGE_FEATURES</glossterm> | ||
2367 | <glossdef> | ||
2368 | <para> | ||
2369 | The list of additional features to include in an image. | ||
2370 | Typically, you configure this variable in your | ||
2371 | <filename>local.conf</filename> file, which is found in the | ||
2372 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
2373 | Although you can use this variable from within a recipe, | ||
2374 | best practices dictate that you do not. | ||
2375 | <note> | ||
2376 | To enable primary features from within the image | ||
2377 | recipe, use the | ||
2378 | <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link> | ||
2379 | variable. | ||
2380 | </note> | ||
2381 | </para> | ||
2382 | |||
2383 | <para> | ||
2384 | Here are some examples of features you can add: | ||
2385 | <literallayout class='monospaced'> | ||
2386 | "dbg-pkgs" - Adds -dbg packages for all installed packages | ||
2387 | including symbol information for debugging and | ||
2388 | profiling. | ||
2389 | |||
2390 | "debug-tweaks" - Makes an image suitable for development. | ||
2391 | For example, ssh root access has a blank | ||
2392 | password. You should remove this feature | ||
2393 | before you produce a production image. | ||
2394 | |||
2395 | "dev-pkgs" - Adds -dev packages for all installed packages. | ||
2396 | This is useful if you want to develop against | ||
2397 | the libraries in the image. | ||
2398 | |||
2399 | "read-only-rootfs" - Creates an image whose root | ||
2400 | filesystem is read-only. See the | ||
2401 | "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-read-only-root-filesystem'>Creating a Read-Only Root Filesystem</ulink>" | ||
2402 | section in the Yocto Project | ||
2403 | Development Manual for more | ||
2404 | information | ||
2405 | |||
2406 | "tools-debug" - Adds debugging tools such as gdb and | ||
2407 | strace. | ||
2408 | |||
2409 | "tools-profile" - Adds profiling tools such as oprofile, | ||
2410 | exmap, lttng and valgrind (x86 only). | ||
2411 | |||
2412 | "tools-sdk" - Adds development tools such as gcc, make, | ||
2413 | pkgconfig and so forth. | ||
2414 | |||
2415 | "tools-testapps" - Adds useful testing tools such as | ||
2416 | ts_print, aplay, arecord and so | ||
2417 | forth. | ||
2418 | |||
2419 | </literallayout> | ||
2420 | </para> | ||
2421 | |||
2422 | <para> | ||
2423 | For a complete list of image features that ships with the | ||
2424 | Yocto Project, see the | ||
2425 | "<link linkend="ref-features-image">Image Features</link>" | ||
2426 | section. | ||
2427 | </para> | ||
2428 | |||
2429 | <para> | ||
2430 | For an example that shows how to customize your image by | ||
2431 | using this variable, see the | ||
2432 | "<ulink url='&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage-imagefeatures'>Customizing Images Using Custom <filename>IMAGE_FEATURES</filename> and <filename>EXTRA_IMAGE_FEATURES</filename></ulink>" | ||
2433 | section in the Yocto Project Development Manual. | ||
2434 | </para> | ||
2435 | </glossdef> | ||
2436 | </glossentry> | ||
2437 | |||
2438 | <glossentry id='var-EXTRA_IMAGECMD'><glossterm>EXTRA_IMAGECMD</glossterm> | ||
2439 | <glossdef> | ||
2440 | <para> | ||
2441 | Specifies additional options for the image | ||
2442 | creation command that has been specified in | ||
2443 | <link linkend='var-IMAGE_CMD'><filename>IMAGE_CMD</filename></link>. | ||
2444 | When setting this variable, you should | ||
2445 | use an override for the associated type. | ||
2446 | Here is an example: | ||
2447 | <literallayout class='monospaced'> | ||
2448 | EXTRA_IMAGECMD_ext3 ?= "-i 4096" | ||
2449 | </literallayout> | ||
2450 | </para> | ||
2451 | </glossdef> | ||
2452 | </glossentry> | ||
2453 | |||
2454 | <glossentry id='var-EXTRA_IMAGEDEPENDS'><glossterm>EXTRA_IMAGEDEPENDS</glossterm> | ||
2455 | <glossdef> | ||
2456 | <para>A list of recipes to build that do not provide packages | ||
2457 | for installing into the root filesystem. | ||
2458 | </para> | ||
2459 | <para>Sometimes a recipe is required to build the final image but is not | ||
2460 | needed in the root filesystem. | ||
2461 | You can use the <filename>EXTRA_IMAGEDEPENDS</filename> variable to | ||
2462 | list these recipes and thus specify the dependencies. | ||
2463 | A typical example is a required bootloader in a machine configuration. | ||
2464 | </para> | ||
2465 | <note> | ||
2466 | To add packages to the root filesystem, see the various | ||
2467 | <filename>*<link linkend='var-RDEPENDS'>RDEPENDS</link></filename> | ||
2468 | and <filename>*<link linkend='var-RRECOMMENDS'>RRECOMMENDS</link></filename> | ||
2469 | variables. | ||
2470 | </note> | ||
2471 | </glossdef> | ||
2472 | </glossentry> | ||
2473 | |||
2474 | <glossentry id='var-EXTRA_OECMAKE'><glossterm>EXTRA_OECMAKE</glossterm> | ||
2475 | <glossdef> | ||
2476 | <para>Additional <filename>cmake</filename> options.</para> | ||
2477 | </glossdef> | ||
2478 | </glossentry> | ||
2479 | |||
2480 | <glossentry id='var-EXTRA_OECONF'><glossterm>EXTRA_OECONF</glossterm> | ||
2481 | <glossdef> | ||
2482 | <para>Additional <filename>configure</filename> script options.</para> | ||
2483 | </glossdef> | ||
2484 | </glossentry> | ||
2485 | |||
2486 | <glossentry id='var-EXTRA_OEMAKE'><glossterm>EXTRA_OEMAKE</glossterm> | ||
2487 | <glossdef> | ||
2488 | <para>Additional GNU <filename>make</filename> options.</para> | ||
2489 | </glossdef> | ||
2490 | </glossentry> | ||
2491 | |||
2492 | <glossentry id='var-EXTRA_OESCONS'><glossterm>EXTRA_OESCONS</glossterm> | ||
2493 | <glossdef> | ||
2494 | <para> | ||
2495 | When a recipe inherits the | ||
2496 | <link linkend='ref-classes-scons'><filename>scons</filename></link> | ||
2497 | class, this variable specifies additional configuration | ||
2498 | options you want to pass to the | ||
2499 | <filename>scons</filename> command line. | ||
2500 | </para> | ||
2501 | </glossdef> | ||
2502 | </glossentry> | ||
2503 | |||
2504 | <glossentry id='var-EXTRA_QMAKEVARS_POST'><glossterm>EXTRA_QMAKEVARS_POST</glossterm> | ||
2505 | <glossdef> | ||
2506 | <para> | ||
2507 | Configuration variables or options you want to pass to | ||
2508 | <filename>qmake</filename>. | ||
2509 | Use this variable when the arguments need to be after the | ||
2510 | <filename>.pro</filename> file list on the command line. | ||
2511 | </para> | ||
2512 | |||
2513 | <para> | ||
2514 | This variable is used with recipes that inherit the | ||
2515 | <link linkend='ref-classes-qmake*'><filename>qmake_base</filename></link> | ||
2516 | class or other classes that inherit | ||
2517 | <filename>qmake_base</filename>. | ||
2518 | </para> | ||
2519 | </glossdef> | ||
2520 | </glossentry> | ||
2521 | |||
2522 | <glossentry id='var-EXTRA_QMAKEVARS_PRE'><glossterm>EXTRA_QMAKEVARS_PRE</glossterm> | ||
2523 | <glossdef> | ||
2524 | <para> | ||
2525 | Configuration variables or options you want to pass to | ||
2526 | <filename>qmake</filename>. | ||
2527 | Use this variable when the arguments need to be before the | ||
2528 | <filename>.pro</filename> file list on the command line. | ||
2529 | </para> | ||
2530 | |||
2531 | <para> | ||
2532 | This variable is used with recipes that inherit the | ||
2533 | <link linkend='ref-classes-qmake*'><filename>qmake_base</filename></link> | ||
2534 | class or other classes that inherit | ||
2535 | <filename>qmake_base</filename>. | ||
2536 | </para> | ||
2537 | </glossdef> | ||
2538 | </glossentry> | ||
2539 | |||
2540 | <glossentry id='var-EXTRA_USERS_PARAMS'><glossterm>EXTRA_USERS_PARAMS</glossterm> | ||
2541 | <glossdef> | ||
2542 | <para> | ||
2543 | When a recipe inherits the | ||
2544 | <link linkend='ref-classes-extrausers'><filename>extrausers</filename></link> | ||
2545 | class, this variable provides image level user and group | ||
2546 | operations. | ||
2547 | This is a more global method of providing user and group | ||
2548 | configuration as compared to using the | ||
2549 | <link linkend='ref-classes-useradd'><filename>useradd</filename></link> | ||
2550 | class, which ties user and group configurations to a | ||
2551 | specific recipe. | ||
2552 | </para> | ||
2553 | |||
2554 | <para> | ||
2555 | The set list of commands you can configure using the | ||
2556 | <filename>EXTRA_USERS_PARAMS</filename> is shown in the | ||
2557 | <filename>extrausers</filename> class. | ||
2558 | These commands map to the normal Unix commands of the same | ||
2559 | names: | ||
2560 | <literallayout class='monospaced'> | ||
2561 | # EXTRA_USERS_PARAMS = "\ | ||
2562 | # useradd -p '' tester; \ | ||
2563 | # groupadd developers; \ | ||
2564 | # userdel nobody; \ | ||
2565 | # groupdel -g video; \ | ||
2566 | # groupmod -g 1020 developers; \ | ||
2567 | # usermod -s /bin/sh tester; \ | ||
2568 | # " | ||
2569 | </literallayout> | ||
2570 | </para> | ||
2571 | </glossdef> | ||
2572 | </glossentry> | ||
2573 | |||
2574 | </glossdiv> | ||
2575 | |||
2576 | <glossdiv id='var-glossary-f'><title>F</title> | ||
2577 | |||
2578 | <glossentry id='var-FEATURE_PACKAGES'><glossterm>FEATURE_PACKAGES</glossterm> | ||
2579 | <glossdef> | ||
2580 | <para> | ||
2581 | Defines one or more packages to include in an image when | ||
2582 | a specific item is included in | ||
2583 | <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>. | ||
2584 | When setting the value, <filename>FEATURE_PACKAGES</filename> | ||
2585 | should have the name of the feature item as an override. | ||
2586 | Here is an example: | ||
2587 | <literallayout class='monospaced'> | ||
2588 | FEATURE_PACKAGES_widget = "package1 package2" | ||
2589 | </literallayout> | ||
2590 | In this example, if "widget" were added to | ||
2591 | <filename>IMAGE_FEATURES</filename>, "package1" and | ||
2592 | "package2" would be included in the image. | ||
2593 | <note> | ||
2594 | Packages installed by features defined through | ||
2595 | <filename>FEATURE_PACKAGES</filename> are often package | ||
2596 | groups. | ||
2597 | While similarly named, you should not confuse the | ||
2598 | <filename>FEATURE_PACKAGES</filename> variable with | ||
2599 | package groups, which are discussed elsewhere in the | ||
2600 | documentation. | ||
2601 | </note> | ||
2602 | </para> | ||
2603 | </glossdef> | ||
2604 | </glossentry> | ||
2605 | |||
2606 | <glossentry id='var-FEED_DEPLOYDIR_BASE_URI'><glossterm>FEED_DEPLOYDIR_BASE_URI</glossterm> | ||
2607 | <glossdef> | ||
2608 | <para> | ||
2609 | Points to the base URL of the server and location within | ||
2610 | the document-root that provides the metadata and | ||
2611 | packages required by OPKG to support runtime package | ||
2612 | management of IPK packages. | ||
2613 | You set this variable in your | ||
2614 | <filename>local.conf</filename> file. | ||
2615 | </para> | ||
2616 | |||
2617 | <para> | ||
2618 | Consider the following example: | ||
2619 | <literallayout class='monospaced'> | ||
2620 | FEED_DEPLOYDIR_BASE_URI = "http://192.168.7.1/BOARD-dir" | ||
2621 | </literallayout> | ||
2622 | This example assumes you are serving your packages over | ||
2623 | HTTP and your databases are located in a directory | ||
2624 | named <filename>BOARD-dir</filename>, which is underneath | ||
2625 | your HTTP server's document-root. | ||
2626 | In this case, the OpenEmbedded build system generates a set | ||
2627 | of configuration files for you in your target that work | ||
2628 | with the feed. | ||
2629 | </para> | ||
2630 | </glossdef> | ||
2631 | </glossentry> | ||
2632 | |||
2633 | <glossentry id='var-FILES'><glossterm>FILES</glossterm> | ||
2634 | <glossdef> | ||
2635 | <para> | ||
2636 | The list of directories or files that are placed in packages. | ||
2637 | </para> | ||
2638 | |||
2639 | <para> | ||
2640 | To use the <filename>FILES</filename> variable, provide a package name | ||
2641 | override that identifies the resulting package. | ||
2642 | Then, provide a space-separated list of files or paths that identifies the | ||
2643 | files you want included as part of the resulting package. | ||
2644 | Here is an example: | ||
2645 | <literallayout class='monospaced'> | ||
2646 | FILES_${PN} += "${bindir}/mydir1/ ${bindir}/mydir2/myfile" | ||
2647 | </literallayout> | ||
2648 | </para> | ||
2649 | |||
2650 | <note> | ||
2651 | When specifying paths as part of the <filename>FILES</filename> variable, | ||
2652 | it is good practice to use appropriate path variables. | ||
2653 | For example, use <filename>${sysconfdir}</filename> rather than | ||
2654 | <filename>/etc</filename>, or <filename>${bindir}</filename> rather | ||
2655 | than <filename>/usr/bin</filename>. | ||
2656 | You can find a list of these variables at the top of the | ||
2657 | <filename>meta/conf/bitbake.conf</filename> file in the | ||
2658 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
2659 | </note> | ||
2660 | |||
2661 | <para> | ||
2662 | If some of the files you provide with the <filename>FILES</filename> variable | ||
2663 | are editable and you know they should not be | ||
2664 | overwritten during the package update process by the Package Management | ||
2665 | System (PMS), you can identify these files so that the PMS will not | ||
2666 | overwrite them. | ||
2667 | See the <filename><link linkend='var-CONFFILES'>CONFFILES</link></filename> | ||
2668 | variable for information on how to identify these files to the PMS. | ||
2669 | </para> | ||
2670 | |||
2671 | </glossdef> | ||
2672 | </glossentry> | ||
2673 | |||
2674 | <glossentry id='var-FILESEXTRAPATHS'><glossterm>FILESEXTRAPATHS</glossterm> | ||
2675 | <glossdef> | ||
2676 | <para> | ||
2677 | Extends the search path the OpenEmbedded build system uses | ||
2678 | when looking for files and patches as it processes recipes | ||
2679 | and append files. | ||
2680 | The default directories BitBake uses when it processes | ||
2681 | recipes are initially defined by the | ||
2682 | <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link> | ||
2683 | variable. | ||
2684 | You can extend <filename>FILESPATH</filename> variable | ||
2685 | by using <filename>FILESEXTRAPATHS</filename>. | ||
2686 | </para> | ||
2687 | |||
2688 | <para> | ||
2689 | Best practices dictate that you accomplish this by using | ||
2690 | <filename>FILESEXTRAPATHS</filename> from within a | ||
2691 | <filename>.bbappend</filename> file and that you prepend | ||
2692 | paths as follows: | ||
2693 | <literallayout class='monospaced'> | ||
2694 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
2695 | </literallayout> | ||
2696 | In the above example, the build system first looks for files | ||
2697 | in a directory that has the same name as the corresponding | ||
2698 | append file. | ||
2699 | <note> | ||
2700 | <para>When extending <filename>FILESEXTRAPATHS</filename>, | ||
2701 | be sure to use the immediate expansion | ||
2702 | (<filename>:=</filename>) operator. | ||
2703 | Immediate expansion makes sure that BitBake evaluates | ||
2704 | <link linkend='var-THISDIR'><filename>THISDIR</filename></link> | ||
2705 | at the time the directive is encountered rather than at | ||
2706 | some later time when expansion might result in a | ||
2707 | directory that does not contain the files you need. | ||
2708 | </para> | ||
2709 | <para>Also, include the trailing separating colon | ||
2710 | character if you are prepending. | ||
2711 | The trailing colon character is necessary because you | ||
2712 | are directing BitBake to extend the path by prepending | ||
2713 | directories to the search path.</para> | ||
2714 | </note> | ||
2715 | Here is another common use: | ||
2716 | <literallayout class='monospaced'> | ||
2717 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
2718 | </literallayout> | ||
2719 | In this example, the build system extends the | ||
2720 | <filename>FILESPATH</filename> variable to include a | ||
2721 | directory named <filename>files</filename> that is in the | ||
2722 | same directory as the corresponding append file. | ||
2723 | </para> | ||
2724 | |||
2725 | <para> | ||
2726 | Here is a final example that specifically adds three paths: | ||
2727 | <literallayout class='monospaced'> | ||
2728 | FILESEXTRAPATHS_prepend := "path_1:path_2:path_3:" | ||
2729 | </literallayout> | ||
2730 | </para> | ||
2731 | |||
2732 | <para> | ||
2733 | By prepending paths in <filename>.bbappend</filename> | ||
2734 | files, you allow multiple append files that reside in | ||
2735 | different layers but are used for the same recipe to | ||
2736 | correctly extend the path. | ||
2737 | </para> | ||
2738 | </glossdef> | ||
2739 | </glossentry> | ||
2740 | |||
2741 | <glossentry id='var-FILESOVERRIDES'><glossterm>FILESOVERRIDES</glossterm> | ||
2742 | <glossdef> | ||
2743 | <para> | ||
2744 | A subset of <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link> | ||
2745 | used by the OpenEmbedded build system for creating | ||
2746 | <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>. | ||
2747 | You can find more information on how overrides are handled | ||
2748 | in the BitBake Manual that is located at | ||
2749 | <filename>bitbake/doc/manual</filename> in the | ||
2750 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
2751 | </para> | ||
2752 | |||
2753 | <para> | ||
2754 | By default, the <filename>FILESOVERRIDES</filename> | ||
2755 | variable is defined as: | ||
2756 | <literallayout class='monospaced'> | ||
2757 | FILESOVERRIDES = "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}" | ||
2758 | </literallayout> | ||
2759 | |||
2760 | <note> | ||
2761 | Do not hand-edit the <filename>FILESOVERRIDES</filename> | ||
2762 | variable. | ||
2763 | The values match up with expected overrides and are | ||
2764 | used in an expected manner by the build system. | ||
2765 | </note> | ||
2766 | </para> | ||
2767 | </glossdef> | ||
2768 | </glossentry> | ||
2769 | |||
2770 | <glossentry id='var-FILESPATH'><glossterm>FILESPATH</glossterm> | ||
2771 | <glossdef> | ||
2772 | <para> | ||
2773 | The default set of directories the OpenEmbedded build system | ||
2774 | uses when searching for patches and files. | ||
2775 | During the build process, BitBake searches each directory in | ||
2776 | <filename>FILESPATH</filename> in the specified order when | ||
2777 | looking for files and patches specified by each | ||
2778 | <filename>file://</filename> URI in a recipe. | ||
2779 | </para> | ||
2780 | |||
2781 | <para> | ||
2782 | The default value for the <filename>FILESPATH</filename> | ||
2783 | variable is defined in the <filename>base.bbclass</filename> | ||
2784 | class found in <filename>meta/classes</filename> in the | ||
2785 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>: | ||
2786 | <literallayout class='monospaced'> | ||
2787 | FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${BP}", \ | ||
2788 | "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files"], d)}" | ||
2789 | </literallayout> | ||
2790 | <note> | ||
2791 | Do not hand-edit the <filename>FILESPATH</filename> | ||
2792 | variable. | ||
2793 | If you want the build system to look in directories | ||
2794 | other than the defaults, extend the | ||
2795 | <filename>FILESPATH</filename> variable by using the | ||
2796 | <link linkend='var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></link> | ||
2797 | variable. | ||
2798 | </note> | ||
2799 | Be aware that the default <filename>FILESPATH</filename> | ||
2800 | directories do not map to directories in custom layers | ||
2801 | where append files (<filename>.bbappend</filename>) | ||
2802 | are used. | ||
2803 | If you want the build system to find patches or files | ||
2804 | that reside with your append files, you need to extend | ||
2805 | the <filename>FILESPATH</filename> variable by using | ||
2806 | the | ||
2807 | <link linkend='var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></link> | ||
2808 | variable. | ||
2809 | </para> | ||
2810 | </glossdef> | ||
2811 | </glossentry> | ||
2812 | |||
2813 | <glossentry id='var-FILESYSTEM_PERMS_TABLES'><glossterm>FILESYSTEM_PERMS_TABLES</glossterm> | ||
2814 | <glossdef> | ||
2815 | <para>Allows you to define your own file permissions settings table as part of | ||
2816 | your configuration for the packaging process. | ||
2817 | For example, suppose you need a consistent set of custom permissions for | ||
2818 | a set of groups and users across an entire work project. | ||
2819 | It is best to do this in the packages themselves but this is not always | ||
2820 | possible. | ||
2821 | </para> | ||
2822 | <para> | ||
2823 | By default, the OpenEmbedded build system uses the <filename>fs-perms.txt</filename>, which | ||
2824 | is located in the <filename>meta/files</filename> folder in the | ||
2825 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
2826 | If you create your own file permissions setting table, you should place it in your | ||
2827 | layer or the distro's layer. | ||
2828 | </para> | ||
2829 | <para> | ||
2830 | You define the <filename>FILESYSTEM_PERMS_TABLES</filename> variable in the | ||
2831 | <filename>conf/local.conf</filename> file, which is found in the | ||
2832 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>, to | ||
2833 | point to your custom <filename>fs-perms.txt</filename>. | ||
2834 | You can specify more than a single file permissions setting table. | ||
2835 | The paths you specify to these files must be defined within the | ||
2836 | <link linkend='var-BBPATH'><filename>BBPATH</filename></link> variable. | ||
2837 | </para> | ||
2838 | <para> | ||
2839 | For guidance on how to create your own file permissions settings table file, | ||
2840 | examine the existing <filename>fs-perms.txt</filename>. | ||
2841 | </para> | ||
2842 | </glossdef> | ||
2843 | </glossentry> | ||
2844 | |||
2845 | <glossentry id='var-FONT_PACKAGES'><glossterm>FONT_PACKAGES</glossterm> | ||
2846 | <glossdef> | ||
2847 | <para> | ||
2848 | When a recipe inherits the | ||
2849 | <link linkend='ref-classes-fontcache'><filename>fontcache</filename></link> | ||
2850 | class, this variable identifies packages containing font | ||
2851 | files that need to be cached by Fontconfig. | ||
2852 | By default, the <filename>fontcache</filename> class assumes | ||
2853 | that fonts are in the recipe's main package | ||
2854 | (i.e. <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename>). | ||
2855 | Use this variable if fonts you need are in a package | ||
2856 | other than that main package. | ||
2857 | </para> | ||
2858 | </glossdef> | ||
2859 | </glossentry> | ||
2860 | |||
2861 | <glossentry id='var-FULL_OPTIMIZATION'><glossterm>FULL_OPTIMIZATION</glossterm> | ||
2862 | <glossdef> | ||
2863 | <para> | ||
2864 | The options to pass in | ||
2865 | <filename><link linkend='var-TARGET_CFLAGS'>TARGET_CFLAGS</link></filename> | ||
2866 | and <filename><link linkend='var-CFLAGS'>CFLAGS</link></filename> | ||
2867 | when compiling an optimized system. | ||
2868 | This variable defaults to | ||
2869 | "-O2 -pipe ${DEBUG_FLAGS}". | ||
2870 | </para> | ||
2871 | </glossdef> | ||
2872 | </glossentry> | ||
2873 | </glossdiv> | ||
2874 | |||
2875 | <glossdiv id='var-glossary-g'><title>G</title> | ||
2876 | |||
2877 | <glossentry id='var-GROUPADD_PARAM'><glossterm>GROUPADD_PARAM</glossterm> | ||
2878 | <glossdef> | ||
2879 | <para> | ||
2880 | When a recipe inherits the | ||
2881 | <filename>useradd</filename> class, this variable | ||
2882 | specifies for a package what parameters should be passed | ||
2883 | to the <filename>groupadd</filename> command | ||
2884 | if you wish to add a group to the system when the package | ||
2885 | is installed. | ||
2886 | </para> | ||
2887 | |||
2888 | <para> | ||
2889 | Here is an example from the <filename>dbus</filename> | ||
2890 | recipe: | ||
2891 | <literallayout class='monospaced'> | ||
2892 | GROUPADD_PARAM_${PN} = "-r netdev" | ||
2893 | </literallayout> | ||
2894 | For information on the standard Linux shell command | ||
2895 | <filename>groupadd</filename>, see | ||
2896 | <ulink url='http://linux.die.net/man/8/groupadd'></ulink>. | ||
2897 | </para> | ||
2898 | </glossdef> | ||
2899 | </glossentry> | ||
2900 | |||
2901 | <glossentry id='var-GROUPMEMS_PARAM'><glossterm>GROUPMEMS_PARAM</glossterm> | ||
2902 | <glossdef> | ||
2903 | <para> | ||
2904 | When a recipe inherits the | ||
2905 | <filename>useradd</filename> class, this variable | ||
2906 | specifies for a package what parameters should be passed | ||
2907 | to the <filename>groupmems</filename> command | ||
2908 | if you wish to modify the members of a group when the | ||
2909 | package is installed. | ||
2910 | </para> | ||
2911 | |||
2912 | <para> | ||
2913 | For information on the standard Linux shell command | ||
2914 | <filename>groupmems</filename>, see | ||
2915 | <ulink url='http://linux.die.net/man/8/groupmems'></ulink>. | ||
2916 | </para> | ||
2917 | </glossdef> | ||
2918 | </glossentry> | ||
2919 | |||
2920 | <glossentry id='var-GRUB_GFXSERIAL'><glossterm>GRUB_GFXSERIAL</glossterm> | ||
2921 | <glossdef> | ||
2922 | <para> | ||
2923 | Configures the GNU GRand Unified Bootloader (GRUB) to have | ||
2924 | graphics and serial in the boot menu. | ||
2925 | Set this variable to "1" in your | ||
2926 | <filename>local.conf</filename> or distribution | ||
2927 | configuration file to enable graphics and serial | ||
2928 | in the menu. | ||
2929 | </para> | ||
2930 | |||
2931 | <para> | ||
2932 | See the | ||
2933 | <link linkend='ref-classes-grub-efi'><filename>grub-efi</filename></link> | ||
2934 | class for more information on how this variable is used. | ||
2935 | </para> | ||
2936 | </glossdef> | ||
2937 | </glossentry> | ||
2938 | |||
2939 | <glossentry id='var-GRUB_OPTS'><glossterm>GRUB_OPTS</glossterm> | ||
2940 | <glossdef> | ||
2941 | <para> | ||
2942 | Additional options to add to the GNU GRand Unified | ||
2943 | Bootloader (GRUB) configuration. | ||
2944 | Use a semi-colon character (<filename>;</filename>) to | ||
2945 | separate multiple options. | ||
2946 | </para> | ||
2947 | |||
2948 | <para> | ||
2949 | The <filename>GRUB_OPTS</filename> variable is optional. | ||
2950 | See the | ||
2951 | <link linkend='ref-classes-grub-efi'><filename>grub-efi</filename></link> | ||
2952 | class for more information on how this variable is used. | ||
2953 | </para> | ||
2954 | </glossdef> | ||
2955 | </glossentry> | ||
2956 | |||
2957 | <glossentry id='var-GRUB_TIMEOUT'><glossterm>GRUB_TIMEOUT</glossterm> | ||
2958 | <glossdef> | ||
2959 | <para> | ||
2960 | Specifies the timeout before executing the default | ||
2961 | <filename>LABEL</filename> in the GNU GRand Unified | ||
2962 | Bootloader (GRUB). | ||
2963 | </para> | ||
2964 | |||
2965 | <para> | ||
2966 | The <filename>GRUB_TIMEOUT</filename> variable is optional. | ||
2967 | See the | ||
2968 | <link linkend='ref-classes-grub-efi'><filename>grub-efi</filename></link> | ||
2969 | class for more information on how this variable is used. | ||
2970 | </para> | ||
2971 | </glossdef> | ||
2972 | </glossentry> | ||
2973 | |||
2974 | <glossentry id='var-GTKIMMODULES_PACKAGES'><glossterm>GTKIMMODULES_PACKAGES</glossterm> | ||
2975 | <glossdef> | ||
2976 | <para> | ||
2977 | For recipes that inherit the | ||
2978 | <link linkend='ref-classes-gtk-immodules-cache'><filename>gtk-immodules-cache</filename></link> | ||
2979 | class, this variable specifies the packages that contain the | ||
2980 | GTK+ input method modules being installed when the modules | ||
2981 | are in packages other than the main package. | ||
2982 | </para> | ||
2983 | </glossdef> | ||
2984 | </glossentry> | ||
2985 | |||
2986 | </glossdiv> | ||
2987 | |||
2988 | <glossdiv id='var-glossary-h'><title>H</title> | ||
2989 | |||
2990 | <glossentry id='var-HOMEPAGE'><glossterm>HOMEPAGE</glossterm> | ||
2991 | <glossdef> | ||
2992 | <para>Website where more information about the software the recipe is building | ||
2993 | can be found.</para> | ||
2994 | </glossdef> | ||
2995 | </glossentry> | ||
2996 | |||
2997 | <glossentry id='var-HOST_CC_ARCH'><glossterm>HOST_CC_ARCH</glossterm> | ||
2998 | <glossdef> | ||
2999 | <para> | ||
3000 | Specifies architecture-specific compiler flags that are | ||
3001 | passed to the C compiler. | ||
3002 | </para> | ||
3003 | |||
3004 | <para> | ||
3005 | Default initialization for <filename>HOST_CC_ARCH</filename> | ||
3006 | varies depending on what is being built: | ||
3007 | <itemizedlist> | ||
3008 | <listitem><para> | ||
3009 | <link linkend='var-TARGET_CC_ARCH'><filename>TARGET_CC_ARCH</filename></link> | ||
3010 | when building for the target | ||
3011 | </para></listitem> | ||
3012 | <listitem><para> | ||
3013 | <filename>BUILD_CC_ARCH</filename> | ||
3014 | when building for the build host (i.e. | ||
3015 | <filename>native</filename>) | ||
3016 | </para></listitem> | ||
3017 | <listitem><para> | ||
3018 | <filename>BUILDSDK_CC_ARCH</filename> | ||
3019 | when building for an SDK (i.e. | ||
3020 | <filename>nativesdk</filename>) | ||
3021 | </para></listitem> | ||
3022 | </itemizedlist> | ||
3023 | </para> | ||
3024 | </glossdef> | ||
3025 | </glossentry> | ||
3026 | |||
3027 | <glossentry id='var-HOST_SYS'><glossterm>HOST_SYS</glossterm> | ||
3028 | <glossdef> | ||
3029 | <para> | ||
3030 | Specifies the system, including the architecture and the | ||
3031 | operating system, for with the build is occurring | ||
3032 | in the context of the current | ||
3033 | recipe. | ||
3034 | The OpenEmbedded build system automatically sets this | ||
3035 | variable. | ||
3036 | You do not need to set the variable yourself. | ||
3037 | </para> | ||
3038 | |||
3039 | <para> | ||
3040 | Here are two examples: | ||
3041 | <itemizedlist> | ||
3042 | <listitem><para>Given a native recipe on a 32-bit | ||
3043 | x86 machine running Linux, the value is | ||
3044 | "i686-linux". | ||
3045 | </para></listitem> | ||
3046 | <listitem><para>Given a recipe being built for a | ||
3047 | little-endian MIPS target running Linux, | ||
3048 | the value might be "mipsel-linux". | ||
3049 | </para></listitem> | ||
3050 | </itemizedlist> | ||
3051 | </para> | ||
3052 | </glossdef> | ||
3053 | </glossentry> | ||
3054 | |||
3055 | </glossdiv> | ||
3056 | |||
3057 | <glossdiv id='var-glossary-i'><title>I</title> | ||
3058 | |||
3059 | <glossentry id='var-ICECC_DISABLED'><glossterm>ICECC_DISABLED</glossterm> | ||
3060 | <glossdef> | ||
3061 | <para> | ||
3062 | Disables or enables the <filename>icecc</filename> | ||
3063 | (Icecream) function. | ||
3064 | For more information on this function and best practices | ||
3065 | for using this variable, see the | ||
3066 | "<link linkend='ref-classes-icecc'><filename>icecc.bbclass</filename></link>" | ||
3067 | section. | ||
3068 | </para> | ||
3069 | |||
3070 | <para> | ||
3071 | Setting this variable to "1" in your | ||
3072 | <filename>local.conf</filename> disables the function: | ||
3073 | <literallayout class='monospaced'> | ||
3074 | ICECC_DISABLED ??= "1" | ||
3075 | </literallayout> | ||
3076 | To enable the function, set the variable as follows: | ||
3077 | <literallayout class='monospaced'> | ||
3078 | ICECC_DISABLED = "" | ||
3079 | </literallayout> | ||
3080 | </para> | ||
3081 | </glossdef> | ||
3082 | </glossentry> | ||
3083 | |||
3084 | <glossentry id='var-ICECC_ENV_EXEC'><glossterm>ICECC_ENV_EXEC</glossterm> | ||
3085 | <glossdef> | ||
3086 | <para> | ||
3087 | Points to the <filename>icecc-create-env</filename> script | ||
3088 | that you provide. | ||
3089 | This variable is used by the | ||
3090 | <link linkend='ref-classes-icecc'><filename>icecc</filename></link> | ||
3091 | class. | ||
3092 | You set this variable in your | ||
3093 | <filename>local.conf</filename> file. | ||
3094 | </para> | ||
3095 | |||
3096 | <para> | ||
3097 | If you do not point to a script that you provide, the | ||
3098 | OpenEmbedded build system uses the default script provided | ||
3099 | by the <filename>icecc-create-env.bb</filename> recipe, | ||
3100 | which is a modified version and not the one that comes with | ||
3101 | <filename>icecc</filename>. | ||
3102 | </para> | ||
3103 | </glossdef> | ||
3104 | </glossentry> | ||
3105 | |||
3106 | <glossentry id='var-ICECC_PARALLEL_MAKE'><glossterm>ICECC_PARALLEL_MAKE</glossterm> | ||
3107 | <glossdef> | ||
3108 | <para> | ||
3109 | Extra options passed to the <filename>make</filename> | ||
3110 | command during the | ||
3111 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link> | ||
3112 | task that specify parallel compilation. | ||
3113 | This variable usually takes the form of | ||
3114 | <filename>-j 4</filename>, where the number | ||
3115 | represents the maximum number of parallel threads | ||
3116 | <filename>make</filename> can run. | ||
3117 | <note> | ||
3118 | The options passed affect builds on all enabled | ||
3119 | machines on the network, which are machines running the | ||
3120 | <filename>iceccd</filename> daemon. | ||
3121 | </note> | ||
3122 | </para> | ||
3123 | |||
3124 | <para> | ||
3125 | If your enabled machines support multiple cores, | ||
3126 | coming up with the maximum number of parallel threads | ||
3127 | that gives you the best performance could take some | ||
3128 | experimentation since machine speed, network lag, | ||
3129 | available memory, and existing machine loads can all | ||
3130 | affect build time. | ||
3131 | Consequently, unlike the | ||
3132 | <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link> | ||
3133 | variable, there is no rule-of-thumb for setting | ||
3134 | <filename>ICECC_PARALLEL_MAKE</filename> to achieve | ||
3135 | optimal performance. | ||
3136 | </para> | ||
3137 | |||
3138 | <para> | ||
3139 | If you do not set <filename>ICECC_PARALLEL_MAKE</filename>, | ||
3140 | the build system does not use it (i.e. the system does | ||
3141 | not detect and assign the number of cores as is done with | ||
3142 | <filename>PARALLEL_MAKE</filename>). | ||
3143 | </para> | ||
3144 | </glossdef> | ||
3145 | </glossentry> | ||
3146 | |||
3147 | <glossentry id='var-ICECC_PATH'><glossterm>ICECC_PATH</glossterm> | ||
3148 | <glossdef> | ||
3149 | <para> | ||
3150 | The location of the <filename>icecc</filename> binary. | ||
3151 | You can set this variable in your | ||
3152 | <filename>local.conf</filename> file. | ||
3153 | If your <filename>local.conf</filename> file does not define | ||
3154 | this variable, the | ||
3155 | <link linkend='ref-classes-icecc'><filename>icecc</filename></link> | ||
3156 | class attempts to define it by locating | ||
3157 | <filename>icecc</filename> using <filename>which</filename>. | ||
3158 | </para> | ||
3159 | </glossdef> | ||
3160 | </glossentry> | ||
3161 | |||
3162 | <glossentry id='var-ICECC_USER_CLASS_BL'><glossterm>ICECC_USER_CLASS_BL</glossterm> | ||
3163 | <glossdef> | ||
3164 | <para> | ||
3165 | Identifies user classes that you do not want the | ||
3166 | Icecream distributed compile support to consider. | ||
3167 | This variable is used by the | ||
3168 | <link linkend='ref-classes-icecc'><filename>icecc</filename></link> | ||
3169 | class. | ||
3170 | You set this variable in your | ||
3171 | <filename>local.conf</filename> file. | ||
3172 | </para> | ||
3173 | |||
3174 | <para> | ||
3175 | When you list classes using this variable, you are | ||
3176 | "blacklisting" them from distributed compilation across | ||
3177 | remote hosts. | ||
3178 | Any classes you list will be distributed and compiled | ||
3179 | locally. | ||
3180 | </para> | ||
3181 | </glossdef> | ||
3182 | </glossentry> | ||
3183 | |||
3184 | <glossentry id='var-ICECC_USER_PACKAGE_BL'><glossterm>ICECC_USER_PACKAGE_BL</glossterm> | ||
3185 | <glossdef> | ||
3186 | <para> | ||
3187 | Identifies user recipes that you do not want the | ||
3188 | Icecream distributed compile support to consider. | ||
3189 | This variable is used by the | ||
3190 | <link linkend='ref-classes-icecc'><filename>icecc</filename></link> | ||
3191 | class. | ||
3192 | You set this variable in your | ||
3193 | <filename>local.conf</filename> file. | ||
3194 | </para> | ||
3195 | |||
3196 | <para> | ||
3197 | When you list packages using this variable, you are | ||
3198 | "blacklisting" them from distributed compilation across | ||
3199 | remote hosts. | ||
3200 | Any packages you list will be distributed and compiled | ||
3201 | locally. | ||
3202 | </para> | ||
3203 | </glossdef> | ||
3204 | </glossentry> | ||
3205 | |||
3206 | <glossentry id='var-ICECC_USER_PACKAGE_WL'><glossterm>ICECC_USER_PACKAGE_WL</glossterm> | ||
3207 | <glossdef> | ||
3208 | <para> | ||
3209 | Identifies user recipes that use an empty | ||
3210 | <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link> | ||
3211 | variable that you want to force remote distributed | ||
3212 | compilation on using the Icecream distributed compile | ||
3213 | support. | ||
3214 | This variable is used by the | ||
3215 | <link linkend='ref-classes-icecc'><filename>icecc</filename></link> | ||
3216 | class. | ||
3217 | You set this variable in your | ||
3218 | <filename>local.conf</filename> file. | ||
3219 | </para> | ||
3220 | </glossdef> | ||
3221 | </glossentry> | ||
3222 | |||
3223 | <glossentry id='var-IMAGE_BASENAME'><glossterm>IMAGE_BASENAME</glossterm> | ||
3224 | <glossdef> | ||
3225 | <para> | ||
3226 | The base name of image output files. | ||
3227 | This variable defaults to the recipe name | ||
3228 | (<filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename>). | ||
3229 | </para> | ||
3230 | </glossdef> | ||
3231 | </glossentry> | ||
3232 | |||
3233 | <glossentry id='var-IMAGE_CLASSES'><glossterm>IMAGE_CLASSES</glossterm> | ||
3234 | <glossdef> | ||
3235 | <para> | ||
3236 | A list of classes that all images should inherit. | ||
3237 | You typically use this variable to specify the list of | ||
3238 | classes that register the different types of images | ||
3239 | the OpenEmbedded build system creates. | ||
3240 | </para> | ||
3241 | |||
3242 | <para> | ||
3243 | The default value for <filename>IMAGE_CLASSES</filename> is | ||
3244 | <filename>image_types</filename>. | ||
3245 | You can set this variable in your | ||
3246 | <filename>local.conf</filename> or in a distribution | ||
3247 | configuration file. | ||
3248 | </para> | ||
3249 | |||
3250 | <para> | ||
3251 | For more information, see | ||
3252 | <filename>meta/classes/image_types.bbclass</filename> in the | ||
3253 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
3254 | </para> | ||
3255 | </glossdef> | ||
3256 | </glossentry> | ||
3257 | |||
3258 | <glossentry id='var-IMAGE_CMD'><glossterm>IMAGE_CMD</glossterm> | ||
3259 | <glossdef> | ||
3260 | <para> | ||
3261 | Specifies the command to create the image file for a | ||
3262 | specific image type, which corresponds to the value set | ||
3263 | set in | ||
3264 | <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>, | ||
3265 | (e.g. <filename>ext3</filename>, | ||
3266 | <filename>btrfs</filename>, and so forth). | ||
3267 | When setting this variable, you should use | ||
3268 | an override for the associated type. | ||
3269 | Here is an example: | ||
3270 | <literallayout class='monospaced'> | ||
3271 | IMAGE_CMD_jffs2 = "mkfs.jffs2 --root=${IMAGE_ROOTFS} \ | ||
3272 | --faketime --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \ | ||
3273 | ${EXTRA_IMAGECMD}" | ||
3274 | </literallayout> | ||
3275 | You typically do not need to set this variable unless | ||
3276 | you are adding support for a new image type. | ||
3277 | For more examples on how to set this variable, see the | ||
3278 | <link linkend='ref-classes-image_types'><filename>image_types</filename></link> | ||
3279 | class file, which is | ||
3280 | <filename>meta/classes/image_types.bbclass</filename>. | ||
3281 | </para> | ||
3282 | </glossdef> | ||
3283 | </glossentry> | ||
3284 | |||
3285 | <glossentry id='var-IMAGE_DEVICE_TABLES'><glossterm>IMAGE_DEVICE_TABLES</glossterm> | ||
3286 | <glossdef> | ||
3287 | <para> | ||
3288 | Specifies one or more files that contain custom device | ||
3289 | tables that are passed to the | ||
3290 | <filename>makedevs</filename> command as part of creating | ||
3291 | an image. | ||
3292 | These files list basic device nodes that should be | ||
3293 | created under <filename>/dev</filename> within the image. | ||
3294 | If <filename>IMAGE_DEVICE_TABLES</filename> is not set, | ||
3295 | <filename>files/device_table-minimal.txt</filename> is | ||
3296 | used, which is located by | ||
3297 | <link linkend='var-BBPATH'><filename>BBPATH</filename></link>. | ||
3298 | For details on how you should write device table files, | ||
3299 | see <filename>meta/files/device_table-minimal.txt</filename> | ||
3300 | as an example. | ||
3301 | </para> | ||
3302 | </glossdef> | ||
3303 | </glossentry> | ||
3304 | |||
3305 | <glossentry id='var-IMAGE_FEATURES'><glossterm>IMAGE_FEATURES</glossterm> | ||
3306 | <glossdef> | ||
3307 | <para> | ||
3308 | The primary list of features to include in an image. | ||
3309 | Typically, you configure this variable in an image recipe. | ||
3310 | Although you can use this variable from your | ||
3311 | <filename>local.conf</filename> file, which is found in the | ||
3312 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>, | ||
3313 | best practices dictate that you do not. | ||
3314 | <note> | ||
3315 | To enable extra features from outside the image recipe, | ||
3316 | use the | ||
3317 | <filename><link linkend='var-EXTRA_IMAGE_FEATURES'>EXTRA_IMAGE_FEATURES</link></filename> variable. | ||
3318 | </note> | ||
3319 | For a list of image features that ships with the Yocto | ||
3320 | Project, see the | ||
3321 | "<link linkend="ref-features-image">Image Features</link>" | ||
3322 | section. | ||
3323 | </para> | ||
3324 | |||
3325 | <para> | ||
3326 | For an example that shows how to customize your image by | ||
3327 | using this variable, see the | ||
3328 | "<ulink url='&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage-imagefeatures'>Customizing Images Using Custom <filename>IMAGE_FEATURES</filename> and <filename>EXTRA_IMAGE_FEATURES</filename></ulink>" | ||
3329 | section in the Yocto Project Development Manual. | ||
3330 | </para> | ||
3331 | </glossdef> | ||
3332 | </glossentry> | ||
3333 | |||
3334 | <glossentry id='var-IMAGE_FSTYPES'><glossterm>IMAGE_FSTYPES</glossterm> | ||
3335 | <glossdef> | ||
3336 | <para> | ||
3337 | Specifies the formats the OpenEmbedded build system uses | ||
3338 | during the build when creating the root filesystem. | ||
3339 | For example, setting <filename>IMAGE_FSTYPES</filename> | ||
3340 | as follows causes the build system to create root | ||
3341 | filesystems using two formats: <filename>.ext3</filename> | ||
3342 | and <filename>.tar.bz2</filename>: | ||
3343 | <literallayout class='monospaced'> | ||
3344 | IMAGE_FSTYPES = "ext3 tar.bz2" | ||
3345 | </literallayout> | ||
3346 | For the complete list of supported image formats from which | ||
3347 | you can choose, see | ||
3348 | <link linkend='var-IMAGE_TYPES'><filename>IMAGE_TYPES</filename></link>. | ||
3349 | </para> | ||
3350 | |||
3351 | <note> | ||
3352 | If you add "live" to <filename>IMAGE_FSTYPES</filename> | ||
3353 | inside an image recipe, be sure that you do so prior to the | ||
3354 | "inherit image" line of the recipe or the live image will | ||
3355 | not build. | ||
3356 | </note> | ||
3357 | |||
3358 | <note> | ||
3359 | Due to the way this variable is processed, it is not | ||
3360 | possible to update its contents using | ||
3361 | <filename>_append</filename> or | ||
3362 | <filename>_prepend</filename>. To add one or more | ||
3363 | additional options to this variable the | ||
3364 | <filename>+=</filename> operator must be used. | ||
3365 | </note> | ||
3366 | </glossdef> | ||
3367 | </glossentry> | ||
3368 | |||
3369 | <glossentry id='var-IMAGE_INSTALL'><glossterm>IMAGE_INSTALL</glossterm> | ||
3370 | <glossdef> | ||
3371 | <para> | ||
3372 | Specifies the packages to install into an image. | ||
3373 | The <filename>IMAGE_INSTALL</filename> variable is a | ||
3374 | mechanism for an image recipe and you should use it | ||
3375 | with care to avoid ordering issues. | ||
3376 | <note> | ||
3377 | When working with an | ||
3378 | <link linkend='images-core-image-minimal-initramfs'><filename>core-image-minimal-initramfs</filename></link> | ||
3379 | image, do not use the <filename>IMAGE_INSTALL</filename> | ||
3380 | variable to specify packages for installation. | ||
3381 | Instead, use the | ||
3382 | <link linkend='var-PACKAGE_INSTALL'><filename>PACKAGE_INSTALL</filename></link> | ||
3383 | variable, which allows the initial RAM disk (initramfs) | ||
3384 | recipe to use a fixed set of packages and not be | ||
3385 | affected by <filename>IMAGE_INSTALL</filename>. | ||
3386 | </note> | ||
3387 | </para> | ||
3388 | |||
3389 | <para> | ||
3390 | Image recipes set <filename>IMAGE_INSTALL</filename> | ||
3391 | to specify the packages to install into an image through | ||
3392 | <filename>image.bbclass</filename>. | ||
3393 | Additionally, "helper" classes exist, such as | ||
3394 | <filename>core-image.bbclass</filename>, that can take | ||
3395 | <filename><link linkend='var-IMAGE_FEATURES'>IMAGE_FEATURES</link></filename> | ||
3396 | lists and turn these into auto-generated entries in | ||
3397 | <filename>IMAGE_INSTALL</filename> in addition to its | ||
3398 | default contents. | ||
3399 | </para> | ||
3400 | |||
3401 | <para> | ||
3402 | Using <filename>IMAGE_INSTALL</filename> with the | ||
3403 | <filename>+=</filename> operator from the | ||
3404 | <filename>/conf/local.conf</filename> file or from within | ||
3405 | an image recipe is not recommended as it can cause ordering | ||
3406 | issues. | ||
3407 | Since <filename>core-image.bbclass</filename> sets | ||
3408 | <filename>IMAGE_INSTALL</filename> to a default value using | ||
3409 | the <filename>?=</filename> operator, using a | ||
3410 | <filename>+=</filename> operation against | ||
3411 | <filename>IMAGE_INSTALL</filename> will result in | ||
3412 | unexpected behavior when used in | ||
3413 | <filename>conf/local.conf</filename>. | ||
3414 | Furthermore, the same operation from within an image | ||
3415 | recipe may or may not succeed depending on the specific | ||
3416 | situation. | ||
3417 | In both these cases, the behavior is contrary to how most | ||
3418 | users expect the <filename>+=</filename> operator to work. | ||
3419 | </para> | ||
3420 | |||
3421 | <para> | ||
3422 | When you use this variable, it is best to use it as follows: | ||
3423 | <literallayout class='monospaced'> | ||
3424 | IMAGE_INSTALL_append = " package-name" | ||
3425 | </literallayout> | ||
3426 | Be sure to include the space between the quotation character | ||
3427 | and the start of the package name or names. | ||
3428 | </para> | ||
3429 | </glossdef> | ||
3430 | </glossentry> | ||
3431 | |||
3432 | <glossentry id='var-IMAGE_LINGUAS'><glossterm>IMAGE_LINGUAS</glossterm> | ||
3433 | <glossdef> | ||
3434 | <para> | ||
3435 | Specifies the list of locales to install into the image | ||
3436 | during the root filesystem construction process. | ||
3437 | The OpenEmbedded build system automatically splits locale | ||
3438 | files, which are used for localization, into separate | ||
3439 | packages. | ||
3440 | Setting the <filename>IMAGE_LINGUAS</filename> variable | ||
3441 | ensures that any locale packages that correspond to packages | ||
3442 | already selected for installation into the image are also | ||
3443 | installed. | ||
3444 | Here is an example: | ||
3445 | <literallayout class='monospaced'> | ||
3446 | IMAGE_LINGUAS = "pt-br de-de" | ||
3447 | </literallayout> | ||
3448 | In this example, the build system ensures any Brazilian | ||
3449 | Portuguese and German locale files that correspond to | ||
3450 | packages in the image are installed (i.e. | ||
3451 | <filename>*-locale-pt-br</filename> | ||
3452 | and <filename>*-locale-de-de</filename> as well as | ||
3453 | <filename>*-locale-pt</filename> | ||
3454 | and <filename>*-locale-de</filename>, since some software | ||
3455 | packages only provide locale files by language and not by | ||
3456 | country-specific language). | ||
3457 | </para> | ||
3458 | </glossdef> | ||
3459 | </glossentry> | ||
3460 | |||
3461 | <glossentry id='var-IMAGE_MANIFEST'><glossterm>IMAGE_MANIFEST</glossterm> | ||
3462 | <glossdef> | ||
3463 | <para> | ||
3464 | The manifest file for the image. | ||
3465 | This file lists all the installed packages that make up | ||
3466 | the image. | ||
3467 | The file contains package information on a line-per-package | ||
3468 | basis as follows: | ||
3469 | <literallayout class='monospaced'> | ||
3470 | <packagename> <packagearch> <version> | ||
3471 | </literallayout> | ||
3472 | </para> | ||
3473 | |||
3474 | <para> | ||
3475 | The | ||
3476 | <link linkend='ref-classes-image'><filename>image</filename></link> | ||
3477 | class defines the manifest file as follows: | ||
3478 | <literallayout class='monospaced'> | ||
3479 | IMAGE_MANIFEST = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest" | ||
3480 | </literallayout> | ||
3481 | The location is derived using the | ||
3482 | <link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link> | ||
3483 | and | ||
3484 | <link linkend='var-IMAGE_NAME'><filename>IMAGE_NAME</filename></link> | ||
3485 | variables. | ||
3486 | You can find information on how the image | ||
3487 | is created in the | ||
3488 | "<link linkend='image-generation-dev-environment'>Image Generation</link>" | ||
3489 | section. | ||
3490 | </para> | ||
3491 | </glossdef> | ||
3492 | </glossentry> | ||
3493 | |||
3494 | <glossentry id='var-IMAGE_NAME'><glossterm>IMAGE_NAME</glossterm> | ||
3495 | <glossdef> | ||
3496 | <para> | ||
3497 | The name of the output image files minus the extension. | ||
3498 | This variable is derived using the | ||
3499 | <link linkend='var-IMAGE_BASENAME'><filename>IMAGE_BASENAME</filename></link>, | ||
3500 | <link linkend='var-MACHINE'><filename>MACHINE</filename></link>, | ||
3501 | and | ||
3502 | <link linkend='var-DATETIME'><filename>DATETIME</filename></link> | ||
3503 | variables: | ||
3504 | <literallayout class='monospaced'> | ||
3505 | IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}" | ||
3506 | </literallayout> | ||
3507 | </para> | ||
3508 | </glossdef> | ||
3509 | </glossentry> | ||
3510 | |||
3511 | <glossentry id='var-IMAGE_OVERHEAD_FACTOR'><glossterm>IMAGE_OVERHEAD_FACTOR</glossterm> | ||
3512 | <glossdef> | ||
3513 | <para> | ||
3514 | Defines a multiplier that the build system applies to the initial image | ||
3515 | size for cases when the multiplier times the returned disk usage value | ||
3516 | for the image is greater than the sum of | ||
3517 | <filename><link linkend='var-IMAGE_ROOTFS_SIZE'>IMAGE_ROOTFS_SIZE</link></filename> | ||
3518 | and | ||
3519 | <filename><link linkend='var-IMAGE_ROOTFS_EXTRA_SPACE'>IMAGE_ROOTFS_EXTRA_SPACE</link></filename>. | ||
3520 | The result of the multiplier applied to the initial image size creates | ||
3521 | free disk space in the image as overhead. | ||
3522 | By default, the build process uses a multiplier of 1.3 for this variable. | ||
3523 | This default value results in 30% free disk space added to the image when this | ||
3524 | method is used to determine the final generated image size. | ||
3525 | You should be aware that post install scripts and the package management | ||
3526 | system uses disk space inside this overhead area. | ||
3527 | Consequently, the multiplier does not produce an image with | ||
3528 | all the theoretical free disk space. | ||
3529 | See <filename><link linkend='var-IMAGE_ROOTFS_SIZE'>IMAGE_ROOTFS_SIZE</link></filename> | ||
3530 | for information on how the build system determines the overall image size. | ||
3531 | </para> | ||
3532 | |||
3533 | <para> | ||
3534 | The default 30% free disk space typically gives the image enough room to boot | ||
3535 | and allows for basic post installs while still leaving a small amount of | ||
3536 | free disk space. | ||
3537 | If 30% free space is inadequate, you can increase the default value. | ||
3538 | For example, the following setting gives you 50% free space added to the image: | ||
3539 | <literallayout class='monospaced'> | ||
3540 | IMAGE_OVERHEAD_FACTOR = "1.5" | ||
3541 | </literallayout> | ||
3542 | </para> | ||
3543 | |||
3544 | <para> | ||
3545 | Alternatively, you can ensure a specific amount of free disk space is added | ||
3546 | to the image by using the | ||
3547 | <filename><link linkend='var-IMAGE_ROOTFS_EXTRA_SPACE'>IMAGE_ROOTFS_EXTRA_SPACE</link></filename> | ||
3548 | variable. | ||
3549 | </para> | ||
3550 | </glossdef> | ||
3551 | </glossentry> | ||
3552 | |||
3553 | <glossentry id='var-IMAGE_PKGTYPE'><glossterm>IMAGE_PKGTYPE</glossterm> | ||
3554 | <glossdef> | ||
3555 | <para> | ||
3556 | Defines the package type (DEB, RPM, IPK, or TAR) used | ||
3557 | by the OpenEmbedded build system. | ||
3558 | The variable is defined appropriately by the | ||
3559 | <link linkend='ref-classes-package_deb'><filename>package_deb</filename></link>, | ||
3560 | <link linkend='ref-classes-package_rpm'><filename>package_rpm</filename></link>, | ||
3561 | <link linkend='ref-classes-package_ipk'><filename>package_ipk</filename></link>, | ||
3562 | or | ||
3563 | <link linkend='ref-classes-package_tar'><filename>package_tar</filename></link> | ||
3564 | class. | ||
3565 | </para> | ||
3566 | |||
3567 | <para> | ||
3568 | The | ||
3569 | <link linkend='ref-classes-populate-sdk-*'><filename>package_sdk_base</filename></link> | ||
3570 | and | ||
3571 | <link linkend='ref-classes-image'><filename>image</filename></link> | ||
3572 | classes use the <filename>IMAGE_PKGTYPE</filename> for | ||
3573 | packaging up images and SDKs. | ||
3574 | </para> | ||
3575 | |||
3576 | <para> | ||
3577 | You should not set the <filename>IMAGE_PKGTYPE</filename> | ||
3578 | manually. | ||
3579 | Rather, the variable is set indirectly through the | ||
3580 | appropriate | ||
3581 | <link linkend='ref-classes-package'><filename>package_*</filename></link> | ||
3582 | class using the | ||
3583 | <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link> | ||
3584 | variable. | ||
3585 | The OpenEmbedded build system uses the first package type | ||
3586 | (e.g. DEB, RPM, or IPK) that appears with the variable | ||
3587 | <note> | ||
3588 | Files using the <filename>.tar</filename> format are | ||
3589 | never used as a substitute packaging format for DEB, | ||
3590 | RPM, and IPK formatted files for your image or SDK. | ||
3591 | </note> | ||
3592 | </para> | ||
3593 | </glossdef> | ||
3594 | </glossentry> | ||
3595 | |||
3596 | <glossentry id='var-IMAGE_POSTPROCESS_COMMAND'><glossterm>IMAGE_POSTPROCESS_COMMAND</glossterm> | ||
3597 | <glossdef> | ||
3598 | <para> | ||
3599 | Added by classes to run post processing commands once the | ||
3600 | OpenEmbedded build system has created the image. | ||
3601 | You can specify shell commands separated by semicolons: | ||
3602 | <literallayout class='monospaced'> | ||
3603 | IMAGE_POSTPROCESS_COMMAND += "<shell_command>; ... " | ||
3604 | </literallayout> | ||
3605 | If you need to pass the path to the root filesystem within | ||
3606 | the command, you can use | ||
3607 | <filename>${IMAGE_ROOTFS}</filename>, which points to | ||
3608 | the root filesystem image. | ||
3609 | </para> | ||
3610 | </glossdef> | ||
3611 | </glossentry> | ||
3612 | |||
3613 | <glossentry id='var-IMAGE_ROOTFS'><glossterm>IMAGE_ROOTFS</glossterm> | ||
3614 | <glossdef> | ||
3615 | <para> | ||
3616 | The location of the root filesystem while it is under | ||
3617 | construction (i.e. during the | ||
3618 | <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link> | ||
3619 | task). | ||
3620 | This variable is not configurable. | ||
3621 | Do not change it. | ||
3622 | </para> | ||
3623 | </glossdef> | ||
3624 | </glossentry> | ||
3625 | |||
3626 | <glossentry id='var-IMAGE_ROOTFS_ALIGNMENT'><glossterm>IMAGE_ROOTFS_ALIGNMENT</glossterm> | ||
3627 | <glossdef> | ||
3628 | <para> | ||
3629 | Specifies the alignment for the output image file in | ||
3630 | Kbytes. | ||
3631 | If the size of the image is not a multiple of | ||
3632 | this value, then the size is rounded up to the nearest | ||
3633 | multiple of the value. | ||
3634 | The default value is "1". | ||
3635 | See | ||
3636 | <link linkend='var-IMAGE_ROOTFS_SIZE'><filename>IMAGE_ROOTFS_SIZE</filename></link> | ||
3637 | for additional information. | ||
3638 | </para> | ||
3639 | </glossdef> | ||
3640 | </glossentry> | ||
3641 | |||
3642 | <glossentry id='var-IMAGE_ROOTFS_EXTRA_SPACE'><glossterm>IMAGE_ROOTFS_EXTRA_SPACE</glossterm> | ||
3643 | <glossdef> | ||
3644 | <para> | ||
3645 | Defines additional free disk space created in the image in Kbytes. | ||
3646 | By default, this variable is set to "0". | ||
3647 | This free disk space is added to the image after the build system determines | ||
3648 | the image size as described in | ||
3649 | <filename><link linkend='var-IMAGE_ROOTFS_SIZE'>IMAGE_ROOTFS_SIZE</link></filename>. | ||
3650 | </para> | ||
3651 | |||
3652 | <para> | ||
3653 | This variable is particularly useful when you want to ensure that a | ||
3654 | specific amount of free disk space is available on a device after an image | ||
3655 | is installed and running. | ||
3656 | For example, to be sure 5 Gbytes of free disk space is available, set the | ||
3657 | variable as follows: | ||
3658 | <literallayout class='monospaced'> | ||
3659 | IMAGE_ROOTFS_EXTRA_SPACE = "5242880" | ||
3660 | </literallayout> | ||
3661 | </para> | ||
3662 | |||
3663 | <para> | ||
3664 | For example, the Yocto Project Build Appliance specifically requests 40 Gbytes | ||
3665 | of extra space with the line: | ||
3666 | <literallayout class='monospaced'> | ||
3667 | IMAGE_ROOTFS_EXTRA_SPACE = "41943040" | ||
3668 | </literallayout> | ||
3669 | </para> | ||
3670 | </glossdef> | ||
3671 | </glossentry> | ||
3672 | |||
3673 | <glossentry id='var-IMAGE_ROOTFS_SIZE'><glossterm>IMAGE_ROOTFS_SIZE</glossterm> | ||
3674 | <glossdef> | ||
3675 | <para> | ||
3676 | Defines the size in Kbytes for the generated image. | ||
3677 | The OpenEmbedded build system determines the final size for the generated | ||
3678 | image using an algorithm that takes into account the initial disk space used | ||
3679 | for the generated image, a requested size for the image, and requested | ||
3680 | additional free disk space to be added to the image. | ||
3681 | Programatically, the build system determines the final size of the | ||
3682 | generated image as follows: | ||
3683 | <literallayout class='monospaced'> | ||
3684 | if (image-du * overhead) < rootfs-size: | ||
3685 | internal-rootfs-size = rootfs-size + xspace | ||
3686 | else: | ||
3687 | internal-rootfs-size = (image-du * overhead) + xspace | ||
3688 | |||
3689 | where: | ||
3690 | |||
3691 | image-du = Returned value of the du command on | ||
3692 | the image. | ||
3693 | |||
3694 | overhead = IMAGE_OVERHEAD_FACTOR | ||
3695 | |||
3696 | rootfs-size = IMAGE_ROOTFS_SIZE | ||
3697 | |||
3698 | internal-rootfs-size = Initial root filesystem | ||
3699 | size before any modifications. | ||
3700 | |||
3701 | xspace = IMAGE_ROOTFS_EXTRA_SPACE | ||
3702 | </literallayout> | ||
3703 | See the <link linkend='var-IMAGE_OVERHEAD_FACTOR'><filename>IMAGE_OVERHEAD_FACTOR</filename></link> | ||
3704 | and <link linkend='var-IMAGE_ROOTFS_EXTRA_SPACE'><filename>IMAGE_ROOTFS_EXTRA_SPACE</filename></link> | ||
3705 | variables for related information. | ||
3706 | <!-- In the above example, <filename>overhead</filename> is defined by the | ||
3707 | <filename><link linkend='var-IMAGE_OVERHEAD_FACTOR'>IMAGE_OVERHEAD_FACTOR</link></filename> | ||
3708 | variable, <filename>xspace</filename> is defined by the | ||
3709 | <filename><link linkend='var-IMAGE_ROOTFS_EXTRA_SPACE'>IMAGE_ROOTFS_EXTRA_SPACE</link></filename> | ||
3710 | variable, and <filename>du</filename> is the results of the disk usage command | ||
3711 | on the initially generated image. --> | ||
3712 | </para> | ||
3713 | </glossdef> | ||
3714 | </glossentry> | ||
3715 | |||
3716 | <glossentry id='var-IMAGE_TYPEDEP'><glossterm>IMAGE_TYPEDEP</glossterm> | ||
3717 | <glossdef> | ||
3718 | <para> | ||
3719 | Specifies a dependency from one image type on another. | ||
3720 | Here is an example from the | ||
3721 | <link linkend='ref-classes-image-live'><filename>image-live</filename></link> | ||
3722 | class: | ||
3723 | <literallayout class='monospaced'> | ||
3724 | IMAGE_TYPEDEP_live = "ext3" | ||
3725 | </literallayout> | ||
3726 | In the previous example, the variable ensures that when | ||
3727 | "live" is listed with the | ||
3728 | <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link> | ||
3729 | variable, the OpenEmbedded build system produces an | ||
3730 | <filename>ext3</filename> image first since one of the | ||
3731 | components of the live | ||
3732 | image is an <filename>ext3</filename> | ||
3733 | formatted partition containing the root | ||
3734 | filesystem. | ||
3735 | </para> | ||
3736 | </glossdef> | ||
3737 | </glossentry> | ||
3738 | |||
3739 | <glossentry id='var-IMAGE_TYPES'><glossterm>IMAGE_TYPES</glossterm> | ||
3740 | <glossdef> | ||
3741 | <para> | ||
3742 | Specifies the complete list of supported image types | ||
3743 | by default: | ||
3744 | <literallayout class='monospaced'> | ||
3745 | jffs2 | ||
3746 | jffs2.sum | ||
3747 | cramfs | ||
3748 | ext2 | ||
3749 | ext2.gz | ||
3750 | ext2.bz2 | ||
3751 | ext3 | ||
3752 | ext3.gz | ||
3753 | ext2.lzma | ||
3754 | btrfs | ||
3755 | live | ||
3756 | squashfs | ||
3757 | squashfs-xz | ||
3758 | ubi | ||
3759 | ubifs | ||
3760 | tar | ||
3761 | tar.gz | ||
3762 | tar.bz2 | ||
3763 | tar.xz | ||
3764 | cpio | ||
3765 | cpio.gz | ||
3766 | cpio.xz | ||
3767 | cpio.lzma | ||
3768 | vmdk | ||
3769 | elf | ||
3770 | </literallayout> | ||
3771 | For more information about these types of images, see | ||
3772 | <filename>meta/classes/image_types*.bbclass</filename> | ||
3773 | in the | ||
3774 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
3775 | </para> | ||
3776 | </glossdef> | ||
3777 | </glossentry> | ||
3778 | |||
3779 | <glossentry id='var-INC_PR'><glossterm>INC_PR</glossterm> | ||
3780 | <glossdef> | ||
3781 | <para>Helps define the recipe revision for recipes that share | ||
3782 | a common <filename>include</filename> file. | ||
3783 | You can think of this variable as part of the recipe revision | ||
3784 | as set from within an include file.</para> | ||
3785 | <para>Suppose, for example, you have a set of recipes that | ||
3786 | are used across several projects. | ||
3787 | And, within each of those recipes the revision | ||
3788 | (its <link linkend='var-PR'><filename>PR</filename></link> | ||
3789 | value) is set accordingly. | ||
3790 | In this case, when the revision of those recipes changes, | ||
3791 | the burden is on you to find all those recipes and | ||
3792 | be sure that they get changed to reflect the updated | ||
3793 | version of the recipe. | ||
3794 | In this scenario, it can get complicated when recipes | ||
3795 | that are used in many places and provide common functionality | ||
3796 | are upgraded to a new revision.</para> | ||
3797 | <para>A more efficient way of dealing with this situation is | ||
3798 | to set the <filename>INC_PR</filename> variable inside | ||
3799 | the <filename>include</filename> files that the recipes | ||
3800 | share and then expand the <filename>INC_PR</filename> | ||
3801 | variable within the recipes to help | ||
3802 | define the recipe revision. | ||
3803 | </para> | ||
3804 | <para> | ||
3805 | The following provides an example that shows how to use | ||
3806 | the <filename>INC_PR</filename> variable | ||
3807 | given a common <filename>include</filename> file that | ||
3808 | defines the variable. | ||
3809 | Once the variable is defined in the | ||
3810 | <filename>include</filename> file, you can use the | ||
3811 | variable to set the <filename>PR</filename> values in | ||
3812 | each recipe. | ||
3813 | You will notice that when you set a recipe's | ||
3814 | <filename>PR</filename> you can provide more granular | ||
3815 | revisioning by appending values to the | ||
3816 | <filename>INC_PR</filename> variable: | ||
3817 | <literallayout class='monospaced'> | ||
3818 | recipes-graphics/xorg-font/xorg-font-common.inc:INC_PR = "r2" | ||
3819 | recipes-graphics/xorg-font/encodings_1.0.4.bb:PR = "${INC_PR}.1" | ||
3820 | recipes-graphics/xorg-font/font-util_1.3.0.bb:PR = "${INC_PR}.0" | ||
3821 | recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3" | ||
3822 | </literallayout> | ||
3823 | The first line of the example establishes the baseline | ||
3824 | revision to be used for all recipes that use the | ||
3825 | <filename>include</filename> file. | ||
3826 | The remaining lines in the example are from individual | ||
3827 | recipes and show how the <filename>PR</filename> value | ||
3828 | is set.</para> | ||
3829 | </glossdef> | ||
3830 | </glossentry> | ||
3831 | |||
3832 | <glossentry id='var-INCOMPATIBLE_LICENSE'><glossterm>INCOMPATIBLE_LICENSE</glossterm> | ||
3833 | <glossdef> | ||
3834 | <para> | ||
3835 | Specifies a space-separated list of license names | ||
3836 | (as they would appear in | ||
3837 | <link linkend='var-LICENSE'><filename>LICENSE</filename></link>) | ||
3838 | that should be excluded from the build. | ||
3839 | Recipes that provide no alternatives to listed incompatible | ||
3840 | licenses are not built. | ||
3841 | Packages that are individually licensed with the specified | ||
3842 | incompatible licenses will be deleted. | ||
3843 | </para> | ||
3844 | |||
3845 | <note> | ||
3846 | This functionality is only regularly tested using | ||
3847 | the following setting: | ||
3848 | <literallayout class='monospaced'> | ||
3849 | INCOMPATIBLE_LICENSE = "GPLv3" | ||
3850 | </literallayout> | ||
3851 | Although you can use other settings, you might be required | ||
3852 | to remove dependencies on or provide alternatives to | ||
3853 | components that are required to produce a functional system | ||
3854 | image. | ||
3855 | </note> | ||
3856 | </glossdef> | ||
3857 | </glossentry> | ||
3858 | |||
3859 | <glossentry id='var-INHIBIT_DEFAULT_DEPS'><glossterm>INHIBIT_DEFAULT_DEPS</glossterm> | ||
3860 | <glossdef> | ||
3861 | <para> | ||
3862 | Prevents the default dependencies, namely the C compiler | ||
3863 | and standard C library (libc), from being added to | ||
3864 | <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>. | ||
3865 | This variable is usually used within recipes that do not | ||
3866 | require any compilation using the C compiler. | ||
3867 | </para> | ||
3868 | |||
3869 | <para> | ||
3870 | Set the variable to "1" to prevent the default dependencies | ||
3871 | from being added. | ||
3872 | </para> | ||
3873 | </glossdef> | ||
3874 | </glossentry> | ||
3875 | |||
3876 | <glossentry id='var-INHIBIT_PACKAGE_STRIP'><glossterm>INHIBIT_PACKAGE_STRIP</glossterm> | ||
3877 | <glossdef> | ||
3878 | <para> | ||
3879 | If set to "1", causes the build to not strip binaries in resulting packages. | ||
3880 | </para> | ||
3881 | </glossdef> | ||
3882 | </glossentry> | ||
3883 | |||
3884 | <glossentry id='var-INHERIT'><glossterm>INHERIT</glossterm> | ||
3885 | <glossdef> | ||
3886 | <para> | ||
3887 | Causes the named class to be inherited at | ||
3888 | this point during parsing. | ||
3889 | The variable is only valid in configuration files. | ||
3890 | </para> | ||
3891 | </glossdef> | ||
3892 | </glossentry> | ||
3893 | |||
3894 | <glossentry id='var-INHERIT_DISTRO'><glossterm>INHERIT_DISTRO</glossterm> | ||
3895 | <glossdef> | ||
3896 | <para> | ||
3897 | Lists classes that will be inherited at the | ||
3898 | distribution level. | ||
3899 | It is unlikely that you want to edit this variable. | ||
3900 | </para> | ||
3901 | |||
3902 | <para> | ||
3903 | The default value of the variable is set as follows in the | ||
3904 | <filename>meta/conf/distro/defaultsetup.conf</filename> | ||
3905 | file: | ||
3906 | <literallayout class='monospaced'> | ||
3907 | INHERIT_DISTRO ?= "debian devshell sstate license" | ||
3908 | </literallayout> | ||
3909 | </para> | ||
3910 | </glossdef> | ||
3911 | </glossentry> | ||
3912 | |||
3913 | <glossentry id='var-INITRAMFS_FSTYPES'><glossterm>INITRAMFS_FSTYPES</glossterm> | ||
3914 | <glossdef> | ||
3915 | <para> | ||
3916 | Defines the format for the output image of an initial | ||
3917 | RAM disk (initramfs), which is used during boot. | ||
3918 | Supported formats are the same as those supported by the | ||
3919 | <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link> | ||
3920 | variable. | ||
3921 | </para> | ||
3922 | </glossdef> | ||
3923 | </glossentry> | ||
3924 | |||
3925 | <glossentry id='var-INITRAMFS_IMAGE'><glossterm>INITRAMFS_IMAGE</glossterm> | ||
3926 | <glossdef> | ||
3927 | <para> | ||
3928 | Causes the OpenEmbedded build system to build an additional | ||
3929 | recipe as a dependency to your root filesystem recipe | ||
3930 | (e.g. <filename>core-image-sato</filename>). | ||
3931 | The additional recipe is used to create an initial RAM disk | ||
3932 | (initramfs) that might be needed during the initial boot of | ||
3933 | the target system to accomplish such things as loading | ||
3934 | kernel modules prior to mounting the root file system. | ||
3935 | </para> | ||
3936 | |||
3937 | <para> | ||
3938 | When you set the variable, specify the name of the | ||
3939 | initramfs you want created. | ||
3940 | The following example, which is set in the | ||
3941 | <filename>local.conf</filename> configuration file, causes | ||
3942 | a separate recipe to be created that results in an | ||
3943 | initramfs image named | ||
3944 | <filename>core-image-sato-initramfs.bb</filename> to be | ||
3945 | created: | ||
3946 | <literallayout class='monospaced'> | ||
3947 | INITRAMFS_IMAGE = "core-image-minimal-initramfs" | ||
3948 | </literallayout> | ||
3949 | By default, the | ||
3950 | <link linkend='ref-classes-kernel'><filename>kernel</filename></link> | ||
3951 | class sets this variable to a null string as follows: | ||
3952 | <literallayout class='monospaced'> | ||
3953 | INITRAMFS_IMAGE = "" | ||
3954 | </literallayout> | ||
3955 | </para> | ||
3956 | |||
3957 | <para> | ||
3958 | See the | ||
3959 | <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta-yocto/conf/local.conf.sample.extended'><filename>local.conf.sample.extended</filename></ulink> | ||
3960 | file for additional information. | ||
3961 | You can also reference the | ||
3962 | <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/classes/kernel.bbclass'><filename>kernel.bbclass</filename></ulink> | ||
3963 | file to see how the variable is used. | ||
3964 | </para> | ||
3965 | </glossdef> | ||
3966 | </glossentry> | ||
3967 | |||
3968 | <glossentry id='var-INITRAMFS_IMAGE_BUNDLE'><glossterm>INITRAMFS_IMAGE_BUNDLE</glossterm> | ||
3969 | <glossdef> | ||
3970 | <para> | ||
3971 | Controls whether or not the image recipe specified by | ||
3972 | <link linkend='var-INITRAMFS_IMAGE'><filename>INITRAMFS_IMAGE</filename></link> | ||
3973 | is run through an extra pass during kernel compilation | ||
3974 | in order to build a single binary that contains both the | ||
3975 | kernel image and the initial RAM disk (initramfs). | ||
3976 | Using an extra compilation pass ensures that when a kernel | ||
3977 | attempts to use an initramfs, it does not encounter | ||
3978 | circular dependencies should the initramfs include kernel | ||
3979 | modules. | ||
3980 | </para> | ||
3981 | |||
3982 | <para> | ||
3983 | The combined binary is deposited into the | ||
3984 | <filename>tmp/deploy</filename> directory, which is part | ||
3985 | of the | ||
3986 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
3987 | </para> | ||
3988 | |||
3989 | <para> | ||
3990 | Setting the variable to "1" in a configuration file causes | ||
3991 | the OpenEmbedded build system to make the extra pass during | ||
3992 | kernel compilation: | ||
3993 | <literallayout class='monospaced'> | ||
3994 | INITRAMFS_IMAGE_BUNDLE = "1" | ||
3995 | </literallayout> | ||
3996 | By default, the | ||
3997 | <link linkend='ref-classes-kernel'><filename>kernel</filename></link> | ||
3998 | class sets this variable to a null string as follows: | ||
3999 | <literallayout class='monospaced'> | ||
4000 | INITRAMFS_IMAGE_BUNDLE = "" | ||
4001 | </literallayout> | ||
4002 | <note> | ||
4003 | You must set the | ||
4004 | <filename>INITRAMFS_IMAGE_BUNDLE</filename> variable in | ||
4005 | a configuration file. | ||
4006 | You cannot set the variable in a recipe file. | ||
4007 | </note> | ||
4008 | See the | ||
4009 | <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta-yocto/conf/local.conf.sample.extended'><filename>local.conf.sample.extended</filename></ulink> | ||
4010 | file for additional information. | ||
4011 | </para> | ||
4012 | </glossdef> | ||
4013 | </glossentry> | ||
4014 | |||
4015 | <glossentry id='var-INITRD'><glossterm>INITRD</glossterm> | ||
4016 | <glossdef> | ||
4017 | <para> | ||
4018 | Indicates a filesystem image to use as an initial RAM | ||
4019 | disk (<filename>initrd</filename>). | ||
4020 | </para> | ||
4021 | |||
4022 | <para> | ||
4023 | The <filename>INITRD</filename> variable is an optional | ||
4024 | variable used with the | ||
4025 | <link linkend='ref-classes-bootimg'><filename>bootimg</filename></link> | ||
4026 | class. | ||
4027 | </para> | ||
4028 | </glossdef> | ||
4029 | </glossentry> | ||
4030 | |||
4031 | <glossentry id='var-INITSCRIPT_NAME'><glossterm>INITSCRIPT_NAME</glossterm> | ||
4032 | <glossdef> | ||
4033 | <para> | ||
4034 | The filename of the initialization script as installed to | ||
4035 | <filename>${sysconfdir}/init.d</filename>. | ||
4036 | </para> | ||
4037 | <para> | ||
4038 | This variable is used in recipes when using <filename>update-rc.d.bbclass</filename>. | ||
4039 | The variable is mandatory. | ||
4040 | </para> | ||
4041 | </glossdef> | ||
4042 | </glossentry> | ||
4043 | |||
4044 | <glossentry id='var-INITSCRIPT_PACKAGES'><glossterm>INITSCRIPT_PACKAGES</glossterm> | ||
4045 | <glossdef> | ||
4046 | <para> | ||
4047 | A list of the packages that contain initscripts. | ||
4048 | If multiple packages are specified, you need to append the package name | ||
4049 | to the other <filename>INITSCRIPT_*</filename> as an override.</para> | ||
4050 | <para> | ||
4051 | This variable is used in recipes when using <filename>update-rc.d.bbclass</filename>. | ||
4052 | The variable is optional and defaults to the | ||
4053 | <link linkend='var-PN'><filename>PN</filename></link> variable. | ||
4054 | </para> | ||
4055 | </glossdef> | ||
4056 | </glossentry> | ||
4057 | |||
4058 | <glossentry id='var-INITSCRIPT_PARAMS'><glossterm>INITSCRIPT_PARAMS</glossterm> | ||
4059 | <glossdef> | ||
4060 | <para> | ||
4061 | Specifies the options to pass to <filename>update-rc.d</filename>. | ||
4062 | Here is an example: | ||
4063 | <literallayout class='monospaced'> | ||
4064 | INITSCRIPT_PARAMS = "start 99 5 2 . stop 20 0 1 6 ." | ||
4065 | </literallayout> | ||
4066 | In this example, the script has a runlevel of 99, | ||
4067 | starts the script in initlevels 2 and 5, and | ||
4068 | stops the script in levels 0, 1 and 6. | ||
4069 | </para> | ||
4070 | <para> | ||
4071 | The variable is mandatory and is used in recipes when using | ||
4072 | <filename>update-rc.d.bbclass</filename>. | ||
4073 | </para> | ||
4074 | </glossdef> | ||
4075 | </glossentry> | ||
4076 | |||
4077 | <glossentry id='var-INSANE_SKIP'><glossterm>INSANE_SKIP</glossterm> | ||
4078 | <glossdef> | ||
4079 | <para> | ||
4080 | Specifies the QA checks to skip for a specific package | ||
4081 | within a recipe. | ||
4082 | For example, to skip the check for symbolic link | ||
4083 | <filename>.so</filename> files in the main package of a | ||
4084 | recipe, add the following to the recipe. | ||
4085 | The package name override must be used, which in this | ||
4086 | example is <filename>${PN}</filename>: | ||
4087 | <literallayout class='monospaced'> | ||
4088 | INSANE_SKIP_${PN} += "dev-so" | ||
4089 | </literallayout> | ||
4090 | </para> | ||
4091 | <para> | ||
4092 | See the "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>" | ||
4093 | section for a list of the valid QA checks you can | ||
4094 | specify using this variable. | ||
4095 | </para> | ||
4096 | </glossdef> | ||
4097 | </glossentry> | ||
4098 | |||
4099 | <glossentry id='var-IPK_FEED_URIS'><glossterm>IPK_FEED_URIS</glossterm> | ||
4100 | <glossdef> | ||
4101 | <para> | ||
4102 | When the IPK backend is in use and package management | ||
4103 | is enabled on the target, you can use this variable to | ||
4104 | set up <filename>opkg</filename> in the target image | ||
4105 | to point to package feeds on a nominated server. | ||
4106 | Once the feed is established, you can perform | ||
4107 | installations or upgrades using the package manager | ||
4108 | at runtime. | ||
4109 | </para> | ||
4110 | </glossdef> | ||
4111 | </glossentry> | ||
4112 | |||
4113 | <!-- | ||
4114 | <glossentry id='var-INTERCEPT_DIR'><glossterm>INTERCEPT_DIR</glossterm> | ||
4115 | <glossdef> | ||
4116 | <para> | ||
4117 | An environment variable that defines the directory where | ||
4118 | post installation hooks are installed for the | ||
4119 | post install environment. | ||
4120 | This variable is fixed as follows: | ||
4121 | <literallayout class='monospaced'> | ||
4122 | ${WORKDIR}/intercept_scripts | ||
4123 | </literallayout> | ||
4124 | </para> | ||
4125 | |||
4126 | <para> | ||
4127 | After installation of a target's root filesystem, | ||
4128 | post installation scripts, which are essentially bash scripts, | ||
4129 | are all executed just a single time. | ||
4130 | Limiting execution of these scripts minimizes installation | ||
4131 | time that would be lengthened due to certain packages | ||
4132 | triggering redundant operations. | ||
4133 | For example, consider the installation of font packages | ||
4134 | as a common example. | ||
4135 | Without limiting the execution of post installation scripts, | ||
4136 | all font directories would be rescanned to create the | ||
4137 | cache after each individual font package was installed. | ||
4138 | </para> | ||
4139 | |||
4140 | <para> | ||
4141 | Do not edit the <filename>INTERCEPT_DIR</filename> | ||
4142 | variable. | ||
4143 | </para> | ||
4144 | </glossdef> | ||
4145 | </glossentry> | ||
4146 | --> | ||
4147 | |||
4148 | </glossdiv> | ||
4149 | |||
4150 | <!-- <glossdiv id='var-glossary-j'><title>J</title>--> | ||
4151 | <!-- </glossdiv>--> | ||
4152 | |||
4153 | <glossdiv id='var-glossary-k'><title>K</title> | ||
4154 | |||
4155 | <glossentry id='var-KARCH'><glossterm>KARCH</glossterm> | ||
4156 | <glossdef> | ||
4157 | <para> | ||
4158 | Defines the kernel architecture used when assembling | ||
4159 | the configuration. | ||
4160 | Architectures supported for this release are: | ||
4161 | <literallayout class='monospaced'> | ||
4162 | powerpc | ||
4163 | i386 | ||
4164 | x86_64 | ||
4165 | arm | ||
4166 | qemu | ||
4167 | mips | ||
4168 | </literallayout> | ||
4169 | </para> | ||
4170 | |||
4171 | <para> | ||
4172 | You define the <filename>KARCH</filename> variable in the | ||
4173 | <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#bsp-descriptions'>BSP Descriptions</ulink>. | ||
4174 | </para> | ||
4175 | </glossdef> | ||
4176 | </glossentry> | ||
4177 | |||
4178 | <glossentry id='var-KBRANCH'><glossterm>KBRANCH</glossterm> | ||
4179 | <glossdef> | ||
4180 | <para> | ||
4181 | A regular expression used by the build process to explicitly | ||
4182 | identify the kernel branch that is validated, patched | ||
4183 | and configured during a build. | ||
4184 | The <filename>KBRANCH</filename> variable is optional. | ||
4185 | You can use it to trigger checks to ensure the exact kernel | ||
4186 | branch you want is being used by the build process. | ||
4187 | </para> | ||
4188 | |||
4189 | <para> | ||
4190 | Values for this variable are set in the kernel's recipe | ||
4191 | file and the kernel's append file. | ||
4192 | For example, if you are using the Yocto Project kernel that | ||
4193 | is based on the Linux 3.10 kernel, the kernel recipe file | ||
4194 | is the | ||
4195 | <filename>meta/recipes-kernel/linux/linux-yocto_3.10.bb</filename> | ||
4196 | file. | ||
4197 | Following is the default value for <filename>KBRANCH</filename> | ||
4198 | and the default override for the architectures the Yocto | ||
4199 | Project supports: | ||
4200 | <literallayout class='monospaced'> | ||
4201 | KBRANCH_DEFAULT = "standard/base" | ||
4202 | KBRANCH = "${KBRANCH_DEFAULT}" | ||
4203 | </literallayout> | ||
4204 | This branch exists in the <filename>linux-yocto-3.10</filename> | ||
4205 | kernel Git repository | ||
4206 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi/linux-yocto-3.10/refs/heads'></ulink>. | ||
4207 | </para> | ||
4208 | |||
4209 | <para> | ||
4210 | This variable is also used from the kernel's append file | ||
4211 | to identify the kernel branch specific to a particular | ||
4212 | machine or target hardware. | ||
4213 | The kernel's append file is located in the BSP layer for | ||
4214 | a given machine. | ||
4215 | For example, the kernel append file for the Crown Bay BSP is in the | ||
4216 | <filename>meta-intel</filename> Git repository and is named | ||
4217 | <filename>meta-crownbay/recipes-kernel/linux/linux-yocto_3.10.bbappend</filename>. | ||
4218 | Here are the related statements from the append file: | ||
4219 | <literallayout class='monospaced'> | ||
4220 | COMPATIBLE_MACHINE_crownbay = "crownbay" | ||
4221 | KMACHINE_crownbay = "crownbay" | ||
4222 | KBRANCH_crownbay = "standard/crownbay" | ||
4223 | KERNEL_FEATURES_append_crownbay = " features/drm-emgd/drm-emgd-1.18 cfg/vesafb" | ||
4224 | |||
4225 | COMPATIBLE_MACHINE_crownbay-noemgd = "crownbay-noemgd" | ||
4226 | KMACHINE_crownbay-noemgd = "crownbay" | ||
4227 | KBRANCH_crownbay-noemgd = "standard/crownbay" | ||
4228 | KERNEL_FEATURES_append_crownbay-noemgd = " cfg/vesafb" | ||
4229 | </literallayout> | ||
4230 | The <filename>KBRANCH_*</filename> statements identify | ||
4231 | the kernel branch to use when building for the Crown | ||
4232 | Bay BSP. | ||
4233 | In this case there are two identical statements: one | ||
4234 | for each type of Crown Bay machine. | ||
4235 | </para> | ||
4236 | </glossdef> | ||
4237 | </glossentry> | ||
4238 | |||
4239 | <glossentry id='var-KBRANCH_DEFAULT'><glossterm>KBRANCH_DEFAULT</glossterm> | ||
4240 | <glossdef> | ||
4241 | <para> | ||
4242 | Defines the Linux kernel source repository's default | ||
4243 | branch used to build the Linux kernel. | ||
4244 | The <filename>KBRANCH_DEFAULT</filename> value is | ||
4245 | the default value for | ||
4246 | <link linkend='var-KBRANCH'><filename>KBRANCH</filename></link>. | ||
4247 | Unless you specify otherwise, | ||
4248 | <filename>KBRANCH_DEFAULT</filename> initializes to | ||
4249 | "master". | ||
4250 | </para> | ||
4251 | </glossdef> | ||
4252 | </glossentry> | ||
4253 | |||
4254 | <glossentry id='var-KERNEL_EXTRA_ARGS'><glossterm>KERNEL_EXTRA_ARGS</glossterm> | ||
4255 | <glossdef> | ||
4256 | <para> | ||
4257 | Specifies additional <filename>make</filename> | ||
4258 | command-line arguments the OpenEmbedded build system | ||
4259 | passes on when compiling the kernel. | ||
4260 | </para> | ||
4261 | </glossdef> | ||
4262 | </glossentry> | ||
4263 | |||
4264 | <glossentry id='var-KERNEL_FEATURES'><glossterm>KERNEL_FEATURES</glossterm> | ||
4265 | <glossdef> | ||
4266 | <para>Includes additional metadata from the Yocto Project kernel Git repository. | ||
4267 | In the OpenEmbedded build system, the default Board Support Packages (BSPs) | ||
4268 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> | ||
4269 | is provided through | ||
4270 | the <link linkend='var-KMACHINE'><filename>KMACHINE</filename></link> | ||
4271 | and <link linkend='var-KBRANCH'><filename>KBRANCH</filename></link> variables. | ||
4272 | You can use the <filename>KERNEL_FEATURES</filename> variable to further | ||
4273 | add metadata for all BSPs.</para> | ||
4274 | <para>The metadata you add through this variable includes config fragments and | ||
4275 | features descriptions, | ||
4276 | which usually includes patches as well as config fragments. | ||
4277 | You typically override the <filename>KERNEL_FEATURES</filename> variable | ||
4278 | for a specific machine. | ||
4279 | In this way, you can provide validated, but optional, sets of kernel | ||
4280 | configurations and features.</para> | ||
4281 | <para>For example, the following adds <filename>netfilter</filename> to all | ||
4282 | the Yocto Project kernels and adds sound support to the <filename>qemux86</filename> | ||
4283 | machine: | ||
4284 | <literallayout class='monospaced'> | ||
4285 | # Add netfilter to all linux-yocto kernels | ||
4286 | KERNEL_FEATURES="features/netfilter" | ||
4287 | |||
4288 | # Add sound support to the qemux86 machine | ||
4289 | KERNEL_FEATURES_append_qemux86=" cfg/sound" | ||
4290 | </literallayout></para> | ||
4291 | </glossdef> | ||
4292 | </glossentry> | ||
4293 | |||
4294 | <glossentry id='var-KERNEL_IMAGE_BASE_NAME'><glossterm>KERNEL_IMAGE_BASE_NAME</glossterm> | ||
4295 | <glossdef> | ||
4296 | <para> | ||
4297 | The base name of the kernel image. | ||
4298 | This variable is set in the | ||
4299 | <link linkend='ref-classes-kernel'>kernel</link> class | ||
4300 | as follows: | ||
4301 | <literallayout class='monospaced'> | ||
4302 | KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" | ||
4303 | </literallayout> | ||
4304 | See the | ||
4305 | <link linkend='var-KERNEL_IMAGETYPE'><filename>KERNEL_IMAGETYPE</filename></link>, | ||
4306 | <link linkend='var-PKGE'><filename>PKGE</filename></link>, | ||
4307 | <link linkend='var-PKGV'><filename>PKGV</filename></link>, | ||
4308 | <link linkend='var-PKGR'><filename>PKGR</filename></link>, | ||
4309 | <link linkend='var-MACHINE'><filename>MACHINE</filename></link>, | ||
4310 | and | ||
4311 | <link linkend='var-DATETIME'><filename>DATETIME</filename></link> | ||
4312 | variables for additional information. | ||
4313 | </para> | ||
4314 | </glossdef> | ||
4315 | </glossentry> | ||
4316 | |||
4317 | <glossentry id='var-KERNEL_IMAGETYPE'><glossterm>KERNEL_IMAGETYPE</glossterm> | ||
4318 | <glossdef> | ||
4319 | <para>The type of kernel to build for a device, usually set by the | ||
4320 | machine configuration files and defaults to "zImage". | ||
4321 | This variable is used | ||
4322 | when building the kernel and is passed to <filename>make</filename> as the target to | ||
4323 | build.</para> | ||
4324 | </glossdef> | ||
4325 | </glossentry> | ||
4326 | |||
4327 | <glossentry id='var-KERNEL_PATH'><glossterm>KERNEL_PATH</glossterm> | ||
4328 | <glossdef> | ||
4329 | <para> | ||
4330 | The location of the kernel sources. | ||
4331 | This variable is set to the value of the | ||
4332 | <link linkend='var-STAGING_KERNEL_DIR'><filename>STAGING_KERNEL_DIR</filename></link> | ||
4333 | within the <filename>module.bbclass</filename> class. | ||
4334 | For information on how this variable is used, see the | ||
4335 | "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#incorporating-out-of-tree-modules'>Incorporating Out-of-Tree Modules</ulink>" | ||
4336 | section. | ||
4337 | </para> | ||
4338 | |||
4339 | <para> | ||
4340 | To help maximize compatibility with out-of-tree drivers | ||
4341 | used to build modules, the OpenEmbedded build system also | ||
4342 | recognizes and uses the | ||
4343 | <link linkend='var-KERNEL_SRC'><filename>KERNEL_SRC</filename></link> | ||
4344 | variable, which is identical to the | ||
4345 | <filename>KERNEL_PATH</filename> variable. | ||
4346 | Both variables are common variables used by external | ||
4347 | Makefiles to point to the kernel source directory. | ||
4348 | </para> | ||
4349 | </glossdef> | ||
4350 | </glossentry> | ||
4351 | |||
4352 | <glossentry id='var-KERNEL_SRC'><glossterm>KERNEL_SRC</glossterm> | ||
4353 | <glossdef> | ||
4354 | <para> | ||
4355 | The location of the kernel sources. | ||
4356 | This variable is set to the value of the | ||
4357 | <link linkend='var-STAGING_KERNEL_DIR'><filename>STAGING_KERNEL_DIR</filename></link> | ||
4358 | within the <filename>module.bbclass</filename> class. | ||
4359 | For information on how this variable is used, see the | ||
4360 | "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#incorporating-out-of-tree-modules'>Incorporating Out-of-Tree Modules</ulink>" | ||
4361 | section. | ||
4362 | </para> | ||
4363 | |||
4364 | <para> | ||
4365 | To help maximize compatibility with out-of-tree drivers | ||
4366 | used to build modules, the OpenEmbedded build system also | ||
4367 | recognizes and uses the | ||
4368 | <link linkend='var-KERNEL_PATH'><filename>KERNEL_PATH</filename></link> | ||
4369 | variable, which is identical to the | ||
4370 | <filename>KERNEL_SRC</filename> variable. | ||
4371 | Both variables are common variables used by external | ||
4372 | Makefiles to point to the kernel source directory. | ||
4373 | </para> | ||
4374 | </glossdef> | ||
4375 | </glossentry> | ||
4376 | |||
4377 | <glossentry id='var-KFEATURE_DESCRIPTION'><glossterm>KFEATURE_DESCRIPTION</glossterm> | ||
4378 | <glossdef> | ||
4379 | <para> | ||
4380 | Provides a short description of a configuration fragment. | ||
4381 | You use this variable in the <filename>.scc</filename> | ||
4382 | file that describes a configuration fragment file. | ||
4383 | Here is the variable used in a file named | ||
4384 | <filename>smp.scc</filename> to describe SMP being | ||
4385 | enabled: | ||
4386 | <literallayout class='monospaced'> | ||
4387 | define KFEATURE_DESCRIPTION "Enable SMP" | ||
4388 | </literallayout> | ||
4389 | </para> | ||
4390 | </glossdef> | ||
4391 | </glossentry> | ||
4392 | |||
4393 | <glossentry id='var-KMACHINE'><glossterm>KMACHINE</glossterm> | ||
4394 | <glossdef> | ||
4395 | <para> | ||
4396 | The machine as known by the kernel. | ||
4397 | Sometimes the machine name used by the kernel does not match the machine name | ||
4398 | used by the OpenEmbedded build system. | ||
4399 | For example, the machine name that the OpenEmbedded build system understands as | ||
4400 | <filename>qemuarm</filename> goes by a different name in the Linux Yocto kernel. | ||
4401 | The kernel understands that machine as <filename>arm_versatile926ejs</filename>. | ||
4402 | For cases like these, the <filename>KMACHINE</filename> variable maps the | ||
4403 | kernel machine name to the OpenEmbedded build system machine name. | ||
4404 | </para> | ||
4405 | |||
4406 | <para> | ||
4407 | Kernel machine names are initially defined in the | ||
4408 | Yocto Linux Kernel's <filename>meta</filename> branch. | ||
4409 | From the <filename>meta</filename> branch, look in | ||
4410 | the <filename>meta/cfg/kernel-cache/bsp/<bsp_name>/<bsp-name>-<kernel-type>.scc</filename> file. | ||
4411 | For example, from the <filename>meta</filename> branch in the | ||
4412 | <filename>linux-yocto-3.0</filename> kernel, the | ||
4413 | <filename>meta/cfg/kernel-cache/bsp/cedartrail/cedartrail-standard.scc</filename> file | ||
4414 | has the following: | ||
4415 | <literallayout class='monospaced'> | ||
4416 | define KMACHINE cedartrail | ||
4417 | define KTYPE standard | ||
4418 | define KARCH i386 | ||
4419 | |||
4420 | include ktypes/standard | ||
4421 | branch cedartrail | ||
4422 | |||
4423 | include cedartrail.scc | ||
4424 | </literallayout> | ||
4425 | You can see that the kernel understands the machine name for | ||
4426 | the Cedar Trail Board Support Package (BSP) as | ||
4427 | <filename>cedartrail</filename>. | ||
4428 | </para> | ||
4429 | |||
4430 | <para> | ||
4431 | If you look in the Cedar Trail BSP layer in the | ||
4432 | <filename>meta-intel</filename> | ||
4433 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-repositories'>Source Repositories</ulink> | ||
4434 | at <filename>meta-cedartrail/recipes-kernel/linux/linux-yocto_3.0.bbappend</filename>, | ||
4435 | you will find the following statements among others: | ||
4436 | <literallayout class='monospaced'> | ||
4437 | COMPATIBLE_MACHINE_cedartrail = "cedartrail" | ||
4438 | KMACHINE_cedartrail = "cedartrail" | ||
4439 | KBRANCH_cedartrail = "yocto/standard/cedartrail" | ||
4440 | KERNEL_FEATURES_append_cedartrail += "bsp/cedartrail/cedartrail-pvr-merge.scc" | ||
4441 | KERNEL_FEATURES_append_cedartrail += "cfg/efi-ext.scc" | ||
4442 | |||
4443 | COMPATIBLE_MACHINE_cedartrail-nopvr = "cedartrail" | ||
4444 | KMACHINE_cedartrail-nopvr = "cedartrail" | ||
4445 | KBRANCH_cedartrail-nopvr = "yocto/standard/cedartrail" | ||
4446 | KERNEL_FEATURES_append_cedartrail-nopvr += " cfg/smp.scc" | ||
4447 | </literallayout> | ||
4448 | The <filename>KMACHINE</filename> statements in the kernel's append file make sure that | ||
4449 | the OpenEmbedded build system and the Yocto Linux kernel understand the same machine | ||
4450 | names. | ||
4451 | </para> | ||
4452 | |||
4453 | <para> | ||
4454 | This append file uses two <filename>KMACHINE</filename> statements. | ||
4455 | The first is not really necessary but does ensure that the machine known to the | ||
4456 | OpenEmbedded build system as <filename>cedartrail</filename> maps to the machine | ||
4457 | in the kernel also known as <filename>cedartrail</filename>: | ||
4458 | <literallayout class='monospaced'> | ||
4459 | KMACHINE_cedartrail = "cedartrail" | ||
4460 | </literallayout> | ||
4461 | </para> | ||
4462 | |||
4463 | <para> | ||
4464 | The second statement is a good example of why the <filename>KMACHINE</filename> variable | ||
4465 | is needed. | ||
4466 | In this example, the OpenEmbedded build system uses the <filename>cedartrail-nopvr</filename> | ||
4467 | machine name to refer to the Cedar Trail BSP that does not support the proprietary | ||
4468 | PowerVR driver. | ||
4469 | The kernel, however, uses the machine name <filename>cedartrail</filename>. | ||
4470 | Thus, the append file must map the <filename>cedartrail-nopvr</filename> machine name to | ||
4471 | the kernel's <filename>cedartrail</filename> name: | ||
4472 | <literallayout class='monospaced'> | ||
4473 | KMACHINE_cedartrail-nopvr = "cedartrail" | ||
4474 | </literallayout> | ||
4475 | </para> | ||
4476 | |||
4477 | <para> | ||
4478 | BSPs that ship with the Yocto Project release provide all mappings between the Yocto | ||
4479 | Project kernel machine names and the OpenEmbedded machine names. | ||
4480 | Be sure to use the <filename>KMACHINE</filename> if you create a BSP and the machine | ||
4481 | name you use is different than that used in the kernel. | ||
4482 | </para> | ||
4483 | </glossdef> | ||
4484 | </glossentry> | ||
4485 | |||
4486 | <glossentry id='var-KTYPE'><glossterm>KTYPE</glossterm> | ||
4487 | <glossdef> | ||
4488 | <para> | ||
4489 | Defines the kernel type to be used in assembling the | ||
4490 | configuration. | ||
4491 | The linux-yocto recipes define "standard", "tiny", | ||
4492 | and "preempt-rt" kernel types. | ||
4493 | See the | ||
4494 | "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#kernel-types'>Kernel Types</ulink>" | ||
4495 | section in the Yocto Project Linux Kernel Development | ||
4496 | Manual for more information on kernel types. | ||
4497 | </para> | ||
4498 | |||
4499 | <para> | ||
4500 | You define the <filename>KTYPE</filename> variable in the | ||
4501 | <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#bsp-descriptions'>BSP Descriptions</ulink>. | ||
4502 | The value you use must match the value used for the | ||
4503 | <link linkend='var-LINUX_KERNEL_TYPE'><filename>LINUX_KERNEL_TYPE</filename></link> | ||
4504 | value used by the kernel recipe. | ||
4505 | </para> | ||
4506 | </glossdef> | ||
4507 | </glossentry> | ||
4508 | </glossdiv> | ||
4509 | |||
4510 | <glossdiv id='var-glossary-l'><title>L</title> | ||
4511 | |||
4512 | <glossentry id='var-LABELS'><glossterm>LABELS</glossterm> | ||
4513 | <glossdef> | ||
4514 | <para> | ||
4515 | Provides a list of targets for automatic configuration. | ||
4516 | </para> | ||
4517 | |||
4518 | <para> | ||
4519 | See the | ||
4520 | <link linkend='ref-classes-grub-efi'><filename>grub-efi</filename></link> | ||
4521 | class for more information on how this variable is used. | ||
4522 | </para> | ||
4523 | </glossdef> | ||
4524 | </glossentry> | ||
4525 | |||
4526 | <glossentry id='var-LAYERDEPENDS'><glossterm>LAYERDEPENDS</glossterm> | ||
4527 | <glossdef> | ||
4528 | <para>Lists the layers that this recipe depends upon, separated by spaces. | ||
4529 | Optionally, you can specify a specific layer version for a dependency | ||
4530 | by adding it to the end of the layer name with a colon, (e.g. "anotherlayer:3" | ||
4531 | to be compared against | ||
4532 | <link linkend='var-LAYERVERSION'><filename>LAYERVERSION</filename></link><filename>_anotherlayer</filename> | ||
4533 | in this case). | ||
4534 | An error will be produced if any dependency is missing or | ||
4535 | the version numbers do not match exactly (if specified). | ||
4536 | This variable is used in the <filename>conf/layer.conf</filename> file | ||
4537 | and must be suffixed with the name of the specific layer (e.g. | ||
4538 | <filename>LAYERDEPENDS_mylayer</filename>).</para> | ||
4539 | </glossdef> | ||
4540 | </glossentry> | ||
4541 | |||
4542 | <glossentry id='var-LAYERDIR'><glossterm>LAYERDIR</glossterm> | ||
4543 | <glossdef> | ||
4544 | <para>When used inside the <filename>layer.conf</filename> configuration | ||
4545 | file, this variable provides the path of the current layer. | ||
4546 | This variable is not available outside of <filename>layer.conf</filename> | ||
4547 | and references are expanded immediately when parsing of the file completes.</para> | ||
4548 | </glossdef> | ||
4549 | </glossentry> | ||
4550 | |||
4551 | <glossentry id='var-LAYERVERSION'><glossterm>LAYERVERSION</glossterm> | ||
4552 | <glossdef> | ||
4553 | <para>Optionally specifies the version of a layer as a single number. | ||
4554 | You can use this within | ||
4555 | <link linkend='var-LAYERDEPENDS'><filename>LAYERDEPENDS</filename></link> | ||
4556 | for another layer in order to depend on a specific version | ||
4557 | of the layer. | ||
4558 | This variable is used in the <filename>conf/layer.conf</filename> file | ||
4559 | and must be suffixed with the name of the specific layer (e.g. | ||
4560 | <filename>LAYERVERSION_mylayer</filename>).</para> | ||
4561 | </glossdef> | ||
4562 | </glossentry> | ||
4563 | |||
4564 | <glossentry id='var-LDFLAGS'><glossterm>LDFLAGS</glossterm> | ||
4565 | <glossdef> | ||
4566 | <para> | ||
4567 | Specifies the flags to pass to the linker. | ||
4568 | This variable is exported to an environment | ||
4569 | variable and thus made visible to the software being | ||
4570 | built during the compilation step. | ||
4571 | </para> | ||
4572 | |||
4573 | <para> | ||
4574 | Default initialization for <filename>LDFLAGS</filename> | ||
4575 | varies depending on what is being built: | ||
4576 | <itemizedlist> | ||
4577 | <listitem><para> | ||
4578 | <link linkend='var-TARGET_LDFLAGS'><filename>TARGET_LDFLAGS</filename></link> | ||
4579 | when building for the target | ||
4580 | </para></listitem> | ||
4581 | <listitem><para> | ||
4582 | <link linkend='var-BUILD_LDFLAGS'><filename>BUILD_LDFLAGS</filename></link> | ||
4583 | when building for the build host (i.e. | ||
4584 | <filename>-native</filename>) | ||
4585 | </para></listitem> | ||
4586 | <listitem><para> | ||
4587 | <link linkend='var-BUILDSDK_LDFLAGS'><filename>BUILDSDK_LDFLAGS</filename></link> | ||
4588 | when building for an SDK (i.e. | ||
4589 | <filename>nativesdk-</filename>) | ||
4590 | </para></listitem> | ||
4591 | </itemizedlist> | ||
4592 | </para> | ||
4593 | </glossdef> | ||
4594 | </glossentry> | ||
4595 | |||
4596 | <glossentry id='var-LEAD_SONAME'><glossterm>LEAD_SONAME</glossterm> | ||
4597 | <glossdef> | ||
4598 | <para> | ||
4599 | Specifies the lead (or primary) compiled library file | ||
4600 | (<filename>.so</filename>) that the | ||
4601 | <link linkend='ref-classes-debian'><filename>debian</filename></link> | ||
4602 | class applies its naming policy to given a recipe that | ||
4603 | packages multiple libraries. | ||
4604 | </para> | ||
4605 | |||
4606 | <para> | ||
4607 | This variable works in conjunction with the | ||
4608 | <filename>debian</filename> class. | ||
4609 | </para> | ||
4610 | </glossdef> | ||
4611 | </glossentry> | ||
4612 | |||
4613 | <glossentry id='var-LIC_FILES_CHKSUM'><glossterm>LIC_FILES_CHKSUM</glossterm> | ||
4614 | <glossdef> | ||
4615 | <para>Checksums of the license text in the recipe source code.</para> | ||
4616 | <para>This variable tracks changes in license text of the source | ||
4617 | code files. | ||
4618 | If the license text is changed, it will trigger a build | ||
4619 | failure, which gives the developer an opportunity to review any | ||
4620 | license change.</para> | ||
4621 | <para> | ||
4622 | This variable must be defined for all recipes (unless | ||
4623 | <link linkend='var-LICENSE'><filename>LICENSE</filename></link> | ||
4624 | is set to "CLOSED")</para> | ||
4625 | <para>For more information, see the | ||
4626 | <link linkend='usingpoky-configuring-LIC_FILES_CHKSUM'> | ||
4627 | Tracking License Changes</link> section</para> | ||
4628 | </glossdef> | ||
4629 | </glossentry> | ||
4630 | |||
4631 | <glossentry id='var-LICENSE'><glossterm>LICENSE</glossterm> | ||
4632 | <glossdef> | ||
4633 | <para> | ||
4634 | The list of source licenses for the recipe. | ||
4635 | Follow these rules: | ||
4636 | <itemizedlist> | ||
4637 | <listitem><para>Do not use spaces within individual | ||
4638 | license names.</para></listitem> | ||
4639 | <listitem><para>Separate license names using | ||
4640 | | (pipe) when there is a choice between licenses. | ||
4641 | </para></listitem> | ||
4642 | <listitem><para>Separate license names using | ||
4643 | & (ampersand) when multiple licenses exist | ||
4644 | that cover different parts of the source. | ||
4645 | </para></listitem> | ||
4646 | <listitem><para>You can use spaces between license | ||
4647 | names.</para></listitem> | ||
4648 | <listitem><para>For standard licenses, use the names | ||
4649 | of the files in | ||
4650 | <filename>meta/files/common-licenses/</filename> | ||
4651 | or the | ||
4652 | <link linkend='var-SPDXLICENSEMAP'><filename>SPDXLICENSEMAP</filename></link> | ||
4653 | flag names defined in | ||
4654 | <filename>meta/conf/licenses.conf</filename>. | ||
4655 | </para></listitem> | ||
4656 | </itemizedlist> | ||
4657 | </para> | ||
4658 | |||
4659 | <para> | ||
4660 | Here are some examples: | ||
4661 | <literallayout class='monospaced'> | ||
4662 | LICENSE = "LGPLv2.1 | GPLv3" | ||
4663 | LICENSE = "MPL-1 & LGPLv2.1" | ||
4664 | LICENSE = "GPLv2+" | ||
4665 | </literallayout> | ||
4666 | The first example is from the recipes for Qt, which the user | ||
4667 | may choose to distribute under either the LGPL version | ||
4668 | 2.1 or GPL version 3. | ||
4669 | The second example is from Cairo where two licenses cover | ||
4670 | different parts of the source code. | ||
4671 | The final example is from <filename>sysstat</filename>, | ||
4672 | which presents a single license. | ||
4673 | </para> | ||
4674 | |||
4675 | <para> | ||
4676 | You can also specify licenses on a per-package basis to | ||
4677 | handle situations where components of the output have | ||
4678 | different licenses. | ||
4679 | For example, a piece of software whose code is | ||
4680 | licensed under GPLv2 but has accompanying documentation | ||
4681 | licensed under the GNU Free Documentation License 1.2 could | ||
4682 | be specified as follows: | ||
4683 | <literallayout class='monospaced'> | ||
4684 | LICENSE = "GFDL-1.2 & GPLv2" | ||
4685 | LICENSE_${PN} = "GPLv2" | ||
4686 | LICENSE_${PN}-doc = "GFDL-1.2" | ||
4687 | </literallayout> | ||
4688 | </para> | ||
4689 | </glossdef> | ||
4690 | </glossentry> | ||
4691 | |||
4692 | <glossentry id='var-LICENSE_PATH'><glossterm>LICENSE_PATH</glossterm> | ||
4693 | <glossdef> | ||
4694 | <para>Path to additional licenses used during the build. | ||
4695 | By default, the OpenEmbedded build system uses <filename>COMMON_LICENSE_DIR</filename> | ||
4696 | to define the directory that holds common license text used during the build. | ||
4697 | The <filename>LICENSE_PATH</filename> variable allows you to extend that | ||
4698 | location to other areas that have additional licenses: | ||
4699 | <literallayout class='monospaced'> | ||
4700 | LICENSE_PATH += "/path/to/additional/common/licenses" | ||
4701 | </literallayout></para> | ||
4702 | </glossdef> | ||
4703 | </glossentry> | ||
4704 | |||
4705 | <glossentry id='var-LINUX_KERNEL_TYPE'><glossterm>LINUX_KERNEL_TYPE</glossterm> | ||
4706 | <glossdef> | ||
4707 | <para> | ||
4708 | Defines the kernel type to be used in assembling the | ||
4709 | configuration. | ||
4710 | The linux-yocto recipes define "standard", "tiny", and | ||
4711 | "preempt-rt" kernel types. | ||
4712 | See the | ||
4713 | "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#kernel-types'>Kernel Types</ulink>" | ||
4714 | section in the Yocto Project Linux Kernel Development | ||
4715 | Manual for more information on kernel types. | ||
4716 | </para> | ||
4717 | |||
4718 | <para> | ||
4719 | If you do not specify a | ||
4720 | <filename>LINUX_KERNEL_TYPE</filename>, it defaults to | ||
4721 | "standard". | ||
4722 | Together with | ||
4723 | <link linkend='var-KMACHINE'><filename>KMACHINE</filename></link>, | ||
4724 | the <filename>LINUX_KERNEL_TYPE</filename> variable | ||
4725 | defines the search | ||
4726 | arguments used by the kernel tools to find the appropriate | ||
4727 | description within the kernel | ||
4728 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> | ||
4729 | with which to build out the sources and configuration. | ||
4730 | </para> | ||
4731 | </glossdef> | ||
4732 | </glossentry> | ||
4733 | |||
4734 | <glossentry id='var-LINUX_VERSION'><glossterm>LINUX_VERSION</glossterm> | ||
4735 | <glossdef> | ||
4736 | <para>The Linux version from <filename>kernel.org</filename> | ||
4737 | on which the Linux kernel image being built using the | ||
4738 | OpenEmbedded build system is based. | ||
4739 | You define this variable in the kernel recipe. | ||
4740 | For example, the <filename>linux-yocto-3.4.bb</filename> | ||
4741 | kernel recipe found in | ||
4742 | <filename>meta/recipes-kernel/linux</filename> | ||
4743 | defines the variables as follows: | ||
4744 | <literallayout class='monospaced'> | ||
4745 | LINUX_VERSION ?= "3.4.24" | ||
4746 | </literallayout> | ||
4747 | The <filename>LINUX_VERSION</filename> variable is used to | ||
4748 | define <link linkend='var-PV'><filename>PV</filename></link> | ||
4749 | for the recipe: | ||
4750 | <literallayout class='monospaced'> | ||
4751 | PV = "${LINUX_VERSION}+git${SRCPV}" | ||
4752 | </literallayout></para> | ||
4753 | </glossdef> | ||
4754 | </glossentry> | ||
4755 | |||
4756 | <glossentry id='var-LINUX_VERSION_EXTENSION'><glossterm>LINUX_VERSION_EXTENSION</glossterm> | ||
4757 | <glossdef> | ||
4758 | <para>A string extension compiled into the version | ||
4759 | string of the Linux kernel built with the OpenEmbedded | ||
4760 | build system. | ||
4761 | You define this variable in the kernel recipe. | ||
4762 | For example, the linux-yocto kernel recipes all define | ||
4763 | the variable as follows: | ||
4764 | <literallayout class='monospaced'> | ||
4765 | LINUX_VERSION_EXTENSION ?= "-yocto-${<link linkend='var-LINUX_KERNEL_TYPE'>LINUX_KERNEL_TYPE</link>}" | ||
4766 | </literallayout> | ||
4767 | Defining this variable essentially sets the | ||
4768 | Linux kernel configuration item | ||
4769 | <filename>CONFIG_LOCALVERSION</filename>, which is visible | ||
4770 | through the <filename>uname</filename> command. | ||
4771 | Here is an example that shows the extension assuming it | ||
4772 | was set as previously shown: | ||
4773 | <literallayout class='monospaced'> | ||
4774 | $ uname -r | ||
4775 | 3.7.0-rc8-custom | ||
4776 | </literallayout> | ||
4777 | </para> | ||
4778 | </glossdef> | ||
4779 | </glossentry> | ||
4780 | |||
4781 | <glossentry id='var-LOG_DIR'><glossterm>LOG_DIR</glossterm> | ||
4782 | <glossdef> | ||
4783 | <para> | ||
4784 | Specifies the directory to which the OpenEmbedded build | ||
4785 | system writes overall log files. | ||
4786 | The default directory is <filename>${TMPDIR}/log</filename>. | ||
4787 | </para> | ||
4788 | <para> | ||
4789 | For the directory containing logs specific to each task, | ||
4790 | see the <link linkend='var-T'><filename>T</filename></link> | ||
4791 | variable. | ||
4792 | </para> | ||
4793 | </glossdef> | ||
4794 | </glossentry> | ||
4795 | |||
4796 | </glossdiv> | ||
4797 | |||
4798 | <glossdiv id='var-glossary-m'><title>M</title> | ||
4799 | |||
4800 | <glossentry id='var-MACHINE'><glossterm>MACHINE</glossterm> | ||
4801 | <glossdef> | ||
4802 | <para> | ||
4803 | Specifies the target device for which the image is built. | ||
4804 | You define <filename>MACHINE</filename> in the | ||
4805 | <filename>local.conf</filename> file found in the | ||
4806 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
4807 | By default, <filename>MACHINE</filename> is set to | ||
4808 | "qemux86", which is an x86-based architecture machine to | ||
4809 | be emulated using QEMU: | ||
4810 | <literallayout class='monospaced'> | ||
4811 | MACHINE ?= "qemux86" | ||
4812 | </literallayout> | ||
4813 | The variable corresponds to a machine configuration file of the | ||
4814 | same name, through which machine-specific configurations are set. | ||
4815 | Thus, when <filename>MACHINE</filename> is set to "qemux86" there | ||
4816 | exists the corresponding <filename>qemux86.conf</filename> machine | ||
4817 | configuration file, which can be found in the | ||
4818 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
4819 | in <filename>meta/conf/machine</filename>. | ||
4820 | </para> | ||
4821 | |||
4822 | <para> | ||
4823 | The list of machines supported by the Yocto Project as | ||
4824 | shipped include the following: | ||
4825 | <literallayout class='monospaced'> | ||
4826 | MACHINE ?= "qemuarm" | ||
4827 | MACHINE ?= "qemumips" | ||
4828 | MACHINE ?= "qemuppc" | ||
4829 | MACHINE ?= "qemux86" | ||
4830 | MACHINE ?= "qemux86-64" | ||
4831 | MACHINE ?= "genericx86" | ||
4832 | MACHINE ?= "genericx86-64" | ||
4833 | MACHINE ?= "beaglebone" | ||
4834 | MACHINE ?= "mpc8315e-rdb" | ||
4835 | MACHINE ?= "edgerouter" | ||
4836 | </literallayout> | ||
4837 | The last five are Yocto Project reference hardware boards, which | ||
4838 | are provided in the <filename>meta-yocto-bsp</filename> layer. | ||
4839 | <note>Adding additional Board Support Package (BSP) layers | ||
4840 | to your configuration adds new possible settings for | ||
4841 | <filename>MACHINE</filename>. | ||
4842 | </note> | ||
4843 | </para> | ||
4844 | </glossdef> | ||
4845 | </glossentry> | ||
4846 | |||
4847 | <glossentry id='var-MACHINE_ARCH'><glossterm>MACHINE_ARCH</glossterm> | ||
4848 | <glossdef> | ||
4849 | <para> | ||
4850 | Specifies the name of the machine-specific architecture. | ||
4851 | This variable is set automatically from | ||
4852 | <link linkend='var-MACHINE'><filename>MACHINE</filename></link> | ||
4853 | or | ||
4854 | <link linkend='var-TUNE_PKGARCH'><filename>TUNE_PKGARCH</filename></link>. | ||
4855 | You should not hand-edit the | ||
4856 | <filename>MACHINE_ARCH</filename> variable. | ||
4857 | </para> | ||
4858 | </glossdef> | ||
4859 | </glossentry> | ||
4860 | |||
4861 | <glossentry id='var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS'><glossterm>MACHINE_ESSENTIAL_EXTRA_RDEPENDS</glossterm> | ||
4862 | <glossdef> | ||
4863 | <para></para> | ||
4864 | <para> | ||
4865 | A list of required machine-specific packages to install as part of | ||
4866 | the image being built. | ||
4867 | The build process depends on these packages being present. | ||
4868 | Furthermore, because this is a "machine essential" variable, the list of | ||
4869 | packages are essential for the machine to boot. | ||
4870 | The impact of this variable affects images based on | ||
4871 | <filename>packagegroup-core-boot</filename>, | ||
4872 | including the <filename>core-image-minimal</filename> image. | ||
4873 | </para> | ||
4874 | <para> | ||
4875 | This variable is similar to the | ||
4876 | <filename><link linkend='var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</link></filename> | ||
4877 | variable with the exception that the image being built has a build | ||
4878 | dependency on the variable's list of packages. | ||
4879 | In other words, the image will not build if a file in this list is not found. | ||
4880 | </para> | ||
4881 | <para> | ||
4882 | As an example, suppose the machine for which you are building requires | ||
4883 | <filename>example-init</filename> to be run during boot to initialize the hardware. | ||
4884 | In this case, you would use the following in the machine's | ||
4885 | <filename>.conf</filename> configuration file: | ||
4886 | <literallayout class='monospaced'> | ||
4887 | MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "example-init" | ||
4888 | </literallayout> | ||
4889 | </para> | ||
4890 | </glossdef> | ||
4891 | </glossentry> | ||
4892 | |||
4893 | <glossentry id='var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'><glossterm>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</glossterm> | ||
4894 | <glossdef> | ||
4895 | <para></para> | ||
4896 | <para> | ||
4897 | A list of recommended machine-specific packages to install as part of | ||
4898 | the image being built. | ||
4899 | The build process does not depend on these packages being present. | ||
4900 | However, because this is a "machine essential" variable, the list of | ||
4901 | packages are essential for the machine to boot. | ||
4902 | The impact of this variable affects images based on | ||
4903 | <filename>packagegroup-core-boot</filename>, | ||
4904 | including the <filename>core-image-minimal</filename> image. | ||
4905 | </para> | ||
4906 | <para> | ||
4907 | This variable is similar to the | ||
4908 | <filename><link linkend='var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS'>MACHINE_ESSENTIAL_EXTRA_RDEPENDS</link></filename> | ||
4909 | variable with the exception that the image being built does not have a build | ||
4910 | dependency on the variable's list of packages. | ||
4911 | In other words, the image will still build if a package in this list is not found. | ||
4912 | Typically, this variable is used to handle essential kernel modules, whose | ||
4913 | functionality may be selected to be built into the kernel rather than as a module, | ||
4914 | in which case a package will not be produced. | ||
4915 | </para> | ||
4916 | <para> | ||
4917 | Consider an example where you have a custom kernel where a specific touchscreen | ||
4918 | driver is required for the machine to be usable. | ||
4919 | However, the driver can be built as a module or | ||
4920 | into the kernel depending on the kernel configuration. | ||
4921 | If the driver is built as a module, you want it to be installed. | ||
4922 | But, when the driver is built into the kernel, you still want the | ||
4923 | build to succeed. | ||
4924 | This variable sets up a "recommends" relationship so that in the latter case, | ||
4925 | the build will not fail due to the missing package. | ||
4926 | To accomplish this, assuming the package for the module was called | ||
4927 | <filename>kernel-module-ab123</filename>, you would use the | ||
4928 | following in the machine's <filename>.conf</filename> configuration | ||
4929 | file: | ||
4930 | <literallayout class='monospaced'> | ||
4931 | MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-module-ab123" | ||
4932 | </literallayout> | ||
4933 | </para> | ||
4934 | <para> | ||
4935 | Some examples of these machine essentials are flash, screen, keyboard, mouse, | ||
4936 | or touchscreen drivers (depending on the machine). | ||
4937 | </para> | ||
4938 | </glossdef> | ||
4939 | </glossentry> | ||
4940 | |||
4941 | <glossentry id='var-MACHINE_EXTRA_RDEPENDS'><glossterm>MACHINE_EXTRA_RDEPENDS</glossterm> | ||
4942 | <glossdef> | ||
4943 | <para> | ||
4944 | A list of machine-specific packages to install as part of the | ||
4945 | image being built that are not essential for the machine to boot. | ||
4946 | However, the build process for more fully-featured images | ||
4947 | depends on the packages being present. | ||
4948 | </para> | ||
4949 | <para> | ||
4950 | This variable affects all images based on | ||
4951 | <filename>packagegroup-base</filename>, which does not include the | ||
4952 | <filename>core-image-minimal</filename> or <filename>core-image-full-cmdline</filename> | ||
4953 | images. | ||
4954 | </para> | ||
4955 | <para> | ||
4956 | The variable is similar to the | ||
4957 | <filename><link linkend='var-MACHINE_EXTRA_RRECOMMENDS'>MACHINE_EXTRA_RRECOMMENDS</link></filename> | ||
4958 | variable with the exception that the image being built has a build | ||
4959 | dependency on the variable's list of packages. | ||
4960 | In other words, the image will not build if a file in this list is not found. | ||
4961 | </para> | ||
4962 | <para> | ||
4963 | An example is a machine that has WiFi capability but is not | ||
4964 | essential for the machine to boot the image. | ||
4965 | However, if you are building a more fully-featured image, you want to enable | ||
4966 | the WiFi. | ||
4967 | The package containing the firmware for the WiFi hardware is always | ||
4968 | expected to exist, so it is acceptable for the build process to depend upon | ||
4969 | finding the package. | ||
4970 | In this case, assuming the package for the firmware was called | ||
4971 | <filename>wifidriver-firmware</filename>, you would use the following in the | ||
4972 | <filename>.conf</filename> file for the machine: | ||
4973 | <literallayout class='monospaced'> | ||
4974 | MACHINE_EXTRA_RDEPENDS += "wifidriver-firmware" | ||
4975 | </literallayout> | ||
4976 | </para> | ||
4977 | </glossdef> | ||
4978 | </glossentry> | ||
4979 | |||
4980 | <glossentry id='var-MACHINE_EXTRA_RRECOMMENDS'><glossterm>MACHINE_EXTRA_RRECOMMENDS</glossterm> | ||
4981 | <glossdef> | ||
4982 | <para></para> | ||
4983 | <para> | ||
4984 | A list of machine-specific packages to install as part of the | ||
4985 | image being built that are not essential for booting the machine. | ||
4986 | The image being built has no build dependency on this list of packages. | ||
4987 | </para> | ||
4988 | <para> | ||
4989 | This variable affects only images based on | ||
4990 | <filename>packagegroup-base</filename>, which does not include the | ||
4991 | <filename>core-image-minimal</filename> or <filename>core-image-full-cmdline</filename> | ||
4992 | images. | ||
4993 | </para> | ||
4994 | <para> | ||
4995 | This variable is similar to the | ||
4996 | <filename><link linkend='var-MACHINE_EXTRA_RDEPENDS'>MACHINE_EXTRA_RDEPENDS</link></filename> | ||
4997 | variable with the exception that the image being built does not have a build | ||
4998 | dependency on the variable's list of packages. | ||
4999 | In other words, the image will build if a file in this list is not found. | ||
5000 | </para> | ||
5001 | <para> | ||
5002 | An example is a machine that has WiFi capability but is not essential | ||
5003 | For the machine to boot the image. | ||
5004 | However, if you are building a more fully-featured image, you want to enable | ||
5005 | WiFi. | ||
5006 | In this case, the package containing the WiFi kernel module will not be produced | ||
5007 | if the WiFi driver is built into the kernel, in which case you still want the | ||
5008 | build to succeed instead of failing as a result of the package not being found. | ||
5009 | To accomplish this, assuming the package for the module was called | ||
5010 | <filename>kernel-module-examplewifi</filename>, you would use the | ||
5011 | following in the <filename>.conf</filename> file for the machine: | ||
5012 | <literallayout class='monospaced'> | ||
5013 | MACHINE_EXTRA_RRECOMMENDS += "kernel-module-examplewifi" | ||
5014 | </literallayout> | ||
5015 | </para> | ||
5016 | </glossdef> | ||
5017 | </glossentry> | ||
5018 | |||
5019 | <glossentry id='var-MACHINE_FEATURES'><glossterm>MACHINE_FEATURES</glossterm> | ||
5020 | <glossdef> | ||
5021 | <para> | ||
5022 | Specifies the list of hardware features the | ||
5023 | <link linkend='var-MACHINE'><filename>MACHINE</filename></link> is capable | ||
5024 | of supporting. | ||
5025 | For related information on enabling features, see the | ||
5026 | <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>, | ||
5027 | <link linkend='var-COMBINED_FEATURES'><filename>COMBINED_FEATURES</filename></link>, | ||
5028 | and | ||
5029 | <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link> | ||
5030 | variables. | ||
5031 | </para> | ||
5032 | |||
5033 | <para> | ||
5034 | For a list of hardware features supported by the Yocto | ||
5035 | Project as shipped, see the | ||
5036 | "<link linkend='ref-features-machine'>Machine Features</link>" | ||
5037 | section. | ||
5038 | </para> | ||
5039 | </glossdef> | ||
5040 | </glossentry> | ||
5041 | |||
5042 | <glossentry id='var-MACHINE_FEATURES_BACKFILL'><glossterm>MACHINE_FEATURES_BACKFILL</glossterm> | ||
5043 | <glossdef> | ||
5044 | <para>Features to be added to | ||
5045 | <filename><link linkend='var-MACHINE_FEATURES'>MACHINE_FEATURES</link></filename> | ||
5046 | if not also present in | ||
5047 | <filename><link linkend='var-MACHINE_FEATURES_BACKFILL_CONSIDERED'>MACHINE_FEATURES_BACKFILL_CONSIDERED</link></filename>. | ||
5048 | </para> | ||
5049 | |||
5050 | <para> | ||
5051 | This variable is set in the <filename>meta/conf/bitbake.conf</filename> file. | ||
5052 | It is not intended to be user-configurable. | ||
5053 | It is best to just reference the variable to see which machine features are | ||
5054 | being backfilled for all machine configurations. | ||
5055 | See the "<link linkend='ref-features-backfill'>Feature backfilling</link>" section for | ||
5056 | more information. | ||
5057 | </para> | ||
5058 | </glossdef> | ||
5059 | </glossentry> | ||
5060 | |||
5061 | <glossentry id='var-MACHINE_FEATURES_BACKFILL_CONSIDERED'><glossterm>MACHINE_FEATURES_BACKFILL_CONSIDERED</glossterm> | ||
5062 | <glossdef> | ||
5063 | <para>Features from | ||
5064 | <filename><link linkend='var-MACHINE_FEATURES_BACKFILL'>MACHINE_FEATURES_BACKFILL</link></filename> | ||
5065 | that should not be backfilled (i.e. added to | ||
5066 | <filename><link linkend='var-MACHINE_FEATURES'>MACHINE_FEATURES</link></filename>) | ||
5067 | during the build. | ||
5068 | See the "<link linkend='ref-features-backfill'>Feature backfilling</link>" section for | ||
5069 | more information. | ||
5070 | </para> | ||
5071 | </glossdef> | ||
5072 | </glossentry> | ||
5073 | |||
5074 | <glossentry id='var-MACHINEOVERRIDES'><glossterm>MACHINEOVERRIDES</glossterm> | ||
5075 | <glossdef> | ||
5076 | <para> | ||
5077 | Lists overrides specific to the current machine. | ||
5078 | By default, this list includes the value | ||
5079 | of <filename><link linkend='var-MACHINE'>MACHINE</link></filename>. | ||
5080 | You can extend the list to apply variable overrides for | ||
5081 | classes of machines. | ||
5082 | For example, all QEMU emulated machines (e.g. qemuarm, | ||
5083 | qemux86, and so forth) include a common file named | ||
5084 | <filename>meta/conf/machine/include/qemu.inc</filename> | ||
5085 | that prepends <filename>MACHINEOVERRIDES</filename> with | ||
5086 | the following variable override: | ||
5087 | <literallayout class='monospaced'> | ||
5088 | MACHINEOVERRIDES =. "qemuall:" | ||
5089 | </literallayout> | ||
5090 | Applying an override like <filename>qemuall</filename> | ||
5091 | affects all QEMU emulated machines elsewhere. | ||
5092 | Here is an example from the | ||
5093 | <filename>connman-conf</filename> recipe: | ||
5094 | <literallayout class='monospaced'> | ||
5095 | SRC_URI_append_qemuall = "file://wired.config \ | ||
5096 | file://wired-setup \ | ||
5097 | " | ||
5098 | </literallayout> | ||
5099 | </para> | ||
5100 | </glossdef> | ||
5101 | </glossentry> | ||
5102 | |||
5103 | <glossentry id='var-MAINTAINER'><glossterm>MAINTAINER</glossterm> | ||
5104 | <glossdef> | ||
5105 | <para>The email address of the distribution maintainer.</para> | ||
5106 | </glossdef> | ||
5107 | </glossentry> | ||
5108 | |||
5109 | <glossentry id='var-MIRRORS'><glossterm>MIRRORS</glossterm> | ||
5110 | <glossdef> | ||
5111 | <para> | ||
5112 | Specifies additional paths from which the OpenEmbedded | ||
5113 | build system gets source code. | ||
5114 | When the build system searches for source code, it first | ||
5115 | tries the local download directory. | ||
5116 | If that location fails, the build system tries locations | ||
5117 | defined by | ||
5118 | <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>, | ||
5119 | the upstream source, and then locations specified by | ||
5120 | <filename>MIRRORS</filename> in that order. | ||
5121 | </para> | ||
5122 | |||
5123 | <para> | ||
5124 | Assuming your distribution | ||
5125 | (<link linkend='var-DISTRO'><filename>DISTRO</filename></link>) | ||
5126 | is "poky", the default value for | ||
5127 | <filename>MIRRORS</filename> is defined in the | ||
5128 | <filename>conf/distro/poky.conf</filename> file in the | ||
5129 | <filename>meta-yocto</filename> Git repository. | ||
5130 | </para> | ||
5131 | </glossdef> | ||
5132 | </glossentry> | ||
5133 | |||
5134 | <glossentry id='var-MLPREFIX'><glossterm>MLPREFIX</glossterm> | ||
5135 | <glossdef> | ||
5136 | <para> | ||
5137 | Specifies a prefix has been added to | ||
5138 | <link linkend='var-PN'><filename>PN</filename></link> to create a special version | ||
5139 | of a recipe or package, such as a Multilib version. | ||
5140 | The variable is used in places where the prefix needs to be | ||
5141 | added to or removed from a the name (e.g. the | ||
5142 | <link linkend='var-BPN'><filename>BPN</filename></link> variable). | ||
5143 | <filename>MLPREFIX</filename> gets set when a prefix has been | ||
5144 | added to <filename>PN</filename>. | ||
5145 | </para> | ||
5146 | </glossdef> | ||
5147 | </glossentry> | ||
5148 | |||
5149 | <glossentry id='var-module_autoload'><glossterm>module_autoload</glossterm> | ||
5150 | <glossdef> | ||
5151 | <para> | ||
5152 | Lists kernel modules that need to be auto-loaded during | ||
5153 | boot. | ||
5154 | </para> | ||
5155 | |||
5156 | <para> | ||
5157 | You can use this variable anywhere that it can be | ||
5158 | recognized by the kernel recipe or out-of-tree kernel | ||
5159 | module recipe (e.g. a machine configuration file, a | ||
5160 | distribution configuration file, an append file for the | ||
5161 | recipe, or the recipe itself). | ||
5162 | </para> | ||
5163 | |||
5164 | <para> | ||
5165 | Specify it as follows: | ||
5166 | <literallayout class='monospaced'> | ||
5167 | module_autoload_<modname> = "modname1 modname2 modname3" | ||
5168 | </literallayout> | ||
5169 | You must use the kernel module name override. | ||
5170 | </para> | ||
5171 | |||
5172 | <para> | ||
5173 | Including <filename>module_autoload</filename> causes the | ||
5174 | OpenEmbedded build system to populate the | ||
5175 | <filename>/etc/modules-load.d/modname.conf</filename> | ||
5176 | file with the list of modules to be auto-loaded on boot. | ||
5177 | The modules appear one-per-line in the file. | ||
5178 | Here is an example of the most common use case: | ||
5179 | <literallayout class='monospaced'> | ||
5180 | module_autoload_modname = "modname" | ||
5181 | </literallayout> | ||
5182 | </para> | ||
5183 | |||
5184 | <para> | ||
5185 | For information on how to populate the | ||
5186 | <filename>modname.conf</filename> file with | ||
5187 | <filename>modprobe.d</filename> syntax lines, see the | ||
5188 | <link linkend='var-module_conf'><filename>module_conf</filename></link> | ||
5189 | variable. | ||
5190 | </para> | ||
5191 | </glossdef> | ||
5192 | </glossentry> | ||
5193 | |||
5194 | <glossentry id='var-module_conf'><glossterm>module_conf</glossterm> | ||
5195 | <glossdef> | ||
5196 | <para> | ||
5197 | Specifies <filename>modprobe.d</filename> syntax lines | ||
5198 | for inclusion in the | ||
5199 | <filename>/etc/modprobe.d/modname.conf</filename> file. | ||
5200 | </para> | ||
5201 | |||
5202 | <para> | ||
5203 | You can use this variable anywhere that it can be | ||
5204 | recognized by the kernel recipe or out-of-tree kernel | ||
5205 | module recipe (e.g. a machine configuration file, a | ||
5206 | distribution configuration file, an append file for the | ||
5207 | recipe, or the recipe itself). | ||
5208 | </para> | ||
5209 | |||
5210 | <para> | ||
5211 | Here is the general syntax: | ||
5212 | <literallayout class='monospaced'> | ||
5213 | module_conf_<modname> = "modprobe.d-syntax" | ||
5214 | </literallayout> | ||
5215 | You must use the kernel module name override. | ||
5216 | </para> | ||
5217 | |||
5218 | <para> | ||
5219 | Run <filename>man modprobe.d</filename> in the shell to | ||
5220 | find out more information on the exact syntax for lines | ||
5221 | you want to provide with <filename>module_conf</filename>. | ||
5222 | </para> | ||
5223 | |||
5224 | <para> | ||
5225 | Including <filename>module_conf</filename> causes the | ||
5226 | OpenEmbedded build system to populate the | ||
5227 | <filename>/etc/modprobe.d/modname.conf</filename> | ||
5228 | file with <filename>modprobe.d</filename> syntax lines. | ||
5229 | Here is an example: | ||
5230 | <literallayout class='monospaced'> | ||
5231 | module_conf_<modname> = "options modname arg1=val1 arg2=val2" | ||
5232 | </literallayout> | ||
5233 | </para> | ||
5234 | |||
5235 | <para> | ||
5236 | For information on how to specify kernel modules to | ||
5237 | auto-load on boot, see the | ||
5238 | <link linkend='var-module_autoload'><filename>module_autoload</filename></link> | ||
5239 | variable. | ||
5240 | </para> | ||
5241 | </glossdef> | ||
5242 | </glossentry> | ||
5243 | |||
5244 | <glossentry id='var-MODULE_IMAGE_BASE_NAME'><glossterm>MODULE_IMAGE_BASE_NAME</glossterm> | ||
5245 | <glossdef> | ||
5246 | <para> | ||
5247 | The base name of the kernel modules tarball. | ||
5248 | This variable is set in the | ||
5249 | <link linkend='ref-classes-kernel'>kernel</link> class | ||
5250 | as follows: | ||
5251 | <literallayout class='monospaced'> | ||
5252 | MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" | ||
5253 | </literallayout> | ||
5254 | See the | ||
5255 | <link linkend='var-PKGE'><filename>PKGE</filename></link>, | ||
5256 | <link linkend='var-PKGV'><filename>PKGV</filename></link>, | ||
5257 | <link linkend='var-PKGR'><filename>PKGR</filename></link>, | ||
5258 | <link linkend='var-MACHINE'><filename>MACHINE</filename></link>, | ||
5259 | and | ||
5260 | <link linkend='var-DATETIME'><filename>DATETIME</filename></link> | ||
5261 | variables for additional information. | ||
5262 | </para> | ||
5263 | </glossdef> | ||
5264 | </glossentry> | ||
5265 | |||
5266 | <glossentry id='var-MODULE_TARBALL_DEPLOY'><glossterm>MODULE_TARBALL_DEPLOY</glossterm> | ||
5267 | <glossdef> | ||
5268 | <para> | ||
5269 | Controls creation of the <filename>modules-*.tgz</filename> | ||
5270 | file. | ||
5271 | Set this variable to "0" to disable creation of this | ||
5272 | file, which contains all of the kernel modules resulting | ||
5273 | from a kernel build. | ||
5274 | </para> | ||
5275 | </glossdef> | ||
5276 | </glossentry> | ||
5277 | |||
5278 | <glossentry id='var-MULTIMACH_TARGET_SYS'><glossterm>MULTIMACH_TARGET_SYS</glossterm> | ||
5279 | <glossdef> | ||
5280 | <para> | ||
5281 | Separates files for different machines such that you can build | ||
5282 | for multiple target machines using the same output directories. | ||
5283 | See the <link linkend='var-STAMP'><filename>STAMP</filename></link> variable | ||
5284 | for an example. | ||
5285 | </para> | ||
5286 | </glossdef> | ||
5287 | </glossentry> | ||
5288 | |||
5289 | </glossdiv> | ||
5290 | |||
5291 | <glossdiv id='var-glossary-n'><title>N</title> | ||
5292 | |||
5293 | <glossentry id='var-NATIVELSBSTRING'><glossterm>NATIVELSBSTRING</glossterm> | ||
5294 | <glossdef> | ||
5295 | <para> | ||
5296 | A string identifying the host distribution. | ||
5297 | Strings consist of the host distributor ID | ||
5298 | followed by the release, as reported by the | ||
5299 | <filename>lsb_release</filename> tool | ||
5300 | or as read from <filename>/etc/lsb-release</filename>. | ||
5301 | For example, when running a build on Ubuntu 12.10, the value | ||
5302 | is "Ubuntu-12.10". | ||
5303 | If this information is unable to be determined, the value | ||
5304 | resolves to "Unknown". | ||
5305 | </para> | ||
5306 | <para> | ||
5307 | This variable is used by default to isolate native shared | ||
5308 | state packages for different distributions (e.g. to avoid | ||
5309 | problems with <filename>glibc</filename> version | ||
5310 | incompatibilities). | ||
5311 | Additionally, the variable is checked against | ||
5312 | <link linkend='var-SANITY_TESTED_DISTROS'><filename>SANITY_TESTED_DISTROS</filename></link> | ||
5313 | if that variable is set. | ||
5314 | </para> | ||
5315 | </glossdef> | ||
5316 | </glossentry> | ||
5317 | |||
5318 | <glossentry id='var-NO_RECOMMENDATIONS'><glossterm>NO_RECOMMENDATIONS</glossterm> | ||
5319 | <glossdef> | ||
5320 | <para> | ||
5321 | Prevents installation of all "recommended-only" packages. | ||
5322 | Recommended-only packages are packages installed only | ||
5323 | through the | ||
5324 | <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link> | ||
5325 | variable). | ||
5326 | Setting the <filename>NO_RECOMMENDATIONS</filename> variable | ||
5327 | to "1" turns this feature on: | ||
5328 | <literallayout class='monospaced'> | ||
5329 | NO_RECOMMENDATIONS = "1" | ||
5330 | </literallayout> | ||
5331 | You can set this variable globally in your | ||
5332 | <filename>local.conf</filename> file or you can attach it to | ||
5333 | a specific image recipe by using the recipe name override: | ||
5334 | <literallayout class='monospaced'> | ||
5335 | NO_RECOMMENDATIONS_pn-<target_image> = "<package_name>" | ||
5336 | </literallayout> | ||
5337 | </para> | ||
5338 | |||
5339 | <para> | ||
5340 | It is important to realize that if you choose to not install | ||
5341 | packages using this variable and some other packages are | ||
5342 | dependent on them (i.e. listed in a recipe's | ||
5343 | <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link> | ||
5344 | variable), the OpenEmbedded build system ignores your | ||
5345 | request and will install the packages to avoid dependency | ||
5346 | errors. | ||
5347 | <note> | ||
5348 | Some recommended packages might be required for certain | ||
5349 | system functionality, such as kernel modules. | ||
5350 | It is up to you to add packages with the | ||
5351 | <link linkend='var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></link> | ||
5352 | variable. | ||
5353 | </note> | ||
5354 | </para> | ||
5355 | |||
5356 | <para> | ||
5357 | Support for this variable exists only when using the | ||
5358 | IPK and RPM packaging backend. | ||
5359 | Support does not exist for DEB. | ||
5360 | </para> | ||
5361 | |||
5362 | <para> | ||
5363 | See the | ||
5364 | <link linkend='var-BAD_RECOMMENDATIONS'><filename>BAD_RECOMMENDATIONS</filename></link> | ||
5365 | and the | ||
5366 | <link linkend='var-PACKAGE_EXCLUDE'><filename>PACKAGE_EXCLUDE</filename></link> | ||
5367 | variables for related information. | ||
5368 | </para> | ||
5369 | </glossdef> | ||
5370 | </glossentry> | ||
5371 | |||
5372 | <glossentry id='var-NOHDD'><glossterm>NOHDD</glossterm> | ||
5373 | <glossdef> | ||
5374 | <para> | ||
5375 | Causes the OpenEmbedded build system to skip building the | ||
5376 | <filename>.hddimg</filename> image. | ||
5377 | The <filename>NOHDD</filename> variable is used with the | ||
5378 | <link linkend='ref-classes-bootimg'><filename>bootimg</filename></link> | ||
5379 | class. | ||
5380 | Set the variable to "1" to prevent the | ||
5381 | <filename>.hddimg</filename> image from being built. | ||
5382 | </para> | ||
5383 | </glossdef> | ||
5384 | </glossentry> | ||
5385 | |||
5386 | <glossentry id='var-NOISO'><glossterm>NOISO</glossterm> | ||
5387 | <glossdef> | ||
5388 | <para> | ||
5389 | Causes the OpenEmbedded build system to skip building the | ||
5390 | ISO image. | ||
5391 | The <filename>NOISO</filename> variable is used with the | ||
5392 | <link linkend='ref-classes-bootimg'><filename>bootimg</filename></link> | ||
5393 | class. | ||
5394 | Set the variable to "1" to prevent the ISO image from | ||
5395 | being built. | ||
5396 | To enable building an ISO image, set the variable to "0". | ||
5397 | </para> | ||
5398 | </glossdef> | ||
5399 | </glossentry> | ||
5400 | |||
5401 | </glossdiv> | ||
5402 | |||
5403 | <glossdiv id='var-glossary-o'><title>O</title> | ||
5404 | |||
5405 | <glossentry id='var-OE_BINCONFIG_EXTRA_MANGLE'><glossterm>OE_BINCONFIG_EXTRA_MANGLE</glossterm> | ||
5406 | <glossdef> | ||
5407 | <para> | ||
5408 | When a recipe inherits the | ||
5409 | <filename>binconfig.bbclass</filename> class, this variable | ||
5410 | specifies additional arguments passed to the "sed" command. | ||
5411 | The sed command alters any paths in configuration scripts | ||
5412 | that have been set up during compilation. | ||
5413 | Inheriting this class results in all paths in these scripts | ||
5414 | being changed to point into the | ||
5415 | <filename>sysroots/</filename> directory so that all builds | ||
5416 | that use the script will use the correct directories | ||
5417 | for the cross compiling layout. | ||
5418 | </para> | ||
5419 | |||
5420 | <para> | ||
5421 | See the <filename>meta/classes/binconfig.bbclass</filename> | ||
5422 | in the | ||
5423 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
5424 | for details on how this class applies these additional | ||
5425 | sed command arguments. | ||
5426 | For general information on the | ||
5427 | <filename>binconfig.bbclass</filename> class, see the | ||
5428 | "<link linkend='ref-classes-binconfig'>Binary Configuration Scripts - <filename>binconfig.bbclass</filename></link>" | ||
5429 | section. | ||
5430 | </para> | ||
5431 | </glossdef> | ||
5432 | </glossentry> | ||
5433 | |||
5434 | <glossentry id='var-OE_IMPORTS'><glossterm>OE_IMPORTS</glossterm> | ||
5435 | <glossdef> | ||
5436 | <para> | ||
5437 | An internal variable used to tell the OpenEmbedded build | ||
5438 | system what Python modules to import for every Python | ||
5439 | function run by the system. | ||
5440 | </para> | ||
5441 | |||
5442 | <note> | ||
5443 | Do not set this variable. | ||
5444 | It is for internal use only. | ||
5445 | </note> | ||
5446 | </glossdef> | ||
5447 | </glossentry> | ||
5448 | |||
5449 | <glossentry id='var-OE_TERMINAL'><glossterm>OE_TERMINAL</glossterm> | ||
5450 | <glossdef> | ||
5451 | <para> | ||
5452 | Controls how the OpenEmbedded build system spawns | ||
5453 | interactive terminals on the host development system | ||
5454 | (e.g. using the BitBake command with the | ||
5455 | <filename>-c devshell</filename> command-line option). | ||
5456 | For more information, see the | ||
5457 | "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-devshell'>Using a Development Shell</ulink>" section | ||
5458 | in the Yocto Project Development Manual. | ||
5459 | </para> | ||
5460 | |||
5461 | <para> | ||
5462 | You can use the following values for the | ||
5463 | <filename>OE_TERMINAL</filename> variable: | ||
5464 | <literallayout class='monospaced'> | ||
5465 | auto | ||
5466 | gnome | ||
5467 | xfce | ||
5468 | rxvt | ||
5469 | screen | ||
5470 | konsole | ||
5471 | none | ||
5472 | </literallayout> | ||
5473 | <note>Konsole support only works for KDE 3.x. | ||
5474 | Also, "auto" is the default behavior for | ||
5475 | <filename>OE_TERMINAL</filename></note> | ||
5476 | </para> | ||
5477 | </glossdef> | ||
5478 | </glossentry> | ||
5479 | |||
5480 | <glossentry id='var-OEROOT'><glossterm>OEROOT</glossterm> | ||
5481 | <glossdef> | ||
5482 | <para> | ||
5483 | The directory from which the top-level build environment | ||
5484 | setup script is sourced. | ||
5485 | The Yocto Project makes two top-level build environment | ||
5486 | setup scripts available: | ||
5487 | <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link> | ||
5488 | and | ||
5489 | <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>. | ||
5490 | When you run one of these scripts, the | ||
5491 | <filename>OEROOT</filename> variable resolves to the | ||
5492 | directory that contains the script. | ||
5493 | </para> | ||
5494 | |||
5495 | <para> | ||
5496 | For additional information on how this variable is used, | ||
5497 | see the initialization scripts. | ||
5498 | </para> | ||
5499 | </glossdef> | ||
5500 | </glossentry> | ||
5501 | |||
5502 | <glossentry id='var-OLDEST_KERNEL'><glossterm>OLDEST_KERNEL</glossterm> | ||
5503 | <glossdef> | ||
5504 | <para> | ||
5505 | Declares the oldest version of the Linux kernel that the | ||
5506 | produced binaries must support. | ||
5507 | This variable is passed into the build of the Embedded | ||
5508 | GNU C Library (<filename>eglibc</filename>). | ||
5509 | </para> | ||
5510 | |||
5511 | <para> | ||
5512 | The default for this variable comes from the | ||
5513 | <filename>meta/conf/bitbake.conf</filename> configuration | ||
5514 | file. | ||
5515 | You can override this default by setting the variable | ||
5516 | in a custom distribution configuration file. | ||
5517 | </para> | ||
5518 | </glossdef> | ||
5519 | </glossentry> | ||
5520 | |||
5521 | <glossentry id='var-OVERRIDES'><glossterm>OVERRIDES</glossterm> | ||
5522 | <glossdef> | ||
5523 | <para> | ||
5524 | BitBake uses <filename>OVERRIDES</filename> to control | ||
5525 | what variables are overridden after BitBake parses | ||
5526 | recipes and configuration files. | ||
5527 | You can find more information on how overrides are handled | ||
5528 | in the BitBake Manual that is located at | ||
5529 | <filename>bitbake/doc/manual</filename> in the | ||
5530 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
5531 | </para> | ||
5532 | </glossdef> | ||
5533 | </glossentry> | ||
5534 | </glossdiv> | ||
5535 | |||
5536 | <glossdiv id='var-glossary-p'><title>P</title> | ||
5537 | |||
5538 | <glossentry id='var-P'><glossterm>P</glossterm> | ||
5539 | <glossdef> | ||
5540 | <para>The recipe name and version. | ||
5541 | <filename>P</filename> is comprised of the following: | ||
5542 | <literallayout class='monospaced'> | ||
5543 | ${PN}-${PV} | ||
5544 | </literallayout></para> | ||
5545 | </glossdef> | ||
5546 | </glossentry> | ||
5547 | |||
5548 | <glossentry id='var-PACKAGE_ARCH'><glossterm>PACKAGE_ARCH</glossterm> | ||
5549 | <glossdef> | ||
5550 | <para> | ||
5551 | The architecture of the resulting package or packages. | ||
5552 | </para> | ||
5553 | |||
5554 | <para> | ||
5555 | By default, the value of this variable is set to | ||
5556 | <link linkend='var-TUNE_PKGARCH'><filename>TUNE_PKGARCH</filename></link> | ||
5557 | when building for the target, | ||
5558 | <filename>BUILD_ARCH</filename> when building for the | ||
5559 | build host and "${SDK_ARCH}-${SDKPKGSUFFIX}" when building | ||
5560 | for the SDK. | ||
5561 | However, if your recipe's output packages are built | ||
5562 | specific to the target machine rather than general for | ||
5563 | the architecture of the machine, you should set | ||
5564 | <filename>PACKAGE_ARCH</filename> to the value of | ||
5565 | <link linkend='var-MACHINE_ARCH'><filename>MACHINE_ARCH</filename></link> | ||
5566 | in the recipe as follows: | ||
5567 | <literallayout class='monospaced'> | ||
5568 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
5569 | </literallayout> | ||
5570 | </para> | ||
5571 | </glossdef> | ||
5572 | </glossentry> | ||
5573 | |||
5574 | <glossentry id='var-PACKAGE_ARCHS'><glossterm>PACKAGE_ARCHS</glossterm> | ||
5575 | <glossdef> | ||
5576 | <para> | ||
5577 | Specifies a list of architectures compatible with | ||
5578 | the target machine. | ||
5579 | This variable is set automatically and should not | ||
5580 | normally be hand-edited. | ||
5581 | Entries are separated using spaces and listed in order | ||
5582 | of priority. | ||
5583 | The default value for | ||
5584 | <filename>PACKAGE_ARCHS</filename> is "all any noarch | ||
5585 | ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}". | ||
5586 | </para> | ||
5587 | </glossdef> | ||
5588 | </glossentry> | ||
5589 | |||
5590 | |||
5591 | |||
5592 | <glossentry id='var-PACKAGE_BEFORE_PN'><glossterm>PACKAGE_BEFORE_PN</glossterm> | ||
5593 | <glossdef> | ||
5594 | <para>Enables easily adding packages to | ||
5595 | <filename><link linkend='var-PACKAGES'>PACKAGES</link></filename> | ||
5596 | before <filename>${<link linkend='var-PN'>PN</link>}</filename> | ||
5597 | so that those added packages can pick up files that would normally be | ||
5598 | included in the default package.</para> | ||
5599 | </glossdef> | ||
5600 | </glossentry> | ||
5601 | |||
5602 | <glossentry id='var-PACKAGE_CLASSES'><glossterm>PACKAGE_CLASSES</glossterm> | ||
5603 | <glossdef> | ||
5604 | <para> | ||
5605 | This variable, which is set in the | ||
5606 | <filename>local.conf</filename> configuration file found in | ||
5607 | the <filename>conf</filename> folder of the | ||
5608 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>, | ||
5609 | specifies the package manager the OpenEmbedded build system | ||
5610 | uses when packaging data. | ||
5611 | </para> | ||
5612 | |||
5613 | <para> | ||
5614 | You can provide one or more of the following arguments for | ||
5615 | the variable: | ||
5616 | <literallayout class='monospaced'> | ||
5617 | PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk package_tar" | ||
5618 | </literallayout> | ||
5619 | The build system uses only the first argument in the list | ||
5620 | as the package manager when creating your image or SDK. | ||
5621 | However, packages will be created using any additional | ||
5622 | packaging classes you specify. | ||
5623 | For example, if you use the following in your | ||
5624 | <filename>local.conf</filename> file: | ||
5625 | <literallayout class='monospaced'> | ||
5626 | PACKAGE_CLASSES ?= "package_ipk package_tar" | ||
5627 | </literallayout> | ||
5628 | The OpenEmbedded build system uses the IPK package manager | ||
5629 | to create your image or SDK as well as generating | ||
5630 | TAR packages. | ||
5631 | </para> | ||
5632 | |||
5633 | <para> | ||
5634 | You cannot specify the | ||
5635 | <link linkend='ref-classes-package_tar'><filename>package_tar</filename></link> | ||
5636 | class first in the list. | ||
5637 | Files using the <filename>.tar</filename> format cannot | ||
5638 | be used as a substitute packaging format | ||
5639 | for DEB, RPM, and IPK formatted files for your image or SDK. | ||
5640 | </para> | ||
5641 | |||
5642 | <para> | ||
5643 | For information on packaging and build performance effects | ||
5644 | as a result of the package manager in use, see the | ||
5645 | "<link linkend='ref-classes-package'><filename>package.bbclass</filename></link>" | ||
5646 | section. | ||
5647 | </para> | ||
5648 | </glossdef> | ||
5649 | </glossentry> | ||
5650 | |||
5651 | <glossentry id='var-PACKAGE_EXCLUDE'><glossterm>PACKAGE_EXCLUDE</glossterm> | ||
5652 | <glossdef> | ||
5653 | <para> | ||
5654 | Lists packages that should not be installed into an image. | ||
5655 | For example: | ||
5656 | <literallayout class='monospaced'> | ||
5657 | PACKAGE_EXCLUDE = "<package_name> <package_name> <package_name> ..." | ||
5658 | </literallayout> | ||
5659 | You can set this variable globally in your | ||
5660 | <filename>local.conf</filename> file or you can attach it to | ||
5661 | a specific image recipe by using the recipe name override: | ||
5662 | <literallayout class='monospaced'> | ||
5663 | PACKAGE_EXCLUDE_pn-<target_image> = "<package_name>" | ||
5664 | </literallayout> | ||
5665 | </para> | ||
5666 | |||
5667 | <para> | ||
5668 | If you choose to not install | ||
5669 | a package using this variable and some other package is | ||
5670 | dependent on it (i.e. listed in a recipe's | ||
5671 | <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link> | ||
5672 | variable), the OpenEmbedded build system generates a fatal | ||
5673 | installation error. | ||
5674 | Because the build system halts the process with a fatal | ||
5675 | error, you can use the variable with an iterative | ||
5676 | development process to remove specific components from a | ||
5677 | system. | ||
5678 | </para> | ||
5679 | |||
5680 | <para> | ||
5681 | Support for this variable exists only when using the | ||
5682 | IPK and RPM packaging backend. | ||
5683 | Support does not exist for DEB. | ||
5684 | </para> | ||
5685 | |||
5686 | <para> | ||
5687 | See the | ||
5688 | <link linkend='var-NO_RECOMMENDATIONS'><filename>NO_RECOMMENDATIONS</filename></link> | ||
5689 | and the | ||
5690 | <link linkend='var-BAD_RECOMMENDATIONS'><filename>BAD_RECOMMENDATIONS</filename></link> | ||
5691 | variables for related information. | ||
5692 | </para> | ||
5693 | </glossdef> | ||
5694 | </glossentry> | ||
5695 | |||
5696 | <glossentry id='var-PACKAGE_EXTRA_ARCHS'><glossterm>PACKAGE_EXTRA_ARCHS</glossterm> | ||
5697 | <glossdef> | ||
5698 | <para>Specifies the list of architectures compatible with the device CPU. | ||
5699 | This variable is useful when you build for several different devices that use | ||
5700 | miscellaneous processors such as XScale and ARM926-EJS).</para> | ||
5701 | </glossdef> | ||
5702 | </glossentry> | ||
5703 | |||
5704 | <glossentry id='var-PACKAGE_GROUP'><glossterm>PACKAGE_GROUP</glossterm> | ||
5705 | <glossdef> | ||
5706 | |||
5707 | <para> | ||
5708 | The <filename>PACKAGE_GROUP</filename> variable has been | ||
5709 | renamed to | ||
5710 | <link linkend='var-FEATURE_PACKAGES'><filename>FEATURE_PACKAGES</filename></link>. | ||
5711 | See the variable description for | ||
5712 | <filename>FEATURE_PACKAGES</filename> for information. | ||
5713 | </para> | ||
5714 | |||
5715 | <para> | ||
5716 | If if you use the <filename>PACKAGE_GROUP</filename> | ||
5717 | variable, the OpenEmbedded build system issues a warning | ||
5718 | message. | ||
5719 | </para> | ||
5720 | </glossdef> | ||
5721 | </glossentry> | ||
5722 | |||
5723 | <glossentry id='var-PACKAGE_INSTALL'><glossterm>PACKAGE_INSTALL</glossterm> | ||
5724 | <glossdef> | ||
5725 | <para> | ||
5726 | The final list of packages passed to the package manager | ||
5727 | for installation into the image. | ||
5728 | </para> | ||
5729 | |||
5730 | <para> | ||
5731 | Because the package manager controls actual installation | ||
5732 | of all packages, the list of packages passed using | ||
5733 | <filename>PACKAGE_INSTALL</filename> is not the final list | ||
5734 | of packages that are actually installed. | ||
5735 | This variable is internal to the image construction | ||
5736 | code. | ||
5737 | Consequently, in general, you should use the | ||
5738 | <link linkend='var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></link> | ||
5739 | variable to specify packages for installation. | ||
5740 | The exception to this is when working with | ||
5741 | the | ||
5742 | <link linkend='images-core-image-minimal-initramfs'><filename>core-image-minimal-initramfs</filename></link> | ||
5743 | image. | ||
5744 | When working with an initial RAM disk (initramfs) | ||
5745 | image, use the <filename>PACKAGE_INSTALL</filename> | ||
5746 | variable. | ||
5747 | </para> | ||
5748 | </glossdef> | ||
5749 | </glossentry> | ||
5750 | |||
5751 | <glossentry id='var-PACKAGE_PREPROCESS_FUNCS'><glossterm>PACKAGE_PREPROCESS_FUNCS</glossterm> | ||
5752 | <glossdef> | ||
5753 | <para> | ||
5754 | Specifies a list of functions run to pre-process the | ||
5755 | <link linkend='var-PKGD'><filename>PKGD</filename></link> | ||
5756 | directory prior to splitting the files out to individual | ||
5757 | packages. | ||
5758 | </para> | ||
5759 | </glossdef> | ||
5760 | </glossentry> | ||
5761 | |||
5762 | <glossentry id='var-PACKAGECONFIG'><glossterm>PACKAGECONFIG</glossterm> | ||
5763 | <glossdef> | ||
5764 | <para> | ||
5765 | This variable provides a means of enabling or disabling | ||
5766 | features of a recipe on a per-recipe basis. | ||
5767 | <filename>PACKAGECONFIG</filename> blocks are defined | ||
5768 | in recipes when you specify features and then arguments | ||
5769 | that define feature behaviors. | ||
5770 | Here is the basic block structure: | ||
5771 | <literallayout class='monospaced'> | ||
5772 | PACKAGECONFIG ??= "f1 f2 f3 ..." | ||
5773 | PACKAGECONFIG[f1] = "--with-f1,--without-f1,build-deps-f1,rt-deps-f1" | ||
5774 | PACKAGECONFIG[f2] = "--with-f2,--without-f2,build-deps-f2,rt-deps-f2" | ||
5775 | PACKAGECONFIG[f3] = "--with-f3,--without-f3,build-deps-f3,rt-deps-f3" | ||
5776 | </literallayout> | ||
5777 | The <filename>PACKAGECONFIG</filename> | ||
5778 | variable itself specifies a space-separated list of the | ||
5779 | features to enable. | ||
5780 | Following the features, you can determine the behavior of | ||
5781 | each feature by providing up to four order-dependent | ||
5782 | arguments, which are separated by commas. | ||
5783 | You can omit any argument you like but must retain the | ||
5784 | separating commas. | ||
5785 | The order is important and specifies the following: | ||
5786 | <orderedlist> | ||
5787 | <listitem><para>Extra arguments | ||
5788 | that should be added to the configure script | ||
5789 | argument list | ||
5790 | (<link linkend='var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></link>) | ||
5791 | if the feature is enabled.</para></listitem> | ||
5792 | <listitem><para>Extra arguments | ||
5793 | that should be added to <filename>EXTRA_OECONF</filename> | ||
5794 | if the feature is disabled. | ||
5795 | </para></listitem> | ||
5796 | <listitem><para>Additional build dependencies | ||
5797 | (<link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>) | ||
5798 | that should be added if the feature is enabled. | ||
5799 | </para></listitem> | ||
5800 | <listitem><para>Additional runtime dependencies | ||
5801 | (<link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>) | ||
5802 | that should be added if the feature is enabled. | ||
5803 | </para></listitem> | ||
5804 | </orderedlist> | ||
5805 | </para> | ||
5806 | |||
5807 | <para> | ||
5808 | Consider the following | ||
5809 | <filename>PACKAGECONFIG</filename> block taken from the | ||
5810 | <filename>librsvg</filename> recipe. | ||
5811 | In this example the feature is <filename>croco</filename>, | ||
5812 | which has three arguments that determine the feature's | ||
5813 | behavior. | ||
5814 | <literallayout class='monospaced'> | ||
5815 | PACKAGECONFIG ??= "croco" | ||
5816 | PACKAGECONFIG[croco] = "--with-croco,--without-croco,libcroco" | ||
5817 | </literallayout> | ||
5818 | The <filename>--with-croco</filename> and | ||
5819 | <filename>libcroco</filename> arguments apply only if | ||
5820 | the feature is enabled. | ||
5821 | In this case, <filename>--with-croco</filename> is | ||
5822 | added to the configure script argument list and | ||
5823 | <filename>libcroco</filename> is added to | ||
5824 | <filename><link linkend='var-DEPENDS'>DEPENDS</link></filename>. | ||
5825 | On the other hand, if the feature is disabled say through | ||
5826 | a <filename>.bbappend</filename> file in another layer, then | ||
5827 | the second argument <filename>--without-croco</filename> is | ||
5828 | added to the configure script rather than | ||
5829 | <filename>--with-croco</filename>. | ||
5830 | </para> | ||
5831 | |||
5832 | <para> | ||
5833 | The basic <filename>PACKAGECONFIG</filename> structure | ||
5834 | previously described holds true regardless of whether you | ||
5835 | are creating a block or changing a block. | ||
5836 | When creating a block, use the structure inside your | ||
5837 | recipe. | ||
5838 | </para> | ||
5839 | |||
5840 | <para> | ||
5841 | If you want to change an existing | ||
5842 | <filename>PACKAGECONFIG</filename> block, you can do so | ||
5843 | one of two ways: | ||
5844 | <itemizedlist> | ||
5845 | <listitem><para><emphasis>Append file:</emphasis> | ||
5846 | Create an append file named | ||
5847 | <filename><recipename>.bbappend</filename> in your | ||
5848 | layer and override the value of | ||
5849 | <filename>PACKAGECONFIG</filename>. | ||
5850 | You can either completely override the variable: | ||
5851 | <literallayout class='monospaced'> | ||
5852 | PACKAGECONFIG="f4 f5" | ||
5853 | </literallayout> | ||
5854 | Or, you can just append the variable: | ||
5855 | <literallayout class='monospaced'> | ||
5856 | PACKAGECONFIG_append = " f4" | ||
5857 | </literallayout></para></listitem> | ||
5858 | <listitem><para><emphasis>Configuration file:</emphasis> | ||
5859 | This method is identical to changing the block | ||
5860 | through an append file except you edit your | ||
5861 | <filename>local.conf</filename> or | ||
5862 | <filename><mydistro>.conf</filename> file. | ||
5863 | As with append files previously described, | ||
5864 | you can either completely override the variable: | ||
5865 | <literallayout class='monospaced'> | ||
5866 | PACKAGECONFIG_pn-<recipename>="f4 f5" | ||
5867 | </literallayout> | ||
5868 | Or, you can just amend the variable: | ||
5869 | <literallayout class='monospaced'> | ||
5870 | PACKAGECONFIG_append_pn-<recipename> = " f4" | ||
5871 | </literallayout></para></listitem> | ||
5872 | </itemizedlist> | ||
5873 | </para> | ||
5874 | </glossdef> | ||
5875 | </glossentry> | ||
5876 | |||
5877 | <glossentry id='var-PACKAGES'><glossterm>PACKAGES</glossterm> | ||
5878 | <glossdef> | ||
5879 | <para>The list of packages to be created from the recipe. | ||
5880 | The default value is the following: | ||
5881 | <literallayout class='monospaced'> | ||
5882 | ${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN} | ||
5883 | </literallayout></para> | ||
5884 | </glossdef> | ||
5885 | </glossentry> | ||
5886 | |||
5887 | <glossentry id='var-PACKAGESPLITFUNCS'><glossterm>PACKAGESPLITFUNCS</glossterm> | ||
5888 | <glossdef> | ||
5889 | <para> | ||
5890 | Specifies a list of functions run to perform additional | ||
5891 | splitting of files into individual packages. | ||
5892 | Recipes can either prepend to this variable or prepend | ||
5893 | to the <filename>populate_packages</filename> function | ||
5894 | in order to perform additional package splitting. | ||
5895 | In either case, the function should set | ||
5896 | <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>, | ||
5897 | <link linkend='var-FILES'><filename>FILES</filename></link>, | ||
5898 | <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link> | ||
5899 | and other packaging variables appropriately in order to | ||
5900 | perform the desired splitting. | ||
5901 | </para> | ||
5902 | </glossdef> | ||
5903 | </glossentry> | ||
5904 | |||
5905 | <glossentry id='var-PACKAGES_DYNAMIC'><glossterm>PACKAGES_DYNAMIC</glossterm> | ||
5906 | <glossdef> | ||
5907 | <para> | ||
5908 | A promise that your recipe satisfies runtime dependencies | ||
5909 | for optional modules that are found in other recipes. | ||
5910 | <filename>PACKAGES_DYNAMIC</filename> | ||
5911 | does not actually satisfy the dependencies, it only states that | ||
5912 | they should be satisfied. | ||
5913 | For example, if a hard, runtime dependency | ||
5914 | (<link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>) | ||
5915 | of another package is satisfied | ||
5916 | at build time through the <filename>PACKAGES_DYNAMIC</filename> | ||
5917 | variable, but a package with the module name is never actually | ||
5918 | produced, then the other package will be broken. | ||
5919 | Thus, if you attempt to include that package in an image, | ||
5920 | you will get a dependency failure from the packaging system | ||
5921 | during the | ||
5922 | <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link> | ||
5923 | task. | ||
5924 | </para> | ||
5925 | <para> | ||
5926 | Typically, if there is a chance that such a situation can | ||
5927 | occur and the package that is not created is valid | ||
5928 | without the dependency being satisfied, then you should use | ||
5929 | <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link> | ||
5930 | (a soft runtime dependency) instead of | ||
5931 | <filename>RDEPENDS</filename>. | ||
5932 | </para> | ||
5933 | |||
5934 | <para> | ||
5935 | For an example of how to use the <filename>PACKAGES_DYNAMIC</filename> | ||
5936 | variable when you are splitting packages, see the | ||
5937 | "<ulink url='&YOCTO_DOCS_DEV_URL;#handling-optional-module-packaging'>Handling Optional Module Packaging</ulink>" section | ||
5938 | in the Yocto Project Development Manual. | ||
5939 | </para> | ||
5940 | </glossdef> | ||
5941 | </glossentry> | ||
5942 | |||
5943 | <glossentry id='var-PARALLEL_MAKE'><glossterm>PARALLEL_MAKE</glossterm> | ||
5944 | <glossdef> | ||
5945 | <para> | ||
5946 | Extra options passed to the <filename>make</filename> | ||
5947 | command during the | ||
5948 | <link linkend='ref-tasks-compile'><filename>do_compile</filename></link> | ||
5949 | task in order to specify parallel compilation on the local | ||
5950 | build host. | ||
5951 | This variable is usually in the form "-j <x>", | ||
5952 | where x represents the maximum number of parallel threads | ||
5953 | <filename>make</filename> can run. | ||
5954 | </para> | ||
5955 | |||
5956 | <para> | ||
5957 | If your development host supports multiple cores, a good | ||
5958 | rule of thumb is to set this variable to twice the number | ||
5959 | of cores on the host. | ||
5960 | If you do not set <filename>PARALLEL_MAKE</filename>, it | ||
5961 | defaults to the number of cores your build system has. | ||
5962 | <note> | ||
5963 | Individual recipes might clear out this variable if | ||
5964 | the software being built has problems running its | ||
5965 | <filename>make</filename> process in parallel. | ||
5966 | </note> | ||
5967 | </para> | ||
5968 | </glossdef> | ||
5969 | </glossentry> | ||
5970 | |||
5971 | <glossentry id='var-PARALLEL_MAKEINST'><glossterm>PARALLEL_MAKEINST</glossterm> | ||
5972 | <glossdef> | ||
5973 | <para> | ||
5974 | Extra options passed to the | ||
5975 | <filename>make install</filename> command during the | ||
5976 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
5977 | task in order to specify parallel installation. | ||
5978 | This variable defaults to the value of | ||
5979 | <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link>. | ||
5980 | <note> | ||
5981 | Individual recipes might clear out this variable if | ||
5982 | the software being built has problems running its | ||
5983 | <filename>make install</filename> process in parallel. | ||
5984 | </note> | ||
5985 | </para> | ||
5986 | </glossdef> | ||
5987 | </glossentry> | ||
5988 | |||
5989 | <glossentry id='var-PATCHRESOLVE'><glossterm>PATCHRESOLVE</glossterm> | ||
5990 | <glossdef> | ||
5991 | <para> | ||
5992 | Determines the action to take when a patch fails. | ||
5993 | You can set this variable to one of two values: "noop" and | ||
5994 | "user". | ||
5995 | </para> | ||
5996 | |||
5997 | <para> | ||
5998 | The default value of "noop" causes the build to simply fail | ||
5999 | when the OpenEmbedded build system cannot successfully | ||
6000 | apply a patch. | ||
6001 | Setting the value to "user" causes the build system to | ||
6002 | launch a shell and places you in the right location so that | ||
6003 | you can manually resolve the conflicts. | ||
6004 | </para> | ||
6005 | |||
6006 | <para> | ||
6007 | Set this variable in your | ||
6008 | <filename>local.conf</filename> file. | ||
6009 | </para> | ||
6010 | </glossdef> | ||
6011 | </glossentry> | ||
6012 | |||
6013 | <glossentry id='var-PATCHTOOL'><glossterm>PATCHTOOL</glossterm> | ||
6014 | <glossdef> | ||
6015 | <para> | ||
6016 | Specifies the utility used to apply patches for a recipe | ||
6017 | during the | ||
6018 | <link linkend='ref-tasks-patch'><filename>do_patch</filename></link> | ||
6019 | task. | ||
6020 | You can specify one of three utilities: "patch", "quilt", or | ||
6021 | "git". | ||
6022 | The default utility used is "quilt" except for the | ||
6023 | quilt-native recipe itself. | ||
6024 | Because the quilt tool is not available at the | ||
6025 | time quilt-native is being patched, it uses "patch". | ||
6026 | </para> | ||
6027 | |||
6028 | <para> | ||
6029 | If you wish to use an alternative patching tool, set the | ||
6030 | variable in the recipe using one of the following: | ||
6031 | <literallayout class='monospaced'> | ||
6032 | PATCHTOOL = "patch" | ||
6033 | PATCHTOOL = "quilt" | ||
6034 | PATCHTOOL = "git" | ||
6035 | </literallayout> | ||
6036 | </para> | ||
6037 | </glossdef> | ||
6038 | </glossentry> | ||
6039 | |||
6040 | <glossentry id='var-PE'><glossterm>PE</glossterm> | ||
6041 | <glossdef> | ||
6042 | <para> | ||
6043 | The epoch of the recipe. | ||
6044 | By default, this variable is unset. | ||
6045 | The variable is used to make upgrades possible when the | ||
6046 | versioning scheme changes in some backwards incompatible | ||
6047 | way. | ||
6048 | </para> | ||
6049 | </glossdef> | ||
6050 | </glossentry> | ||
6051 | |||
6052 | <glossentry id='var-PF'><glossterm>PF</glossterm> | ||
6053 | <glossdef> | ||
6054 | <para>Specifies the recipe or package name and includes all version and revision | ||
6055 | numbers (i.e. <filename>eglibc-2.13-r20+svnr15508/</filename> and | ||
6056 | <filename>bash-4.2-r1/</filename>). | ||
6057 | This variable is comprised of the following: | ||
6058 | <literallayout class='monospaced'> | ||
6059 | ${<link linkend='var-PN'>PN</link>}-${<link linkend='var-EXTENDPE'>EXTENDPE</link>}${<link linkend='var-PV'>PV</link>}-${<link linkend='var-PR'>PR</link>} | ||
6060 | </literallayout></para> | ||
6061 | </glossdef> | ||
6062 | </glossentry> | ||
6063 | |||
6064 | <glossentry id='var-PIXBUF_PACKAGES'><glossterm>PIXBUF_PACKAGES</glossterm> | ||
6065 | <glossdef> | ||
6066 | <para> | ||
6067 | When a recipe inherits the | ||
6068 | <link linkend='ref-classes-pixbufcache'><filename>pixbufcache</filename></link> | ||
6069 | class, this variable identifies packages that contain | ||
6070 | the pixbuf loaders used with | ||
6071 | <filename>gdk-pixbuf</filename>. | ||
6072 | By default, the <filename>pixbufcache</filename> class | ||
6073 | assumes that the loaders are in the recipe's main package | ||
6074 | (i.e. <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename>). | ||
6075 | Use this variable if the loaders you need are in a package | ||
6076 | other than that main package. | ||
6077 | </para> | ||
6078 | </glossdef> | ||
6079 | </glossentry> | ||
6080 | |||
6081 | <glossentry id='var-PKG'><glossterm>PKG</glossterm> | ||
6082 | <glossdef> | ||
6083 | <para> | ||
6084 | The name of the resulting package created by the | ||
6085 | OpenEmbedded build system. | ||
6086 | <note> | ||
6087 | When using the <filename>PKG</filename> variable, you | ||
6088 | must use a package name override. | ||
6089 | </note> | ||
6090 | For example, when the | ||
6091 | <link linkend='ref-classes-debian'><filename>debian</filename></link> | ||
6092 | class renames the output package, it does so by setting | ||
6093 | <filename>PKG_<packagename></filename>. | ||
6094 | </para> | ||
6095 | </glossdef> | ||
6096 | </glossentry> | ||
6097 | |||
6098 | <glossentry id='var-PKGD'><glossterm>PKGD</glossterm> | ||
6099 | <glossdef> | ||
6100 | <para> | ||
6101 | Points to the destination directory for files to be | ||
6102 | packaged before they are split into individual packages. | ||
6103 | This directory defaults to the following: | ||
6104 | <literallayout class='monospaced'> | ||
6105 | ${WORKDIR}/package | ||
6106 | </literallayout> | ||
6107 | Do not change this default. | ||
6108 | </para> | ||
6109 | </glossdef> | ||
6110 | </glossentry> | ||
6111 | |||
6112 | <glossentry id='var-PKGDATA_DIR'><glossterm>PKGDATA_DIR</glossterm> | ||
6113 | <glossdef> | ||
6114 | <para> | ||
6115 | Points to a shared, global-state directory that holds data | ||
6116 | generated during the packaging process. | ||
6117 | During the packaging process, the | ||
6118 | <link linkend='ref-tasks-packagedata'><filename>do_packagedata</filename></link> | ||
6119 | task packages data for each recipe and installs it into | ||
6120 | this temporary, shared area. | ||
6121 | This directory defaults to the following: | ||
6122 | <literallayout class='monospaced'> | ||
6123 | ${STAGING_DIR_HOST}/pkgdata | ||
6124 | </literallayout> | ||
6125 | Do not change this default. | ||
6126 | </para> | ||
6127 | </glossdef> | ||
6128 | </glossentry> | ||
6129 | |||
6130 | <glossentry id='var-PKGDEST'><glossterm>PKGDEST</glossterm> | ||
6131 | <glossdef> | ||
6132 | <para> | ||
6133 | Points to the parent directory for files to be packaged | ||
6134 | after they have been split into individual packages. | ||
6135 | This directory defaults to the following: | ||
6136 | <literallayout class='monospaced'> | ||
6137 | ${WORKDIR}/packages-split | ||
6138 | </literallayout> | ||
6139 | Under this directory, the build system creates | ||
6140 | directories for each package specified in | ||
6141 | <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>. | ||
6142 | Do not change this default. | ||
6143 | </para> | ||
6144 | </glossdef> | ||
6145 | </glossentry> | ||
6146 | |||
6147 | <glossentry id='var-PKGDESTWORK'><glossterm>PKGDESTWORK</glossterm> | ||
6148 | <glossdef> | ||
6149 | <para> | ||
6150 | Points to a temporary work area used by the | ||
6151 | <link linkend='ref-tasks-package'><filename>do_package</filename></link> | ||
6152 | task to write output from the | ||
6153 | <link linkend='ref-tasks-packagedata'><filename>do_packagedata</filename></link> | ||
6154 | task. | ||
6155 | The <filename>PKGDESTWORK</filename> location defaults to | ||
6156 | the following: | ||
6157 | <literallayout class='monospaced'> | ||
6158 | ${WORKDIR}/pkgdata | ||
6159 | </literallayout> | ||
6160 | The <filename>do_packagedata</filename> task then packages | ||
6161 | the data in the temporary work area and installs it into a | ||
6162 | shared directory pointed to by | ||
6163 | <link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link>. | ||
6164 | </para> | ||
6165 | |||
6166 | <para> | ||
6167 | Do not change this default. | ||
6168 | </para> | ||
6169 | </glossdef> | ||
6170 | </glossentry> | ||
6171 | |||
6172 | <glossentry id='var-PKGE'><glossterm>PKGE</glossterm> | ||
6173 | <glossdef> | ||
6174 | <para> | ||
6175 | The epoch of the output package built by the | ||
6176 | OpenEmbedded build system. | ||
6177 | By default, <filename>PKGE</filename> is set to | ||
6178 | <link linkend='var-PE'><filename>PE</filename></link>. | ||
6179 | </para> | ||
6180 | </glossdef> | ||
6181 | </glossentry> | ||
6182 | |||
6183 | <glossentry id='var-PKGR'><glossterm>PKGR</glossterm> | ||
6184 | <glossdef> | ||
6185 | <para> | ||
6186 | The revision of the output package built by the | ||
6187 | OpenEmbedded build system. | ||
6188 | By default, <filename>PKGR</filename> is set to | ||
6189 | <link linkend='var-PR'><filename>PR</filename></link>. | ||
6190 | </para> | ||
6191 | </glossdef> | ||
6192 | </glossentry> | ||
6193 | |||
6194 | <glossentry id='var-PKGV'><glossterm>PKGV</glossterm> | ||
6195 | <glossdef> | ||
6196 | <para> | ||
6197 | The version of the output package built by the | ||
6198 | OpenEmbedded build system. | ||
6199 | By default, <filename>PKGV</filename> is set to | ||
6200 | <link linkend='var-PV'><filename>PV</filename></link>. | ||
6201 | </para> | ||
6202 | </glossdef> | ||
6203 | </glossentry> | ||
6204 | |||
6205 | <glossentry id='var-PN'><glossterm>PN</glossterm> | ||
6206 | <glossdef> | ||
6207 | <para>This variable can have two separate functions depending on the context: a recipe | ||
6208 | name or a resulting package name.</para> | ||
6209 | <para><filename>PN</filename> refers to a recipe name in the context of a file used | ||
6210 | by the OpenEmbedded build system as input to create a package. | ||
6211 | The name is normally extracted from the recipe file name. | ||
6212 | For example, if the recipe is named | ||
6213 | <filename>expat_2.0.1.bb</filename>, then the default value of <filename>PN</filename> | ||
6214 | will be "expat".</para> | ||
6215 | <para> | ||
6216 | The variable refers to a package name in the context of a file created or produced by the | ||
6217 | OpenEmbedded build system.</para> | ||
6218 | <para>If applicable, the <filename>PN</filename> variable also contains any special | ||
6219 | suffix or prefix. | ||
6220 | For example, using <filename>bash</filename> to build packages for the native | ||
6221 | machine, <filename>PN</filename> is <filename>bash-native</filename>. | ||
6222 | Using <filename>bash</filename> to build packages for the target and for Multilib, | ||
6223 | <filename>PN</filename> would be <filename>bash</filename> and | ||
6224 | <filename>lib64-bash</filename>, respectively. | ||
6225 | </para> | ||
6226 | </glossdef> | ||
6227 | </glossentry> | ||
6228 | |||
6229 | <glossentry id='var-PNBLACKLIST'><glossterm>PNBLACKLIST</glossterm> | ||
6230 | <glossdef> | ||
6231 | <para> | ||
6232 | Lists recipes you do not want the OpenEmbedded build system | ||
6233 | to build. | ||
6234 | This variable works in conjunction with the | ||
6235 | <link linkend='ref-classes-blacklist'><filename>blacklist</filename></link> | ||
6236 | class, which the recipe must inherit globally. | ||
6237 | </para> | ||
6238 | |||
6239 | <para> | ||
6240 | To prevent a recipe from being built, inherit the class | ||
6241 | globally and use the variable in your | ||
6242 | <filename>local.conf</filename> file. | ||
6243 | Here is an example that prevents | ||
6244 | <filename>myrecipe</filename> from being built: | ||
6245 | <literallayout class='monospaced'> | ||
6246 | INHERIT += "blacklist" | ||
6247 | PNBLACKLIST[myrecipe] = "Not supported by our organization." | ||
6248 | </literallayout> | ||
6249 | </para> | ||
6250 | </glossdef> | ||
6251 | </glossentry> | ||
6252 | |||
6253 | <glossentry id='var-PR'><glossterm>PR</glossterm> | ||
6254 | <glossdef> | ||
6255 | <para> | ||
6256 | The revision of the recipe. | ||
6257 | The default value for this variable is "r0". | ||
6258 | </para> | ||
6259 | </glossdef> | ||
6260 | </glossentry> | ||
6261 | |||
6262 | <glossentry id='var-PREFERRED_PROVIDER'><glossterm>PREFERRED_PROVIDER</glossterm> | ||
6263 | <glossdef> | ||
6264 | <para> | ||
6265 | If multiple recipes provide an item, this variable | ||
6266 | determines which recipe should be given preference. | ||
6267 | You should always suffix the variable with the name of the | ||
6268 | provided item, and you should set it to the | ||
6269 | <link linkend='var-PN'><filename>PN</filename></link> | ||
6270 | of the recipe to which you want to give precedence. | ||
6271 | Some examples: | ||
6272 | <literallayout class='monospaced'> | ||
6273 | PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto" | ||
6274 | PREFERRED_PROVIDER_virtual/xserver = "xserver-xf86" | ||
6275 | PREFERRED_PROVIDER_virtual/libgl ?= "mesa" | ||
6276 | </literallayout> | ||
6277 | </para> | ||
6278 | </glossdef> | ||
6279 | </glossentry> | ||
6280 | |||
6281 | <glossentry id='var-PREFERRED_VERSION'><glossterm>PREFERRED_VERSION</glossterm> | ||
6282 | <glossdef> | ||
6283 | <para> | ||
6284 | If there are multiple versions of recipes available, this | ||
6285 | variable determines which recipe should be given preference. | ||
6286 | You must always suffix the variable with the | ||
6287 | <link linkend='var-PN'><filename>PN</filename></link> | ||
6288 | you want to select, and you should set the | ||
6289 | <link linkend='var-PV'><filename>PV</filename></link> | ||
6290 | accordingly for precedence. | ||
6291 | You can use the "<filename>%</filename>" character as a | ||
6292 | wildcard to match any number of characters, which can be | ||
6293 | useful when specifying versions that contain long revision | ||
6294 | numbers that could potentially change. | ||
6295 | Here are two examples: | ||
6296 | <literallayout class='monospaced'> | ||
6297 | PREFERRED_VERSION_python = "2.7.3" | ||
6298 | PREFERRED_VERSION_linux-yocto = "3.10%" | ||
6299 | </literallayout> | ||
6300 | </para> | ||
6301 | </glossdef> | ||
6302 | </glossentry> | ||
6303 | |||
6304 | <glossentry id='var-PREMIRRORS'><glossterm>PREMIRRORS</glossterm> | ||
6305 | <glossdef> | ||
6306 | <para> | ||
6307 | Specifies additional paths from which the OpenEmbedded | ||
6308 | build system gets source code. | ||
6309 | When the build system searches for source code, it first | ||
6310 | tries the local download directory. | ||
6311 | If that location fails, the build system tries locations | ||
6312 | defined by <filename>PREMIRRORS</filename>, the upstream | ||
6313 | source, and then locations specified by | ||
6314 | <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link> | ||
6315 | in that order. | ||
6316 | </para> | ||
6317 | |||
6318 | <para> | ||
6319 | Assuming your distribution | ||
6320 | (<link linkend='var-DISTRO'><filename>DISTRO</filename></link>) | ||
6321 | is "poky", the default value for | ||
6322 | <filename>PREMIRRORS</filename> is defined in the | ||
6323 | <filename>conf/distro/poky.conf</filename> file in the | ||
6324 | <filename>meta-yocto</filename> Git repository. | ||
6325 | </para> | ||
6326 | |||
6327 | <para> | ||
6328 | Typically, you could add a specific server for the | ||
6329 | build system to attempt before any others by adding | ||
6330 | something like the following to the | ||
6331 | <filename>local.conf</filename> configuration file in the | ||
6332 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>: | ||
6333 | <literallayout class='monospaced'> | ||
6334 | PREMIRRORS_prepend = "\ | ||
6335 | git://.*/.* http://www.yoctoproject.org/sources/ \n \ | ||
6336 | ftp://.*/.* http://www.yoctoproject.org/sources/ \n \ | ||
6337 | http://.*/.* http://www.yoctoproject.org/sources/ \n \ | ||
6338 | https://.*/.* http://www.yoctoproject.org/sources/ \n" | ||
6339 | </literallayout> | ||
6340 | These changes cause the build system to intercept | ||
6341 | Git, FTP, HTTP, and HTTPS requests and direct them to | ||
6342 | the <filename>http://</filename> sources mirror. | ||
6343 | You can use <filename>file://</filename> URLs to point | ||
6344 | to local directories or network shares as well. | ||
6345 | </para> | ||
6346 | </glossdef> | ||
6347 | </glossentry> | ||
6348 | |||
6349 | <glossentry id='var-PRINC'><glossterm>PRINC</glossterm> | ||
6350 | <glossdef> | ||
6351 | |||
6352 | <para> | ||
6353 | The <filename>PRINC</filename> variable has been deprecated | ||
6354 | and triggers a warning if detected during a build. | ||
6355 | For | ||
6356 | <link linkend='var-PR'><filename>PR</filename></link> | ||
6357 | increments on changes, use the PR service instead. | ||
6358 | You can find out more about this service in the | ||
6359 | "<ulink url='&YOCTO_DOCS_DEV_URL;#working-with-a-pr-service'>Working With a PR Service</ulink>" | ||
6360 | section in the Yocto Project Development Manual. | ||
6361 | </para> | ||
6362 | <!-- | ||
6363 | |||
6364 | <para> | ||
6365 | Causes the | ||
6366 | <link linkend='var-PR'><filename>PR</filename></link> | ||
6367 | variable of <filename>.bbappend</filename> files to | ||
6368 | dynamically increment. | ||
6369 | This increment minimizes the impact of layer ordering. | ||
6370 | </para> | ||
6371 | |||
6372 | <para> | ||
6373 | In order to ensure multiple <filename>.bbappend</filename> | ||
6374 | files can co-exist, | ||
6375 | <filename>PRINC</filename> should be self-referencing. | ||
6376 | This variable defaults to 0. | ||
6377 | </para> | ||
6378 | |||
6379 | <para> | ||
6380 | Following is an example that increments | ||
6381 | <filename>PR</filename> by two: | ||
6382 | <literallayout class='monospaced'> | ||
6383 | PRINC := "${@int(PRINC) + 2}" | ||
6384 | </literallayout> | ||
6385 | It is advisable not to use strings such as ".= '.1'" with the variable because | ||
6386 | this usage is very sensitive to layer ordering. | ||
6387 | You should avoid explicit assignments as they cannot | ||
6388 | adequately represent multiple | ||
6389 | <filename>.bbappend</filename> files. | ||
6390 | </para> | ||
6391 | --> | ||
6392 | </glossdef> | ||
6393 | </glossentry> | ||
6394 | |||
6395 | <glossentry id='var-PRIVATE_LIBS'><glossterm>PRIVATE_LIBS</glossterm> | ||
6396 | <glossdef> | ||
6397 | <para> | ||
6398 | Specifies libraries installed within a recipe that | ||
6399 | should be ignored by the OpenEmbedded build system's | ||
6400 | shared library resolver. | ||
6401 | This variable is typically used when software being | ||
6402 | built by a recipe has its own private versions of a | ||
6403 | library normally provided by another recipe. | ||
6404 | In this case, you would not want the package containing | ||
6405 | the private libraries to be set as a dependency on other | ||
6406 | unrelated packages that should instead depend on the | ||
6407 | package providing the standard version of the library. | ||
6408 | </para> | ||
6409 | |||
6410 | <para> | ||
6411 | Libraries specified in this variable should be specified | ||
6412 | by their file name. | ||
6413 | For example, from the Firefox recipe in meta-browser: | ||
6414 | <literallayout class='monospaced'> | ||
6415 | PRIVATE_LIBS = "libmozjs.so \ | ||
6416 | libxpcom.so \ | ||
6417 | libnspr4.so \ | ||
6418 | libxul.so \ | ||
6419 | libmozalloc.so \ | ||
6420 | libplc4.so \ | ||
6421 | libplds4.so" | ||
6422 | </literallayout> | ||
6423 | </para> | ||
6424 | </glossdef> | ||
6425 | </glossentry> | ||
6426 | |||
6427 | <glossentry id='var-PROVIDES'><glossterm>PROVIDES</glossterm> | ||
6428 | <glossdef> | ||
6429 | <para> | ||
6430 | A list of aliases by which a particular recipe can be | ||
6431 | known. | ||
6432 | By default, a recipe's own | ||
6433 | <filename><link linkend='var-PN'>PN</link></filename> | ||
6434 | is implicitly already in its <filename>PROVIDES</filename> | ||
6435 | list. | ||
6436 | If a recipe uses <filename>PROVIDES</filename>, the | ||
6437 | additional aliases are synonyms for the recipe and can | ||
6438 | be useful satisfying dependencies of other recipes during | ||
6439 | the build as specified by | ||
6440 | <filename><link linkend='var-DEPENDS'>DEPENDS</link></filename>. | ||
6441 | </para> | ||
6442 | |||
6443 | <para> | ||
6444 | Consider the following example | ||
6445 | <filename>PROVIDES</filename> statement from a recipe | ||
6446 | file <filename>libav_0.8.11.bb</filename>: | ||
6447 | <literallayout class='monospaced'> | ||
6448 | PROVIDES += "libpostproc" | ||
6449 | </literallayout> | ||
6450 | The <filename>PROVIDES</filename> statement results in | ||
6451 | the "libav" recipe also being known as "libpostproc". | ||
6452 | </para> | ||
6453 | </glossdef> | ||
6454 | </glossentry> | ||
6455 | |||
6456 | <glossentry id='var-PRSERV_HOST'><glossterm>PRSERV_HOST</glossterm> | ||
6457 | <glossdef> | ||
6458 | <para> | ||
6459 | The network based | ||
6460 | <link linkend='var-PR'><filename>PR</filename></link> | ||
6461 | service host and port. | ||
6462 | </para> | ||
6463 | |||
6464 | <para> | ||
6465 | The <filename>conf/local.conf.sample.extended</filename> | ||
6466 | configuration file in the | ||
6467 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
6468 | shows how the <filename>PRSERV_HOST</filename> variable is | ||
6469 | set: | ||
6470 | <literallayout class='monospaced'> | ||
6471 | PRSERV_HOST = "localhost:0" | ||
6472 | </literallayout> | ||
6473 | You must set the variable if you want to automatically | ||
6474 | start a local | ||
6475 | <ulink url='&YOCTO_DOCS_DEV_URL;#working-with-a-pr-service'>PR service</ulink>. | ||
6476 | You can set <filename>PRSERV_HOST</filename> to other | ||
6477 | values to use a remote PR service. | ||
6478 | </para> | ||
6479 | </glossdef> | ||
6480 | </glossentry> | ||
6481 | |||
6482 | <glossentry id='var-PV'><glossterm>PV</glossterm> | ||
6483 | <glossdef> | ||
6484 | <para> | ||
6485 | The version of the recipe. | ||
6486 | The version is normally extracted from the recipe filename. | ||
6487 | For example, if the recipe is named | ||
6488 | <filename>expat_2.0.1.bb</filename>, then the default value of <filename>PV</filename> | ||
6489 | will be "2.0.1". | ||
6490 | <filename>PV</filename> is generally not overridden within | ||
6491 | a recipe unless it is building an unstable (i.e. development) version from a source code repository | ||
6492 | (e.g. Git or Subversion). | ||
6493 | </para> | ||
6494 | </glossdef> | ||
6495 | </glossentry> | ||
6496 | |||
6497 | <glossentry id='var-PYTHON_ABI'><glossterm>PYTHON_ABI</glossterm> | ||
6498 | <glossdef> | ||
6499 | <para> | ||
6500 | When used by recipes that inherit the | ||
6501 | <link linkend='ref-classes-distutils3'><filename>distutils3</filename></link>, | ||
6502 | <link linkend='ref-classes-setuptools3'><filename>setuptools3</filename></link>, | ||
6503 | <link linkend='ref-classes-distutils'><filename>distutils</filename></link>, | ||
6504 | or | ||
6505 | <link linkend='ref-classes-setuptools'><filename>setuptools</filename></link> | ||
6506 | classes, denotes the Application Binary Interface (ABI) | ||
6507 | currently in use for Python. | ||
6508 | By default, the ABI is "m". | ||
6509 | You do not have to set this variable as the OpenEmbedded | ||
6510 | build system sets it for you. | ||
6511 | </para> | ||
6512 | |||
6513 | <para> | ||
6514 | The OpenEmbedded build system uses the ABI to construct | ||
6515 | directory names used when installing the Python headers | ||
6516 | and libraries in sysroot | ||
6517 | (e.g. <filename>.../python3.3m/...</filename>). | ||
6518 | </para> | ||
6519 | |||
6520 | <para> | ||
6521 | Recipes that inherit the | ||
6522 | <link linkend='ref-classes-distutils'><filename>distutils</filename></link> | ||
6523 | class during cross-builds also use this variable to | ||
6524 | locate the headers and libraries of the appropriate Python | ||
6525 | that the extension is targeting. | ||
6526 | </para> | ||
6527 | </glossdef> | ||
6528 | </glossentry> | ||
6529 | |||
6530 | <glossentry id='var-PYTHON_PN'><glossterm>PYTHON_PN</glossterm> | ||
6531 | <glossdef> | ||
6532 | <para> | ||
6533 | When used by recipes that inherit the | ||
6534 | <link linkend='ref-classes-distutils3'><filename>distutils3</filename></link>, | ||
6535 | <link linkend='ref-classes-setuptools3'><filename>setuptools3</filename></link>, | ||
6536 | <link linkend='ref-classes-distutils'><filename>distutils</filename></link>, | ||
6537 | or | ||
6538 | <link linkend='ref-classes-setuptools'><filename>setuptools</filename></link> | ||
6539 | classes, specifies the major Python version being built. | ||
6540 | For Python 2.x, <filename>PYTHON_PN</filename> would | ||
6541 | be "python2". For Python 3.x, the variable would be | ||
6542 | "python3". | ||
6543 | You do not have to set this variable as the | ||
6544 | OpenEmbedded build system automatically sets it for you. | ||
6545 | </para> | ||
6546 | |||
6547 | <para> | ||
6548 | The variable allows recipes to use common infrastructure | ||
6549 | such as the following: | ||
6550 | <literallayout class='monospaced'> | ||
6551 | DEPENDS += "${PYTHON_PN}-native" | ||
6552 | </literallayout> | ||
6553 | In the previous example, the version of the dependency | ||
6554 | is <filename>PYTHON_PN</filename>. | ||
6555 | </para> | ||
6556 | </glossdef> | ||
6557 | </glossentry> | ||
6558 | |||
6559 | </glossdiv> | ||
6560 | |||
6561 | <glossdiv id='var-glossary-q'><title>Q</title> | ||
6562 | |||
6563 | <glossentry id='var-QMAKE_PROFILES'><glossterm>QMAKE_PROFILES</glossterm> | ||
6564 | <glossdef> | ||
6565 | <para> | ||
6566 | Specifies your own subset of <filename>.pro</filename> | ||
6567 | files to be built for use with | ||
6568 | <filename>qmake</filename>. | ||
6569 | If you do not set this variable, all | ||
6570 | <filename>.pro</filename> files in the directory pointed to | ||
6571 | by <link linkend='var-S'><filename>S</filename></link> | ||
6572 | will be built by default. | ||
6573 | </para> | ||
6574 | |||
6575 | <para> | ||
6576 | This variable is used with recipes that inherit the | ||
6577 | <link linkend='ref-classes-qmake*'><filename>qmake_base</filename></link> | ||
6578 | class or other classes that inherit | ||
6579 | <filename>qmake_base</filename>. | ||
6580 | </para> | ||
6581 | </glossdef> | ||
6582 | </glossentry> | ||
6583 | |||
6584 | </glossdiv> | ||
6585 | |||
6586 | <glossdiv id='var-glossary-r'><title>R</title> | ||
6587 | |||
6588 | <glossentry id='var-RCONFLICTS'><glossterm>RCONFLICTS</glossterm> | ||
6589 | <glossdef> | ||
6590 | <para> | ||
6591 | The list of packages that conflict with packages. | ||
6592 | Note that packages will not be installed if conflicting | ||
6593 | packages are not first removed. | ||
6594 | </para> | ||
6595 | |||
6596 | <para> | ||
6597 | Like all package-controlling variables, you must always use | ||
6598 | them in conjunction with a package name override. | ||
6599 | Here is an example: | ||
6600 | <literallayout class='monospaced'> | ||
6601 | RCONFLICTS_${PN} = "another-conflicting-package-name" | ||
6602 | </literallayout> | ||
6603 | </para> | ||
6604 | |||
6605 | <para> | ||
6606 | BitBake, which the OpenEmbedded build system uses, supports | ||
6607 | specifying versioned dependencies. | ||
6608 | Although the syntax varies depending on the packaging | ||
6609 | format, BitBake hides these differences from you. | ||
6610 | Here is the general syntax to specify versions with | ||
6611 | the <filename>RCONFLICTS</filename> variable: | ||
6612 | <literallayout class='monospaced'> | ||
6613 | RCONFLICTS_${PN} = "<package> (<operator> <version>)" | ||
6614 | </literallayout> | ||
6615 | For <filename>operator</filename>, you can specify the | ||
6616 | following: | ||
6617 | <literallayout class='monospaced'> | ||
6618 | = | ||
6619 | < | ||
6620 | > | ||
6621 | <= | ||
6622 | >= | ||
6623 | </literallayout> | ||
6624 | For example, the following sets up a dependency on version | ||
6625 | 1.2 or greater of the package <filename>foo</filename>: | ||
6626 | <literallayout class='monospaced'> | ||
6627 | RCONFLICTS_${PN} = "foo (>= 1.2)" | ||
6628 | </literallayout> | ||
6629 | </para> | ||
6630 | </glossdef> | ||
6631 | </glossentry> | ||
6632 | |||
6633 | <glossentry id='var-RDEPENDS'><glossterm>RDEPENDS</glossterm> | ||
6634 | <glossdef> | ||
6635 | <para> | ||
6636 | Lists a package's runtime dependencies (i.e. other packages) | ||
6637 | that must be installed in order for the built package to run | ||
6638 | correctly. | ||
6639 | If a package in this list cannot be found during the build, | ||
6640 | you will get a build error. | ||
6641 | </para> | ||
6642 | |||
6643 | <para> | ||
6644 | When you use the <filename>RDEPENDS</filename> variable | ||
6645 | in a recipe, you are essentially stating that the recipe's | ||
6646 | <link linkend='ref-tasks-build'><filename>do_build</filename></link> | ||
6647 | task depends on the existence of a specific package. | ||
6648 | Consider this simple example for two recipes named "a" and | ||
6649 | "b" that produce similarly named IPK packages. | ||
6650 | In this example, the <filename>RDEPENDS</filename> | ||
6651 | statement appears in the "a" recipe: | ||
6652 | <literallayout class='monospaced'> | ||
6653 | RDEPENDS_${PN} = "b" | ||
6654 | </literallayout> | ||
6655 | Here, the dependency is such that the | ||
6656 | <filename>do_build</filename> task for recipe "a" depends | ||
6657 | on the | ||
6658 | <link linkend='ref-tasks-package_write_ipk'><filename>do_package_write_ipk</filename></link> | ||
6659 | task of recipe "b". | ||
6660 | This means the package file for "b" must be available when | ||
6661 | the output for recipe "a" has been completely built. | ||
6662 | More importantly, package "a" will be marked as depending | ||
6663 | on package "b" in a manner that is understood by the | ||
6664 | package manager. | ||
6665 | </para> | ||
6666 | |||
6667 | <para> | ||
6668 | The names of the packages you list within | ||
6669 | <filename>RDEPENDS</filename> must be the names of other | ||
6670 | packages - they cannot be recipe names. | ||
6671 | Although package names and recipe names usually match, | ||
6672 | the important point here is that you are | ||
6673 | providing package names within the | ||
6674 | <filename>RDEPENDS</filename> variable. | ||
6675 | For an example of the default list of packages created from | ||
6676 | a recipe, see the | ||
6677 | <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link> | ||
6678 | variable. | ||
6679 | </para> | ||
6680 | |||
6681 | <para> | ||
6682 | Because the <filename>RDEPENDS</filename> variable applies | ||
6683 | to packages being built, you should always use the variable | ||
6684 | in a form with an attached package name. | ||
6685 | For example, suppose you are building a development package | ||
6686 | that depends on the <filename>perl</filename> package. | ||
6687 | In this case, you would use the following | ||
6688 | <filename>RDEPENDS</filename> statement: | ||
6689 | <literallayout class='monospaced'> | ||
6690 | RDEPENDS_${PN}-dev += "perl" | ||
6691 | </literallayout> | ||
6692 | In the example, the development package depends on | ||
6693 | the <filename>perl</filename> package. | ||
6694 | Thus, the <filename>RDEPENDS</filename> variable has the | ||
6695 | <filename>${PN}-dev</filename> package name as part of the | ||
6696 | variable. | ||
6697 | </para> | ||
6698 | |||
6699 | <para> | ||
6700 | The package name you attach to the | ||
6701 | <filename>RDEPENDS</filename> variable must appear | ||
6702 | as it would in the <filename>PACKAGES</filename> | ||
6703 | namespace before any renaming of the output package by | ||
6704 | classes like | ||
6705 | <link linkend='ref-classes-debian'><filename>debian.bbclass</filename></link>. | ||
6706 | </para> | ||
6707 | |||
6708 | <para> | ||
6709 | In many cases you do not need to explicitly add | ||
6710 | runtime dependencies using | ||
6711 | <filename>RDEPENDS</filename> since some automatic | ||
6712 | handling occurs: | ||
6713 | <itemizedlist> | ||
6714 | <listitem><para><emphasis><filename>shlibdeps</filename></emphasis>: If | ||
6715 | a runtime package contains a shared library | ||
6716 | (<filename>.so</filename>), the build | ||
6717 | processes the library in order to determine other | ||
6718 | libraries to which it is dynamically linked. | ||
6719 | The build process adds these libraries to | ||
6720 | <filename>RDEPENDS</filename> when creating the runtime | ||
6721 | package.</para></listitem> | ||
6722 | <listitem><para><emphasis><filename>pcdeps</filename></emphasis>: If | ||
6723 | the package ships a <filename>pkg-config</filename> | ||
6724 | information file, the build process uses this file | ||
6725 | to add items to the <filename>RDEPENDS</filename> | ||
6726 | variable to create the runtime packages. | ||
6727 | </para></listitem> | ||
6728 | </itemizedlist> | ||
6729 | </para> | ||
6730 | |||
6731 | <para> | ||
6732 | BitBake, which the OpenEmbedded build system uses, supports | ||
6733 | specifying versioned dependencies. | ||
6734 | Although the syntax varies depending on the packaging | ||
6735 | format, BitBake hides these differences from you. | ||
6736 | Here is the general syntax to specify versions with | ||
6737 | the <filename>RDEPENDS</filename> variable: | ||
6738 | <literallayout class='monospaced'> | ||
6739 | RDEPENDS_${PN} = "<package> (<operator> <version>)" | ||
6740 | </literallayout> | ||
6741 | For <filename>operator</filename>, you can specify the | ||
6742 | following: | ||
6743 | <literallayout class='monospaced'> | ||
6744 | = | ||
6745 | < | ||
6746 | > | ||
6747 | <= | ||
6748 | >= | ||
6749 | </literallayout> | ||
6750 | For example, the following sets up a dependency on version | ||
6751 | 1.2 or greater of the package <filename>foo</filename>: | ||
6752 | <literallayout class='monospaced'> | ||
6753 | RDEPENDS_${PN} = "foo (>= 1.2)" | ||
6754 | </literallayout> | ||
6755 | </para> | ||
6756 | |||
6757 | <para> | ||
6758 | For information on build-time dependencies, see the | ||
6759 | <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link> | ||
6760 | variable. | ||
6761 | </para> | ||
6762 | </glossdef> | ||
6763 | </glossentry> | ||
6764 | |||
6765 | <glossentry id='var-REQUIRED_DISTRO_FEATURES'><glossterm>REQUIRED_DISTRO_FEATURES</glossterm> | ||
6766 | <glossdef> | ||
6767 | <para> | ||
6768 | When a recipe inherits the | ||
6769 | <filename>distro_features_check</filename> class, this | ||
6770 | variable identifies distribution features that must | ||
6771 | exist in the current configuration in order for the | ||
6772 | OpenEmbedded build system to build the recipe. | ||
6773 | In other words, if the | ||
6774 | <filename>REQUIRED_DISTRO_FEATURES</filename> variable | ||
6775 | lists a feature that does not appear in | ||
6776 | <filename>DISTRO_FEATURES</filename> within the | ||
6777 | current configuration, an error occurs and the | ||
6778 | build stops. | ||
6779 | </para> | ||
6780 | </glossdef> | ||
6781 | </glossentry> | ||
6782 | |||
6783 | <glossentry id='var-RM_OLD_IMAGE'><glossterm>RM_OLD_IMAGE</glossterm> | ||
6784 | <glossdef> | ||
6785 | <para> | ||
6786 | Reclaims disk space by removing previously built | ||
6787 | versions of the same image from the | ||
6788 | <filename>images</filename> directory pointed to by the | ||
6789 | <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link> | ||
6790 | variable. | ||
6791 | </para> | ||
6792 | |||
6793 | <para> | ||
6794 | Set this variable to "1" in your | ||
6795 | <filename>local.conf</filename> file to remove these | ||
6796 | images. | ||
6797 | </para> | ||
6798 | </glossdef> | ||
6799 | </glossentry> | ||
6800 | |||
6801 | <glossentry id='var-RM_WORK_EXCLUDE'><glossterm>RM_WORK_EXCLUDE</glossterm> | ||
6802 | <glossdef> | ||
6803 | <para> | ||
6804 | With <filename>rm_work</filename> enabled, this | ||
6805 | variable specifies a list of recipes whose work directories | ||
6806 | should not be removed. | ||
6807 | See the "<link linkend='ref-classes-rm-work'><filename>rm_work.bbclass</filename></link>" | ||
6808 | section for more details. | ||
6809 | </para> | ||
6810 | </glossdef> | ||
6811 | </glossentry> | ||
6812 | |||
6813 | <glossentry id='var-ROOT_HOME'><glossterm>ROOT_HOME</glossterm> | ||
6814 | <glossdef> | ||
6815 | <para> | ||
6816 | Defines the root home directory. | ||
6817 | By default, this directory is set as follows in the | ||
6818 | BitBake configuration file: | ||
6819 | <literallayout class='monospaced'> | ||
6820 | ROOT_HOME ??= "/home/root" | ||
6821 | </literallayout> | ||
6822 | <note> | ||
6823 | This default value is likely used because some | ||
6824 | embedded solutions prefer to have a read-only root | ||
6825 | filesystem and prefer to keep writeable data in one | ||
6826 | place. | ||
6827 | </note> | ||
6828 | </para> | ||
6829 | |||
6830 | <para> | ||
6831 | You can override the default by setting the variable | ||
6832 | in any layer or in the <filename>local.conf</filename> file. | ||
6833 | Because the default is set using a "weak" assignment | ||
6834 | (i.e. "??="), you can use either of the following forms | ||
6835 | to define your override: | ||
6836 | <literallayout class='monospaced'> | ||
6837 | ROOT_HOME = "/root" | ||
6838 | ROOT_HOME ?= "/root" | ||
6839 | </literallayout> | ||
6840 | These override examples use <filename>/root</filename>, | ||
6841 | which is probably the most commonly used override. | ||
6842 | </para> | ||
6843 | </glossdef> | ||
6844 | </glossentry> | ||
6845 | |||
6846 | <glossentry id='var-ROOTFS'><glossterm>ROOTFS</glossterm> | ||
6847 | <glossdef> | ||
6848 | <para> | ||
6849 | Indicates a filesystem image to include as the root | ||
6850 | filesystem. | ||
6851 | </para> | ||
6852 | |||
6853 | <para> | ||
6854 | The <filename>ROOTFS</filename> variable is an optional | ||
6855 | variable used with the | ||
6856 | <link linkend='ref-classes-bootimg'><filename>bootimg</filename></link> | ||
6857 | class. | ||
6858 | </para> | ||
6859 | </glossdef> | ||
6860 | </glossentry> | ||
6861 | |||
6862 | <glossentry id='var-ROOTFS_POSTPROCESS_COMMAND'><glossterm>ROOTFS_POSTPROCESS_COMMAND</glossterm> | ||
6863 | <glossdef> | ||
6864 | <para> | ||
6865 | Added by classes to run post processing commands once the | ||
6866 | OpenEmbedded build system has created the root filesystem. | ||
6867 | You can specify shell commands separated by semicolons: | ||
6868 | <literallayout class='monospaced'> | ||
6869 | ROOTFS_POSTPROCESS_COMMAND += "<shell_command>; ... " | ||
6870 | </literallayout> | ||
6871 | If you need to pass the path to the root filesystem within | ||
6872 | the command, you can use | ||
6873 | <filename>${IMAGE_ROOTFS}</filename>, which points to | ||
6874 | the root filesystem image. | ||
6875 | See the | ||
6876 | <link linkend='var-IMAGE_ROOTFS'><filename>IMAGE_ROOTFS</filename></link> | ||
6877 | variable for more information. | ||
6878 | </para> | ||
6879 | </glossdef> | ||
6880 | </glossentry> | ||
6881 | |||
6882 | <glossentry id='var-RPROVIDES'><glossterm>RPROVIDES</glossterm> | ||
6883 | <glossdef> | ||
6884 | <para> | ||
6885 | A list of package name aliases that a package also provides. | ||
6886 | These aliases are useful for satisfying runtime dependencies | ||
6887 | of other packages both during the build and on the target | ||
6888 | (as specified by | ||
6889 | <filename><link linkend='var-RDEPENDS'>RDEPENDS</link></filename>). | ||
6890 | <note> | ||
6891 | A package's own name is implicitly already in its | ||
6892 | <filename>RPROVIDES</filename> list. | ||
6893 | </note> | ||
6894 | </para> | ||
6895 | <para> | ||
6896 | As with all package-controlling variables, you must always | ||
6897 | use the variable in conjunction with a package name override. | ||
6898 | Here is an example: | ||
6899 | <literallayout class='monospaced'> | ||
6900 | RPROVIDES_${PN} = "widget-abi-2" | ||
6901 | </literallayout> | ||
6902 | </para> | ||
6903 | </glossdef> | ||
6904 | </glossentry> | ||
6905 | |||
6906 | <glossentry id='var-RRECOMMENDS'><glossterm>RRECOMMENDS</glossterm> | ||
6907 | <glossdef> | ||
6908 | <para> | ||
6909 | A list of packages that extends the usability of a package | ||
6910 | being built. | ||
6911 | The package being built does not depend on this list of | ||
6912 | packages in order to successfully build, but needs them for | ||
6913 | the extended usability. | ||
6914 | To specify runtime dependencies for packages, see the | ||
6915 | <filename><link linkend='var-RDEPENDS'>RDEPENDS</link></filename> | ||
6916 | variable. | ||
6917 | </para> | ||
6918 | |||
6919 | <para> | ||
6920 | The OpenEmbedded build process automatically installs the | ||
6921 | list of packages as part of the built package. | ||
6922 | However, you can remove these packages later if you want. | ||
6923 | If, during the build, a package from the | ||
6924 | <filename>RRECOMMENDS</filename> list cannot be | ||
6925 | found, the build process continues without an error. | ||
6926 | </para> | ||
6927 | |||
6928 | <para> | ||
6929 | You can also prevent packages in the list from being | ||
6930 | installed by using several variables. | ||
6931 | See the | ||
6932 | <link linkend='var-BAD_RECOMMENDATIONS'><filename>BAD_RECOMMENDATIONS</filename></link>, | ||
6933 | <link linkend='var-NO_RECOMMENDATIONS'><filename>NO_RECOMMENDATIONS</filename></link>, | ||
6934 | and | ||
6935 | <link linkend='var-PACKAGE_EXCLUDE'><filename>PACKAGE_EXCLUDE</filename></link> | ||
6936 | variables for more information. | ||
6937 | </para> | ||
6938 | |||
6939 | <para> | ||
6940 | Because the <filename>RRECOMMENDS</filename> variable | ||
6941 | applies to packages being built, you should always attach | ||
6942 | an override to the variable to specify the particular | ||
6943 | package whose usability is being extended. | ||
6944 | For example, suppose you are building a development package | ||
6945 | that is extended to support wireless functionality. | ||
6946 | In this case, you would use the following: | ||
6947 | <literallayout class='monospaced'> | ||
6948 | RRECOMMENDS_${PN}-dev += "<wireless_package_name>" | ||
6949 | </literallayout> | ||
6950 | In the example, the package name | ||
6951 | (<filename>${<link linkend='var-PN'>PN</link>}-dev</filename>) | ||
6952 | must appear as it would in the | ||
6953 | <filename><link linkend='var-PACKAGES'>PACKAGES</link></filename> | ||
6954 | namespace before any renaming of the output package by | ||
6955 | classes such as <filename>debian.bbclass</filename>. | ||
6956 | </para> | ||
6957 | |||
6958 | <para> | ||
6959 | BitBake, which the OpenEmbedded build system uses, supports | ||
6960 | specifying versioned recommends. | ||
6961 | Although the syntax varies depending on the packaging | ||
6962 | format, BitBake hides these differences from you. | ||
6963 | Here is the general syntax to specify versions with | ||
6964 | the <filename>RRECOMMENDS</filename> variable: | ||
6965 | <literallayout class='monospaced'> | ||
6966 | RRECOMMENDS_${PN} = "<package> (<operator> <version>)" | ||
6967 | </literallayout> | ||
6968 | For <filename>operator</filename>, you can specify the | ||
6969 | following: | ||
6970 | <literallayout class='monospaced'> | ||
6971 | = | ||
6972 | < | ||
6973 | > | ||
6974 | <= | ||
6975 | >= | ||
6976 | </literallayout> | ||
6977 | For example, the following sets up a recommend on version | ||
6978 | 1.2 or greater of the package <filename>foo</filename>: | ||
6979 | <literallayout class='monospaced'> | ||
6980 | RRECOMMENDS_${PN} = "foo (>= 1.2)" | ||
6981 | </literallayout> | ||
6982 | </para> | ||
6983 | </glossdef> | ||
6984 | </glossentry> | ||
6985 | |||
6986 | <glossentry id='var-RREPLACES'><glossterm>RREPLACES</glossterm> | ||
6987 | <glossdef> | ||
6988 | <para> | ||
6989 | A list of packages replaced by a package. | ||
6990 | The package manager uses this variable to determine which | ||
6991 | package should be installed to replace other package(s) | ||
6992 | during an upgrade. | ||
6993 | In order to also have the other package(s) removed at the | ||
6994 | same time, you must add the name of the other | ||
6995 | package to the | ||
6996 | <filename><link linkend='var-RCONFLICTS'>RCONFLICTS</link></filename> variable. | ||
6997 | </para> | ||
6998 | <para> | ||
6999 | As with all package-controlling variables, you must use | ||
7000 | this variable in conjunction with a package name | ||
7001 | override. | ||
7002 | Here is an example: | ||
7003 | <literallayout class='monospaced'> | ||
7004 | RREPLACES_${PN} = "other-package-being-replaced" | ||
7005 | </literallayout> | ||
7006 | </para> | ||
7007 | |||
7008 | <para> | ||
7009 | BitBake, which the OpenEmbedded build system uses, supports | ||
7010 | specifying versioned replacements. | ||
7011 | Although the syntax varies depending on the packaging | ||
7012 | format, BitBake hides these differences from you. | ||
7013 | Here is the general syntax to specify versions with | ||
7014 | the <filename>RREPLACES</filename> variable: | ||
7015 | <literallayout class='monospaced'> | ||
7016 | RREPLACES_${PN} = "<package> (<operator> <version>)" | ||
7017 | </literallayout> | ||
7018 | For <filename>operator</filename>, you can specify the | ||
7019 | following: | ||
7020 | <literallayout class='monospaced'> | ||
7021 | = | ||
7022 | < | ||
7023 | > | ||
7024 | <= | ||
7025 | >= | ||
7026 | </literallayout> | ||
7027 | For example, the following sets up a replacement using | ||
7028 | version 1.2 or greater of the package | ||
7029 | <filename>foo</filename>: | ||
7030 | <literallayout class='monospaced'> | ||
7031 | RREPLACES_${PN} = "foo (>= 1.2)" | ||
7032 | </literallayout> | ||
7033 | </para> | ||
7034 | </glossdef> | ||
7035 | </glossentry> | ||
7036 | |||
7037 | <glossentry id='var-RSUGGESTS'><glossterm>RSUGGESTS</glossterm> | ||
7038 | <glossdef> | ||
7039 | <para> | ||
7040 | A list of additional packages that you can suggest for | ||
7041 | installation by the package manager at the time a package | ||
7042 | is installed. | ||
7043 | Not all package managers support this functionality. | ||
7044 | </para> | ||
7045 | <para> | ||
7046 | As with all package-controlling variables, you must always | ||
7047 | use this variable in conjunction with a package name | ||
7048 | override. | ||
7049 | Here is an example: | ||
7050 | <literallayout class='monospaced'> | ||
7051 | RSUGGESTS_${PN} = "useful-package another-package" | ||
7052 | </literallayout> | ||
7053 | </para> | ||
7054 | </glossdef> | ||
7055 | </glossentry> | ||
7056 | |||
7057 | </glossdiv> | ||
7058 | |||
7059 | <glossdiv id='var-glossary-s'><title>S</title> | ||
7060 | |||
7061 | <glossentry id='var-S'><glossterm>S</glossterm> | ||
7062 | <glossdef> | ||
7063 | <para> | ||
7064 | The location in the | ||
7065 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
7066 | where unpacked recipe source code resides. | ||
7067 | This location is within the work directory | ||
7068 | (<filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>), | ||
7069 | which is not static. | ||
7070 | The unpacked source location depends on the recipe name | ||
7071 | (<filename><link linkend='var-PN'>PN</link></filename>) and | ||
7072 | recipe version | ||
7073 | (<filename><link linkend='var-PV'>PV</link></filename>) as | ||
7074 | follows: | ||
7075 | <literallayout class='monospaced'> | ||
7076 | ${WORKDIR}/${PN}-${PV} | ||
7077 | </literallayout> | ||
7078 | As an example, assume a | ||
7079 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
7080 | top-level folder named <filename>poky</filename> and a | ||
7081 | default Build Directory at <filename>poky/build</filename>. | ||
7082 | In this case, the work directory the build system uses | ||
7083 | to keep the unpacked recipe for <filename>db</filename> | ||
7084 | is the following: | ||
7085 | <literallayout class='monospaced'> | ||
7086 | poky/build/tmp/work/qemux86-poky-linux/db/5.1.19-r3/db-5.1.19 | ||
7087 | </literallayout> | ||
7088 | </para> | ||
7089 | </glossdef> | ||
7090 | </glossentry> | ||
7091 | |||
7092 | <glossentry id='var-SANITY_TESTED_DISTROS'><glossterm>SANITY_TESTED_DISTROS</glossterm> | ||
7093 | <glossdef> | ||
7094 | <para> | ||
7095 | A list of the host distribution identifiers that the | ||
7096 | build system has been tested against. | ||
7097 | Identifiers consist of the host distributor ID | ||
7098 | followed by the release, | ||
7099 | as reported by the <filename>lsb_release</filename> tool | ||
7100 | or as read from <filename>/etc/lsb-release</filename>. | ||
7101 | Separate the list items with explicit newline | ||
7102 | characters (<filename>\n</filename>). | ||
7103 | If <filename>SANITY_TESTED_DISTROS</filename> is not empty | ||
7104 | and the current value of | ||
7105 | <link linkend='var-NATIVELSBSTRING'><filename>NATIVELSBSTRING</filename></link> | ||
7106 | does not appear in the list, then the build system reports | ||
7107 | a warning that indicates the current host distribution has | ||
7108 | not been tested as a build host. | ||
7109 | </para> | ||
7110 | </glossdef> | ||
7111 | </glossentry> | ||
7112 | |||
7113 | <glossentry id='var-SDK_ARCH'><glossterm>SDK_ARCH</glossterm> | ||
7114 | <glossdef> | ||
7115 | <para> | ||
7116 | The target architecture for the SDK. | ||
7117 | Typically, you do not directly set this variable. | ||
7118 | Instead, use | ||
7119 | <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>. | ||
7120 | </para> | ||
7121 | </glossdef> | ||
7122 | </glossentry> | ||
7123 | |||
7124 | <glossentry id='var-SDK_DEPLOY'><glossterm>SDK_DEPLOY</glossterm> | ||
7125 | <glossdef> | ||
7126 | <para> | ||
7127 | The directory set up and used by the | ||
7128 | <link linkend='ref-classes-populate-sdk'><filename>populate_sdk_base</filename></link> | ||
7129 | to which the SDK is deployed. | ||
7130 | The <filename>populate_sdk_base</filename> class defines | ||
7131 | <filename>SDK_DEPLOY</filename> as follows: | ||
7132 | <literallayout class='monospaced'> | ||
7133 | SDK_DEPLOY = "${<link linkend='var-TMPDIR'>TMPDIR</link>}/deploy/sdk" | ||
7134 | </literallayout> | ||
7135 | </para> | ||
7136 | </glossdef> | ||
7137 | </glossentry> | ||
7138 | |||
7139 | <glossentry id='var-SDK_DIR'><glossterm>SDK_DIR</glossterm> | ||
7140 | <glossdef> | ||
7141 | <para> | ||
7142 | The parent directory used by the OpenEmbedded build system | ||
7143 | when creating SDK output. | ||
7144 | The | ||
7145 | <link linkend='ref-classes-populate-sdk-*'><filename>populate_sdk_base</filename></link> | ||
7146 | class defines the variable as follows: | ||
7147 | <literallayout class='monospaced'> | ||
7148 | SDK_DIR = "${<link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>}/sdk" | ||
7149 | </literallayout> | ||
7150 | <note> | ||
7151 | The <filename>SDK_DIR</filename> directory is a | ||
7152 | temporary directory as it is part of | ||
7153 | <filename>WORKDIR</filename>. | ||
7154 | The final output directory is | ||
7155 | <link linkend='var-SDK_DEPLOY'><filename>SDK_DEPLOY</filename></link>. | ||
7156 | </note> | ||
7157 | </para> | ||
7158 | </glossdef> | ||
7159 | </glossentry> | ||
7160 | |||
7161 | <glossentry id='var-SDK_NAME'><glossterm>SDK_NAME</glossterm> | ||
7162 | <glossdef> | ||
7163 | <para> | ||
7164 | The base name for SDK output files. | ||
7165 | The name is derived from the | ||
7166 | <link linkend='var-DISTRO'><filename>DISTRO</filename></link>, | ||
7167 | <link linkend='var-TCLIBC'><filename>TCLIBC</filename></link>, | ||
7168 | <link linkend='var-SDK_ARCH'><filename>SDK_ARCH</filename></link>, | ||
7169 | <link linkend='var-IMAGE_BASENAME'><filename>IMAGE_BASENAME</filename></link>, | ||
7170 | and | ||
7171 | <link linkend='var-TUNE_PKGARCH'><filename>TUNE_PKGARCH</filename></link> | ||
7172 | variables: | ||
7173 | <literallayout class='monospaced'> | ||
7174 | SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${IMAGE_BASENAME}-${TUNE_PKGARCH}" | ||
7175 | </literallayout> | ||
7176 | </para> | ||
7177 | </glossdef> | ||
7178 | </glossentry> | ||
7179 | |||
7180 | <glossentry id='var-SDK_OUTPUT'><glossterm>SDK_OUTPUT</glossterm> | ||
7181 | <glossdef> | ||
7182 | <para> | ||
7183 | The location used by the OpenEmbedded build system when | ||
7184 | creating SDK output. | ||
7185 | The | ||
7186 | <link linkend='ref-classes-populate-sdk-*'><filename>populate_sdk_base</filename></link> | ||
7187 | class defines the variable as follows: | ||
7188 | <literallayout class='monospaced'> | ||
7189 | SDK_OUTPUT = "${<link linkend='var-SDK_DIR'>SDK_DIR</link>}/image" | ||
7190 | </literallayout> | ||
7191 | <note> | ||
7192 | The <filename>SDK_OUTPUT</filename> directory is a | ||
7193 | temporary directory as it is part of | ||
7194 | <filename>WORKDIR</filename> by way of | ||
7195 | <filename>SDK_DIR</filename>. | ||
7196 | The final output directory is | ||
7197 | <link linkend='var-SDK_DEPLOY'><filename>SDK_DEPLOY</filename></link>. | ||
7198 | </note> | ||
7199 | |||
7200 | </para> | ||
7201 | </glossdef> | ||
7202 | </glossentry> | ||
7203 | |||
7204 | <glossentry id='var-SDK_PACKAGE_ARCHS'><glossterm>SDK_PACKAGE_ARCHS</glossterm> | ||
7205 | <glossdef> | ||
7206 | <para> | ||
7207 | Specifies a list of architectures compatible with | ||
7208 | the SDK machine. | ||
7209 | This variable is set automatically and should not | ||
7210 | normally be hand-edited. | ||
7211 | Entries are separated using spaces and listed in order | ||
7212 | of priority. | ||
7213 | The default value for | ||
7214 | <filename>SDK_PACKAGE_ARCHS</filename> is "all any noarch | ||
7215 | ${SDK_ARCH}-${SDKPKGSUFFIX}". | ||
7216 | </para> | ||
7217 | </glossdef> | ||
7218 | </glossentry> | ||
7219 | |||
7220 | <glossentry id='var-SDKIMAGE_FEATURES'><glossterm>SDKIMAGE_FEATURES</glossterm> | ||
7221 | <glossdef> | ||
7222 | <para>Equivalent to | ||
7223 | <filename><link linkend='var-IMAGE_FEATURES'>IMAGE_FEATURES</link></filename>. | ||
7224 | However, this variable applies to the SDK generated from an | ||
7225 | image using the following command: | ||
7226 | <literallayout class='monospaced'> | ||
7227 | $ bitbake -c populate_sdk imagename | ||
7228 | </literallayout> | ||
7229 | </para> | ||
7230 | </glossdef> | ||
7231 | </glossentry> | ||
7232 | |||
7233 | <glossentry id='var-SDKMACHINE'><glossterm>SDKMACHINE</glossterm> | ||
7234 | <glossdef> | ||
7235 | <para> | ||
7236 | The machine for which the Application Development Toolkit | ||
7237 | (ADT) or SDK is built. | ||
7238 | In other words, the SDK or ADT is built such that it | ||
7239 | runs on the target you specify with the | ||
7240 | <filename>SDKMACHINE</filename> value. | ||
7241 | The value points to a corresponding | ||
7242 | <filename>.conf</filename> file under | ||
7243 | <filename>conf/machine-sdk/</filename>. | ||
7244 | </para> | ||
7245 | |||
7246 | <para> | ||
7247 | You can use "i686" and "x86_64" as possible values | ||
7248 | for this variable. The variable defaults to "i686" | ||
7249 | and is set in the local.conf file in the Build Directory. | ||
7250 | <literallayout class='monospaced'> | ||
7251 | SDKMACHINE ?= "i686" | ||
7252 | </literallayout> | ||
7253 | <note> | ||
7254 | You cannot set the <filename>SDKMACHINE</filename> | ||
7255 | variable in your distribution configuration file. | ||
7256 | If you do, the configuration will not take affect. | ||
7257 | </note> | ||
7258 | </para> | ||
7259 | </glossdef> | ||
7260 | </glossentry> | ||
7261 | |||
7262 | <glossentry id='var-SDKPATH'><glossterm>SDKPATH</glossterm> | ||
7263 | <glossdef> | ||
7264 | <para> | ||
7265 | Defines the path offered to the user for installation | ||
7266 | of the SDK that is generated by the OpenEmbedded build | ||
7267 | system. | ||
7268 | The path appears as the default location for installing | ||
7269 | the SDK when you run the SDK's installation script. | ||
7270 | You can override the offered path when you run the | ||
7271 | script. | ||
7272 | </para> | ||
7273 | </glossdef> | ||
7274 | </glossentry> | ||
7275 | |||
7276 | <glossentry id='var-SECTION'><glossterm>SECTION</glossterm> | ||
7277 | <glossdef> | ||
7278 | <para>The section in which packages should be categorized. | ||
7279 | Package management utilities can make use of this variable.</para> | ||
7280 | </glossdef> | ||
7281 | </glossentry> | ||
7282 | |||
7283 | <glossentry id='var-SELECTED_OPTIMIZATION'><glossterm>SELECTED_OPTIMIZATION</glossterm> | ||
7284 | <glossdef> | ||
7285 | <para> | ||
7286 | Specifies the optimization flags passed to the C compiler | ||
7287 | when building for the target. | ||
7288 | The flags are passed through the default value of the | ||
7289 | <link linkend='var-TARGET_CFLAGS'><filename>TARGET_CFLAGS</filename></link> | ||
7290 | variable. | ||
7291 | </para> | ||
7292 | |||
7293 | <para> | ||
7294 | The <filename>SELECTED_OPTIMIZATION</filename> variable | ||
7295 | takes the value of | ||
7296 | <filename><link linkend='var-FULL_OPTIMIZATION'>FULL_OPTIMIZATION</link></filename> | ||
7297 | unless <filename><link linkend='var-DEBUG_BUILD'>DEBUG_BUILD</link></filename> = "1". | ||
7298 | If that is the case, the value of | ||
7299 | <filename><link linkend='var-DEBUG_OPTIMIZATION'>DEBUG_OPTIMIZATION</link></filename> is used. | ||
7300 | </para> | ||
7301 | </glossdef> | ||
7302 | </glossentry> | ||
7303 | |||
7304 | <glossentry id='var-SERIAL_CONSOLE'><glossterm>SERIAL_CONSOLE</glossterm> | ||
7305 | <glossdef> | ||
7306 | <para> | ||
7307 | Defines a serial console (TTY) to enable using getty. | ||
7308 | Provide a value that specifies the baud rate followed by | ||
7309 | the TTY device name separated by a space. | ||
7310 | You cannot specify more than one TTY device: | ||
7311 | <literallayout class='monospaced'> | ||
7312 | SERIAL_CONSOLE = "115200 ttyS0" | ||
7313 | </literallayout> | ||
7314 | <note> | ||
7315 | The <filename>SERIAL_CONSOLE</filename> variable | ||
7316 | is deprecated. | ||
7317 | Please use the | ||
7318 | <link linkend='var-SERIAL_CONSOLES'><filename>SERIAL_CONSOLES</filename></link> | ||
7319 | variable. | ||
7320 | </note> | ||
7321 | </para> | ||
7322 | </glossdef> | ||
7323 | </glossentry> | ||
7324 | |||
7325 | <glossentry id='var-SERIAL_CONSOLES'><glossterm>SERIAL_CONSOLES</glossterm> | ||
7326 | <glossdef> | ||
7327 | <para> | ||
7328 | Defines the serial consoles (TTYs) to enable using getty. | ||
7329 | Provide a value that specifies the baud rate followed by | ||
7330 | the TTY device name separated by a semicolon. | ||
7331 | Use spaces to separate multiple devices: | ||
7332 | <literallayout class='monospaced'> | ||
7333 | SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS1" | ||
7334 | </literallayout> | ||
7335 | </para> | ||
7336 | </glossdef> | ||
7337 | </glossentry> | ||
7338 | |||
7339 | <glossentry id='var-SERIAL_CONSOLES_CHECK'><glossterm>SERIAL_CONSOLES_CHECK</glossterm> | ||
7340 | <glossdef> | ||
7341 | <para> | ||
7342 | Similar to | ||
7343 | <link linkend='var-SERIAL_CONSOLES'><filename>SERIAL_CONSOLES</filename></link> | ||
7344 | except the device is checked for existence before attempting | ||
7345 | to enable it. | ||
7346 | This variable is currently only supported with SysVinit | ||
7347 | (i.e. not with systemd). | ||
7348 | </para> | ||
7349 | </glossdef> | ||
7350 | </glossentry> | ||
7351 | |||
7352 | <glossentry id='var-SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS'><glossterm>SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS</glossterm> | ||
7353 | <glossdef> | ||
7354 | <para> | ||
7355 | A list of recipe dependencies that should not be used to | ||
7356 | determine signatures of tasks from one recipe when they | ||
7357 | depend on tasks from another recipe. | ||
7358 | For example: | ||
7359 | <literallayout class='monospaced'> | ||
7360 | SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += "intone->mplayer2" | ||
7361 | </literallayout> | ||
7362 | In this example, <filename>intone</filename> depends on | ||
7363 | <filename>mplayer2</filename>. | ||
7364 | </para> | ||
7365 | |||
7366 | <para> | ||
7367 | Use of this variable is one mechanism to remove dependencies | ||
7368 | that affect task signatures and thus force rebuilds when a | ||
7369 | recipe changes. | ||
7370 | <note><title>Caution</title> | ||
7371 | If you add an inappropriate dependency for a recipe | ||
7372 | relationship, the software might break during | ||
7373 | runtime if the interface of the second recipe was | ||
7374 | changed after the first recipe had been built. | ||
7375 | </note> | ||
7376 | </para> | ||
7377 | </glossdef> | ||
7378 | </glossentry> | ||
7379 | |||
7380 | <glossentry id='var-SIGGEN_EXCLUDERECIPES_ABISAFE'><glossterm>SIGGEN_EXCLUDERECIPES_ABISAFE</glossterm> | ||
7381 | <glossdef> | ||
7382 | <para> | ||
7383 | A list of recipes that are completely stable and will | ||
7384 | never change. | ||
7385 | The ABI for the recipes in the list are presented by | ||
7386 | output from the tasks run to build the recipe. | ||
7387 | Use of this variable is one way to remove dependencies from | ||
7388 | one recipe on another that affect task signatures and | ||
7389 | thus force rebuilds when the recipe changes. | ||
7390 | <note><title>Caution</title> | ||
7391 | If you add an inappropriate variable to this list, | ||
7392 | the software might break at runtime if the | ||
7393 | interface of the recipe was changed after the other | ||
7394 | had been built. | ||
7395 | </note> | ||
7396 | </para> | ||
7397 | </glossdef> | ||
7398 | </glossentry> | ||
7399 | |||
7400 | <glossentry id='var-SITEINFO_BITS'><glossterm>SITEINFO_BITS</glossterm> | ||
7401 | <glossdef> | ||
7402 | <para> | ||
7403 | Specifies the number of bits for the target system CPU. | ||
7404 | The value should be either "32" or "64". | ||
7405 | </para> | ||
7406 | </glossdef> | ||
7407 | </glossentry> | ||
7408 | |||
7409 | <glossentry id='var-SITEINFO_ENDIANNESS'><glossterm>SITEINFO_ENDIANNESS</glossterm> | ||
7410 | <glossdef> | ||
7411 | <para> | ||
7412 | Specifies the endian byte order of the target system. | ||
7413 | The value should be either "le" for little-endian or "be" for big-endian. | ||
7414 | </para> | ||
7415 | </glossdef> | ||
7416 | </glossentry> | ||
7417 | |||
7418 | <glossentry id='var-SOC_FAMILY'><glossterm>SOC_FAMILY</glossterm> | ||
7419 | <glossdef> | ||
7420 | <para> | ||
7421 | Groups together machines based upon the same family | ||
7422 | of SOC (System On Chip). | ||
7423 | You typically set this variable in a common | ||
7424 | <filename>.inc</filename> file that you include in the | ||
7425 | configuration files of all the machines. | ||
7426 | <note> | ||
7427 | You must include | ||
7428 | <filename>conf/machine/include/soc-family.inc</filename> | ||
7429 | for this variable to appear in | ||
7430 | <link linkend='var-MACHINEOVERRIDES'><filename>MACHINEOVERRIDES</filename></link>. | ||
7431 | </note> | ||
7432 | </para> | ||
7433 | </glossdef> | ||
7434 | </glossentry> | ||
7435 | |||
7436 | <glossentry id='var-SOLIBS'><glossterm>SOLIBS</glossterm> | ||
7437 | <glossdef> | ||
7438 | <para> | ||
7439 | Defines the suffix for shared libraries used on the | ||
7440 | target platform. | ||
7441 | By default, this suffix is ".so.*" for all Linux-based | ||
7442 | systems and is defined in the | ||
7443 | <filename>meta/conf/bitbake.conf</filename> configuration | ||
7444 | file. | ||
7445 | </para> | ||
7446 | |||
7447 | <para> | ||
7448 | You will see this variable referenced in the default values | ||
7449 | of <filename>FILES_${PN}</filename>. | ||
7450 | </para> | ||
7451 | </glossdef> | ||
7452 | </glossentry> | ||
7453 | |||
7454 | <glossentry id='var-SOLIBSDEV'><glossterm>SOLIBSDEV</glossterm> | ||
7455 | <glossdef> | ||
7456 | <para> | ||
7457 | Defines the suffix for the development symbolic link | ||
7458 | (symlink) for shared libraries on the target platform. | ||
7459 | By default, this suffix is ".so" for Linux-based | ||
7460 | systems and is defined in the | ||
7461 | <filename>meta/conf/bitbake.conf</filename> configuration | ||
7462 | file. | ||
7463 | </para> | ||
7464 | |||
7465 | <para> | ||
7466 | You will see this variable referenced in the default values | ||
7467 | of <filename>FILES_${PN}-dev</filename>. | ||
7468 | </para> | ||
7469 | </glossdef> | ||
7470 | </glossentry> | ||
7471 | |||
7472 | <glossentry id='var-SOURCE_MIRROR_URL'><glossterm>SOURCE_MIRROR_URL</glossterm> | ||
7473 | <glossdef> | ||
7474 | <para> | ||
7475 | Defines your own | ||
7476 | <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link> | ||
7477 | from which to first fetch source before attempting to fetch | ||
7478 | from the upstream specified in | ||
7479 | <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>. | ||
7480 | </para> | ||
7481 | |||
7482 | <para> | ||
7483 | To use this variable, you must globally inherit the | ||
7484 | <link linkend='ref-classes-own-mirrors'><filename>own-mirrors</filename></link> | ||
7485 | class and then provide the URL to your mirrors. | ||
7486 | Here is an example: | ||
7487 | <literallayout class='monospaced'> | ||
7488 | INHERIT += "own-mirrors" | ||
7489 | SOURCE_MIRROR_URL = "http://example.com/my-source-mirror" | ||
7490 | </literallayout> | ||
7491 | <note> | ||
7492 | You can specify only a single URL in | ||
7493 | <filename>SOURCE_MIRROR_URL</filename>. | ||
7494 | </note> | ||
7495 | </para> | ||
7496 | </glossdef> | ||
7497 | </glossentry> | ||
7498 | |||
7499 | <glossentry id='var-SPDXLICENSEMAP'><glossterm>SPDXLICENSEMAP</glossterm> | ||
7500 | <glossdef> | ||
7501 | <para> | ||
7502 | Maps commonly used license names to their SPDX counterparts | ||
7503 | found in <filename>meta/files/common-licenses/</filename>. | ||
7504 | For the default <filename>SPDXLICENSEMAP</filename> | ||
7505 | mappings, see the | ||
7506 | <filename>meta/conf/licenses.conf</filename> file. | ||
7507 | </para> | ||
7508 | |||
7509 | <para> | ||
7510 | For additional information, see the | ||
7511 | <link linkend='var-LICENSE'><filename>LICENSE</filename></link> | ||
7512 | variable. | ||
7513 | </para> | ||
7514 | </glossdef> | ||
7515 | </glossentry> | ||
7516 | |||
7517 | <glossentry id='var-SPECIAL_PKGSUFFIX'><glossterm>SPECIAL_PKGSUFFIX</glossterm> | ||
7518 | <glossdef> | ||
7519 | <para> | ||
7520 | A list of prefixes for <link linkend='var-PN'><filename>PN</filename></link> used by the | ||
7521 | OpenEmbedded build system to create variants of recipes or packages. | ||
7522 | The list specifies the prefixes to strip off during certain circumstances | ||
7523 | such as the generation of the <link linkend='var-BPN'><filename>BPN</filename></link> variable. | ||
7524 | </para> | ||
7525 | </glossdef> | ||
7526 | </glossentry> | ||
7527 | |||
7528 | <glossentry id='var-SRC_URI'><glossterm>SRC_URI</glossterm> | ||
7529 | <glossdef> | ||
7530 | <para>The list of source files - local or remote. | ||
7531 | This variable tells the OpenEmbedded build system which bits | ||
7532 | to pull in for the build and how to pull them in. | ||
7533 | For example, if the recipe or append file only needs to | ||
7534 | fetch a tarball from the Internet, the recipe or | ||
7535 | append file uses a single <filename>SRC_URI</filename> | ||
7536 | entry. | ||
7537 | On the other hand, if the recipe or append file needs to | ||
7538 | fetch a tarball, apply two patches, and include a custom | ||
7539 | file, the recipe or append file would include four | ||
7540 | instances of the variable.</para> | ||
7541 | <para>The following list explains the available URI protocols: | ||
7542 | <itemizedlist> | ||
7543 | <listitem><para><emphasis><filename>file://</filename> -</emphasis> | ||
7544 | Fetches files, which are usually files shipped with | ||
7545 | the | ||
7546 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>, | ||
7547 | from the local machine. | ||
7548 | The path is relative to the | ||
7549 | <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link> | ||
7550 | variable. | ||
7551 | Thus, the build system searches, in order, from the | ||
7552 | following directories, which are assumed to be a | ||
7553 | subdirectories of the directory in which the | ||
7554 | recipe file (<filename>.bb</filename>) or | ||
7555 | append file (<filename>.bbappend</filename>) | ||
7556 | resides: | ||
7557 | <itemizedlist> | ||
7558 | <listitem><para><emphasis><filename>${BPN}</filename> -</emphasis> | ||
7559 | The base recipe name without any special | ||
7560 | suffix or version numbers. | ||
7561 | </para></listitem> | ||
7562 | <listitem><para><emphasis><filename>${BP}</filename> -</emphasis> | ||
7563 | <filename>${<link linkend='var-BPN'>BPN</link>}-${PV}</filename>. | ||
7564 | The base recipe name and version but without | ||
7565 | any special package name suffix. | ||
7566 | </para></listitem> | ||
7567 | <listitem><para><emphasis>files -</emphasis> | ||
7568 | Files within a directory, which is named | ||
7569 | <filename>files</filename> and is also | ||
7570 | alongside the recipe or append file. | ||
7571 | </para></listitem> | ||
7572 | </itemizedlist> | ||
7573 | <note> | ||
7574 | If you want the build system to pick up files | ||
7575 | specified through a | ||
7576 | <filename>SRC_URI</filename> | ||
7577 | statement from your append file, you need to be | ||
7578 | sure to extend the | ||
7579 | <filename>FILESPATH</filename> | ||
7580 | variable by also using the | ||
7581 | <link linkend='var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></link> | ||
7582 | variable from within your append file. | ||
7583 | </note> | ||
7584 | </para></listitem> | ||
7585 | <listitem><para><emphasis><filename>bzr://</filename> -</emphasis> Fetches files from a | ||
7586 | Bazaar revision control repository.</para></listitem> | ||
7587 | <listitem><para><emphasis><filename>git://</filename> -</emphasis> Fetches files from a | ||
7588 | Git revision control repository.</para></listitem> | ||
7589 | <listitem><para><emphasis><filename>osc://</filename> -</emphasis> Fetches files from | ||
7590 | an OSC (OpenSUSE Build service) revision control repository.</para></listitem> | ||
7591 | <listitem><para><emphasis><filename>repo://</filename> -</emphasis> Fetches files from | ||
7592 | a repo (Git) repository.</para></listitem> | ||
7593 | <listitem><para><emphasis><filename>svk://</filename> -</emphasis> Fetches files from | ||
7594 | an SVK revision control repository.</para></listitem> | ||
7595 | <listitem><para><emphasis><filename>http://</filename> -</emphasis> Fetches files from | ||
7596 | the Internet using <filename>http</filename>.</para></listitem> | ||
7597 | <listitem><para><emphasis><filename>https://</filename> -</emphasis> Fetches files | ||
7598 | from the Internet using <filename>https</filename>.</para></listitem> | ||
7599 | <listitem><para><emphasis><filename>ftp://</filename> -</emphasis> Fetches files | ||
7600 | from the Internet using <filename>ftp</filename>.</para></listitem> | ||
7601 | <listitem><para><emphasis><filename>cvs://</filename> -</emphasis> Fetches files from | ||
7602 | a CVS revision control repository.</para></listitem> | ||
7603 | <listitem><para><emphasis><filename>hg://</filename> -</emphasis> Fetches files from | ||
7604 | a Mercurial (<filename>hg</filename>) revision control repository.</para></listitem> | ||
7605 | <listitem><para><emphasis><filename>p4://</filename> -</emphasis> Fetches files from | ||
7606 | a Perforce (<filename>p4</filename>) revision control repository.</para></listitem> | ||
7607 | <listitem><para><emphasis><filename>ssh://</filename> -</emphasis> Fetches files from | ||
7608 | a secure shell.</para></listitem> | ||
7609 | <listitem><para><emphasis><filename>svn://</filename> -</emphasis> Fetches files from | ||
7610 | a Subversion (<filename>svn</filename>) revision control repository.</para></listitem> | ||
7611 | </itemizedlist> | ||
7612 | </para> | ||
7613 | <para>Standard and recipe-specific options for <filename>SRC_URI</filename> exist. | ||
7614 | Here are standard options: | ||
7615 | <itemizedlist> | ||
7616 | <listitem><para><emphasis><filename>apply</filename> -</emphasis> Whether to apply | ||
7617 | the patch or not. | ||
7618 | The default action is to apply the patch.</para></listitem> | ||
7619 | <listitem><para><emphasis><filename>striplevel</filename> -</emphasis> Which | ||
7620 | striplevel to use when applying the patch. | ||
7621 | The default level is 1.</para></listitem> | ||
7622 | <listitem><para><emphasis><filename>patchdir</filename> -</emphasis> Specifies | ||
7623 | the directory in which the patch should be applied. | ||
7624 | The default is <filename>${</filename><link linkend='var-S'><filename>S</filename></link><filename>}</filename>. | ||
7625 | </para></listitem> | ||
7626 | </itemizedlist> | ||
7627 | </para> | ||
7628 | <para>Here are options specific to recipes building code from a revision control system: | ||
7629 | <itemizedlist> | ||
7630 | <listitem><para><emphasis><filename>mindate</filename> -</emphasis> | ||
7631 | Apply the patch only if | ||
7632 | <link linkend='var-SRCDATE'><filename>SRCDATE</filename></link> | ||
7633 | is equal to or greater than <filename>mindate</filename>. | ||
7634 | </para></listitem> | ||
7635 | <listitem><para><emphasis><filename>maxdate</filename> -</emphasis> | ||
7636 | Apply the patch only if <filename>SRCDATE</filename> | ||
7637 | is not later than <filename>mindate</filename>. | ||
7638 | </para></listitem> | ||
7639 | <listitem><para><emphasis><filename>minrev</filename> -</emphasis> | ||
7640 | Apply the patch only if <filename>SRCREV</filename> | ||
7641 | is equal to or greater than <filename>minrev</filename>. | ||
7642 | </para></listitem> | ||
7643 | <listitem><para><emphasis><filename>maxrev</filename> -</emphasis> | ||
7644 | Apply the patch only if <filename>SRCREV</filename> | ||
7645 | is not later than <filename>maxrev</filename>. | ||
7646 | </para></listitem> | ||
7647 | <listitem><para><emphasis><filename>rev</filename> -</emphasis> | ||
7648 | Apply the patch only if <filename>SRCREV</filename> | ||
7649 | is equal to <filename>rev</filename>. | ||
7650 | </para></listitem> | ||
7651 | <listitem><para><emphasis><filename>notrev</filename> -</emphasis> | ||
7652 | Apply the patch only if <filename>SRCREV</filename> | ||
7653 | is not equal to <filename>rev</filename>. | ||
7654 | </para></listitem> | ||
7655 | </itemizedlist> | ||
7656 | </para> | ||
7657 | <para>Here are some additional options worth mentioning: | ||
7658 | <itemizedlist> | ||
7659 | <listitem><para><emphasis><filename>unpack</filename> -</emphasis> Controls | ||
7660 | whether or not to unpack the file if it is an archive. | ||
7661 | The default action is to unpack the file.</para></listitem> | ||
7662 | <listitem><para><emphasis><filename>subdir</filename> -</emphasis> Places the file | ||
7663 | (or extracts its contents) into the specified | ||
7664 | subdirectory of <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>. | ||
7665 | This option is useful for unusual tarballs or other archives that | ||
7666 | do not have their files already in a subdirectory within the archive. | ||
7667 | </para></listitem> | ||
7668 | <listitem><para><emphasis><filename>name</filename> -</emphasis> Specifies a | ||
7669 | name to be used for association with <filename>SRC_URI</filename> checksums | ||
7670 | when you have more than one file specified in <filename>SRC_URI</filename>. | ||
7671 | </para></listitem> | ||
7672 | <listitem><para><emphasis><filename>downloadfilename</filename> -</emphasis> Specifies | ||
7673 | the filename used when storing the downloaded file.</para></listitem> | ||
7674 | </itemizedlist> | ||
7675 | </para> | ||
7676 | </glossdef> | ||
7677 | </glossentry> | ||
7678 | |||
7679 | <glossentry id='var-SRC_URI_OVERRIDES_PACKAGE_ARCH'><glossterm>SRC_URI_OVERRIDES_PACKAGE_ARCH</glossterm> | ||
7680 | <glossdef> | ||
7681 | <para></para> | ||
7682 | <para> | ||
7683 | By default, the OpenEmbedded build system automatically detects whether | ||
7684 | <filename><link linkend='var-SRC_URI'>SRC_URI</link></filename> | ||
7685 | contains files that are machine-specific. | ||
7686 | If so, the build system automatically changes | ||
7687 | <filename><link linkend='var-PACKAGE_ARCH'>PACKAGE_ARCH</link></filename>. | ||
7688 | Setting this variable to "0" disables this behavior. | ||
7689 | </para> | ||
7690 | </glossdef> | ||
7691 | </glossentry> | ||
7692 | |||
7693 | <glossentry id='var-SRCDATE'><glossterm>SRCDATE</glossterm> | ||
7694 | <glossdef> | ||
7695 | <para> | ||
7696 | The date of the source code used to build the package. | ||
7697 | This variable applies only if the source was fetched from a Source Code Manager (SCM). | ||
7698 | </para> | ||
7699 | </glossdef> | ||
7700 | </glossentry> | ||
7701 | |||
7702 | <glossentry id='var-SRCPV'><glossterm>SRCPV</glossterm> | ||
7703 | <glossdef> | ||
7704 | <para> | ||
7705 | Returns the version string of the current package. | ||
7706 | This string is used to help define the value of | ||
7707 | <link linkend='var-PV'><filename>PV</filename></link>. | ||
7708 | </para> | ||
7709 | |||
7710 | <para> | ||
7711 | The <filename>SRCPV</filename> variable is defined in the | ||
7712 | <filename>meta/conf/bitbake.conf</filename> configuration | ||
7713 | file in the | ||
7714 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
7715 | as follows: | ||
7716 | <literallayout class='monospaced'> | ||
7717 | SRCPV = "${@bb.fetch2.get_srcrev(d)}" | ||
7718 | </literallayout> | ||
7719 | </para> | ||
7720 | |||
7721 | <para> | ||
7722 | Recipes that need to define <filename>PV</filename> do so | ||
7723 | with the help of the <filename>SRCPV</filename>. | ||
7724 | For example, the <filename>ofono</filename> recipe | ||
7725 | (<filename>ofono_git.bb</filename>) located in | ||
7726 | <filename>meta/recipes-connectivity</filename> in the | ||
7727 | Source Directory defines <filename>PV</filename> as | ||
7728 | follows: | ||
7729 | <literallayout class='monospaced'> | ||
7730 | PV = "0.12-git${SRCPV}" | ||
7731 | </literallayout> | ||
7732 | </para> | ||
7733 | </glossdef> | ||
7734 | </glossentry> | ||
7735 | |||
7736 | <glossentry id='var-SRCREV'><glossterm>SRCREV</glossterm> | ||
7737 | <glossdef> | ||
7738 | <para> | ||
7739 | The revision of the source code used to build the package. | ||
7740 | This variable applies to Subversion, Git, Mercurial and Bazaar | ||
7741 | only. | ||
7742 | Note that if you wish to build a fixed revision and you wish | ||
7743 | to avoid performing a query on the remote repository every time | ||
7744 | BitBake parses your recipe, you should specify a <filename>SRCREV</filename> that is a | ||
7745 | full revision identifier and not just a tag. | ||
7746 | </para> | ||
7747 | </glossdef> | ||
7748 | </glossentry> | ||
7749 | |||
7750 | <glossentry id='var-SSTATE_DIR'><glossterm>SSTATE_DIR</glossterm> | ||
7751 | <glossdef> | ||
7752 | <para>The directory for the shared state cache.</para> | ||
7753 | </glossdef> | ||
7754 | </glossentry> | ||
7755 | |||
7756 | <glossentry id='var-SSTATE_MIRROR_ALLOW_NETWORK'><glossterm>SSTATE_MIRROR_ALLOW_NETWORK</glossterm> | ||
7757 | <glossdef> | ||
7758 | <para> | ||
7759 | If set to "1", allows fetches from | ||
7760 | mirrors that are specified in | ||
7761 | <link linkend='var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></link> | ||
7762 | to work even when fetching from the network has been | ||
7763 | disabled by setting <filename>BB_NO_NETWORK</filename> | ||
7764 | to "1". | ||
7765 | Using the | ||
7766 | <filename>SSTATE_MIRROR_ALLOW_NETWORK</filename> | ||
7767 | variable is useful if you have set | ||
7768 | <filename>SSTATE_MIRRORS</filename> to point to an | ||
7769 | internal server for your shared state cache, but | ||
7770 | you want to disable any other fetching from the network. | ||
7771 | </para> | ||
7772 | </glossdef> | ||
7773 | </glossentry> | ||
7774 | |||
7775 | <glossentry id='var-SSTATE_MIRRORS'><glossterm>SSTATE_MIRRORS</glossterm> | ||
7776 | <glossdef> | ||
7777 | <para> | ||
7778 | Configures the OpenEmbedded build system to search other | ||
7779 | mirror locations for prebuilt cache data objects before | ||
7780 | building out the data. | ||
7781 | This variable works like fetcher | ||
7782 | <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link> | ||
7783 | and <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link> | ||
7784 | and points to the cache locations to check for the shared | ||
7785 | objects. | ||
7786 | </para> | ||
7787 | |||
7788 | <para> | ||
7789 | You can specify a filesystem directory or a remote URL such | ||
7790 | as HTTP or FTP. | ||
7791 | The locations you specify need to contain the shared state | ||
7792 | cache (sstate-cache) results from previous builds. | ||
7793 | The sstate-cache you point to can also be from builds on | ||
7794 | other machines. | ||
7795 | </para> | ||
7796 | |||
7797 | <para> | ||
7798 | If a mirror uses the same structure as | ||
7799 | <link linkend='var-SSTATE_DIR'><filename>SSTATE_DIR</filename></link>, | ||
7800 | you need to add | ||
7801 | "PATH" at the end as shown in the examples below. | ||
7802 | The build system substitutes the correct path within the | ||
7803 | directory structure. | ||
7804 | <literallayout class='monospaced'> | ||
7805 | SSTATE_MIRRORS ?= "\ | ||
7806 | file://.* http://someserver.tld/share/sstate/PATH \n \ | ||
7807 | file://.* file:///some/local/dir/sstate/PATH" | ||
7808 | </literallayout> | ||
7809 | </para> | ||
7810 | </glossdef> | ||
7811 | </glossentry> | ||
7812 | |||
7813 | <glossentry id='var-STAGING_BASE_LIBDIR_NATIVE'><glossterm>STAGING_BASE_LIBDIR_NATIVE</glossterm> | ||
7814 | <glossdef> | ||
7815 | <para> | ||
7816 | Specifies the path to the <filename>/lib</filename> | ||
7817 | subdirectory of the sysroot directory for the | ||
7818 | build host. | ||
7819 | </para> | ||
7820 | </glossdef> | ||
7821 | </glossentry> | ||
7822 | |||
7823 | <glossentry id='var-STAGING_BASELIBDIR'><glossterm>STAGING_BASELIBDIR</glossterm> | ||
7824 | <glossdef> | ||
7825 | <para> | ||
7826 | Specifies the path to the <filename>/lib</filename> | ||
7827 | subdirectory of the sysroot directory for the target | ||
7828 | for which the current recipe is being built | ||
7829 | (<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>). | ||
7830 | </para> | ||
7831 | </glossdef> | ||
7832 | </glossentry> | ||
7833 | |||
7834 | <glossentry id='var-STAGING_BINDIR'><glossterm>STAGING_BINDIR</glossterm> | ||
7835 | <glossdef> | ||
7836 | <para> | ||
7837 | Specifies the path to the | ||
7838 | <filename>/usr/bin</filename> subdirectory of the | ||
7839 | sysroot directory for the target for which the current | ||
7840 | recipe is being built | ||
7841 | (<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>). | ||
7842 | </para> | ||
7843 | </glossdef> | ||
7844 | </glossentry> | ||
7845 | |||
7846 | <glossentry id='var-STAGING_BINDIR_CROSS'><glossterm>STAGING_BINDIR_CROSS</glossterm> | ||
7847 | <glossdef> | ||
7848 | <para> | ||
7849 | Specifies the path to the directory containing binary | ||
7850 | configuration scripts. | ||
7851 | These scripts provide configuration information for | ||
7852 | other software that wants to make use of libraries or | ||
7853 | include files provided by the software associated with | ||
7854 | the script. | ||
7855 | <note> | ||
7856 | This style of build configuration has been largely | ||
7857 | replaced by <filename>pkg-config</filename>. | ||
7858 | Consequently, if <filename>pkg-config</filename> | ||
7859 | is supported by the library to which you are linking, | ||
7860 | it is recommended you use | ||
7861 | <filename>pkg-config</filename> instead of a | ||
7862 | provided configuration script. | ||
7863 | </note> | ||
7864 | </para> | ||
7865 | </glossdef> | ||
7866 | </glossentry> | ||
7867 | |||
7868 | <glossentry id='var-STAGING_BINDIR_NATIVE'><glossterm>STAGING_BINDIR_NATIVE</glossterm> | ||
7869 | <glossdef> | ||
7870 | <para> | ||
7871 | Specifies the path to the | ||
7872 | <filename>/usr/bin</filename> subdirectory of the | ||
7873 | sysroot directory for the build host. | ||
7874 | </para> | ||
7875 | </glossdef> | ||
7876 | </glossentry> | ||
7877 | |||
7878 | <glossentry id='var-STAGING_DATADIR'><glossterm>STAGING_DATADIR</glossterm> | ||
7879 | <glossdef> | ||
7880 | <para> | ||
7881 | Specifies the path to the <filename>/usr/share</filename> | ||
7882 | subdirectory of the sysroot directory for the target | ||
7883 | for which the current recipe is being built | ||
7884 | (<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>). | ||
7885 | </para> | ||
7886 | </glossdef> | ||
7887 | </glossentry> | ||
7888 | |||
7889 | <glossentry id='var-STAGING_DIR'><glossterm>STAGING_DIR</glossterm> | ||
7890 | <glossdef> | ||
7891 | <para> | ||
7892 | Specifies the path to the top-level sysroots directory | ||
7893 | (i.e. | ||
7894 | <filename>${</filename><link linkend='var-TMPDIR'><filename>TMPDIR</filename></link><filename>}/sysroots</filename>). | ||
7895 | <note> | ||
7896 | Recipes should never write files directly under | ||
7897 | this directory because the OpenEmbedded build system | ||
7898 | manages the directory automatically. | ||
7899 | Instead, files should be installed to | ||
7900 | <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename> | ||
7901 | within your recipe's | ||
7902 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
7903 | task and then the OpenEmbedded build system will | ||
7904 | stage a subset of those files into the sysroot. | ||
7905 | </note> | ||
7906 | </para> | ||
7907 | </glossdef> | ||
7908 | </glossentry> | ||
7909 | |||
7910 | <glossentry id='var-STAGING_DIR_HOST'><glossterm>STAGING_DIR_HOST</glossterm> | ||
7911 | <glossdef> | ||
7912 | <para> | ||
7913 | Specifies the path to the primary sysroot directory for | ||
7914 | which the target is being built. | ||
7915 | Depending on the type of recipe and the build target, the | ||
7916 | recipe's value is as follows: | ||
7917 | <itemizedlist> | ||
7918 | <listitem><para>For recipes building for the target | ||
7919 | machine, the value is "${STAGING_DIR}/${MACHINE}". | ||
7920 | </para></listitem> | ||
7921 | <listitem><para>For <filename>native</filename> | ||
7922 | recipes building | ||
7923 | for the build host, the value is empty given the | ||
7924 | assumption that when building for the build host, | ||
7925 | the build host's own directories should be used. | ||
7926 | </para></listitem> | ||
7927 | <listitem><para>For <filename>nativesdk</filename> | ||
7928 | recipes that Build for the SDK, the value is | ||
7929 | "${STAGING_DIR}/${MULTIMACH_HOST_SYS}". | ||
7930 | </para></listitem> | ||
7931 | </itemizedlist> | ||
7932 | </para> | ||
7933 | </glossdef> | ||
7934 | </glossentry> | ||
7935 | |||
7936 | <glossentry id='var-STAGING_DATADIR_NATIVE'><glossterm>STAGING_DATADIR_NATIVE</glossterm> | ||
7937 | <glossdef> | ||
7938 | <para> | ||
7939 | Specifies the path to the <filename>/usr/share</filename> | ||
7940 | subdirectory of the sysroot directory for the build host. | ||
7941 | </para> | ||
7942 | </glossdef> | ||
7943 | </glossentry> | ||
7944 | |||
7945 | |||
7946 | |||
7947 | <glossentry id='var-STAGING_DIR_NATIVE'><glossterm>STAGING_DIR_NATIVE</glossterm> | ||
7948 | <glossdef> | ||
7949 | <para> | ||
7950 | Specifies the path to the sysroot directory for the | ||
7951 | build host. | ||
7952 | </para> | ||
7953 | </glossdef> | ||
7954 | </glossentry> | ||
7955 | |||
7956 | <glossentry id='var-STAGING_DIR_TARGET'><glossterm>STAGING_DIR_TARGET</glossterm> | ||
7957 | <glossdef> | ||
7958 | <para> | ||
7959 | Specifies the path to the sysroot directory for the | ||
7960 | target for which the current recipe is being built. | ||
7961 | In most cases, this path is the | ||
7962 | <link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>. | ||
7963 | </para> | ||
7964 | |||
7965 | <para> | ||
7966 | Some recipes build binaries that can run on the target | ||
7967 | system but those binaries in turn generate code for | ||
7968 | another different system (e.g. cross-canadian recipes). | ||
7969 | Using terminology from GNU, the primary system is referred | ||
7970 | to as the "HOST" and the secondary, or different, system is | ||
7971 | referred to as the "TARGET". | ||
7972 | Thus, the binaries run on the "HOST" system and | ||
7973 | and generate binaries for the "TARGET" system. | ||
7974 | <filename>STAGING_DIR_TARGET</filename> points to the | ||
7975 | sysroot used for the "TARGET" system. | ||
7976 | </para> | ||
7977 | </glossdef> | ||
7978 | </glossentry> | ||
7979 | |||
7980 | <glossentry id='var-STAGING_ETCDIR_NATIVE'><glossterm>STAGING_ETCDIR_NATIVE</glossterm> | ||
7981 | <glossdef> | ||
7982 | <para> | ||
7983 | Specifies the path to the <filename>/etc</filename> | ||
7984 | subdirectory of the sysroot directory for the | ||
7985 | build host. | ||
7986 | </para> | ||
7987 | </glossdef> | ||
7988 | </glossentry> | ||
7989 | |||
7990 | <glossentry id='var-STAGING_EXECPREFIXDIR'><glossterm>STAGING_EXECPREFIXDIR</glossterm> | ||
7991 | <glossdef> | ||
7992 | <para> | ||
7993 | Specifies the path to the <filename>/usr</filename> | ||
7994 | subdirectory of the sysroot directory for the target | ||
7995 | for which the current recipe is being built | ||
7996 | (<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>). | ||
7997 | </para> | ||
7998 | </glossdef> | ||
7999 | </glossentry> | ||
8000 | |||
8001 | <glossentry id='var-STAGING_INCDIR'><glossterm>STAGING_INCDIR</glossterm> | ||
8002 | <glossdef> | ||
8003 | <para> | ||
8004 | Specifies the path to the | ||
8005 | <filename>/usr/include</filename> subdirectory of the | ||
8006 | sysroot directory for the target for which the current | ||
8007 | recipe being built | ||
8008 | (<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>). | ||
8009 | </para> | ||
8010 | </glossdef> | ||
8011 | </glossentry> | ||
8012 | |||
8013 | <glossentry id='var-STAGING_INCDIR_NATIVE'><glossterm>STAGING_INCDIR_NATIVE</glossterm> | ||
8014 | <glossdef> | ||
8015 | <para> | ||
8016 | Specifies the path to the <filename>/usr/include</filename> | ||
8017 | subdirectory of the sysroot directory for the build host. | ||
8018 | </para> | ||
8019 | </glossdef> | ||
8020 | </glossentry> | ||
8021 | |||
8022 | <glossentry id='var-STAGING_LIBDIR'><glossterm>STAGING_LIBDIR</glossterm> | ||
8023 | <glossdef> | ||
8024 | <para> | ||
8025 | Specifies the path to the <filename>/usr/lib</filename> | ||
8026 | subdirectory of the sysroot directory for the target for | ||
8027 | which the current recipe is being built | ||
8028 | (<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>). | ||
8029 | </para> | ||
8030 | </glossdef> | ||
8031 | </glossentry> | ||
8032 | |||
8033 | <glossentry id='var-STAGING_LIBDIR_NATIVE'><glossterm>STAGING_LIBDIR_NATIVE</glossterm> | ||
8034 | <glossdef> | ||
8035 | <para> | ||
8036 | Specifies the path to the <filename>/usr/lib</filename> | ||
8037 | subdirectory of the sysroot directory for the build host. | ||
8038 | </para> | ||
8039 | </glossdef> | ||
8040 | </glossentry> | ||
8041 | |||
8042 | <glossentry id='var-STAGING_KERNEL_DIR'><glossterm>STAGING_KERNEL_DIR</glossterm> | ||
8043 | <glossdef> | ||
8044 | <para> | ||
8045 | The directory with kernel headers that are required to build out-of-tree | ||
8046 | modules. | ||
8047 | </para> | ||
8048 | </glossdef> | ||
8049 | </glossentry> | ||
8050 | |||
8051 | <glossentry id='var-STAMP'><glossterm>STAMP</glossterm> | ||
8052 | <glossdef> | ||
8053 | <para> | ||
8054 | Specifies the base path used to create recipe stamp files. | ||
8055 | The path to an actual stamp file is constructed by evaluating this | ||
8056 | string and then appending additional information. | ||
8057 | Currently, the default assignment for <filename>STAMP</filename> | ||
8058 | as set in the <filename>meta/conf/bitbake.conf</filename> file | ||
8059 | is: | ||
8060 | <literallayout class='monospaced'> | ||
8061 | STAMP = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}" | ||
8062 | </literallayout> | ||
8063 | See <link linkend='var-STAMPS_DIR'><filename>STAMPS_DIR</filename></link>, | ||
8064 | <link linkend='var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></link>, | ||
8065 | <link linkend='var-PN'><filename>PN</filename></link>, | ||
8066 | <link linkend='var-EXTENDPE'><filename>EXTENDPE</filename></link>, | ||
8067 | <link linkend='var-PV'><filename>PV</filename></link>, and | ||
8068 | <link linkend='var-PR'><filename>PR</filename></link> for related variable | ||
8069 | information. | ||
8070 | </para> | ||
8071 | </glossdef> | ||
8072 | </glossentry> | ||
8073 | |||
8074 | <glossentry id='var-STAMPS_DIR'><glossterm>STAMPS_DIR</glossterm> | ||
8075 | <glossdef> | ||
8076 | <para> | ||
8077 | Specifies the base directory in which the OpenEmbedded | ||
8078 | build system places stamps. | ||
8079 | The default directory is | ||
8080 | <filename>${TMPDIR}/stamps</filename>. | ||
8081 | </para> | ||
8082 | </glossdef> | ||
8083 | </glossentry> | ||
8084 | |||
8085 | <glossentry id='var-SUMMARY'><glossterm>SUMMARY</glossterm> | ||
8086 | <glossdef> | ||
8087 | <para>The short (72 characters or less) summary of the binary package for packaging | ||
8088 | systems such as <filename>opkg</filename>, <filename>rpm</filename> or | ||
8089 | <filename>dpkg</filename>. | ||
8090 | By default, <filename>SUMMARY</filename> is used to define | ||
8091 | the <link linkend='var-DESCRIPTION'><filename>DESCRIPTION</filename></link> | ||
8092 | variable if <filename>DESCRIPTION</filename> is not set | ||
8093 | in the recipe. | ||
8094 | </para> | ||
8095 | </glossdef> | ||
8096 | </glossentry> | ||
8097 | |||
8098 | <glossentry id='var-SYSLINUX_DEFAULT_CONSOLE'><glossterm>SYSLINUX_DEFAULT_CONSOLE</glossterm> | ||
8099 | <glossdef> | ||
8100 | <para> | ||
8101 | Specifies the kernel boot default console. | ||
8102 | If you want to use a console other than the default, | ||
8103 | set this variable in your recipe as follows where "X" is | ||
8104 | the console number you want to use: | ||
8105 | <literallayout class='monospaced'> | ||
8106 | SYSLINUX_DEFAULT_CONSOLE = "console=ttyX" | ||
8107 | </literallayout> | ||
8108 | </para> | ||
8109 | |||
8110 | <para> | ||
8111 | The | ||
8112 | <link linkend='ref-classes-syslinux'><filename>syslinux</filename></link> | ||
8113 | class initially sets this variable to null but then checks | ||
8114 | for a value later. | ||
8115 | </para> | ||
8116 | </glossdef> | ||
8117 | </glossentry> | ||
8118 | |||
8119 | <glossentry id='var-SYSLINUX_OPTS'><glossterm>SYSLINUX_OPTS</glossterm> | ||
8120 | <glossdef> | ||
8121 | <para> | ||
8122 | Lists additional options to add to the syslinux file. | ||
8123 | You need to set this variable in your recipe. | ||
8124 | If you want to list multiple options, separate the options | ||
8125 | with a semicolon character (<filename>;</filename>). | ||
8126 | </para> | ||
8127 | |||
8128 | <para> | ||
8129 | The | ||
8130 | <link linkend='ref-classes-syslinux'><filename>syslinux</filename></link> | ||
8131 | class uses this variable to create a set of options. | ||
8132 | </para> | ||
8133 | </glossdef> | ||
8134 | </glossentry> | ||
8135 | |||
8136 | <glossentry id='var-SYSLINUX_SERIAL'><glossterm>SYSLINUX_SERIAL</glossterm> | ||
8137 | <glossdef> | ||
8138 | <para> | ||
8139 | Specifies the alternate serial port or turns it off. | ||
8140 | To turn off serial, set this variable to an empty string | ||
8141 | in your recipe. | ||
8142 | The variable's default value is set in the | ||
8143 | <link linkend='ref-classes-syslinux'><filename>syslinux</filename></link> | ||
8144 | as follows: | ||
8145 | <literallayout class='monospaced'> | ||
8146 | SYSLINUX_SERIAL ?= "0 115200" | ||
8147 | </literallayout> | ||
8148 | The class checks for and uses the variable as needed. </para> | ||
8149 | </glossdef> | ||
8150 | </glossentry> | ||
8151 | |||
8152 | <glossentry id='var-SYSLINUX_SPLASH'><glossterm>SYSLINUX_SPLASH</glossterm> | ||
8153 | <glossdef> | ||
8154 | <para> | ||
8155 | An <filename>.LSS</filename> file used as the background | ||
8156 | for the VGA boot menu when you are using the boot menu. | ||
8157 | You need to set this variable in your recipe. | ||
8158 | </para> | ||
8159 | |||
8160 | <para> | ||
8161 | The | ||
8162 | <link linkend='ref-classes-syslinux'><filename>syslinux</filename></link> | ||
8163 | class checks for this variable and if found, the | ||
8164 | OpenEmbedded build system installs the splash screen. | ||
8165 | </para> | ||
8166 | </glossdef> | ||
8167 | </glossentry> | ||
8168 | |||
8169 | <glossentry id='var-SYSLINUX_SERIAL_TTY'><glossterm>SYSLINUX_SERIAL_TTY</glossterm> | ||
8170 | <glossdef> | ||
8171 | <para> | ||
8172 | Specifies the alternate console=tty... kernel boot argument. | ||
8173 | The variable's default value is set in the | ||
8174 | <link linkend='ref-classes-syslinux'><filename>syslinux</filename></link> | ||
8175 | as follows: | ||
8176 | <literallayout class='monospaced'> | ||
8177 | SYSLINUX_SERIAL_TTY ?= "console=ttyS0,115200" | ||
8178 | </literallayout> | ||
8179 | The class checks for and uses the variable as needed. | ||
8180 | </para> | ||
8181 | </glossdef> | ||
8182 | </glossentry> | ||
8183 | |||
8184 | <glossentry id='var-SYSROOT_PREPROCESS_FUNCS'><glossterm>SYSROOT_PREPROCESS_FUNCS</glossterm> | ||
8185 | <glossdef> | ||
8186 | <para> | ||
8187 | A list of functions to execute after files are staged into | ||
8188 | the sysroot. | ||
8189 | These functions are usually used to apply additional | ||
8190 | processing on the staged files, or to stage additional | ||
8191 | files. | ||
8192 | </para> | ||
8193 | </glossdef> | ||
8194 | </glossentry> | ||
8195 | |||
8196 | <glossentry id='var-SYSTEMD_AUTO_ENABLE'><glossterm>SYSTEMD_AUTO_ENABLE</glossterm> | ||
8197 | <glossdef> | ||
8198 | <para> | ||
8199 | For recipes that inherit the | ||
8200 | <link linkend='ref-classes-systemd'><filename>systemd</filename></link> | ||
8201 | class, this variable specifies whether the service you have | ||
8202 | specified in | ||
8203 | <link linkend='var-SYSTEMD_SERVICE'><filename>SYSTEMD_SERVICE</filename></link> | ||
8204 | should be started automatically or not. | ||
8205 | By default, the service is enabled to automatically start | ||
8206 | at boot time. | ||
8207 | The default setting is in the | ||
8208 | <link linkend='ref-classes-systemd'><filename>systemd</filename></link> | ||
8209 | class as follows: | ||
8210 | <literallayout class='monospaced'> | ||
8211 | SYSTEMD_AUTO_ENABLE ??= "enable" | ||
8212 | </literallayout> | ||
8213 | You can disable the service by setting the variable to | ||
8214 | "disable". | ||
8215 | </para> | ||
8216 | </glossdef> | ||
8217 | </glossentry> | ||
8218 | |||
8219 | <glossentry id='var-SYSTEMD_PACKAGES'><glossterm>SYSTEMD_PACKAGES</glossterm> | ||
8220 | <glossdef> | ||
8221 | <para> | ||
8222 | For recipes that inherit the | ||
8223 | <link linkend='ref-classes-systemd'><filename>systemd</filename></link> | ||
8224 | class, this variable locates the systemd unit files when | ||
8225 | they are not found in the main recipe's package. | ||
8226 | By default, the | ||
8227 | <filename>SYSTEMD_PACKAGES</filename> variable is set | ||
8228 | such that the systemd unit files are assumed to reside in | ||
8229 | the recipes main package: | ||
8230 | <literallayout class='monospaced'> | ||
8231 | SYSTEMD_PACKAGES ?= "${PN}" | ||
8232 | </literallayout> | ||
8233 | If these unit files are not in this recipe's main | ||
8234 | package, you need to use | ||
8235 | <filename>SYSTEMD_PACKAGES</filename> to list the package | ||
8236 | or packages in which the build system can find the systemd | ||
8237 | unit files. | ||
8238 | </para> | ||
8239 | </glossdef> | ||
8240 | </glossentry> | ||
8241 | |||
8242 | <glossentry id='var-SYSTEMD_SERVICE'><glossterm>SYSTEMD_SERVICE</glossterm> | ||
8243 | <glossdef> | ||
8244 | <para> | ||
8245 | For recipes that inherit the | ||
8246 | <link linkend='ref-classes-systemd'><filename>systemd</filename></link> | ||
8247 | class, this variable specifies the systemd service name for | ||
8248 | a package. | ||
8249 | </para> | ||
8250 | |||
8251 | <para> | ||
8252 | When you specify this file in your recipe, use a package | ||
8253 | name override to indicate the package to which the value | ||
8254 | applies. | ||
8255 | Here is an example from the connman recipe: | ||
8256 | <literallayout class='monospaced'> | ||
8257 | SYSTEMD_SERVICE_${PN} = "connman.service" | ||
8258 | </literallayout> | ||
8259 | </para> | ||
8260 | </glossdef> | ||
8261 | </glossentry> | ||
8262 | |||
8263 | </glossdiv> | ||
8264 | |||
8265 | <glossdiv id='var-glossary-t'><title>T</title> | ||
8266 | |||
8267 | <glossentry id='var-T'><glossterm>T</glossterm> | ||
8268 | <glossdef> | ||
8269 | <para>This variable points to a directory were BitBake places | ||
8270 | temporary files, which consist mostly of task logs and | ||
8271 | scripts, when building a particular recipe. | ||
8272 | The variable is typically set as follows: | ||
8273 | <literallayout class='monospaced'> | ||
8274 | T = "${WORKDIR}/temp" | ||
8275 | </literallayout> | ||
8276 | The <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link> | ||
8277 | is the directory into which BitBake unpacks and builds the | ||
8278 | recipe. | ||
8279 | The default <filename>bitbake.conf</filename> file sets this variable.</para> | ||
8280 | <para>The <filename>T</filename> variable is not to be confused with | ||
8281 | the <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link> variable, | ||
8282 | which points to the root of the directory tree where BitBake | ||
8283 | places the output of an entire build. | ||
8284 | </para> | ||
8285 | </glossdef> | ||
8286 | </glossentry> | ||
8287 | |||
8288 | <glossentry id='var-TARGET_ARCH'><glossterm>TARGET_ARCH</glossterm> | ||
8289 | <glossdef> | ||
8290 | <para> | ||
8291 | The target machine's architecture. | ||
8292 | The OpenEmbedded build system supports many | ||
8293 | architectures. | ||
8294 | Here is an example list of architectures supported. | ||
8295 | This list is by no means complete as the architecture | ||
8296 | is configurable: | ||
8297 | <literallayout class='monospaced'> | ||
8298 | arm | ||
8299 | i586 | ||
8300 | x86_64 | ||
8301 | powerpc | ||
8302 | powerpc64 | ||
8303 | mips | ||
8304 | mipsel | ||
8305 | </literallayout> | ||
8306 | For additional information on machine architectures, see | ||
8307 | the | ||
8308 | <link linkend='var-TUNE_ARCH'><filename>TUNE_ARCH</filename></link> | ||
8309 | variable. | ||
8310 | </para> | ||
8311 | </glossdef> | ||
8312 | </glossentry> | ||
8313 | |||
8314 | <glossentry id='var-TARGET_AS_ARCH'><glossterm>TARGET_AS_ARCH</glossterm> | ||
8315 | <glossdef> | ||
8316 | <para> | ||
8317 | Specifies architecture-specific assembler flags for the | ||
8318 | target system. | ||
8319 | <filename>TARGET_AS_ARCH</filename> is initialized from | ||
8320 | <link linkend='var-TUNE_ASARGS'><filename>TUNE_ASARGS</filename></link> | ||
8321 | by default in the BitBake configuration file | ||
8322 | (<filename>meta/conf/bitbake.conf</filename>): | ||
8323 | <literallayout class='monospaced'> | ||
8324 | TARGET_AS_ARCH = "${TUNE_ASARGS}" | ||
8325 | </literallayout> | ||
8326 | </para> | ||
8327 | </glossdef> | ||
8328 | </glossentry> | ||
8329 | |||
8330 | <glossentry id='var-TARGET_CC_ARCH'><glossterm>TARGET_CC_ARCH</glossterm> | ||
8331 | <glossdef> | ||
8332 | <para> | ||
8333 | Specifies architecture-specific C compiler flags for the | ||
8334 | target system. | ||
8335 | <filename>TARGET_CC_ARCH</filename> is initialized from | ||
8336 | <link linkend='var-TUNE_CCARGS'><filename>TUNE_CCARGS</filename></link> | ||
8337 | by default. | ||
8338 | <note> | ||
8339 | It is a common workaround to append | ||
8340 | <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link> | ||
8341 | to <filename>TARGET_CC_ARCH</filename> | ||
8342 | in recipes that build software for the target that | ||
8343 | would not otherwise respect the exported | ||
8344 | <filename>LDFLAGS</filename> variable. | ||
8345 | </note> | ||
8346 | </para> | ||
8347 | </glossdef> | ||
8348 | </glossentry> | ||
8349 | |||
8350 | <glossentry id='var-TARGET_CC_KERNEL_ARCH'><glossterm>TARGET_CC_KERNEL_ARCH</glossterm> | ||
8351 | <glossdef> | ||
8352 | <para> | ||
8353 | This is a specific kernel compiler flag for a CPU or | ||
8354 | Application Binary Interface (ABI) tune. | ||
8355 | The flag is used rarely and only for cases where a | ||
8356 | userspace | ||
8357 | <link linkend='var-TUNE_CCARGS'><filename>TUNE_CCARGS</filename></link> | ||
8358 | is not compatible with the kernel compilation. | ||
8359 | The <filename>TARGET_CC_KERNEL_ARCH</filename> variable | ||
8360 | allows the kernel (and associated modules) to use a | ||
8361 | different configuration. | ||
8362 | See the | ||
8363 | <filename>meta/conf/machine/include/arm/feature-arm-thumb.inc</filename> | ||
8364 | file in the | ||
8365 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
8366 | for an example. | ||
8367 | </para> | ||
8368 | </glossdef> | ||
8369 | </glossentry> | ||
8370 | |||
8371 | <glossentry id='var-TARGET_CFLAGS'><glossterm>TARGET_CFLAGS</glossterm> | ||
8372 | <glossdef> | ||
8373 | <para> | ||
8374 | Specifies the flags to pass to the C compiler when building | ||
8375 | for the target. | ||
8376 | When building in the target context, | ||
8377 | <link linkend='var-CFLAGS'><filename>CFLAGS</filename></link> | ||
8378 | is set to the value of this variable by default. | ||
8379 | </para> | ||
8380 | |||
8381 | <para> | ||
8382 | Additionally, the SDK's environment setup script sets | ||
8383 | the | ||
8384 | <link linkend='var-CFLAGS'><filename>CFLAGS</filename></link> | ||
8385 | variable in the environment to the | ||
8386 | <filename>TARGET_CFLAGS</filename> value so that | ||
8387 | executables built using the SDK also have the flags | ||
8388 | applied. | ||
8389 | </para> | ||
8390 | </glossdef> | ||
8391 | </glossentry> | ||
8392 | |||
8393 | <glossentry id='var-TARGET_CPPFLAGS'><glossterm>TARGET_CPPFLAGS</glossterm> | ||
8394 | <glossdef> | ||
8395 | <para> | ||
8396 | Specifies the flags to pass to the C pre-processor | ||
8397 | (i.e. to both the C and the C++ compilers) when building | ||
8398 | for the target. | ||
8399 | When building in the target context, | ||
8400 | <link linkend='var-CPPFLAGS'><filename>CPPFLAGS</filename></link> | ||
8401 | is set to the value of this variable by default. | ||
8402 | </para> | ||
8403 | |||
8404 | <para> | ||
8405 | Additionally, the SDK's environment setup script sets | ||
8406 | the | ||
8407 | <link linkend='var-CPPFLAGS'><filename>CPPFLAGS</filename></link> | ||
8408 | variable in the environment to the | ||
8409 | <filename>TARGET_CPPFLAGS</filename> value so that | ||
8410 | executables built using the SDK also have the flags | ||
8411 | applied. | ||
8412 | </para> | ||
8413 | </glossdef> | ||
8414 | </glossentry> | ||
8415 | |||
8416 | <glossentry id='var-TARGET_CXXFLAGS'><glossterm>TARGET_CXXFLAGS</glossterm> | ||
8417 | <glossdef> | ||
8418 | <para> | ||
8419 | Specifies the flags to pass to the C++ compiler when | ||
8420 | building for the target. | ||
8421 | When building in the target context, | ||
8422 | <link linkend='var-CXXFLAGS'><filename>CXXFLAGS</filename></link> | ||
8423 | is set to the value of this variable by default. | ||
8424 | </para> | ||
8425 | |||
8426 | <para> | ||
8427 | Additionally, the SDK's environment setup script sets | ||
8428 | the | ||
8429 | <link linkend='var-CXXFLAGS'><filename>CXXFLAGS</filename></link> | ||
8430 | variable in the environment to the | ||
8431 | <filename>TARGET_CXXFLAGS</filename> value so that | ||
8432 | executables built using the SDK also have the flags | ||
8433 | applied. | ||
8434 | </para> | ||
8435 | </glossdef> | ||
8436 | </glossentry> | ||
8437 | |||
8438 | <glossentry id='var-TARGET_FPU'><glossterm>TARGET_FPU</glossterm> | ||
8439 | <glossdef> | ||
8440 | <para>Specifies the method for handling FPU code. | ||
8441 | For FPU-less targets, which include most ARM CPUs, the variable must be | ||
8442 | set to "soft". | ||
8443 | If not, the kernel emulation gets used, which results in a performance penalty.</para> | ||
8444 | </glossdef> | ||
8445 | </glossentry> | ||
8446 | |||
8447 | <glossentry id='var-TARGET_LD_ARCH'><glossterm>TARGET_LD_ARCH</glossterm> | ||
8448 | <glossdef> | ||
8449 | <para> | ||
8450 | Specifies architecture-specific linker flags for the | ||
8451 | target system. | ||
8452 | <filename>TARGET_LD_ARCH</filename> is initialized from | ||
8453 | <link linkend='var-TUNE_LDARGS'><filename>TUNE_LDARGS</filename></link> | ||
8454 | by default in the BitBake configuration file | ||
8455 | (<filename>meta/conf/bitbake.conf</filename>): | ||
8456 | <literallayout class='monospaced'> | ||
8457 | TARGET_LD_ARCH = "${TUNE_LDARGS}" | ||
8458 | </literallayout> | ||
8459 | </para> | ||
8460 | </glossdef> | ||
8461 | </glossentry> | ||
8462 | |||
8463 | <glossentry id='var-TARGET_LDFLAGS'><glossterm>TARGET_LDFLAGS</glossterm> | ||
8464 | <glossdef> | ||
8465 | <para> | ||
8466 | Specifies the flags to pass to the linker when building | ||
8467 | for the target. | ||
8468 | When building in the target context, | ||
8469 | <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link> | ||
8470 | is set to the value of this variable by default. | ||
8471 | </para> | ||
8472 | |||
8473 | <para> | ||
8474 | Additionally, the SDK's environment setup script sets | ||
8475 | the | ||
8476 | <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link> | ||
8477 | variable in the environment to the | ||
8478 | <filename>TARGET_LDFLAGS</filename> value so that | ||
8479 | executables built using the SDK also have the flags | ||
8480 | applied. | ||
8481 | </para> | ||
8482 | </glossdef> | ||
8483 | </glossentry> | ||
8484 | |||
8485 | <glossentry id='var-TARGET_OS'><glossterm>TARGET_OS</glossterm> | ||
8486 | <glossdef> | ||
8487 | <para>Specifies the target's operating system. | ||
8488 | The variable can be set to "linux" for <filename>eglibc</filename>-based systems and | ||
8489 | to "linux-uclibc" for <filename>uclibc</filename>. | ||
8490 | For ARM/EABI targets, there are also "linux-gnueabi" and | ||
8491 | "linux-uclibc-gnueabi" values possible.</para> | ||
8492 | </glossdef> | ||
8493 | </glossentry> | ||
8494 | |||
8495 | <glossentry id='var-TCLIBC'><glossterm>TCLIBC</glossterm> | ||
8496 | <glossdef> | ||
8497 | <para> | ||
8498 | Specifies the GNU standard C library (<filename>libc</filename>) | ||
8499 | variant to use during the build process. | ||
8500 | This variable replaces <filename>POKYLIBC</filename>, which is no longer | ||
8501 | supported. | ||
8502 | </para> | ||
8503 | <para> | ||
8504 | You can select "eglibc" or "uclibc". | ||
8505 | <note> | ||
8506 | This release of the Yocto Project does not support the | ||
8507 | <filename>glibc</filename> implementation of <filename>libc</filename>. | ||
8508 | </note> | ||
8509 | </para> | ||
8510 | </glossdef> | ||
8511 | </glossentry> | ||
8512 | |||
8513 | <glossentry id='var-TCMODE'><glossterm>TCMODE</glossterm> | ||
8514 | <glossdef> | ||
8515 | <para> | ||
8516 | Specifies the toolchain selector. | ||
8517 | <filename>TCMODE</filename> controls the characteristics | ||
8518 | of the generated packages and images by telling the | ||
8519 | OpenEmbedded build system which toolchain profile to use. | ||
8520 | By default, the OpenEmbedded build system builds its own | ||
8521 | internal toolchain. | ||
8522 | The variable's default value is "default", which uses | ||
8523 | that internal toolchain. | ||
8524 | <note> | ||
8525 | If <filename>TCMODE</filename> is set to a value | ||
8526 | other than "default", then it is your responsibility | ||
8527 | to ensure that the toolchain is compatible with the | ||
8528 | default toolchain. | ||
8529 | Using older or newer versions of these components | ||
8530 | might cause build problems. | ||
8531 | See the | ||
8532 | <ulink url='&YOCTO_RELEASE_NOTES;'>Release Notes</ulink> | ||
8533 | for the specific components with which the toolchain | ||
8534 | must be compatible. | ||
8535 | </note> | ||
8536 | </para> | ||
8537 | |||
8538 | <para> | ||
8539 | With additional layers, it is possible to use a pre-compiled | ||
8540 | external toolchain. | ||
8541 | One example is the Sourcery G++ Toolchain. | ||
8542 | The support for this toolchain resides in the separate | ||
8543 | <filename>meta-sourcery</filename> layer at | ||
8544 | <ulink url='http://github.com/MentorEmbedded/meta-sourcery/'></ulink>. | ||
8545 | You can use <filename>meta-sourcery</filename> as a | ||
8546 | template for adding support for other external toolchains. | ||
8547 | </para> | ||
8548 | |||
8549 | <para> | ||
8550 | The <filename>TCMODE</filename> variable points the build | ||
8551 | system to a file in | ||
8552 | <filename>conf/distro/include/tcmode-${TCMODE}.inc</filename>. | ||
8553 | Thus, for <filename>meta-sourcery</filename>, | ||
8554 | which has <filename>conf/distro/include/tcmode-external-sourcery.inc</filename>, | ||
8555 | you would set the variable as follows: | ||
8556 | <literallayout class='monospaced'> | ||
8557 | TCMODE ?= "external-sourcery" | ||
8558 | </literallayout> | ||
8559 | </para> | ||
8560 | |||
8561 | <para> | ||
8562 | The variable is similar to | ||
8563 | <link linkend='var-TCLIBC'><filename>TCLIBC</filename></link>, | ||
8564 | which controls the variant of the GNU standard C library | ||
8565 | (<filename>libc</filename>) used during the build process: | ||
8566 | <filename>eglibc</filename> or <filename>uclibc</filename>. | ||
8567 | </para> | ||
8568 | </glossdef> | ||
8569 | </glossentry> | ||
8570 | |||
8571 | <glossentry id='var-TEST_EXPORT_DIR'><glossterm>TEST_EXPORT_DIR</glossterm> | ||
8572 | <glossdef> | ||
8573 | <para> | ||
8574 | The location the OpenEmbedded build system uses to export | ||
8575 | tests when the | ||
8576 | <link linkend='var-TEST_EXPORT_ONLY'><filename>TEST_EXPORT_ONLY</filename></link> | ||
8577 | variable is set to "1". | ||
8578 | </para> | ||
8579 | |||
8580 | <para> | ||
8581 | The <filename>TEST_EXPORT_DIR</filename> variable defaults | ||
8582 | to <filename>"${TMPDIR}/testimage/${PN}"</filename>. | ||
8583 | </para> | ||
8584 | </glossdef> | ||
8585 | </glossentry> | ||
8586 | |||
8587 | <glossentry id='var-TEST_EXPORT_ONLY'><glossterm>TEST_EXPORT_ONLY</glossterm> | ||
8588 | <glossdef> | ||
8589 | <para> | ||
8590 | Specifies to export the tests only. | ||
8591 | Set this variable to "1" if you do not want to run the | ||
8592 | tests but you want them to be exported in a manner that | ||
8593 | you to run them outside of the build system. | ||
8594 | </para> | ||
8595 | </glossdef> | ||
8596 | </glossentry> | ||
8597 | |||
8598 | <glossentry id='var-TEST_IMAGE'><glossterm>TEST_IMAGE</glossterm> | ||
8599 | <glossdef> | ||
8600 | <para> | ||
8601 | Automatically runs the series of automated tests for | ||
8602 | images when an image is successfully built. | ||
8603 | </para> | ||
8604 | |||
8605 | <para> | ||
8606 | These tests are written in Python making use of the | ||
8607 | <filename>unittest</filename> module, and the majority of | ||
8608 | them run commands on the target system over | ||
8609 | <filename>ssh</filename>. | ||
8610 | You can set this variable to "1" in your | ||
8611 | <filename>local.conf</filename> file in the | ||
8612 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
8613 | to have the OpenEmbedded build system automatically run | ||
8614 | these tests after an image successfully builds: | ||
8615 | <literallayout class='monospaced'> | ||
8616 | TEST_IMAGE = "1" | ||
8617 | </literallayout> | ||
8618 | For more information on enabling, running, and writing | ||
8619 | these tests, see the | ||
8620 | "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>" | ||
8621 | section in the Yocto Project Development Manual and the | ||
8622 | "<link linkend='ref-classes-testimage'><filename>testimage.bbclass</filename></link>" | ||
8623 | section. | ||
8624 | </para> | ||
8625 | </glossdef> | ||
8626 | </glossentry> | ||
8627 | |||
8628 | <glossentry id='var-TEST_LOG_DIR'><glossterm>TEST_LOG_DIR</glossterm> | ||
8629 | <glossdef> | ||
8630 | <para> | ||
8631 | Holds the SSH log and the boot log for QEMU machines. | ||
8632 | The <filename>TEST_LOG_DIR</filename> variable defaults | ||
8633 | to <filename>"${WORKDIR}/testimage"</filename>. | ||
8634 | <note> | ||
8635 | Actual test results reside in the task log | ||
8636 | (<filename>log.do_testimage</filename>), which is in | ||
8637 | the <filename>${WORKDIR}/temp/</filename> directory. | ||
8638 | </note> | ||
8639 | </para> | ||
8640 | </glossdef> | ||
8641 | </glossentry> | ||
8642 | |||
8643 | <glossentry id='var-TEST_QEMUBOOT_TIMEOUT'><glossterm>TEST_QEMUBOOT_TIMEOUT</glossterm> | ||
8644 | <glossdef> | ||
8645 | <para> | ||
8646 | The time in seconds allowed for an image to boot before | ||
8647 | automated runtime tests begin to run against an | ||
8648 | image. | ||
8649 | The default timeout period to allow the boot process to | ||
8650 | reach the login prompt is 500 seconds. | ||
8651 | You can specify a different value in the | ||
8652 | <filename>local.conf</filename> file. | ||
8653 | </para> | ||
8654 | |||
8655 | <para> | ||
8656 | For more information on testing images, see the | ||
8657 | "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>" | ||
8658 | section in the Yocto Project Development Manual. | ||
8659 | </para> | ||
8660 | </glossdef> | ||
8661 | </glossentry> | ||
8662 | |||
8663 | <glossentry id='var-TEST_SERVER_IP'><glossterm>TEST_SERVER_IP</glossterm> | ||
8664 | <glossdef> | ||
8665 | <para> | ||
8666 | The IP address of the build machine (host machine). | ||
8667 | This IP address is usually automatically detected. | ||
8668 | However, if detection fails, this variable needs to be set | ||
8669 | to the IP address of the build machine (i.e. where | ||
8670 | the build is taking place). | ||
8671 | <note> | ||
8672 | The <filename>TEST_SERVER_IP</filename> variable | ||
8673 | is only used for a small number of tests such as | ||
8674 | the "smart" test suite, which needs to download | ||
8675 | packages from <filename>DEPLOY_DIR/rpm</filename>. | ||
8676 | </note> | ||
8677 | </para> | ||
8678 | </glossdef> | ||
8679 | </glossentry> | ||
8680 | |||
8681 | <glossentry id='var-TEST_TARGET'><glossterm>TEST_TARGET</glossterm> | ||
8682 | <glossdef> | ||
8683 | <para> | ||
8684 | Specifies the target controller to use when running tests | ||
8685 | against a test image. | ||
8686 | The default controller to use is "qemu": | ||
8687 | <literallayout class='monospaced'> | ||
8688 | TEST_TARGET = "qemu" | ||
8689 | </literallayout> | ||
8690 | A target controller is a class that defines how an | ||
8691 | image gets deployed on a target and how a target is started. | ||
8692 | A layer can extend the controllers by adding a module | ||
8693 | in the layer's <filename>/lib/oeqa/controllers</filename> | ||
8694 | directory and by inheriting the | ||
8695 | <filename>BaseTarget</filename> class, which is an abstract | ||
8696 | class that cannot be used as a value of | ||
8697 | <filename>TEST_TARGET</filename>. | ||
8698 | </para> | ||
8699 | |||
8700 | <para> | ||
8701 | You can provide the following arguments with | ||
8702 | <filename>TEST_TARGET</filename>: | ||
8703 | <itemizedlist> | ||
8704 | <listitem><para><emphasis>"qemu" and "QemuTarget":</emphasis> | ||
8705 | Boots a QEMU image and runs the tests. | ||
8706 | See the | ||
8707 | "<ulink url='&YOCTO_DOCS_DEV_URL;#qemu-image-enabling-tests'>Enabling Runtime Tests on QEMU</ulink>" | ||
8708 | section in the Yocto Project Development Manual for | ||
8709 | more information. | ||
8710 | </para></listitem> | ||
8711 | <listitem><para><emphasis>"simpleremote" and "SimpleRemoteTarget":</emphasis> | ||
8712 | Runs the tests on target hardware that is already | ||
8713 | up and running. | ||
8714 | The hardware can be on the network or it can be | ||
8715 | a device running an image on QEMU. | ||
8716 | You must also set | ||
8717 | <link linkend='var-TEST_TARGET_IP'><filename>TEST_TARGET_IP</filename></link> | ||
8718 | when you use "simpleremote" or "SimpleRemoteTarget". | ||
8719 | <note> | ||
8720 | This argument is defined in | ||
8721 | <filename>meta/lib/oeqa/targetcontrol.py</filename>. | ||
8722 | The small caps names are kept for compatibility | ||
8723 | reasons. | ||
8724 | </note> | ||
8725 | </para></listitem> | ||
8726 | <listitem><para><emphasis>"GummibootTarget":</emphasis> | ||
8727 | Automatically deploys and runs tests on an | ||
8728 | EFI-enabled machine that has a master image | ||
8729 | installed. | ||
8730 | <note> | ||
8731 | This argument is defined in | ||
8732 | <filename>meta/lib/oeqa/controllers/masterimage.py</filename>. | ||
8733 | </note> | ||
8734 | </para></listitem> | ||
8735 | </itemizedlist> | ||
8736 | </para> | ||
8737 | |||
8738 | <para> | ||
8739 | For information on running tests on hardware, see the | ||
8740 | "<ulink url='&YOCTO_DOCS_DEV_URL;#hardware-image-enabling-tests'>Enabling Runtime Tests on Hardware</ulink>" | ||
8741 | section in the Yocto Project Development Manual. | ||
8742 | </para> | ||
8743 | </glossdef> | ||
8744 | </glossentry> | ||
8745 | |||
8746 | <glossentry id='var-TEST_TARGET_IP'><glossterm>TEST_TARGET_IP</glossterm> | ||
8747 | <glossdef> | ||
8748 | <para> | ||
8749 | The IP address of your hardware under test. | ||
8750 | The <filename>TEST_TARGET_IP</filename> variable has no | ||
8751 | effect when | ||
8752 | <link linkend='var-TEST_TARGET'><filename>TEST_TARGET</filename></link> | ||
8753 | is set to "qemu". | ||
8754 | </para> | ||
8755 | |||
8756 | <para> | ||
8757 | When you specify the IP address, you can also include a | ||
8758 | port. | ||
8759 | Here is an example: | ||
8760 | <literallayout class='monospaced'> | ||
8761 | TEST_TARGET_IP = "192.168.1.4:2201" | ||
8762 | </literallayout> | ||
8763 | Specifying a port is useful when SSH is started on a | ||
8764 | non-standard port or in cases when your hardware under test | ||
8765 | is behind a firewall or network that is not directly | ||
8766 | accessible from your host and you need to do port address | ||
8767 | translation. | ||
8768 | </para> | ||
8769 | </glossdef> | ||
8770 | </glossentry> | ||
8771 | |||
8772 | <glossentry id='var-TEST_SUITES'><glossterm>TEST_SUITES</glossterm> | ||
8773 | <glossdef> | ||
8774 | <para> | ||
8775 | An ordered list of tests (modules) to run against | ||
8776 | an image when performing automated runtime testing. | ||
8777 | </para> | ||
8778 | |||
8779 | <para> | ||
8780 | The OpenEmbedded build system provides a core set of tests | ||
8781 | that can be used against images. | ||
8782 | <note> | ||
8783 | Currently, there is only support for running these tests | ||
8784 | under QEMU. | ||
8785 | </note> | ||
8786 | Tests include <filename>ping</filename>, | ||
8787 | <filename>ssh</filename>, <filename>df</filename> among | ||
8788 | others. | ||
8789 | You can add your own tests to the list of tests by | ||
8790 | appending <filename>TEST_SUITES</filename> as follows: | ||
8791 | <literallayout class='monospaced'> | ||
8792 | TEST_SUITES_append = " mytest" | ||
8793 | </literallayout> | ||
8794 | Alternatively, you can provide the "auto" option to | ||
8795 | have all applicable tests run against the image. | ||
8796 | <literallayout class='monospaced'> | ||
8797 | TEST_SUITES_append = " auto" | ||
8798 | </literallayout> | ||
8799 | Using this option causes the build system to automatically | ||
8800 | run tests that are applicable to the image. | ||
8801 | Tests that are not applicable are skipped. | ||
8802 | </para> | ||
8803 | |||
8804 | <para> | ||
8805 | The order in which tests are run is important. | ||
8806 | Tests that depend on another test must appear later in the | ||
8807 | list than the test on which they depend. | ||
8808 | For example, if you append the list of tests with two | ||
8809 | tests (<filename>test_A</filename> and | ||
8810 | <filename>test_B</filename>) where | ||
8811 | <filename>test_B</filename> is dependent on | ||
8812 | <filename>test_A</filename>, then you must order the tests | ||
8813 | as follows: | ||
8814 | <literallayout class='monospaced'> | ||
8815 | TEST_SUITES = " test_A test_B" | ||
8816 | </literallayout> | ||
8817 | </para> | ||
8818 | |||
8819 | <para> | ||
8820 | For more information on testing images, see the | ||
8821 | "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>" | ||
8822 | section in the Yocto Project Development Manual. | ||
8823 | </para> | ||
8824 | </glossdef> | ||
8825 | </glossentry> | ||
8826 | |||
8827 | <glossentry id='var-THISDIR'><glossterm>THISDIR</glossterm> | ||
8828 | <glossdef> | ||
8829 | <para> | ||
8830 | The directory in which the file BitBake is currently | ||
8831 | parsing is located. | ||
8832 | Do not manually set this variable. | ||
8833 | </para> | ||
8834 | </glossdef> | ||
8835 | </glossentry> | ||
8836 | |||
8837 | <glossentry id='var-TMPDIR'><glossterm>TMPDIR</glossterm> | ||
8838 | <glossdef> | ||
8839 | <para> | ||
8840 | This variable is the base directory the OpenEmbedded | ||
8841 | build system uses for all build output and intermediate | ||
8842 | files (other than the shared state cache). | ||
8843 | By default, the <filename>TMPDIR</filename> variable points | ||
8844 | to <filename>tmp</filename> within the | ||
8845 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
8846 | </para> | ||
8847 | |||
8848 | <para> | ||
8849 | If you want to establish this directory in a location other | ||
8850 | than the default, you can uncomment and edit the following | ||
8851 | statement in the | ||
8852 | <filename>conf/local.conf</filename> file in the | ||
8853 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>: | ||
8854 | <literallayout class='monospaced'> | ||
8855 | #TMPDIR = "${TOPDIR}/tmp" | ||
8856 | </literallayout> | ||
8857 | An example use for this scenario is to set | ||
8858 | <filename>TMPDIR</filename> to a local disk, which does | ||
8859 | not use NFS, while having the Build Directory use NFS. | ||
8860 | </para> | ||
8861 | |||
8862 | <para> | ||
8863 | The filesystem used by <filename>TMPDIR</filename> must | ||
8864 | have standard filesystem semantics (i.e. mixed-case files | ||
8865 | are unique, POSIX file locking, and persistent inodes). | ||
8866 | Due to various issues with NFS and bugs in some | ||
8867 | implementations, NFS does not meet this minimum | ||
8868 | requirement. | ||
8869 | Consequently, <filename>TMPDIR</filename> cannot be on | ||
8870 | NFS. | ||
8871 | </para> | ||
8872 | </glossdef> | ||
8873 | </glossentry> | ||
8874 | |||
8875 | <glossentry id='var-TOOLCHAIN_HOST_TASK'><glossterm>TOOLCHAIN_HOST_TASK</glossterm> | ||
8876 | <glossdef> | ||
8877 | <para> | ||
8878 | This variable lists packages the OpenEmbedded build system | ||
8879 | uses when building an SDK, which contains a | ||
8880 | cross-development environment. | ||
8881 | The packages specified by this variable are part of the | ||
8882 | toolchain set that runs on the | ||
8883 | <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>, | ||
8884 | and each package should usually have the prefix | ||
8885 | "nativesdk-". | ||
8886 | When building an SDK using | ||
8887 | <filename>bitbake -c populate_sdk <imagename></filename>, | ||
8888 | a default list of packages is set in this variable, but | ||
8889 | you can add additional packages to the list. | ||
8890 | </para> | ||
8891 | |||
8892 | <para> | ||
8893 | For background information on cross-development toolchains | ||
8894 | in the Yocto Project development environment, see the | ||
8895 | "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>" | ||
8896 | section. | ||
8897 | For information on setting up a cross-development | ||
8898 | environment, see the | ||
8899 | "<ulink url='&YOCTO_DOCS_ADT_URL;#installing-the-adt'>Installing the ADT and Toolchains</ulink>" | ||
8900 | section in the Yocto Project Application Developer's Guide. | ||
8901 | </para> | ||
8902 | </glossdef> | ||
8903 | </glossentry> | ||
8904 | |||
8905 | <glossentry id='var-TOOLCHAIN_TARGET_TASK'><glossterm>TOOLCHAIN_TARGET_TASK</glossterm> | ||
8906 | <glossdef> | ||
8907 | <para> | ||
8908 | This variable lists packages the OpenEmbedded build system | ||
8909 | uses when it creates the target part of an SDK | ||
8910 | (i.e. the part built for the target hardware), which | ||
8911 | includes libraries and headers. | ||
8912 | </para> | ||
8913 | |||
8914 | <para> | ||
8915 | For background information on cross-development toolchains | ||
8916 | in the Yocto Project development environment, see the | ||
8917 | "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>" | ||
8918 | section. | ||
8919 | For information on setting up a cross-development | ||
8920 | environment, see the | ||
8921 | "<ulink url='&YOCTO_DOCS_ADT_URL;#installing-the-adt'>Installing the ADT and Toolchains</ulink>" | ||
8922 | section in the Yocto Project Application Developer's Guide. | ||
8923 | </para> | ||
8924 | </glossdef> | ||
8925 | </glossentry> | ||
8926 | |||
8927 | <glossentry id='var-TOPDIR'><glossterm>TOPDIR</glossterm> | ||
8928 | <glossdef> | ||
8929 | <para> | ||
8930 | The top-level | ||
8931 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
8932 | BitBake automatically sets this variable when you | ||
8933 | initialize your build environment using either | ||
8934 | <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link> | ||
8935 | or | ||
8936 | <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>. | ||
8937 | </para> | ||
8938 | </glossdef> | ||
8939 | </glossentry> | ||
8940 | |||
8941 | <glossentry id='var-TRANSLATED_TARGET_ARCH'><glossterm>TRANSLATED_TARGET_ARCH</glossterm> | ||
8942 | <glossdef> | ||
8943 | <para> | ||
8944 | A sanitized version of | ||
8945 | <link linkend='var-TARGET_ARCH'><filename>TARGET_ARCH</filename></link>. | ||
8946 | This variable is used where the architecture is needed in | ||
8947 | a value where underscores are not allowed, for example | ||
8948 | within package filenames. | ||
8949 | In this case, dash characters replace any underscore | ||
8950 | characters used in TARGET_ARCH. | ||
8951 | </para> | ||
8952 | |||
8953 | <para> | ||
8954 | Do not edit this variable. | ||
8955 | </para> | ||
8956 | </glossdef> | ||
8957 | </glossentry> | ||
8958 | |||
8959 | <glossentry id='var-TUNE_ARCH'><glossterm>TUNE_ARCH</glossterm> | ||
8960 | <glossdef> | ||
8961 | <para> | ||
8962 | The GNU canonical architecture for a specific architecture | ||
8963 | (i.e. <filename>arm</filename>, | ||
8964 | <filename>armeb</filename>, | ||
8965 | <filename>mips</filename>, | ||
8966 | <filename>mips64</filename>, and so forth). | ||
8967 | BitBake uses this value to setup configuration. | ||
8968 | </para> | ||
8969 | |||
8970 | <para> | ||
8971 | <filename>TUNE_ARCH</filename> definitions are specific to | ||
8972 | a given architecture. | ||
8973 | The definitions can be a single static definition, or | ||
8974 | can be dynamically adjusted. | ||
8975 | You can see details for a given CPU family by looking at | ||
8976 | the architecture's <filename>README</filename> file. | ||
8977 | For example, the | ||
8978 | <filename>meta/conf/machine/include/mips/README</filename> | ||
8979 | file in the | ||
8980 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
8981 | provides information for <filename>TUNE_ARCH</filename> | ||
8982 | specific to the <filename>mips</filename> architecture. | ||
8983 | </para> | ||
8984 | |||
8985 | <para> | ||
8986 | <filename>TUNE_ARCH</filename> is tied closely to | ||
8987 | <link linkend='var-TARGET_ARCH'><filename>TARGET_ARCH</filename></link>, | ||
8988 | which defines the target machine's architecture. | ||
8989 | The BitBake configuration file | ||
8990 | (<filename>meta/conf/bitbake.conf</filename>) sets | ||
8991 | <filename>TARGET_ARCH</filename> as follows: | ||
8992 | <literallayout class='monospaced'> | ||
8993 | TARGET_ARCH = "${TUNE_ARCH}" | ||
8994 | </literallayout> | ||
8995 | </para> | ||
8996 | |||
8997 | <para> | ||
8998 | The following list, which is by no means complete since | ||
8999 | architectures are configurable, shows supported machine | ||
9000 | architectures: | ||
9001 | <literallayout class='monospaced'> | ||
9002 | arm | ||
9003 | i586 | ||
9004 | x86_64 | ||
9005 | powerpc | ||
9006 | powerpc64 | ||
9007 | mips | ||
9008 | mipsel | ||
9009 | </literallayout> | ||
9010 | </para> | ||
9011 | </glossdef> | ||
9012 | </glossentry> | ||
9013 | |||
9014 | <glossentry id='var-TUNE_ASARGS'><glossterm>TUNE_ASARGS</glossterm> | ||
9015 | <glossdef> | ||
9016 | <para> | ||
9017 | Specifies architecture-specific assembler flags for | ||
9018 | the target system. | ||
9019 | The set of flags is based on the selected tune features. | ||
9020 | <filename>TUNE_ASARGS</filename> is set using | ||
9021 | the tune include files, which are typically under | ||
9022 | <filename>meta/conf/machine/include/</filename> and are | ||
9023 | influenced through <filename>TUNE_FEATURES</filename>. | ||
9024 | For example, the | ||
9025 | <filename>meta/conf/machine/include/x86/arch-x86.inc</filename> | ||
9026 | file defines the flags for the x86 architecture as follows: | ||
9027 | <literallayout class='monospaced'> | ||
9028 | TUNE_ASARGS += "${@bb.utils.contains("TUNE_FEATURES", "mx32", "-x32", "", d)}" | ||
9029 | </literallayout> | ||
9030 | <note> | ||
9031 | Board Support Packages (BSPs) can supply their own | ||
9032 | set of flags. | ||
9033 | </note> | ||
9034 | </para> | ||
9035 | </glossdef> | ||
9036 | </glossentry> | ||
9037 | |||
9038 | <glossentry id='var-TUNE_CCARGS'><glossterm>TUNE_CCARGS</glossterm> | ||
9039 | <glossdef> | ||
9040 | <para> | ||
9041 | Specifies architecture-specific C compiler flags for | ||
9042 | the target system. | ||
9043 | The set of flags is based on the selected tune features. | ||
9044 | <filename>TUNE_CCARGS</filename> is set using | ||
9045 | the tune include files, which are typically under | ||
9046 | <filename>meta/conf/machine/include/</filename> and are | ||
9047 | influenced through <filename>TUNE_FEATURES</filename>. | ||
9048 | <note> | ||
9049 | Board Support Packages (BSPs) can supply their own | ||
9050 | set of flags. | ||
9051 | </note> | ||
9052 | </para> | ||
9053 | </glossdef> | ||
9054 | </glossentry> | ||
9055 | |||
9056 | <glossentry id='var-TUNE_LDARGS'><glossterm>TUNE_LDARGS</glossterm> | ||
9057 | <glossdef> | ||
9058 | <para> | ||
9059 | Specifies architecture-specific linker flags for | ||
9060 | the target system. | ||
9061 | The set of flags is based on the selected tune features. | ||
9062 | <filename>TUNE_LDARGS</filename> is set using | ||
9063 | the tune include files, which are typically under | ||
9064 | <filename>meta/conf/machine/include/</filename> and are | ||
9065 | influenced through <filename>TUNE_FEATURES</filename>. | ||
9066 | For example, the | ||
9067 | <filename>meta/conf/machine/include/x86/arch-x86.inc</filename> | ||
9068 | file defines the flags for the x86 architecture as follows: | ||
9069 | <literallayout class='monospaced'> | ||
9070 | TUNE_LDARGS += "${@bb.utils.contains("TUNE_FEATURES", "mx32", "-m elf32_x86_64", "", d)}" | ||
9071 | </literallayout> | ||
9072 | <note> | ||
9073 | Board Support Packages (BSPs) can supply their own | ||
9074 | set of flags. | ||
9075 | </note> | ||
9076 | </para> | ||
9077 | </glossdef> | ||
9078 | </glossentry> | ||
9079 | |||
9080 | <glossentry id='var-TUNE_FEATURES'><glossterm>TUNE_FEATURES</glossterm> | ||
9081 | <glossdef> | ||
9082 | <para> | ||
9083 | Features used to "tune" a compiler for optimal use | ||
9084 | given a specific processor. | ||
9085 | The features are defined within the tune files and allow | ||
9086 | arguments (i.e. <filename>TUNE_*ARGS</filename>) to be | ||
9087 | dynamically generated based on the features. | ||
9088 | </para> | ||
9089 | |||
9090 | <para> | ||
9091 | The OpenEmbedded build system verifies the features | ||
9092 | to be sure they are not conflicting and that they are | ||
9093 | supported. | ||
9094 | </para> | ||
9095 | |||
9096 | <para> | ||
9097 | The BitBake configuration file | ||
9098 | (<filename>meta/conf/bitbake.conf</filename>) defines | ||
9099 | <filename>TUNE_FEATURES</filename> as follows: | ||
9100 | <literallayout class='monospaced'> | ||
9101 | TUNE_FEATURES ??= "${TUNE_FEATURES_tune-${DEFAULTTUNE}}" | ||
9102 | </literallayout> | ||
9103 | See the | ||
9104 | <link linkend='var-DEFAULTTUNE'><filename>DEFAULTTUNE</filename></link> | ||
9105 | variable for more information. | ||
9106 | </para> | ||
9107 | </glossdef> | ||
9108 | </glossentry> | ||
9109 | |||
9110 | <glossentry id='var-TUNE_PKGARCH'><glossterm>TUNE_PKGARCH</glossterm> | ||
9111 | <glossdef> | ||
9112 | <para> | ||
9113 | The package architecture understood by the packaging | ||
9114 | system to define the architecture, ABI, and tuning of | ||
9115 | output packages. | ||
9116 | </para> | ||
9117 | </glossdef> | ||
9118 | </glossentry> | ||
9119 | |||
9120 | <glossentry id='var-TUNE_PKGARCH_tune'><glossterm>TUNE_PKGARCH_tune</glossterm> | ||
9121 | <glossdef> | ||
9122 | <para> | ||
9123 | The CPU or Application Binary Interface (ABI) specific | ||
9124 | tuning of the | ||
9125 | <link linkend='var-TUNE_PKGARCH'><filename>TUNE_PKGARCH</filename></link>. | ||
9126 | </para> | ||
9127 | |||
9128 | <para> | ||
9129 | These tune-specific package architectures are defined in | ||
9130 | the machine include files. | ||
9131 | Here is an example of the "core2-32" tuning as used | ||
9132 | in the | ||
9133 | <filename>meta/conf/machine/include/tune-core2.inc</filename> | ||
9134 | file: | ||
9135 | <literallayout class='monospaced'> | ||
9136 | TUNE_PKGARCH_tune-core2-32 = "core2-32" | ||
9137 | </literallayout> | ||
9138 | </para> | ||
9139 | </glossdef> | ||
9140 | </glossentry> | ||
9141 | |||
9142 | <glossentry id='var-TUNEABI'><glossterm>TUNEABI</glossterm> | ||
9143 | <glossdef> | ||
9144 | <para> | ||
9145 | An underlying Application Binary Interface (ABI) used by | ||
9146 | a particular tuning in a given toolchain layer. | ||
9147 | Providers that use prebuilt libraries can use the | ||
9148 | <filename>TUNEABI</filename>, | ||
9149 | <link linkend='var-TUNEABI_OVERRIDE'><filename>TUNEABI_OVERRIDE</filename></link>, | ||
9150 | and | ||
9151 | <link linkend='var-TUNEABI_WHITELIST'><filename>TUNEABI_WHITELIST</filename></link> | ||
9152 | variables to check compatibility of tunings against their | ||
9153 | selection of libraries. | ||
9154 | </para> | ||
9155 | |||
9156 | <para> | ||
9157 | If <filename>TUNEABI</filename> is undefined, then every | ||
9158 | tuning is allowed. | ||
9159 | See the | ||
9160 | <link linkend='ref-classes-sanity'><filename>sanity</filename></link> | ||
9161 | class to see how the variable is used. | ||
9162 | </para> | ||
9163 | </glossdef> | ||
9164 | </glossentry> | ||
9165 | |||
9166 | <glossentry id='var-TUNEABI_OVERRIDE'><glossterm>TUNEABI_OVERRIDE</glossterm> | ||
9167 | <glossdef> | ||
9168 | <para> | ||
9169 | If set, the OpenEmbedded system ignores the | ||
9170 | <link linkend='var-TUNEABI_WHITELIST'><filename>TUNEABI_WHITELIST</filename></link> | ||
9171 | variable. | ||
9172 | Providers that use prebuilt libraries can use the | ||
9173 | <filename>TUNEABI_OVERRIDE</filename>, | ||
9174 | <filename>TUNEABI_WHITELIST</filename>, | ||
9175 | and | ||
9176 | <link linkend='var-TUNEABI'><filename>TUNEABI</filename></link> | ||
9177 | variables to check compatibility of a tuning against their | ||
9178 | selection of libraries. | ||
9179 | </para> | ||
9180 | |||
9181 | <para> | ||
9182 | See the | ||
9183 | <link linkend='ref-classes-sanity'><filename>sanity</filename></link> | ||
9184 | class to see how the variable is used. | ||
9185 | </para> | ||
9186 | </glossdef> | ||
9187 | </glossentry> | ||
9188 | |||
9189 | <glossentry id='var-TUNEABI_WHITELIST'><glossterm>TUNEABI_WHITELIST</glossterm> | ||
9190 | <glossdef> | ||
9191 | <para> | ||
9192 | A whitelist of permissible | ||
9193 | <link linkend='var-TUNEABI'><filename>TUNEABI</filename></link> | ||
9194 | values. | ||
9195 | If <filename>TUNEABI_WHITELIST</filename> is not set, | ||
9196 | all tunes are allowed. | ||
9197 | Providers that use prebuilt libraries can use the | ||
9198 | <filename>TUNEABI_WHITELIST</filename>, | ||
9199 | <link linkend='var-TUNEABI_OVERRIDE'><filename>TUNEABI_OVERRIDE</filename></link>, | ||
9200 | and <filename>TUNEABI</filename> variables to check | ||
9201 | compatibility of a tuning against their selection of | ||
9202 | libraries. | ||
9203 | </para> | ||
9204 | |||
9205 | <para> | ||
9206 | See the | ||
9207 | <link linkend='ref-classes-sanity'><filename>sanity</filename></link> | ||
9208 | class to see how the variable is used. | ||
9209 | </para> | ||
9210 | </glossdef> | ||
9211 | </glossentry> | ||
9212 | |||
9213 | <glossentry id='var-TUNECONFLICT'><glossterm>TUNECONFLICT[<feature>]</glossterm> | ||
9214 | <glossdef> | ||
9215 | <para> | ||
9216 | Specifies CPU or Application Binary Interface (ABI) | ||
9217 | tuning features that conflict with >feature<. | ||
9218 | </para> | ||
9219 | |||
9220 | <para> | ||
9221 | Known tuning conflicts are specified in the machine include | ||
9222 | files in the | ||
9223 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
9224 | Here is an example from the | ||
9225 | <filename>meta/conf/machine/include/mips/arch-mips.inc</filename> | ||
9226 | include file that lists the "o32" and "n64" features as | ||
9227 | conflicting with the "n32" feature: | ||
9228 | <literallayout class='monospaced'> | ||
9229 | TUNECONFLICTS[n32] = "o32 n64" | ||
9230 | </literallayout> | ||
9231 | </para> | ||
9232 | </glossdef> | ||
9233 | </glossentry> | ||
9234 | |||
9235 | <glossentry id='var-TUNEVALID'><glossterm>TUNEVALID[<feature>]</glossterm> | ||
9236 | <glossdef> | ||
9237 | <para> | ||
9238 | Specifies a valid CPU or Application Binary Interface (ABI) | ||
9239 | tuning feature. | ||
9240 | The specified feature is stored as a flag. | ||
9241 | Valid features are specified in the machine include files | ||
9242 | (e.g. <filename>meta/conf/machine/include/arm/arch-arm.inc</filename>). | ||
9243 | Here is an example from that file: | ||
9244 | <literallayout class='monospaced'> | ||
9245 | TUNEVALID[bigendian] = "Enable big-endian mode." | ||
9246 | </literallayout> | ||
9247 | See the machine include files in the | ||
9248 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
9249 | for these features. | ||
9250 | </para> | ||
9251 | </glossdef> | ||
9252 | </glossentry> | ||
9253 | |||
9254 | </glossdiv> | ||
9255 | |||
9256 | <glossdiv id='var-glossary-u'><title>U</title> | ||
9257 | |||
9258 | <glossentry id='var-UBOOT_CONFIG'><glossterm>UBOOT_CONFIG</glossterm> | ||
9259 | <glossdef> | ||
9260 | <para> | ||
9261 | Configures the | ||
9262 | <link linkend='var-UBOOT_MACHINE'><filename>UBOOT_MACHINE</filename></link> | ||
9263 | and can also define | ||
9264 | <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link> | ||
9265 | for individual cases. | ||
9266 | </para> | ||
9267 | |||
9268 | <para> | ||
9269 | Following is an example from the | ||
9270 | <filename>meta-fsl-arm</filename> layer. | ||
9271 | <literallayout class='monospaced'> | ||
9272 | UBOOT_CONFIG ??= "sd" | ||
9273 | UBOOT_CONFIG[sd] = "mx6qsabreauto_config,sdcard" | ||
9274 | UBOOT_CONFIG[eimnor] = "mx6qsabreauto_eimnor_config" | ||
9275 | UBOOT_CONFIG[nand] = "mx6qsabreauto_nand_config,ubifs" | ||
9276 | UBOOT_CONFIG[spinor] = "mx6qsabreauto_spinor_config" | ||
9277 | </literallayout> | ||
9278 | In this example, "sd" is selected as the configuration | ||
9279 | of the possible four for the | ||
9280 | <filename>UBOOT_MACHINE</filename>. | ||
9281 | The "sd" configuration defines "mx6qsabreauto_config" | ||
9282 | as the value for <filename>UBOOT_MACHINE</filename>, while | ||
9283 | the "sdcard" specifies the | ||
9284 | <filename>IMAGE_FSTYPES</filename> to use for the U-boot | ||
9285 | image. | ||
9286 | </para> | ||
9287 | |||
9288 | <para> | ||
9289 | For more information on how the | ||
9290 | <filename>UBOOT_CONFIG</filename> is handled, see the | ||
9291 | <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/uboot-config.bbclass'><filename>uboot-config</filename></ulink> | ||
9292 | class. | ||
9293 | </para> | ||
9294 | </glossdef> | ||
9295 | </glossentry> | ||
9296 | |||
9297 | <glossentry id='var-UBOOT_ENTRYPOINT'><glossterm>UBOOT_ENTRYPOINT</glossterm> | ||
9298 | <glossdef> | ||
9299 | <para> | ||
9300 | Specifies the entry point for the U-Boot image. | ||
9301 | During U-Boot image creation, the | ||
9302 | <filename>UBOOT_ENTRYPOINT</filename> variable is passed | ||
9303 | as a command-line parameter to the | ||
9304 | <filename>uboot-mkimage</filename> utility. | ||
9305 | </para> | ||
9306 | </glossdef> | ||
9307 | </glossentry> | ||
9308 | |||
9309 | <glossentry id='var-UBOOT_LOADADDRESS'><glossterm>UBOOT_LOADADDRESS</glossterm> | ||
9310 | <glossdef> | ||
9311 | <para> | ||
9312 | Specifies the load address for the U-Boot image. | ||
9313 | During U-Boot image creation, the | ||
9314 | <filename>UBOOT_LOADADDRESS</filename> variable is passed | ||
9315 | as a command-line parameter to the | ||
9316 | <filename>uboot-mkimage</filename> utility. | ||
9317 | </para> | ||
9318 | </glossdef> | ||
9319 | </glossentry> | ||
9320 | |||
9321 | <glossentry id='var-UBOOT_LOCALVERSION'><glossterm>UBOOT_LOCALVERSION</glossterm> | ||
9322 | <glossdef> | ||
9323 | <para> | ||
9324 | Appends a string to the name of the local version of the | ||
9325 | U-Boot image. | ||
9326 | For example, assuming the version of the U-Boot image | ||
9327 | built was "2013.10, the full version string reported by | ||
9328 | U-Boot would be "2013.10-yocto" given the following | ||
9329 | statement: | ||
9330 | <literallayout class='monospaced'> | ||
9331 | UBOOT_LOCALVERSION = "-yocto" | ||
9332 | </literallayout> | ||
9333 | </para> | ||
9334 | </glossdef> | ||
9335 | </glossentry> | ||
9336 | |||
9337 | <glossentry id='var-UBOOT_MACHINE'><glossterm>UBOOT_MACHINE</glossterm> | ||
9338 | <glossdef> | ||
9339 | <para> | ||
9340 | Specifies the value passed on the | ||
9341 | <filename>make</filename> command line when building | ||
9342 | a U-Boot image. | ||
9343 | The value indicates the target platform configuration. | ||
9344 | You typically set this variable from the machine | ||
9345 | configuration file (i.e. | ||
9346 | <filename>conf/machine/<machine_name>.conf</filename>). | ||
9347 | </para> | ||
9348 | |||
9349 | <para> | ||
9350 | Please see the "Selection of Processor Architecture and | ||
9351 | Board Type" section in the U-Boot README for valid values | ||
9352 | for this variable. | ||
9353 | </para> | ||
9354 | </glossdef> | ||
9355 | </glossentry> | ||
9356 | |||
9357 | <glossentry id='var-UBOOT_MAKE_TARGET'><glossterm>UBOOT_MAKE_TARGET</glossterm> | ||
9358 | <glossdef> | ||
9359 | <para> | ||
9360 | Specifies the target called in the | ||
9361 | <filename>Makefile</filename>. | ||
9362 | The default target is "all". | ||
9363 | </para> | ||
9364 | </glossdef> | ||
9365 | </glossentry> | ||
9366 | |||
9367 | <glossentry id='var-UBOOT_SUFFIX'><glossterm>UBOOT_SUFFIX</glossterm> | ||
9368 | <glossdef> | ||
9369 | <para> | ||
9370 | Points to the generated U-Boot extension. | ||
9371 | For example, <filename>u-boot.sb</filename> has a | ||
9372 | <filename>.sb</filename> extension. | ||
9373 | </para> | ||
9374 | |||
9375 | <para> | ||
9376 | The default U-Boot extension is | ||
9377 | <filename>.bin</filename> | ||
9378 | </para> | ||
9379 | </glossdef> | ||
9380 | </glossentry> | ||
9381 | |||
9382 | <glossentry id='var-UBOOT_TARGET'><glossterm>UBOOT_TARGET</glossterm> | ||
9383 | <glossdef> | ||
9384 | <para> | ||
9385 | Specifies the target used for building U-Boot. | ||
9386 | The target is passed directly as part of the "make" command | ||
9387 | (e.g. SPL and AIS). | ||
9388 | If you do not specifically set this variable, the | ||
9389 | OpenEmbedded build process passes and uses "all" for the | ||
9390 | target during the U-Boot building process. | ||
9391 | </para> | ||
9392 | </glossdef> | ||
9393 | </glossentry> | ||
9394 | |||
9395 | <glossentry id='var-USER_CLASSES'><glossterm>USER_CLASSES</glossterm> | ||
9396 | <glossdef> | ||
9397 | <para> | ||
9398 | A list of classes to globally inherit. | ||
9399 | These classes are used by the OpenEmbedded build system | ||
9400 | to enable extra features (e.g. | ||
9401 | <filename>buildstats</filename>, | ||
9402 | <filename>image-mklibs</filename>, and so forth). | ||
9403 | </para> | ||
9404 | |||
9405 | <para> | ||
9406 | The default list is set in your | ||
9407 | <filename>local.conf</filename> file: | ||
9408 | <literallayout class='monospaced'> | ||
9409 | USER_CLASSES ?= "buildstats image-mklibs image-prelink" | ||
9410 | </literallayout> | ||
9411 | For more information, see | ||
9412 | <filename>meta-yocto/conf/local.conf.sample</filename> in | ||
9413 | the | ||
9414 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
9415 | </para> | ||
9416 | </glossdef> | ||
9417 | </glossentry> | ||
9418 | |||
9419 | <glossentry id='var-USERADD_ERROR_DYNAMIC'><glossterm>USERADD_ERROR_DYNAMIC</glossterm> | ||
9420 | <glossdef> | ||
9421 | <para> | ||
9422 | Forces the OpenEmbedded build system to produce an error | ||
9423 | if the user identification (<filename>uid</filename>) and | ||
9424 | group identification (<filename>gid</filename>) values | ||
9425 | are not defined in <filename>files/passwd</filename> | ||
9426 | and <filename>files/group</filename> files. | ||
9427 | </para> | ||
9428 | |||
9429 | <para> | ||
9430 | The default behavior for the build system is to dynamically | ||
9431 | apply <filename>uid</filename> and | ||
9432 | <filename>gid</filename> values. | ||
9433 | Consequently, the <filename>USERADD_ERROR_DYNAMIC</filename> | ||
9434 | variable is by default not set. | ||
9435 | If you plan on using statically assigned | ||
9436 | <filename>gid</filename> and <filename>uid</filename> | ||
9437 | values, you should set | ||
9438 | the <filename>USERADD_ERROR_DYNAMIC</filename> variable in | ||
9439 | your <filename>local.conf</filename> file as | ||
9440 | follows: | ||
9441 | <literallayout class='monospaced'> | ||
9442 | USERADD_ERROR_DYNAMIC = "1" | ||
9443 | </literallayout> | ||
9444 | Overriding the default behavior implies you are going to | ||
9445 | also take steps to set static <filename>uid</filename> and | ||
9446 | <filename>gid</filename> values through use of the | ||
9447 | <link linkend='var-USERADDEXTENSION'><filename>USERADDEXTENSION</filename></link>, | ||
9448 | <link linkend='var-USERADD_UID_TABLES'><filename>USERADD_UID_TABLES</filename></link>, | ||
9449 | and | ||
9450 | <link linkend='var-USERADD_GID_TABLES'><filename>USERADD_GID_TABLES</filename></link> | ||
9451 | variables. | ||
9452 | </para> | ||
9453 | </glossdef> | ||
9454 | </glossentry> | ||
9455 | |||
9456 | <glossentry id='var-USERADD_GID_TABLES'><glossterm>USERADD_GID_TABLES</glossterm> | ||
9457 | <glossdef> | ||
9458 | <para> | ||
9459 | Specifies a password file to use for obtaining static | ||
9460 | group identification (<filename>gid</filename>) values | ||
9461 | when the OpenEmbedded build system adds a group to the | ||
9462 | system during package installation. | ||
9463 | </para> | ||
9464 | |||
9465 | <para> | ||
9466 | When applying static group identification | ||
9467 | (<filename>gid</filename>) values, the OpenEmbedded build | ||
9468 | system looks in | ||
9469 | <link linkend='var-BBPATH'><filename>BBPATH</filename></link> | ||
9470 | for a <filename>files/group</filename> file and then applies | ||
9471 | those <filename>uid</filename> values. | ||
9472 | Set the variable as follows in your | ||
9473 | <filename>local.conf</filename> file: | ||
9474 | <literallayout class='monospaced'> | ||
9475 | USERADD_GID_TABLES = "files/group" | ||
9476 | </literallayout> | ||
9477 | </para> | ||
9478 | |||
9479 | <note> | ||
9480 | Setting the | ||
9481 | <link linkend='var-USERADDEXTENSION'><filename>USERADDEXTENSION</filename></link> | ||
9482 | variable to "useradd-staticids" causes the build system | ||
9483 | to use static <filename>gid</filename> values. | ||
9484 | </note> | ||
9485 | </glossdef> | ||
9486 | </glossentry> | ||
9487 | |||
9488 | <glossentry id='var-USERADD_UID_TABLES'><glossterm>USERADD_UID_TABLES</glossterm> | ||
9489 | <glossdef> | ||
9490 | <para> | ||
9491 | Specifies a password file to use for obtaining static | ||
9492 | user identification (<filename>uid</filename>) values | ||
9493 | when the OpenEmbedded build system adds a user to the | ||
9494 | system during package installation. | ||
9495 | </para> | ||
9496 | |||
9497 | <para> | ||
9498 | When applying static user identification | ||
9499 | (<filename>uid</filename>) values, the OpenEmbedded build | ||
9500 | system looks in | ||
9501 | <link linkend='var-BBPATH'><filename>BBPATH</filename></link> | ||
9502 | for a <filename>files/passwd</filename> file and then applies | ||
9503 | those <filename>uid</filename> values. | ||
9504 | Set the variable as follows in your | ||
9505 | <filename>local.conf</filename> file: | ||
9506 | <literallayout class='monospaced'> | ||
9507 | USERADD_UID_TABLES = "files/passwd" | ||
9508 | </literallayout> | ||
9509 | </para> | ||
9510 | |||
9511 | <note> | ||
9512 | Setting the | ||
9513 | <link linkend='var-USERADDEXTENSION'><filename>USERADDEXTENSION</filename></link> | ||
9514 | variable to "useradd-staticids" causes the build system | ||
9515 | to use static <filename>uid</filename> values. | ||
9516 | </note> | ||
9517 | </glossdef> | ||
9518 | </glossentry> | ||
9519 | |||
9520 | <glossentry id='var-USERADD_PACKAGES'><glossterm>USERADD_PACKAGES</glossterm> | ||
9521 | <glossdef> | ||
9522 | <para> | ||
9523 | When a recipe inherits the | ||
9524 | <filename>useradd</filename> class, this variable | ||
9525 | specifies the individual packages within the recipe that | ||
9526 | require users and/or groups to be added. | ||
9527 | </para> | ||
9528 | |||
9529 | <para> | ||
9530 | You must set this variable if the recipe inherits the | ||
9531 | class. | ||
9532 | For example, the following enables adding a user for the | ||
9533 | main package in a recipe: | ||
9534 | <literallayout class='monospaced'> | ||
9535 | USERADD_PACKAGES = "${PN}" | ||
9536 | </literallayout> | ||
9537 | <note> | ||
9538 | If follows that if you are going to use the | ||
9539 | <filename>USERADD_PACKAGES</filename> variable, | ||
9540 | you need to set one or more of the | ||
9541 | <link linkend='var-USERADD_PARAM'><filename>USERADD_PARAM</filename></link>, | ||
9542 | <link linkend='var-GROUPADD_PARAM'><filename>GROUPADD_PARAM</filename></link>, | ||
9543 | or | ||
9544 | <link linkend='var-GROUPMEMS_PARAM'><filename>GROUPMEMS_PARAM</filename></link> | ||
9545 | variables. | ||
9546 | </note> | ||
9547 | </para> | ||
9548 | |||
9549 | </glossdef> | ||
9550 | </glossentry> | ||
9551 | |||
9552 | <glossentry id='var-USERADD_PARAM'><glossterm>USERADD_PARAM</glossterm> | ||
9553 | <glossdef> | ||
9554 | <para> | ||
9555 | When a recipe inherits the | ||
9556 | <filename>useradd</filename> class, this variable | ||
9557 | specifies for a package what parameters should be passed | ||
9558 | to the <filename>useradd</filename> command | ||
9559 | if you wish to add a user to the system when the package | ||
9560 | is installed. | ||
9561 | </para> | ||
9562 | |||
9563 | <para> | ||
9564 | Here is an example from the <filename>dbus</filename> | ||
9565 | recipe: | ||
9566 | <literallayout class='monospaced'> | ||
9567 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \ | ||
9568 | --no-create-home --shell /bin/false \ | ||
9569 | --user-group messagebus" | ||
9570 | </literallayout> | ||
9571 | For information on the standard Linux shell command | ||
9572 | <filename>useradd</filename>, see | ||
9573 | <ulink url='http://linux.die.net/man/8/useradd'></ulink>. | ||
9574 | </para> | ||
9575 | </glossdef> | ||
9576 | </glossentry> | ||
9577 | |||
9578 | <glossentry id='var-USERADDEXTENSION'><glossterm>USERADDEXTENSION</glossterm> | ||
9579 | <glossdef> | ||
9580 | <para> | ||
9581 | When set to "useradd-staticids", causes the | ||
9582 | OpenEmbedded build system to base all user and group | ||
9583 | additions on a static | ||
9584 | <filename>passwd</filename> and | ||
9585 | <filename>group</filename> files found in | ||
9586 | <link linkend='var-BBPATH'><filename>BBPATH</filename></link>. | ||
9587 | </para> | ||
9588 | |||
9589 | <para> | ||
9590 | To use static user identification (<filename>uid</filename>) | ||
9591 | and group identification (<filename>gid</filename>) | ||
9592 | values, set the variable | ||
9593 | as follows in your <filename>local.conf</filename> file: | ||
9594 | <literallayout class='monospaced'> | ||
9595 | USERADDEXTENSION = "useradd-staticids" | ||
9596 | </literallayout> | ||
9597 | <note> | ||
9598 | Setting this variable to use static | ||
9599 | <filename>uid</filename> and <filename>gid</filename> | ||
9600 | values causes the OpenEmbedded build system to employ | ||
9601 | the | ||
9602 | <link linkend='ref-classes-useradd-staticids'><filename>useradd-staticids</filename></link> | ||
9603 | class. | ||
9604 | </note> | ||
9605 | </para> | ||
9606 | |||
9607 | <para> | ||
9608 | If you use static <filename>uid</filename> and | ||
9609 | <filename>gid</filename> information, you must also | ||
9610 | specify the <filename>files/passwd</filename> and | ||
9611 | <filename>files/group</filename> files by setting the | ||
9612 | <link linkend='var-USERADD_UID_TABLES'><filename>USERADD_UID_TABLES</filename></link> | ||
9613 | and | ||
9614 | <link linkend='var-USERADD_GID_TABLES'><filename>USERADD_GID_TABLES</filename></link> | ||
9615 | variables. | ||
9616 | Additionally, you should also set the | ||
9617 | <link linkend='var-USERADD_ERROR_DYNAMIC'><filename>USERADD_ERROR_DYNAMIC</filename></link> | ||
9618 | variable. | ||
9619 | </para> | ||
9620 | </glossdef> | ||
9621 | </glossentry> | ||
9622 | |||
9623 | </glossdiv> | ||
9624 | |||
9625 | <!-- <glossdiv id='var-glossary-v'><title>V</title>--> | ||
9626 | <!-- </glossdiv>--> | ||
9627 | |||
9628 | <glossdiv id='var-glossary-w'><title>W</title> | ||
9629 | |||
9630 | <glossentry id='var-WARN_QA'><glossterm>WARN_QA</glossterm> | ||
9631 | <glossdef> | ||
9632 | <para> | ||
9633 | Specifies the quality assurance checks whose failures are | ||
9634 | reported as warnings by the OpenEmbedded build system. | ||
9635 | You set this variable in your distribution configuration | ||
9636 | file. | ||
9637 | For a list of the checks you can control with this variable, | ||
9638 | see the | ||
9639 | "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>" | ||
9640 | section. | ||
9641 | </para> | ||
9642 | </glossdef> | ||
9643 | </glossentry> | ||
9644 | |||
9645 | <glossentry id='var-WORKDIR'><glossterm>WORKDIR</glossterm> | ||
9646 | <glossdef> | ||
9647 | <para> | ||
9648 | The pathname of the work directory in which the OpenEmbedded | ||
9649 | build system builds a recipe. | ||
9650 | This directory is located within the | ||
9651 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link> | ||
9652 | directory structure and is specific to the recipe being | ||
9653 | built and the system for which it is being built. | ||
9654 | </para> | ||
9655 | |||
9656 | <para> | ||
9657 | The <filename>WORKDIR</filename> directory is defined as | ||
9658 | follows: | ||
9659 | <literallayout class='monospaced'> | ||
9660 | ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR} | ||
9661 | </literallayout> | ||
9662 | The actual directory depends on several things: | ||
9663 | <itemizedlist> | ||
9664 | <listitem><link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>: | ||
9665 | The top-level build output directory</listitem> | ||
9666 | <listitem><link linkend='var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></link>: | ||
9667 | The target system identifier</listitem> | ||
9668 | <listitem><link linkend='var-PN'><filename>PN</filename></link>: | ||
9669 | The recipe name</listitem> | ||
9670 | <listitem><link linkend='var-EXTENDPE'><filename>EXTENDPE</filename></link>: | ||
9671 | The epoch - (if | ||
9672 | <link linkend='var-PE'><filename>PE</filename></link> | ||
9673 | is not specified, which is usually the case for most | ||
9674 | recipes, then <filename>EXTENDPE</filename> is blank)</listitem> | ||
9675 | <listitem><link linkend='var-PV'><filename>PV</filename></link>: | ||
9676 | The recipe version</listitem> | ||
9677 | <listitem><link linkend='var-PR'><filename>PR</filename></link>: | ||
9678 | The recipe revision</listitem> | ||
9679 | </itemizedlist> | ||
9680 | </para> | ||
9681 | |||
9682 | <para> | ||
9683 | As an example, assume a Source Directory top-level folder | ||
9684 | name <filename>poky</filename>, a default Build Directory at | ||
9685 | <filename>poky/build</filename>, and a | ||
9686 | <filename>qemux86-poky-linux</filename> machine target | ||
9687 | system. | ||
9688 | Furthermore, suppose your recipe is named | ||
9689 | <filename>foo_1.3.0-r0.bb</filename>. | ||
9690 | In this case, the work directory the build system uses to | ||
9691 | build the package would be as follows: | ||
9692 | <literallayout class='monospaced'> | ||
9693 | poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0 | ||
9694 | </literallayout> | ||
9695 | </para> | ||
9696 | </glossdef> | ||
9697 | </glossentry> | ||
9698 | |||
9699 | </glossdiv> | ||
9700 | |||
9701 | <!-- <glossdiv id='var-glossary-x'><title>X</title>--> | ||
9702 | <!-- </glossdiv>--> | ||
9703 | |||
9704 | <!-- <glossdiv id='var-glossary-y'><title>Y</title>--> | ||
9705 | <!-- </glossdiv>--> | ||
9706 | |||
9707 | <!-- <glossdiv id='var-glossary-z'><title>Z</title>--> | ||
9708 | <!-- </glossdiv>--> | ||
9709 | |||
9710 | </glossary> | ||
9711 | </chapter> | ||
9712 | <!-- | ||
9713 | vim: expandtab tw=80 ts=4 | ||
9714 | --> | ||
diff --git a/documentation/ref-manual/ref-varlocality.xml b/documentation/ref-manual/ref-varlocality.xml new file mode 100644 index 0000000..d3f8732 --- /dev/null +++ b/documentation/ref-manual/ref-varlocality.xml | |||
@@ -0,0 +1,196 @@ | |||
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 | |||
5 | <chapter id='ref-varlocality'> | ||
6 | <title>Variable Context</title> | ||
7 | |||
8 | <para> | ||
9 | While you can use most variables in almost any context such as | ||
10 | <filename>.conf</filename>, <filename>.bbclass</filename>, | ||
11 | <filename>.inc</filename>, and <filename>.bb</filename> files, | ||
12 | some variables are often associated with a particular locality or context. | ||
13 | This chapter describes some common associations. | ||
14 | </para> | ||
15 | |||
16 | <section id='ref-varlocality-configuration'> | ||
17 | <title>Configuration</title> | ||
18 | |||
19 | <para> | ||
20 | The following subsections provide lists of variables whose context is | ||
21 | configuration: distribution, machine, and local. | ||
22 | </para> | ||
23 | |||
24 | <section id='ref-varlocality-config-distro'> | ||
25 | <title>Distribution (Distro)</title> | ||
26 | |||
27 | <para> | ||
28 | This section lists variables whose configuration context is the | ||
29 | distribution, or distro. | ||
30 | <itemizedlist> | ||
31 | <listitem><para><filename><link linkend='var-DISTRO'>DISTRO</link></filename></para></listitem> | ||
32 | <listitem><para><filename><link linkend='var-DISTRO_NAME'>DISTRO_NAME</link></filename> | ||
33 | </para></listitem> | ||
34 | <listitem><para><filename><link linkend='var-DISTRO_VERSION'>DISTRO_VERSION</link> | ||
35 | </filename></para></listitem> | ||
36 | <listitem><para><filename><link linkend='var-MAINTAINER'>MAINTAINER</link></filename> | ||
37 | </para></listitem> | ||
38 | <listitem><para><filename><link linkend='var-PACKAGE_CLASSES'>PACKAGE_CLASSES</link> | ||
39 | </filename></para></listitem> | ||
40 | <listitem><para><filename><link linkend='var-TARGET_OS'>TARGET_OS</link></filename> | ||
41 | </para></listitem> | ||
42 | <listitem><para><filename><link linkend='var-TARGET_FPU'>TARGET_FPU</link></filename> | ||
43 | </para></listitem> | ||
44 | <listitem><para><filename><link linkend='var-TCMODE'>TCMODE</link></filename> | ||
45 | </para></listitem> | ||
46 | <listitem><para><filename><link linkend='var-TCLIBC'>TCLIBC</link></filename> | ||
47 | </para></listitem> | ||
48 | </itemizedlist> | ||
49 | </para> | ||
50 | </section> | ||
51 | |||
52 | <section id='ref-varlocality-config-machine'> | ||
53 | <title>Machine</title> | ||
54 | |||
55 | <para> | ||
56 | This section lists variables whose configuration context is the | ||
57 | machine. | ||
58 | <itemizedlist> | ||
59 | <listitem><para><filename><link linkend='var-TARGET_ARCH'>TARGET_ARCH</link></filename> | ||
60 | </para></listitem> | ||
61 | <listitem><para><filename><link linkend='var-SERIAL_CONSOLES'>SERIAL_CONSOLES</link> | ||
62 | </filename></para></listitem> | ||
63 | <listitem><para><filename><link linkend='var-PACKAGE_EXTRA_ARCHS'>PACKAGE_EXTRA_ARCHS</link> | ||
64 | </filename></para></listitem> | ||
65 | <listitem><para><filename><link linkend='var-IMAGE_FSTYPES'>IMAGE_FSTYPES</link> | ||
66 | </filename></para></listitem> | ||
67 | <listitem><para><filename><link linkend='var-MACHINE_FEATURES'>MACHINE_FEATURES</link> | ||
68 | </filename></para></listitem> | ||
69 | <listitem><para><filename><link linkend='var-MACHINE_EXTRA_RDEPENDS'>MACHINE_EXTRA_RDEPENDS | ||
70 | </link></filename></para></listitem> | ||
71 | <listitem><para><filename><link linkend='var-MACHINE_EXTRA_RRECOMMENDS'>MACHINE_EXTRA_RRECOMMENDS | ||
72 | </link></filename></para></listitem> | ||
73 | <listitem><para><filename><link linkend='var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS'>MACHINE_ESSENTIAL_EXTRA_RDEPENDS | ||
74 | </link></filename></para></listitem> | ||
75 | <listitem><para><filename><link linkend='var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'> | ||
76 | MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</link></filename></para></listitem> | ||
77 | </itemizedlist> | ||
78 | </para> | ||
79 | </section> | ||
80 | |||
81 | <section id='ref-varlocality-config-local'> | ||
82 | <title>Local</title> | ||
83 | |||
84 | <para> | ||
85 | This section lists variables whose configuration context is the | ||
86 | local configuration through the <filename>local.conf</filename> | ||
87 | file. | ||
88 | <itemizedlist> | ||
89 | <listitem><para><filename><link linkend='var-DISTRO'>DISTRO</link></filename> | ||
90 | </para></listitem> | ||
91 | <listitem><para><filename><link linkend='var-MACHINE'>MACHINE</link></filename> | ||
92 | </para></listitem> | ||
93 | <listitem><para><filename><link linkend='var-DL_DIR'>DL_DIR</link></filename> | ||
94 | </para></listitem> | ||
95 | <listitem><para><filename><link linkend='var-BBFILES'>BBFILES</link></filename> | ||
96 | </para></listitem> | ||
97 | <listitem><para><filename><link linkend='var-EXTRA_IMAGE_FEATURES'>EXTRA_IMAGE_FEATURES | ||
98 | </link></filename></para></listitem> | ||
99 | <listitem><para><filename><link linkend='var-PACKAGE_CLASSES'>PACKAGE_CLASSES</link> | ||
100 | </filename></para></listitem> | ||
101 | <listitem><para><filename><link linkend='var-BB_NUMBER_THREADS'>BB_NUMBER_THREADS</link> | ||
102 | </filename></para></listitem> | ||
103 | <listitem><para><filename><link linkend='var-BBINCLUDELOGS'>BBINCLUDELOGS</link> | ||
104 | </filename></para></listitem> | ||
105 | <listitem><para><filename><link linkend='var-ENABLE_BINARY_LOCALE_GENERATION'> | ||
106 | ENABLE_BINARY_LOCALE_GENERATION</link></filename></para></listitem> | ||
107 | </itemizedlist> | ||
108 | </para> | ||
109 | </section> | ||
110 | </section> | ||
111 | |||
112 | <section id='ref-varlocality-recipes'> | ||
113 | <title>Recipes</title> | ||
114 | |||
115 | <para> | ||
116 | The following subsections provide lists of variables whose context is | ||
117 | recipes: required, dependencies, path, and extra build information. | ||
118 | </para> | ||
119 | |||
120 | <section id='ref-varlocality-recipe-required'> | ||
121 | <title>Required</title> | ||
122 | |||
123 | <para> | ||
124 | This section lists variables that are required for recipes. | ||
125 | <itemizedlist> | ||
126 | <listitem><para><filename><link linkend='var-LICENSE'>LICENSE</link> | ||
127 | </filename></para></listitem> | ||
128 | <listitem><para><filename><link linkend='var-LIC_FILES_CHKSUM'>LIC_FILES_CHKSUM</link> | ||
129 | </filename></para></listitem> | ||
130 | <listitem><para><filename><link linkend='var-SRC_URI'>SRC_URI</link></filename> - used | ||
131 | in recipes that fetch local or remote files. | ||
132 | </para></listitem> | ||
133 | </itemizedlist> | ||
134 | </para> | ||
135 | </section> | ||
136 | |||
137 | <section id='ref-varlocality-recipe-dependencies'> | ||
138 | <title>Dependencies</title> | ||
139 | |||
140 | <para> | ||
141 | This section lists variables that define recipe dependencies. | ||
142 | <itemizedlist> | ||
143 | <listitem><para><filename><link linkend='var-DEPENDS'>DEPENDS</link> | ||
144 | </filename></para></listitem> | ||
145 | <listitem><para><filename><link linkend='var-RDEPENDS'>RDEPENDS</link> | ||
146 | </filename></para></listitem> | ||
147 | <listitem><para><filename><link linkend='var-RRECOMMENDS'>RRECOMMENDS</link> | ||
148 | </filename></para></listitem> | ||
149 | <listitem><para><filename><link linkend='var-RCONFLICTS'>RCONFLICTS</link> | ||
150 | </filename></para></listitem> | ||
151 | <listitem><para><filename><link linkend='var-RREPLACES'>RREPLACES</link> | ||
152 | </filename></para></listitem> | ||
153 | </itemizedlist> | ||
154 | </para> | ||
155 | </section> | ||
156 | |||
157 | <section id='ref-varlocality-recipe-paths'> | ||
158 | <title>Paths</title> | ||
159 | |||
160 | <para> | ||
161 | This section lists variables that define recipe paths. | ||
162 | <itemizedlist> | ||
163 | <listitem><para><filename><link linkend='var-WORKDIR'>WORKDIR</link> | ||
164 | </filename></para></listitem> | ||
165 | <listitem><para><filename><link linkend='var-S'>S</link> | ||
166 | </filename></para></listitem> | ||
167 | <listitem><para><filename><link linkend='var-FILES'>FILES</link> | ||
168 | </filename></para></listitem> | ||
169 | </itemizedlist> | ||
170 | </para> | ||
171 | </section> | ||
172 | |||
173 | <section id='ref-varlocality-recipe-build'> | ||
174 | <title>Extra Build Information</title> | ||
175 | |||
176 | <para> | ||
177 | This section lists variables that define extra build information for recipes. | ||
178 | <itemizedlist> | ||
179 | <listitem><para><filename><link linkend='var-EXTRA_OECMAKE'>EXTRA_OECMAKE</link> | ||
180 | </filename></para></listitem> | ||
181 | <listitem><para><filename><link linkend='var-EXTRA_OECONF'>EXTRA_OECONF</link> | ||
182 | </filename></para></listitem> | ||
183 | <listitem><para><filename><link linkend='var-EXTRA_OEMAKE'>EXTRA_OEMAKE</link> | ||
184 | </filename></para></listitem> | ||
185 | <listitem><para><filename><link linkend='var-PACKAGES'>PACKAGES</link></filename> | ||
186 | </para></listitem> | ||
187 | <listitem><para><filename><link linkend='var-DEFAULT_PREFERENCE'>DEFAULT_PREFERENCE | ||
188 | </link></filename></para></listitem> | ||
189 | </itemizedlist> | ||
190 | </para> | ||
191 | </section> | ||
192 | </section> | ||
193 | </chapter> | ||
194 | <!-- | ||
195 | vim: expandtab tw=80 ts=4 spell spelllang=en_gb | ||
196 | --> | ||
diff --git a/documentation/ref-manual/resources.xml b/documentation/ref-manual/resources.xml new file mode 100644 index 0000000..686b48a --- /dev/null +++ b/documentation/ref-manual/resources.xml | |||
@@ -0,0 +1,128 @@ | |||
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 | |||
5 | <chapter id='resources'> | ||
6 | <title>Contributing to the Yocto Project</title> | ||
7 | |||
8 | <section id='resources-intro'> | ||
9 | <title>Introduction</title> | ||
10 | <para> | ||
11 | The Yocto Project team is happy for people to experiment with the Yocto Project. | ||
12 | A number of places exist to find help if you run into difficulties or find bugs. | ||
13 | To find out how to download source code, | ||
14 | see the "<ulink url='&YOCTO_DOCS_DEV_URL;#local-yp-release'>Yocto Project Release</ulink>" | ||
15 | section in the Yocto Project Development Manual. | ||
16 | </para> | ||
17 | </section> | ||
18 | |||
19 | <section id='resources-bugtracker'> | ||
20 | <title>Tracking Bugs</title> | ||
21 | |||
22 | <para> | ||
23 | If you find problems with the Yocto Project, you should report them using the | ||
24 | Bugzilla application at <ulink url='&YOCTO_BUGZILLA_URL;'></ulink>. | ||
25 | </para> | ||
26 | </section> | ||
27 | |||
28 | <section id='resources-mailinglist'> | ||
29 | <title>Mailing lists</title> | ||
30 | |||
31 | <para> | ||
32 | A number of mailing lists maintained by the Yocto Project exist | ||
33 | as well as related OpenEmbedded mailing lists for discussion, | ||
34 | patch submission and announcements. | ||
35 | To subscribe to one of the following mailing lists, click on the | ||
36 | appropriate URL in the following list and follow the instructions: | ||
37 | <itemizedlist> | ||
38 | <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'></ulink> - | ||
39 | General Yocto Project discussion mailing list. </para></listitem> | ||
40 | <listitem><para><ulink url='&OE_LISTS_URL;/listinfo/openembedded-core'></ulink> - | ||
41 | Discussion mailing list about OpenEmbedded-Core (the core metadata).</para></listitem> | ||
42 | <listitem><para><ulink url='&OE_LISTS_URL;/listinfo/openembedded-devel'></ulink> - | ||
43 | Discussion mailing list about OpenEmbedded.</para></listitem> | ||
44 | <listitem><para><ulink url='&OE_LISTS_URL;/listinfo/bitbake-devel'></ulink> - | ||
45 | Discussion mailing list about the | ||
46 | <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink> | ||
47 | build tool.</para></listitem> | ||
48 | <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/poky'></ulink> - | ||
49 | Discussion mailing list about | ||
50 | <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink>. | ||
51 | </para></listitem> | ||
52 | <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/yocto-announce'></ulink> - | ||
53 | Mailing list to receive official Yocto Project release and milestone | ||
54 | announcements.</para></listitem> | ||
55 | </itemizedlist> | ||
56 | </para> | ||
57 | </section> | ||
58 | |||
59 | <section id='resources-irc'> | ||
60 | <title>Internet Relay Chat (IRC)</title> | ||
61 | |||
62 | <para> | ||
63 | Two IRC channels on freenode are available for the Yocto Project and Poky discussions: | ||
64 | <itemizedlist> | ||
65 | <listitem><para><filename>#yocto</filename></para></listitem> | ||
66 | <listitem><para><filename>#poky</filename></para></listitem> | ||
67 | </itemizedlist> | ||
68 | </para> | ||
69 | </section> | ||
70 | |||
71 | <section id='resources-links'> | ||
72 | <title>Links</title> | ||
73 | |||
74 | <para> | ||
75 | Here is a list of resources you will find helpful: | ||
76 | <itemizedlist> | ||
77 | <listitem><para><emphasis> | ||
78 | <ulink url='&YOCTO_HOME_URL;'>The Yocto Project website</ulink>: | ||
79 | </emphasis> The home site for the Yocto | ||
80 | Project.</para></listitem> | ||
81 | <listitem><para><emphasis> | ||
82 | <ulink url='http://www.intel.com/'>Intel Corporation</ulink>:</emphasis> | ||
83 | The company who acquired OpenedHand in 2008 and began | ||
84 | development on the Yocto Project.</para></listitem> | ||
85 | <listitem><para><emphasis> | ||
86 | <ulink url='&OE_HOME_URL;'>OpenEmbedded</ulink>:</emphasis> | ||
87 | The upstream, generic, embedded distribution used as the basis | ||
88 | for the build system in the Yocto Project. | ||
89 | Poky derives from and contributes back to the OpenEmbedded | ||
90 | project.</para></listitem> | ||
91 | <listitem><para><emphasis> | ||
92 | <ulink url='http://developer.berlios.de/projects/bitbake/'> | ||
93 | BitBake</ulink>:</emphasis> The tool used to process metadata.</para></listitem> | ||
94 | <listitem><para><emphasis> | ||
95 | <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>:</emphasis> | ||
96 | A comprehensive guide to the BitBake tool. | ||
97 | In the | ||
98 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>, | ||
99 | you can find the BitBake User Manual in the | ||
100 | <filename>bitbake/doc/bitbake-user-manual</filename> directory. | ||
101 | </para></listitem> | ||
102 | <listitem><para><emphasis> | ||
103 | <ulink url='http://wiki.qemu.org/Index.html'>QEMU</ulink>: | ||
104 | </emphasis> An open source machine emulator and virtualizer. | ||
105 | </para></listitem> | ||
106 | </itemizedlist> | ||
107 | </para> | ||
108 | </section> | ||
109 | |||
110 | <section id='resources-contributions'> | ||
111 | <title>Contributions</title> | ||
112 | |||
113 | <para> | ||
114 | The Yocto Project gladly accepts contributions. | ||
115 | You can submit changes to the project either by creating and sending | ||
116 | pull requests, | ||
117 | or by submitting patches through email. | ||
118 | For information on how to do both as well as information on how | ||
119 | to find out who is the maintainer for areas of code, see the | ||
120 | "<ulink url='&YOCTO_DOCS_DEV_URL;#how-to-submit-a-change'>How to Submit a Change</ulink>" | ||
121 | section in the Yocto Project Development Manual. | ||
122 | </para> | ||
123 | </section> | ||
124 | |||
125 | </chapter> | ||
126 | <!-- | ||
127 | vim: expandtab tw=80 ts=4 | ||
128 | --> | ||
diff --git a/documentation/ref-manual/technical-details.xml b/documentation/ref-manual/technical-details.xml new file mode 100644 index 0000000..8bba42b --- /dev/null +++ b/documentation/ref-manual/technical-details.xml | |||
@@ -0,0 +1,1419 @@ | |||
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 | |||
5 | <chapter id='technical-details'> | ||
6 | <title>Technical Details</title> | ||
7 | |||
8 | <para> | ||
9 | This chapter provides technical details for various parts of the | ||
10 | Yocto Project. | ||
11 | Currently, topics include Yocto Project components, | ||
12 | cross-toolchain generation, shared state (sstate) cache, | ||
13 | x32, Wayland support, and Licenses. | ||
14 | </para> | ||
15 | |||
16 | <section id='usingpoky-components'> | ||
17 | <title>Yocto Project Components</title> | ||
18 | |||
19 | <para> | ||
20 | The | ||
21 | <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink> | ||
22 | task executor together with various types of configuration files form | ||
23 | the OpenEmbedded Core. | ||
24 | This section overviews these components by describing their use and | ||
25 | how they interact. | ||
26 | </para> | ||
27 | |||
28 | <para> | ||
29 | BitBake handles the parsing and execution of the data files. | ||
30 | The data itself is of various types: | ||
31 | <itemizedlist> | ||
32 | <listitem><para><emphasis>Recipes:</emphasis> Provides details | ||
33 | about particular pieces of software. | ||
34 | </para></listitem> | ||
35 | <listitem><para><emphasis>Class Data:</emphasis> Abstracts | ||
36 | common build information (e.g. how to build a Linux kernel). | ||
37 | </para></listitem> | ||
38 | <listitem><para><emphasis>Configuration Data:</emphasis> Defines | ||
39 | machine-specific settings, policy decisions, and so forth. | ||
40 | Configuration data acts as the glue to bind everything | ||
41 | together. | ||
42 | </para></listitem> | ||
43 | </itemizedlist> | ||
44 | </para> | ||
45 | |||
46 | <para> | ||
47 | BitBake knows how to combine multiple data sources together and refers | ||
48 | to each data source as a layer. | ||
49 | For information on layers, see the | ||
50 | "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and | ||
51 | Creating Layers</ulink>" section of the Yocto Project Development Manual. | ||
52 | </para> | ||
53 | |||
54 | <para> | ||
55 | Following are some brief details on these core components. | ||
56 | For additional information on how these components interact during | ||
57 | a build, see the | ||
58 | "<link linkend='closer-look'>A Closer Look at the Yocto Project Development Environment</link>" | ||
59 | Chapter. | ||
60 | </para> | ||
61 | |||
62 | <section id='usingpoky-components-bitbake'> | ||
63 | <title>BitBake</title> | ||
64 | |||
65 | <para> | ||
66 | BitBake is the tool at the heart of the OpenEmbedded build system | ||
67 | and is responsible for parsing the | ||
68 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>, | ||
69 | generating a list of tasks from it, and then executing those tasks. | ||
70 | </para> | ||
71 | |||
72 | <para> | ||
73 | This section briefly introduces BitBake. | ||
74 | If you want more information on BitBake, see the | ||
75 | <ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual'>BitBake User Manual</ulink>. | ||
76 | </para> | ||
77 | |||
78 | <para> | ||
79 | To see a list of the options BitBake supports, use either of | ||
80 | the following commands: | ||
81 | <literallayout class='monospaced'> | ||
82 | $ bitbake -h | ||
83 | $ bitbake --help | ||
84 | </literallayout> | ||
85 | </para> | ||
86 | |||
87 | <para> | ||
88 | The most common usage for BitBake is <filename>bitbake <packagename></filename>, where | ||
89 | <filename>packagename</filename> is the name of the package you want to build | ||
90 | (referred to as the "target" in this manual). | ||
91 | The target often equates to the first part of a recipe's filename | ||
92 | (e.g. "foo" for a recipe named | ||
93 | <filename>foo_1.3.0-r0.bb</filename>). | ||
94 | So, to process the <filename>matchbox-desktop_1.2.3.bb</filename> recipe file, you | ||
95 | might type the following: | ||
96 | <literallayout class='monospaced'> | ||
97 | $ bitbake matchbox-desktop | ||
98 | </literallayout> | ||
99 | Several different versions of <filename>matchbox-desktop</filename> might exist. | ||
100 | BitBake chooses the one selected by the distribution configuration. | ||
101 | You can get more details about how BitBake chooses between different | ||
102 | target versions and providers in the | ||
103 | "<ulink url='&YOCTO_DOCS_BB_URL;#bb-bitbake-preferences'>Preferences</ulink>" | ||
104 | section of the BitBake User Manual. | ||
105 | </para> | ||
106 | |||
107 | <para> | ||
108 | BitBake also tries to execute any dependent tasks first. | ||
109 | So for example, before building <filename>matchbox-desktop</filename>, BitBake | ||
110 | would build a cross compiler and <filename>eglibc</filename> if they had not already | ||
111 | been built. | ||
112 | <note>This release of the Yocto Project does not support the <filename>glibc</filename> | ||
113 | GNU version of the Unix standard C library. By default, the OpenEmbedded build system | ||
114 | builds with <filename>eglibc</filename>.</note> | ||
115 | </para> | ||
116 | |||
117 | <para> | ||
118 | A useful BitBake option to consider is the <filename>-k</filename> or | ||
119 | <filename>--continue</filename> option. | ||
120 | This option instructs BitBake to try and continue processing the job | ||
121 | as long as possible even after encountering an error. | ||
122 | When an error occurs, the target that | ||
123 | failed and those that depend on it cannot be remade. | ||
124 | However, when you use this option other dependencies can still be | ||
125 | processed. | ||
126 | </para> | ||
127 | </section> | ||
128 | |||
129 | <section id='usingpoky-components-metadata'> | ||
130 | <title>Metadata (Recipes)</title> | ||
131 | |||
132 | <para> | ||
133 | Files that have the <filename>.bb</filename> suffix are "recipes" | ||
134 | files. | ||
135 | In general, a recipe contains information about a single piece of | ||
136 | software. | ||
137 | This information includes the location from which to download the | ||
138 | unaltered source, any source patches to be applied to that source | ||
139 | (if needed), which special configuration options to apply, | ||
140 | how to compile the source files, and how to package the compiled | ||
141 | output. | ||
142 | </para> | ||
143 | |||
144 | <para> | ||
145 | The term "package" is sometimes used to refer to recipes. However, | ||
146 | since the word "package" is used for the packaged output from the OpenEmbedded | ||
147 | build system (i.e. <filename>.ipk</filename> or <filename>.deb</filename> files), | ||
148 | this document avoids using the term "package" when referring to recipes. | ||
149 | </para> | ||
150 | </section> | ||
151 | |||
152 | <section id='usingpoky-components-classes'> | ||
153 | <title>Classes</title> | ||
154 | |||
155 | <para> | ||
156 | Class files (<filename>.bbclass</filename>) contain information that | ||
157 | is useful to share between | ||
158 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> files. | ||
159 | An example is the | ||
160 | <link linkend='ref-classes-autotools'><filename>autotools</filename></link> | ||
161 | class, which contains common settings for any application that | ||
162 | Autotools uses. | ||
163 | The "<link linkend='ref-classes'>Classes</link>" chapter provides | ||
164 | details about classes and how to use them. | ||
165 | </para> | ||
166 | </section> | ||
167 | |||
168 | <section id='usingpoky-components-configuration'> | ||
169 | <title>Configuration</title> | ||
170 | |||
171 | <para> | ||
172 | The configuration files (<filename>.conf</filename>) define various configuration variables | ||
173 | that govern the OpenEmbedded build process. | ||
174 | These files fall into several areas that define machine configuration options, | ||
175 | distribution configuration options, compiler tuning options, general common configuration | ||
176 | options, and user configuration options in <filename>local.conf</filename>, which is found | ||
177 | in the | ||
178 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
179 | </para> | ||
180 | </section> | ||
181 | </section> | ||
182 | |||
183 | <section id="cross-development-toolchain-generation"> | ||
184 | <title>Cross-Development Toolchain Generation</title> | ||
185 | |||
186 | <para> | ||
187 | The Yocto Project does most of the work for you when it comes to | ||
188 | creating | ||
189 | <ulink url='&YOCTO_DOCS_DEV_URL;#cross-development-toolchain'>cross-development toolchains</ulink>. | ||
190 | This section provides some technical background on how | ||
191 | cross-development toolchains are created and used. | ||
192 | For more information on toolchains, you can also see the | ||
193 | <ulink url='&YOCTO_DOCS_ADT_URL;'>Yocto Project Application Developer's Guide</ulink>. | ||
194 | </para> | ||
195 | |||
196 | <para> | ||
197 | In the Yocto Project development environment, cross-development | ||
198 | toolchains are used to build the image and applications that run on the | ||
199 | target hardware. | ||
200 | With just a few commands, the OpenEmbedded build system creates | ||
201 | these necessary toolchains for you. | ||
202 | </para> | ||
203 | |||
204 | <para> | ||
205 | The following figure shows a high-level build environment regarding | ||
206 | toolchain construction and use. | ||
207 | </para> | ||
208 | |||
209 | <para> | ||
210 | <imagedata fileref="figures/cross-development-toolchains.png" width="8in" depth="6in" align="center" /> | ||
211 | </para> | ||
212 | |||
213 | <para> | ||
214 | Most of the work occurs on the Build Host. | ||
215 | This is the machine used to build images and generally work within the | ||
216 | the Yocto Project environment. | ||
217 | When you run BitBake to create an image, the OpenEmbedded build system | ||
218 | uses the host <filename>gcc</filename> compiler to bootstrap a | ||
219 | cross-compiler named <filename>gcc-cross</filename>. | ||
220 | The <filename>gcc-cross</filename> compiler is what BitBake uses to | ||
221 | compile source files when creating the target image. | ||
222 | You can think of <filename>gcc-cross</filename> simply as an | ||
223 | automatically generated cross-compiler that is used internally within | ||
224 | BitBake only. | ||
225 | </para> | ||
226 | |||
227 | <para> | ||
228 | The chain of events that occurs when <filename>gcc-cross</filename> is | ||
229 | bootstrapped is as follows: | ||
230 | <literallayout class='monospaced'> | ||
231 | gcc -> binutils-cross -> gcc-cross-initial -> linux-libc-headers -> eglibc-initial -> eglibc -> gcc-cross -> gcc-runtime | ||
232 | </literallayout> | ||
233 | <itemizedlist> | ||
234 | <listitem><para><filename>gcc</filename>: | ||
235 | The build host's GNU Compiler Collection (GCC). | ||
236 | </para></listitem> | ||
237 | <listitem><para><filename>binutils-cross</filename>: | ||
238 | The bare minimum binary utilities needed in order to run | ||
239 | the <filename>gcc-cross-initial</filename> phase of the | ||
240 | bootstrap operation. | ||
241 | </para></listitem> | ||
242 | <listitem><para><filename>gcc-cross-initial</filename>: | ||
243 | An early stage of the bootstrap process for creating | ||
244 | the cross-compiler. | ||
245 | This stage builds enough of the <filename>gcc-cross</filename>, | ||
246 | the C library, and other pieces needed to finish building the | ||
247 | final cross-compiler in later stages. | ||
248 | This tool is a "native" package (i.e. it is designed to run on | ||
249 | the build host). | ||
250 | </para></listitem> | ||
251 | <listitem><para><filename>linux-libc-headers</filename>: | ||
252 | Headers needed for the cross-compiler. | ||
253 | </para></listitem> | ||
254 | <listitem><para><filename>eglibc-initial</filename>: | ||
255 | An initial version of the Embedded GLIBC needed to bootstrap | ||
256 | <filename>eglibc</filename>. | ||
257 | </para></listitem> | ||
258 | <listitem><para><filename>gcc-cross</filename>: | ||
259 | The final stage of the bootstrap process for the | ||
260 | cross-compiler. | ||
261 | This stage results in the actual cross-compiler that | ||
262 | BitBake uses when it builds an image for a targeted | ||
263 | device. | ||
264 | <note> | ||
265 | If you are replacing this cross compiler toolchain | ||
266 | with a custom version, you must replace | ||
267 | <filename>gcc-cross</filename>. | ||
268 | </note> | ||
269 | This tool is also a "native" package (i.e. it is | ||
270 | designed to run on the build host). | ||
271 | </para></listitem> | ||
272 | <listitem><para><filename>gcc-runtime</filename>: | ||
273 | Runtime libraries resulting from the toolchain bootstrapping | ||
274 | process. | ||
275 | This tool produces a binary that consists of the | ||
276 | runtime libraries need for the targeted device. | ||
277 | </para></listitem> | ||
278 | </itemizedlist> | ||
279 | </para> | ||
280 | |||
281 | <para> | ||
282 | You can use the OpenEmbedded build system to build an installer for | ||
283 | the relocatable SDK used to develop applications. | ||
284 | When you run the installer, it installs the toolchain, which contains | ||
285 | the development tools (e.g., the | ||
286 | <filename>gcc-cross-canadian</filename>), | ||
287 | <filename>binutils-cross-canadian</filename>, and other | ||
288 | <filename>nativesdk-*</filename> tools you need to cross-compile and | ||
289 | test your software. | ||
290 | The figure shows the commands you use to easily build out this | ||
291 | toolchain. | ||
292 | This cross-development toolchain is built to execute on the | ||
293 | <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>, | ||
294 | which might or might not be the same | ||
295 | machine as the Build Host. | ||
296 | <note> | ||
297 | If your target architecture is supported by the Yocto Project, | ||
298 | you can take advantage of pre-built images that ship with the | ||
299 | Yocto Project and already contain cross-development toolchain | ||
300 | installers. | ||
301 | </note> | ||
302 | </para> | ||
303 | |||
304 | <para> | ||
305 | Here is the bootstrap process for the relocatable toolchain: | ||
306 | <literallayout class='monospaced'> | ||
307 | gcc -> binutils-crosssdk -> gcc-crosssdk-initial -> linux-libc-headers -> eglibc-initial -> nativesdk-eglibc -> gcc-crosssdk -> gcc-cross-canadian | ||
308 | </literallayout> | ||
309 | <itemizedlist> | ||
310 | <listitem><para><filename>gcc</filename>: | ||
311 | The build host's GNU Compiler Collection (GCC). | ||
312 | </para></listitem> | ||
313 | <listitem><para><filename>binutils-crosssdk</filename>: | ||
314 | The bare minimum binary utilities needed in order to run | ||
315 | the <filename>gcc-crosssdk-initial</filename> phase of the | ||
316 | bootstrap operation. | ||
317 | </para></listitem> | ||
318 | <listitem><para><filename>gcc-crosssdk-initial</filename>: | ||
319 | An early stage of the bootstrap process for creating | ||
320 | the cross-compiler. | ||
321 | This stage builds enough of the | ||
322 | <filename>gcc-crosssdk</filename> and supporting pieces so that | ||
323 | the final stage of the bootstrap process can produce the | ||
324 | finished cross-compiler. | ||
325 | This tool is a "native" binary that runs on the build host. | ||
326 | </para></listitem> | ||
327 | <listitem><para><filename>linux-libc-headers</filename>: | ||
328 | Headers needed for the cross-compiler. | ||
329 | </para></listitem> | ||
330 | <listitem><para><filename>eglibc-initial</filename>: | ||
331 | An initial version of the Embedded GLIBC needed to bootstrap | ||
332 | <filename>nativesdk-eglibc</filename>. | ||
333 | </para></listitem> | ||
334 | <listitem><para><filename>nativesdk-eglibc</filename>: | ||
335 | The Embedded GLIBC needed to bootstrap the | ||
336 | <filename>gcc-crosssdk</filename>. | ||
337 | </para></listitem> | ||
338 | <listitem><para><filename>gcc-crosssdk</filename>: | ||
339 | The final stage of the bootstrap process for the | ||
340 | relocatable cross-compiler. | ||
341 | The <filename>gcc-crosssdk</filename> is a transitory compiler | ||
342 | and never leaves the build host. | ||
343 | Its purpose is to help in the bootstrap process to create the | ||
344 | eventual relocatable <filename>gcc-cross-canadian</filename> | ||
345 | compiler, which is relocatable. | ||
346 | This tool is also a "native" package (i.e. it is | ||
347 | designed to run on the build host). | ||
348 | </para></listitem> | ||
349 | <listitem><para><filename>gcc-cross-canadian</filename>: | ||
350 | The final relocatable cross-compiler. | ||
351 | When run on the | ||
352 | <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>, | ||
353 | this tool | ||
354 | produces executable code that runs on the target device. | ||
355 | Only one cross-canadian compiler is produced per architecture | ||
356 | since they can be targeted at different processor optimizations | ||
357 | using configurations passed to the compiler through the | ||
358 | compile commands. | ||
359 | This circumvents the need for multiple compilers and thus | ||
360 | reduces the size of the toolchains. | ||
361 | </para></listitem> | ||
362 | </itemizedlist> | ||
363 | </para> | ||
364 | |||
365 | <note> | ||
366 | For information on advantages gained when building a | ||
367 | cross-development toolchain installer, see the | ||
368 | "<ulink url='&YOCTO_DOCS_ADT_URL;#optionally-building-a-toolchain-installer'>Optionally Building a Toolchain Installer</ulink>" | ||
369 | section in the Yocto Project Application Developer's Guide. | ||
370 | </note> | ||
371 | </section> | ||
372 | |||
373 | <section id="shared-state-cache"> | ||
374 | <title>Shared State Cache</title> | ||
375 | |||
376 | <para> | ||
377 | By design, the OpenEmbedded build system builds everything from scratch unless | ||
378 | BitBake can determine that parts do not need to be rebuilt. | ||
379 | Fundamentally, building from scratch is attractive as it means all parts are | ||
380 | built fresh and there is no possibility of stale data causing problems. | ||
381 | When developers hit problems, they typically default back to building from scratch | ||
382 | so they know the state of things from the start. | ||
383 | </para> | ||
384 | |||
385 | <para> | ||
386 | Building an image from scratch is both an advantage and a disadvantage to the process. | ||
387 | As mentioned in the previous paragraph, building from scratch ensures that | ||
388 | everything is current and starts from a known state. | ||
389 | However, building from scratch also takes much longer as it generally means | ||
390 | rebuilding things that do not necessarily need to be rebuilt. | ||
391 | </para> | ||
392 | |||
393 | <para> | ||
394 | The Yocto Project implements shared state code that supports incremental builds. | ||
395 | The implementation of the shared state code answers the following questions that | ||
396 | were fundamental roadblocks within the OpenEmbedded incremental build support system: | ||
397 | <itemizedlist> | ||
398 | <listitem><para>What pieces of the system have changed and what pieces have | ||
399 | not changed?</para></listitem> | ||
400 | <listitem><para>How are changed pieces of software removed and replaced?</para></listitem> | ||
401 | <listitem><para>How are pre-built components that do not need to be rebuilt from scratch | ||
402 | used when they are available?</para></listitem> | ||
403 | </itemizedlist> | ||
404 | </para> | ||
405 | |||
406 | <para> | ||
407 | For the first question, the build system detects changes in the "inputs" to a given task by | ||
408 | creating a checksum (or signature) of the task's inputs. | ||
409 | If the checksum changes, the system assumes the inputs have changed and the task needs to be | ||
410 | rerun. | ||
411 | For the second question, the shared state (sstate) code tracks which tasks add which output | ||
412 | to the build process. | ||
413 | This means the output from a given task can be removed, upgraded or otherwise manipulated. | ||
414 | The third question is partly addressed by the solution for the second question | ||
415 | assuming the build system can fetch the sstate objects from remote locations and | ||
416 | install them if they are deemed to be valid. | ||
417 | </para> | ||
418 | |||
419 | <note> | ||
420 | The OpenEmbedded build system does not maintain | ||
421 | <link linkend='var-PR'><filename>PR</filename></link> information | ||
422 | as part of the shared state packages. | ||
423 | Consequently, considerations exist that affect maintaining shared | ||
424 | state feeds. | ||
425 | For information on how the OpenEmbedded build system | ||
426 | works with packages and can | ||
427 | track incrementing <filename>PR</filename> information, see the | ||
428 | "<ulink url='&YOCTO_DOCS_DEV_URL;#incrementing-a-package-revision-number'>Incrementing a Package Revision Number</ulink>" | ||
429 | section. | ||
430 | </note> | ||
431 | |||
432 | <para> | ||
433 | The rest of this section goes into detail about the overall incremental build | ||
434 | architecture, the checksums (signatures), shared state, and some tips and tricks. | ||
435 | </para> | ||
436 | |||
437 | <section id='overall-architecture'> | ||
438 | <title>Overall Architecture</title> | ||
439 | |||
440 | <para> | ||
441 | When determining what parts of the system need to be built, BitBake | ||
442 | works on a per-task basis rather than a per-recipe basis. | ||
443 | You might wonder why using a per-task basis is preferred over a per-recipe basis. | ||
444 | To help explain, consider having the IPK packaging backend enabled and then switching to DEB. | ||
445 | In this case, the | ||
446 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
447 | and | ||
448 | <link linkend='ref-tasks-package'><filename>do_package</filename></link> | ||
449 | task outputs are still valid. | ||
450 | However, with a per-recipe approach, the build would not include the | ||
451 | <filename>.deb</filename> files. | ||
452 | Consequently, you would have to invalidate the whole build and rerun it. | ||
453 | Rerunning everything is not the best solution. | ||
454 | Also, in this case, the core must be "taught" much about specific tasks. | ||
455 | This methodology does not scale well and does not allow users to easily add new tasks | ||
456 | in layers or as external recipes without touching the packaged-staging core. | ||
457 | </para> | ||
458 | </section> | ||
459 | |||
460 | <section id='checksums'> | ||
461 | <title>Checksums (Signatures)</title> | ||
462 | |||
463 | <para> | ||
464 | The shared state code uses a checksum, which is a unique signature of a task's | ||
465 | inputs, to determine if a task needs to be run again. | ||
466 | Because it is a change in a task's inputs that triggers a rerun, the process | ||
467 | needs to detect all the inputs to a given task. | ||
468 | For shell tasks, this turns out to be fairly easy because | ||
469 | the build process generates a "run" shell script for each task and | ||
470 | it is possible to create a checksum that gives you a good idea of when | ||
471 | the task's data changes. | ||
472 | </para> | ||
473 | |||
474 | <para> | ||
475 | To complicate the problem, there are things that should not be included in | ||
476 | the checksum. | ||
477 | First, there is the actual specific build path of a given task - | ||
478 | the <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>. | ||
479 | It does not matter if the work directory changes because it should not | ||
480 | affect the output for target packages. | ||
481 | Also, the build process has the objective of making native or cross packages relocatable. | ||
482 | The checksum therefore needs to exclude <filename>WORKDIR</filename>. | ||
483 | The simplistic approach for excluding the work directory is to set | ||
484 | <filename>WORKDIR</filename> to some fixed value and create the checksum | ||
485 | for the "run" script. | ||
486 | </para> | ||
487 | |||
488 | <para> | ||
489 | Another problem results from the "run" scripts containing functions that | ||
490 | might or might not get called. | ||
491 | The incremental build solution contains code that figures out dependencies | ||
492 | between shell functions. | ||
493 | This code is used to prune the "run" scripts down to the minimum set, | ||
494 | thereby alleviating this problem and making the "run" scripts much more | ||
495 | readable as a bonus. | ||
496 | </para> | ||
497 | |||
498 | <para> | ||
499 | So far we have solutions for shell scripts. | ||
500 | What about Python tasks? | ||
501 | The same approach applies even though these tasks are more difficult. | ||
502 | The process needs to figure out what variables a Python function accesses | ||
503 | and what functions it calls. | ||
504 | Again, the incremental build solution contains code that first figures out | ||
505 | the variable and function dependencies, and then creates a checksum for the data | ||
506 | used as the input to the task. | ||
507 | </para> | ||
508 | |||
509 | <para> | ||
510 | Like the <filename>WORKDIR</filename> case, situations exist where dependencies | ||
511 | should be ignored. | ||
512 | For these cases, you can instruct the build process to ignore a dependency | ||
513 | by using a line like the following: | ||
514 | <literallayout class='monospaced'> | ||
515 | PACKAGE_ARCHS[vardepsexclude] = "MACHINE" | ||
516 | </literallayout> | ||
517 | This example ensures that the | ||
518 | <link linkend='var-PACKAGE_ARCHS'><filename>PACKAGE_ARCHS</filename></link> | ||
519 | variable does not | ||
520 | depend on the value of | ||
521 | <link linkend='var-MACHINE'><filename>MACHINE</filename></link>, | ||
522 | even if it does reference it. | ||
523 | </para> | ||
524 | |||
525 | <para> | ||
526 | Equally, there are cases where we need to add dependencies BitBake is not able to find. | ||
527 | You can accomplish this by using a line like the following: | ||
528 | <literallayout class='monospaced'> | ||
529 | PACKAGE_ARCHS[vardeps] = "MACHINE" | ||
530 | </literallayout> | ||
531 | This example explicitly adds the <filename>MACHINE</filename> variable as a | ||
532 | dependency for <filename>PACKAGE_ARCHS</filename>. | ||
533 | </para> | ||
534 | |||
535 | <para> | ||
536 | Consider a case with in-line Python, for example, where BitBake is not | ||
537 | able to figure out dependencies. | ||
538 | When running in debug mode (i.e. using <filename>-DDD</filename>), BitBake | ||
539 | produces output when it discovers something for which it cannot figure out | ||
540 | dependencies. | ||
541 | The Yocto Project team has currently not managed to cover those dependencies | ||
542 | in detail and is aware of the need to fix this situation. | ||
543 | </para> | ||
544 | |||
545 | <para> | ||
546 | Thus far, this section has limited discussion to the direct inputs into a task. | ||
547 | Information based on direct inputs is referred to as the "basehash" in the | ||
548 | code. | ||
549 | However, there is still the question of a task's indirect inputs - the | ||
550 | things that were already built and present in the | ||
551 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
552 | The checksum (or signature) for a particular task needs to add the hashes | ||
553 | of all the tasks on which the particular task depends. | ||
554 | Choosing which dependencies to add is a policy decision. | ||
555 | However, the effect is to generate a master checksum that combines the basehash | ||
556 | and the hashes of the task's dependencies. | ||
557 | </para> | ||
558 | |||
559 | <para> | ||
560 | At the code level, there are a variety of ways both the basehash and the | ||
561 | dependent task hashes can be influenced. | ||
562 | Within the BitBake configuration file, we can give BitBake some extra information | ||
563 | to help it construct the basehash. | ||
564 | The following statement effectively results in a list of global variable | ||
565 | dependency excludes - variables never included in any checksum: | ||
566 | <literallayout class='monospaced'> | ||
567 | BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR \ | ||
568 | SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \ | ||
569 | USER FILESPATH STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE PRSERV_HOST \ | ||
570 | PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \ | ||
571 | CCACHE_DIR EXTERNAL_TOOLCHAIN CCACHE CCACHE_DISABLE LICENSE_PATH SDKPKGSUFFIX" | ||
572 | </literallayout> | ||
573 | The previous example excludes | ||
574 | <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link> | ||
575 | since that variable is actually constructed as a path within | ||
576 | <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>, which is on | ||
577 | the whitelist. | ||
578 | </para> | ||
579 | |||
580 | <para> | ||
581 | The rules for deciding which hashes of dependent tasks to include through | ||
582 | dependency chains are more complex and are generally accomplished with a | ||
583 | Python function. | ||
584 | The code in <filename>meta/lib/oe/sstatesig.py</filename> shows two examples | ||
585 | of this and also illustrates how you can insert your own policy into the system | ||
586 | if so desired. | ||
587 | This file defines the two basic signature generators <filename>OE-Core</filename> | ||
588 | uses: "OEBasic" and "OEBasicHash". | ||
589 | By default, there is a dummy "noop" signature handler enabled in BitBake. | ||
590 | This means that behavior is unchanged from previous versions. | ||
591 | <filename>OE-Core</filename> uses the "OEBasicHash" signature handler by default | ||
592 | through this setting in the <filename>bitbake.conf</filename> file: | ||
593 | <literallayout class='monospaced'> | ||
594 | BB_SIGNATURE_HANDLER ?= "OEBasicHash" | ||
595 | </literallayout> | ||
596 | The "OEBasicHash" <filename>BB_SIGNATURE_HANDLER</filename> is the same as the | ||
597 | "OEBasic" version but adds the task hash to the stamp files. | ||
598 | This results in any | ||
599 | <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink> | ||
600 | change that changes the task hash, automatically | ||
601 | causing the task to be run again. | ||
602 | This removes the need to bump <link linkend='var-PR'><filename>PR</filename></link> | ||
603 | values, and changes to Metadata automatically ripple across the build. | ||
604 | </para> | ||
605 | |||
606 | <para> | ||
607 | It is also worth noting that the end result of these signature generators is to | ||
608 | make some dependency and hash information available to the build. | ||
609 | This information includes: | ||
610 | <itemizedlist> | ||
611 | <listitem><para><filename>BB_BASEHASH_task-<taskname></filename>: | ||
612 | The base hashes for each task in the recipe. | ||
613 | </para></listitem> | ||
614 | <listitem><para><filename>BB_BASEHASH_<filename:taskname></filename>: | ||
615 | The base hashes for each dependent task. | ||
616 | </para></listitem> | ||
617 | <listitem><para><filename>BBHASHDEPS_<filename:taskname></filename>: | ||
618 | The task dependencies for each task. | ||
619 | </para></listitem> | ||
620 | <listitem><para><filename>BB_TASKHASH</filename>: | ||
621 | The hash of the currently running task. | ||
622 | </para></listitem> | ||
623 | </itemizedlist> | ||
624 | </para> | ||
625 | </section> | ||
626 | |||
627 | <section id='shared-state'> | ||
628 | <title>Shared State</title> | ||
629 | |||
630 | <para> | ||
631 | Checksums and dependencies, as discussed in the previous section, solve half the | ||
632 | problem of supporting a shared state. | ||
633 | The other part of the problem is being able to use checksum information during the build | ||
634 | and being able to reuse or rebuild specific components. | ||
635 | </para> | ||
636 | |||
637 | <para> | ||
638 | The | ||
639 | <link linkend='ref-classes-sstate'><filename>sstate</filename></link> | ||
640 | class is a relatively generic implementation of how to "capture" | ||
641 | a snapshot of a given task. | ||
642 | The idea is that the build process does not care about the source of a task's output. | ||
643 | Output could be freshly built or it could be downloaded and unpacked from | ||
644 | somewhere - the build process does not need to worry about its origin. | ||
645 | </para> | ||
646 | |||
647 | <para> | ||
648 | There are two types of output, one is just about creating a directory | ||
649 | in <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>. | ||
650 | A good example is the output of either | ||
651 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
652 | or | ||
653 | <link linkend='ref-tasks-package'><filename>do_package</filename></link>. | ||
654 | The other type of output occurs when a set of data is merged into a shared directory | ||
655 | tree such as the sysroot. | ||
656 | </para> | ||
657 | |||
658 | <para> | ||
659 | The Yocto Project team has tried to keep the details of the | ||
660 | implementation hidden in <filename>sstate</filename> class. | ||
661 | From a user's perspective, adding shared state wrapping to a task | ||
662 | is as simple as this | ||
663 | <link linkend='ref-tasks-deploy'><filename>do_deploy</filename></link> | ||
664 | example taken from the | ||
665 | <link linkend='ref-classes-deploy'><filename>deploy</filename></link> | ||
666 | class: | ||
667 | <literallayout class='monospaced'> | ||
668 | DEPLOYDIR = "${WORKDIR}/deploy-${PN}" | ||
669 | SSTATETASKS += "do_deploy" | ||
670 | do_deploy[sstate-name] = "deploy" | ||
671 | do_deploy[sstate-inputdirs] = "${DEPLOYDIR}" | ||
672 | do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}" | ||
673 | |||
674 | python do_deploy_setscene () { | ||
675 | sstate_setscene(d) | ||
676 | } | ||
677 | addtask do_deploy_setscene | ||
678 | do_deploy[dirs] = "${DEPLOYDIR} ${B}" | ||
679 | </literallayout> | ||
680 | In this example, we add some extra flags to the task, a name field ("deploy"), an | ||
681 | input directory where the task sends data, and the output | ||
682 | directory where the data from the task should eventually be copied. | ||
683 | We also add a <filename>_setscene</filename> variant of the task and add the task | ||
684 | name to the <filename>SSTATETASKS</filename> list. | ||
685 | </para> | ||
686 | |||
687 | <para> | ||
688 | If you have a directory whose contents you need to preserve, you can do this with | ||
689 | a line like the following: | ||
690 | <literallayout class='monospaced'> | ||
691 | do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST}" | ||
692 | </literallayout> | ||
693 | This method, as well as the following example, also works for multiple directories. | ||
694 | <literallayout class='monospaced'> | ||
695 | do_package[sstate-inputdirs] = "${PKGDESTWORK} ${SHLIBSWORKDIR}" | ||
696 | do_package[sstate-outputdirs] = "${PKGDATA_DIR} ${SHLIBSDIR}" | ||
697 | do_package[sstate-lockfile] = "${PACKAGELOCK}" | ||
698 | </literallayout> | ||
699 | These methods also include the ability to take a lockfile when manipulating | ||
700 | shared state directory structures since some cases are sensitive to file | ||
701 | additions or removals. | ||
702 | </para> | ||
703 | |||
704 | <para> | ||
705 | Behind the scenes, the shared state code works by looking in | ||
706 | <link linkend='var-SSTATE_DIR'><filename>SSTATE_DIR</filename></link> and | ||
707 | <link linkend='var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></link> | ||
708 | for shared state files. | ||
709 | Here is an example: | ||
710 | <literallayout class='monospaced'> | ||
711 | SSTATE_MIRRORS ?= "\ | ||
712 | file://.* http://someserver.tld/share/sstate/PATH \n \ | ||
713 | file://.* file:///some/local/dir/sstate/PATH" | ||
714 | </literallayout> | ||
715 | <note> | ||
716 | The shared state directory (<filename>SSTATE_DIR</filename>) is | ||
717 | organized into two-character subdirectories, where the subdirectory | ||
718 | names are based on the first two characters of the hash. | ||
719 | If the shared state directory structure for a mirror has the | ||
720 | same structure as <filename>SSTATE_DIR</filename>, you must | ||
721 | specify "PATH" as part of the URI to enable the build system | ||
722 | to map to the appropriate subdirectory. | ||
723 | </note> | ||
724 | </para> | ||
725 | |||
726 | <para> | ||
727 | The shared state package validity can be detected just by looking at the | ||
728 | filename since the filename contains the task checksum (or signature) as | ||
729 | described earlier in this section. | ||
730 | If a valid shared state package is found, the build process downloads it | ||
731 | and uses it to accelerate the task. | ||
732 | </para> | ||
733 | |||
734 | <para> | ||
735 | The build processes use the <filename>*_setscene</filename> tasks | ||
736 | for the task acceleration phase. | ||
737 | BitBake goes through this phase before the main execution code and tries | ||
738 | to accelerate any tasks for which it can find shared state packages. | ||
739 | If a shared state package for a task is available, the shared state | ||
740 | package is used. | ||
741 | This means the task and any tasks on which it is dependent are not | ||
742 | executed. | ||
743 | </para> | ||
744 | |||
745 | <para> | ||
746 | As a real world example, the aim is when building an IPK-based image, | ||
747 | only the | ||
748 | <link linkend='ref-tasks-package_write_ipk'><filename>do_package_write_ipk</filename></link> | ||
749 | tasks would have their | ||
750 | shared state packages fetched and extracted. | ||
751 | Since the sysroot is not used, it would never get extracted. | ||
752 | This is another reason why a task-based approach is preferred over a | ||
753 | recipe-based approach, which would have to install the output from every task. | ||
754 | </para> | ||
755 | </section> | ||
756 | |||
757 | <section id='tips-and-tricks'> | ||
758 | <title>Tips and Tricks</title> | ||
759 | |||
760 | <para> | ||
761 | The code in the build system that supports incremental builds is not | ||
762 | simple code. | ||
763 | This section presents some tips and tricks that help you work around | ||
764 | issues related to shared state code. | ||
765 | </para> | ||
766 | |||
767 | <section id='debugging'> | ||
768 | <title>Debugging</title> | ||
769 | |||
770 | <para> | ||
771 | When things go wrong, debugging needs to be straightforward. | ||
772 | Because of this, the Yocto Project includes strong debugging | ||
773 | tools: | ||
774 | <itemizedlist> | ||
775 | <listitem><para>Whenever a shared state package is written out, so is a | ||
776 | corresponding <filename>.siginfo</filename> file. | ||
777 | This practice results in a pickled Python database of all | ||
778 | the metadata that went into creating the hash for a given shared state | ||
779 | package.</para></listitem> | ||
780 | <listitem><para>If you run BitBake with the <filename>--dump-signatures</filename> | ||
781 | (or <filename>-S</filename>) option, BitBake dumps out | ||
782 | <filename>.siginfo</filename> files in | ||
783 | the stamp directory for every task it would have executed instead of | ||
784 | building the specified target package.</para></listitem> | ||
785 | <listitem><para>There is a <filename>bitbake-diffsigs</filename> command that | ||
786 | can process <filename>.siginfo</filename> files. | ||
787 | If you specify one of these files, BitBake dumps out the dependency | ||
788 | information in the file. | ||
789 | If you specify two files, BitBake compares the two files and dumps out | ||
790 | the differences between the two. | ||
791 | This more easily helps answer the question of "What | ||
792 | changed between X and Y?"</para></listitem> | ||
793 | </itemizedlist> | ||
794 | </para> | ||
795 | </section> | ||
796 | |||
797 | <section id='invalidating-shared-state'> | ||
798 | <title>Invalidating Shared State</title> | ||
799 | |||
800 | <para> | ||
801 | The OpenEmbedded build system uses checksums and shared state | ||
802 | cache to avoid unnecessarily rebuilding tasks. | ||
803 | Collectively, this scheme is known as "shared state code." | ||
804 | </para> | ||
805 | |||
806 | <para> | ||
807 | As with all schemes, this one has some drawbacks. | ||
808 | It is possible that you could make implicit changes to your | ||
809 | code that the checksum calculations do not take into | ||
810 | account. | ||
811 | These implicit changes affect a task's output but do not trigger | ||
812 | the shared state code into rebuilding a recipe. | ||
813 | Consider an example during which a tool changes its output. | ||
814 | Assume that the output of <filename>rpmdeps</filename> changes. | ||
815 | The result of the change should be that all the | ||
816 | <filename>package</filename> and | ||
817 | <filename>package_write_rpm</filename> shared state cache | ||
818 | items become invalid. | ||
819 | However, because the change to the output is | ||
820 | external to the code and therefore implicit, | ||
821 | the associated shared state cache items do not become | ||
822 | invalidated. | ||
823 | In this case, the build process uses the cached items rather | ||
824 | than running the task again. | ||
825 | Obviously, these types of implicit changes can cause problems. | ||
826 | </para> | ||
827 | |||
828 | <para> | ||
829 | To avoid these problems during the build, you need to | ||
830 | understand the effects of any changes you make. | ||
831 | Realize that changes you make directly to a function | ||
832 | are automatically factored into the checksum calculation. | ||
833 | Thus, these explicit changes invalidate the associated area of | ||
834 | shared state cache. | ||
835 | However, you need to be aware of any implicit changes that | ||
836 | are not obvious changes to the code and could affect the output | ||
837 | of a given task. | ||
838 | </para> | ||
839 | |||
840 | <para> | ||
841 | When you identify an implicit change, you can easily take steps | ||
842 | to invalidate the cache and force the tasks to run. | ||
843 | The steps you can take are as simple as changing a function's | ||
844 | comments in the source code. | ||
845 | For example, to invalidate package shared state files, change | ||
846 | the comment statements of | ||
847 | <link linkend='ref-tasks-package'><filename>do_package</filename></link> | ||
848 | or the comments of one of the functions it calls. | ||
849 | Even though the change is purely cosmetic, it causes the | ||
850 | checksum to be recalculated and forces the OpenEmbedded build | ||
851 | system to run the task again. | ||
852 | </para> | ||
853 | |||
854 | <note> | ||
855 | For an example of a commit that makes a cosmetic change to | ||
856 | invalidate shared state, see this | ||
857 | <ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/commit/meta/classes/package.bbclass?id=737f8bbb4f27b4837047cb9b4fbfe01dfde36d54'>commit</ulink>. | ||
858 | </note> | ||
859 | </section> | ||
860 | </section> | ||
861 | </section> | ||
862 | |||
863 | <section id='x32'> | ||
864 | <title>x32</title> | ||
865 | |||
866 | <para> | ||
867 | x32 is a processor-specific Application Binary Interface (psABI) for x86_64. | ||
868 | An ABI defines the calling conventions between functions in a processing environment. | ||
869 | The interface determines what registers are used and what the sizes are for various C data types. | ||
870 | </para> | ||
871 | |||
872 | <para> | ||
873 | Some processing environments prefer using 32-bit applications even when running | ||
874 | on Intel 64-bit platforms. | ||
875 | Consider the i386 psABI, which is a very old 32-bit ABI for Intel 64-bit platforms. | ||
876 | The i386 psABI does not provide efficient use and access of the Intel 64-bit processor resources, | ||
877 | leaving the system underutilized. | ||
878 | Now consider the x86_64 psABI. | ||
879 | This ABI is newer and uses 64-bits for data sizes and program pointers. | ||
880 | The extra bits increase the footprint size of the programs, libraries, | ||
881 | and also increases the memory and file system size requirements. | ||
882 | Executing under the x32 psABI enables user programs to utilize CPU and system resources | ||
883 | more efficiently while keeping the memory footprint of the applications low. | ||
884 | Extra bits are used for registers but not for addressing mechanisms. | ||
885 | </para> | ||
886 | |||
887 | <section id='support'> | ||
888 | <title>Support</title> | ||
889 | |||
890 | <para> | ||
891 | This Yocto Project release supports the final specifications of x32 | ||
892 | psABI. | ||
893 | Support for x32 psABI exists as follows: | ||
894 | <itemizedlist> | ||
895 | <listitem><para>You can create packages and images in x32 psABI format on x86_64 architecture targets. | ||
896 | </para></listitem> | ||
897 | <listitem><para>You can successfully build many recipes with the x32 toolchain.</para></listitem> | ||
898 | <listitem><para>You can create and boot <filename>core-image-minimal</filename> and | ||
899 | <filename>core-image-sato</filename> images.</para></listitem> | ||
900 | </itemizedlist> | ||
901 | </para> | ||
902 | </section> | ||
903 | |||
904 | <section id='completing-x32'> | ||
905 | <title>Completing x32</title> | ||
906 | |||
907 | <para> | ||
908 | Future Plans for the x32 psABI in the Yocto Project include the following: | ||
909 | <itemizedlist> | ||
910 | <listitem><para>Enhance and fix the few remaining recipes so they | ||
911 | work with and support x32 toolchains.</para></listitem> | ||
912 | <listitem><para>Enhance RPM Package Manager (RPM) support for x32 binaries.</para></listitem> | ||
913 | <listitem><para>Support larger images.</para></listitem> | ||
914 | </itemizedlist> | ||
915 | </para> | ||
916 | </section> | ||
917 | |||
918 | <section id='using-x32-right-now'> | ||
919 | <title>Using x32 Right Now</title> | ||
920 | |||
921 | <para> | ||
922 | Follow these steps to use the x32 spABI: | ||
923 | <itemizedlist> | ||
924 | <listitem><para>Enable the x32 psABI tuning file for <filename>x86_64</filename> | ||
925 | machines by editing the <filename>conf/local.conf</filename> like this: | ||
926 | <literallayout class='monospaced'> | ||
927 | MACHINE = "qemux86-64" | ||
928 | DEFAULTTUNE = "x86-64-x32" | ||
929 | baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) \ | ||
930 | or 'INVALID'), True) or 'lib'}" | ||
931 | #MACHINE = "genericx86" | ||
932 | #DEFAULTTUNE = "core2-64-x32" | ||
933 | </literallayout></para></listitem> | ||
934 | <listitem><para>As usual, use BitBake to build an image that supports the x32 psABI. | ||
935 | Here is an example: | ||
936 | <literallayout class='monospaced'> | ||
937 | $ bitbake core-image-sato | ||
938 | </literallayout></para></listitem> | ||
939 | <listitem><para>As usual, run your image using QEMU: | ||
940 | <literallayout class='monospaced'> | ||
941 | $ runqemu qemux86-64 core-image-sato | ||
942 | </literallayout></para></listitem> | ||
943 | </itemizedlist> | ||
944 | </para> | ||
945 | </section> | ||
946 | </section> | ||
947 | |||
948 | <section id="wayland"> | ||
949 | <title>Wayland</title> | ||
950 | |||
951 | <para> | ||
952 | <ulink url='http://en.wikipedia.org/wiki/Wayland_(display_server_protocol)'>Wayland</ulink> | ||
953 | is a computer display server protocol that | ||
954 | provides a method for compositing window managers to communicate | ||
955 | directly with applications and video hardware and expects them to | ||
956 | communicate with input hardware using other libraries. | ||
957 | Using Wayland with supporting targets can result in better control | ||
958 | over graphics frame rendering than an application might otherwise | ||
959 | achieve. | ||
960 | </para> | ||
961 | |||
962 | <para> | ||
963 | The Yocto Project provides the Wayland protocol libraries and the | ||
964 | reference | ||
965 | <ulink url='http://en.wikipedia.org/wiki/Wayland_(display_server_protocol)#Weston'>Weston</ulink> | ||
966 | compositor as part of its release. | ||
967 | This section describes what you need to do to implement Wayland and | ||
968 | use the compositor when building an image for a supporting target. | ||
969 | </para> | ||
970 | |||
971 | <section id="wayland-support"> | ||
972 | <title>Support</title> | ||
973 | |||
974 | <para> | ||
975 | The Wayland protocol libraries and the reference Weston compositor | ||
976 | ship as integrated packages in the <filename>meta</filename> layer | ||
977 | of the | ||
978 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
979 | Specifically, you can find the recipes that build both Wayland | ||
980 | and Weston at <filename>meta/recipes-graphics/wayland</filename>. | ||
981 | </para> | ||
982 | |||
983 | <para> | ||
984 | You can build both the Wayland and Weston packages for use only | ||
985 | with targets that accept the | ||
986 | <ulink url='http://dri.freedesktop.org/wiki/'>Mesa 3D and Direct Rendering Infrastructure</ulink>, | ||
987 | which is also known as Mesa DRI. | ||
988 | This implies that you cannot build and use the packages if your | ||
989 | target uses, for example, the | ||
990 | <trademark class='registered'>Intel</trademark> Embedded Media and | ||
991 | Graphics Driver (<trademark class='registered'>Intel</trademark> | ||
992 | EMGD) that overrides Mesa DRI. | ||
993 | </para> | ||
994 | |||
995 | <note> | ||
996 | Due to lack of EGL support, Weston 1.0.3 will not run directly on | ||
997 | the emulated QEMU hardware. | ||
998 | However, this version of Weston will run under X emulation without | ||
999 | issues. | ||
1000 | </note> | ||
1001 | </section> | ||
1002 | |||
1003 | <section id="enabling-wayland-in-an-image"> | ||
1004 | <title>Enabling Wayland in an Image</title> | ||
1005 | |||
1006 | <para> | ||
1007 | To enable Wayland, you need to enable it to be built and enable | ||
1008 | it to be included in the image. | ||
1009 | </para> | ||
1010 | |||
1011 | <section id="enable-building"> | ||
1012 | <title>Building</title> | ||
1013 | |||
1014 | <para> | ||
1015 | To cause Mesa to build the <filename>wayland-egl</filename> | ||
1016 | platform and Weston to build Wayland with Kernel Mode | ||
1017 | Setting | ||
1018 | (<ulink url='https://wiki.archlinux.org/index.php/Kernel_Mode_Setting'>KMS</ulink>) | ||
1019 | support, include the "wayland" flag in the | ||
1020 | <link linkend="var-DISTRO_FEATURES"><filename>DISTRO_FEATURES</filename></link> | ||
1021 | statement in your <filename>local.conf</filename> file: | ||
1022 | <literallayout class='monospaced'> | ||
1023 | DISTRO_FEATURES_append = " wayland" | ||
1024 | </literallayout> | ||
1025 | </para> | ||
1026 | |||
1027 | <note> | ||
1028 | If X11 has been enabled elsewhere, Weston will build Wayland | ||
1029 | with X11 support | ||
1030 | </note> | ||
1031 | </section> | ||
1032 | |||
1033 | <section id="enable-installation-in-an-image"> | ||
1034 | <title>Installing</title> | ||
1035 | |||
1036 | <para> | ||
1037 | To install the Wayland feature into an image, you must | ||
1038 | include the following | ||
1039 | <link linkend='var-CORE_IMAGE_EXTRA_INSTALL'><filename>CORE_IMAGE_EXTRA_INSTALL</filename></link> | ||
1040 | statement in your <filename>local.conf</filename> file: | ||
1041 | <literallayout class='monospaced'> | ||
1042 | CORE_IMAGE_EXTRA_INSTALL += "wayland weston" | ||
1043 | </literallayout> | ||
1044 | </para> | ||
1045 | </section> | ||
1046 | </section> | ||
1047 | |||
1048 | <section id="running-weston"> | ||
1049 | <title>Running Weston</title> | ||
1050 | |||
1051 | <para> | ||
1052 | To run Weston inside X11, enabling it as described earlier and | ||
1053 | building a Sato image is sufficient. | ||
1054 | If you are running your image under Sato, a Weston Launcher appears | ||
1055 | in the "Utility" category. | ||
1056 | </para> | ||
1057 | |||
1058 | <para> | ||
1059 | Alternatively, you can run Weston through the command-line | ||
1060 | interpretor (CLI), which is better suited for development work. | ||
1061 | To run Weston under the CLI, you need to do the following after | ||
1062 | your image is built: | ||
1063 | <orderedlist> | ||
1064 | <listitem><para>Run these commands to export | ||
1065 | <filename>XDG_RUNTIME_DIR</filename>: | ||
1066 | <literallayout class='monospaced'> | ||
1067 | mkdir -p /tmp/$USER-weston | ||
1068 | chmod 0700 /tmp/$USER-weston | ||
1069 | export XDG_RUNTIME_DIR=/tmp/$USER-weston | ||
1070 | </literallayout></para></listitem> | ||
1071 | <listitem><para>Launch Weston in the shell: | ||
1072 | <literallayout class='monospaced'> | ||
1073 | weston | ||
1074 | </literallayout></para></listitem> | ||
1075 | </orderedlist> | ||
1076 | </para> | ||
1077 | </section> | ||
1078 | </section> | ||
1079 | |||
1080 | <section id="licenses"> | ||
1081 | <title>Licenses</title> | ||
1082 | |||
1083 | <para> | ||
1084 | This section describes the mechanism by which the OpenEmbedded build system | ||
1085 | tracks changes to licensing text. | ||
1086 | The section also describes how to enable commercially licensed recipes, | ||
1087 | which by default are disabled. | ||
1088 | </para> | ||
1089 | |||
1090 | <para> | ||
1091 | For information that can help you maintain compliance with various open | ||
1092 | source licensing during the lifecycle of the product, see the | ||
1093 | "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Project's Lifecycle</ulink>" section | ||
1094 | in the Yocto Project Development Manual. | ||
1095 | </para> | ||
1096 | |||
1097 | <section id="usingpoky-configuring-LIC_FILES_CHKSUM"> | ||
1098 | <title>Tracking License Changes</title> | ||
1099 | |||
1100 | <para> | ||
1101 | The license of an upstream project might change in the future. | ||
1102 | In order to prevent these changes going unnoticed, the | ||
1103 | <filename><link linkend='var-LIC_FILES_CHKSUM'>LIC_FILES_CHKSUM</link></filename> | ||
1104 | variable tracks changes to the license text. The checksums are validated at the end of the | ||
1105 | configure step, and if the checksums do not match, the build will fail. | ||
1106 | </para> | ||
1107 | |||
1108 | <section id="usingpoky-specifying-LIC_FILES_CHKSUM"> | ||
1109 | <title>Specifying the <filename>LIC_FILES_CHKSUM</filename> Variable</title> | ||
1110 | |||
1111 | <para> | ||
1112 | The <filename>LIC_FILES_CHKSUM</filename> | ||
1113 | variable contains checksums of the license text in the source code for the recipe. | ||
1114 | Following is an example of how to specify <filename>LIC_FILES_CHKSUM</filename>: | ||
1115 | <literallayout class='monospaced'> | ||
1116 | LIC_FILES_CHKSUM = "file://COPYING;md5=xxxx \ | ||
1117 | file://licfile1.txt;beginline=5;endline=29;md5=yyyy \ | ||
1118 | file://licfile2.txt;endline=50;md5=zzzz \ | ||
1119 | ..." | ||
1120 | </literallayout> | ||
1121 | </para> | ||
1122 | |||
1123 | <para> | ||
1124 | The build system uses the | ||
1125 | <filename><link linkend='var-S'>S</link></filename> variable as | ||
1126 | the default directory when searching files listed in | ||
1127 | <filename>LIC_FILES_CHKSUM</filename>. | ||
1128 | The previous example employs the default directory. | ||
1129 | </para> | ||
1130 | |||
1131 | <para> | ||
1132 | Consider this next example: | ||
1133 | <literallayout class='monospaced'> | ||
1134 | LIC_FILES_CHKSUM = "file://src/ls.c;beginline=5;endline=16;\ | ||
1135 | md5=bb14ed3c4cda583abc85401304b5cd4e" | ||
1136 | LIC_FILES_CHKSUM = "file://${WORKDIR}/license.html;md5=5c94767cedb5d6987c902ac850ded2c6" | ||
1137 | </literallayout> | ||
1138 | </para> | ||
1139 | |||
1140 | <para> | ||
1141 | The first line locates a file in | ||
1142 | <filename>${S}/src/ls.c</filename>. | ||
1143 | The second line refers to a file in | ||
1144 | <filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>. | ||
1145 | </para> | ||
1146 | <para> | ||
1147 | Note that <filename>LIC_FILES_CHKSUM</filename> variable is | ||
1148 | mandatory for all recipes, unless the | ||
1149 | <filename>LICENSE</filename> variable is set to "CLOSED". | ||
1150 | </para> | ||
1151 | </section> | ||
1152 | |||
1153 | <section id="usingpoky-LIC_FILES_CHKSUM-explanation-of-syntax"> | ||
1154 | <title>Explanation of Syntax</title> | ||
1155 | <para> | ||
1156 | As mentioned in the previous section, the | ||
1157 | <filename>LIC_FILES_CHKSUM</filename> variable lists all the | ||
1158 | important files that contain the license text for the source code. | ||
1159 | It is possible to specify a checksum for an entire file, or a specific section of a | ||
1160 | file (specified by beginning and ending line numbers with the "beginline" and "endline" | ||
1161 | parameters, respectively). | ||
1162 | The latter is useful for source files with a license notice header, | ||
1163 | README documents, and so forth. | ||
1164 | If you do not use the "beginline" parameter, then it is assumed that the text begins on the | ||
1165 | first line of the file. | ||
1166 | Similarly, if you do not use the "endline" parameter, it is assumed that the license text | ||
1167 | ends with the last line of the file. | ||
1168 | </para> | ||
1169 | |||
1170 | <para> | ||
1171 | The "md5" parameter stores the md5 checksum of the license text. | ||
1172 | If the license text changes in any way as compared to this parameter | ||
1173 | then a mismatch occurs. | ||
1174 | This mismatch triggers a build failure and notifies the developer. | ||
1175 | Notification allows the developer to review and address the license text changes. | ||
1176 | Also note that if a mismatch occurs during the build, the correct md5 | ||
1177 | checksum is placed in the build log and can be easily copied to the recipe. | ||
1178 | </para> | ||
1179 | |||
1180 | <para> | ||
1181 | There is no limit to how many files you can specify using the | ||
1182 | <filename>LIC_FILES_CHKSUM</filename> variable. | ||
1183 | Generally, however, every project requires a few specifications for license tracking. | ||
1184 | Many projects have a "COPYING" file that stores the license information for all the source | ||
1185 | code files. | ||
1186 | This practice allows you to just track the "COPYING" file as long as it is kept up to date. | ||
1187 | </para> | ||
1188 | |||
1189 | <tip> | ||
1190 | If you specify an empty or invalid "md5" parameter, BitBake returns an md5 mis-match | ||
1191 | error and displays the correct "md5" parameter value during the build. | ||
1192 | The correct parameter is also captured in the build log. | ||
1193 | </tip> | ||
1194 | |||
1195 | <tip> | ||
1196 | If the whole file contains only license text, you do not need to use the "beginline" and | ||
1197 | "endline" parameters. | ||
1198 | </tip> | ||
1199 | </section> | ||
1200 | </section> | ||
1201 | |||
1202 | <section id="enabling-commercially-licensed-recipes"> | ||
1203 | <title>Enabling Commercially Licensed Recipes</title> | ||
1204 | |||
1205 | <para> | ||
1206 | By default, the OpenEmbedded build system disables | ||
1207 | components that have commercial or other special licensing | ||
1208 | requirements. | ||
1209 | Such requirements are defined on a | ||
1210 | recipe-by-recipe basis through the <filename>LICENSE_FLAGS</filename> variable | ||
1211 | definition in the affected recipe. | ||
1212 | For instance, the | ||
1213 | <filename>poky/meta/recipes-multimedia/gstreamer/gst-plugins-ugly</filename> | ||
1214 | recipe contains the following statement: | ||
1215 | <literallayout class='monospaced'> | ||
1216 | LICENSE_FLAGS = "commercial" | ||
1217 | </literallayout> | ||
1218 | Here is a slightly more complicated example that contains both an | ||
1219 | explicit recipe name and version (after variable expansion): | ||
1220 | <literallayout class='monospaced'> | ||
1221 | LICENSE_FLAGS = "license_${PN}_${PV}" | ||
1222 | </literallayout> | ||
1223 | In order for a component restricted by a <filename>LICENSE_FLAGS</filename> | ||
1224 | definition to be enabled and included in an image, it | ||
1225 | needs to have a matching entry in the global | ||
1226 | <filename>LICENSE_FLAGS_WHITELIST</filename> variable, which is a variable | ||
1227 | typically defined in your <filename>local.conf</filename> file. | ||
1228 | For example, to enable | ||
1229 | the <filename>poky/meta/recipes-multimedia/gstreamer/gst-plugins-ugly</filename> | ||
1230 | package, you could add either the string | ||
1231 | "commercial_gst-plugins-ugly" or the more general string | ||
1232 | "commercial" to <filename>LICENSE_FLAGS_WHITELIST</filename>. | ||
1233 | See the | ||
1234 | "<link linkend='license-flag-matching'>License Flag Matching</link>" section | ||
1235 | for a full explanation of how <filename>LICENSE_FLAGS</filename> matching works. | ||
1236 | Here is the example: | ||
1237 | <literallayout class='monospaced'> | ||
1238 | LICENSE_FLAGS_WHITELIST = "commercial_gst-plugins-ugly" | ||
1239 | </literallayout> | ||
1240 | Likewise, to additionally enable the package built from the recipe containing | ||
1241 | <filename>LICENSE_FLAGS = "license_${PN}_${PV}"</filename>, and assuming | ||
1242 | that the actual recipe name was <filename>emgd_1.10.bb</filename>, | ||
1243 | the following string would enable that package as well as | ||
1244 | the original <filename>gst-plugins-ugly</filename> package: | ||
1245 | <literallayout class='monospaced'> | ||
1246 | LICENSE_FLAGS_WHITELIST = "commercial_gst-plugins-ugly license_emgd_1.10" | ||
1247 | </literallayout> | ||
1248 | As a convenience, you do not need to specify the complete license string | ||
1249 | in the whitelist for every package. | ||
1250 | You can use an abbreviated form, which consists | ||
1251 | of just the first portion or portions of the license string before | ||
1252 | the initial underscore character or characters. | ||
1253 | A partial string will match | ||
1254 | any license that contains the given string as the first | ||
1255 | portion of its license. | ||
1256 | For example, the following | ||
1257 | whitelist string will also match both of the packages | ||
1258 | previously mentioned as well as any other packages that have | ||
1259 | licenses starting with "commercial" or "license". | ||
1260 | <literallayout class='monospaced'> | ||
1261 | LICENSE_FLAGS_WHITELIST = "commercial license" | ||
1262 | </literallayout> | ||
1263 | </para> | ||
1264 | |||
1265 | <section id="license-flag-matching"> | ||
1266 | <title>License Flag Matching</title> | ||
1267 | |||
1268 | <para> | ||
1269 | License flag matching allows you to control what recipes the | ||
1270 | OpenEmbedded build system includes in the build. | ||
1271 | Fundamentally, the build system attempts to match | ||
1272 | <filename>LICENSE_FLAGS</filename> strings found in | ||
1273 | recipes against <filename>LICENSE_FLAGS_WHITELIST</filename> | ||
1274 | strings found in the whitelist. | ||
1275 | A match causes the build system to include a recipe in the | ||
1276 | build, while failure to find a match causes the build system to | ||
1277 | exclude a recipe. | ||
1278 | </para> | ||
1279 | |||
1280 | <para> | ||
1281 | In general, license flag matching is simple. | ||
1282 | However, understanding some concepts will help you | ||
1283 | correctly and effectively use matching. | ||
1284 | </para> | ||
1285 | |||
1286 | <para> | ||
1287 | Before a flag | ||
1288 | defined by a particular recipe is tested against the | ||
1289 | contents of the whitelist, the expanded string | ||
1290 | <filename>_${PN}</filename> is appended to the flag. | ||
1291 | This expansion makes each <filename>LICENSE_FLAGS</filename> | ||
1292 | value recipe-specific. | ||
1293 | After expansion, the string is then matched against the | ||
1294 | whitelist. | ||
1295 | Thus, specifying | ||
1296 | <filename>LICENSE_FLAGS = "commercial"</filename> | ||
1297 | in recipe "foo", for example, results in the string | ||
1298 | <filename>"commercial_foo"</filename>. | ||
1299 | And, to create a match, that string must appear in the | ||
1300 | whitelist. | ||
1301 | </para> | ||
1302 | |||
1303 | <para> | ||
1304 | Judicious use of the <filename>LICENSE_FLAGS</filename> | ||
1305 | strings and the contents of the | ||
1306 | <filename>LICENSE_FLAGS_WHITELIST</filename> variable | ||
1307 | allows you a lot of flexibility for including or excluding | ||
1308 | recipes based on licensing. | ||
1309 | For example, you can broaden the matching capabilities by | ||
1310 | using license flags string subsets in the whitelist. | ||
1311 | <note>When using a string subset, be sure to use the part of | ||
1312 | the expanded string that precedes the appended underscore | ||
1313 | character (e.g. <filename>usethispart_1.3</filename>, | ||
1314 | <filename>usethispart_1.4</filename>, and so forth). | ||
1315 | </note> | ||
1316 | For example, simply specifying the string "commercial" in | ||
1317 | the whitelist matches any expanded | ||
1318 | <filename>LICENSE_FLAGS</filename> definition that starts with | ||
1319 | the string "commercial" such as "commercial_foo" and | ||
1320 | "commercial_bar", which are the strings the build system | ||
1321 | automatically generates for hypothetical recipes named | ||
1322 | "foo" and "bar" assuming those recipes simply specify the | ||
1323 | following: | ||
1324 | <literallayout class='monospaced'> | ||
1325 | LICENSE_FLAGS = "commercial" | ||
1326 | </literallayout> | ||
1327 | Thus, you can choose to exhaustively | ||
1328 | enumerate each license flag in the whitelist and | ||
1329 | allow only specific recipes into the image, or | ||
1330 | you can use a string subset that causes a broader range of | ||
1331 | matches to allow a range of recipes into the image. | ||
1332 | </para> | ||
1333 | |||
1334 | <para> | ||
1335 | This scheme works even if the | ||
1336 | <filename>LICENSE_FLAGS</filename> string already | ||
1337 | has <filename>_${PN}</filename> appended. | ||
1338 | For example, the build system turns the license flag | ||
1339 | "commercial_1.2_foo" into "commercial_1.2_foo_foo" and would | ||
1340 | match both the general "commercial" and the specific | ||
1341 | "commercial_1.2_foo" strings found in the whitelist, as | ||
1342 | expected. | ||
1343 | </para> | ||
1344 | |||
1345 | <para> | ||
1346 | Here are some other scenarios: | ||
1347 | <itemizedlist> | ||
1348 | <listitem><para>You can specify a versioned string in the | ||
1349 | recipe such as "commercial_foo_1.2" in a "foo" recipe. | ||
1350 | The build system expands this string to | ||
1351 | "commercial_foo_1.2_foo". | ||
1352 | Combine this license flag with a whitelist that has | ||
1353 | the string "commercial" and you match the flag along | ||
1354 | with any other flag that starts with the string | ||
1355 | "commercial".</para></listitem> | ||
1356 | <listitem><para>Under the same circumstances, you can | ||
1357 | use "commercial_foo" in the whitelist and the | ||
1358 | build system not only matches "commercial_foo_1.2" but | ||
1359 | also matches any license flag with the string | ||
1360 | "commercial_foo", regardless of the version. | ||
1361 | </para></listitem> | ||
1362 | <listitem><para>You can be very specific and use both the | ||
1363 | package and version parts in the whitelist (e.g. | ||
1364 | "commercial_foo_1.2") to specifically match a | ||
1365 | versioned recipe.</para></listitem> | ||
1366 | </itemizedlist> | ||
1367 | </para> | ||
1368 | </section> | ||
1369 | |||
1370 | <section id="other-variables-related-to-commercial-licenses"> | ||
1371 | <title>Other Variables Related to Commercial Licenses</title> | ||
1372 | |||
1373 | <para> | ||
1374 | Other helpful variables related to commercial | ||
1375 | license handling exist and are defined in the | ||
1376 | <filename>poky/meta/conf/distro/include/default-distrovars.inc</filename> file: | ||
1377 | <literallayout class='monospaced'> | ||
1378 | COMMERCIAL_AUDIO_PLUGINS ?= "" | ||
1379 | COMMERCIAL_VIDEO_PLUGINS ?= "" | ||
1380 | COMMERCIAL_QT = "" | ||
1381 | </literallayout> | ||
1382 | If you want to enable these components, you can do so by making sure you have | ||
1383 | statements similar to the following | ||
1384 | in your <filename>local.conf</filename> configuration file: | ||
1385 | <literallayout class='monospaced'> | ||
1386 | COMMERCIAL_AUDIO_PLUGINS = "gst-plugins-ugly-mad \ | ||
1387 | gst-plugins-ugly-mpegaudioparse" | ||
1388 | COMMERCIAL_VIDEO_PLUGINS = "gst-plugins-ugly-mpeg2dec \ | ||
1389 | gst-plugins-ugly-mpegstream gst-plugins-bad-mpegvideoparse" | ||
1390 | COMMERCIAL_QT ?= "qmmp" | ||
1391 | LICENSE_FLAGS_WHITELIST = "commercial_gst-plugins-ugly commercial_gst-plugins-bad commercial_qmmp" | ||
1392 | </literallayout> | ||
1393 | Of course, you could also create a matching whitelist | ||
1394 | for those components using the more general "commercial" | ||
1395 | in the whitelist, but that would also enable all the | ||
1396 | other packages with <filename>LICENSE_FLAGS</filename> containing | ||
1397 | "commercial", which you may or may not want: | ||
1398 | <literallayout class='monospaced'> | ||
1399 | LICENSE_FLAGS_WHITELIST = "commercial" | ||
1400 | </literallayout> | ||
1401 | </para> | ||
1402 | |||
1403 | <para> | ||
1404 | Specifying audio and video plug-ins as part of the | ||
1405 | <filename>COMMERCIAL_AUDIO_PLUGINS</filename> and | ||
1406 | <filename>COMMERCIAL_VIDEO_PLUGINS</filename> statements | ||
1407 | or commercial Qt components as part of | ||
1408 | the <filename>COMMERCIAL_QT</filename> statement (along | ||
1409 | with the enabling <filename>LICENSE_FLAGS_WHITELIST</filename>) includes the | ||
1410 | plug-ins or components into built images, thus adding | ||
1411 | support for media formats or components. | ||
1412 | </para> | ||
1413 | </section> | ||
1414 | </section> | ||
1415 | </section> | ||
1416 | </chapter> | ||
1417 | <!-- | ||
1418 | vim: expandtab tw=80 ts=4 | ||
1419 | --> | ||
diff --git a/documentation/ref-manual/usingpoky.xml b/documentation/ref-manual/usingpoky.xml new file mode 100644 index 0000000..3c82d81 --- /dev/null +++ b/documentation/ref-manual/usingpoky.xml | |||
@@ -0,0 +1,891 @@ | |||
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 | |||
5 | <chapter id='usingpoky'> | ||
6 | <title>Using the Yocto Project</title> | ||
7 | |||
8 | <para> | ||
9 | This chapter describes common usage for the Yocto Project. | ||
10 | The information is introductory in nature as other manuals in the Yocto Project | ||
11 | documentation set provide more details on how to use the Yocto Project. | ||
12 | </para> | ||
13 | |||
14 | <section id='usingpoky-build'> | ||
15 | <title>Running a Build</title> | ||
16 | |||
17 | <para> | ||
18 | This section provides a summary of the build process and provides information | ||
19 | for less obvious aspects of the build process. | ||
20 | For general information on how to build an image using the OpenEmbedded build | ||
21 | system, see the | ||
22 | "<ulink url='&YOCTO_DOCS_QS_URL;#building-image'>Building an Image</ulink>" | ||
23 | section of the Yocto Project Quick Start. | ||
24 | </para> | ||
25 | |||
26 | <section id='build-overview'> | ||
27 | <title>Build Overview</title> | ||
28 | |||
29 | <para> | ||
30 | The first thing you need to do is set up the OpenEmbedded build | ||
31 | environment by sourcing an environment setup script | ||
32 | (i.e. | ||
33 | <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link> | ||
34 | or | ||
35 | <link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>). | ||
36 | Here is an example: | ||
37 | <literallayout class='monospaced'> | ||
38 | $ source &OE_INIT_FILE; [<build_dir>] | ||
39 | </literallayout> | ||
40 | </para> | ||
41 | |||
42 | <para> | ||
43 | The <filename>build_dir</filename> argument is optional and specifies the directory the | ||
44 | OpenEmbedded build system uses for the build - | ||
45 | the <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>. | ||
46 | If you do not specify a Build Directory, it defaults to a directory | ||
47 | named <filename>build</filename> in your current working directory. | ||
48 | A common practice is to use a different Build Directory for different targets. | ||
49 | For example, <filename>~/build/x86</filename> for a <filename>qemux86</filename> | ||
50 | target, and <filename>~/build/arm</filename> for a <filename>qemuarm</filename> target. | ||
51 | </para> | ||
52 | |||
53 | <para> | ||
54 | Once the build environment is set up, you can build a target using: | ||
55 | <literallayout class='monospaced'> | ||
56 | $ bitbake <target> | ||
57 | </literallayout> | ||
58 | </para> | ||
59 | |||
60 | <para> | ||
61 | The <filename>target</filename> is the name of the recipe you want to build. | ||
62 | Common targets are the images in <filename>meta/recipes-core/images</filename>, | ||
63 | <filename>meta/recipes-sato/images</filename>, etc. all found in the | ||
64 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
65 | Or, the target can be the name of a recipe for a specific piece of software such as | ||
66 | BusyBox. | ||
67 | For more details about the images the OpenEmbedded build system supports, see the | ||
68 | "<link linkend="ref-images">Images</link>" chapter. | ||
69 | </para> | ||
70 | |||
71 | <note> | ||
72 | Building an image without GNU General Public License Version 3 (GPLv3) components | ||
73 | is supported for only minimal and base images. | ||
74 | See the "<link linkend='ref-images'>Images</link>" chapter for more information. | ||
75 | </note> | ||
76 | </section> | ||
77 | |||
78 | <section id='building-an-image-using-gpl-components'> | ||
79 | <title>Building an Image Using GPL Components</title> | ||
80 | |||
81 | <para> | ||
82 | When building an image using GPL components, you need to maintain your original | ||
83 | settings and not switch back and forth applying different versions of the GNU | ||
84 | General Public License. | ||
85 | If you rebuild using different versions of GPL, dependency errors might occur | ||
86 | due to some components not being rebuilt. | ||
87 | </para> | ||
88 | </section> | ||
89 | </section> | ||
90 | |||
91 | <section id='usingpoky-install'> | ||
92 | <title>Installing and Using the Result</title> | ||
93 | |||
94 | <para> | ||
95 | Once an image has been built, it often needs to be installed. | ||
96 | The images and kernels built by the OpenEmbedded build system are placed in the | ||
97 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> in | ||
98 | <filename class="directory">tmp/deploy/images</filename>. | ||
99 | For information on how to run pre-built images such as <filename>qemux86</filename> | ||
100 | and <filename>qemuarm</filename>, see the | ||
101 | "<ulink url='&YOCTO_DOCS_QS_URL;#using-pre-built'>Using Pre-Built Binaries and QEMU</ulink>" | ||
102 | section in the Yocto Project Quick Start. | ||
103 | For information about how to install these images, see the documentation for your | ||
104 | particular board or machine. | ||
105 | </para> | ||
106 | </section> | ||
107 | |||
108 | <section id='usingpoky-debugging'> | ||
109 | <title>Debugging Build Failures</title> | ||
110 | |||
111 | <para> | ||
112 | The exact method for debugging build failures depends on the nature of | ||
113 | the problem and on the system's area from which the bug originates. | ||
114 | Standard debugging practices such as comparison against the last | ||
115 | known working version with examination of the changes and the | ||
116 | re-application of steps to identify the one causing the problem are | ||
117 | valid for the Yocto Project just as they are for any other system. | ||
118 | Even though it is impossible to detail every possible potential failure, | ||
119 | this section provides some general tips to aid in debugging. | ||
120 | </para> | ||
121 | |||
122 | <para> | ||
123 | A useful feature for debugging is the error reporting tool. | ||
124 | Configuring the Yocto Project to use this tool causes the | ||
125 | OpenEmbedded build system to produce error reporting commands as | ||
126 | part of the console output. | ||
127 | You can enter the commands after the build completes | ||
128 | to log error information | ||
129 | into a common database, that can help you figure out what might be | ||
130 | going wrong. | ||
131 | For information on how to enable and use this feature, see the | ||
132 | "<ulink url='&YOCTO_DOCS_DEV_URL;#using-the-error-reporting-tool'>Using the Error Reporting Tool</ulink>" | ||
133 | section in the Yocto Project Development Manual. | ||
134 | </para> | ||
135 | |||
136 | <para> | ||
137 | For discussions on debugging, see the | ||
138 | "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-gdb-remotedebug'>Debugging With the GNU Project Debugger (GDB) Remotely</ulink>" | ||
139 | and | ||
140 | "<ulink url='&YOCTO_DOCS_DEV_URL;#adt-eclipse'>Working within Eclipse</ulink>" | ||
141 | sections in the Yocto Project Development Manual. | ||
142 | </para> | ||
143 | |||
144 | <note> | ||
145 | The remainder of this section presents many examples of the | ||
146 | <filename>bitbake</filename> command. | ||
147 | You can learn about BitBake by reading the | ||
148 | <ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual'>BitBake User Manual</ulink>. | ||
149 | </note> | ||
150 | |||
151 | |||
152 | <section id='usingpoky-debugging-taskfailures'> | ||
153 | <title>Task Failures</title> | ||
154 | |||
155 | <para>The log file for shell tasks is available in | ||
156 | <filename>${WORKDIR}/temp/log.do_taskname.pid</filename>. | ||
157 | For example, the <filename>compile</filename> task for the QEMU minimal image for the x86 | ||
158 | machine (<filename>qemux86</filename>) might be | ||
159 | <filename>tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_compile.20830</filename>. | ||
160 | To see what | ||
161 | <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink> | ||
162 | runs to generate that log, look at the corresponding | ||
163 | <filename>run.do_taskname.pid</filename> file located in the same directory. | ||
164 | </para> | ||
165 | |||
166 | <para> | ||
167 | Presently, the output from Python tasks is sent directly to the console. | ||
168 | </para> | ||
169 | </section> | ||
170 | |||
171 | <section id='usingpoky-debugging-taskrunning'> | ||
172 | <title>Running Specific Tasks</title> | ||
173 | |||
174 | <para> | ||
175 | Any given package consists of a set of tasks. | ||
176 | The standard BitBake behavior in most cases is: | ||
177 | <filename>do_fetch</filename>, | ||
178 | <filename>do_unpack</filename>, | ||
179 | <filename>do_patch</filename>, <filename>do_configure</filename>, | ||
180 | <filename>do_compile</filename>, <filename>do_install</filename>, | ||
181 | <filename>do_package</filename>, | ||
182 | <filename>do_package_write</filename>, and | ||
183 | <filename>do_build</filename>. | ||
184 | The default task is <filename>do_build</filename> and any tasks | ||
185 | on which it depends build first. | ||
186 | Some tasks, such as <filename>do_devshell</filename>, are not part | ||
187 | of the default build chain. | ||
188 | If you wish to run a task that is not part of the default build | ||
189 | chain, you can use the <filename>-c</filename> option in BitBake. | ||
190 | Here is an example: | ||
191 | <literallayout class='monospaced'> | ||
192 | $ bitbake matchbox-desktop -c devshell | ||
193 | </literallayout> | ||
194 | </para> | ||
195 | |||
196 | <para> | ||
197 | If you wish to rerun a task, use the <filename>-f</filename> force | ||
198 | option. | ||
199 | For example, the following sequence forces recompilation after | ||
200 | changing files in the work directory. | ||
201 | <literallayout class='monospaced'> | ||
202 | $ bitbake matchbox-desktop | ||
203 | . | ||
204 | . | ||
205 | [make some changes to the source code in the work directory] | ||
206 | . | ||
207 | . | ||
208 | $ bitbake matchbox-desktop -c compile -f | ||
209 | $ bitbake matchbox-desktop | ||
210 | </literallayout> | ||
211 | </para> | ||
212 | |||
213 | <para> | ||
214 | This sequence first builds and then recompiles | ||
215 | <filename>matchbox-desktop</filename>. | ||
216 | The last command reruns all tasks (basically the packaging tasks) | ||
217 | after the compile. | ||
218 | BitBake recognizes that the <filename>do_compile</filename> | ||
219 | task was rerun and therefore understands that the other tasks | ||
220 | also need to be run again. | ||
221 | </para> | ||
222 | |||
223 | <para> | ||
224 | You can view a list of tasks in a given package by running the | ||
225 | <filename>do_listtasks</filename> task as follows: | ||
226 | <literallayout class='monospaced'> | ||
227 | $ bitbake matchbox-desktop -c listtasks | ||
228 | </literallayout> | ||
229 | The results appear as output to the console and are also in the | ||
230 | file <filename>${WORKDIR}/temp/log.do_listtasks</filename>. | ||
231 | </para> | ||
232 | </section> | ||
233 | |||
234 | <section id='usingpoky-debugging-dependencies'> | ||
235 | <title>Dependency Graphs</title> | ||
236 | |||
237 | <para> | ||
238 | Sometimes it can be hard to see why BitBake wants to build | ||
239 | other packages before building a given package you have specified. | ||
240 | The <filename>bitbake -g <targetname></filename> command | ||
241 | creates the <filename>pn-buildlist</filename>, | ||
242 | <filename>pn-depends.dot</filename>, | ||
243 | <filename>package-depends.dot</filename>, and | ||
244 | <filename>task-depends.dot</filename> files in the current | ||
245 | directory. | ||
246 | These files show what will be built and the package and task | ||
247 | dependencies, which are useful for debugging problems. | ||
248 | You can use the | ||
249 | <filename>bitbake -g -u depexp <targetname></filename> | ||
250 | command to display the results in a more human-readable form. | ||
251 | </para> | ||
252 | </section> | ||
253 | |||
254 | <section id='usingpoky-debugging-bitbake'> | ||
255 | <title>General BitBake Problems</title> | ||
256 | |||
257 | <para> | ||
258 | You can see debug output from BitBake by using the <filename>-D</filename> option. | ||
259 | The debug output gives more information about what BitBake | ||
260 | is doing and the reason behind it. | ||
261 | Each <filename>-D</filename> option you use increases the logging level. | ||
262 | The most common usage is <filename>-DDD</filename>. | ||
263 | </para> | ||
264 | |||
265 | <para> | ||
266 | The output from <filename>bitbake -DDD -v targetname</filename> can reveal why | ||
267 | BitBake chose a certain version of a package or why BitBake | ||
268 | picked a certain provider. | ||
269 | This command could also help you in a situation where you think BitBake did something | ||
270 | unexpected. | ||
271 | </para> | ||
272 | </section> | ||
273 | |||
274 | <section id='development-host-system-issues'> | ||
275 | <title>Development Host System Issues</title> | ||
276 | |||
277 | <para> | ||
278 | Sometimes issues on the host development system can cause your | ||
279 | build to fail. | ||
280 | Following are known, host-specific problems. | ||
281 | Be sure to always consult the | ||
282 | <ulink url='&YOCTO_RELEASE_NOTES;'>Release Notes</ulink> | ||
283 | for a look at all release-related issues. | ||
284 | <itemizedlist> | ||
285 | <listitem><para><emphasis><filename>eglibc-initial</filename> fails to build</emphasis>: | ||
286 | If your development host system has the unpatched | ||
287 | <filename>GNU Make 3.82</filename>, | ||
288 | the | ||
289 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
290 | task fails for <filename>eglibc-initial</filename> during | ||
291 | the build.</para> | ||
292 | <para>Typically, every distribution that ships | ||
293 | <filename>GNU Make 3.82</filename> as | ||
294 | the default already has the patched version. | ||
295 | However, some distributions, such as Debian, have | ||
296 | <filename>GNU Make 3.82</filename> as an option, which | ||
297 | is unpatched. | ||
298 | You will see this error on these types of distributions. | ||
299 | Switch to <filename>GNU Make 3.81</filename> or patch | ||
300 | your <filename>make</filename> to solve the problem. | ||
301 | </para></listitem> | ||
302 | </itemizedlist> | ||
303 | </para> | ||
304 | </section> | ||
305 | |||
306 | <section id='usingpoky-debugging-buildfile'> | ||
307 | <title>Building with No Dependencies</title> | ||
308 | <para> | ||
309 | To build a specific recipe (<filename>.bb</filename> file), | ||
310 | you can use the following command form: | ||
311 | <literallayout class='monospaced'> | ||
312 | $ bitbake -b <somepath/somerecipe.bb> | ||
313 | </literallayout> | ||
314 | This command form does not check for dependencies. | ||
315 | Consequently, you should use it | ||
316 | only when you know existing dependencies have been met. | ||
317 | <note> | ||
318 | You can also specify fragments of the filename. | ||
319 | In this case, BitBake checks for a unique match. | ||
320 | </note> | ||
321 | </para> | ||
322 | </section> | ||
323 | |||
324 | <section id='usingpoky-debugging-variables'> | ||
325 | <title>Variables</title> | ||
326 | <para> | ||
327 | You can use the <filename>-e</filename> BitBake option to | ||
328 | display the parsing environment for a configuration. | ||
329 | The following displays the general parsing environment: | ||
330 | <literallayout class='monospaced'> | ||
331 | $ bitbake -e | ||
332 | </literallayout> | ||
333 | This next example shows the parsing environment for a specific | ||
334 | recipe: | ||
335 | <literallayout class='monospaced'> | ||
336 | $ bitbake -e <recipename> | ||
337 | </literallayout> | ||
338 | </para> | ||
339 | </section> | ||
340 | |||
341 | <section id='recipe-logging-mechanisms'> | ||
342 | <title>Recipe Logging Mechanisms</title> | ||
343 | <para> | ||
344 | Best practices exist while writing recipes that both log build progress and | ||
345 | act on build conditions such as warnings and errors. | ||
346 | Both Python and Bash language bindings exist for the logging mechanism: | ||
347 | <itemizedlist> | ||
348 | <listitem><para><emphasis>Python:</emphasis> For Python functions, BitBake | ||
349 | supports several loglevels: <filename>bb.fatal</filename>, | ||
350 | <filename>bb.error</filename>, <filename>bb.warn</filename>, | ||
351 | <filename>bb.note</filename>, <filename>bb.plain</filename>, | ||
352 | and <filename>bb.debug</filename>.</para></listitem> | ||
353 | <listitem><para><emphasis>Bash:</emphasis> For Bash functions, the same set | ||
354 | of loglevels exist and are accessed with a similar syntax: | ||
355 | <filename>bbfatal</filename>, <filename>bberror</filename>, | ||
356 | <filename>bbwarn</filename>, <filename>bbnote</filename>, | ||
357 | <filename>bbplain</filename>, and <filename>bbdebug</filename>.</para></listitem> | ||
358 | </itemizedlist> | ||
359 | </para> | ||
360 | |||
361 | <para> | ||
362 | For guidance on how logging is handled in both Python and Bash recipes, see the | ||
363 | <filename>logging.bbclass</filename> file in the | ||
364 | <filename>meta/classes</filename> folder of the | ||
365 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
366 | </para> | ||
367 | |||
368 | <section id='logging-with-python'> | ||
369 | <title>Logging With Python</title> | ||
370 | <para> | ||
371 | When creating recipes using Python and inserting code that handles build logs, | ||
372 | keep in mind the goal is to have informative logs while keeping the console as | ||
373 | "silent" as possible. | ||
374 | Also, if you want status messages in the log, use the "debug" loglevel. | ||
375 | </para> | ||
376 | |||
377 | <para> | ||
378 | Following is an example written in Python. | ||
379 | The code handles logging for a function that determines the | ||
380 | number of tasks needed to be run. | ||
381 | See the | ||
382 | "<link linkend='ref-tasks-listtasks'><filename>do_listtasks</filename></link>" | ||
383 | section for additional information: | ||
384 | <literallayout class='monospaced'> | ||
385 | python do_listtasks() { | ||
386 | bb.debug(2, "Starting to figure out the task list") | ||
387 | if noteworthy_condition: | ||
388 | bb.note("There are 47 tasks to run") | ||
389 | bb.debug(2, "Got to point xyz") | ||
390 | if warning_trigger: | ||
391 | bb.warn("Detected warning_trigger, this might be a problem later.") | ||
392 | if recoverable_error: | ||
393 | bb.error("Hit recoverable_error, you really need to fix this!") | ||
394 | if fatal_error: | ||
395 | bb.fatal("fatal_error detected, unable to print the task list") | ||
396 | bb.plain("The tasks present are abc") | ||
397 | bb.debug(2, "Finished figuring out the tasklist") | ||
398 | } | ||
399 | </literallayout> | ||
400 | </para> | ||
401 | </section> | ||
402 | |||
403 | <section id='logging-with-bash'> | ||
404 | <title>Logging With Bash</title> | ||
405 | <para> | ||
406 | When creating recipes using Bash and inserting code that handles build | ||
407 | logs, you have the same goals - informative with minimal console output. | ||
408 | The syntax you use for recipes written in Bash is similar to that of | ||
409 | recipes written in Python described in the previous section. | ||
410 | </para> | ||
411 | |||
412 | <para> | ||
413 | Following is an example written in Bash. | ||
414 | The code logs the progress of the <filename>do_my_function</filename> function. | ||
415 | <literallayout class='monospaced'> | ||
416 | do_my_function() { | ||
417 | bbdebug 2 "Running do_my_function" | ||
418 | if [ exceptional_condition ]; then | ||
419 | bbnote "Hit exceptional_condition" | ||
420 | fi | ||
421 | bbdebug 2 "Got to point xyz" | ||
422 | if [ warning_trigger ]; then | ||
423 | bbwarn "Detected warning_trigger, this might cause a problem later." | ||
424 | fi | ||
425 | if [ recoverable_error ]; then | ||
426 | bberror "Hit recoverable_error, correcting" | ||
427 | fi | ||
428 | if [ fatal_error ]; then | ||
429 | bbfatal "fatal_error detected" | ||
430 | fi | ||
431 | bbdebug 2 "Completed do_my_function" | ||
432 | } | ||
433 | </literallayout> | ||
434 | </para> | ||
435 | </section> | ||
436 | </section> | ||
437 | |||
438 | <section id='usingpoky-debugging-others'> | ||
439 | <title>Other Tips</title> | ||
440 | |||
441 | <para> | ||
442 | Here are some other tips that you might find useful: | ||
443 | <itemizedlist> | ||
444 | <listitem><para>When adding new packages, it is worth watching for | ||
445 | undesirable items making their way into compiler command lines. | ||
446 | For example, you do not want references to local system files like | ||
447 | <filename>/usr/lib/</filename> or <filename>/usr/include/</filename>. | ||
448 | </para></listitem> | ||
449 | <listitem><para>If you want to remove the <filename>psplash</filename> | ||
450 | boot splashscreen, | ||
451 | add <filename>psplash=false</filename> to the kernel command line. | ||
452 | Doing so prevents <filename>psplash</filename> from loading | ||
453 | and thus allows you to see the console. | ||
454 | It is also possible to switch out of the splashscreen by | ||
455 | switching the virtual console (e.g. Fn+Left or Fn+Right on a Zaurus). | ||
456 | </para></listitem> | ||
457 | </itemizedlist> | ||
458 | </para> | ||
459 | </section> | ||
460 | </section> | ||
461 | |||
462 | <section id='maintaining-build-output-quality'> | ||
463 | <title>Maintaining Build Output Quality</title> | ||
464 | |||
465 | <para> | ||
466 | Many factors can influence the quality of a build. | ||
467 | For example, if you upgrade a recipe to use a new version of an upstream software | ||
468 | package or you experiment with some new configuration options, subtle changes | ||
469 | can occur that you might not detect until later. | ||
470 | Consider the case where your recipe is using a newer version of an upstream package. | ||
471 | In this case, a new version of a piece of software might introduce an optional | ||
472 | dependency on another library, which is auto-detected. | ||
473 | If that library has already been built when the software is building, | ||
474 | the software will link to the built library and that library will be pulled | ||
475 | into your image along with the new software even if you did not want the | ||
476 | library. | ||
477 | </para> | ||
478 | |||
479 | <para> | ||
480 | The | ||
481 | <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link> | ||
482 | class exists to help you maintain | ||
483 | the quality of your build output. | ||
484 | You can use the class to highlight unexpected and possibly unwanted | ||
485 | changes in the build output. | ||
486 | When you enable build history, it records information about the contents of | ||
487 | each package and image and then commits that information to a local Git | ||
488 | repository where you can examine the information. | ||
489 | </para> | ||
490 | |||
491 | <para> | ||
492 | The remainder of this section describes the following: | ||
493 | <itemizedlist> | ||
494 | <listitem><para>How you can enable and disable | ||
495 | build history</para></listitem> | ||
496 | <listitem><para>How to understand what the build history contains | ||
497 | </para></listitem> | ||
498 | <listitem><para>How to limit the information used for build history | ||
499 | </para></listitem> | ||
500 | <listitem><para>How to examine the build history from both a | ||
501 | command-line and web interface</para></listitem> | ||
502 | </itemizedlist> | ||
503 | </para> | ||
504 | |||
505 | <section id='enabling-and-disabling-build-history'> | ||
506 | <title>Enabling and Disabling Build History</title> | ||
507 | |||
508 | <para> | ||
509 | Build history is disabled by default. | ||
510 | To enable it, add the following <filename>INHERIT</filename> | ||
511 | statement and set the | ||
512 | <link linkend='var-BUILDHISTORY_COMMIT'><filename>BUILDHISTORY_COMMIT</filename></link> | ||
513 | variable to "1" at the end of your | ||
514 | <filename>conf/local.conf</filename> file found in the | ||
515 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>: | ||
516 | <literallayout class='monospaced'> | ||
517 | INHERIT += "buildhistory" | ||
518 | BUILDHISTORY_COMMIT = "1" | ||
519 | </literallayout> | ||
520 | Enabling build history as previously described | ||
521 | causes the build process to collect build | ||
522 | output information and commit it to a local | ||
523 | <ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink> repository. | ||
524 | <note> | ||
525 | Enabling build history increases your build times slightly, | ||
526 | particularly for images, and increases the amount of disk | ||
527 | space used during the build. | ||
528 | </note> | ||
529 | </para> | ||
530 | |||
531 | <para> | ||
532 | You can disable build history by removing the previous statements | ||
533 | from your <filename>conf/local.conf</filename> file. | ||
534 | </para> | ||
535 | </section> | ||
536 | |||
537 | <section id='understanding-what-the-build-history-contains'> | ||
538 | <title>Understanding What the Build History Contains</title> | ||
539 | |||
540 | <para> | ||
541 | Build history information is kept in | ||
542 | <filename>$</filename><link linkend='var-TOPDIR'><filename>TOPDIR</filename></link><filename>/buildhistory</filename> | ||
543 | in the Build Directory as defined by the | ||
544 | <link linkend='var-BUILDHISTORY_DIR'><filename>BUILDHISTORY_DIR</filename></link> | ||
545 | variable. | ||
546 | The following is an example abbreviated listing: | ||
547 | <imagedata fileref="figures/buildhistory.png" align="center" width="6in" depth="4in" /> | ||
548 | </para> | ||
549 | |||
550 | <para> | ||
551 | At the top level, there is a <filename>metadata-revs</filename> file | ||
552 | that lists the revisions of the repositories for the layers enabled | ||
553 | when the build was produced. | ||
554 | The rest of the data splits into separate | ||
555 | <filename>packages</filename>, <filename>images</filename> and | ||
556 | <filename>sdk</filename> directories, the contents of which are | ||
557 | described below. | ||
558 | </para> | ||
559 | |||
560 | <section id='build-history-package-information'> | ||
561 | <title>Build History Package Information</title> | ||
562 | |||
563 | <para> | ||
564 | The history for each package contains a text file that has | ||
565 | name-value pairs with information about the package. | ||
566 | For example, <filename>buildhistory/packages/core2-poky-linux/busybox/busybox/latest</filename> | ||
567 | contains the following: | ||
568 | <literallayout class='monospaced'> | ||
569 | PV = 1.19.3 | ||
570 | PR = r3 | ||
571 | RDEPENDS = update-rc.d eglibc (>= 2.13) | ||
572 | RRECOMMENDS = busybox-syslog busybox-udhcpc | ||
573 | PKGSIZE = 564701 | ||
574 | FILES = /usr/bin/* /usr/sbin/* /usr/libexec/* /usr/lib/lib*.so.* \ | ||
575 | /etc /com /var /bin/* /sbin/* /lib/*.so.* /usr/share/busybox \ | ||
576 | /usr/lib/busybox/* /usr/share/pixmaps /usr/share/applications \ | ||
577 | /usr/share/idl /usr/share/omf /usr/share/sounds /usr/lib/bonobo/servers | ||
578 | FILELIST = /etc/busybox.links /etc/init.d/hwclock.sh /bin/busybox /bin/sh | ||
579 | </literallayout> | ||
580 | Most of these name-value pairs correspond to variables used | ||
581 | to produce the package. | ||
582 | The exceptions are <filename>FILELIST</filename>, which is the | ||
583 | actual list of files in the package, and | ||
584 | <filename>PKGSIZE</filename>, which is the total size of files | ||
585 | in the package in bytes. | ||
586 | </para> | ||
587 | |||
588 | <para> | ||
589 | There is also a file corresponding to the recipe from which the | ||
590 | package came (e.g. | ||
591 | <filename>buildhistory/packages/core2-poky-linux/busybox/latest</filename>): | ||
592 | <literallayout class='monospaced'> | ||
593 | PV = 1.19.3 | ||
594 | PR = r3 | ||
595 | DEPENDS = virtual/i586-poky-linux-gcc virtual/i586-poky-linux-compilerlibs \ | ||
596 | virtual/libc update-rc.d-native | ||
597 | PACKAGES = busybox-httpd busybox-udhcpd busybox-udhcpc busybox-syslog \ | ||
598 | busybox-mdev busybox-dbg busybox busybox-doc busybox-dev \ | ||
599 | busybox-staticdev busybox-locale | ||
600 | </literallayout> | ||
601 | </para> | ||
602 | |||
603 | <para> | ||
604 | Finally, for those recipes fetched from a version control | ||
605 | system (e.g., Git), a file exists that lists source revisions | ||
606 | that are specified in the recipe and lists the actual revisions | ||
607 | used during the build. | ||
608 | Listed and actual revisions might differ when | ||
609 | <link linkend='var-SRCREV'><filename>SRCREV</filename></link> | ||
610 | is set to | ||
611 | <filename>${<link linkend='var-AUTOREV'>AUTOREV</link>}</filename>. | ||
612 | Here is an example assuming | ||
613 | <filename>buildhistory/packages/emenlow-poky-linux/linux-yocto/latest_srcrev</filename>): | ||
614 | <literallayout class='monospaced'> | ||
615 | # SRCREV_machine = "b5c37fe6e24eec194bb29d22fdd55d73bcc709bf" | ||
616 | SRCREV_machine = "b5c37fe6e24eec194bb29d22fdd55d73bcc709bf" | ||
617 | # SRCREV_emgd = "caea08c988e0f41103bbe18eafca20348f95da02" | ||
618 | SRCREV_emgd = "caea08c988e0f41103bbe18eafca20348f95da02" | ||
619 | # SRCREV_meta = "c2ed0f16fdec628242a682897d5d86df4547cf24" | ||
620 | SRCREV_meta = "c2ed0f16fdec628242a682897d5d86df4547cf24" | ||
621 | </literallayout> | ||
622 | You can use the <filename>buildhistory-collect-srcrevs</filename> | ||
623 | command to collect the stored <filename>SRCREV</filename> values | ||
624 | from build history and report them in a format suitable for use in | ||
625 | global configuration (e.g., <filename>local.conf</filename> | ||
626 | or a distro include file) to override floating | ||
627 | <filename>AUTOREV</filename> values to a fixed set of revisions. | ||
628 | Here is some example output from this command: | ||
629 | <literallayout class='monospaced'> | ||
630 | # emenlow-poky-linux | ||
631 | SRCREV_machine_pn-linux-yocto = "b5c37fe6e24eec194bb29d22fdd55d73bcc709bf" | ||
632 | SRCREV_emgd_pn-linux-yocto = "caea08c988e0f41103bbe18eafca20348f95da02" | ||
633 | SRCREV_meta_pn-linux-yocto = "c2ed0f16fdec628242a682897d5d86df4547cf24" | ||
634 | # core2-poky-linux | ||
635 | SRCREV_pn-kmod = "62081c0f68905b22f375156d4532fd37fa5c8d33" | ||
636 | SRCREV_pn-blktrace = "d6918c8832793b4205ed3bfede78c2f915c23385" | ||
637 | SRCREV_pn-opkg = "649" | ||
638 | </literallayout> | ||
639 | <note> | ||
640 | Here are some notes on using the | ||
641 | <filename>buildhistory-collect-srcrevs</filename> command: | ||
642 | <itemizedlist> | ||
643 | <listitem><para>By default, only values where the | ||
644 | <filename>SRCREV</filename> was | ||
645 | not hardcoded (usually when <filename>AUTOREV</filename> | ||
646 | was used) are reported. | ||
647 | Use the <filename>-a</filename> option to see all | ||
648 | <filename>SRCREV</filename> values. | ||
649 | </para></listitem> | ||
650 | <listitem><para>The output statements might not have any effect | ||
651 | if overrides are applied elsewhere in the build system | ||
652 | configuration. | ||
653 | Use the <filename>-f</filename> option to add the | ||
654 | <filename>forcevariable</filename> override to each output line | ||
655 | if you need to work around this restriction. | ||
656 | </para></listitem> | ||
657 | <listitem><para>The script does apply special handling when | ||
658 | building for multiple machines. | ||
659 | However, the script does place a | ||
660 | comment before each set of values that specifies | ||
661 | which triplet to which they belong as shown above | ||
662 | (e.g., <filename>emenlow-poky-linux</filename>). | ||
663 | </para></listitem> | ||
664 | </itemizedlist> | ||
665 | </note> | ||
666 | </para> | ||
667 | </section> | ||
668 | |||
669 | <section id='build-history-image-information'> | ||
670 | <title>Build History Image Information</title> | ||
671 | |||
672 | <para> | ||
673 | The files produced for each image are as follows: | ||
674 | <itemizedlist> | ||
675 | <listitem><para><filename>image-files:</filename> | ||
676 | A directory containing selected files from the root | ||
677 | filesystem. | ||
678 | The files are defined by | ||
679 | <link linkend='var-BUILDHISTORY_IMAGE_FILES'><filename>BUILDHISTORY_IMAGE_FILES</filename></link>. | ||
680 | </para></listitem> | ||
681 | <listitem><para><filename>build-id:</filename> | ||
682 | Human-readable information about the build configuration | ||
683 | and metadata source revisions.</para></listitem> | ||
684 | <listitem><para><filename>*.dot:</filename> | ||
685 | Dependency graphs for the image that are | ||
686 | compatible with <filename>graphviz</filename>. | ||
687 | </para></listitem> | ||
688 | <listitem><para><filename>files-in-image.txt:</filename> | ||
689 | A list of files in the image with permissions, | ||
690 | owner, group, size, and symlink information. | ||
691 | </para></listitem> | ||
692 | <listitem><para><filename>image-info.txt:</filename> | ||
693 | A text file containing name-value pairs with information | ||
694 | about the image. | ||
695 | See the following listing example for more information. | ||
696 | </para></listitem> | ||
697 | <listitem><para><filename>installed-package-names.txt:</filename> | ||
698 | A list of installed packages by name only.</para></listitem> | ||
699 | <listitem><para><filename>installed-package-sizes.txt:</filename> | ||
700 | A list of installed packages ordered by size. | ||
701 | </para></listitem> | ||
702 | <listitem><para><filename>installed-packages.txt:</filename> | ||
703 | A list of installed packages with full package | ||
704 | filenames.</para></listitem> | ||
705 | </itemizedlist> | ||
706 | <note> | ||
707 | Installed package information is able to be gathered and | ||
708 | produced even if package management is disabled for the final | ||
709 | image. | ||
710 | </note> | ||
711 | </para> | ||
712 | |||
713 | <para> | ||
714 | Here is an example of <filename>image-info.txt</filename>: | ||
715 | <literallayout class='monospaced'> | ||
716 | DISTRO = poky | ||
717 | DISTRO_VERSION = 1.1+snapshot-20120207 | ||
718 | USER_CLASSES = image-mklibs image-prelink | ||
719 | IMAGE_CLASSES = image_types | ||
720 | IMAGE_FEATURES = debug-tweaks x11-base apps-x11-core \ | ||
721 | package-management ssh-server-dropbear package-management | ||
722 | IMAGE_LINGUAS = en-us en-gb | ||
723 | IMAGE_INSTALL = task-core-boot task-base-extended | ||
724 | BAD_RECOMMENDATIONS = | ||
725 | ROOTFS_POSTPROCESS_COMMAND = buildhistory_get_image_installed ; rootfs_update_timestamp ; | ||
726 | IMAGE_POSTPROCESS_COMMAND = buildhistory_get_imageinfo ; | ||
727 | IMAGESIZE = 171816 | ||
728 | </literallayout> | ||
729 | Other than <filename>IMAGESIZE</filename>, which is the | ||
730 | total size of the files in the image in Kbytes, the | ||
731 | name-value pairs are variables that may have influenced the | ||
732 | content of the image. | ||
733 | This information is often useful when you are trying to determine | ||
734 | why a change in the package or file listings has occurred. | ||
735 | </para> | ||
736 | </section> | ||
737 | |||
738 | <section id='using-build-history-to-gather-image-information-only'> | ||
739 | <title>Using Build History to Gather Image Information Only</title> | ||
740 | |||
741 | <para> | ||
742 | As you can see, build history produces image information, | ||
743 | including dependency graphs, so you can see why something | ||
744 | was pulled into the image. | ||
745 | If you are just interested in this information and not | ||
746 | interested in collecting specific package or SDK information, | ||
747 | you can enable writing only image information without | ||
748 | any history by adding the following to your | ||
749 | <filename>conf/local.conf</filename> file found in the | ||
750 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>: | ||
751 | <literallayout class='monospaced'> | ||
752 | INHERIT += "buildhistory" | ||
753 | BUILDHISTORY_COMMIT = "0" | ||
754 | BUILDHISTORY_FEATURES = "image" | ||
755 | </literallayout> | ||
756 | Here, you set the | ||
757 | <link linkend='var-BUILDHISTORY_FEATURES'><filename>BUILDHISTORY_FEATURES</filename></link> | ||
758 | variable to use the image feature only. | ||
759 | </para> | ||
760 | </section> | ||
761 | |||
762 | <section id='build-history-sdk-information'> | ||
763 | <title>Build History SDK Information</title> | ||
764 | <para> | ||
765 | Build history collects similar information on the contents | ||
766 | of SDKs (e.g. <filename>meta-toolchain</filename> | ||
767 | or <filename>bitbake -c populate_sdk imagename</filename>) | ||
768 | as compared to information it collects for images. | ||
769 | The following list shows the files produced for each SDK: | ||
770 | <itemizedlist> | ||
771 | <listitem><para><filename>files-in-sdk.txt:</filename> | ||
772 | A list of files in the SDK with permissions, | ||
773 | owner, group, size, and symlink information. | ||
774 | This list includes both the host and target parts | ||
775 | of the SDK. | ||
776 | </para></listitem> | ||
777 | <listitem><para><filename>sdk-info.txt:</filename> | ||
778 | A text file containing name-value pairs with information | ||
779 | about the SDK. | ||
780 | See the following listing example for more information. | ||
781 | </para></listitem> | ||
782 | <listitem><para>The following information appears under | ||
783 | each of the <filename>host</filename> | ||
784 | and <filename>target</filename> directories | ||
785 | for the portions of the SDK that run on the host and | ||
786 | on the target, respectively: | ||
787 | <itemizedlist> | ||
788 | <listitem><para><filename>depends.dot:</filename> | ||
789 | Dependency graph for the SDK that is | ||
790 | compatible with <filename>graphviz</filename>. | ||
791 | </para></listitem> | ||
792 | <listitem><para><filename>installed-package-names.txt:</filename> | ||
793 | A list of installed packages by name only. | ||
794 | </para></listitem> | ||
795 | <listitem><para><filename>installed-package-sizes.txt:</filename> | ||
796 | A list of installed packages ordered by size. | ||
797 | </para></listitem> | ||
798 | <listitem><para><filename>installed-packages.txt:</filename> | ||
799 | A list of installed packages with full package | ||
800 | filenames.</para></listitem> | ||
801 | </itemizedlist> | ||
802 | </para></listitem> | ||
803 | </itemizedlist> | ||
804 | </para> | ||
805 | |||
806 | <para> | ||
807 | Here is an example of <filename>sdk-info.txt</filename>: | ||
808 | <literallayout class='monospaced'> | ||
809 | DISTRO = poky | ||
810 | DISTRO_VERSION = 1.3+snapshot-20130327 | ||
811 | SDK_NAME = poky-eglibc-i686-arm | ||
812 | SDK_VERSION = 1.3+snapshot | ||
813 | SDKMACHINE = | ||
814 | SDKIMAGE_FEATURES = dev-pkgs dbg-pkgs | ||
815 | BAD_RECOMMENDATIONS = | ||
816 | SDKSIZE = 352712 | ||
817 | </literallayout> | ||
818 | Other than <filename>SDKSIZE</filename>, which is the | ||
819 | total size of the files in the SDK in Kbytes, the | ||
820 | name-value pairs are variables that might have influenced the | ||
821 | content of the SDK. | ||
822 | This information is often useful when you are trying to | ||
823 | determine why a change in the package or file listings | ||
824 | has occurred. | ||
825 | </para> | ||
826 | </section> | ||
827 | |||
828 | <section id='examining-build-history-information'> | ||
829 | <title>Examining Build History Information</title> | ||
830 | |||
831 | <para> | ||
832 | You can examine build history output from the command line or | ||
833 | from a web interface. | ||
834 | </para> | ||
835 | |||
836 | <para> | ||
837 | To see any changes that have occurred (assuming you have | ||
838 | <link linkend='var-BUILDHISTORY_COMMIT'><filename>BUILDHISTORY_COMMIT = "1"</filename></link>), | ||
839 | you can simply | ||
840 | use any Git command that allows you to view the history of | ||
841 | a repository. | ||
842 | Here is one method: | ||
843 | <literallayout class='monospaced'> | ||
844 | $ git log -p | ||
845 | </literallayout> | ||
846 | You need to realize, however, that this method does show | ||
847 | changes that are not significant (e.g. a package's size | ||
848 | changing by a few bytes). | ||
849 | </para> | ||
850 | |||
851 | <para> | ||
852 | A command-line tool called <filename>buildhistory-diff</filename> | ||
853 | does exist, though, that queries the Git repository and prints just | ||
854 | the differences that might be significant in human-readable form. | ||
855 | Here is an example: | ||
856 | <literallayout class='monospaced'> | ||
857 | $ ~/poky/poky/scripts/buildhistory-diff . HEAD^ | ||
858 | Changes to images/qemux86_64/eglibc/core-image-minimal (files-in-image.txt): | ||
859 | /etc/anotherpkg.conf was added | ||
860 | /sbin/anotherpkg was added | ||
861 | * (installed-package-names.txt): | ||
862 | * anotherpkg was added | ||
863 | Changes to images/qemux86_64/eglibc/core-image-minimal (installed-package-names.txt): | ||
864 | anotherpkg was added | ||
865 | packages/qemux86_64-poky-linux/v86d: PACKAGES: added "v86d-extras" | ||
866 | * PR changed from "r0" to "r1" | ||
867 | * PV changed from "0.1.10" to "0.1.12" | ||
868 | packages/qemux86_64-poky-linux/v86d/v86d: PKGSIZE changed from 110579 to 144381 (+30%) | ||
869 | * PR changed from "r0" to "r1" | ||
870 | * PV changed from "0.1.10" to "0.1.12" | ||
871 | </literallayout> | ||
872 | </para> | ||
873 | |||
874 | <para> | ||
875 | To see changes to the build history using a web interface, follow | ||
876 | the instruction in the <filename>README</filename> file here. | ||
877 | <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/buildhistory-web/'></ulink>. | ||
878 | </para> | ||
879 | |||
880 | <para> | ||
881 | Here is a sample screenshot of the interface: | ||
882 | <imagedata fileref="figures/buildhistory-web.png" align="center" scalefit="1" width="130%" contentdepth="130%" /> | ||
883 | </para> | ||
884 | </section> | ||
885 | </section> | ||
886 | </section> | ||
887 | |||
888 | </chapter> | ||
889 | <!-- | ||
890 | vim: expandtab tw=80 ts=4 | ||
891 | --> | ||
diff --git a/documentation/template/Vera.ttf b/documentation/template/Vera.ttf new file mode 100644 index 0000000..58cd6b5 --- /dev/null +++ b/documentation/template/Vera.ttf | |||
Binary files differ | |||
diff --git a/documentation/template/Vera.xml b/documentation/template/Vera.xml new file mode 100644 index 0000000..3c82043 --- /dev/null +++ b/documentation/template/Vera.xml | |||
@@ -0,0 +1 @@ | |||
<?xml version="1.0" encoding="UTF-8"?><font-metrics type="TYPE0"><font-name>BitstreamVeraSans</font-name><embed/><cap-height>729</cap-height><x-height>546</x-height><ascender>928</ascender><descender>-235</descender><bbox><left>-183</left><bottom>-235</bottom><right>1287</right><top>928</top></bbox><flags>32</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="3" ue="126" us="32"/><bf gi="172" ue="160" us="160"/><bf gi="163" ue="161" us="161"/><bf gi="132" ue="163" us="162"/><bf gi="189" ue="164" us="164"/><bf gi="150" ue="165" us="165"/><bf gi="231" ue="166" us="166"/><bf gi="134" ue="167" us="167"/><bf gi="142" ue="168" us="168"/><bf gi="139" ue="169" us="169"/><bf gi="157" ue="170" us="170"/><bf gi="169" ue="171" us="171"/><bf gi="164" ue="172" us="172"/><bf gi="256" ue="173" us="173"/><bf gi="138" ue="174" us="174"/><bf gi="217" ue="175" us="175"/><bf gi="131" ue="176" us="176"/><bf gi="147" ue="177" us="177"/><bf gi="241" ue="179" us="178"/><bf gi="141" ue="180" us="180"/><bf gi="151" ue="181" us="181"/><bf gi="136" ue="182" us="182"/><bf gi="195" ue="183" us="183"/><bf gi="221" ue="184" us="184"/><bf gi="240" ue="185" us="185"/><bf gi="158" ue="186" us="186"/><bf gi="170" ue="187" us="187"/><bf gi="243" ue="190" us="188"/><bf gi="162" ue="191" us="191"/><bf gi="173" ue="192" us="192"/><bf gi="201" ue="193" us="193"/><bf gi="199" ue="194" us="194"/><bf gi="174" ue="195" us="195"/><bf gi="98" ue="197" us="196"/><bf gi="144" ue="198" us="198"/><bf gi="100" ue="199" us="199"/><bf gi="203" ue="200" us="200"/><bf gi="101" ue="201" us="201"/><bf gi="200" ue="202" us="202"/><bf gi="202" ue="203" us="203"/><bf gi="207" ue="204" us="204"/><bf gi="204" ue="207" us="205"/><bf gi="232" ue="208" us="208"/><bf gi="102" ue="209" us="209"/><bf gi="210" ue="210" us="210"/><bf gi="208" ue="212" us="211"/><bf gi="175" ue="213" us="213"/><bf gi="103" ue="214" us="214"/><bf gi="239" ue="215" us="215"/><bf gi="145" ue="216" us="216"/><bf gi="213" ue="217" us="217"/><bf gi="211" ue="219" us="218"/><bf gi="104" ue="220" us="220"/><bf gi="234" ue="221" us="221"/><bf gi="236" ue="222" us="222"/><bf gi="137" ue="223" us="223"/><bf gi="106" ue="224" us="224"/><bf gi="105" ue="225" us="225"/><bf gi="107" ue="226" us="226"/><bf gi="109" ue="227" us="227"/><bf gi="108" ue="228" us="228"/><bf gi="110" ue="229" us="229"/><bf gi="160" ue="230" us="230"/><bf gi="111" ue="231" us="231"/><bf gi="113" ue="232" us="232"/><bf gi="112" ue="233" us="233"/><bf gi="114" ue="235" us="234"/><bf gi="117" ue="236" us="236"/><bf gi="116" ue="237" us="237"/><bf gi="118" ue="239" us="238"/><bf gi="233" ue="240" us="240"/><bf gi="120" ue="241" us="241"/><bf gi="122" ue="242" us="242"/><bf gi="121" ue="243" us="243"/><bf gi="123" ue="244" us="244"/><bf gi="125" ue="245" us="245"/><bf gi="124" ue="246" us="246"/><bf gi="184" ue="247" us="247"/><bf gi="161" ue="248" us="248"/><bf gi="127" ue="249" us="249"/><bf gi="126" ue="250" us="250"/><bf gi="128" ue="252" us="251"/><bf gi="235" ue="253" us="253"/><bf gi="237" ue="254" us="254"/><bf gi="186" ue="255" us="255"/><bf gi="251" ue="263" us="262"/><bf gi="253" ue="269" us="268"/><bf gi="0" ue="270" us="270"/><bf gi="0" ue="271" us="271"/><bf gi="0" ue="272" us="272"/><bf gi="255" ue="273" us="273"/><bf gi="246" ue="287" us="286"/><bf gi="248" ue="304" us="304"/><bf gi="214" ue="305" us="305"/><bf gi="225" ue="322" us="321"/><bf gi="176" ue="339" us="338"/><bf gi="249" ue="351" us="350"/><bf gi="227" ue="353" us="352"/><bf gi="187" ue="376" us="376"/><bf gi="229" ue="382" us="381"/><bf gi="166" ue="402" us="402"/><bf gi="215" ue="710" us="710"/><bf gi="224" ue="711" us="711"/><bf gi="218" ue="730" us="728"/><bf gi="223" ue="731" us="731"/><bf gi="216" ue="732" us="732"/><bf gi="222" ue="733" us="733"/><bf gi="159" ue="937" us="937"/><bf gi="155" ue="960" us="960"/><bf gi="178" ue="8212" us="8211"/><bf gi="0" ue="8213" us="8213"/><bf gi="0" ue="8214" us="8214"/><bf gi="0" ue="8215" us="8215"/><bf gi="182" ue="8217" us="8216"/><bf gi="196" ue="8218" us="8218"/><bf gi="0" ue="8219" us="8219"/><bf gi="180" ue="8221" us="8220"/><bf gi="197" ue="8222" us="8222"/><bf gi="0" ue="8223" us="8223"/><bf gi="130" ue="8224" us="8224"/><bf gi="194" ue="8225" us="8225"/><bf gi="135" ue="8226" us="8226"/><bf gi="0" ue="8227" us="8227"/><bf gi="0" ue="8228" us="8228"/><bf gi="0" ue="8229" us="8229"/><bf gi="171" ue="8230" us="8230"/><bf gi="198" ue="8240" us="8240"/><bf gi="190" ue="8250" us="8249"/><bf gi="258" ue="8364" us="8364"/><bf gi="140" ue="8482" us="8482"/><bf gi="152" ue="8706" us="8706"/><bf gi="0" ue="8707" us="8707"/><bf gi="0" ue="8708" us="8708"/><bf gi="0" ue="8709" us="8709"/><bf gi="168" ue="8710" us="8710"/><bf gi="154" ue="8719" us="8719"/><bf gi="0" ue="8720" us="8720"/><bf gi="153" ue="8721" us="8721"/><bf gi="238" ue="8722" us="8722"/><bf gi="0" ue="8723" us="8723"/><bf gi="0" ue="8724" us="8724"/><bf gi="188" ue="8725" us="8725"/><bf gi="0" ue="8726" us="8726"/><bf gi="0" ue="8727" us="8727"/><bf gi="0" ue="8728" us="8728"/><bf gi="257" ue="8729" us="8729"/><bf gi="165" ue="8730" us="8730"/><bf gi="0" ue="8731" us="8731"/><bf gi="0" ue="8732" us="8732"/><bf gi="0" ue="8733" us="8733"/><bf gi="146" ue="8734" us="8734"/><bf gi="156" ue="8747" us="8747"/><bf gi="167" ue="8776" us="8776"/><bf gi="143" ue="8800" us="8800"/><bf gi="0" ue="8801" us="8801"/><bf gi="0" ue="8802" us="8802"/><bf gi="0" ue="8803" us="8803"/><bf gi="148" ue="8805" us="8804"/><bf gi="185" ue="9674" us="9674"/><bf gi="192" ue="64258" us="64257"/><bf gi="0" ue="65535" us="65535"/></bfranges><cid-widths start-index="0"><wx w="600"/><wx w="0"/><wx w="317"/><wx w="317"/><wx w="400"/><wx w="459"/><wx w="837"/><wx w="636"/><wx w="950"/><wx w="779"/><wx w="274"/><wx w="390"/><wx w="390"/><wx w="500"/><wx w="837"/><wx w="317"/><wx w="360"/><wx w="317"/><wx w="336"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="336"/><wx w="336"/><wx w="837"/><wx w="837"/><wx w="837"/><wx w="530"/><wx w="1000"/><wx w="684"/><wx w="686"/><wx w="698"/><wx w="770"/><wx w="631"/><wx w="575"/><wx w="774"/><wx w="751"/><wx w="294"/><wx w="294"/><wx w="655"/><wx w="557"/><wx w="862"/><wx w="748"/><wx w="787"/><wx w="603"/><wx w="787"/><wx w="694"/><wx w="634"/><wx w="610"/><wx w="731"/><wx w="684"/><wx w="988"/><wx w="685"/><wx w="610"/><wx w="685"/><wx w="390"/><wx w="336"/><wx w="390"/><wx w="837"/><wx w="500"/><wx w="500"/><wx w="612"/><wx w="634"/><wx w="549"/><wx w="634"/><wx w="615"/><wx w="352"/><wx w="634"/><wx w="633"/><wx w="277"/><wx w="277"/><wx w="579"/><wx w="277"/><wx w="974"/><wx w="633"/><wx w="611"/><wx w="634"/><wx w="634"/><wx w="411"/><wx w="520"/><wx w="392"/><wx w="633"/><wx w="591"/><wx w="817"/><wx w="591"/><wx w="591"/><wx w="524"/><wx w="636"/><wx w="336"/><wx w="636"/><wx w="837"/><wx w="684"/><wx w="684"/><wx w="698"/><wx w="631"/><wx w="748"/><wx w="787"/><wx w="731"/><wx w="612"/><wx w="612"/><wx w="612"/><wx w="612"/><wx w="612"/><wx w="612"/><wx w="549"/><wx w="615"/><wx w="615"/><wx w="615"/><wx w="615"/><wx w="277"/><wx w="277"/><wx w="277"/><wx w="277"/><wx w="633"/><wx w="611"/><wx w="611"/><wx w="611"/><wx w="611"/><wx w="611"/><wx w="633"/><wx w="633"/><wx w="633"/><wx w="633"/><wx w="500"/><wx w="500"/><wx w="636"/><wx w="636"/><wx w="500"/><wx w="589"/><wx w="636"/><wx w="629"/><wx w="1000"/><wx w="1000"/><wx w="1000"/><wx w="500"/><wx w="500"/><wx w="837"/><wx w="974"/><wx w="787"/><wx w="833"/><wx w="837"/><wx w="837"/><wx w="837"/><wx w="636"/><wx w="636"/><wx w="517"/><wx w="673"/><wx w="756"/><wx w="588"/><wx w="520"/><wx w="471"/><wx w="471"/><wx w="764"/><wx w="981"/><wx w="611"/><wx w="530"/><wx w="400"/><wx w="837"/><wx w="637"/><wx w="636"/><wx w="837"/><wx w="668"/><wx w="611"/><wx w="611"/><wx w="1000"/><wx w="636"/><wx w="684"/><wx w="684"/><wx w="787"/><wx w="1069"/><wx w="1022"/><wx w="500"/><wx w="1000"/><wx w="518"/><wx w="518"/><wx w="317"/><wx w="317"/><wx w="837"/><wx w="494"/><wx w="591"/><wx w="610"/><wx w="166"/><wx w="636"/><wx w="399"/><wx w="399"/><wx w="629"/><wx w="629"/><wx w="500"/><wx w="317"/><wx w="317"/><wx w="518"/><wx w="1341"/><wx w="684"/><wx w="631"/><wx w="684"/><wx w="631"/><wx w="631"/><wx w="294"/><wx w="294"/><wx w="294"/><wx w="294"/><wx w="787"/><wx w="787"/><wx w="787"/><wx w="731"/><wx w="731"/><wx w="731"/><wx w="277"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="562"/><wx w="284"/><wx w="634"/><wx w="520"/><wx w="685"/><wx w="524"/><wx w="336"/><wx w="774"/><wx w="611"/><wx w="610"/><wx w="591"/><wx w="604"/><wx w="634"/><wx w="837"/><wx w="837"/><wx w="400"/><wx w="400"/><wx w="400"/><wx w="969"/><wx w="969"/><wx w="969"/><wx w="774"/><wx w="634"/><wx w="294"/><wx w="634"/><wx w="520"/><wx w="698"/><wx w="549"/><wx w="698"/><wx w="549"/><wx w="634"/><wx w="360"/><wx w="317"/><wx w="636"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="400"/><wx w="500"/><wx w="500"/></cid-widths></multibyte-extras><kerning kpx1="246"><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="169"/><pair kern="-26" kpx2="197"/><pair kern="-35" kpx2="55"/><pair kern="-49" kpx2="60"/><pair kern="-49" kpx2="187"/><pair kern="-21" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-49" kpx2="234"/></kerning><kerning kpx1="235"><pair kern="-142" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-146" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-72" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="43"><pair kern="-35" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-35" kpx2="197"/><pair kern="-30" kpx2="181"/></kerning><kerning kpx1="16"><pair kern="36" kpx2="246"/><pair kern="-17" kpx2="235"/><pair kern="-21" kpx2="199"/><pair kern="18" kpx2="123"/><pair kern="27" kpx2="208"/><pair kern="-118" kpx2="187"/><pair kern="-49" kpx2="59"/><pair kern="18" kpx2="124"/><pair kern="-21" kpx2="201"/><pair kern="-118" kpx2="60"/><pair kern="36" kpx2="52"/><pair kern="18" kpx2="125"/><pair kern="36" kpx2="42"/><pair kern="-118" kpx2="234"/><pair kern="18" kpx2="122"/><pair kern="27" kpx2="210"/><pair kern="-21" kpx2="36"/><pair kern="18" kpx2="82"/><pair kern="-40" kpx2="58"/><pair kern="-91" kpx2="55"/><pair kern="-17" kpx2="186"/><pair kern="27" kpx2="175"/><pair kern="27" kpx2="50"/><pair kern="27" kpx2="209"/><pair kern="27" kpx2="103"/><pair kern="-21" kpx2="98"/><pair kern="55" kpx2="45"/><pair kern="-21" kpx2="173"/><pair kern="-17" kpx2="92"/><pair kern="-26" kpx2="89"/><pair kern="18" kpx2="121"/><pair kern="-58" kpx2="57"/><pair kern="-35" kpx2="37"/><pair kern="-21" kpx2="174"/></kerning><kerning kpx1="112"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="123"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="251"><pair kern="-17" kpx2="169"/><pair kern="-17" kpx2="60"/><pair kern="-17" kpx2="187"/><pair kern="18" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-17" kpx2="234"/></kerning><kerning kpx1="213"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning><kerning kpx1="208"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="187"><pair kern="-114" kpx2="126"/><pair kern="-137" kpx2="107"/><pair kern="-132" kpx2="72"/><pair kern="-77" kpx2="199"/><pair kern="-118" kpx2="16"/><pair kern="-132" kpx2="123"/><pair kern="-132" kpx2="112"/><pair kern="-54" kpx2="251"/><pair kern="-54" kpx2="208"/><pair kern="-132" kpx2="113"/><pair kern="-54" kpx2="180"/><pair kern="-137" kpx2="105"/><pair kern="-114" kpx2="129"/><pair kern="-132" kpx2="124"/><pair kern="-109" kpx2="169"/><pair kern="-77" kpx2="201"/><pair kern="-54" kpx2="253"/><pair kern="-137" kpx2="106"/><pair kern="-132" kpx2="29"/><pair kern="-132" kpx2="125"/><pair kern="-72" kpx2="170"/><pair kern="-132" kpx2="115"/><pair kern="-114" kpx2="88"/><pair kern="-132" kpx2="122"/><pair kern="-54" kpx2="100"/><pair kern="-137" kpx2="68"/><pair kern="-54" kpx2="210"/><pair kern="-77" kpx2="36"/><pair kern="-132" kpx2="82"/><pair kern="-132" kpx2="114"/><pair kern="-54" kpx2="175"/><pair kern="-114" kpx2="127"/><pair kern="-54" kpx2="50"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-137" kpx2="108"/><pair kern="-77" kpx2="98"/><pair kern="-35" kpx2="76"/><pair kern="-17" kpx2="181"/><pair kern="-202" kpx2="17"/><pair kern="-114" kpx2="128"/><pair kern="-77" kpx2="173"/><pair kern="-137" kpx2="109"/><pair kern="-128" kpx2="197"/><pair kern="-54" kpx2="38"/><pair kern="-132" kpx2="121"/><pair kern="-137" kpx2="110"/><pair kern="-77" kpx2="174"/></kerning><kerning kpx1="113"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="144"><pair kern="-40" kpx2="180"/><pair kern="-54" kpx2="197"/><pair kern="-44" kpx2="181"/></kerning><kerning kpx1="59"><pair kern="-72" kpx2="100"/><pair kern="-63" kpx2="210"/><pair kern="-17" kpx2="55"/><pair kern="-44" kpx2="114"/><pair kern="-44" kpx2="72"/><pair kern="-63" kpx2="175"/><pair kern="-49" kpx2="16"/><pair kern="-63" kpx2="50"/><pair kern="-63" kpx2="209"/><pair kern="-44" kpx2="112"/><pair kern="-72" kpx2="251"/><pair kern="-63" kpx2="103"/><pair kern="-63" kpx2="208"/><pair kern="-44" kpx2="113"/><pair kern="-40" kpx2="181"/><pair kern="-77" kpx2="180"/><pair kern="-54" kpx2="169"/><pair kern="-21" kpx2="197"/><pair kern="-72" kpx2="38"/><pair kern="-72" kpx2="253"/><pair kern="-44" kpx2="115"/></kerning><kerning kpx1="73"><pair kern="31" kpx2="180"/><pair kern="-17" kpx2="90"/><pair kern="-72" kpx2="17"/><pair kern="-17" kpx2="235"/><pair kern="-35" kpx2="169"/><pair kern="-114" kpx2="197"/><pair kern="-17" kpx2="186"/><pair kern="-17" kpx2="92"/><pair kern="-17" kpx2="87"/><pair kern="-54" kpx2="16"/><pair kern="-35" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="41"><pair kern="-17" kpx2="227"/><pair kern="-54" kpx2="126"/><pair kern="-91" kpx2="107"/><pair kern="-91" kpx2="235"/><pair kern="-54" kpx2="72"/><pair kern="-91" kpx2="199"/><pair kern="-35" kpx2="123"/><pair kern="-54" kpx2="112"/><pair kern="-54" kpx2="113"/><pair kern="-17" kpx2="54"/><pair kern="-21" kpx2="180"/><pair kern="-91" kpx2="105"/><pair kern="-54" kpx2="129"/><pair kern="-35" kpx2="124"/><pair kern="-91" kpx2="201"/><pair kern="-72" kpx2="85"/><pair kern="-91" kpx2="106"/><pair kern="-77" kpx2="29"/><pair kern="-35" kpx2="125"/><pair kern="-54" kpx2="115"/><pair kern="-54" kpx2="88"/><pair kern="-35" kpx2="122"/><pair kern="-91" kpx2="68"/><pair kern="-91" kpx2="36"/><pair kern="-35" kpx2="82"/><pair kern="-91" kpx2="186"/><pair kern="-17" kpx2="55"/><pair kern="-54" kpx2="114"/><pair kern="-54" kpx2="127"/><pair kern="-91" kpx2="108"/><pair kern="-91" kpx2="98"/><pair kern="-72" kpx2="76"/><pair kern="-160" kpx2="17"/><pair kern="-54" kpx2="128"/><pair kern="-91" kpx2="173"/><pair kern="-91" kpx2="109"/><pair kern="-183" kpx2="197"/><pair kern="-91" kpx2="92"/><pair kern="-35" kpx2="121"/><pair kern="-91" kpx2="110"/><pair kern="-91" kpx2="174"/><pair kern="-17" kpx2="249"/></kerning><kerning kpx1="124"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="169"><pair kern="-17" kpx2="90"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="246"/><pair kern="-17" kpx2="235"/><pair kern="-17" kpx2="58"/><pair kern="-17" kpx2="186"/><pair kern="-54" kpx2="55"/><pair kern="-17" kpx2="251"/><pair kern="-72" kpx2="187"/><pair kern="-17" kpx2="39"/><pair kern="73" kpx2="144"/><pair kern="-17" kpx2="45"/><pair kern="-17" kpx2="92"/><pair kern="-17" kpx2="38"/><pair kern="-72" kpx2="60"/><pair kern="-17" kpx2="89"/><pair kern="-17" kpx2="253"/><pair kern="-54" kpx2="57"/><pair kern="-17" kpx2="37"/><pair kern="-17" kpx2="42"/><pair kern="-72" kpx2="234"/></kerning><kerning kpx1="201"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="60"><pair kern="-114" kpx2="126"/><pair kern="-137" kpx2="107"/><pair kern="-132" kpx2="72"/><pair kern="-77" kpx2="199"/><pair kern="-118" kpx2="16"/><pair kern="-132" kpx2="123"/><pair kern="-132" kpx2="112"/><pair kern="-54" kpx2="251"/><pair kern="-54" kpx2="208"/><pair kern="-132" kpx2="113"/><pair kern="-54" kpx2="180"/><pair kern="-137" kpx2="105"/><pair kern="-114" kpx2="129"/><pair kern="-132" kpx2="124"/><pair kern="-109" kpx2="169"/><pair kern="-77" kpx2="201"/><pair kern="-54" kpx2="253"/><pair kern="-137" kpx2="106"/><pair kern="-132" kpx2="29"/><pair kern="-132" kpx2="125"/><pair kern="-72" kpx2="170"/><pair kern="-132" kpx2="115"/><pair kern="-114" kpx2="88"/><pair kern="-132" kpx2="122"/><pair kern="-54" kpx2="100"/><pair kern="-137" kpx2="68"/><pair kern="-54" kpx2="210"/><pair kern="-77" kpx2="36"/><pair kern="-132" kpx2="82"/><pair kern="-132" kpx2="114"/><pair kern="-54" kpx2="175"/><pair kern="-114" kpx2="127"/><pair kern="-54" kpx2="50"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-137" kpx2="108"/><pair kern="-77" kpx2="98"/><pair kern="-35" kpx2="76"/><pair kern="-17" kpx2="181"/><pair kern="-202" kpx2="17"/><pair kern="-114" kpx2="128"/><pair kern="-77" kpx2="173"/><pair kern="-137" kpx2="109"/><pair kern="-128" kpx2="197"/><pair kern="-54" kpx2="38"/><pair kern="-132" kpx2="121"/><pair kern="-137" kpx2="110"/><pair kern="-77" kpx2="174"/></kerning><kerning kpx1="85"><pair kern="-21" kpx2="254"/><pair kern="-21" kpx2="72"/><pair kern="-63" kpx2="16"/><pair kern="-21" kpx2="112"/><pair kern="-21" kpx2="123"/><pair kern="-17" kpx2="80"/><pair kern="-21" kpx2="113"/><pair kern="-17" kpx2="71"/><pair kern="-21" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-21" kpx2="252"/><pair kern="-21" kpx2="70"/><pair kern="-17" kpx2="85"/><pair kern="-17" kpx2="29"/><pair kern="-21" kpx2="125"/><pair kern="-21" kpx2="115"/><pair kern="-21" kpx2="111"/><pair kern="-21" kpx2="122"/><pair kern="-21" kpx2="82"/><pair kern="-17" kpx2="75"/><pair kern="-21" kpx2="114"/><pair kern="-26" kpx2="91"/><pair kern="-17" kpx2="81"/><pair kern="41" kpx2="181"/><pair kern="-91" kpx2="17"/><pair kern="-151" kpx2="197"/><pair kern="-17" kpx2="74"/><pair kern="-17" kpx2="84"/><pair kern="-21" kpx2="121"/><pair kern="-17" kpx2="247"/><pair kern="-17" kpx2="120"/></kerning><kerning kpx1="61"><pair kern="-17" kpx2="180"/><pair kern="-17" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-17" kpx2="181"/></kerning><kerning kpx1="234"><pair kern="-114" kpx2="126"/><pair kern="-137" kpx2="107"/><pair kern="-132" kpx2="72"/><pair kern="-77" kpx2="199"/><pair kern="-118" kpx2="16"/><pair kern="-132" kpx2="123"/><pair kern="-132" kpx2="112"/><pair kern="-54" kpx2="251"/><pair kern="-54" kpx2="208"/><pair kern="-132" kpx2="113"/><pair kern="-54" kpx2="180"/><pair kern="-137" kpx2="105"/><pair kern="-114" kpx2="129"/><pair kern="-132" kpx2="124"/><pair kern="-109" kpx2="169"/><pair kern="-77" kpx2="201"/><pair kern="-54" kpx2="253"/><pair kern="-137" kpx2="106"/><pair kern="-132" kpx2="29"/><pair kern="-132" kpx2="125"/><pair kern="-72" kpx2="170"/><pair kern="-132" kpx2="115"/><pair kern="-114" kpx2="88"/><pair kern="-132" kpx2="122"/><pair kern="-54" kpx2="100"/><pair kern="-137" kpx2="68"/><pair kern="-54" kpx2="210"/><pair kern="-77" kpx2="36"/><pair kern="-132" kpx2="82"/><pair kern="-132" kpx2="114"/><pair kern="-54" kpx2="175"/><pair kern="-114" kpx2="127"/><pair kern="-54" kpx2="50"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-137" kpx2="108"/><pair kern="-77" kpx2="98"/><pair kern="-35" kpx2="76"/><pair kern="-17" kpx2="181"/><pair kern="-202" kpx2="17"/><pair kern="-114" kpx2="128"/><pair kern="-77" kpx2="173"/><pair kern="-137" kpx2="109"/><pair kern="-128" kpx2="197"/><pair kern="-54" kpx2="38"/><pair kern="-132" kpx2="121"/><pair kern="-137" kpx2="110"/><pair kern="-77" kpx2="174"/></kerning><kerning kpx1="100"><pair kern="-17" kpx2="169"/><pair kern="-17" kpx2="60"/><pair kern="-17" kpx2="187"/><pair kern="18" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-17" kpx2="234"/></kerning><kerning kpx1="122"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="47"><pair kern="-17" kpx2="126"/><pair kern="-91" kpx2="235"/><pair kern="-49" kpx2="104"/><pair kern="-17" kpx2="72"/><pair kern="22" kpx2="199"/><pair kern="-17" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-49" kpx2="213"/><pair kern="-35" kpx2="208"/><pair kern="-132" kpx2="187"/><pair kern="-17" kpx2="113"/><pair kern="-202" kpx2="180"/><pair kern="-17" kpx2="129"/><pair kern="-17" kpx2="124"/><pair kern="22" kpx2="201"/><pair kern="-132" kpx2="60"/><pair kern="-49" kpx2="211"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="115"/><pair kern="-132" kpx2="234"/><pair kern="-17" kpx2="88"/><pair kern="-17" kpx2="122"/><pair kern="-35" kpx2="210"/><pair kern="22" kpx2="36"/><pair kern="-17" kpx2="82"/><pair kern="-91" kpx2="58"/><pair kern="-91" kpx2="186"/><pair kern="-137" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-35" kpx2="175"/><pair kern="-17" kpx2="127"/><pair kern="-35" kpx2="50"/><pair kern="-35" kpx2="209"/><pair kern="-35" kpx2="103"/><pair kern="22" kpx2="98"/><pair kern="-262" kpx2="181"/><pair kern="-17" kpx2="128"/><pair kern="22" kpx2="173"/><pair kern="-49" kpx2="212"/><pair kern="-91" kpx2="92"/><pair kern="-17" kpx2="121"/><pair kern="-109" kpx2="57"/><pair kern="22" kpx2="174"/><pair kern="-49" kpx2="56"/></kerning><kerning kpx1="210"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="58"><pair kern="-35" kpx2="126"/><pair kern="-63" kpx2="107"/><pair kern="-17" kpx2="235"/><pair kern="-58" kpx2="72"/><pair kern="-54" kpx2="199"/><pair kern="-40" kpx2="16"/><pair kern="-58" kpx2="112"/><pair kern="-58" kpx2="123"/><pair kern="-58" kpx2="113"/><pair kern="-17" kpx2="180"/><pair kern="-63" kpx2="105"/><pair kern="-35" kpx2="129"/><pair kern="-58" kpx2="124"/><pair kern="-54" kpx2="169"/><pair kern="-54" kpx2="201"/><pair kern="-44" kpx2="85"/><pair kern="-63" kpx2="106"/><pair kern="-58" kpx2="29"/><pair kern="-58" kpx2="125"/><pair kern="-17" kpx2="170"/><pair kern="-58" kpx2="115"/><pair kern="-35" kpx2="88"/><pair kern="-58" kpx2="122"/><pair kern="-63" kpx2="68"/><pair kern="-54" kpx2="36"/><pair kern="-58" kpx2="82"/><pair kern="-17" kpx2="186"/><pair kern="-58" kpx2="114"/><pair kern="-35" kpx2="127"/><pair kern="-63" kpx2="108"/><pair kern="-54" kpx2="98"/><pair kern="-21" kpx2="76"/><pair kern="-114" kpx2="17"/><pair kern="-35" kpx2="128"/><pair kern="-54" kpx2="173"/><pair kern="-63" kpx2="109"/><pair kern="-128" kpx2="197"/><pair kern="-17" kpx2="92"/><pair kern="-58" kpx2="121"/><pair kern="-63" kpx2="110"/><pair kern="-54" kpx2="174"/></kerning><kerning kpx1="82"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="186"><pair kern="-142" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-146" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-72" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="175"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="209"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="103"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="81"><pair kern="-72" kpx2="180"/><pair kern="-44" kpx2="197"/><pair kern="-54" kpx2="181"/></kerning><kerning kpx1="98"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="212"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning><kerning kpx1="229"><pair kern="-17" kpx2="180"/><pair kern="-17" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-17" kpx2="181"/></kerning><kerning kpx1="38"><pair kern="-17" kpx2="169"/><pair kern="-17" kpx2="60"/><pair kern="-17" kpx2="187"/><pair kern="18" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-17" kpx2="234"/></kerning><kerning kpx1="121"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="57"><pair kern="-67" kpx2="126"/><pair kern="-77" kpx2="107"/><pair kern="-26" kpx2="235"/><pair kern="-77" kpx2="72"/><pair kern="-63" kpx2="199"/><pair kern="-58" kpx2="16"/><pair kern="-77" kpx2="123"/><pair kern="-77" kpx2="112"/><pair kern="-17" kpx2="208"/><pair kern="-77" kpx2="113"/><pair kern="-77" kpx2="105"/><pair kern="-67" kpx2="129"/><pair kern="-77" kpx2="124"/><pair kern="-86" kpx2="169"/><pair kern="-63" kpx2="201"/><pair kern="-77" kpx2="106"/><pair kern="-81" kpx2="29"/><pair kern="-77" kpx2="125"/><pair kern="-54" kpx2="170"/><pair kern="-77" kpx2="115"/><pair kern="-67" kpx2="88"/><pair kern="-77" kpx2="122"/><pair kern="-77" kpx2="68"/><pair kern="-17" kpx2="210"/><pair kern="-63" kpx2="36"/><pair kern="-77" kpx2="82"/><pair kern="-26" kpx2="186"/><pair kern="-77" kpx2="114"/><pair kern="-17" kpx2="175"/><pair kern="-67" kpx2="127"/><pair kern="-17" kpx2="50"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="-77" kpx2="108"/><pair kern="-63" kpx2="98"/><pair kern="-21" kpx2="76"/><pair kern="-128" kpx2="17"/><pair kern="-67" kpx2="128"/><pair kern="-63" kpx2="173"/><pair kern="-77" kpx2="109"/><pair kern="-137" kpx2="197"/><pair kern="-26" kpx2="92"/><pair kern="-77" kpx2="121"/><pair kern="-77" kpx2="110"/><pair kern="-63" kpx2="174"/></kerning><kerning kpx1="37"><pair kern="-17" kpx2="227"/><pair kern="-17" kpx2="246"/><pair kern="-17" kpx2="251"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-17" kpx2="54"/><pair kern="-54" kpx2="180"/><pair kern="-30" kpx2="169"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="170"/><pair kern="-54" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="210"/><pair kern="-35" kpx2="58"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="50"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="-54" kpx2="181"/><pair kern="-40" kpx2="197"/><pair kern="-17" kpx2="38"/><pair kern="-30" kpx2="57"/><pair kern="-17" kpx2="249"/></kerning><kerning kpx1="120"><pair kern="-72" kpx2="180"/><pair kern="-44" kpx2="197"/><pair kern="-54" kpx2="181"/></kerning><kerning kpx1="249"><pair kern="18" kpx2="173"/><pair kern="18" kpx2="36"/><pair kern="18" kpx2="201"/><pair kern="18" kpx2="199"/><pair kern="18" kpx2="174"/><pair kern="18" kpx2="98"/></kerning><kerning kpx1="227"><pair kern="18" kpx2="173"/><pair kern="18" kpx2="36"/><pair kern="18" kpx2="201"/><pair kern="18" kpx2="199"/><pair kern="18" kpx2="174"/><pair kern="18" kpx2="98"/></kerning><kerning kpx1="51"><pair kern="-17" kpx2="126"/><pair kern="-44" kpx2="107"/><pair kern="-35" kpx2="72"/><pair kern="-63" kpx2="199"/><pair kern="-21" kpx2="16"/><pair kern="-35" kpx2="123"/><pair kern="-35" kpx2="112"/><pair kern="-21" kpx2="187"/><pair kern="-35" kpx2="113"/><pair kern="-17" kpx2="86"/><pair kern="18" kpx2="180"/><pair kern="-44" kpx2="105"/><pair kern="-17" kpx2="129"/><pair kern="-35" kpx2="124"/><pair kern="-17" kpx2="169"/><pair kern="-63" kpx2="201"/><pair kern="-17" kpx2="85"/><pair kern="-21" kpx2="60"/><pair kern="-44" kpx2="106"/><pair kern="-35" kpx2="125"/><pair kern="-35" kpx2="115"/><pair kern="-21" kpx2="234"/><pair kern="-17" kpx2="88"/><pair kern="-35" kpx2="122"/><pair kern="-44" kpx2="68"/><pair kern="-63" kpx2="36"/><pair kern="-35" kpx2="82"/><pair kern="-35" kpx2="114"/><pair kern="-17" kpx2="250"/><pair kern="-17" kpx2="127"/><pair kern="-44" kpx2="108"/><pair kern="-63" kpx2="98"/><pair kern="-17" kpx2="81"/><pair kern="-21" kpx2="76"/><pair kern="18" kpx2="181"/><pair kern="-155" kpx2="17"/><pair kern="-17" kpx2="128"/><pair kern="-63" kpx2="173"/><pair kern="-44" kpx2="109"/><pair kern="-160" kpx2="197"/><pair kern="-35" kpx2="121"/><pair kern="-17" kpx2="228"/><pair kern="-44" kpx2="110"/><pair kern="-63" kpx2="174"/><pair kern="-17" kpx2="120"/></kerning><kerning kpx1="104"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning><kerning kpx1="72"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="199"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="54"><pair kern="18" kpx2="173"/><pair kern="18" kpx2="36"/><pair kern="18" kpx2="201"/><pair kern="18" kpx2="199"/><pair kern="18" kpx2="174"/><pair kern="18" kpx2="98"/></kerning><kerning kpx1="180"><pair kern="-35" kpx2="235"/><pair kern="-35" kpx2="246"/><pair kern="-30" kpx2="43"/><pair kern="-72" kpx2="123"/><pair kern="-35" kpx2="251"/><pair kern="-35" kpx2="208"/><pair kern="-188" kpx2="144"/><pair kern="-58" kpx2="59"/><pair kern="-35" kpx2="73"/><pair kern="-30" kpx2="41"/><pair kern="-72" kpx2="124"/><pair kern="-54" kpx2="85"/><pair kern="-128" kpx2="201"/><pair kern="-17" kpx2="61"/><pair kern="-35" kpx2="100"/><pair kern="-72" kpx2="122"/><pair kern="-30" kpx2="47"/><pair kern="-35" kpx2="210"/><pair kern="-72" kpx2="82"/><pair kern="-35" kpx2="186"/><pair kern="-35" kpx2="175"/><pair kern="-35" kpx2="209"/><pair kern="-35" kpx2="103"/><pair kern="-128" kpx2="98"/><pair kern="-54" kpx2="81"/><pair kern="-17" kpx2="229"/><pair kern="-35" kpx2="38"/><pair kern="-72" kpx2="121"/><pair kern="-30" kpx2="37"/><pair kern="-54" kpx2="120"/><pair kern="-30" kpx2="51"/><pair kern="-128" kpx2="199"/><pair kern="-30" kpx2="53"/><pair kern="-30" kpx2="137"/><pair kern="-35" kpx2="233"/><pair kern="-35" kpx2="253"/><pair kern="-35" kpx2="52"/><pair kern="-72" kpx2="125"/><pair kern="-35" kpx2="42"/><pair kern="-35" kpx2="90"/><pair kern="-128" kpx2="36"/><pair kern="-35" kpx2="50"/><pair kern="-30" kpx2="39"/><pair kern="-30" kpx2="236"/><pair kern="-30" kpx2="45"/><pair kern="-128" kpx2="173"/><pair kern="-35" kpx2="92"/><pair kern="-35" kpx2="89"/><pair kern="-30" kpx2="46"/><pair kern="-128" kpx2="174"/></kerning><kerning kpx1="53"><pair kern="-21" kpx2="107"/><pair kern="-54" kpx2="235"/><pair kern="-40" kpx2="16"/><pair kern="-44" kpx2="112"/><pair kern="-44" kpx2="123"/><pair kern="-49" kpx2="251"/><pair kern="-44" kpx2="113"/><pair kern="-63" kpx2="187"/><pair kern="-44" kpx2="129"/><pair kern="-44" kpx2="124"/><pair kern="-54" kpx2="169"/><pair kern="-63" kpx2="60"/><pair kern="-40" kpx2="201"/><pair kern="-21" kpx2="106"/><pair kern="-30" kpx2="29"/><pair kern="-63" kpx2="234"/><pair kern="-49" kpx2="100"/><pair kern="-44" kpx2="122"/><pair kern="-21" kpx2="68"/><pair kern="-40" kpx2="58"/><pair kern="-44" kpx2="82"/><pair kern="-54" kpx2="186"/><pair kern="-40" kpx2="98"/><pair kern="-63" kpx2="181"/><pair kern="-35" kpx2="17"/><pair kern="-49" kpx2="38"/><pair kern="-44" kpx2="121"/><pair kern="-54" kpx2="57"/><pair kern="-44" kpx2="126"/><pair kern="-44" kpx2="72"/><pair kern="-40" kpx2="199"/><pair kern="-72" kpx2="180"/><pair kern="-21" kpx2="105"/><pair kern="-49" kpx2="253"/><pair kern="-44" kpx2="125"/><pair kern="-44" kpx2="115"/><pair kern="-17" kpx2="170"/><pair kern="-44" kpx2="88"/><pair kern="-40" kpx2="36"/><pair kern="-44" kpx2="114"/><pair kern="-72" kpx2="55"/><pair kern="-44" kpx2="127"/><pair kern="-21" kpx2="108"/><pair kern="-44" kpx2="128"/><pair kern="-40" kpx2="173"/><pair kern="-21" kpx2="109"/><pair kern="-54" kpx2="92"/><pair kern="-17" kpx2="197"/><pair kern="-21" kpx2="110"/><pair kern="-40" kpx2="174"/></kerning><kerning kpx1="137"><pair kern="-54" kpx2="180"/><pair kern="-40" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-54" kpx2="181"/></kerning><kerning kpx1="233"><pair kern="-44" kpx2="180"/><pair kern="-35" kpx2="197"/><pair kern="-54" kpx2="181"/></kerning><kerning kpx1="253"><pair kern="-17" kpx2="169"/><pair kern="-17" kpx2="60"/><pair kern="-17" kpx2="187"/><pair kern="18" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-17" kpx2="234"/></kerning><kerning kpx1="211"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning><kerning kpx1="78"><pair kern="-17" kpx2="107"/><pair kern="-30" kpx2="126"/><pair kern="-35" kpx2="235"/><pair kern="-35" kpx2="72"/><pair kern="-35" kpx2="112"/><pair kern="-35" kpx2="123"/><pair kern="-35" kpx2="113"/><pair kern="-17" kpx2="105"/><pair kern="-30" kpx2="129"/><pair kern="-35" kpx2="124"/><pair kern="-17" kpx2="106"/><pair kern="-35" kpx2="125"/><pair kern="-35" kpx2="115"/><pair kern="-30" kpx2="88"/><pair kern="-35" kpx2="122"/><pair kern="-17" kpx2="68"/><pair kern="-35" kpx2="82"/><pair kern="-35" kpx2="114"/><pair kern="-35" kpx2="186"/><pair kern="-30" kpx2="127"/><pair kern="-17" kpx2="108"/><pair kern="-30" kpx2="128"/><pair kern="-17" kpx2="109"/><pair kern="-35" kpx2="92"/><pair kern="-35" kpx2="121"/><pair kern="-17" kpx2="110"/></kerning><kerning kpx1="52"><pair kern="-21" kpx2="180"/><pair kern="-63" kpx2="197"/><pair kern="27" kpx2="16"/><pair kern="-17" kpx2="181"/></kerning><kerning kpx1="125"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="42"><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="169"/><pair kern="-26" kpx2="197"/><pair kern="-35" kpx2="55"/><pair kern="-49" kpx2="60"/><pair kern="-49" kpx2="187"/><pair kern="-21" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-49" kpx2="234"/></kerning><kerning kpx1="170"><pair kern="-17" kpx2="235"/><pair kern="-35" kpx2="199"/><pair kern="-17" kpx2="251"/><pair kern="-109" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-54" kpx2="59"/><pair kern="-109" kpx2="60"/><pair kern="-35" kpx2="201"/><pair kern="-17" kpx2="253"/><pair kern="-109" kpx2="234"/><pair kern="-17" kpx2="90"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="210"/><pair kern="-35" kpx2="36"/><pair kern="-54" kpx2="58"/><pair kern="-91" kpx2="55"/><pair kern="-17" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="50"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="-17" kpx2="39"/><pair kern="-35" kpx2="98"/><pair kern="-17" kpx2="45"/><pair kern="-35" kpx2="173"/><pair kern="-17" kpx2="92"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="89"/><pair kern="-86" kpx2="57"/><pair kern="-35" kpx2="37"/><pair kern="-35" kpx2="174"/></kerning><kerning kpx1="115"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="90"><pair kern="-91" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-104" kpx2="197"/><pair kern="-54" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="36"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="55"><pair kern="-165" kpx2="107"/><pair kern="-155" kpx2="235"/><pair kern="-91" kpx2="16"/><pair kern="-169" kpx2="112"/><pair kern="-169" kpx2="123"/><pair kern="-58" kpx2="251"/><pair kern="-169" kpx2="113"/><pair kern="-165" kpx2="86"/><pair kern="-151" kpx2="129"/><pair kern="-169" kpx2="124"/><pair kern="-91" kpx2="169"/><pair kern="-169" kpx2="252"/><pair kern="-169" kpx2="70"/><pair kern="-146" kpx2="85"/><pair kern="-77" kpx2="201"/><pair kern="-165" kpx2="106"/><pair kern="-109" kpx2="29"/><pair kern="-58" kpx2="100"/><pair kern="-169" kpx2="122"/><pair kern="-165" kpx2="68"/><pair kern="-169" kpx2="82"/><pair kern="-155" kpx2="186"/><pair kern="-165" kpx2="250"/><pair kern="-77" kpx2="98"/><pair kern="-21" kpx2="181"/><pair kern="-118" kpx2="17"/><pair kern="-58" kpx2="38"/><pair kern="-169" kpx2="121"/><pair kern="-165" kpx2="228"/><pair kern="-169" kpx2="254"/><pair kern="-151" kpx2="126"/><pair kern="-169" kpx2="72"/><pair kern="-77" kpx2="199"/><pair kern="-165" kpx2="105"/><pair kern="-58" kpx2="253"/><pair kern="-169" kpx2="125"/><pair kern="-169" kpx2="115"/><pair kern="-54" kpx2="170"/><pair kern="-151" kpx2="88"/><pair kern="-169" kpx2="111"/><pair kern="-165" kpx2="90"/><pair kern="-77" kpx2="36"/><pair kern="-17" kpx2="55"/><pair kern="-169" kpx2="114"/><pair kern="-151" kpx2="127"/><pair kern="-165" kpx2="108"/><pair kern="-30" kpx2="76"/><pair kern="-151" kpx2="128"/><pair kern="-77" kpx2="173"/><pair kern="-165" kpx2="109"/><pair kern="-155" kpx2="92"/><pair kern="-128" kpx2="197"/><pair kern="-165" kpx2="110"/><pair kern="-77" kpx2="174"/></kerning><kerning kpx1="114"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="50"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="91"><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="111"/><pair kern="-30" kpx2="122"/><pair kern="-30" kpx2="82"/><pair kern="-30" kpx2="114"/><pair kern="-30" kpx2="72"/><pair kern="-30" kpx2="112"/><pair kern="-30" kpx2="123"/><pair kern="-30" kpx2="113"/><pair kern="-30" kpx2="124"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-30" kpx2="121"/><pair kern="-30" kpx2="125"/><pair kern="-30" kpx2="115"/></kerning><kerning kpx1="39"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="-17" kpx2="98"/><pair kern="-54" kpx2="187"/><pair kern="-26" kpx2="181"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-17" kpx2="170"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="236"><pair kern="-17" kpx2="180"/><pair kern="-72" kpx2="17"/><pair kern="-91" kpx2="197"/><pair kern="-35" kpx2="29"/></kerning><kerning kpx1="45"><pair kern="-35" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="169"/><pair kern="-54" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-17" kpx2="199"/><pair kern="-35" kpx2="16"/><pair kern="-17" kpx2="174"/><pair kern="-17" kpx2="98"/><pair kern="-30" kpx2="181"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="173"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="197"><pair kern="-35" kpx2="246"/><pair kern="-54" kpx2="235"/><pair kern="-35" kpx2="43"/><pair kern="-35" kpx2="123"/><pair kern="-54" kpx2="251"/><pair kern="-183" kpx2="187"/><pair kern="-54" kpx2="208"/><pair kern="18" kpx2="144"/><pair kern="-35" kpx2="59"/><pair kern="-17" kpx2="73"/><pair kern="-35" kpx2="41"/><pair kern="-35" kpx2="124"/><pair kern="-35" kpx2="85"/><pair kern="-183" kpx2="60"/><pair kern="18" kpx2="201"/><pair kern="-183" kpx2="234"/><pair kern="-54" kpx2="100"/><pair kern="-35" kpx2="122"/><pair kern="-35" kpx2="47"/><pair kern="-54" kpx2="210"/><pair kern="-35" kpx2="82"/><pair kern="-123" kpx2="58"/><pair kern="-54" kpx2="186"/><pair kern="-54" kpx2="175"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-35" kpx2="81"/><pair kern="18" kpx2="98"/><pair kern="-54" kpx2="38"/><pair kern="-35" kpx2="121"/><pair kern="-183" kpx2="57"/><pair kern="-35" kpx2="37"/><pair kern="-35" kpx2="120"/><pair kern="-35" kpx2="51"/><pair kern="18" kpx2="199"/><pair kern="-35" kpx2="53"/><pair kern="-35" kpx2="137"/><pair kern="-35" kpx2="233"/><pair kern="-54" kpx2="253"/><pair kern="-54" kpx2="52"/><pair kern="-35" kpx2="125"/><pair kern="-35" kpx2="42"/><pair kern="-95" kpx2="90"/><pair kern="18" kpx2="36"/><pair kern="-137" kpx2="55"/><pair kern="-54" kpx2="50"/><pair kern="-35" kpx2="39"/><pair kern="-35" kpx2="236"/><pair kern="22" kpx2="45"/><pair kern="18" kpx2="173"/><pair kern="-54" kpx2="92"/><pair kern="-114" kpx2="89"/><pair kern="-35" kpx2="46"/><pair kern="18" kpx2="174"/></kerning><kerning kpx1="92"><pair kern="-142" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-146" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-72" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="89"><pair kern="-77" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-132" kpx2="197"/><pair kern="-26" kpx2="16"/><pair kern="-54" kpx2="29"/><pair kern="-17" kpx2="181"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="46"><pair kern="-17" kpx2="107"/><pair kern="-72" kpx2="235"/><pair kern="-104" kpx2="16"/><pair kern="-49" kpx2="112"/><pair kern="-49" kpx2="123"/><pair kern="-54" kpx2="251"/><pair kern="-26" kpx2="213"/><pair kern="-49" kpx2="113"/><pair kern="-35" kpx2="187"/><pair kern="-54" kpx2="208"/><pair kern="-49" kpx2="129"/><pair kern="-49" kpx2="124"/><pair kern="-63" kpx2="169"/><pair kern="-35" kpx2="60"/><pair kern="-17" kpx2="201"/><pair kern="-17" kpx2="106"/><pair kern="-35" kpx2="234"/><pair kern="-54" kpx2="100"/><pair kern="-49" kpx2="122"/><pair kern="-17" kpx2="68"/><pair kern="-54" kpx2="210"/><pair kern="-35" kpx2="58"/><pair kern="-49" kpx2="82"/><pair kern="-72" kpx2="186"/><pair kern="-54" kpx2="175"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-17" kpx2="98"/><pair kern="-30" kpx2="181"/><pair kern="-26" kpx2="212"/><pair kern="-54" kpx2="38"/><pair kern="-49" kpx2="121"/><pair kern="-49" kpx2="126"/><pair kern="-26" kpx2="104"/><pair kern="-49" kpx2="72"/><pair kern="-17" kpx2="199"/><pair kern="-30" kpx2="180"/><pair kern="-17" kpx2="105"/><pair kern="-54" kpx2="253"/><pair kern="-26" kpx2="211"/><pair kern="-49" kpx2="125"/><pair kern="-49" kpx2="115"/><pair kern="-49" kpx2="88"/><pair kern="-17" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-49" kpx2="114"/><pair kern="-54" kpx2="50"/><pair kern="-49" kpx2="127"/><pair kern="-17" kpx2="108"/><pair kern="-49" kpx2="128"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="109"/><pair kern="-72" kpx2="92"/><pair kern="-17" kpx2="110"/><pair kern="-17" kpx2="174"/><pair kern="-26" kpx2="56"/></kerning><kerning kpx1="174"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="56"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning></font-metrics> \ No newline at end of file | |||
diff --git a/documentation/template/VeraMoBd.ttf b/documentation/template/VeraMoBd.ttf new file mode 100644 index 0000000..9be6547 --- /dev/null +++ b/documentation/template/VeraMoBd.ttf | |||
Binary files differ | |||
diff --git a/documentation/template/VeraMoBd.xml b/documentation/template/VeraMoBd.xml new file mode 100644 index 0000000..9b33107 --- /dev/null +++ b/documentation/template/VeraMoBd.xml | |||
@@ -0,0 +1 @@ | |||
<?xml version="1.0" encoding="UTF-8"?><font-metrics metrics-version="2" type="TYPE0"><font-name>BitstreamVeraSansMono-Bold</font-name><full-name>Bitstream Vera Sans Mono Bold</full-name><family-name>Bitstream Vera Sans Mono</family-name><embed/><cap-height>729</cap-height><x-height>546</x-height><ascender>759</ascender><descender>-240</descender><bbox><left>-19</left><bottom>-235</bottom><right>605</right><top>928</top></bbox><flags>34</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="3" ue="126" us="32"/><bf gi="172" ue="160" us="160"/><bf gi="163" ue="161" us="161"/><bf gi="132" ue="163" us="162"/><bf gi="189" ue="164" us="164"/><bf gi="150" ue="165" us="165"/><bf gi="231" ue="166" us="166"/><bf gi="134" ue="167" us="167"/><bf gi="142" ue="168" us="168"/><bf gi="139" ue="169" us="169"/><bf gi="157" ue="170" us="170"/><bf gi="169" ue="171" us="171"/><bf gi="164" ue="172" us="172"/><bf gi="256" ue="173" us="173"/><bf gi="138" ue="174" us="174"/><bf gi="217" ue="175" us="175"/><bf gi="131" ue="176" us="176"/><bf gi="147" ue="177" us="177"/><bf gi="241" ue="179" us="178"/><bf gi="141" ue="180" us="180"/><bf gi="151" ue="181" us="181"/><bf gi="136" ue="182" us="182"/><bf gi="195" ue="183" us="183"/><bf gi="221" ue="184" us="184"/><bf gi="240" ue="185" us="185"/><bf gi="158" ue="186" us="186"/><bf gi="170" ue="187" us="187"/><bf gi="243" ue="190" us="188"/><bf gi="162" ue="191" us="191"/><bf gi="173" ue="192" us="192"/><bf gi="201" ue="193" us="193"/><bf gi="199" ue="194" us="194"/><bf gi="174" ue="195" us="195"/><bf gi="98" ue="197" us="196"/><bf gi="144" ue="198" us="198"/><bf gi="100" ue="199" us="199"/><bf gi="203" ue="200" us="200"/><bf gi="101" ue="201" us="201"/><bf gi="200" ue="202" us="202"/><bf gi="202" ue="203" us="203"/><bf gi="207" ue="204" us="204"/><bf gi="204" ue="207" us="205"/><bf gi="232" ue="208" us="208"/><bf gi="102" ue="209" us="209"/><bf gi="210" ue="210" us="210"/><bf gi="208" ue="212" us="211"/><bf gi="175" ue="213" us="213"/><bf gi="103" ue="214" us="214"/><bf gi="239" ue="215" us="215"/><bf gi="145" ue="216" us="216"/><bf gi="213" ue="217" us="217"/><bf gi="211" ue="219" us="218"/><bf gi="104" ue="220" us="220"/><bf gi="234" ue="221" us="221"/><bf gi="236" ue="222" us="222"/><bf gi="137" ue="223" us="223"/><bf gi="106" ue="224" us="224"/><bf gi="105" ue="225" us="225"/><bf gi="107" ue="226" us="226"/><bf gi="109" ue="227" us="227"/><bf gi="108" ue="228" us="228"/><bf gi="110" ue="229" us="229"/><bf gi="160" ue="230" us="230"/><bf gi="111" ue="231" us="231"/><bf gi="113" ue="232" us="232"/><bf gi="112" ue="233" us="233"/><bf gi="114" ue="235" us="234"/><bf gi="117" ue="236" us="236"/><bf gi="116" ue="237" us="237"/><bf gi="118" ue="239" us="238"/><bf gi="233" ue="240" us="240"/><bf gi="120" ue="241" us="241"/><bf gi="122" ue="242" us="242"/><bf gi="121" ue="243" us="243"/><bf gi="123" ue="244" us="244"/><bf gi="125" ue="245" us="245"/><bf gi="124" ue="246" us="246"/><bf gi="184" ue="247" us="247"/><bf gi="161" ue="248" us="248"/><bf gi="127" ue="249" us="249"/><bf gi="126" ue="250" us="250"/><bf gi="128" ue="252" us="251"/><bf gi="235" ue="253" us="253"/><bf gi="237" ue="254" us="254"/><bf gi="186" ue="255" us="255"/><bf gi="251" ue="263" us="262"/><bf gi="253" ue="269" us="268"/><bf gi="0" ue="270" us="270"/><bf gi="0" ue="271" us="271"/><bf gi="0" ue="272" us="272"/><bf gi="255" ue="273" us="273"/><bf gi="246" ue="287" us="286"/><bf gi="248" ue="304" us="304"/><bf gi="214" ue="305" us="305"/><bf gi="225" ue="322" us="321"/><bf gi="176" ue="339" us="338"/><bf gi="249" ue="351" us="350"/><bf gi="227" ue="353" us="352"/><bf gi="187" ue="376" us="376"/><bf gi="229" ue="382" us="381"/><bf gi="166" ue="402" us="402"/><bf gi="215" ue="710" us="710"/><bf gi="224" ue="711" us="711"/><bf gi="218" ue="730" us="728"/><bf gi="223" ue="731" us="731"/><bf gi="216" ue="732" us="732"/><bf gi="222" ue="733" us="733"/><bf gi="159" ue="937" us="937"/><bf gi="155" ue="960" us="960"/><bf gi="178" ue="8212" us="8211"/><bf gi="0" ue="8213" us="8213"/><bf gi="0" ue="8214" us="8214"/><bf gi="0" ue="8215" us="8215"/><bf gi="182" ue="8217" us="8216"/><bf gi="196" ue="8218" us="8218"/><bf gi="0" ue="8219" us="8219"/><bf gi="180" ue="8221" us="8220"/><bf gi="197" ue="8222" us="8222"/><bf gi="0" ue="8223" us="8223"/><bf gi="130" ue="8224" us="8224"/><bf gi="194" ue="8225" us="8225"/><bf gi="135" ue="8226" us="8226"/><bf gi="0" ue="8227" us="8227"/><bf gi="0" ue="8228" us="8228"/><bf gi="0" ue="8229" us="8229"/><bf gi="171" ue="8230" us="8230"/><bf gi="198" ue="8240" us="8240"/><bf gi="190" ue="8250" us="8249"/><bf gi="258" ue="8364" us="8364"/><bf gi="140" ue="8482" us="8482"/><bf gi="152" ue="8706" us="8706"/><bf gi="0" ue="8707" us="8707"/><bf gi="0" ue="8708" us="8708"/><bf gi="0" ue="8709" us="8709"/><bf gi="168" ue="8710" us="8710"/><bf gi="154" ue="8719" us="8719"/><bf gi="0" ue="8720" us="8720"/><bf gi="153" ue="8721" us="8721"/><bf gi="238" ue="8722" us="8722"/><bf gi="0" ue="8723" us="8723"/><bf gi="0" ue="8724" us="8724"/><bf gi="188" ue="8725" us="8725"/><bf gi="0" ue="8726" us="8726"/><bf gi="0" ue="8727" us="8727"/><bf gi="0" ue="8728" us="8728"/><bf gi="257" ue="8729" us="8729"/><bf gi="165" ue="8730" us="8730"/><bf gi="0" ue="8731" us="8731"/><bf gi="0" ue="8732" us="8732"/><bf gi="0" ue="8733" us="8733"/><bf gi="146" ue="8734" us="8734"/><bf gi="156" ue="8747" us="8747"/><bf gi="167" ue="8776" us="8776"/><bf gi="143" ue="8800" us="8800"/><bf gi="0" ue="8801" us="8801"/><bf gi="0" ue="8802" us="8802"/><bf gi="0" ue="8803" us="8803"/><bf gi="148" ue="8805" us="8804"/><bf gi="185" ue="9674" us="9674"/><bf gi="192" ue="64258" us="64257"/><bf gi="0" ue="65535" us="65535"/></bfranges><cid-widths start-index="0"><wx w="602"/><wx w="0"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/></cid-widths></multibyte-extras></font-metrics> \ No newline at end of file | |||
diff --git a/documentation/template/VeraMono.ttf b/documentation/template/VeraMono.ttf new file mode 100644 index 0000000..139f0b4 --- /dev/null +++ b/documentation/template/VeraMono.ttf | |||
Binary files differ | |||
diff --git a/documentation/template/VeraMono.xml b/documentation/template/VeraMono.xml new file mode 100644 index 0000000..3a0a866 --- /dev/null +++ b/documentation/template/VeraMono.xml | |||
@@ -0,0 +1 @@ | |||
<?xml version="1.0" encoding="UTF-8"?><font-metrics metrics-version="2" type="TYPE0"><font-name>BitstreamVeraSansMono-Roman</font-name><full-name>Bitstream Vera Sans Mono</full-name><family-name>Bitstream Vera Sans Mono</family-name><embed/><cap-height>729</cap-height><x-height>546</x-height><ascender>759</ascender><descender>-240</descender><bbox><left>-4</left><bottom>-235</bottom><right>605</right><top>928</top></bbox><flags>34</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="3" ue="126" us="32"/><bf gi="172" ue="160" us="160"/><bf gi="163" ue="161" us="161"/><bf gi="132" ue="163" us="162"/><bf gi="189" ue="164" us="164"/><bf gi="150" ue="165" us="165"/><bf gi="231" ue="166" us="166"/><bf gi="134" ue="167" us="167"/><bf gi="142" ue="168" us="168"/><bf gi="139" ue="169" us="169"/><bf gi="157" ue="170" us="170"/><bf gi="169" ue="171" us="171"/><bf gi="164" ue="172" us="172"/><bf gi="256" ue="173" us="173"/><bf gi="138" ue="174" us="174"/><bf gi="217" ue="175" us="175"/><bf gi="131" ue="176" us="176"/><bf gi="147" ue="177" us="177"/><bf gi="241" ue="179" us="178"/><bf gi="141" ue="180" us="180"/><bf gi="151" ue="181" us="181"/><bf gi="136" ue="182" us="182"/><bf gi="195" ue="183" us="183"/><bf gi="221" ue="184" us="184"/><bf gi="240" ue="185" us="185"/><bf gi="158" ue="186" us="186"/><bf gi="170" ue="187" us="187"/><bf gi="243" ue="190" us="188"/><bf gi="162" ue="191" us="191"/><bf gi="173" ue="192" us="192"/><bf gi="201" ue="193" us="193"/><bf gi="199" ue="194" us="194"/><bf gi="174" ue="195" us="195"/><bf gi="98" ue="197" us="196"/><bf gi="144" ue="198" us="198"/><bf gi="100" ue="199" us="199"/><bf gi="203" ue="200" us="200"/><bf gi="101" ue="201" us="201"/><bf gi="200" ue="202" us="202"/><bf gi="202" ue="203" us="203"/><bf gi="207" ue="204" us="204"/><bf gi="204" ue="207" us="205"/><bf gi="232" ue="208" us="208"/><bf gi="102" ue="209" us="209"/><bf gi="210" ue="210" us="210"/><bf gi="208" ue="212" us="211"/><bf gi="175" ue="213" us="213"/><bf gi="103" ue="214" us="214"/><bf gi="239" ue="215" us="215"/><bf gi="145" ue="216" us="216"/><bf gi="213" ue="217" us="217"/><bf gi="211" ue="219" us="218"/><bf gi="104" ue="220" us="220"/><bf gi="234" ue="221" us="221"/><bf gi="236" ue="222" us="222"/><bf gi="137" ue="223" us="223"/><bf gi="106" ue="224" us="224"/><bf gi="105" ue="225" us="225"/><bf gi="107" ue="226" us="226"/><bf gi="109" ue="227" us="227"/><bf gi="108" ue="228" us="228"/><bf gi="110" ue="229" us="229"/><bf gi="160" ue="230" us="230"/><bf gi="111" ue="231" us="231"/><bf gi="113" ue="232" us="232"/><bf gi="112" ue="233" us="233"/><bf gi="114" ue="235" us="234"/><bf gi="117" ue="236" us="236"/><bf gi="116" ue="237" us="237"/><bf gi="118" ue="239" us="238"/><bf gi="233" ue="240" us="240"/><bf gi="120" ue="241" us="241"/><bf gi="122" ue="242" us="242"/><bf gi="121" ue="243" us="243"/><bf gi="123" ue="244" us="244"/><bf gi="125" ue="245" us="245"/><bf gi="124" ue="246" us="246"/><bf gi="184" ue="247" us="247"/><bf gi="161" ue="248" us="248"/><bf gi="127" ue="249" us="249"/><bf gi="126" ue="250" us="250"/><bf gi="128" ue="252" us="251"/><bf gi="235" ue="253" us="253"/><bf gi="237" ue="254" us="254"/><bf gi="186" ue="255" us="255"/><bf gi="251" ue="263" us="262"/><bf gi="253" ue="269" us="268"/><bf gi="0" ue="270" us="270"/><bf gi="0" ue="271" us="271"/><bf gi="0" ue="272" us="272"/><bf gi="255" ue="273" us="273"/><bf gi="246" ue="287" us="286"/><bf gi="248" ue="304" us="304"/><bf gi="214" ue="305" us="305"/><bf gi="225" ue="322" us="321"/><bf gi="176" ue="339" us="338"/><bf gi="249" ue="351" us="350"/><bf gi="227" ue="353" us="352"/><bf gi="187" ue="376" us="376"/><bf gi="229" ue="382" us="381"/><bf gi="166" ue="402" us="402"/><bf gi="215" ue="710" us="710"/><bf gi="224" ue="711" us="711"/><bf gi="218" ue="730" us="728"/><bf gi="223" ue="731" us="731"/><bf gi="216" ue="732" us="732"/><bf gi="222" ue="733" us="733"/><bf gi="159" ue="937" us="937"/><bf gi="155" ue="960" us="960"/><bf gi="178" ue="8212" us="8211"/><bf gi="0" ue="8213" us="8213"/><bf gi="0" ue="8214" us="8214"/><bf gi="0" ue="8215" us="8215"/><bf gi="182" ue="8217" us="8216"/><bf gi="196" ue="8218" us="8218"/><bf gi="0" ue="8219" us="8219"/><bf gi="180" ue="8221" us="8220"/><bf gi="197" ue="8222" us="8222"/><bf gi="0" ue="8223" us="8223"/><bf gi="130" ue="8224" us="8224"/><bf gi="194" ue="8225" us="8225"/><bf gi="135" ue="8226" us="8226"/><bf gi="0" ue="8227" us="8227"/><bf gi="0" ue="8228" us="8228"/><bf gi="0" ue="8229" us="8229"/><bf gi="171" ue="8230" us="8230"/><bf gi="198" ue="8240" us="8240"/><bf gi="190" ue="8250" us="8249"/><bf gi="258" ue="8364" us="8364"/><bf gi="140" ue="8482" us="8482"/><bf gi="152" ue="8706" us="8706"/><bf gi="0" ue="8707" us="8707"/><bf gi="0" ue="8708" us="8708"/><bf gi="0" ue="8709" us="8709"/><bf gi="168" ue="8710" us="8710"/><bf gi="154" ue="8719" us="8719"/><bf gi="0" ue="8720" us="8720"/><bf gi="153" ue="8721" us="8721"/><bf gi="238" ue="8722" us="8722"/><bf gi="0" ue="8723" us="8723"/><bf gi="0" ue="8724" us="8724"/><bf gi="188" ue="8725" us="8725"/><bf gi="0" ue="8726" us="8726"/><bf gi="0" ue="8727" us="8727"/><bf gi="0" ue="8728" us="8728"/><bf gi="257" ue="8729" us="8729"/><bf gi="165" ue="8730" us="8730"/><bf gi="0" ue="8731" us="8731"/><bf gi="0" ue="8732" us="8732"/><bf gi="0" ue="8733" us="8733"/><bf gi="146" ue="8734" us="8734"/><bf gi="156" ue="8747" us="8747"/><bf gi="167" ue="8776" us="8776"/><bf gi="143" ue="8800" us="8800"/><bf gi="0" ue="8801" us="8801"/><bf gi="0" ue="8802" us="8802"/><bf gi="0" ue="8803" us="8803"/><bf gi="148" ue="8805" us="8804"/><bf gi="185" ue="9674" us="9674"/><bf gi="192" ue="64258" us="64257"/><bf gi="0" ue="65535" us="65535"/></bfranges><cid-widths start-index="0"><wx w="602"/><wx w="0"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/></cid-widths></multibyte-extras></font-metrics> \ No newline at end of file | |||
diff --git a/documentation/template/component.title.xsl b/documentation/template/component.title.xsl new file mode 100644 index 0000000..ee21d59 --- /dev/null +++ b/documentation/template/component.title.xsl | |||
@@ -0,0 +1,39 @@ | |||
1 | <xsl:stylesheet version="1.0" | ||
2 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
3 | xmlns:d="http://docbook.org/ns/docbook" | ||
4 | xmlns="http://www.w3.org/1999/xhtml" | ||
5 | exclude-result-prefixes="d"> | ||
6 | |||
7 | <xsl:template name="component.title"> | ||
8 | <xsl:param name="node" select="."/> | ||
9 | |||
10 | <xsl:variable name="level"> | ||
11 | <xsl:choose> | ||
12 | <xsl:when test="ancestor::d:section"> | ||
13 | <xsl:value-of select="count(ancestor::d:section)+1"/> | ||
14 | </xsl:when> | ||
15 | <xsl:when test="ancestor::sect5">6</xsl:when> | ||
16 | <xsl:when test="ancestor::sect4">5</xsl:when> | ||
17 | <xsl:when test="ancestor::sect3">4</xsl:when> | ||
18 | <xsl:when test="ancestor::sect2">3</xsl:when> | ||
19 | <xsl:when test="ancestor::sect1">2</xsl:when> | ||
20 | <xsl:otherwise>1</xsl:otherwise> | ||
21 | </xsl:choose> | ||
22 | </xsl:variable> | ||
23 | <xsl:element name="h{$level+1}" namespace="http://www.w3.org/1999/xhtml"> | ||
24 | <xsl:attribute name="class">title</xsl:attribute> | ||
25 | <xsl:if test="$generate.id.attributes = 0"> | ||
26 | <xsl:call-template name="anchor"> | ||
27 | <xsl:with-param name="node" select="$node"/> | ||
28 | <xsl:with-param name="conditional" select="0"/> | ||
29 | </xsl:call-template> | ||
30 | </xsl:if> | ||
31 | <xsl:apply-templates select="$node" mode="object.title.markup"> | ||
32 | <xsl:with-param name="allow-anchors" select="1"/> | ||
33 | </xsl:apply-templates> | ||
34 | <xsl:call-template name="permalink"> | ||
35 | <xsl:with-param name="node" select="$node"/> | ||
36 | </xsl:call-template> | ||
37 | </xsl:element> | ||
38 | </xsl:template> | ||
39 | </xsl:stylesheet> | ||
diff --git a/documentation/template/division.title.xsl b/documentation/template/division.title.xsl new file mode 100644 index 0000000..8cd70a5 --- /dev/null +++ b/documentation/template/division.title.xsl | |||
@@ -0,0 +1,24 @@ | |||
1 | <xsl:stylesheet version="1.0" | ||
2 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
3 | xmlns:d="http://docbook.org/ns/docbook" | ||
4 | xmlns="http://www.w3.org/1999/xhtml" | ||
5 | exclude-result-prefixes="d"> | ||
6 | |||
7 | <xsl:template name="division.title"> | ||
8 | <xsl:param name="node" select="."/> | ||
9 | |||
10 | <h1> | ||
11 | <xsl:attribute name="class">title</xsl:attribute> | ||
12 | <xsl:call-template name="anchor"> | ||
13 | <xsl:with-param name="node" select="$node"/> | ||
14 | <xsl:with-param name="conditional" select="0"/> | ||
15 | </xsl:call-template> | ||
16 | <xsl:apply-templates select="$node" mode="object.title.markup"> | ||
17 | <xsl:with-param name="allow-anchors" select="1"/> | ||
18 | </xsl:apply-templates> | ||
19 | <xsl:call-template name="permalink"> | ||
20 | <xsl:with-param name="node" select="$node"/> | ||
21 | </xsl:call-template> | ||
22 | </h1> | ||
23 | </xsl:template> | ||
24 | </xsl:stylesheet> \ No newline at end of file | ||
diff --git a/documentation/template/draft.png b/documentation/template/draft.png new file mode 100644 index 0000000..53051a9 --- /dev/null +++ b/documentation/template/draft.png | |||
Binary files differ | |||
diff --git a/documentation/template/fop-config.xml b/documentation/template/fop-config.xml new file mode 100644 index 0000000..09cc5ca --- /dev/null +++ b/documentation/template/fop-config.xml | |||
@@ -0,0 +1,58 @@ | |||
1 | <fop version="1.0"> | ||
2 | |||
3 | <!-- Strict user configuration --> | ||
4 | <strict-configuration>true</strict-configuration> | ||
5 | |||
6 | <!-- Strict FO validation --> | ||
7 | <strict-validation>true</strict-validation> | ||
8 | |||
9 | <!-- | ||
10 | Set the baseDir so common/openedhand.svg references in plans still | ||
11 | work ok. Note, relative file references to current dir should still work. | ||
12 | --> | ||
13 | <base>../template</base> | ||
14 | <font-base>../template</font-base> | ||
15 | |||
16 | <!-- Source resolution in dpi (dots/pixels per inch) for determining the | ||
17 | size of pixels in SVG and bitmap images, default: 72dpi --> | ||
18 | <!-- <source-resolution>72</source-resolution> --> | ||
19 | <!-- Target resolution in dpi (dots/pixels per inch) for specifying the | ||
20 | target resolution for generated bitmaps, default: 72dpi --> | ||
21 | <!-- <target-resolution>72</target-resolution> --> | ||
22 | |||
23 | <!-- default page-height and page-width, in case | ||
24 | value is specified as auto --> | ||
25 | <default-page-settings height="11in" width="8.26in"/> | ||
26 | |||
27 | <!-- <use-cache>false</use-cache> --> | ||
28 | |||
29 | <renderers> | ||
30 | <renderer mime="application/pdf"> | ||
31 | <fonts> | ||
32 | <font metrics-file="VeraMono.xml" | ||
33 | kerning="yes" | ||
34 | embed-url="VeraMono.ttf"> | ||
35 | <font-triplet name="veramono" style="normal" weight="normal"/> | ||
36 | </font> | ||
37 | |||
38 | <font metrics-file="VeraMoBd.xml" | ||
39 | kerning="yes" | ||
40 | embed-url="VeraMoBd.ttf"> | ||
41 | <font-triplet name="veramono" style="normal" weight="bold"/> | ||
42 | </font> | ||
43 | |||
44 | <font metrics-file="Vera.xml" | ||
45 | kerning="yes" | ||
46 | embed-url="Vera.ttf"> | ||
47 | <font-triplet name="verasans" style="normal" weight="normal"/> | ||
48 | <font-triplet name="verasans" style="normal" weight="bold"/> | ||
49 | <font-triplet name="verasans" style="italic" weight="normal"/> | ||
50 | <font-triplet name="verasans" style="italic" weight="bold"/> | ||
51 | </font> | ||
52 | |||
53 | <auto-detect/> | ||
54 | </fonts> | ||
55 | </renderer> | ||
56 | </renderers> | ||
57 | </fop> | ||
58 | |||
diff --git a/documentation/template/formal.object.heading.xsl b/documentation/template/formal.object.heading.xsl new file mode 100644 index 0000000..4f3900d --- /dev/null +++ b/documentation/template/formal.object.heading.xsl | |||
@@ -0,0 +1,21 @@ | |||
1 | <xsl:stylesheet version="1.0" | ||
2 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
3 | xmlns:d="http://docbook.org/ns/docbook" | ||
4 | xmlns="http://www.w3.org/1999/xhtml" | ||
5 | exclude-result-prefixes="d"> | ||
6 | |||
7 | <xsl:template name="formal.object.heading"> | ||
8 | <xsl:param name="object" select="."/> | ||
9 | <xsl:param name="title"> | ||
10 | <xsl:apply-templates select="$object" mode="object.title.markup"> | ||
11 | <xsl:with-param name="allow-anchors" select="1"/> | ||
12 | </xsl:apply-templates> | ||
13 | </xsl:param> | ||
14 | <p class="title"> | ||
15 | <b><xsl:copy-of select="$title"/></b> | ||
16 | <xsl:call-template name="permalink"> | ||
17 | <xsl:with-param name="node" select="$object"/> | ||
18 | </xsl:call-template> | ||
19 | </p> | ||
20 | </xsl:template> | ||
21 | </xsl:stylesheet> \ No newline at end of file | ||
diff --git a/documentation/template/gloss-permalinks.xsl b/documentation/template/gloss-permalinks.xsl new file mode 100644 index 0000000..6bf5811 --- /dev/null +++ b/documentation/template/gloss-permalinks.xsl | |||
@@ -0,0 +1,14 @@ | |||
1 | <xsl:stylesheet version="1.0" | ||
2 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
3 | xmlns:d="http://docbook.org/ns/docbook" | ||
4 | xmlns="http://www.w3.org/1999/xhtml"> | ||
5 | |||
6 | <xsl:template match="glossentry/glossterm"> | ||
7 | <xsl:apply-imports/> | ||
8 | <xsl:if test="$generate.permalink != 0"> | ||
9 | <xsl:call-template name="permalink"> | ||
10 | <xsl:with-param name="node" select=".."/> | ||
11 | </xsl:call-template> | ||
12 | </xsl:if> | ||
13 | </xsl:template> | ||
14 | </xsl:stylesheet> | ||
diff --git a/documentation/template/ohand-color.svg b/documentation/template/ohand-color.svg new file mode 100644 index 0000000..e42ff9c --- /dev/null +++ b/documentation/template/ohand-color.svg | |||
@@ -0,0 +1,150 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||
3 | <svg | ||
4 | xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
5 | xmlns:cc="http://web.resource.org/cc/" | ||
6 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
7 | xmlns:svg="http://www.w3.org/2000/svg" | ||
8 | xmlns="http://www.w3.org/2000/svg" | ||
9 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
10 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
11 | width="141.17999" | ||
12 | height="55.34" | ||
13 | id="svg2207" | ||
14 | sodipodi:version="0.32" | ||
15 | inkscape:version="0.45" | ||
16 | version="1.0" | ||
17 | sodipodi:docname="ohand-color.svg" | ||
18 | inkscape:output_extension="org.inkscape.output.svg.inkscape" | ||
19 | sodipodi:docbase="/home/mallum/Projects/admin/oh-doc-tools/common" | ||
20 | sodipodi:modified="true"> | ||
21 | <defs | ||
22 | id="defs3" /> | ||
23 | <sodipodi:namedview | ||
24 | id="base" | ||
25 | pagecolor="#ffffff" | ||
26 | bordercolor="#666666" | ||
27 | borderopacity="1.0" | ||
28 | inkscape:pageopacity="0.0" | ||
29 | inkscape:pageshadow="2" | ||
30 | inkscape:zoom="1.2" | ||
31 | inkscape:cx="160" | ||
32 | inkscape:cy="146.21189" | ||
33 | inkscape:document-units="mm" | ||
34 | inkscape:current-layer="layer1" | ||
35 | height="55.34px" | ||
36 | width="141.18px" | ||
37 | inkscape:window-width="772" | ||
38 | inkscape:window-height="581" | ||
39 | inkscape:window-x="5" | ||
40 | inkscape:window-y="48" /> | ||
41 | <metadata | ||
42 | id="metadata2211"> | ||
43 | <rdf:RDF> | ||
44 | <cc:Work | ||
45 | rdf:about=""> | ||
46 | <dc:format>image/svg+xml</dc:format> | ||
47 | <dc:type | ||
48 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||
49 | </cc:Work> | ||
50 | </rdf:RDF> | ||
51 | </metadata> | ||
52 | <g | ||
53 | inkscape:label="Layer 1" | ||
54 | inkscape:groupmode="layer" | ||
55 | id="layer1"> | ||
56 | <g | ||
57 | id="g2094" | ||
58 | style="fill:#6d6d70;fill-opacity:1" | ||
59 | inkscape:export-filename="/home/mallum/Desktop/g2126.png" | ||
60 | inkscape:export-xdpi="312.71841" | ||
61 | inkscape:export-ydpi="312.71841" | ||
62 | transform="matrix(0.5954767,0,0,0.5954767,31.793058,-18.471052)"> | ||
63 | <g | ||
64 | id="g19" | ||
65 | style="fill:#6d6d70;fill-opacity:1"> | ||
66 | <path | ||
67 | style="fill:#6d6d70;fill-opacity:1" | ||
68 | id="path21" | ||
69 | d="M 48.693,50.633 C 40.282,50.633 33.439,57.477 33.439,65.888 L 33.439,81.142 L 41.066,81.142 L 41.066,65.888 C 41.066,61.684 44.486,58.261 48.692,58.261 C 52.897,58.261 56.32,61.684 56.32,65.888 C 56.32,70.093 52.897,73.516 48.692,73.516 C 45.677,73.516 43.065,71.756 41.828,69.211 L 41.828,79.504 C 43.892,80.549 46.224,81.142 48.692,81.142 C 57.103,81.142 63.947,74.3 63.947,65.888 C 63.948,57.477 57.104,50.633 48.693,50.633 z " /> | ||
70 | </g> | ||
71 | <path | ||
72 | style="fill:#6d6d70;fill-opacity:1" | ||
73 | id="path23" | ||
74 | d="M 18.486,50.557 C 26.942,50.557 33.819,57.435 33.819,65.888 C 33.819,74.344 26.942,81.223 18.486,81.223 C 10.032,81.223 3.152,74.344 3.152,65.888 C 3.152,57.435 10.032,50.557 18.486,50.557 z M 18.486,73.556 C 22.713,73.556 26.153,70.118 26.153,65.888 C 26.153,61.661 22.713,58.222 18.486,58.222 C 14.258,58.222 10.819,61.661 10.819,65.888 C 10.82,70.117 14.259,73.556 18.486,73.556 z " /> | ||
75 | <path | ||
76 | style="fill:#6d6d70;fill-opacity:1" | ||
77 | id="path25" | ||
78 | d="M 94.074,107.465 L 94.074,96.016 C 94.074,87.605 87.233,80.763 78.822,80.763 C 70.41,80.763 63.567,87.605 63.567,96.016 C 63.567,104.427 70.41,111.269 78.822,111.269 C 81.289,111.269 83.621,110.676 85.685,109.631 L 85.685,99.339 C 84.448,101.885 81.836,103.644 78.822,103.644 C 74.615,103.644 71.194,100.221 71.194,96.016 C 71.194,91.81 74.615,88.388 78.822,88.388 C 83.026,88.388 86.448,91.81 86.448,96.016 L 86.448,107.456 C 86.448,109.562 88.156,111.268 90.262,111.268 C 92.364,111.269 94.068,109.566 94.074,107.465 z " /> | ||
79 | <path | ||
80 | style="fill:#6d6d70;fill-opacity:1" | ||
81 | id="path27" | ||
82 | d="M 124.197,95.814 C 124.088,87.496 117.293,80.762 108.949,80.762 C 100.59,80.762 93.783,87.52 93.697,95.856 L 93.693,95.856 L 93.695,107.456 C 93.695,109.562 95.402,111.268 97.509,111.268 C 99.611,111.268 101.316,109.566 101.321,107.464 L 101.321,95.994 L 101.321,95.994 C 101.333,91.798 104.747,88.388 108.948,88.388 C 113.147,88.388 116.563,91.798 116.575,95.994 L 116.575,107.456 C 116.575,109.562 118.282,111.268 120.387,111.268 C 122.492,111.268 124.201,109.562 124.201,107.456 L 124.201,95.814 L 124.197,95.814 z " /> | ||
83 | <path | ||
84 | style="fill:#6d6d70;fill-opacity:1" | ||
85 | id="path29" | ||
86 | d="M 63.946,96.005 L 63.946,95.854 L 63.943,95.854 L 63.943,95.815 L 63.942,95.815 C 63.833,87.497 57.037,80.761 48.693,80.761 C 48.682,80.761 48.671,80.763 48.658,80.763 C 48.382,80.763 48.107,80.772 47.833,80.786 C 47.75,80.791 47.668,80.799 47.586,80.806 C 47.378,80.822 47.172,80.838 46.968,80.862 C 46.884,80.873 46.801,80.882 46.719,80.893 C 46.508,80.92 46.298,80.952 46.091,80.987 C 46.024,80.999 45.958,81.01 45.891,81.024 C 45.649,81.068 45.406,81.119 45.168,81.175 C 45.14,81.183 45.112,81.189 45.085,81.195 C 43.656,81.542 42.306,82.092 41.065,82.812 L 41.065,80.761 L 33.438,80.761 L 33.438,95.857 L 33.435,95.857 L 33.435,107.457 C 33.435,109.563 35.142,111.269 37.248,111.269 C 39.093,111.269 40.632,109.958 40.984,108.217 C 41.036,107.963 41.065,107.702 41.065,107.435 L 41.065,95.873 C 41.086,94.732 41.357,93.65 41.828,92.685 L 41.828,92.693 C 42.598,91.106 43.905,89.824 45.511,89.085 C 45.519,89.08 45.529,89.076 45.536,89.073 C 45.849,88.928 46.174,88.807 46.508,88.707 C 46.523,88.704 46.536,88.699 46.55,88.696 C 46.699,88.651 46.85,88.614 47.004,88.576 C 47.025,88.575 47.046,88.567 47.069,88.562 C 47.234,88.527 47.402,88.495 47.572,88.469 C 47.586,88.468 47.6,88.466 47.615,88.463 C 47.763,88.443 47.916,88.427 48.067,88.415 C 48.106,88.41 48.145,88.407 48.186,88.404 C 48.352,88.393 48.52,88.386 48.691,88.386 C 52.888,88.387 56.304,91.797 56.316,95.992 L 56.316,107.454 C 56.316,109.56 58.023,111.266 60.13,111.266 C 61.976,111.266 63.516,109.954 63.867,108.211 C 63.919,107.963 63.946,107.706 63.946,107.442 L 63.946,96.024 C 63.946,96.021 63.947,96.018 63.947,96.015 C 63.948,96.011 63.946,96.008 63.946,96.005 z " /> | ||
87 | <path | ||
88 | style="fill:#6d6d70;fill-opacity:1" | ||
89 | id="path31" | ||
90 | d="M 180.644,50.633 C 178.539,50.633 176.832,52.341 176.832,54.447 L 176.832,65.887 C 176.832,70.092 173.41,73.513 169.203,73.513 C 164.998,73.513 161.576,70.092 161.576,65.887 C 161.576,61.683 164.998,58.26 169.203,58.26 C 172.219,58.26 174.83,60.019 176.068,62.565 L 176.068,52.271 C 174.004,51.225 171.673,50.632 169.203,50.632 C 160.793,50.632 153.951,57.476 153.951,65.887 C 153.951,74.298 160.793,81.141 169.203,81.141 C 177.615,81.141 184.459,74.298 184.459,65.887 L 184.459,54.447 C 184.458,52.341 182.751,50.633 180.644,50.633 z " /> | ||
91 | <path | ||
92 | style="fill:#6d6d70;fill-opacity:1" | ||
93 | id="path33" | ||
94 | d="M 124.203,77.339 L 124.203,65.687 L 124.197,65.687 C 124.088,57.371 117.293,50.633 108.949,50.633 C 100.592,50.633 93.783,57.393 93.697,65.731 L 93.695,65.731 L 93.695,65.877 C 93.695,65.882 93.693,65.885 93.693,65.888 C 93.693,65.891 93.695,65.896 93.695,65.899 L 93.695,77.33 C 93.695,79.435 95.402,81.142 97.509,81.142 C 99.614,81.142 101.321,79.435 101.321,77.33 L 101.321,65.868 C 101.333,61.672 104.747,58.261 108.948,58.261 C 113.147,58.261 116.563,61.672 116.575,65.868 L 116.575,65.868 L 116.575,77.329 C 116.575,79.434 118.282,81.141 120.389,81.141 C 122.492,81.142 124.197,79.44 124.203,77.339 z " /> | ||
95 | <path | ||
96 | style="fill:#6d6d70;fill-opacity:1" | ||
97 | id="path35" | ||
98 | d="M 150.517,80.761 C 148.41,80.761 146.703,82.469 146.703,84.575 L 146.703,96.015 C 146.703,100.22 143.283,103.643 139.076,103.643 C 134.871,103.643 131.449,100.22 131.449,96.015 C 131.449,91.808 134.871,88.387 139.076,88.387 C 142.092,88.387 144.703,90.145 145.941,92.692 L 145.941,82.397 C 143.875,81.353 141.545,80.76 139.076,80.76 C 130.666,80.76 123.822,87.604 123.822,96.015 C 123.822,104.426 130.666,111.268 139.076,111.268 C 147.486,111.268 154.33,104.426 154.33,96.015 L 154.33,84.575 C 154.33,82.469 152.623,80.761 150.517,80.761 z " /> | ||
99 | <path | ||
100 | style="fill:#6d6d70;fill-opacity:1" | ||
101 | id="path37" | ||
102 | d="M 82.625,77.345 C 82.625,75.247 80.923,73.547 78.826,73.547 L 78.826,81.142 C 80.922,81.142 82.625,79.442 82.625,77.345 z " /> | ||
103 | <path | ||
104 | style="fill:#6d6d70;fill-opacity:1" | ||
105 | id="path39" | ||
106 | d="M 90.252,69.685 C 92.35,69.685 94.048,67.987 94.048,65.888 L 86.453,65.888 C 86.453,67.986 88.154,69.685 90.252,69.685 z " /> | ||
107 | <path | ||
108 | style="fill:#6d6d70;fill-opacity:1" | ||
109 | id="path41" | ||
110 | d="M 93.832,77.329 C 93.832,75.223 92.125,73.516 90.018,73.516 L 78.825,73.516 C 74.619,73.516 71.199,70.093 71.199,65.888 C 71.199,61.684 74.619,58.261 78.825,58.261 C 83.032,58.261 86.453,61.684 86.453,65.888 C 86.453,68.904 84.694,71.514 82.149,72.752 L 92.442,72.752 C 93.488,70.689 94.08,68.356 94.08,65.888 C 94.08,57.477 87.237,50.633 78.826,50.633 C 70.415,50.633 63.571,57.477 63.571,65.888 C 63.571,74.3 70.415,81.142 78.826,81.142 L 90.018,81.142 C 92.125,81.142 93.832,79.435 93.832,77.329 z " /> | ||
111 | <path | ||
112 | style="fill:#6d6d70;fill-opacity:1" | ||
113 | id="path43" | ||
114 | d="M 142.869,77.345 C 142.869,75.247 141.168,73.547 139.07,73.547 L 139.07,81.142 C 141.167,81.142 142.869,79.442 142.869,77.345 z " /> | ||
115 | <path | ||
116 | style="fill:#6d6d70;fill-opacity:1" | ||
117 | id="path45" | ||
118 | d="M 150.496,69.685 C 152.594,69.685 154.293,67.987 154.293,65.888 L 146.699,65.888 C 146.699,67.986 148.398,69.685 150.496,69.685 z " /> | ||
119 | <path | ||
120 | style="fill:#6d6d70;fill-opacity:1" | ||
121 | id="path47" | ||
122 | d="M 154.076,77.329 C 154.076,75.223 152.367,73.516 150.262,73.516 L 139.07,73.516 C 134.865,73.516 131.443,70.093 131.443,65.888 C 131.443,61.684 134.865,58.261 139.07,58.261 C 143.275,58.261 146.699,61.684 146.699,65.888 C 146.699,68.904 144.939,71.514 142.392,72.752 L 152.687,72.752 C 153.73,70.689 154.324,68.356 154.324,65.888 C 154.324,57.477 147.48,50.633 139.07,50.633 C 130.66,50.633 123.816,57.477 123.816,65.888 C 123.816,74.3 130.66,81.142 139.07,81.142 L 150.261,81.142 C 152.367,81.142 154.076,79.435 154.076,77.329 z " /> | ||
123 | </g> | ||
124 | <g | ||
125 | id="g2126" | ||
126 | transform="matrix(0.7679564,0,0,0.7679564,-66.520631,11.42903)" | ||
127 | inkscape:export-xdpi="312.71841" | ||
128 | inkscape:export-ydpi="312.71841" | ||
129 | style="fill:#35992a;fill-opacity:1"> | ||
130 | <g | ||
131 | transform="translate(86.33975,4.23985e-2)" | ||
132 | style="fill:#35992a;fill-opacity:1" | ||
133 | id="g2114"> | ||
134 | <g | ||
135 | style="fill:#35992a;fill-opacity:1" | ||
136 | id="g2116"> | ||
137 | <path | ||
138 | id="path2118" | ||
139 | transform="translate(-86.33975,-4.239934e-2)" | ||
140 | d="M 89.96875,0.03125 C 87.962748,0.031250001 86.34375,1.6815001 86.34375,3.6875 L 86.34375,17.71875 L 86.34375,19.6875 L 86.34375,28.90625 C 86.343752,39.06825 94.61925,47.34375 104.78125,47.34375 L 113.375,47.34375 L 123.1875,47.34375 L 127.15625,47.34375 C 129.16325,47.343749 130.8125,45.72475 130.8125,43.71875 C 130.8125,41.71275 129.16325,40.09375 127.15625,40.09375 L 123.1875,40.09375 L 123.1875,19.6875 L 123.1875,14.65625 L 123.1875,3.6875 C 123.1875,1.6815 121.5675,0.03125 119.5625,0.03125 C 117.5555,0.031250001 115.9375,1.6815001 115.9375,3.6875 L 115.9375,14.28125 C 115.1185,13.65425 114.26275,13.109 113.34375,12.625 L 113.34375,3.6875 C 113.34475,1.6815 111.6925,0.03125 109.6875,0.03125 C 107.6825,0.031250001 106.0625,1.6815001 106.0625,3.6875 L 106.0625,10.5625 C 105.6305,10.5325 105.22025,10.5 104.78125,10.5 C 104.34125,10.5 103.90075,10.5325 103.46875,10.5625 L 103.46875,3.6875 C 103.46975,1.6815 101.84975,0.03125 99.84375,0.03125 C 97.837749,0.031250001 96.21875,1.6815001 96.21875,3.6875 L 96.21875,12.625 C 95.299754,13.109 94.41375,13.65425 93.59375,14.28125 L 93.59375,3.6875 C 93.59475,1.6815 91.97475,0.03125 89.96875,0.03125 z M 104.78125,14.34375 C 112.80825,14.34375 119.3125,20.87925 119.3125,28.90625 C 119.3125,36.93325 112.80825,43.46875 104.78125,43.46875 C 96.754254,43.46875 90.21875,36.93425 90.21875,28.90625 C 90.218752,20.87825 96.753253,14.34375 104.78125,14.34375 z " | ||
141 | style="fill:#35992a;fill-opacity:1" /> | ||
142 | </g> | ||
143 | </g> | ||
144 | <path | ||
145 | style="fill:#35992a;fill-opacity:1" | ||
146 | id="path2122" | ||
147 | d="M 112.04875,28.913399 C 112.04875,24.899399 108.78275,21.634399 104.76975,21.634399 C 100.75675,21.634399 97.490753,24.900399 97.490753,28.913399 C 97.490753,32.926399 100.75675,36.192399 104.76975,36.192399 C 108.78275,36.192399 112.04875,32.927399 112.04875,28.913399 z " /> | ||
148 | </g> | ||
149 | </g> | ||
150 | </svg> | ||
diff --git a/documentation/template/permalinks.xsl b/documentation/template/permalinks.xsl new file mode 100644 index 0000000..d2a1c14 --- /dev/null +++ b/documentation/template/permalinks.xsl | |||
@@ -0,0 +1,25 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <xsl:stylesheet version="1.0" | ||
3 | xmlns="http://www.w3.org/1999/xhtml" | ||
4 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | ||
5 | |||
6 | <xsl:param name="generate.permalink" select="1"/> | ||
7 | <xsl:param name="permalink.text">¶</xsl:param> | ||
8 | |||
9 | <xsl:template name="permalink"> | ||
10 | <xsl:param name="node"/> | ||
11 | |||
12 | <xsl:if test="$generate.permalink != '0'"> | ||
13 | <span class="permalink"> | ||
14 | <a alt="Permalink" title="Permalink"> | ||
15 | <xsl:attribute name="href"> | ||
16 | <xsl:call-template name="href.target"> | ||
17 | <xsl:with-param name="object" select="$node"/> | ||
18 | </xsl:call-template> | ||
19 | </xsl:attribute> | ||
20 | <xsl:copy-of select="$permalink.text"/> | ||
21 | </a> | ||
22 | </span> | ||
23 | </xsl:if> | ||
24 | </xsl:template> | ||
25 | </xsl:stylesheet> | ||
diff --git a/documentation/template/poky-db-pdf.xsl b/documentation/template/poky-db-pdf.xsl new file mode 100644 index 0000000..f8a3df1 --- /dev/null +++ b/documentation/template/poky-db-pdf.xsl | |||
@@ -0,0 +1,64 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> | ||
3 | |||
4 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" /> | ||
5 | |||
6 | <!-- check project-plan.sh for how this is generated, needed to tweak | ||
7 | the cover page | ||
8 | --> | ||
9 | <xsl:include href="/tmp/titlepage.xsl"/> | ||
10 | |||
11 | <!-- To force a page break in document, i.e per section add a | ||
12 | <?hard-pagebreak?> tag. | ||
13 | --> | ||
14 | <xsl:template match="processing-instruction('hard-pagebreak')"> | ||
15 | <fo:block break-before='page' /> | ||
16 | </xsl:template> | ||
17 | |||
18 | <!--Fix for defualt indent getting TOC all wierd.. | ||
19 | See http://sources.redhat.com/ml/docbook-apps/2005-q1/msg00455.html | ||
20 | FIXME: must be a better fix | ||
21 | --> | ||
22 | <xsl:param name="body.start.indent" select="'0'"/> | ||
23 | <!--<xsl:param name="title.margin.left" select="'0'"/>--> | ||
24 | |||
25 | <!-- stop long-ish header titles getting wrapped --> | ||
26 | <xsl:param name="header.column.widths">1 10 1</xsl:param> | ||
27 | |||
28 | <!-- customise headers and footers a little --> | ||
29 | |||
30 | <xsl:template name="head.sep.rule"> | ||
31 | <xsl:if test="$header.rule != 0"> | ||
32 | <xsl:attribute name="border-bottom-width">0.5pt</xsl:attribute> | ||
33 | <xsl:attribute name="border-bottom-style">solid</xsl:attribute> | ||
34 | <xsl:attribute name="border-bottom-color">#999999</xsl:attribute> | ||
35 | </xsl:if> | ||
36 | </xsl:template> | ||
37 | |||
38 | <xsl:template name="foot.sep.rule"> | ||
39 | <xsl:if test="$footer.rule != 0"> | ||
40 | <xsl:attribute name="border-top-width">0.5pt</xsl:attribute> | ||
41 | <xsl:attribute name="border-top-style">solid</xsl:attribute> | ||
42 | <xsl:attribute name="border-top-color">#999999</xsl:attribute> | ||
43 | </xsl:if> | ||
44 | </xsl:template> | ||
45 | |||
46 | <xsl:attribute-set name="header.content.properties"> | ||
47 | <xsl:attribute name="color">#999999</xsl:attribute> | ||
48 | </xsl:attribute-set> | ||
49 | |||
50 | <xsl:attribute-set name="footer.content.properties"> | ||
51 | <xsl:attribute name="color">#999999</xsl:attribute> | ||
52 | </xsl:attribute-set> | ||
53 | |||
54 | |||
55 | <!-- general settings --> | ||
56 | |||
57 | <xsl:param name="fop1.extensions" select="1"></xsl:param> | ||
58 | <xsl:param name="paper.type" select="'A4'"></xsl:param> | ||
59 | <xsl:param name="section.autolabel" select="1"></xsl:param> | ||
60 | <xsl:param name="body.font.family" select="'verasans'"></xsl:param> | ||
61 | <xsl:param name="title.font.family" select="'verasans'"></xsl:param> | ||
62 | <xsl:param name="monospace.font.family" select="'veramono'"></xsl:param> | ||
63 | |||
64 | </xsl:stylesheet> | ||
diff --git a/documentation/template/poky-ref-manual.png b/documentation/template/poky-ref-manual.png new file mode 100644 index 0000000..2085edb --- /dev/null +++ b/documentation/template/poky-ref-manual.png | |||
Binary files differ | |||
diff --git a/documentation/template/poky.svg b/documentation/template/poky.svg new file mode 100644 index 0000000..a4ea5e2 --- /dev/null +++ b/documentation/template/poky.svg | |||
@@ -0,0 +1,163 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
2 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||
3 | <svg | ||
4 | xmlns:svg="http://www.w3.org/2000/svg" | ||
5 | xmlns="http://www.w3.org/2000/svg" | ||
6 | version="1.0" | ||
7 | width="158.56076" | ||
8 | height="79.284424" | ||
9 | viewBox="-40.981 -92.592 300 300" | ||
10 | id="svg2" | ||
11 | xml:space="preserve"> | ||
12 | <defs | ||
13 | id="defs4"> | ||
14 | </defs> | ||
15 | <path | ||
16 | d="M -36.585379,54.412576 L -36.585379,54.421305 L -36.582469,54.421305 L -36.582469,54.243829 C -36.57956,54.302018 -36.585379,54.357297 -36.585379,54.412576 z " | ||
17 | style="fill:#6ac7bd" | ||
18 | id="path6" /> | ||
19 | <g | ||
20 | transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)" | ||
21 | style="opacity:0.65" | ||
22 | id="g8"> | ||
23 | <g | ||
24 | id="g10"> | ||
25 | <path | ||
26 | d="M 24.482,23.998 L 24.482,23.995 C 10.961,23.994 0,34.955 0,48.476 L 0.001,48.479 L 0.001,48.482 C 0.003,62.001 10.962,72.96 24.482,72.96 L 24.482,72.96 L 0,72.96 L 0,97.442 L 0.003,97.442 C 13.523,97.44 24.482,86.48 24.482,72.961 L 24.485,72.961 C 38.005,72.959 48.963,62 48.963,48.479 L 48.963,48.476 C 48.962,34.957 38.001,23.998 24.482,23.998 z M 24.482,50.928 C 23.13,50.928 22.034,49.832 22.034,48.48 C 22.034,47.128 23.13,46.032 24.482,46.032 C 25.834,46.032 26.93,47.128 26.93,48.48 C 26.93,49.832 25.834,50.928 24.482,50.928 z " | ||
27 | style="fill:#ef412a" | ||
28 | id="path12" /> | ||
29 | </g> | ||
30 | </g> | ||
31 | <g | ||
32 | transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)" | ||
33 | style="opacity:0.65" | ||
34 | id="g14"> | ||
35 | <g | ||
36 | id="g16"> | ||
37 | <path | ||
38 | d="M 119.96,48.842 C 120.024,47.548 121.086,46.516 122.397,46.516 C 123.707,46.516 124.768,47.548 124.833,48.843 C 137.211,47.62 146.879,37.181 146.879,24.483 L 122.397,24.483 C 122.396,10.961 111.435,0 97.915,0 L 97.915,24.485 C 97.917,37.183 107.584,47.619 119.96,48.842 z M 124.833,49.084 C 124.769,50.379 123.707,51.411 122.397,51.411 L 122.396,51.411 L 122.396,73.444 L 146.878,73.444 L 146.878,73.441 C 146.876,60.745 137.208,50.308 124.833,49.084 z M 119.949,48.963 L 97.915,48.963 L 97.915,73.442 L 97.915,73.442 C 110.613,73.442 121.052,63.774 122.275,51.399 C 120.981,51.334 119.949,50.274 119.949,48.963 z " | ||
39 | style="fill:#a9c542" | ||
40 | id="path18" /> | ||
41 | </g> | ||
42 | </g> | ||
43 | <g | ||
44 | transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)" | ||
45 | style="opacity:0.65" | ||
46 | id="g20"> | ||
47 | <g | ||
48 | id="g22"> | ||
49 | <path | ||
50 | d="M 168.912,48.967 C 168.912,47.656 169.945,46.596 171.24,46.531 C 170.018,34.152 159.579,24.482 146.879,24.482 L 146.879,48.963 C 146.879,62.484 157.84,73.444 171.361,73.444 L 171.361,51.414 C 170.007,51.415 168.912,50.319 168.912,48.967 z M 195.841,48.978 C 195.841,48.973 195.842,48.969 195.842,48.964 L 195.842,24.482 L 195.838,24.482 C 183.14,24.484 172.702,34.154 171.482,46.531 C 172.776,46.595 173.808,47.656 173.808,48.967 C 173.808,50.278 172.776,51.339 171.481,51.403 C 172.679,63.59 182.814,73.146 195.244,73.445 L 171.361,73.445 L 171.361,97.927 L 171.364,97.927 C 184.879,97.925 195.834,86.973 195.842,73.46 L 195.844,73.46 L 195.844,48.979 L 195.841,48.978 z M 195.832,48.964 L 195.842,48.964 L 195.842,48.978 L 195.832,48.964 z " | ||
51 | style="fill:#f9c759" | ||
52 | id="path24" /> | ||
53 | </g> | ||
54 | </g> | ||
55 | <g | ||
56 | transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)" | ||
57 | style="opacity:0.65" | ||
58 | id="g26"> | ||
59 | <g | ||
60 | id="g28"> | ||
61 | <path | ||
62 | d="M 70.994,48.479 L 48.962,48.479 L 48.962,48.481 L 70.995,48.481 C 70.995,48.481 70.994,48.48 70.994,48.479 z M 73.44,24.001 L 73.437,24.001 L 73.437,46.032 C 73.439,46.032 73.44,46.032 73.442,46.032 C 74.794,46.032 75.89,47.128 75.89,48.48 C 75.89,49.832 74.794,50.928 73.442,50.928 C 72.091,50.928 70.996,49.834 70.994,48.483 L 48.958,48.483 L 48.958,48.486 C 48.96,62.005 59.919,72.964 73.437,72.964 C 86.955,72.964 97.914,62.005 97.916,48.486 L 97.916,48.483 C 97.916,34.963 86.958,24.003 73.44,24.001 z " | ||
63 | style="fill:#6ac7bd" | ||
64 | id="path30" /> | ||
65 | </g> | ||
66 | </g> | ||
67 | <g | ||
68 | transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)" | ||
69 | style="opacity:0.65" | ||
70 | id="g32"> | ||
71 | <g | ||
72 | id="g34"> | ||
73 | <path | ||
74 | d="M 24.482,23.998 L 24.482,23.995 C 10.961,23.994 0,34.955 0,48.476 L 22.034,48.476 C 22.036,47.125 23.131,46.031 24.482,46.031 C 25.834,46.031 26.93,47.127 26.93,48.479 C 26.93,49.831 25.834,50.927 24.482,50.927 L 24.482,72.937 C 24.469,59.427 13.514,48.479 0,48.479 L 0,72.96 L 24.481,72.96 L 24.481,72.96 L 0,72.96 L 0,97.442 L 0.003,97.442 C 13.523,97.44 24.482,86.48 24.482,72.961 L 24.485,72.961 C 38.005,72.959 48.963,62 48.963,48.479 L 48.963,48.476 C 48.962,34.957 38.001,23.998 24.482,23.998 z " | ||
75 | style="fill:#ef412a" | ||
76 | id="path36" /> | ||
77 | </g> | ||
78 | </g> | ||
79 | <g | ||
80 | transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)" | ||
81 | style="opacity:0.65" | ||
82 | id="g38"> | ||
83 | <g | ||
84 | id="g40"> | ||
85 | <path | ||
86 | d="M 122.397,46.516 C 123.707,46.516 124.768,47.548 124.833,48.843 C 137.211,47.62 146.879,37.181 146.879,24.483 L 122.397,24.483 L 122.397,46.516 L 122.397,46.516 z M 97.915,0 L 97.915,24.482 L 122.396,24.482 C 122.396,10.961 111.435,0 97.915,0 z M 122.275,46.528 C 121.052,34.151 110.613,24.482 97.914,24.482 L 97.914,48.964 L 97.914,48.964 L 97.914,73.443 L 97.914,73.443 C 110.612,73.443 121.051,63.775 122.274,51.4 C 120.98,51.335 119.948,50.275 119.948,48.964 C 119.949,47.653 120.98,46.593 122.275,46.528 z M 124.833,49.084 C 124.769,50.379 123.707,51.411 122.397,51.411 L 122.396,51.411 L 122.396,73.444 L 146.878,73.444 L 146.878,73.441 C 146.876,60.745 137.208,50.308 124.833,49.084 z " | ||
87 | style="fill:#a9c542" | ||
88 | id="path42" /> | ||
89 | </g> | ||
90 | </g> | ||
91 | <g | ||
92 | transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)" | ||
93 | style="opacity:0.65" | ||
94 | id="g44"> | ||
95 | <g | ||
96 | id="g46"> | ||
97 | <path | ||
98 | d="M 173.795,49.1 C 173.724,50.389 172.666,51.415 171.36,51.415 C 170.006,51.415 168.911,50.319 168.911,48.967 C 168.911,47.656 169.944,46.596 171.239,46.531 C 170.017,34.152 159.578,24.482 146.878,24.482 L 146.878,48.963 C 146.878,62.484 157.839,73.444 171.36,73.444 L 171.36,97.926 L 171.363,97.926 C 184.878,97.924 195.833,86.972 195.841,73.459 L 195.842,73.459 L 195.842,73.443 L 195.841,73.443 C 195.833,60.753 186.167,50.322 173.795,49.1 z M 195.838,24.482 C 183.14,24.484 172.702,34.154 171.482,46.531 C 172.775,46.595 173.806,47.655 173.808,48.964 L 195.841,48.964 L 195.841,48.979 C 195.841,48.974 195.842,48.969 195.842,48.964 L 195.842,24.482 L 195.838,24.482 z " | ||
99 | style="fill:#f9c759" | ||
100 | id="path48" /> | ||
101 | </g> | ||
102 | </g> | ||
103 | <g | ||
104 | transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)" | ||
105 | style="opacity:0.65" | ||
106 | id="g50"> | ||
107 | <g | ||
108 | id="g52"> | ||
109 | <path | ||
110 | d="M 71.007,48.347 C 71.075,47.105 72.062,46.117 73.304,46.046 C 72.509,38.02 67.85,31.133 61.201,27.284 C 57.601,25.2 53.424,24 48.965,24 L 48.962,24 C 48.962,28.46 50.161,32.638 52.245,36.24 C 56.093,42.891 62.98,47.552 71.007,48.347 z M 48.962,48.418 C 48.962,48.438 48.961,48.456 48.961,48.476 L 48.961,48.479 L 48.962,48.479 L 48.962,48.418 z M 70.995,48.482 C 70.995,48.481 70.995,48.481 70.995,48.48 L 48.962,48.48 L 48.962,48.482 L 70.995,48.482 z M 73.44,24.001 L 73.437,24.001 L 73.437,46.032 C 73.439,46.032 73.44,46.032 73.442,46.032 C 74.794,46.032 75.89,47.128 75.89,48.48 C 75.89,49.832 74.794,50.928 73.442,50.928 C 72.091,50.928 70.996,49.834 70.994,48.483 L 48.958,48.483 L 48.958,48.486 C 48.96,62.005 59.919,72.964 73.437,72.964 C 86.955,72.964 97.914,62.005 97.916,48.486 L 97.916,48.483 C 97.916,34.963 86.958,24.003 73.44,24.001 z " | ||
111 | style="fill:#6ac7bd" | ||
112 | id="path54" /> | ||
113 | </g> | ||
114 | </g> | ||
115 | <g | ||
116 | transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)" | ||
117 | style="opacity:0.65" | ||
118 | id="g56"> | ||
119 | <g | ||
120 | id="g58"> | ||
121 | <path | ||
122 | d="M 24.482,23.998 L 24.482,23.995 C 10.961,23.994 0,34.955 0,48.476 L 22.034,48.476 C 22.036,47.125 23.131,46.031 24.482,46.031 C 25.834,46.031 26.93,47.127 26.93,48.479 C 26.93,49.831 25.834,50.927 24.482,50.927 C 23.171,50.927 22.11,49.894 22.046,48.6 C 9.669,49.824 0.001,60.262 0.001,72.96 L 0,72.96 L 0,97.442 L 0.003,97.442 C 13.523,97.44 24.482,86.48 24.482,72.961 L 24.485,72.961 C 38.005,72.959 48.963,62 48.963,48.479 L 48.963,48.476 C 48.962,34.957 38.001,23.998 24.482,23.998 z " | ||
123 | style="fill:#ef412a" | ||
124 | id="path60" /> | ||
125 | </g> | ||
126 | </g> | ||
127 | <g | ||
128 | transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)" | ||
129 | style="opacity:0.65" | ||
130 | id="g62"> | ||
131 | <g | ||
132 | id="g64"> | ||
133 | <path | ||
134 | d="M 119.949,48.963 C 119.949,47.611 121.045,46.515 122.397,46.515 C 123.707,46.515 124.768,47.547 124.833,48.842 C 137.211,47.619 146.879,37.18 146.879,24.482 L 122.397,24.482 C 122.396,10.961 111.435,0 97.915,0 L 97.915,24.482 L 122.394,24.482 C 108.874,24.484 97.916,35.444 97.916,48.963 L 97.916,48.963 L 97.916,73.442 L 97.916,73.442 C 110.614,73.442 121.053,63.774 122.276,51.399 C 120.981,51.334 119.949,50.274 119.949,48.963 z M 124.833,49.084 C 124.769,50.379 123.707,51.411 122.397,51.411 L 122.396,51.411 L 122.396,73.444 L 146.878,73.444 L 146.878,73.441 C 146.876,60.745 137.208,50.308 124.833,49.084 z " | ||
135 | style="fill:#a9c542" | ||
136 | id="path66" /> | ||
137 | </g> | ||
138 | </g> | ||
139 | <g | ||
140 | transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)" | ||
141 | style="opacity:0.65" | ||
142 | id="g68"> | ||
143 | <g | ||
144 | id="g70"> | ||
145 | <path | ||
146 | d="M 195.841,48.979 L 195.835,48.964 L 195.841,48.964 L 195.841,48.979 C 195.841,48.974 195.842,48.969 195.842,48.964 L 195.842,24.482 L 195.838,24.482 C 183.14,24.484 172.702,34.154 171.482,46.531 C 172.776,46.595 173.808,47.656 173.808,48.967 C 173.808,50.319 172.712,51.415 171.361,51.415 C 170.007,51.415 168.912,50.319 168.912,48.967 C 168.912,47.656 169.945,46.596 171.24,46.531 C 170.018,34.152 159.579,24.482 146.879,24.482 L 146.879,48.963 C 146.879,62.484 157.84,73.444 171.361,73.444 L 171.361,97.926 L 171.364,97.926 C 184.883,97.924 195.843,86.963 195.843,73.444 L 171.959,73.444 C 185.203,73.126 195.841,62.299 195.841,48.979 z " | ||
147 | style="fill:#f9c759" | ||
148 | id="path72" /> | ||
149 | </g> | ||
150 | </g> | ||
151 | <g | ||
152 | transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)" | ||
153 | style="opacity:0.65" | ||
154 | id="g74"> | ||
155 | <g | ||
156 | id="g76"> | ||
157 | <path | ||
158 | d="M 73.44,24.001 L 73.437,24.001 C 59.919,24.003 48.96,34.959 48.958,48.476 L 48.958,48.479 L 48.961,48.479 L 48.961,48.481 L 48.957,48.482 L 48.957,48.485 C 48.959,62.004 59.918,72.963 73.436,72.963 C 86.954,72.963 97.913,62.004 97.915,48.485 L 97.915,48.482 C 97.916,34.963 86.958,24.003 73.44,24.001 z M 73.442,50.928 C 72.09,50.928 70.994,49.832 70.994,48.48 C 70.994,47.128 72.09,46.032 73.442,46.032 C 74.794,46.032 75.89,47.128 75.89,48.48 C 75.89,49.832 74.794,50.928 73.442,50.928 z " | ||
159 | style="fill:#6ac7bd" | ||
160 | id="path78" /> | ||
161 | </g> | ||
162 | </g> | ||
163 | </svg> \ No newline at end of file | ||
diff --git a/documentation/template/section.title.xsl b/documentation/template/section.title.xsl new file mode 100644 index 0000000..5c6ff9a --- /dev/null +++ b/documentation/template/section.title.xsl | |||
@@ -0,0 +1,55 @@ | |||
1 | <xsl:stylesheet version="1.0" | ||
2 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
3 | xmlns:d="http://docbook.org/ns/docbook" | ||
4 | xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="d"> | ||
5 | |||
6 | <xsl:template name="section.title"> | ||
7 | <xsl:variable name="section" | ||
8 | select="(ancestor::section | | ||
9 | ancestor::simplesect| | ||
10 | ancestor::sect1| | ||
11 | ancestor::sect2| | ||
12 | ancestor::sect3| | ||
13 | ancestor::sect4| | ||
14 | ancestor::sect5)[last()]"/> | ||
15 | |||
16 | <xsl:variable name="renderas"> | ||
17 | <xsl:choose> | ||
18 | <xsl:when test="$section/@renderas = 'sect1'">1</xsl:when> | ||
19 | <xsl:when test="$section/@renderas = 'sect2'">2</xsl:when> | ||
20 | <xsl:when test="$section/@renderas = 'sect3'">3</xsl:when> | ||
21 | <xsl:when test="$section/@renderas = 'sect4'">4</xsl:when> | ||
22 | <xsl:when test="$section/@renderas = 'sect5'">5</xsl:when> | ||
23 | <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise> | ||
24 | </xsl:choose> | ||
25 | </xsl:variable> | ||
26 | |||
27 | <xsl:variable name="level"> | ||
28 | <xsl:choose> | ||
29 | <xsl:when test="$renderas != ''"> | ||
30 | <xsl:value-of select="$renderas"/> | ||
31 | </xsl:when> | ||
32 | <xsl:otherwise> | ||
33 | <xsl:call-template name="section.level"> | ||
34 | <xsl:with-param name="node" select="$section"/> | ||
35 | </xsl:call-template> | ||
36 | </xsl:otherwise> | ||
37 | </xsl:choose> | ||
38 | </xsl:variable> | ||
39 | |||
40 | <xsl:call-template name="section.heading"> | ||
41 | <xsl:with-param name="section" select="$section"/> | ||
42 | <xsl:with-param name="level" select="$level"/> | ||
43 | <xsl:with-param name="title"> | ||
44 | <xsl:apply-templates select="$section" mode="object.title.markup"> | ||
45 | <xsl:with-param name="allow-anchors" select="1"/> | ||
46 | </xsl:apply-templates> | ||
47 | <xsl:if test="$level > 0"> | ||
48 | <xsl:call-template name="permalink"> | ||
49 | <xsl:with-param name="node" select="$section"/> | ||
50 | </xsl:call-template> | ||
51 | </xsl:if> | ||
52 | </xsl:with-param> | ||
53 | </xsl:call-template> | ||
54 | </xsl:template> | ||
55 | </xsl:stylesheet> | ||
diff --git a/documentation/template/titlepage.templates.xml b/documentation/template/titlepage.templates.xml new file mode 100644 index 0000000..f53f147 --- /dev/null +++ b/documentation/template/titlepage.templates.xml | |||
@@ -0,0 +1,1227 @@ | |||
1 | <!DOCTYPE t:templates [ | ||
2 | <!ENTITY hsize0 "10pt"> | ||
3 | <!ENTITY hsize1 "12pt"> | ||
4 | <!ENTITY hsize2 "14.4pt"> | ||
5 | <!ENTITY hsize3 "17.28pt"> | ||
6 | <!ENTITY hsize4 "20.736pt"> | ||
7 | <!ENTITY hsize5 "24.8832pt"> | ||
8 | <!ENTITY hsize0space "7.5pt"> <!-- 0.75 * hsize0 --> | ||
9 | <!ENTITY hsize1space "9pt"> <!-- 0.75 * hsize1 --> | ||
10 | <!ENTITY hsize2space "10.8pt"> <!-- 0.75 * hsize2 --> | ||
11 | <!ENTITY hsize3space "12.96pt"> <!-- 0.75 * hsize3 --> | ||
12 | <!ENTITY hsize4space "15.552pt"> <!-- 0.75 * hsize4 --> | ||
13 | <!ENTITY hsize5space "18.6624pt"> <!-- 0.75 * hsize5 --> | ||
14 | ]> | ||
15 | <t:templates xmlns:t="http://nwalsh.com/docbook/xsl/template/1.0" | ||
16 | xmlns:param="http://nwalsh.com/docbook/xsl/template/1.0/param" | ||
17 | xmlns:fo="http://www.w3.org/1999/XSL/Format" | ||
18 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | ||
19 | |||
20 | <!-- ******************************************************************** | ||
21 | $Id: titlepage.templates.xml,v 1.23 2003/12/16 00:30:49 bobstayton Exp $ | ||
22 | ******************************************************************** | ||
23 | |||
24 | This file is part of the DocBook XSL Stylesheet distribution. | ||
25 | See ../README or http://docbook.sf.net/ for copyright | ||
26 | and other information. | ||
27 | |||
28 | ******************************************************************** --> | ||
29 | |||
30 | <!-- ==================================================================== --> | ||
31 | |||
32 | <t:titlepage t:element="article" t:wrapper="fo:block" | ||
33 | font-family="{$title.fontset}"> | ||
34 | |||
35 | <t:titlepage-content t:side="recto" | ||
36 | text-align="center"> | ||
37 | |||
38 | <mediaobject/> | ||
39 | |||
40 | <title t:named-template="component.title" | ||
41 | param:node="ancestor-or-self::article[1]" | ||
42 | keep-with-next="always" | ||
43 | font-size="&hsize5;" | ||
44 | font-weight="bold"/> | ||
45 | |||
46 | <subtitle param:node="ancestor-or-self::article[1]" | ||
47 | keep-with-next="always" | ||
48 | font-size="&hsize3;" | ||
49 | font-weight="bold" | ||
50 | space-after="0.8em"/> | ||
51 | |||
52 | <corpauthor space-before="0.5em" | ||
53 | font-size="&hsize3;"/> | ||
54 | <authorgroup space-before="0.5em" | ||
55 | font-size="&hsize2;"/> | ||
56 | <author space-before="0.5em" | ||
57 | font-size="&hsize2;" | ||
58 | space-after="0.8em"/> | ||
59 | |||
60 | <email font-size="&hsize2;"/> | ||
61 | |||
62 | <othercredit space-before="0.5em"/> | ||
63 | <releaseinfo space-before="0.5em"/> | ||
64 | <copyright space-before="0.5em"/> | ||
65 | <legalnotice text-align="start" | ||
66 | margin-left="0.5in" | ||
67 | margin-right="0.5in" | ||
68 | font-family="{$body.fontset}"/> | ||
69 | <pubdate space-before="0.5em"/> | ||
70 | <para></para> | ||
71 | <revision space-before="0.5em"/> | ||
72 | <revhistory space-before="0.5em"/> | ||
73 | <abstract space-before="0.5em" | ||
74 | text-align="start" | ||
75 | margin-left="0.5in" | ||
76 | margin-right="0.5in" | ||
77 | font-family="{$body.fontset}"/> | ||
78 | |||
79 | <para></para> | ||
80 | </t:titlepage-content> | ||
81 | |||
82 | <t:titlepage-content t:side="verso"> | ||
83 | </t:titlepage-content> | ||
84 | |||
85 | <t:titlepage-separator> | ||
86 | </t:titlepage-separator> | ||
87 | |||
88 | <t:titlepage-before t:side="recto"> | ||
89 | </t:titlepage-before> | ||
90 | |||
91 | <t:titlepage-before t:side="verso"> | ||
92 | </t:titlepage-before> | ||
93 | </t:titlepage> | ||
94 | |||
95 | <!-- ==================================================================== --> | ||
96 | |||
97 | <t:titlepage t:element="set" t:wrapper="fo:block"> | ||
98 | <t:titlepage-content t:side="recto"> | ||
99 | <title | ||
100 | t:named-template="division.title" | ||
101 | param:node="ancestor-or-self::set[1]" | ||
102 | text-align="center" | ||
103 | font-size="&hsize5;" | ||
104 | space-before="&hsize5space;" | ||
105 | font-weight="bold" | ||
106 | font-family="{$title.fontset}"/> | ||
107 | <subtitle | ||
108 | font-family="{$title.fontset}" | ||
109 | text-align="center"/> | ||
110 | <corpauthor/> | ||
111 | <authorgroup/> | ||
112 | <author/> | ||
113 | <othercredit/> | ||
114 | <releaseinfo/> | ||
115 | <copyright/> | ||
116 | <legalnotice/> | ||
117 | <pubdate/> | ||
118 | <revision/> | ||
119 | <revhistory/> | ||
120 | <abstract/> | ||
121 | </t:titlepage-content> | ||
122 | |||
123 | <t:titlepage-content t:side="verso"> | ||
124 | </t:titlepage-content> | ||
125 | |||
126 | <t:titlepage-separator> | ||
127 | </t:titlepage-separator> | ||
128 | |||
129 | <t:titlepage-before t:side="recto"> | ||
130 | </t:titlepage-before> | ||
131 | |||
132 | <t:titlepage-before t:side="verso"> | ||
133 | </t:titlepage-before> | ||
134 | </t:titlepage> | ||
135 | |||
136 | <!-- ==================================================================== --> | ||
137 | |||
138 | <t:titlepage t:element="book" t:wrapper="fo:block"> | ||
139 | <t:titlepage-content t:side="recto"> | ||
140 | |||
141 | <mediaobject/> | ||
142 | |||
143 | <subtitle | ||
144 | text-align="center" | ||
145 | font-size="&hsize4;" | ||
146 | space-before="&hsize4space;" | ||
147 | font-family="{$title.fontset}"/> | ||
148 | <corpauthor font-size="&hsize3;" | ||
149 | keep-with-next="always" | ||
150 | space-before="2in"/> | ||
151 | <authorgroup space-before="2in"/> | ||
152 | <author font-size="&hsize3;" | ||
153 | space-before="&hsize2space;" | ||
154 | keep-with-next="always"/> | ||
155 | </t:titlepage-content> | ||
156 | |||
157 | <t:titlepage-content t:side="verso"> | ||
158 | <corpauthor/> | ||
159 | <authorgroup t:named-template="verso.authorgroup"/> | ||
160 | <author/> | ||
161 | <othercredit/> | ||
162 | <pubdate space-before="1em"/> | ||
163 | <copyright/> | ||
164 | <abstract/> | ||
165 | <legalnotice font-size="8pt"/> | ||
166 | </t:titlepage-content> | ||
167 | |||
168 | <t:titlepage-separator> | ||
169 | <fo:block break-after="page"/> | ||
170 | </t:titlepage-separator> | ||
171 | |||
172 | <t:titlepage-before t:side="recto"> | ||
173 | </t:titlepage-before> | ||
174 | |||
175 | <t:titlepage-before t:side="verso"> | ||
176 | <fo:block break-after="page"/> | ||
177 | </t:titlepage-before> | ||
178 | </t:titlepage> | ||
179 | |||
180 | <!-- ==================================================================== --> | ||
181 | |||
182 | <t:titlepage t:element="part" t:wrapper="fo:block"> | ||
183 | <t:titlepage-content t:side="recto"> | ||
184 | <title | ||
185 | t:named-template="division.title" | ||
186 | param:node="ancestor-or-self::part[1]" | ||
187 | text-align="center" | ||
188 | font-size="&hsize5;" | ||
189 | space-before="&hsize5space;" | ||
190 | font-weight="bold" | ||
191 | font-family="{$title.fontset}"/> | ||
192 | <subtitle | ||
193 | text-align="center" | ||
194 | font-size="&hsize4;" | ||
195 | space-before="&hsize4space;" | ||
196 | font-weight='bold' | ||
197 | font-style='italic' | ||
198 | font-family="{$title.fontset}"/> | ||
199 | </t:titlepage-content> | ||
200 | |||
201 | <t:titlepage-content t:side="verso"> | ||
202 | </t:titlepage-content> | ||
203 | |||
204 | <t:titlepage-separator> | ||
205 | </t:titlepage-separator> | ||
206 | |||
207 | <t:titlepage-before t:side="recto"> | ||
208 | </t:titlepage-before> | ||
209 | |||
210 | <t:titlepage-before t:side="verso"> | ||
211 | </t:titlepage-before> | ||
212 | </t:titlepage> | ||
213 | |||
214 | <t:titlepage t:element="partintro" t:wrapper="fo:block"> | ||
215 | <t:titlepage-content t:side="recto"> | ||
216 | <title | ||
217 | text-align="center" | ||
218 | font-size="&hsize5;" | ||
219 | font-weight="bold" | ||
220 | space-before="1em" | ||
221 | font-family="{$title.fontset}"/> | ||
222 | <subtitle | ||
223 | text-align="center" | ||
224 | font-size="&hsize2;" | ||
225 | font-weight="bold" | ||
226 | font-style="italic" | ||
227 | font-family="{$title.fontset}"/> | ||
228 | <corpauthor/> | ||
229 | <authorgroup/> | ||
230 | <author/> | ||
231 | <othercredit/> | ||
232 | <releaseinfo/> | ||
233 | <copyright/> | ||
234 | <legalnotice/> | ||
235 | <pubdate/> | ||
236 | <revision/> | ||
237 | <revhistory/> | ||
238 | <abstract/> | ||
239 | </t:titlepage-content> | ||
240 | |||
241 | <t:titlepage-content t:side="verso"> | ||
242 | </t:titlepage-content> | ||
243 | |||
244 | <t:titlepage-separator> | ||
245 | </t:titlepage-separator> | ||
246 | |||
247 | <t:titlepage-before t:side="recto"> | ||
248 | </t:titlepage-before> | ||
249 | |||
250 | <t:titlepage-before t:side="verso"> | ||
251 | </t:titlepage-before> | ||
252 | </t:titlepage> | ||
253 | |||
254 | <!-- ==================================================================== --> | ||
255 | |||
256 | <t:titlepage t:element="reference" t:wrapper="fo:block"> | ||
257 | <t:titlepage-content t:side="recto"> | ||
258 | <title | ||
259 | t:named-template="division.title" | ||
260 | param:node="ancestor-or-self::reference[1]" | ||
261 | text-align="center" | ||
262 | font-size="&hsize5;" | ||
263 | space-before="&hsize5space;" | ||
264 | font-weight="bold" | ||
265 | font-family="{$title.fontset}"/> | ||
266 | <subtitle | ||
267 | font-family="{$title.fontset}" | ||
268 | text-align="center"/> | ||
269 | <corpauthor/> | ||
270 | <authorgroup/> | ||
271 | <author/> | ||
272 | <othercredit/> | ||
273 | <releaseinfo/> | ||
274 | <copyright/> | ||
275 | <legalnotice/> | ||
276 | <pubdate/> | ||
277 | <revision/> | ||
278 | <revhistory/> | ||
279 | <abstract/> | ||
280 | </t:titlepage-content> | ||
281 | |||
282 | <t:titlepage-content t:side="verso"> | ||
283 | </t:titlepage-content> | ||
284 | |||
285 | <t:titlepage-separator> | ||
286 | </t:titlepage-separator> | ||
287 | |||
288 | <t:titlepage-before t:side="recto"> | ||
289 | </t:titlepage-before> | ||
290 | |||
291 | <t:titlepage-before t:side="verso"> | ||
292 | </t:titlepage-before> | ||
293 | </t:titlepage> | ||
294 | |||
295 | <!-- ==================================================================== --> | ||
296 | |||
297 | <t:titlepage t:element="refsynopsisdiv" t:wrapper="fo:block"> | ||
298 | <t:titlepage-content t:side="recto"> | ||
299 | <title | ||
300 | font-family="{$title.fontset}"/> | ||
301 | </t:titlepage-content> | ||
302 | |||
303 | <t:titlepage-content t:side="verso"> | ||
304 | </t:titlepage-content> | ||
305 | |||
306 | <t:titlepage-separator> | ||
307 | </t:titlepage-separator> | ||
308 | |||
309 | <t:titlepage-before t:side="recto"> | ||
310 | </t:titlepage-before> | ||
311 | |||
312 | <t:titlepage-before t:side="verso"> | ||
313 | </t:titlepage-before> | ||
314 | </t:titlepage> | ||
315 | |||
316 | <!-- ==================================================================== --> | ||
317 | |||
318 | <t:titlepage t:element="refsection" t:wrapper="fo:block"> | ||
319 | <t:titlepage-content t:side="recto"> | ||
320 | <title | ||
321 | font-family="{$title.fontset}"/> | ||
322 | </t:titlepage-content> | ||
323 | |||
324 | <t:titlepage-content t:side="verso"> | ||
325 | </t:titlepage-content> | ||
326 | |||
327 | <t:titlepage-separator> | ||
328 | </t:titlepage-separator> | ||
329 | |||
330 | <t:titlepage-before t:side="recto"> | ||
331 | </t:titlepage-before> | ||
332 | |||
333 | <t:titlepage-before t:side="verso"> | ||
334 | </t:titlepage-before> | ||
335 | </t:titlepage> | ||
336 | |||
337 | <!-- ==================================================================== --> | ||
338 | |||
339 | <t:titlepage t:element="refsect1" t:wrapper="fo:block"> | ||
340 | <t:titlepage-content t:side="recto"> | ||
341 | <title | ||
342 | font-family="{$title.fontset}"/> | ||
343 | </t:titlepage-content> | ||
344 | |||
345 | <t:titlepage-content t:side="verso"> | ||
346 | </t:titlepage-content> | ||
347 | |||
348 | <t:titlepage-separator> | ||
349 | </t:titlepage-separator> | ||
350 | |||
351 | <t:titlepage-before t:side="recto"> | ||
352 | </t:titlepage-before> | ||
353 | |||
354 | <t:titlepage-before t:side="verso"> | ||
355 | </t:titlepage-before> | ||
356 | </t:titlepage> | ||
357 | |||
358 | <!-- ==================================================================== --> | ||
359 | |||
360 | <t:titlepage t:element="refsect2" t:wrapper="fo:block"> | ||
361 | <t:titlepage-content t:side="recto"> | ||
362 | <title | ||
363 | font-family="{$title.fontset}"/> | ||
364 | </t:titlepage-content> | ||
365 | |||
366 | <t:titlepage-content t:side="verso"> | ||
367 | </t:titlepage-content> | ||
368 | |||
369 | <t:titlepage-separator> | ||
370 | </t:titlepage-separator> | ||
371 | |||
372 | <t:titlepage-before t:side="recto"> | ||
373 | </t:titlepage-before> | ||
374 | |||
375 | <t:titlepage-before t:side="verso"> | ||
376 | </t:titlepage-before> | ||
377 | </t:titlepage> | ||
378 | |||
379 | <!-- ==================================================================== --> | ||
380 | |||
381 | <t:titlepage t:element="refsect3" t:wrapper="fo:block"> | ||
382 | <t:titlepage-content t:side="recto"> | ||
383 | <title | ||
384 | font-family="{$title.fontset}"/> | ||
385 | </t:titlepage-content> | ||
386 | |||
387 | <t:titlepage-content t:side="verso"> | ||
388 | </t:titlepage-content> | ||
389 | |||
390 | <t:titlepage-separator> | ||
391 | </t:titlepage-separator> | ||
392 | |||
393 | <t:titlepage-before t:side="recto"> | ||
394 | </t:titlepage-before> | ||
395 | |||
396 | <t:titlepage-before t:side="verso"> | ||
397 | </t:titlepage-before> | ||
398 | </t:titlepage> | ||
399 | |||
400 | <!-- ==================================================================== --> | ||
401 | |||
402 | <t:titlepage t:element="dedication" t:wrapper="fo:block"> | ||
403 | <t:titlepage-content t:side="recto"> | ||
404 | <title | ||
405 | t:force="1" | ||
406 | t:named-template="component.title" | ||
407 | param:node="ancestor-or-self::dedication[1]" | ||
408 | margin-left="{$title.margin.left}" | ||
409 | font-size="&hsize5;" | ||
410 | font-family="{$title.fontset}" | ||
411 | font-weight="bold"/> | ||
412 | <subtitle | ||
413 | font-family="{$title.fontset}"/> | ||
414 | </t:titlepage-content> | ||
415 | |||
416 | <t:titlepage-content t:side="verso"> | ||
417 | </t:titlepage-content> | ||
418 | |||
419 | <t:titlepage-separator> | ||
420 | </t:titlepage-separator> | ||
421 | |||
422 | <t:titlepage-before t:side="recto"> | ||
423 | </t:titlepage-before> | ||
424 | |||
425 | <t:titlepage-before t:side="verso"> | ||
426 | </t:titlepage-before> | ||
427 | </t:titlepage> | ||
428 | |||
429 | <!-- ==================================================================== --> | ||
430 | |||
431 | <t:titlepage t:element="preface" t:wrapper="fo:block"> | ||
432 | <t:titlepage-content t:side="recto"> | ||
433 | <title | ||
434 | t:force="1" | ||
435 | t:named-template="component.title" | ||
436 | param:node="ancestor-or-self::preface[1]" | ||
437 | margin-left="{$title.margin.left}" | ||
438 | font-size="&hsize5;" | ||
439 | font-family="{$title.fontset}" | ||
440 | font-weight="bold"/> | ||
441 | <subtitle | ||
442 | font-family="{$title.fontset}"/> | ||
443 | <corpauthor/> | ||
444 | <authorgroup/> | ||
445 | <author/> | ||
446 | <othercredit/> | ||
447 | <releaseinfo/> | ||
448 | <copyright/> | ||
449 | <legalnotice/> | ||
450 | <pubdate/> | ||
451 | <revision/> | ||
452 | <revhistory/> | ||
453 | <abstract/> | ||
454 | </t:titlepage-content> | ||
455 | |||
456 | <t:titlepage-content t:side="verso"> | ||
457 | </t:titlepage-content> | ||
458 | |||
459 | <t:titlepage-separator> | ||
460 | </t:titlepage-separator> | ||
461 | |||
462 | <t:titlepage-before t:side="recto"> | ||
463 | </t:titlepage-before> | ||
464 | |||
465 | <t:titlepage-before t:side="verso"> | ||
466 | </t:titlepage-before> | ||
467 | </t:titlepage> | ||
468 | |||
469 | <!-- ==================================================================== --> | ||
470 | |||
471 | <t:titlepage t:element="chapter" t:wrapper="fo:block" | ||
472 | font-family="{$title.fontset}"> | ||
473 | <t:titlepage-content t:side="recto" margin-left="{$title.margin.left}"> | ||
474 | <title t:named-template="component.title" | ||
475 | param:node="ancestor-or-self::chapter[1]" | ||
476 | font-size="&hsize5;" | ||
477 | font-weight="bold"/> | ||
478 | |||
479 | <subtitle space-before="0.5em" | ||
480 | font-style="italic" | ||
481 | font-size="&hsize2;" | ||
482 | font-weight="bold"/> | ||
483 | |||
484 | <corpauthor space-before="0.5em" | ||
485 | space-after="0.5em" | ||
486 | font-size="&hsize2;"/> | ||
487 | |||
488 | <authorgroup space-before="0.5em" | ||
489 | space-after="0.5em" | ||
490 | font-size="&hsize2;"/> | ||
491 | |||
492 | <author space-before="0.5em" | ||
493 | space-after="0.5em" | ||
494 | font-size="&hsize2;"/> | ||
495 | |||
496 | <othercredit/> | ||
497 | <releaseinfo/> | ||
498 | <copyright/> | ||
499 | <legalnotice/> | ||
500 | <pubdate/> | ||
501 | <revision/> | ||
502 | <revhistory/> | ||
503 | <abstract/> | ||
504 | </t:titlepage-content> | ||
505 | |||
506 | <t:titlepage-content t:side="verso"> | ||
507 | </t:titlepage-content> | ||
508 | |||
509 | <t:titlepage-separator> | ||
510 | </t:titlepage-separator> | ||
511 | |||
512 | <t:titlepage-before t:side="recto"> | ||
513 | </t:titlepage-before> | ||
514 | |||
515 | <t:titlepage-before t:side="verso"> | ||
516 | </t:titlepage-before> | ||
517 | </t:titlepage> | ||
518 | |||
519 | <!-- ==================================================================== --> | ||
520 | |||
521 | <t:titlepage t:element="appendix" t:wrapper="fo:block"> | ||
522 | <t:titlepage-content t:side="recto"> | ||
523 | <title | ||
524 | t:named-template="component.title" | ||
525 | param:node="ancestor-or-self::appendix[1]" | ||
526 | margin-left="{$title.margin.left}" | ||
527 | font-size="&hsize5;" | ||
528 | font-weight="bold" | ||
529 | font-family="{$title.fontset}"/> | ||
530 | <subtitle | ||
531 | font-family="{$title.fontset}"/> | ||
532 | <corpauthor/> | ||
533 | <authorgroup/> | ||
534 | <author/> | ||
535 | <othercredit/> | ||
536 | <releaseinfo/> | ||
537 | <copyright/> | ||
538 | <legalnotice/> | ||
539 | <pubdate/> | ||
540 | <revision/> | ||
541 | <revhistory/> | ||
542 | <abstract/> | ||
543 | </t:titlepage-content> | ||
544 | |||
545 | <t:titlepage-content t:side="verso"> | ||
546 | </t:titlepage-content> | ||
547 | |||
548 | <t:titlepage-separator> | ||
549 | </t:titlepage-separator> | ||
550 | |||
551 | <t:titlepage-before t:side="recto"> | ||
552 | </t:titlepage-before> | ||
553 | |||
554 | <t:titlepage-before t:side="verso"> | ||
555 | </t:titlepage-before> | ||
556 | </t:titlepage> | ||
557 | |||
558 | <!-- ==================================================================== --> | ||
559 | |||
560 | <t:titlepage t:element="section" t:wrapper="fo:block"> | ||
561 | <t:titlepage-content t:side="recto"> | ||
562 | <title | ||
563 | margin-left="{$title.margin.left}" | ||
564 | font-family="{$title.fontset}"/> | ||
565 | <subtitle | ||
566 | font-family="{$title.fontset}"/> | ||
567 | <corpauthor/> | ||
568 | <authorgroup/> | ||
569 | <author/> | ||
570 | <othercredit/> | ||
571 | <releaseinfo/> | ||
572 | <copyright/> | ||
573 | <legalnotice/> | ||
574 | <pubdate/> | ||
575 | <revision/> | ||
576 | <revhistory/> | ||
577 | <abstract/> | ||
578 | </t:titlepage-content> | ||
579 | |||
580 | <t:titlepage-content t:side="verso"> | ||
581 | </t:titlepage-content> | ||
582 | |||
583 | <t:titlepage-separator> | ||
584 | </t:titlepage-separator> | ||
585 | |||
586 | <t:titlepage-before t:side="recto"> | ||
587 | </t:titlepage-before> | ||
588 | |||
589 | <t:titlepage-before t:side="verso"> | ||
590 | </t:titlepage-before> | ||
591 | </t:titlepage> | ||
592 | |||
593 | <t:titlepage t:element="sect1" t:wrapper="fo:block"> | ||
594 | <t:titlepage-content t:side="recto"> | ||
595 | <title | ||
596 | margin-left="{$title.margin.left}" | ||
597 | font-family="{$title.fontset}"/> | ||
598 | <subtitle | ||
599 | font-family="{$title.fontset}"/> | ||
600 | <corpauthor/> | ||
601 | <authorgroup/> | ||
602 | <author/> | ||
603 | <othercredit/> | ||
604 | <releaseinfo/> | ||
605 | <copyright/> | ||
606 | <legalnotice/> | ||
607 | <pubdate/> | ||
608 | <revision/> | ||
609 | <revhistory/> | ||
610 | <abstract/> | ||
611 | </t:titlepage-content> | ||
612 | |||
613 | <t:titlepage-content t:side="verso"> | ||
614 | </t:titlepage-content> | ||
615 | |||
616 | <t:titlepage-separator> | ||
617 | </t:titlepage-separator> | ||
618 | |||
619 | <t:titlepage-before t:side="recto"> | ||
620 | </t:titlepage-before> | ||
621 | |||
622 | <t:titlepage-before t:side="verso"> | ||
623 | </t:titlepage-before> | ||
624 | </t:titlepage> | ||
625 | |||
626 | <t:titlepage t:element="sect2" t:wrapper="fo:block"> | ||
627 | <t:titlepage-content t:side="recto"> | ||
628 | <title | ||
629 | margin-left="{$title.margin.left}" | ||
630 | font-family="{$title.fontset}"/> | ||
631 | <subtitle | ||
632 | font-family="{$title.fontset}"/> | ||
633 | <corpauthor/> | ||
634 | <authorgroup/> | ||
635 | <author/> | ||
636 | <othercredit/> | ||
637 | <releaseinfo/> | ||
638 | <copyright/> | ||
639 | <legalnotice/> | ||
640 | <pubdate/> | ||
641 | <revision/> | ||
642 | <revhistory/> | ||
643 | <abstract/> | ||
644 | </t:titlepage-content> | ||
645 | |||
646 | <t:titlepage-content t:side="verso"> | ||
647 | </t:titlepage-content> | ||
648 | |||
649 | <t:titlepage-separator> | ||
650 | </t:titlepage-separator> | ||
651 | |||
652 | <t:titlepage-before t:side="recto"> | ||
653 | </t:titlepage-before> | ||
654 | |||
655 | <t:titlepage-before t:side="verso"> | ||
656 | </t:titlepage-before> | ||
657 | </t:titlepage> | ||
658 | |||
659 | <t:titlepage t:element="sect3" t:wrapper="fo:block"> | ||
660 | <t:titlepage-content t:side="recto"> | ||
661 | <title | ||
662 | margin-left="{$title.margin.left}" | ||
663 | font-family="{$title.fontset}"/> | ||
664 | <subtitle | ||
665 | font-family="{$title.fontset}"/> | ||
666 | <corpauthor/> | ||
667 | <authorgroup/> | ||
668 | <author/> | ||
669 | <othercredit/> | ||
670 | <releaseinfo/> | ||
671 | <copyright/> | ||
672 | <legalnotice/> | ||
673 | <pubdate/> | ||
674 | <revision/> | ||
675 | <revhistory/> | ||
676 | <abstract/> | ||
677 | </t:titlepage-content> | ||
678 | |||
679 | <t:titlepage-content t:side="verso"> | ||
680 | </t:titlepage-content> | ||
681 | |||
682 | <t:titlepage-separator> | ||
683 | </t:titlepage-separator> | ||
684 | |||
685 | <t:titlepage-before t:side="recto"> | ||
686 | </t:titlepage-before> | ||
687 | |||
688 | <t:titlepage-before t:side="verso"> | ||
689 | </t:titlepage-before> | ||
690 | </t:titlepage> | ||
691 | |||
692 | <t:titlepage t:element="sect4" t:wrapper="fo:block"> | ||
693 | <t:titlepage-content t:side="recto"> | ||
694 | <title | ||
695 | margin-left="{$title.margin.left}" | ||
696 | font-family="{$title.fontset}"/> | ||
697 | <subtitle | ||
698 | font-family="{$title.fontset}"/> | ||
699 | <corpauthor/> | ||
700 | <authorgroup/> | ||
701 | <author/> | ||
702 | <othercredit/> | ||
703 | <releaseinfo/> | ||
704 | <copyright/> | ||
705 | <legalnotice/> | ||
706 | <pubdate/> | ||
707 | <revision/> | ||
708 | <revhistory/> | ||
709 | <abstract/> | ||
710 | </t:titlepage-content> | ||
711 | |||
712 | <t:titlepage-content t:side="verso"> | ||
713 | </t:titlepage-content> | ||
714 | |||
715 | <t:titlepage-separator> | ||
716 | </t:titlepage-separator> | ||
717 | |||
718 | <t:titlepage-before t:side="recto"> | ||
719 | </t:titlepage-before> | ||
720 | |||
721 | <t:titlepage-before t:side="verso"> | ||
722 | </t:titlepage-before> | ||
723 | </t:titlepage> | ||
724 | |||
725 | <t:titlepage t:element="sect5" t:wrapper="fo:block"> | ||
726 | <t:titlepage-content t:side="recto"> | ||
727 | <title | ||
728 | margin-left="{$title.margin.left}" | ||
729 | font-family="{$title.fontset}"/> | ||
730 | <subtitle | ||
731 | font-family="{$title.fontset}"/> | ||
732 | <corpauthor/> | ||
733 | <authorgroup/> | ||
734 | <author/> | ||
735 | <othercredit/> | ||
736 | <releaseinfo/> | ||
737 | <copyright/> | ||
738 | <legalnotice/> | ||
739 | <pubdate/> | ||
740 | <revision/> | ||
741 | <revhistory/> | ||
742 | <abstract/> | ||
743 | </t:titlepage-content> | ||
744 | |||
745 | <t:titlepage-content t:side="verso"> | ||
746 | </t:titlepage-content> | ||
747 | |||
748 | <t:titlepage-separator> | ||
749 | </t:titlepage-separator> | ||
750 | |||
751 | <t:titlepage-before t:side="recto"> | ||
752 | </t:titlepage-before> | ||
753 | |||
754 | <t:titlepage-before t:side="verso"> | ||
755 | </t:titlepage-before> | ||
756 | </t:titlepage> | ||
757 | |||
758 | <t:titlepage t:element="simplesect" t:wrapper="fo:block"> | ||
759 | <t:titlepage-content t:side="recto"> | ||
760 | <title | ||
761 | margin-left="{$title.margin.left}" | ||
762 | font-family="{$title.fontset}"/> | ||
763 | <subtitle | ||
764 | font-family="{$title.fontset}"/> | ||
765 | <corpauthor/> | ||
766 | <authorgroup/> | ||
767 | <author/> | ||
768 | <othercredit/> | ||
769 | <releaseinfo/> | ||
770 | <copyright/> | ||
771 | <legalnotice/> | ||
772 | <pubdate/> | ||
773 | <revision/> | ||
774 | <revhistory/> | ||
775 | <abstract/> | ||
776 | </t:titlepage-content> | ||
777 | |||
778 | <t:titlepage-content t:side="verso"> | ||
779 | </t:titlepage-content> | ||
780 | |||
781 | <t:titlepage-separator> | ||
782 | </t:titlepage-separator> | ||
783 | |||
784 | <t:titlepage-before t:side="recto"> | ||
785 | </t:titlepage-before> | ||
786 | |||
787 | <t:titlepage-before t:side="verso"> | ||
788 | </t:titlepage-before> | ||
789 | </t:titlepage> | ||
790 | |||
791 | <!-- ==================================================================== --> | ||
792 | |||
793 | <t:titlepage t:element="bibliography" t:wrapper="fo:block"> | ||
794 | <t:titlepage-content t:side="recto"> | ||
795 | <title | ||
796 | t:force="1" | ||
797 | t:named-template="component.title" | ||
798 | param:node="ancestor-or-self::bibliography[1]" | ||
799 | margin-left="{$title.margin.left}" | ||
800 | font-size="&hsize5;" | ||
801 | font-family="{$title.fontset}" | ||
802 | font-weight="bold"/> | ||
803 | <subtitle | ||
804 | font-family="{$title.fontset}"/> | ||
805 | </t:titlepage-content> | ||
806 | |||
807 | <t:titlepage-content t:side="verso"> | ||
808 | </t:titlepage-content> | ||
809 | |||
810 | <t:titlepage-separator> | ||
811 | </t:titlepage-separator> | ||
812 | |||
813 | <t:titlepage-before t:side="recto"> | ||
814 | </t:titlepage-before> | ||
815 | |||
816 | <t:titlepage-before t:side="verso"> | ||
817 | </t:titlepage-before> | ||
818 | </t:titlepage> | ||
819 | |||
820 | <!-- ==================================================================== --> | ||
821 | |||
822 | <t:titlepage t:element="bibliodiv" t:wrapper="fo:block"> | ||
823 | <t:titlepage-content t:side="recto"> | ||
824 | <title t:named-template="component.title" | ||
825 | param:node="ancestor-or-self::bibliodiv[1]" | ||
826 | margin-left="{$title.margin.left}" | ||
827 | font-size="&hsize4;" | ||
828 | font-family="{$title.fontset}" | ||
829 | font-weight="bold"/> | ||
830 | <subtitle | ||
831 | font-family="{$title.fontset}"/> | ||
832 | </t:titlepage-content> | ||
833 | |||
834 | <t:titlepage-content t:side="verso"> | ||
835 | </t:titlepage-content> | ||
836 | |||
837 | <t:titlepage-separator> | ||
838 | </t:titlepage-separator> | ||
839 | |||
840 | <t:titlepage-before t:side="recto"> | ||
841 | </t:titlepage-before> | ||
842 | |||
843 | <t:titlepage-before t:side="verso"> | ||
844 | </t:titlepage-before> | ||
845 | </t:titlepage> | ||
846 | |||
847 | <!-- ==================================================================== --> | ||
848 | |||
849 | <t:titlepage t:element="glossary" t:wrapper="fo:block"> | ||
850 | <t:titlepage-content t:side="recto"> | ||
851 | <title | ||
852 | t:force="1" | ||
853 | t:named-template="component.title" | ||
854 | param:node="ancestor-or-self::glossary[1]" | ||
855 | margin-left="{$title.margin.left}" | ||
856 | font-size="&hsize5;" | ||
857 | font-family="{$title.fontset}" | ||
858 | font-weight="bold"/> | ||
859 | <subtitle | ||
860 | font-family="{$title.fontset}"/> | ||
861 | </t:titlepage-content> | ||
862 | |||
863 | <t:titlepage-content t:side="verso"> | ||
864 | </t:titlepage-content> | ||
865 | |||
866 | <t:titlepage-separator> | ||
867 | </t:titlepage-separator> | ||
868 | |||
869 | <t:titlepage-before t:side="recto"> | ||
870 | </t:titlepage-before> | ||
871 | |||
872 | <t:titlepage-before t:side="verso"> | ||
873 | </t:titlepage-before> | ||
874 | </t:titlepage> | ||
875 | |||
876 | <!-- ==================================================================== --> | ||
877 | |||
878 | <t:titlepage t:element="glossdiv" t:wrapper="fo:block"> | ||
879 | <t:titlepage-content t:side="recto"> | ||
880 | <title t:named-template="component.title" | ||
881 | param:node="ancestor-or-self::glossdiv[1]" | ||
882 | margin-left="{$title.margin.left}" | ||
883 | font-size="&hsize4;" | ||
884 | font-family="{$title.fontset}" | ||
885 | font-weight="bold"/> | ||
886 | <subtitle | ||
887 | font-family="{$title.fontset}"/> | ||
888 | </t:titlepage-content> | ||
889 | |||
890 | <t:titlepage-content t:side="verso"> | ||
891 | </t:titlepage-content> | ||
892 | |||
893 | <t:titlepage-separator> | ||
894 | </t:titlepage-separator> | ||
895 | |||
896 | <t:titlepage-before t:side="recto"> | ||
897 | </t:titlepage-before> | ||
898 | |||
899 | <t:titlepage-before t:side="verso"> | ||
900 | </t:titlepage-before> | ||
901 | </t:titlepage> | ||
902 | |||
903 | <!-- ==================================================================== --> | ||
904 | |||
905 | <t:titlepage t:element="index" t:wrapper="fo:block"> | ||
906 | <t:titlepage-content t:side="recto"> | ||
907 | <title | ||
908 | t:force="1" | ||
909 | t:named-template="component.title" | ||
910 | param:node="ancestor-or-self::index[1]" | ||
911 | param:pagewide="1" | ||
912 | margin-left="0pt" | ||
913 | font-size="&hsize5;" | ||
914 | font-family="{$title.fontset}" | ||
915 | font-weight="bold"/> | ||
916 | <subtitle | ||
917 | font-family="{$title.fontset}"/> | ||
918 | </t:titlepage-content> | ||
919 | |||
920 | <t:titlepage-content t:side="verso"> | ||
921 | </t:titlepage-content> | ||
922 | |||
923 | <t:titlepage-separator> | ||
924 | </t:titlepage-separator> | ||
925 | |||
926 | <t:titlepage-before t:side="recto"> | ||
927 | </t:titlepage-before> | ||
928 | |||
929 | <t:titlepage-before t:side="verso"> | ||
930 | </t:titlepage-before> | ||
931 | </t:titlepage> | ||
932 | |||
933 | <!-- ==================================================================== --> | ||
934 | |||
935 | <!-- The indexdiv.title template is used so that manual and --> | ||
936 | <!-- automatically generated indexdiv titles get the same --> | ||
937 | <!-- formatting. --> | ||
938 | |||
939 | <t:titlepage t:element="indexdiv" t:wrapper="fo:block"> | ||
940 | <t:titlepage-content t:side="recto"> | ||
941 | <title t:force="1" | ||
942 | t:named-template="indexdiv.title" | ||
943 | param:title="title"/> | ||
944 | <subtitle | ||
945 | font-family="{$title.fontset}"/> | ||
946 | </t:titlepage-content> | ||
947 | |||
948 | <t:titlepage-content t:side="verso"> | ||
949 | </t:titlepage-content> | ||
950 | |||
951 | <t:titlepage-separator> | ||
952 | </t:titlepage-separator> | ||
953 | |||
954 | <t:titlepage-before t:side="recto"> | ||
955 | </t:titlepage-before> | ||
956 | |||
957 | <t:titlepage-before t:side="verso"> | ||
958 | </t:titlepage-before> | ||
959 | </t:titlepage> | ||
960 | |||
961 | <!-- ==================================================================== --> | ||
962 | |||
963 | <t:titlepage t:element="setindex" t:wrapper="fo:block"> | ||
964 | <t:titlepage-content t:side="recto"> | ||
965 | <title | ||
966 | t:force="1" | ||
967 | t:named-template="component.title" | ||
968 | param:node="ancestor-or-self::setindex[1]" | ||
969 | param:pagewide="1" | ||
970 | margin-left="0pt" | ||
971 | font-size="&hsize5;" | ||
972 | font-family="{$title.fontset}" | ||
973 | font-weight="bold"/> | ||
974 | <subtitle | ||
975 | font-family="{$title.fontset}"/> | ||
976 | </t:titlepage-content> | ||
977 | |||
978 | <t:titlepage-content t:side="verso"> | ||
979 | </t:titlepage-content> | ||
980 | |||
981 | <t:titlepage-separator> | ||
982 | </t:titlepage-separator> | ||
983 | |||
984 | <t:titlepage-before t:side="recto"> | ||
985 | </t:titlepage-before> | ||
986 | |||
987 | <t:titlepage-before t:side="verso"> | ||
988 | </t:titlepage-before> | ||
989 | </t:titlepage> | ||
990 | |||
991 | <!-- ==================================================================== --> | ||
992 | |||
993 | <t:titlepage t:element="colophon" t:wrapper="fo:block"> | ||
994 | <t:titlepage-content t:side="recto"> | ||
995 | <title | ||
996 | t:force="1" | ||
997 | t:named-template="component.title" | ||
998 | param:node="ancestor-or-self::colophon[1]" | ||
999 | margin-left="{$title.margin.left}" | ||
1000 | font-size="&hsize5;" | ||
1001 | font-family="{$title.fontset}" | ||
1002 | font-weight="bold"/> | ||
1003 | <subtitle | ||
1004 | font-family="{$title.fontset}"/> | ||
1005 | </t:titlepage-content> | ||
1006 | |||
1007 | <t:titlepage-content t:side="verso"> | ||
1008 | </t:titlepage-content> | ||
1009 | |||
1010 | <t:titlepage-separator> | ||
1011 | </t:titlepage-separator> | ||
1012 | |||
1013 | <t:titlepage-before t:side="recto"> | ||
1014 | </t:titlepage-before> | ||
1015 | |||
1016 | <t:titlepage-before t:side="verso"> | ||
1017 | </t:titlepage-before> | ||
1018 | </t:titlepage> | ||
1019 | |||
1020 | <!-- ==================================================================== --> | ||
1021 | |||
1022 | <t:titlepage t:element="table.of.contents" t:wrapper="fo:block"> | ||
1023 | <t:titlepage-content t:side="recto"> | ||
1024 | <title | ||
1025 | t:force="1" | ||
1026 | t:named-template="gentext" | ||
1027 | param:key="'TableofContents'" | ||
1028 | space-before.minimum="1em" | ||
1029 | space-before.optimum="1.5em" | ||
1030 | space-before.maximum="2em" | ||
1031 | space-after="0.5em" | ||
1032 | margin-left="{$title.margin.left}" | ||
1033 | font-size="&hsize3;" | ||
1034 | font-weight="bold" | ||
1035 | font-family="{$title.fontset}"/> | ||
1036 | </t:titlepage-content> | ||
1037 | |||
1038 | <t:titlepage-content t:side="verso"> | ||
1039 | </t:titlepage-content> | ||
1040 | |||
1041 | <t:titlepage-separator> | ||
1042 | </t:titlepage-separator> | ||
1043 | |||
1044 | <t:titlepage-before t:side="recto"> | ||
1045 | </t:titlepage-before> | ||
1046 | |||
1047 | <t:titlepage-before t:side="verso"> | ||
1048 | </t:titlepage-before> | ||
1049 | </t:titlepage> | ||
1050 | |||
1051 | <t:titlepage t:element="list.of.tables" t:wrapper="fo:block"> | ||
1052 | <t:titlepage-content t:side="recto"> | ||
1053 | <title | ||
1054 | t:force="1" | ||
1055 | t:named-template="gentext" | ||
1056 | param:key="'ListofTables'" | ||
1057 | space-before.minimum="1em" | ||
1058 | space-before.optimum="1.5em" | ||
1059 | space-before.maximum="2em" | ||
1060 | space-after="0.5em" | ||
1061 | margin-left="{$title.margin.left}" | ||
1062 | font-size="&hsize3;" | ||
1063 | font-weight="bold" | ||
1064 | font-family="{$title.fontset}"/> | ||
1065 | </t:titlepage-content> | ||
1066 | |||
1067 | <t:titlepage-content t:side="verso"> | ||
1068 | </t:titlepage-content> | ||
1069 | |||
1070 | <t:titlepage-separator> | ||
1071 | </t:titlepage-separator> | ||
1072 | |||
1073 | <t:titlepage-before t:side="recto"> | ||
1074 | </t:titlepage-before> | ||
1075 | |||
1076 | <t:titlepage-before t:side="verso"> | ||
1077 | </t:titlepage-before> | ||
1078 | </t:titlepage> | ||
1079 | |||
1080 | <t:titlepage t:element="list.of.figures" t:wrapper="fo:block"> | ||
1081 | <t:titlepage-content t:side="recto"> | ||
1082 | <title | ||
1083 | t:force="1" | ||
1084 | t:named-template="gentext" | ||
1085 | param:key="'ListofFigures'" | ||
1086 | space-before.minimum="1em" | ||
1087 | space-before.optimum="1.5em" | ||
1088 | space-before.maximum="2em" | ||
1089 | space-after="0.5em" | ||
1090 | margin-left="{$title.margin.left}" | ||
1091 | font-size="&hsize3;" | ||
1092 | font-weight="bold" | ||
1093 | font-family="{$title.fontset}"/> | ||
1094 | </t:titlepage-content> | ||
1095 | |||
1096 | <t:titlepage-content t:side="verso"> | ||
1097 | </t:titlepage-content> | ||
1098 | |||
1099 | <t:titlepage-separator> | ||
1100 | </t:titlepage-separator> | ||
1101 | |||
1102 | <t:titlepage-before t:side="recto"> | ||
1103 | </t:titlepage-before> | ||
1104 | |||
1105 | <t:titlepage-before t:side="verso"> | ||
1106 | </t:titlepage-before> | ||
1107 | </t:titlepage> | ||
1108 | |||
1109 | <t:titlepage t:element="list.of.examples" t:wrapper="fo:block"> | ||
1110 | <t:titlepage-content t:side="recto"> | ||
1111 | <title | ||
1112 | t:force="1" | ||
1113 | t:named-template="gentext" | ||
1114 | param:key="'ListofExamples'" | ||
1115 | space-before.minimum="1em" | ||
1116 | space-before.optimum="1.5em" | ||
1117 | space-before.maximum="2em" | ||
1118 | space-after="0.5em" | ||
1119 | margin-left="{$title.margin.left}" | ||
1120 | font-size="&hsize3;" | ||
1121 | font-weight="bold" | ||
1122 | font-family="{$title.fontset}"/> | ||
1123 | </t:titlepage-content> | ||
1124 | |||
1125 | <t:titlepage-content t:side="verso"> | ||
1126 | </t:titlepage-content> | ||
1127 | |||
1128 | <t:titlepage-separator> | ||
1129 | </t:titlepage-separator> | ||
1130 | |||
1131 | <t:titlepage-before t:side="recto"> | ||
1132 | </t:titlepage-before> | ||
1133 | |||
1134 | <t:titlepage-before t:side="verso"> | ||
1135 | </t:titlepage-before> | ||
1136 | </t:titlepage> | ||
1137 | |||
1138 | <t:titlepage t:element="list.of.equations" t:wrapper="fo:block"> | ||
1139 | <t:titlepage-content t:side="recto"> | ||
1140 | <title | ||
1141 | t:force="1" | ||
1142 | t:named-template="gentext" | ||
1143 | param:key="'ListofEquations'" | ||
1144 | space-before.minimum="1em" | ||
1145 | space-before.optimum="1.5em" | ||
1146 | space-before.maximum="2em" | ||
1147 | space-after="0.5em" | ||
1148 | margin-left="{$title.margin.left}" | ||
1149 | font-size="&hsize3;" | ||
1150 | font-weight="bold" | ||
1151 | font-family="{$title.fontset}"/> | ||
1152 | </t:titlepage-content> | ||
1153 | |||
1154 | <t:titlepage-content t:side="verso"> | ||
1155 | </t:titlepage-content> | ||
1156 | |||
1157 | <t:titlepage-separator> | ||
1158 | </t:titlepage-separator> | ||
1159 | |||
1160 | <t:titlepage-before t:side="recto"> | ||
1161 | </t:titlepage-before> | ||
1162 | |||
1163 | <t:titlepage-before t:side="verso"> | ||
1164 | </t:titlepage-before> | ||
1165 | </t:titlepage> | ||
1166 | |||
1167 | <t:titlepage t:element="list.of.procedures" t:wrapper="fo:block"> | ||
1168 | <t:titlepage-content t:side="recto"> | ||
1169 | <title | ||
1170 | t:force="1" | ||
1171 | t:named-template="gentext" | ||
1172 | param:key="'ListofProcedures'" | ||
1173 | space-before.minimum="1em" | ||
1174 | space-before.optimum="1.5em" | ||
1175 | space-before.maximum="2em" | ||
1176 | space-after="0.5em" | ||
1177 | margin-left="{$title.margin.left}" | ||
1178 | font-size="&hsize3;" | ||
1179 | font-weight="bold" | ||
1180 | font-family="{$title.fontset}"/> | ||
1181 | </t:titlepage-content> | ||
1182 | |||
1183 | <t:titlepage-content t:side="verso"> | ||
1184 | </t:titlepage-content> | ||
1185 | |||
1186 | <t:titlepage-separator> | ||
1187 | </t:titlepage-separator> | ||
1188 | |||
1189 | <t:titlepage-before t:side="recto"> | ||
1190 | </t:titlepage-before> | ||
1191 | |||
1192 | <t:titlepage-before t:side="verso"> | ||
1193 | </t:titlepage-before> | ||
1194 | </t:titlepage> | ||
1195 | |||
1196 | <t:titlepage t:element="list.of.unknowns" t:wrapper="fo:block"> | ||
1197 | <t:titlepage-content t:side="recto"> | ||
1198 | <title | ||
1199 | t:force="1" | ||
1200 | t:named-template="gentext" | ||
1201 | param:key="'ListofUnknown'" | ||
1202 | space-before.minimum="1em" | ||
1203 | space-before.optimum="1.5em" | ||
1204 | space-before.maximum="2em" | ||
1205 | space-after="0.5em" | ||
1206 | margin-left="{$title.margin.left}" | ||
1207 | font-size="&hsize3;" | ||
1208 | font-weight="bold" | ||
1209 | font-family="{$title.fontset}"/> | ||
1210 | </t:titlepage-content> | ||
1211 | |||
1212 | <t:titlepage-content t:side="verso"> | ||
1213 | </t:titlepage-content> | ||
1214 | |||
1215 | <t:titlepage-separator> | ||
1216 | </t:titlepage-separator> | ||
1217 | |||
1218 | <t:titlepage-before t:side="recto"> | ||
1219 | </t:titlepage-before> | ||
1220 | |||
1221 | <t:titlepage-before t:side="verso"> | ||
1222 | </t:titlepage-before> | ||
1223 | </t:titlepage> | ||
1224 | |||
1225 | <!-- ==================================================================== --> | ||
1226 | |||
1227 | </t:templates> | ||
diff --git a/documentation/template/yocto-project-qs.png b/documentation/template/yocto-project-qs.png new file mode 100644 index 0000000..333442e --- /dev/null +++ b/documentation/template/yocto-project-qs.png | |||
Binary files differ | |||
diff --git a/documentation/tools/eclipse-help.sed b/documentation/tools/eclipse-help.sed new file mode 100644 index 0000000..38690bc --- /dev/null +++ b/documentation/tools/eclipse-help.sed | |||
@@ -0,0 +1,18 @@ | |||
1 | # Processes poky-ref-manual and yocto-project-qs manual (<word>-<word>-<word> style) | ||
2 | # For example: | ||
3 | # "ulink" href="http://www.yoctoproject.org/docs/1.3/poky-ref-manual/poky-ref-manual.html#faq" | ||
4 | # -> "link" href="../poky-ref-manual/faq.html" | ||
5 | s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/[^\/]*\/\([a-z]*-[a-z]*-[a-z]*\)\/[a-z]*-[a-z]*-[a-z]*.html#\([^\"]*\)\"/\"link\" href=\"\.\.\/\1\/\2.html\"/g | ||
6 | |||
7 | # Processes all other manuals (<word>-<word> style) | ||
8 | # For example: | ||
9 | # "ulink" href="http://www.yoctoproject.org/docs/1.3/kernel-manual/kernel-manual.html#faq" | ||
10 | # -> "link" href="../kernel-manual/faq.html" | ||
11 | s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/[^\/]*\/\([a-z]*-[a-z]*\)\/[a-z]*-[a-z]*.html#\([^\"]*\)\"/\"link\" href=\"\.\.\/\1\/\2.html\"/g | ||
12 | |||
13 | # Process cases where just an external manual is referenced without an id anchor | ||
14 | # For example: | ||
15 | # "ulink" href="http://www.yoctoproject.org/docs/1.3/kernel-manual/kernel-manual.html | ||
16 | # -> "link" href="../kernel-manual/index.html" | ||
17 | s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/[^\/]*\/\([a-z]*-[a-z]*-[a-z]*\)\/[a-z]*-[a-z]*-[a-z]*.html\"/\"link\" href=\"\.\.\/\1\/index.html\"/g | ||
18 | s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/[^\/]*\/\([a-z]*-[a-z]*\)\/[a-z]*-[a-z]*.html\"/\"link\" href=\"\.\.\/\1\/index.html\"/g | ||
diff --git a/documentation/tools/mega-manual.sed b/documentation/tools/mega-manual.sed new file mode 100644 index 0000000..69a5b82 --- /dev/null +++ b/documentation/tools/mega-manual.sed | |||
@@ -0,0 +1,14 @@ | |||
1 | # Processes ref-manual and yocto-project-qs manual (<word>-<word>-<word> style) | ||
2 | s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.7\/[a-z]*-[a-z]*-[a-z]*\/[a-z]*-[a-z]*-[a-z]*.html#/\"link\" href=\"#/g | ||
3 | |||
4 | # Processes all other manuals (<word>-<word> style) | ||
5 | s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.7\/[a-z]*-[a-z]*\/[a-z]*-[a-z]*.html#/\"link\" href=\"#/g | ||
6 | |||
7 | # Process cases where just an external manual is referenced without an id anchor | ||
8 | s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.7\/yocto-project-qs\/yocto-project-qs.html\" target=\"_top\">Yocto Project Quick Start<\/a>/Yocto Project Quick Start/g | ||
9 | s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.7\/dev-manual\/dev-manual.html\" target=\"_top\">Yocto Project Development Manual<\/a>/Yocto Project Development Manual/g | ||
10 | s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.7\/adt-manual\/adt-manual.html\" target=\"_top\">Yocto Project Application Developer's Guide<\/a>/Yocto Project Application Developer's Guide/g | ||
11 | s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.7\/bsp-guide\/bsp-guide.html\" target=\"_top\">Yocto Project Board Support Package (BSP) Developer's Guide<\/a>/Yocto Project Board Support Package (BSP) Developer's Guide/g | ||
12 | s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.7\/profile-manual\/profile-manual.html\" target=\"_top\">Yocto Project Profiling and Tracing Manual<\/a>/Yocto Project Profiling and Tracing Manual/g | ||
13 | s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.7\/kernel-dev\/kernel-dev.html\" target=\"_top\">Yocto Project Linux Kernel Development Manual<\/a>/Yocto Project Linux Kernel Development Manual/g | ||
14 | s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/1.7\/ref-manual\/ref-manual.html\" target=\"_top\">Yocto Project Reference Manual<\/a>/Yocto Project Reference Manual/g | ||
diff --git a/documentation/tools/poky-docbook-to-pdf b/documentation/tools/poky-docbook-to-pdf new file mode 100755 index 0000000..f55fd27 --- /dev/null +++ b/documentation/tools/poky-docbook-to-pdf | |||
@@ -0,0 +1,51 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if [ -z "$1" -o -z "$2" ]; then | ||
4 | echo "usage: [-v] $0 <docbook file> <templatedir>" | ||
5 | echo | ||
6 | echo "*NOTE* you need xsltproc, fop and nwalsh docbook stylesheets" | ||
7 | echo " installed for this to work!" | ||
8 | echo | ||
9 | exit 0 | ||
10 | fi | ||
11 | |||
12 | FO=`echo $1 | sed s/.xml/.fo/` || exit 1 | ||
13 | PDF=`echo $1 | sed s/.xml/.pdf/` || exit 1 | ||
14 | TEMPLATEDIR=$2 | ||
15 | |||
16 | ## | ||
17 | # These URI should be rewritten by your distribution's xml catalog to | ||
18 | # match your localy installed XSL stylesheets. | ||
19 | XSL_BASE_URI="http://docbook.sourceforge.net/release/xsl/current" | ||
20 | |||
21 | # Creates a temporary XSL stylesheet based on titlepage.xsl | ||
22 | xsltproc -o /tmp/titlepage.xsl \ | ||
23 | --xinclude \ | ||
24 | $XSL_BASE_URI/template/titlepage.xsl \ | ||
25 | $TEMPLATEDIR/titlepage.templates.xml || exit 1 | ||
26 | |||
27 | # Creates the file needed for FOP | ||
28 | xsltproc --xinclude \ | ||
29 | --stringparam hyphenate false \ | ||
30 | --stringparam formal.title.placement "figure after" \ | ||
31 | --stringparam ulink.show 1 \ | ||
32 | --stringparam body.font.master 9 \ | ||
33 | --stringparam title.font.master 11 \ | ||
34 | --stringparam draft.watermark.image "$TEMPLATEDIR/draft.png" \ | ||
35 | --stringparam chapter.autolabel 1 \ | ||
36 | --stringparam appendix.autolabel A \ | ||
37 | --stringparam section.autolabel 1 \ | ||
38 | --stringparam section.label.includes.component.label 1 \ | ||
39 | --output $FO \ | ||
40 | $TEMPLATEDIR/poky-db-pdf.xsl \ | ||
41 | $1 || exit 1 | ||
42 | |||
43 | # Invokes the Java version of FOP. Uses the additional configuration file common/fop-config.xml | ||
44 | fop -c $TEMPLATEDIR/fop-config.xml -fo $FO -pdf $PDF || exit 1 | ||
45 | |||
46 | rm -f $FO | ||
47 | rm -f /tmp/titlepage.xsl | ||
48 | |||
49 | echo | ||
50 | echo " #### Success! $PDF ready. ####" | ||
51 | echo | ||
diff --git a/documentation/yocto-project-qs/figures/building-an-image.png b/documentation/yocto-project-qs/figures/building-an-image.png new file mode 100755 index 0000000..1fbea5a --- /dev/null +++ b/documentation/yocto-project-qs/figures/building-an-image.png | |||
Binary files differ | |||
diff --git a/documentation/yocto-project-qs/figures/using-a-pre-built-image.png b/documentation/yocto-project-qs/figures/using-a-pre-built-image.png new file mode 100644 index 0000000..b03130d --- /dev/null +++ b/documentation/yocto-project-qs/figures/using-a-pre-built-image.png | |||
Binary files differ | |||
diff --git a/documentation/yocto-project-qs/figures/yocto-environment.png b/documentation/yocto-project-qs/figures/yocto-environment.png new file mode 100644 index 0000000..82b7a55 --- /dev/null +++ b/documentation/yocto-project-qs/figures/yocto-environment.png | |||
Binary files differ | |||
diff --git a/documentation/yocto-project-qs/figures/yocto-project-transp.png b/documentation/yocto-project-qs/figures/yocto-project-transp.png new file mode 100755 index 0000000..31d2b14 --- /dev/null +++ b/documentation/yocto-project-qs/figures/yocto-project-transp.png | |||
Binary files differ | |||
diff --git a/documentation/yocto-project-qs/qs-style.css b/documentation/yocto-project-qs/qs-style.css new file mode 100644 index 0000000..235c85a --- /dev/null +++ b/documentation/yocto-project-qs/qs-style.css | |||
@@ -0,0 +1,983 @@ | |||
1 | /* | ||
2 | Generic XHTML / DocBook XHTML CSS Stylesheet. | ||
3 | |||
4 | Browser wrangling and typographic design by | ||
5 | Oyvind Kolas / pippin@gimp.org | ||
6 | |||
7 | Customised for Poky by | ||
8 | Matthew Allum / mallum@o-hand.com | ||
9 | |||
10 | Thanks to: | ||
11 | Liam R. E. Quin | ||
12 | William Skaggs | ||
13 | Jakub Steiner | ||
14 | |||
15 | Structure | ||
16 | --------- | ||
17 | |||
18 | The stylesheet is divided into the following sections: | ||
19 | |||
20 | Positioning | ||
21 | Margins, paddings, width, font-size, clearing. | ||
22 | Decorations | ||
23 | Borders, style | ||
24 | Colors | ||
25 | Colors | ||
26 | Graphics | ||
27 | Graphical backgrounds | ||
28 | Nasty IE tweaks | ||
29 | Workarounds needed to make it work in internet explorer, | ||
30 | currently makes the stylesheet non validating, but up until | ||
31 | this point it is validating. | ||
32 | Mozilla extensions | ||
33 | Transparency for footer | ||
34 | Rounded corners on boxes | ||
35 | |||
36 | */ | ||
37 | |||
38 | |||
39 | /*************** / | ||
40 | / Positioning / | ||
41 | / ***************/ | ||
42 | |||
43 | body { | ||
44 | font-family: Verdana, Sans, sans-serif; | ||
45 | |||
46 | min-width: 640px; | ||
47 | width: 80%; | ||
48 | margin: 0em auto; | ||
49 | padding: 2em 5em 5em 5em; | ||
50 | color: #333; | ||
51 | } | ||
52 | |||
53 | h1,h2,h3,h4,h5,h6,h7 { | ||
54 | font-family: Arial, Sans; | ||
55 | color: #00557D; | ||
56 | clear: both; | ||
57 | } | ||
58 | |||
59 | h1 { | ||
60 | font-size: 2em; | ||
61 | text-align: left; | ||
62 | padding: 0em 0em 0em 0em; | ||
63 | margin: 2em 0em 0em 0em; | ||
64 | } | ||
65 | |||
66 | h2.subtitle { | ||
67 | margin: 0.10em 0em 3.0em 0em; | ||
68 | padding: 0em 0em 0em 0em; | ||
69 | font-size: 1.8em; | ||
70 | padding-left: 20%; | ||
71 | font-weight: normal; | ||
72 | font-style: italic; | ||
73 | } | ||
74 | |||
75 | h2 { | ||
76 | margin: 2em 0em 0.66em 0em; | ||
77 | padding: 0.5em 0em 0em 0em; | ||
78 | font-size: 1.5em; | ||
79 | font-weight: bold; | ||
80 | } | ||
81 | |||
82 | h3.subtitle { | ||
83 | margin: 0em 0em 1em 0em; | ||
84 | padding: 0em 0em 0em 0em; | ||
85 | font-size: 142.14%; | ||
86 | text-align: right; | ||
87 | } | ||
88 | |||
89 | h3 { | ||
90 | margin: 1em 0em 0.5em 0em; | ||
91 | padding: 1em 0em 0em 0em; | ||
92 | font-size: 140%; | ||
93 | font-weight: bold; | ||
94 | } | ||
95 | |||
96 | h4 { | ||
97 | margin: 1em 0em 0.5em 0em; | ||
98 | padding: 1em 0em 0em 0em; | ||
99 | font-size: 120%; | ||
100 | font-weight: bold; | ||
101 | } | ||
102 | |||
103 | h5 { | ||
104 | margin: 1em 0em 0.5em 0em; | ||
105 | padding: 1em 0em 0em 0em; | ||
106 | font-size: 110%; | ||
107 | font-weight: bold; | ||
108 | } | ||
109 | |||
110 | h6 { | ||
111 | margin: 1em 0em 0em 0em; | ||
112 | padding: 1em 0em 0em 0em; | ||
113 | font-size: 110%; | ||
114 | font-weight: bold; | ||
115 | } | ||
116 | |||
117 | .authorgroup { | ||
118 | background-color: transparent; | ||
119 | background-repeat: no-repeat; | ||
120 | padding-top: 256px; | ||
121 | background-position: top; | ||
122 | margin-top: -256px; | ||
123 | padding-right: 50px; | ||
124 | margin-left: 50px; | ||
125 | text-align: center; | ||
126 | width: 600px; | ||
127 | } | ||
128 | |||
129 | h3.author { | ||
130 | margin: 0em 0me 0em 0em; | ||
131 | padding: 0em 0em 0em 0em; | ||
132 | font-weight: normal; | ||
133 | font-size: 100%; | ||
134 | color: #333; | ||
135 | clear: both; | ||
136 | } | ||
137 | |||
138 | .author tt.email { | ||
139 | font-size: 66%; | ||
140 | } | ||
141 | |||
142 | .titlepage hr { | ||
143 | width: 0em; | ||
144 | clear: both; | ||
145 | } | ||
146 | |||
147 | .revhistory { | ||
148 | padding-top: 2em; | ||
149 | clear: both; | ||
150 | } | ||
151 | |||
152 | .toc, | ||
153 | .list-of-tables, | ||
154 | .list-of-examples, | ||
155 | .list-of-figures { | ||
156 | padding: 1.33em 0em 2.5em 0em; | ||
157 | color: #00557D; | ||
158 | } | ||
159 | |||
160 | .toc p, | ||
161 | .list-of-tables p, | ||
162 | .list-of-figures p, | ||
163 | .list-of-examples p { | ||
164 | padding: 0em 0em 0em 0em; | ||
165 | padding: 0em 0em 0.3em; | ||
166 | margin: 1.5em 0em 0em 0em; | ||
167 | } | ||
168 | |||
169 | .toc p b, | ||
170 | .list-of-tables p b, | ||
171 | .list-of-figures p b, | ||
172 | .list-of-examples p b{ | ||
173 | font-size: 100.0%; | ||
174 | font-weight: bold; | ||
175 | } | ||
176 | |||
177 | .toc dl, | ||
178 | .list-of-tables dl, | ||
179 | .list-of-figures dl, | ||
180 | .list-of-examples dl { | ||
181 | margin: 0em 0em 0.5em 0em; | ||
182 | padding: 0em 0em 0em 0em; | ||
183 | } | ||
184 | |||
185 | .toc dt { | ||
186 | margin: 0em 0em 0em 0em; | ||
187 | padding: 0em 0em 0em 0em; | ||
188 | } | ||
189 | |||
190 | .toc dd { | ||
191 | margin: 0em 0em 0em 2.6em; | ||
192 | padding: 0em 0em 0em 0em; | ||
193 | } | ||
194 | |||
195 | div.glossary dl, | ||
196 | div.variablelist dl { | ||
197 | } | ||
198 | |||
199 | .glossary dl dt, | ||
200 | .variablelist dl dt, | ||
201 | .variablelist dl dt span.term { | ||
202 | font-weight: normal; | ||
203 | width: 20em; | ||
204 | text-align: right; | ||
205 | } | ||
206 | |||
207 | .variablelist dl dt { | ||
208 | margin-top: 0.5em; | ||
209 | } | ||
210 | |||
211 | .glossary dl dd, | ||
212 | .variablelist dl dd { | ||
213 | margin-top: -1em; | ||
214 | margin-left: 25.5em; | ||
215 | } | ||
216 | |||
217 | .glossary dd p, | ||
218 | .variablelist dd p { | ||
219 | margin-top: 0em; | ||
220 | margin-bottom: 1em; | ||
221 | } | ||
222 | |||
223 | |||
224 | div.calloutlist table td { | ||
225 | padding: 0em 0em 0em 0em; | ||
226 | margin: 0em 0em 0em 0em; | ||
227 | } | ||
228 | |||
229 | div.calloutlist table td p { | ||
230 | margin-top: 0em; | ||
231 | margin-bottom: 1em; | ||
232 | } | ||
233 | |||
234 | div p.copyright { | ||
235 | text-align: left; | ||
236 | } | ||
237 | |||
238 | div.legalnotice p.legalnotice-title { | ||
239 | margin-bottom: 0em; | ||
240 | } | ||
241 | |||
242 | p { | ||
243 | line-height: 1.5em; | ||
244 | margin-top: 0em; | ||
245 | |||
246 | } | ||
247 | |||
248 | dl { | ||
249 | padding-top: 0em; | ||
250 | } | ||
251 | |||
252 | hr { | ||
253 | border: solid 1px; | ||
254 | } | ||
255 | |||
256 | |||
257 | .mediaobject, | ||
258 | .mediaobjectco { | ||
259 | text-align: center; | ||
260 | } | ||
261 | |||
262 | img { | ||
263 | border: none; | ||
264 | } | ||
265 | |||
266 | ul { | ||
267 | padding: 0em 0em 0em 1.5em; | ||
268 | } | ||
269 | |||
270 | ul li { | ||
271 | padding: 0em 0em 0em 0em; | ||
272 | } | ||
273 | |||
274 | ul li p { | ||
275 | text-align: left; | ||
276 | } | ||
277 | |||
278 | table { | ||
279 | width :100%; | ||
280 | } | ||
281 | |||
282 | th { | ||
283 | padding: 0.25em; | ||
284 | text-align: left; | ||
285 | font-weight: normal; | ||
286 | vertical-align: top; | ||
287 | } | ||
288 | |||
289 | td { | ||
290 | padding: 0.25em; | ||
291 | vertical-align: top; | ||
292 | } | ||
293 | |||
294 | p a[id] { | ||
295 | margin: 0px; | ||
296 | padding: 0px; | ||
297 | display: inline; | ||
298 | background-image: none; | ||
299 | } | ||
300 | |||
301 | a { | ||
302 | text-decoration: underline; | ||
303 | color: #444; | ||
304 | } | ||
305 | |||
306 | pre { | ||
307 | overflow: auto; | ||
308 | } | ||
309 | |||
310 | a:hover { | ||
311 | text-decoration: underline; | ||
312 | /*font-weight: bold;*/ | ||
313 | } | ||
314 | |||
315 | /* This style defines how the permalink character | ||
316 | appears by itself and when hovered over with | ||
317 | the mouse. */ | ||
318 | |||
319 | [alt='Permalink'] { color: #eee; } | ||
320 | [alt='Permalink']:hover { color: black; } | ||
321 | |||
322 | |||
323 | div.informalfigure, | ||
324 | div.informalexample, | ||
325 | div.informaltable, | ||
326 | div.figure, | ||
327 | div.table, | ||
328 | div.example { | ||
329 | margin: 1em 0em; | ||
330 | padding: 1em; | ||
331 | page-break-inside: avoid; | ||
332 | } | ||
333 | |||
334 | |||
335 | div.informalfigure p.title b, | ||
336 | div.informalexample p.title b, | ||
337 | div.informaltable p.title b, | ||
338 | div.figure p.title b, | ||
339 | div.example p.title b, | ||
340 | div.table p.title b{ | ||
341 | padding-top: 0em; | ||
342 | margin-top: 0em; | ||
343 | font-size: 100%; | ||
344 | font-weight: normal; | ||
345 | } | ||
346 | |||
347 | .mediaobject .caption, | ||
348 | .mediaobject .caption p { | ||
349 | text-align: center; | ||
350 | font-size: 80%; | ||
351 | padding-top: 0.5em; | ||
352 | padding-bottom: 0.5em; | ||
353 | } | ||
354 | |||
355 | .epigraph { | ||
356 | padding-left: 55%; | ||
357 | margin-bottom: 1em; | ||
358 | } | ||
359 | |||
360 | .epigraph p { | ||
361 | text-align: left; | ||
362 | } | ||
363 | |||
364 | .epigraph .quote { | ||
365 | font-style: italic; | ||
366 | } | ||
367 | .epigraph .attribution { | ||
368 | font-style: normal; | ||
369 | text-align: right; | ||
370 | } | ||
371 | |||
372 | span.application { | ||
373 | font-style: italic; | ||
374 | } | ||
375 | |||
376 | .programlisting { | ||
377 | font-family: monospace; | ||
378 | font-size: 80%; | ||
379 | white-space: pre; | ||
380 | margin: 1.33em 0em; | ||
381 | padding: 1.33em; | ||
382 | } | ||
383 | |||
384 | .tip, | ||
385 | .warning, | ||
386 | .caution, | ||
387 | .note { | ||
388 | margin-top: 1em; | ||
389 | margin-bottom: 1em; | ||
390 | |||
391 | } | ||
392 | |||
393 | /* force full width of table within div */ | ||
394 | .tip table, | ||
395 | .warning table, | ||
396 | .caution table, | ||
397 | .note table { | ||
398 | border: none; | ||
399 | width: 100%; | ||
400 | } | ||
401 | |||
402 | |||
403 | .tip table th, | ||
404 | .warning table th, | ||
405 | .caution table th, | ||
406 | .note table th { | ||
407 | padding: 0.8em 0.0em 0.0em 0.0em; | ||
408 | margin : 0em 0em 0em 0em; | ||
409 | } | ||
410 | |||
411 | .tip p, | ||
412 | .warning p, | ||
413 | .caution p, | ||
414 | .note p { | ||
415 | margin-top: 0.5em; | ||
416 | margin-bottom: 0.5em; | ||
417 | padding-right: 1em; | ||
418 | text-align: left; | ||
419 | } | ||
420 | |||
421 | .acronym { | ||
422 | text-transform: uppercase; | ||
423 | } | ||
424 | |||
425 | b.keycap, | ||
426 | .keycap { | ||
427 | padding: 0.09em 0.3em; | ||
428 | margin: 0em; | ||
429 | } | ||
430 | |||
431 | .itemizedlist li { | ||
432 | clear: none; | ||
433 | } | ||
434 | |||
435 | .filename { | ||
436 | font-size: medium; | ||
437 | font-family: Courier, monospace; | ||
438 | } | ||
439 | |||
440 | |||
441 | div.navheader, div.heading{ | ||
442 | position: absolute; | ||
443 | left: 0em; | ||
444 | top: 0em; | ||
445 | width: 100%; | ||
446 | background-color: #cdf; | ||
447 | width: 100%; | ||
448 | } | ||
449 | |||
450 | div.navfooter, div.footing{ | ||
451 | position: fixed; | ||
452 | left: 0em; | ||
453 | bottom: 0em; | ||
454 | background-color: #eee; | ||
455 | width: 100%; | ||
456 | } | ||
457 | |||
458 | |||
459 | div.navheader td, | ||
460 | div.navfooter td { | ||
461 | font-size: 66%; | ||
462 | } | ||
463 | |||
464 | div.navheader table th { | ||
465 | /*font-family: Georgia, Times, serif;*/ | ||
466 | /*font-size: x-large;*/ | ||
467 | font-size: 80%; | ||
468 | } | ||
469 | |||
470 | div.navheader table { | ||
471 | border-left: 0em; | ||
472 | border-right: 0em; | ||
473 | border-top: 0em; | ||
474 | width: 100%; | ||
475 | } | ||
476 | |||
477 | div.navfooter table { | ||
478 | border-left: 0em; | ||
479 | border-right: 0em; | ||
480 | border-bottom: 0em; | ||
481 | width: 100%; | ||
482 | } | ||
483 | |||
484 | div.navheader table td a, | ||
485 | div.navfooter table td a { | ||
486 | color: #777; | ||
487 | text-decoration: none; | ||
488 | } | ||
489 | |||
490 | /* normal text in the footer */ | ||
491 | div.navfooter table td { | ||
492 | color: black; | ||
493 | } | ||
494 | |||
495 | div.navheader table td a:visited, | ||
496 | div.navfooter table td a:visited { | ||
497 | color: #444; | ||
498 | } | ||
499 | |||
500 | |||
501 | /* links in header and footer */ | ||
502 | div.navheader table td a:hover, | ||
503 | div.navfooter table td a:hover { | ||
504 | text-decoration: underline; | ||
505 | background-color: transparent; | ||
506 | color: #33a; | ||
507 | } | ||
508 | |||
509 | div.navheader hr, | ||
510 | div.navfooter hr { | ||
511 | display: none; | ||
512 | } | ||
513 | |||
514 | |||
515 | .qandaset tr.question td p { | ||
516 | margin: 0em 0em 1em 0em; | ||
517 | padding: 0em 0em 0em 0em; | ||
518 | } | ||
519 | |||
520 | .qandaset tr.answer td p { | ||
521 | margin: 0em 0em 1em 0em; | ||
522 | padding: 0em 0em 0em 0em; | ||
523 | } | ||
524 | .answer td { | ||
525 | padding-bottom: 1.5em; | ||
526 | } | ||
527 | |||
528 | .emphasis { | ||
529 | font-weight: bold; | ||
530 | } | ||
531 | |||
532 | |||
533 | /************* / | ||
534 | / decorations / | ||
535 | / *************/ | ||
536 | |||
537 | .titlepage { | ||
538 | } | ||
539 | |||
540 | .part .title { | ||
541 | } | ||
542 | |||
543 | .subtitle { | ||
544 | border: none; | ||
545 | } | ||
546 | |||
547 | /* | ||
548 | h1 { | ||
549 | border: none; | ||
550 | } | ||
551 | |||
552 | h2 { | ||
553 | border-top: solid 0.2em; | ||
554 | border-bottom: solid 0.06em; | ||
555 | } | ||
556 | |||
557 | h3 { | ||
558 | border-top: 0em; | ||
559 | border-bottom: solid 0.06em; | ||
560 | } | ||
561 | |||
562 | h4 { | ||
563 | border: 0em; | ||
564 | border-bottom: solid 0.06em; | ||
565 | } | ||
566 | |||
567 | h5 { | ||
568 | border: 0em; | ||
569 | } | ||
570 | */ | ||
571 | |||
572 | .programlisting { | ||
573 | border: solid 1px; | ||
574 | } | ||
575 | |||
576 | div.figure, | ||
577 | div.table, | ||
578 | div.informalfigure, | ||
579 | div.informaltable, | ||
580 | div.informalexample, | ||
581 | div.example { | ||
582 | border: 1px solid; | ||
583 | } | ||
584 | |||
585 | |||
586 | |||
587 | .tip, | ||
588 | .warning, | ||
589 | .caution, | ||
590 | .note { | ||
591 | border: 1px solid; | ||
592 | } | ||
593 | |||
594 | .tip table th, | ||
595 | .warning table th, | ||
596 | .caution table th, | ||
597 | .note table th { | ||
598 | border-bottom: 1px solid; | ||
599 | } | ||
600 | |||
601 | .question td { | ||
602 | border-top: 1px solid black; | ||
603 | } | ||
604 | |||
605 | .answer { | ||
606 | } | ||
607 | |||
608 | |||
609 | b.keycap, | ||
610 | .keycap { | ||
611 | border: 1px solid; | ||
612 | } | ||
613 | |||
614 | |||
615 | div.navheader, div.heading{ | ||
616 | border-bottom: 1px solid; | ||
617 | } | ||
618 | |||
619 | |||
620 | div.navfooter, div.footing{ | ||
621 | border-top: 1px solid; | ||
622 | } | ||
623 | |||
624 | /********* / | ||
625 | / colors / | ||
626 | / *********/ | ||
627 | |||
628 | body { | ||
629 | color: #333; | ||
630 | background: white; | ||
631 | } | ||
632 | |||
633 | a { | ||
634 | background: transparent; | ||
635 | } | ||
636 | |||
637 | a:hover { | ||
638 | background-color: #dedede; | ||
639 | } | ||
640 | |||
641 | |||
642 | h1, | ||
643 | h2, | ||
644 | h3, | ||
645 | h4, | ||
646 | h5, | ||
647 | h6, | ||
648 | h7, | ||
649 | h8 { | ||
650 | background-color: transparent; | ||
651 | } | ||
652 | |||
653 | hr { | ||
654 | border-color: #aaa; | ||
655 | } | ||
656 | |||
657 | |||
658 | .tip, .warning, .caution, .note { | ||
659 | border-color: #fff; | ||
660 | } | ||
661 | |||
662 | |||
663 | .tip table th, | ||
664 | .warning table th, | ||
665 | .caution table th, | ||
666 | .note table th { | ||
667 | border-bottom-color: #fff; | ||
668 | } | ||
669 | |||
670 | |||
671 | .warning { | ||
672 | background-color: #f0f0f2; | ||
673 | } | ||
674 | |||
675 | .caution { | ||
676 | background-color: #f0f0f2; | ||
677 | } | ||
678 | |||
679 | .tip { | ||
680 | background-color: #f0f0f2; | ||
681 | } | ||
682 | |||
683 | .note { | ||
684 | background-color: #f0f0f2; | ||
685 | } | ||
686 | |||
687 | .glossary dl dt, | ||
688 | .variablelist dl dt, | ||
689 | .variablelist dl dt span.term { | ||
690 | color: #044; | ||
691 | } | ||
692 | |||
693 | div.figure, | ||
694 | div.table, | ||
695 | div.example, | ||
696 | div.informalfigure, | ||
697 | div.informaltable, | ||
698 | div.informalexample { | ||
699 | border-color: #aaa; | ||
700 | } | ||
701 | |||
702 | pre.programlisting { | ||
703 | color: black; | ||
704 | background-color: #fff; | ||
705 | border-color: #aaa; | ||
706 | border-width: 2px; | ||
707 | } | ||
708 | |||
709 | .guimenu, | ||
710 | .guilabel, | ||
711 | .guimenuitem { | ||
712 | background-color: #eee; | ||
713 | } | ||
714 | |||
715 | |||
716 | b.keycap, | ||
717 | .keycap { | ||
718 | background-color: #eee; | ||
719 | border-color: #999; | ||
720 | } | ||
721 | |||
722 | |||
723 | div.navheader { | ||
724 | border-color: black; | ||
725 | } | ||
726 | |||
727 | |||
728 | div.navfooter { | ||
729 | border-color: black; | ||
730 | } | ||
731 | |||
732 | |||
733 | /*********** / | ||
734 | / graphics / | ||
735 | / ***********/ | ||
736 | |||
737 | /* | ||
738 | body { | ||
739 | background-image: url("images/body_bg.jpg"); | ||
740 | background-attachment: fixed; | ||
741 | } | ||
742 | |||
743 | .navheader, | ||
744 | .note, | ||
745 | .tip { | ||
746 | background-image: url("images/note_bg.jpg"); | ||
747 | background-attachment: fixed; | ||
748 | } | ||
749 | |||
750 | .warning, | ||
751 | .caution { | ||
752 | background-image: url("images/warning_bg.jpg"); | ||
753 | background-attachment: fixed; | ||
754 | } | ||
755 | |||
756 | .figure, | ||
757 | .informalfigure, | ||
758 | .example, | ||
759 | .informalexample, | ||
760 | .table, | ||
761 | .informaltable { | ||
762 | background-image: url("images/figure_bg.jpg"); | ||
763 | background-attachment: fixed; | ||
764 | } | ||
765 | |||
766 | */ | ||
767 | h1, | ||
768 | h2, | ||
769 | h3, | ||
770 | h4, | ||
771 | h5, | ||
772 | h6, | ||
773 | h7{ | ||
774 | } | ||
775 | |||
776 | /* | ||
777 | Example of how to stick an image as part of the title. | ||
778 | |||
779 | div.article .titlepage .title | ||
780 | { | ||
781 | background-image: url("figures/white-on-black.png"); | ||
782 | background-position: center; | ||
783 | background-repeat: repeat-x; | ||
784 | } | ||
785 | */ | ||
786 | |||
787 | div.preface .titlepage .title, | ||
788 | div.colophon .title, | ||
789 | div.chapter .titlepage .title, | ||
790 | div.article .titlepage .title | ||
791 | { | ||
792 | } | ||
793 | |||
794 | div.section div.section .titlepage .title, | ||
795 | div.sect2 .titlepage .title { | ||
796 | background: none; | ||
797 | } | ||
798 | |||
799 | |||
800 | h1.title { | ||
801 | background-color: transparent; | ||
802 | background-repeat: no-repeat; | ||
803 | height: 256px; | ||
804 | text-indent: -9000px; | ||
805 | overflow:hidden; | ||
806 | } | ||
807 | |||
808 | h2.subtitle { | ||
809 | background-color: transparent; | ||
810 | text-indent: -9000px; | ||
811 | overflow:hidden; | ||
812 | width: 0px; | ||
813 | display: none; | ||
814 | } | ||
815 | |||
816 | /*************************************** / | ||
817 | / pippin.gimp.org specific alterations / | ||
818 | / ***************************************/ | ||
819 | |||
820 | /* | ||
821 | div.heading, div.navheader { | ||
822 | color: #777; | ||
823 | font-size: 80%; | ||
824 | padding: 0; | ||
825 | margin: 0; | ||
826 | text-align: left; | ||
827 | position: absolute; | ||
828 | top: 0px; | ||
829 | left: 0px; | ||
830 | width: 100%; | ||
831 | height: 50px; | ||
832 | background: url('/gfx/heading_bg.png') transparent; | ||
833 | background-repeat: repeat-x; | ||
834 | background-attachment: fixed; | ||
835 | border: none; | ||
836 | } | ||
837 | |||
838 | div.heading a { | ||
839 | color: #444; | ||
840 | } | ||
841 | |||
842 | div.footing, div.navfooter { | ||
843 | border: none; | ||
844 | color: #ddd; | ||
845 | font-size: 80%; | ||
846 | text-align:right; | ||
847 | |||
848 | width: 100%; | ||
849 | padding-top: 10px; | ||
850 | position: absolute; | ||
851 | bottom: 0px; | ||
852 | left: 0px; | ||
853 | |||
854 | background: url('/gfx/footing_bg.png') transparent; | ||
855 | } | ||
856 | */ | ||
857 | |||
858 | |||
859 | |||
860 | /****************** / | ||
861 | / nasty ie tweaks / | ||
862 | / ******************/ | ||
863 | |||
864 | /* | ||
865 | div.heading, div.navheader { | ||
866 | width:expression(document.body.clientWidth + "px"); | ||
867 | } | ||
868 | |||
869 | div.footing, div.navfooter { | ||
870 | width:expression(document.body.clientWidth + "px"); | ||
871 | margin-left:expression("-5em"); | ||
872 | } | ||
873 | body { | ||
874 | padding:expression("4em 5em 0em 5em"); | ||
875 | } | ||
876 | */ | ||
877 | |||
878 | /**************************************** / | ||
879 | / mozilla vendor specific css extensions / | ||
880 | / ****************************************/ | ||
881 | /* | ||
882 | div.navfooter, div.footing{ | ||
883 | -moz-opacity: 0.8em; | ||
884 | } | ||
885 | |||
886 | div.figure, | ||
887 | div.table, | ||
888 | div.informalfigure, | ||
889 | div.informaltable, | ||
890 | div.informalexample, | ||
891 | div.example, | ||
892 | .tip, | ||
893 | .warning, | ||
894 | .caution, | ||
895 | .note { | ||
896 | -moz-border-radius: 0.5em; | ||
897 | } | ||
898 | |||
899 | b.keycap, | ||
900 | .keycap { | ||
901 | -moz-border-radius: 0.3em; | ||
902 | } | ||
903 | */ | ||
904 | |||
905 | table tr td table tr td { | ||
906 | display: none; | ||
907 | } | ||
908 | |||
909 | |||
910 | hr { | ||
911 | display: none; | ||
912 | } | ||
913 | |||
914 | table { | ||
915 | border: 0em; | ||
916 | } | ||
917 | |||
918 | .photo { | ||
919 | float: right; | ||
920 | margin-left: 1.5em; | ||
921 | margin-bottom: 1.5em; | ||
922 | margin-top: 0em; | ||
923 | max-width: 17em; | ||
924 | border: 1px solid gray; | ||
925 | padding: 3px; | ||
926 | background: white; | ||
927 | } | ||
928 | .seperator { | ||
929 | padding-top: 2em; | ||
930 | clear: both; | ||
931 | } | ||
932 | |||
933 | #validators { | ||
934 | margin-top: 5em; | ||
935 | text-align: right; | ||
936 | color: #777; | ||
937 | } | ||
938 | @media print { | ||
939 | body { | ||
940 | font-size: 8pt; | ||
941 | } | ||
942 | .noprint { | ||
943 | display: none; | ||
944 | } | ||
945 | } | ||
946 | |||
947 | |||
948 | .tip, | ||
949 | .note { | ||
950 | background: #f0f0f2; | ||
951 | color: #333; | ||
952 | padding: 20px; | ||
953 | margin: 20px; | ||
954 | } | ||
955 | |||
956 | .tip h3, | ||
957 | .note h3 { | ||
958 | padding: 0em; | ||
959 | margin: 0em; | ||
960 | font-size: 2em; | ||
961 | font-weight: bold; | ||
962 | color: #333; | ||
963 | } | ||
964 | |||
965 | .tip a, | ||
966 | .note a { | ||
967 | color: #333; | ||
968 | text-decoration: underline; | ||
969 | } | ||
970 | |||
971 | .footnote { | ||
972 | font-size: small; | ||
973 | color: #333; | ||
974 | } | ||
975 | |||
976 | /* Changes the announcement text */ | ||
977 | .tip h3, | ||
978 | .warning h3, | ||
979 | .caution h3, | ||
980 | .note h3 { | ||
981 | font-size:large; | ||
982 | color: #00557D; | ||
983 | } | ||
diff --git a/documentation/yocto-project-qs/yocto-project-qs-customization.xsl b/documentation/yocto-project-qs/yocto-project-qs-customization.xsl new file mode 100644 index 0000000..5d11e7e --- /dev/null +++ b/documentation/yocto-project-qs/yocto-project-qs-customization.xsl | |||
@@ -0,0 +1,15 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> | ||
3 | |||
4 | <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" /> | ||
5 | <xsl:import href="yocto-project-qs-titlepage.xsl"/> | ||
6 | |||
7 | <xsl:include href="../template/permalinks.xsl"/> | ||
8 | <xsl:include href="../template/section.title.xsl"/> | ||
9 | <xsl:include href="../template/component.title.xsl"/> | ||
10 | <xsl:include href="../template/division.title.xsl"/> | ||
11 | <xsl:include href="../template/formal.object.heading.xsl"/> | ||
12 | |||
13 | <xsl:param name="generate.toc" select="'article nop'"></xsl:param> | ||
14 | <xsl:param name="html.stylesheet" select="'qs-style.css'" /> | ||
15 | </xsl:stylesheet> | ||
diff --git a/documentation/yocto-project-qs/yocto-project-qs-eclipse-customization.xsl b/documentation/yocto-project-qs/yocto-project-qs-eclipse-customization.xsl new file mode 100644 index 0000000..f8f8930 --- /dev/null +++ b/documentation/yocto-project-qs/yocto-project-qs-eclipse-customization.xsl | |||
@@ -0,0 +1,25 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <xsl:stylesheet | ||
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
4 | xmlns="http://www.w3.org/1999/xhtml" | ||
5 | xmlns:fo="http://www.w3.org/1999/XSL/Format" | ||
6 | version="1.0"> | ||
7 | |||
8 | <xsl:import | ||
9 | href="http://docbook.sourceforge.net/release/xsl/current/eclipse/eclipse3.xsl" /> | ||
10 | <xsl:import href="yocto-project-qs-titlepage.xsl"/> | ||
11 | |||
12 | <xsl:param name="chunker.output.indent" select="'yes'"/> | ||
13 | <xsl:param name="chunk.quietly" select="1"/> | ||
14 | <xsl:param name="use.id.as.filename" select="1"/> | ||
15 | <xsl:param name="ulink.target" select="'_self'" /> | ||
16 | <xsl:param name="base.dir" select="'html/yocto-project-qs/'"/> | ||
17 | <xsl:param name="chunk.section.depth" select="0"/> | ||
18 | <xsl:param name="html.stylesheet" select="'../book.css'"/> | ||
19 | <xsl:param name="eclipse.manifest" select="0"/> | ||
20 | <xsl:param name="create.plugin.xml" select="0"/> | ||
21 | <xsl:param name="suppress.navigation" select="1"/> | ||
22 | <xsl:param name="generate.index" select="0"/> | ||
23 | <xsl:param name="generate.toc" select="'article nop'"></xsl:param> | ||
24 | <xsl:param name="html.stylesheet" select="'style.css'" /> | ||
25 | </xsl:stylesheet> | ||
diff --git a/documentation/yocto-project-qs/yocto-project-qs-titlepage.xsl b/documentation/yocto-project-qs/yocto-project-qs-titlepage.xsl new file mode 100644 index 0000000..a435ac7 --- /dev/null +++ b/documentation/yocto-project-qs/yocto-project-qs-titlepage.xsl | |||
@@ -0,0 +1,3820 @@ | |||
1 | <?xml version="1.0"?> | ||
2 | |||
3 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" version="1.0" exclude-result-prefixes="exsl"> | ||
4 | |||
5 | <!-- This stylesheet was created by template/titlepage.xsl--> | ||
6 | |||
7 | <xsl:template name="article.titlepage.recto"> | ||
8 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/abstract"/> | ||
9 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/abstract"/> | ||
10 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/abstract"/> | ||
11 | <xsl:choose> | ||
12 | <xsl:when test="articleinfo/title"> | ||
13 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/title"/> | ||
14 | </xsl:when> | ||
15 | <xsl:when test="artheader/title"> | ||
16 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/title"/> | ||
17 | </xsl:when> | ||
18 | <xsl:when test="info/title"> | ||
19 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/title"/> | ||
20 | </xsl:when> | ||
21 | <xsl:when test="title"> | ||
22 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="title"/> | ||
23 | </xsl:when> | ||
24 | </xsl:choose> | ||
25 | |||
26 | <xsl:choose> | ||
27 | <xsl:when test="articleinfo/subtitle"> | ||
28 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/subtitle"/> | ||
29 | </xsl:when> | ||
30 | <xsl:when test="artheader/subtitle"> | ||
31 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/subtitle"/> | ||
32 | </xsl:when> | ||
33 | <xsl:when test="info/subtitle"> | ||
34 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
35 | </xsl:when> | ||
36 | <xsl:when test="subtitle"> | ||
37 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="subtitle"/> | ||
38 | </xsl:when> | ||
39 | </xsl:choose> | ||
40 | |||
41 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/corpauthor"/> | ||
42 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/corpauthor"/> | ||
43 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
44 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/authorgroup"/> | ||
45 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/authorgroup"/> | ||
46 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
47 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/author"/> | ||
48 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/author"/> | ||
49 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/author"/> | ||
50 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/othercredit"/> | ||
51 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/othercredit"/> | ||
52 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
53 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/releaseinfo"/> | ||
54 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/releaseinfo"/> | ||
55 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
56 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/copyright"/> | ||
57 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/copyright"/> | ||
58 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/copyright"/> | ||
59 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/legalnotice"/> | ||
60 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/legalnotice"/> | ||
61 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
62 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/pubdate"/> | ||
63 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/pubdate"/> | ||
64 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
65 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revision"/> | ||
66 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revision"/> | ||
67 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revision"/> | ||
68 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revhistory"/> | ||
69 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revhistory"/> | ||
70 | <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
71 | </xsl:template> | ||
72 | |||
73 | <xsl:template name="article.titlepage.verso"> | ||
74 | </xsl:template> | ||
75 | |||
76 | <xsl:template name="article.titlepage.separator"><hr/> | ||
77 | </xsl:template> | ||
78 | |||
79 | <xsl:template name="article.titlepage.before.recto"> | ||
80 | </xsl:template> | ||
81 | |||
82 | <xsl:template name="article.titlepage.before.verso"> | ||
83 | </xsl:template> | ||
84 | |||
85 | <xsl:template name="article.titlepage"> | ||
86 | <div class="titlepage"> | ||
87 | <xsl:variable name="recto.content"> | ||
88 | <xsl:call-template name="article.titlepage.before.recto"/> | ||
89 | <xsl:call-template name="article.titlepage.recto"/> | ||
90 | </xsl:variable> | ||
91 | <xsl:variable name="recto.elements.count"> | ||
92 | <xsl:choose> | ||
93 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
94 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
95 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
96 | <xsl:otherwise>1</xsl:otherwise> | ||
97 | </xsl:choose> | ||
98 | </xsl:variable> | ||
99 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
100 | <div><xsl:copy-of select="$recto.content"/></div> | ||
101 | </xsl:if> | ||
102 | <xsl:variable name="verso.content"> | ||
103 | <xsl:call-template name="article.titlepage.before.verso"/> | ||
104 | <xsl:call-template name="article.titlepage.verso"/> | ||
105 | </xsl:variable> | ||
106 | <xsl:variable name="verso.elements.count"> | ||
107 | <xsl:choose> | ||
108 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
109 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
110 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
111 | <xsl:otherwise>1</xsl:otherwise> | ||
112 | </xsl:choose> | ||
113 | </xsl:variable> | ||
114 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
115 | <div><xsl:copy-of select="$verso.content"/></div> | ||
116 | </xsl:if> | ||
117 | <xsl:call-template name="article.titlepage.separator"/> | ||
118 | </div> | ||
119 | </xsl:template> | ||
120 | |||
121 | <xsl:template match="*" mode="article.titlepage.recto.mode"> | ||
122 | <!-- if an element isn't found in this mode, --> | ||
123 | <!-- try the generic titlepage.mode --> | ||
124 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
125 | </xsl:template> | ||
126 | |||
127 | <xsl:template match="*" mode="article.titlepage.verso.mode"> | ||
128 | <!-- if an element isn't found in this mode, --> | ||
129 | <!-- try the generic titlepage.mode --> | ||
130 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
131 | </xsl:template> | ||
132 | |||
133 | <xsl:template match="abstract" mode="article.titlepage.recto.auto.mode"> | ||
134 | <div xsl:use-attribute-sets="article.titlepage.recto.style"> | ||
135 | <xsl:call-template name="anchor"/> | ||
136 | <xsl:apply-templates/> | ||
137 | <!-- orignally generated content --> | ||
138 | <!-- <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> --> | ||
139 | </div> | ||
140 | </xsl:template> | ||
141 | |||
142 | <xsl:template match="title" mode="article.titlepage.recto.auto.mode"> | ||
143 | <div xsl:use-attribute-sets="article.titlepage.recto.style"> | ||
144 | <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> | ||
145 | </div> | ||
146 | </xsl:template> | ||
147 | |||
148 | <xsl:template match="subtitle" mode="article.titlepage.recto.auto.mode"> | ||
149 | <div xsl:use-attribute-sets="article.titlepage.recto.style"> | ||
150 | <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> | ||
151 | </div> | ||
152 | </xsl:template> | ||
153 | |||
154 | <xsl:template match="corpauthor" mode="article.titlepage.recto.auto.mode"> | ||
155 | <div xsl:use-attribute-sets="article.titlepage.recto.style"> | ||
156 | <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> | ||
157 | </div> | ||
158 | </xsl:template> | ||
159 | |||
160 | <xsl:template match="authorgroup" mode="article.titlepage.recto.auto.mode"> | ||
161 | <div xsl:use-attribute-sets="article.titlepage.recto.style"> | ||
162 | <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> | ||
163 | </div> | ||
164 | </xsl:template> | ||
165 | |||
166 | <xsl:template match="author" mode="article.titlepage.recto.auto.mode"> | ||
167 | <div xsl:use-attribute-sets="article.titlepage.recto.style"> | ||
168 | <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> | ||
169 | </div> | ||
170 | </xsl:template> | ||
171 | |||
172 | <xsl:template match="othercredit" mode="article.titlepage.recto.auto.mode"> | ||
173 | <div xsl:use-attribute-sets="article.titlepage.recto.style"> | ||
174 | <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> | ||
175 | </div> | ||
176 | </xsl:template> | ||
177 | |||
178 | <xsl:template match="releaseinfo" mode="article.titlepage.recto.auto.mode"> | ||
179 | <div xsl:use-attribute-sets="article.titlepage.recto.style"> | ||
180 | <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> | ||
181 | </div> | ||
182 | </xsl:template> | ||
183 | |||
184 | <xsl:template match="copyright" mode="article.titlepage.recto.auto.mode"> | ||
185 | <div xsl:use-attribute-sets="article.titlepage.recto.style"> | ||
186 | <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> | ||
187 | </div> | ||
188 | </xsl:template> | ||
189 | |||
190 | <xsl:template match="legalnotice" mode="article.titlepage.recto.auto.mode"> | ||
191 | <div xsl:use-attribute-sets="article.titlepage.recto.style"> | ||
192 | <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> | ||
193 | </div> | ||
194 | </xsl:template> | ||
195 | |||
196 | <xsl:template match="pubdate" mode="article.titlepage.recto.auto.mode"> | ||
197 | <div xsl:use-attribute-sets="article.titlepage.recto.style"> | ||
198 | <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> | ||
199 | </div> | ||
200 | </xsl:template> | ||
201 | |||
202 | <xsl:template match="revision" mode="article.titlepage.recto.auto.mode"> | ||
203 | <div xsl:use-attribute-sets="article.titlepage.recto.style"> | ||
204 | <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> | ||
205 | </div> | ||
206 | </xsl:template> | ||
207 | |||
208 | <xsl:template match="revhistory" mode="article.titlepage.recto.auto.mode"> | ||
209 | <div xsl:use-attribute-sets="article.titlepage.recto.style"> | ||
210 | <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> | ||
211 | </div> | ||
212 | </xsl:template> | ||
213 | |||
214 | <xsl:template name="set.titlepage.recto"> | ||
215 | <xsl:choose> | ||
216 | <xsl:when test="setinfo/title"> | ||
217 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/title"/> | ||
218 | </xsl:when> | ||
219 | <xsl:when test="info/title"> | ||
220 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/title"/> | ||
221 | </xsl:when> | ||
222 | <xsl:when test="title"> | ||
223 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="title"/> | ||
224 | </xsl:when> | ||
225 | </xsl:choose> | ||
226 | |||
227 | <xsl:choose> | ||
228 | <xsl:when test="setinfo/subtitle"> | ||
229 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/subtitle"/> | ||
230 | </xsl:when> | ||
231 | <xsl:when test="info/subtitle"> | ||
232 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
233 | </xsl:when> | ||
234 | <xsl:when test="subtitle"> | ||
235 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="subtitle"/> | ||
236 | </xsl:when> | ||
237 | </xsl:choose> | ||
238 | |||
239 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/corpauthor"/> | ||
240 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
241 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/authorgroup"/> | ||
242 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
243 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/author"/> | ||
244 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/author"/> | ||
245 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/othercredit"/> | ||
246 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
247 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/releaseinfo"/> | ||
248 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
249 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/copyright"/> | ||
250 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/copyright"/> | ||
251 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/legalnotice"/> | ||
252 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
253 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/pubdate"/> | ||
254 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
255 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revision"/> | ||
256 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/revision"/> | ||
257 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revhistory"/> | ||
258 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
259 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/abstract"/> | ||
260 | <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/abstract"/> | ||
261 | </xsl:template> | ||
262 | |||
263 | <xsl:template name="set.titlepage.verso"> | ||
264 | </xsl:template> | ||
265 | |||
266 | <xsl:template name="set.titlepage.separator"><hr/> | ||
267 | </xsl:template> | ||
268 | |||
269 | <xsl:template name="set.titlepage.before.recto"> | ||
270 | </xsl:template> | ||
271 | |||
272 | <xsl:template name="set.titlepage.before.verso"> | ||
273 | </xsl:template> | ||
274 | |||
275 | <xsl:template name="set.titlepage"> | ||
276 | <div class="titlepage"> | ||
277 | <xsl:variable name="recto.content"> | ||
278 | <xsl:call-template name="set.titlepage.before.recto"/> | ||
279 | <xsl:call-template name="set.titlepage.recto"/> | ||
280 | </xsl:variable> | ||
281 | <xsl:variable name="recto.elements.count"> | ||
282 | <xsl:choose> | ||
283 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
284 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
285 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
286 | <xsl:otherwise>1</xsl:otherwise> | ||
287 | </xsl:choose> | ||
288 | </xsl:variable> | ||
289 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
290 | <div><xsl:copy-of select="$recto.content"/></div> | ||
291 | </xsl:if> | ||
292 | <xsl:variable name="verso.content"> | ||
293 | <xsl:call-template name="set.titlepage.before.verso"/> | ||
294 | <xsl:call-template name="set.titlepage.verso"/> | ||
295 | </xsl:variable> | ||
296 | <xsl:variable name="verso.elements.count"> | ||
297 | <xsl:choose> | ||
298 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
299 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
300 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
301 | <xsl:otherwise>1</xsl:otherwise> | ||
302 | </xsl:choose> | ||
303 | </xsl:variable> | ||
304 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
305 | <div><xsl:copy-of select="$verso.content"/></div> | ||
306 | </xsl:if> | ||
307 | <xsl:call-template name="set.titlepage.separator"/> | ||
308 | </div> | ||
309 | </xsl:template> | ||
310 | |||
311 | <xsl:template match="*" mode="set.titlepage.recto.mode"> | ||
312 | <!-- if an element isn't found in this mode, --> | ||
313 | <!-- try the generic titlepage.mode --> | ||
314 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
315 | </xsl:template> | ||
316 | |||
317 | <xsl:template match="*" mode="set.titlepage.verso.mode"> | ||
318 | <!-- if an element isn't found in this mode, --> | ||
319 | <!-- try the generic titlepage.mode --> | ||
320 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
321 | </xsl:template> | ||
322 | |||
323 | <xsl:template match="title" mode="set.titlepage.recto.auto.mode"> | ||
324 | <div xsl:use-attribute-sets="set.titlepage.recto.style"> | ||
325 | <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> | ||
326 | </div> | ||
327 | </xsl:template> | ||
328 | |||
329 | <xsl:template match="subtitle" mode="set.titlepage.recto.auto.mode"> | ||
330 | <div xsl:use-attribute-sets="set.titlepage.recto.style"> | ||
331 | <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> | ||
332 | </div> | ||
333 | </xsl:template> | ||
334 | |||
335 | <xsl:template match="corpauthor" mode="set.titlepage.recto.auto.mode"> | ||
336 | <div xsl:use-attribute-sets="set.titlepage.recto.style"> | ||
337 | <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> | ||
338 | </div> | ||
339 | </xsl:template> | ||
340 | |||
341 | <xsl:template match="authorgroup" mode="set.titlepage.recto.auto.mode"> | ||
342 | <div xsl:use-attribute-sets="set.titlepage.recto.style"> | ||
343 | <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> | ||
344 | </div> | ||
345 | </xsl:template> | ||
346 | |||
347 | <xsl:template match="author" mode="set.titlepage.recto.auto.mode"> | ||
348 | <div xsl:use-attribute-sets="set.titlepage.recto.style"> | ||
349 | <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> | ||
350 | </div> | ||
351 | </xsl:template> | ||
352 | |||
353 | <xsl:template match="othercredit" mode="set.titlepage.recto.auto.mode"> | ||
354 | <div xsl:use-attribute-sets="set.titlepage.recto.style"> | ||
355 | <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> | ||
356 | </div> | ||
357 | </xsl:template> | ||
358 | |||
359 | <xsl:template match="releaseinfo" mode="set.titlepage.recto.auto.mode"> | ||
360 | <div xsl:use-attribute-sets="set.titlepage.recto.style"> | ||
361 | <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> | ||
362 | </div> | ||
363 | </xsl:template> | ||
364 | |||
365 | <xsl:template match="copyright" mode="set.titlepage.recto.auto.mode"> | ||
366 | <div xsl:use-attribute-sets="set.titlepage.recto.style"> | ||
367 | <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> | ||
368 | </div> | ||
369 | </xsl:template> | ||
370 | |||
371 | <xsl:template match="legalnotice" mode="set.titlepage.recto.auto.mode"> | ||
372 | <div xsl:use-attribute-sets="set.titlepage.recto.style"> | ||
373 | <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> | ||
374 | </div> | ||
375 | </xsl:template> | ||
376 | |||
377 | <xsl:template match="pubdate" mode="set.titlepage.recto.auto.mode"> | ||
378 | <div xsl:use-attribute-sets="set.titlepage.recto.style"> | ||
379 | <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> | ||
380 | </div> | ||
381 | </xsl:template> | ||
382 | |||
383 | <xsl:template match="revision" mode="set.titlepage.recto.auto.mode"> | ||
384 | <div xsl:use-attribute-sets="set.titlepage.recto.style"> | ||
385 | <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> | ||
386 | </div> | ||
387 | </xsl:template> | ||
388 | |||
389 | <xsl:template match="revhistory" mode="set.titlepage.recto.auto.mode"> | ||
390 | <div xsl:use-attribute-sets="set.titlepage.recto.style"> | ||
391 | <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> | ||
392 | </div> | ||
393 | </xsl:template> | ||
394 | |||
395 | <xsl:template match="abstract" mode="set.titlepage.recto.auto.mode"> | ||
396 | <div xsl:use-attribute-sets="set.titlepage.recto.style"> | ||
397 | <xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> | ||
398 | </div> | ||
399 | </xsl:template> | ||
400 | |||
401 | <xsl:template name="book.titlepage.recto"> | ||
402 | <xsl:choose> | ||
403 | <xsl:when test="bookinfo/title"> | ||
404 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/title"/> | ||
405 | </xsl:when> | ||
406 | <xsl:when test="info/title"> | ||
407 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/title"/> | ||
408 | </xsl:when> | ||
409 | <xsl:when test="title"> | ||
410 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="title"/> | ||
411 | </xsl:when> | ||
412 | </xsl:choose> | ||
413 | |||
414 | <xsl:choose> | ||
415 | <xsl:when test="bookinfo/subtitle"> | ||
416 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/subtitle"/> | ||
417 | </xsl:when> | ||
418 | <xsl:when test="info/subtitle"> | ||
419 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
420 | </xsl:when> | ||
421 | <xsl:when test="subtitle"> | ||
422 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="subtitle"/> | ||
423 | </xsl:when> | ||
424 | </xsl:choose> | ||
425 | |||
426 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/corpauthor"/> | ||
427 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
428 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/authorgroup"/> | ||
429 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
430 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/author"/> | ||
431 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/author"/> | ||
432 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/othercredit"/> | ||
433 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
434 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/releaseinfo"/> | ||
435 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
436 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/copyright"/> | ||
437 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/copyright"/> | ||
438 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/legalnotice"/> | ||
439 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
440 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/pubdate"/> | ||
441 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
442 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revision"/> | ||
443 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revision"/> | ||
444 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revhistory"/> | ||
445 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
446 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/abstract"/> | ||
447 | <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/abstract"/> | ||
448 | </xsl:template> | ||
449 | |||
450 | <xsl:template name="book.titlepage.verso"> | ||
451 | </xsl:template> | ||
452 | |||
453 | <xsl:template name="book.titlepage.separator"><hr/> | ||
454 | </xsl:template> | ||
455 | |||
456 | <xsl:template name="book.titlepage.before.recto"> | ||
457 | </xsl:template> | ||
458 | |||
459 | <xsl:template name="book.titlepage.before.verso"> | ||
460 | </xsl:template> | ||
461 | |||
462 | <xsl:template name="book.titlepage"> | ||
463 | <div class="titlepage"> | ||
464 | <xsl:variable name="recto.content"> | ||
465 | <xsl:call-template name="book.titlepage.before.recto"/> | ||
466 | <xsl:call-template name="book.titlepage.recto"/> | ||
467 | </xsl:variable> | ||
468 | <xsl:variable name="recto.elements.count"> | ||
469 | <xsl:choose> | ||
470 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
471 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
472 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
473 | <xsl:otherwise>1</xsl:otherwise> | ||
474 | </xsl:choose> | ||
475 | </xsl:variable> | ||
476 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
477 | <div><xsl:copy-of select="$recto.content"/></div> | ||
478 | </xsl:if> | ||
479 | <xsl:variable name="verso.content"> | ||
480 | <xsl:call-template name="book.titlepage.before.verso"/> | ||
481 | <xsl:call-template name="book.titlepage.verso"/> | ||
482 | </xsl:variable> | ||
483 | <xsl:variable name="verso.elements.count"> | ||
484 | <xsl:choose> | ||
485 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
486 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
487 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
488 | <xsl:otherwise>1</xsl:otherwise> | ||
489 | </xsl:choose> | ||
490 | </xsl:variable> | ||
491 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
492 | <div><xsl:copy-of select="$verso.content"/></div> | ||
493 | </xsl:if> | ||
494 | <xsl:call-template name="book.titlepage.separator"/> | ||
495 | </div> | ||
496 | </xsl:template> | ||
497 | |||
498 | <xsl:template match="*" mode="book.titlepage.recto.mode"> | ||
499 | <!-- if an element isn't found in this mode, --> | ||
500 | <!-- try the generic titlepage.mode --> | ||
501 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
502 | </xsl:template> | ||
503 | |||
504 | <xsl:template match="*" mode="book.titlepage.verso.mode"> | ||
505 | <!-- if an element isn't found in this mode, --> | ||
506 | <!-- try the generic titlepage.mode --> | ||
507 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
508 | </xsl:template> | ||
509 | |||
510 | <xsl:template match="title" mode="book.titlepage.recto.auto.mode"> | ||
511 | <div xsl:use-attribute-sets="book.titlepage.recto.style"> | ||
512 | <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> | ||
513 | </div> | ||
514 | </xsl:template> | ||
515 | |||
516 | <xsl:template match="subtitle" mode="book.titlepage.recto.auto.mode"> | ||
517 | <div xsl:use-attribute-sets="book.titlepage.recto.style"> | ||
518 | <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> | ||
519 | </div> | ||
520 | </xsl:template> | ||
521 | |||
522 | <xsl:template match="corpauthor" mode="book.titlepage.recto.auto.mode"> | ||
523 | <div xsl:use-attribute-sets="book.titlepage.recto.style"> | ||
524 | <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> | ||
525 | </div> | ||
526 | </xsl:template> | ||
527 | |||
528 | <xsl:template match="authorgroup" mode="book.titlepage.recto.auto.mode"> | ||
529 | <div xsl:use-attribute-sets="book.titlepage.recto.style"> | ||
530 | <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> | ||
531 | </div> | ||
532 | </xsl:template> | ||
533 | |||
534 | <xsl:template match="author" mode="book.titlepage.recto.auto.mode"> | ||
535 | <div xsl:use-attribute-sets="book.titlepage.recto.style"> | ||
536 | <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> | ||
537 | </div> | ||
538 | </xsl:template> | ||
539 | |||
540 | <xsl:template match="othercredit" mode="book.titlepage.recto.auto.mode"> | ||
541 | <div xsl:use-attribute-sets="book.titlepage.recto.style"> | ||
542 | <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> | ||
543 | </div> | ||
544 | </xsl:template> | ||
545 | |||
546 | <xsl:template match="releaseinfo" mode="book.titlepage.recto.auto.mode"> | ||
547 | <div xsl:use-attribute-sets="book.titlepage.recto.style"> | ||
548 | <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> | ||
549 | </div> | ||
550 | </xsl:template> | ||
551 | |||
552 | <xsl:template match="copyright" mode="book.titlepage.recto.auto.mode"> | ||
553 | <div xsl:use-attribute-sets="book.titlepage.recto.style"> | ||
554 | <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> | ||
555 | </div> | ||
556 | </xsl:template> | ||
557 | |||
558 | <xsl:template match="legalnotice" mode="book.titlepage.recto.auto.mode"> | ||
559 | <div xsl:use-attribute-sets="book.titlepage.recto.style"> | ||
560 | <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> | ||
561 | </div> | ||
562 | </xsl:template> | ||
563 | |||
564 | <xsl:template match="pubdate" mode="book.titlepage.recto.auto.mode"> | ||
565 | <div xsl:use-attribute-sets="book.titlepage.recto.style"> | ||
566 | <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> | ||
567 | </div> | ||
568 | </xsl:template> | ||
569 | |||
570 | <xsl:template match="revision" mode="book.titlepage.recto.auto.mode"> | ||
571 | <div xsl:use-attribute-sets="book.titlepage.recto.style"> | ||
572 | <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> | ||
573 | </div> | ||
574 | </xsl:template> | ||
575 | |||
576 | <xsl:template match="revhistory" mode="book.titlepage.recto.auto.mode"> | ||
577 | <div xsl:use-attribute-sets="book.titlepage.recto.style"> | ||
578 | <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> | ||
579 | </div> | ||
580 | </xsl:template> | ||
581 | |||
582 | <xsl:template match="abstract" mode="book.titlepage.recto.auto.mode"> | ||
583 | <div xsl:use-attribute-sets="book.titlepage.recto.style"> | ||
584 | <xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> | ||
585 | </div> | ||
586 | </xsl:template> | ||
587 | |||
588 | <xsl:template name="part.titlepage.recto"> | ||
589 | <div xsl:use-attribute-sets="part.titlepage.recto.style"> | ||
590 | <xsl:call-template name="division.title"> | ||
591 | <xsl:with-param name="node" select="ancestor-or-self::part[1]"/> | ||
592 | </xsl:call-template></div> | ||
593 | <xsl:choose> | ||
594 | <xsl:when test="partinfo/subtitle"> | ||
595 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/subtitle"/> | ||
596 | </xsl:when> | ||
597 | <xsl:when test="docinfo/subtitle"> | ||
598 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
599 | </xsl:when> | ||
600 | <xsl:when test="info/subtitle"> | ||
601 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
602 | </xsl:when> | ||
603 | <xsl:when test="subtitle"> | ||
604 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="subtitle"/> | ||
605 | </xsl:when> | ||
606 | </xsl:choose> | ||
607 | |||
608 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/corpauthor"/> | ||
609 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> | ||
610 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
611 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/authorgroup"/> | ||
612 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> | ||
613 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
614 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/author"/> | ||
615 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/author"/> | ||
616 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/author"/> | ||
617 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/othercredit"/> | ||
618 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/othercredit"/> | ||
619 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
620 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/releaseinfo"/> | ||
621 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> | ||
622 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
623 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/copyright"/> | ||
624 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/copyright"/> | ||
625 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/copyright"/> | ||
626 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/legalnotice"/> | ||
627 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> | ||
628 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
629 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/pubdate"/> | ||
630 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/pubdate"/> | ||
631 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
632 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revision"/> | ||
633 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/revision"/> | ||
634 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/revision"/> | ||
635 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revhistory"/> | ||
636 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/revhistory"/> | ||
637 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
638 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/abstract"/> | ||
639 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/abstract"/> | ||
640 | <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/abstract"/> | ||
641 | </xsl:template> | ||
642 | |||
643 | <xsl:template name="part.titlepage.verso"> | ||
644 | </xsl:template> | ||
645 | |||
646 | <xsl:template name="part.titlepage.separator"> | ||
647 | </xsl:template> | ||
648 | |||
649 | <xsl:template name="part.titlepage.before.recto"> | ||
650 | </xsl:template> | ||
651 | |||
652 | <xsl:template name="part.titlepage.before.verso"> | ||
653 | </xsl:template> | ||
654 | |||
655 | <xsl:template name="part.titlepage"> | ||
656 | <div class="titlepage"> | ||
657 | <xsl:variable name="recto.content"> | ||
658 | <xsl:call-template name="part.titlepage.before.recto"/> | ||
659 | <xsl:call-template name="part.titlepage.recto"/> | ||
660 | </xsl:variable> | ||
661 | <xsl:variable name="recto.elements.count"> | ||
662 | <xsl:choose> | ||
663 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
664 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
665 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
666 | <xsl:otherwise>1</xsl:otherwise> | ||
667 | </xsl:choose> | ||
668 | </xsl:variable> | ||
669 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
670 | <div><xsl:copy-of select="$recto.content"/></div> | ||
671 | </xsl:if> | ||
672 | <xsl:variable name="verso.content"> | ||
673 | <xsl:call-template name="part.titlepage.before.verso"/> | ||
674 | <xsl:call-template name="part.titlepage.verso"/> | ||
675 | </xsl:variable> | ||
676 | <xsl:variable name="verso.elements.count"> | ||
677 | <xsl:choose> | ||
678 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
679 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
680 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
681 | <xsl:otherwise>1</xsl:otherwise> | ||
682 | </xsl:choose> | ||
683 | </xsl:variable> | ||
684 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
685 | <div><xsl:copy-of select="$verso.content"/></div> | ||
686 | </xsl:if> | ||
687 | <xsl:call-template name="part.titlepage.separator"/> | ||
688 | </div> | ||
689 | </xsl:template> | ||
690 | |||
691 | <xsl:template match="*" mode="part.titlepage.recto.mode"> | ||
692 | <!-- if an element isn't found in this mode, --> | ||
693 | <!-- try the generic titlepage.mode --> | ||
694 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
695 | </xsl:template> | ||
696 | |||
697 | <xsl:template match="*" mode="part.titlepage.verso.mode"> | ||
698 | <!-- if an element isn't found in this mode, --> | ||
699 | <!-- try the generic titlepage.mode --> | ||
700 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
701 | </xsl:template> | ||
702 | |||
703 | <xsl:template match="subtitle" mode="part.titlepage.recto.auto.mode"> | ||
704 | <div xsl:use-attribute-sets="part.titlepage.recto.style"> | ||
705 | <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> | ||
706 | </div> | ||
707 | </xsl:template> | ||
708 | |||
709 | <xsl:template match="corpauthor" mode="part.titlepage.recto.auto.mode"> | ||
710 | <div xsl:use-attribute-sets="part.titlepage.recto.style"> | ||
711 | <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> | ||
712 | </div> | ||
713 | </xsl:template> | ||
714 | |||
715 | <xsl:template match="authorgroup" mode="part.titlepage.recto.auto.mode"> | ||
716 | <div xsl:use-attribute-sets="part.titlepage.recto.style"> | ||
717 | <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> | ||
718 | </div> | ||
719 | </xsl:template> | ||
720 | |||
721 | <xsl:template match="author" mode="part.titlepage.recto.auto.mode"> | ||
722 | <div xsl:use-attribute-sets="part.titlepage.recto.style"> | ||
723 | <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> | ||
724 | </div> | ||
725 | </xsl:template> | ||
726 | |||
727 | <xsl:template match="othercredit" mode="part.titlepage.recto.auto.mode"> | ||
728 | <div xsl:use-attribute-sets="part.titlepage.recto.style"> | ||
729 | <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> | ||
730 | </div> | ||
731 | </xsl:template> | ||
732 | |||
733 | <xsl:template match="releaseinfo" mode="part.titlepage.recto.auto.mode"> | ||
734 | <div xsl:use-attribute-sets="part.titlepage.recto.style"> | ||
735 | <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> | ||
736 | </div> | ||
737 | </xsl:template> | ||
738 | |||
739 | <xsl:template match="copyright" mode="part.titlepage.recto.auto.mode"> | ||
740 | <div xsl:use-attribute-sets="part.titlepage.recto.style"> | ||
741 | <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> | ||
742 | </div> | ||
743 | </xsl:template> | ||
744 | |||
745 | <xsl:template match="legalnotice" mode="part.titlepage.recto.auto.mode"> | ||
746 | <div xsl:use-attribute-sets="part.titlepage.recto.style"> | ||
747 | <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> | ||
748 | </div> | ||
749 | </xsl:template> | ||
750 | |||
751 | <xsl:template match="pubdate" mode="part.titlepage.recto.auto.mode"> | ||
752 | <div xsl:use-attribute-sets="part.titlepage.recto.style"> | ||
753 | <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> | ||
754 | </div> | ||
755 | </xsl:template> | ||
756 | |||
757 | <xsl:template match="revision" mode="part.titlepage.recto.auto.mode"> | ||
758 | <div xsl:use-attribute-sets="part.titlepage.recto.style"> | ||
759 | <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> | ||
760 | </div> | ||
761 | </xsl:template> | ||
762 | |||
763 | <xsl:template match="revhistory" mode="part.titlepage.recto.auto.mode"> | ||
764 | <div xsl:use-attribute-sets="part.titlepage.recto.style"> | ||
765 | <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> | ||
766 | </div> | ||
767 | </xsl:template> | ||
768 | |||
769 | <xsl:template match="abstract" mode="part.titlepage.recto.auto.mode"> | ||
770 | <div xsl:use-attribute-sets="part.titlepage.recto.style"> | ||
771 | <xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> | ||
772 | </div> | ||
773 | </xsl:template> | ||
774 | |||
775 | <xsl:template name="partintro.titlepage.recto"> | ||
776 | <xsl:choose> | ||
777 | <xsl:when test="partintroinfo/title"> | ||
778 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/title"/> | ||
779 | </xsl:when> | ||
780 | <xsl:when test="docinfo/title"> | ||
781 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/title"/> | ||
782 | </xsl:when> | ||
783 | <xsl:when test="info/title"> | ||
784 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/title"/> | ||
785 | </xsl:when> | ||
786 | <xsl:when test="title"> | ||
787 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="title"/> | ||
788 | </xsl:when> | ||
789 | </xsl:choose> | ||
790 | |||
791 | <xsl:choose> | ||
792 | <xsl:when test="partintroinfo/subtitle"> | ||
793 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/subtitle"/> | ||
794 | </xsl:when> | ||
795 | <xsl:when test="docinfo/subtitle"> | ||
796 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
797 | </xsl:when> | ||
798 | <xsl:when test="info/subtitle"> | ||
799 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
800 | </xsl:when> | ||
801 | <xsl:when test="subtitle"> | ||
802 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="subtitle"/> | ||
803 | </xsl:when> | ||
804 | </xsl:choose> | ||
805 | |||
806 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/corpauthor"/> | ||
807 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> | ||
808 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
809 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/authorgroup"/> | ||
810 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> | ||
811 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
812 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/author"/> | ||
813 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/author"/> | ||
814 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/author"/> | ||
815 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/othercredit"/> | ||
816 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/othercredit"/> | ||
817 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
818 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/releaseinfo"/> | ||
819 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> | ||
820 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
821 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/copyright"/> | ||
822 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/copyright"/> | ||
823 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/copyright"/> | ||
824 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/legalnotice"/> | ||
825 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> | ||
826 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
827 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/pubdate"/> | ||
828 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/pubdate"/> | ||
829 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
830 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revision"/> | ||
831 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/revision"/> | ||
832 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/revision"/> | ||
833 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revhistory"/> | ||
834 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/revhistory"/> | ||
835 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
836 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/abstract"/> | ||
837 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/abstract"/> | ||
838 | <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/abstract"/> | ||
839 | </xsl:template> | ||
840 | |||
841 | <xsl:template name="partintro.titlepage.verso"> | ||
842 | </xsl:template> | ||
843 | |||
844 | <xsl:template name="partintro.titlepage.separator"> | ||
845 | </xsl:template> | ||
846 | |||
847 | <xsl:template name="partintro.titlepage.before.recto"> | ||
848 | </xsl:template> | ||
849 | |||
850 | <xsl:template name="partintro.titlepage.before.verso"> | ||
851 | </xsl:template> | ||
852 | |||
853 | <xsl:template name="partintro.titlepage"> | ||
854 | <div> | ||
855 | <xsl:variable name="recto.content"> | ||
856 | <xsl:call-template name="partintro.titlepage.before.recto"/> | ||
857 | <xsl:call-template name="partintro.titlepage.recto"/> | ||
858 | </xsl:variable> | ||
859 | <xsl:variable name="recto.elements.count"> | ||
860 | <xsl:choose> | ||
861 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
862 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
863 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
864 | <xsl:otherwise>1</xsl:otherwise> | ||
865 | </xsl:choose> | ||
866 | </xsl:variable> | ||
867 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
868 | <div><xsl:copy-of select="$recto.content"/></div> | ||
869 | </xsl:if> | ||
870 | <xsl:variable name="verso.content"> | ||
871 | <xsl:call-template name="partintro.titlepage.before.verso"/> | ||
872 | <xsl:call-template name="partintro.titlepage.verso"/> | ||
873 | </xsl:variable> | ||
874 | <xsl:variable name="verso.elements.count"> | ||
875 | <xsl:choose> | ||
876 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
877 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
878 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
879 | <xsl:otherwise>1</xsl:otherwise> | ||
880 | </xsl:choose> | ||
881 | </xsl:variable> | ||
882 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
883 | <div><xsl:copy-of select="$verso.content"/></div> | ||
884 | </xsl:if> | ||
885 | <xsl:call-template name="partintro.titlepage.separator"/> | ||
886 | </div> | ||
887 | </xsl:template> | ||
888 | |||
889 | <xsl:template match="*" mode="partintro.titlepage.recto.mode"> | ||
890 | <!-- if an element isn't found in this mode, --> | ||
891 | <!-- try the generic titlepage.mode --> | ||
892 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
893 | </xsl:template> | ||
894 | |||
895 | <xsl:template match="*" mode="partintro.titlepage.verso.mode"> | ||
896 | <!-- if an element isn't found in this mode, --> | ||
897 | <!-- try the generic titlepage.mode --> | ||
898 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
899 | </xsl:template> | ||
900 | |||
901 | <xsl:template match="title" mode="partintro.titlepage.recto.auto.mode"> | ||
902 | <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> | ||
903 | <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> | ||
904 | </div> | ||
905 | </xsl:template> | ||
906 | |||
907 | <xsl:template match="subtitle" mode="partintro.titlepage.recto.auto.mode"> | ||
908 | <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> | ||
909 | <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> | ||
910 | </div> | ||
911 | </xsl:template> | ||
912 | |||
913 | <xsl:template match="corpauthor" mode="partintro.titlepage.recto.auto.mode"> | ||
914 | <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> | ||
915 | <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> | ||
916 | </div> | ||
917 | </xsl:template> | ||
918 | |||
919 | <xsl:template match="authorgroup" mode="partintro.titlepage.recto.auto.mode"> | ||
920 | <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> | ||
921 | <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> | ||
922 | </div> | ||
923 | </xsl:template> | ||
924 | |||
925 | <xsl:template match="author" mode="partintro.titlepage.recto.auto.mode"> | ||
926 | <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> | ||
927 | <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> | ||
928 | </div> | ||
929 | </xsl:template> | ||
930 | |||
931 | <xsl:template match="othercredit" mode="partintro.titlepage.recto.auto.mode"> | ||
932 | <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> | ||
933 | <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> | ||
934 | </div> | ||
935 | </xsl:template> | ||
936 | |||
937 | <xsl:template match="releaseinfo" mode="partintro.titlepage.recto.auto.mode"> | ||
938 | <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> | ||
939 | <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> | ||
940 | </div> | ||
941 | </xsl:template> | ||
942 | |||
943 | <xsl:template match="copyright" mode="partintro.titlepage.recto.auto.mode"> | ||
944 | <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> | ||
945 | <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> | ||
946 | </div> | ||
947 | </xsl:template> | ||
948 | |||
949 | <xsl:template match="legalnotice" mode="partintro.titlepage.recto.auto.mode"> | ||
950 | <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> | ||
951 | <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> | ||
952 | </div> | ||
953 | </xsl:template> | ||
954 | |||
955 | <xsl:template match="pubdate" mode="partintro.titlepage.recto.auto.mode"> | ||
956 | <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> | ||
957 | <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> | ||
958 | </div> | ||
959 | </xsl:template> | ||
960 | |||
961 | <xsl:template match="revision" mode="partintro.titlepage.recto.auto.mode"> | ||
962 | <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> | ||
963 | <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> | ||
964 | </div> | ||
965 | </xsl:template> | ||
966 | |||
967 | <xsl:template match="revhistory" mode="partintro.titlepage.recto.auto.mode"> | ||
968 | <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> | ||
969 | <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> | ||
970 | </div> | ||
971 | </xsl:template> | ||
972 | |||
973 | <xsl:template match="abstract" mode="partintro.titlepage.recto.auto.mode"> | ||
974 | <div xsl:use-attribute-sets="partintro.titlepage.recto.style"> | ||
975 | <xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> | ||
976 | </div> | ||
977 | </xsl:template> | ||
978 | |||
979 | <xsl:template name="reference.titlepage.recto"> | ||
980 | <xsl:choose> | ||
981 | <xsl:when test="referenceinfo/title"> | ||
982 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/title"/> | ||
983 | </xsl:when> | ||
984 | <xsl:when test="docinfo/title"> | ||
985 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/title"/> | ||
986 | </xsl:when> | ||
987 | <xsl:when test="info/title"> | ||
988 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/title"/> | ||
989 | </xsl:when> | ||
990 | <xsl:when test="title"> | ||
991 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="title"/> | ||
992 | </xsl:when> | ||
993 | </xsl:choose> | ||
994 | |||
995 | <xsl:choose> | ||
996 | <xsl:when test="referenceinfo/subtitle"> | ||
997 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/subtitle"/> | ||
998 | </xsl:when> | ||
999 | <xsl:when test="docinfo/subtitle"> | ||
1000 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
1001 | </xsl:when> | ||
1002 | <xsl:when test="info/subtitle"> | ||
1003 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
1004 | </xsl:when> | ||
1005 | <xsl:when test="subtitle"> | ||
1006 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="subtitle"/> | ||
1007 | </xsl:when> | ||
1008 | </xsl:choose> | ||
1009 | |||
1010 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/corpauthor"/> | ||
1011 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> | ||
1012 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
1013 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/authorgroup"/> | ||
1014 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> | ||
1015 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
1016 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/author"/> | ||
1017 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/author"/> | ||
1018 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/author"/> | ||
1019 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/othercredit"/> | ||
1020 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/othercredit"/> | ||
1021 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
1022 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/releaseinfo"/> | ||
1023 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> | ||
1024 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
1025 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/copyright"/> | ||
1026 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/copyright"/> | ||
1027 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/copyright"/> | ||
1028 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/legalnotice"/> | ||
1029 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> | ||
1030 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
1031 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/pubdate"/> | ||
1032 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/pubdate"/> | ||
1033 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
1034 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revision"/> | ||
1035 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/revision"/> | ||
1036 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/revision"/> | ||
1037 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revhistory"/> | ||
1038 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/revhistory"/> | ||
1039 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
1040 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/abstract"/> | ||
1041 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/abstract"/> | ||
1042 | <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/abstract"/> | ||
1043 | </xsl:template> | ||
1044 | |||
1045 | <xsl:template name="reference.titlepage.verso"> | ||
1046 | </xsl:template> | ||
1047 | |||
1048 | <xsl:template name="reference.titlepage.separator"><hr/> | ||
1049 | </xsl:template> | ||
1050 | |||
1051 | <xsl:template name="reference.titlepage.before.recto"> | ||
1052 | </xsl:template> | ||
1053 | |||
1054 | <xsl:template name="reference.titlepage.before.verso"> | ||
1055 | </xsl:template> | ||
1056 | |||
1057 | <xsl:template name="reference.titlepage"> | ||
1058 | <div class="titlepage"> | ||
1059 | <xsl:variable name="recto.content"> | ||
1060 | <xsl:call-template name="reference.titlepage.before.recto"/> | ||
1061 | <xsl:call-template name="reference.titlepage.recto"/> | ||
1062 | </xsl:variable> | ||
1063 | <xsl:variable name="recto.elements.count"> | ||
1064 | <xsl:choose> | ||
1065 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1066 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1067 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1068 | <xsl:otherwise>1</xsl:otherwise> | ||
1069 | </xsl:choose> | ||
1070 | </xsl:variable> | ||
1071 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
1072 | <div><xsl:copy-of select="$recto.content"/></div> | ||
1073 | </xsl:if> | ||
1074 | <xsl:variable name="verso.content"> | ||
1075 | <xsl:call-template name="reference.titlepage.before.verso"/> | ||
1076 | <xsl:call-template name="reference.titlepage.verso"/> | ||
1077 | </xsl:variable> | ||
1078 | <xsl:variable name="verso.elements.count"> | ||
1079 | <xsl:choose> | ||
1080 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1081 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1082 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1083 | <xsl:otherwise>1</xsl:otherwise> | ||
1084 | </xsl:choose> | ||
1085 | </xsl:variable> | ||
1086 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
1087 | <div><xsl:copy-of select="$verso.content"/></div> | ||
1088 | </xsl:if> | ||
1089 | <xsl:call-template name="reference.titlepage.separator"/> | ||
1090 | </div> | ||
1091 | </xsl:template> | ||
1092 | |||
1093 | <xsl:template match="*" mode="reference.titlepage.recto.mode"> | ||
1094 | <!-- if an element isn't found in this mode, --> | ||
1095 | <!-- try the generic titlepage.mode --> | ||
1096 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1097 | </xsl:template> | ||
1098 | |||
1099 | <xsl:template match="*" mode="reference.titlepage.verso.mode"> | ||
1100 | <!-- if an element isn't found in this mode, --> | ||
1101 | <!-- try the generic titlepage.mode --> | ||
1102 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1103 | </xsl:template> | ||
1104 | |||
1105 | <xsl:template match="title" mode="reference.titlepage.recto.auto.mode"> | ||
1106 | <div xsl:use-attribute-sets="reference.titlepage.recto.style"> | ||
1107 | <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> | ||
1108 | </div> | ||
1109 | </xsl:template> | ||
1110 | |||
1111 | <xsl:template match="subtitle" mode="reference.titlepage.recto.auto.mode"> | ||
1112 | <div xsl:use-attribute-sets="reference.titlepage.recto.style"> | ||
1113 | <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> | ||
1114 | </div> | ||
1115 | </xsl:template> | ||
1116 | |||
1117 | <xsl:template match="corpauthor" mode="reference.titlepage.recto.auto.mode"> | ||
1118 | <div xsl:use-attribute-sets="reference.titlepage.recto.style"> | ||
1119 | <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> | ||
1120 | </div> | ||
1121 | </xsl:template> | ||
1122 | |||
1123 | <xsl:template match="authorgroup" mode="reference.titlepage.recto.auto.mode"> | ||
1124 | <div xsl:use-attribute-sets="reference.titlepage.recto.style"> | ||
1125 | <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> | ||
1126 | </div> | ||
1127 | </xsl:template> | ||
1128 | |||
1129 | <xsl:template match="author" mode="reference.titlepage.recto.auto.mode"> | ||
1130 | <div xsl:use-attribute-sets="reference.titlepage.recto.style"> | ||
1131 | <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> | ||
1132 | </div> | ||
1133 | </xsl:template> | ||
1134 | |||
1135 | <xsl:template match="othercredit" mode="reference.titlepage.recto.auto.mode"> | ||
1136 | <div xsl:use-attribute-sets="reference.titlepage.recto.style"> | ||
1137 | <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> | ||
1138 | </div> | ||
1139 | </xsl:template> | ||
1140 | |||
1141 | <xsl:template match="releaseinfo" mode="reference.titlepage.recto.auto.mode"> | ||
1142 | <div xsl:use-attribute-sets="reference.titlepage.recto.style"> | ||
1143 | <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> | ||
1144 | </div> | ||
1145 | </xsl:template> | ||
1146 | |||
1147 | <xsl:template match="copyright" mode="reference.titlepage.recto.auto.mode"> | ||
1148 | <div xsl:use-attribute-sets="reference.titlepage.recto.style"> | ||
1149 | <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> | ||
1150 | </div> | ||
1151 | </xsl:template> | ||
1152 | |||
1153 | <xsl:template match="legalnotice" mode="reference.titlepage.recto.auto.mode"> | ||
1154 | <div xsl:use-attribute-sets="reference.titlepage.recto.style"> | ||
1155 | <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> | ||
1156 | </div> | ||
1157 | </xsl:template> | ||
1158 | |||
1159 | <xsl:template match="pubdate" mode="reference.titlepage.recto.auto.mode"> | ||
1160 | <div xsl:use-attribute-sets="reference.titlepage.recto.style"> | ||
1161 | <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> | ||
1162 | </div> | ||
1163 | </xsl:template> | ||
1164 | |||
1165 | <xsl:template match="revision" mode="reference.titlepage.recto.auto.mode"> | ||
1166 | <div xsl:use-attribute-sets="reference.titlepage.recto.style"> | ||
1167 | <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> | ||
1168 | </div> | ||
1169 | </xsl:template> | ||
1170 | |||
1171 | <xsl:template match="revhistory" mode="reference.titlepage.recto.auto.mode"> | ||
1172 | <div xsl:use-attribute-sets="reference.titlepage.recto.style"> | ||
1173 | <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> | ||
1174 | </div> | ||
1175 | </xsl:template> | ||
1176 | |||
1177 | <xsl:template match="abstract" mode="reference.titlepage.recto.auto.mode"> | ||
1178 | <div xsl:use-attribute-sets="reference.titlepage.recto.style"> | ||
1179 | <xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> | ||
1180 | </div> | ||
1181 | </xsl:template> | ||
1182 | |||
1183 | <xsl:template name="refentry.titlepage.recto"> | ||
1184 | </xsl:template> | ||
1185 | |||
1186 | <xsl:template name="refentry.titlepage.verso"> | ||
1187 | </xsl:template> | ||
1188 | |||
1189 | <xsl:template name="refentry.titlepage.separator"> | ||
1190 | </xsl:template> | ||
1191 | |||
1192 | <xsl:template name="refentry.titlepage.before.recto"> | ||
1193 | </xsl:template> | ||
1194 | |||
1195 | <xsl:template name="refentry.titlepage.before.verso"> | ||
1196 | </xsl:template> | ||
1197 | |||
1198 | <xsl:template name="refentry.titlepage"> | ||
1199 | <div class="titlepage"> | ||
1200 | <xsl:variable name="recto.content"> | ||
1201 | <xsl:call-template name="refentry.titlepage.before.recto"/> | ||
1202 | <xsl:call-template name="refentry.titlepage.recto"/> | ||
1203 | </xsl:variable> | ||
1204 | <xsl:variable name="recto.elements.count"> | ||
1205 | <xsl:choose> | ||
1206 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1207 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1208 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1209 | <xsl:otherwise>1</xsl:otherwise> | ||
1210 | </xsl:choose> | ||
1211 | </xsl:variable> | ||
1212 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
1213 | <div><xsl:copy-of select="$recto.content"/></div> | ||
1214 | </xsl:if> | ||
1215 | <xsl:variable name="verso.content"> | ||
1216 | <xsl:call-template name="refentry.titlepage.before.verso"/> | ||
1217 | <xsl:call-template name="refentry.titlepage.verso"/> | ||
1218 | </xsl:variable> | ||
1219 | <xsl:variable name="verso.elements.count"> | ||
1220 | <xsl:choose> | ||
1221 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1222 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1223 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1224 | <xsl:otherwise>1</xsl:otherwise> | ||
1225 | </xsl:choose> | ||
1226 | </xsl:variable> | ||
1227 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
1228 | <div><xsl:copy-of select="$verso.content"/></div> | ||
1229 | </xsl:if> | ||
1230 | <xsl:call-template name="refentry.titlepage.separator"/> | ||
1231 | </div> | ||
1232 | </xsl:template> | ||
1233 | |||
1234 | <xsl:template match="*" mode="refentry.titlepage.recto.mode"> | ||
1235 | <!-- if an element isn't found in this mode, --> | ||
1236 | <!-- try the generic titlepage.mode --> | ||
1237 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1238 | </xsl:template> | ||
1239 | |||
1240 | <xsl:template match="*" mode="refentry.titlepage.verso.mode"> | ||
1241 | <!-- if an element isn't found in this mode, --> | ||
1242 | <!-- try the generic titlepage.mode --> | ||
1243 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1244 | </xsl:template> | ||
1245 | |||
1246 | <xsl:template name="dedication.titlepage.recto"> | ||
1247 | <div xsl:use-attribute-sets="dedication.titlepage.recto.style"> | ||
1248 | <xsl:call-template name="component.title"> | ||
1249 | <xsl:with-param name="node" select="ancestor-or-self::dedication[1]"/> | ||
1250 | </xsl:call-template></div> | ||
1251 | <xsl:choose> | ||
1252 | <xsl:when test="dedicationinfo/subtitle"> | ||
1253 | <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="dedicationinfo/subtitle"/> | ||
1254 | </xsl:when> | ||
1255 | <xsl:when test="docinfo/subtitle"> | ||
1256 | <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
1257 | </xsl:when> | ||
1258 | <xsl:when test="info/subtitle"> | ||
1259 | <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
1260 | </xsl:when> | ||
1261 | <xsl:when test="subtitle"> | ||
1262 | <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="subtitle"/> | ||
1263 | </xsl:when> | ||
1264 | </xsl:choose> | ||
1265 | |||
1266 | </xsl:template> | ||
1267 | |||
1268 | <xsl:template name="dedication.titlepage.verso"> | ||
1269 | </xsl:template> | ||
1270 | |||
1271 | <xsl:template name="dedication.titlepage.separator"> | ||
1272 | </xsl:template> | ||
1273 | |||
1274 | <xsl:template name="dedication.titlepage.before.recto"> | ||
1275 | </xsl:template> | ||
1276 | |||
1277 | <xsl:template name="dedication.titlepage.before.verso"> | ||
1278 | </xsl:template> | ||
1279 | |||
1280 | <xsl:template name="dedication.titlepage"> | ||
1281 | <div class="titlepage"> | ||
1282 | <xsl:variable name="recto.content"> | ||
1283 | <xsl:call-template name="dedication.titlepage.before.recto"/> | ||
1284 | <xsl:call-template name="dedication.titlepage.recto"/> | ||
1285 | </xsl:variable> | ||
1286 | <xsl:variable name="recto.elements.count"> | ||
1287 | <xsl:choose> | ||
1288 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1289 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1290 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1291 | <xsl:otherwise>1</xsl:otherwise> | ||
1292 | </xsl:choose> | ||
1293 | </xsl:variable> | ||
1294 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
1295 | <div><xsl:copy-of select="$recto.content"/></div> | ||
1296 | </xsl:if> | ||
1297 | <xsl:variable name="verso.content"> | ||
1298 | <xsl:call-template name="dedication.titlepage.before.verso"/> | ||
1299 | <xsl:call-template name="dedication.titlepage.verso"/> | ||
1300 | </xsl:variable> | ||
1301 | <xsl:variable name="verso.elements.count"> | ||
1302 | <xsl:choose> | ||
1303 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1304 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1305 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1306 | <xsl:otherwise>1</xsl:otherwise> | ||
1307 | </xsl:choose> | ||
1308 | </xsl:variable> | ||
1309 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
1310 | <div><xsl:copy-of select="$verso.content"/></div> | ||
1311 | </xsl:if> | ||
1312 | <xsl:call-template name="dedication.titlepage.separator"/> | ||
1313 | </div> | ||
1314 | </xsl:template> | ||
1315 | |||
1316 | <xsl:template match="*" mode="dedication.titlepage.recto.mode"> | ||
1317 | <!-- if an element isn't found in this mode, --> | ||
1318 | <!-- try the generic titlepage.mode --> | ||
1319 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1320 | </xsl:template> | ||
1321 | |||
1322 | <xsl:template match="*" mode="dedication.titlepage.verso.mode"> | ||
1323 | <!-- if an element isn't found in this mode, --> | ||
1324 | <!-- try the generic titlepage.mode --> | ||
1325 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1326 | </xsl:template> | ||
1327 | |||
1328 | <xsl:template match="subtitle" mode="dedication.titlepage.recto.auto.mode"> | ||
1329 | <div xsl:use-attribute-sets="dedication.titlepage.recto.style"> | ||
1330 | <xsl:apply-templates select="." mode="dedication.titlepage.recto.mode"/> | ||
1331 | </div> | ||
1332 | </xsl:template> | ||
1333 | |||
1334 | <xsl:template name="acknowledgements.titlepage.recto"> | ||
1335 | <div xsl:use-attribute-sets="acknowledgements.titlepage.recto.style"> | ||
1336 | <xsl:call-template name="component.title"> | ||
1337 | <xsl:with-param name="node" select="ancestor-or-self::acknowledgements[1]"/> | ||
1338 | </xsl:call-template></div> | ||
1339 | <xsl:choose> | ||
1340 | <xsl:when test="acknowledgementsinfo/subtitle"> | ||
1341 | <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="acknowledgementsinfo/subtitle"/> | ||
1342 | </xsl:when> | ||
1343 | <xsl:when test="docinfo/subtitle"> | ||
1344 | <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
1345 | </xsl:when> | ||
1346 | <xsl:when test="info/subtitle"> | ||
1347 | <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
1348 | </xsl:when> | ||
1349 | <xsl:when test="subtitle"> | ||
1350 | <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="subtitle"/> | ||
1351 | </xsl:when> | ||
1352 | </xsl:choose> | ||
1353 | |||
1354 | </xsl:template> | ||
1355 | |||
1356 | <xsl:template name="acknowledgements.titlepage.verso"> | ||
1357 | </xsl:template> | ||
1358 | |||
1359 | <xsl:template name="acknowledgements.titlepage.separator"> | ||
1360 | </xsl:template> | ||
1361 | |||
1362 | <xsl:template name="acknowledgements.titlepage.before.recto"> | ||
1363 | </xsl:template> | ||
1364 | |||
1365 | <xsl:template name="acknowledgements.titlepage.before.verso"> | ||
1366 | </xsl:template> | ||
1367 | |||
1368 | <xsl:template name="acknowledgements.titlepage"> | ||
1369 | <div class="titlepage"> | ||
1370 | <xsl:variable name="recto.content"> | ||
1371 | <xsl:call-template name="acknowledgements.titlepage.before.recto"/> | ||
1372 | <xsl:call-template name="acknowledgements.titlepage.recto"/> | ||
1373 | </xsl:variable> | ||
1374 | <xsl:variable name="recto.elements.count"> | ||
1375 | <xsl:choose> | ||
1376 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1377 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1378 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1379 | <xsl:otherwise>1</xsl:otherwise> | ||
1380 | </xsl:choose> | ||
1381 | </xsl:variable> | ||
1382 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
1383 | <div><xsl:copy-of select="$recto.content"/></div> | ||
1384 | </xsl:if> | ||
1385 | <xsl:variable name="verso.content"> | ||
1386 | <xsl:call-template name="acknowledgements.titlepage.before.verso"/> | ||
1387 | <xsl:call-template name="acknowledgements.titlepage.verso"/> | ||
1388 | </xsl:variable> | ||
1389 | <xsl:variable name="verso.elements.count"> | ||
1390 | <xsl:choose> | ||
1391 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1392 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1393 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1394 | <xsl:otherwise>1</xsl:otherwise> | ||
1395 | </xsl:choose> | ||
1396 | </xsl:variable> | ||
1397 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
1398 | <div><xsl:copy-of select="$verso.content"/></div> | ||
1399 | </xsl:if> | ||
1400 | <xsl:call-template name="acknowledgements.titlepage.separator"/> | ||
1401 | </div> | ||
1402 | </xsl:template> | ||
1403 | |||
1404 | <xsl:template match="*" mode="acknowledgements.titlepage.recto.mode"> | ||
1405 | <!-- if an element isn't found in this mode, --> | ||
1406 | <!-- try the generic titlepage.mode --> | ||
1407 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1408 | </xsl:template> | ||
1409 | |||
1410 | <xsl:template match="*" mode="acknowledgements.titlepage.verso.mode"> | ||
1411 | <!-- if an element isn't found in this mode, --> | ||
1412 | <!-- try the generic titlepage.mode --> | ||
1413 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1414 | </xsl:template> | ||
1415 | |||
1416 | <xsl:template match="subtitle" mode="acknowledgements.titlepage.recto.auto.mode"> | ||
1417 | <div xsl:use-attribute-sets="acknowledgements.titlepage.recto.style"> | ||
1418 | <xsl:apply-templates select="." mode="acknowledgements.titlepage.recto.mode"/> | ||
1419 | </div> | ||
1420 | </xsl:template> | ||
1421 | |||
1422 | <xsl:template name="preface.titlepage.recto"> | ||
1423 | <xsl:choose> | ||
1424 | <xsl:when test="prefaceinfo/title"> | ||
1425 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/title"/> | ||
1426 | </xsl:when> | ||
1427 | <xsl:when test="docinfo/title"> | ||
1428 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/title"/> | ||
1429 | </xsl:when> | ||
1430 | <xsl:when test="info/title"> | ||
1431 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/title"/> | ||
1432 | </xsl:when> | ||
1433 | <xsl:when test="title"> | ||
1434 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="title"/> | ||
1435 | </xsl:when> | ||
1436 | </xsl:choose> | ||
1437 | |||
1438 | <xsl:choose> | ||
1439 | <xsl:when test="prefaceinfo/subtitle"> | ||
1440 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/subtitle"/> | ||
1441 | </xsl:when> | ||
1442 | <xsl:when test="docinfo/subtitle"> | ||
1443 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
1444 | </xsl:when> | ||
1445 | <xsl:when test="info/subtitle"> | ||
1446 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
1447 | </xsl:when> | ||
1448 | <xsl:when test="subtitle"> | ||
1449 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="subtitle"/> | ||
1450 | </xsl:when> | ||
1451 | </xsl:choose> | ||
1452 | |||
1453 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/corpauthor"/> | ||
1454 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> | ||
1455 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
1456 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/authorgroup"/> | ||
1457 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> | ||
1458 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
1459 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/author"/> | ||
1460 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/author"/> | ||
1461 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/author"/> | ||
1462 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/othercredit"/> | ||
1463 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/othercredit"/> | ||
1464 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
1465 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/releaseinfo"/> | ||
1466 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> | ||
1467 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
1468 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/copyright"/> | ||
1469 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/copyright"/> | ||
1470 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/copyright"/> | ||
1471 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/legalnotice"/> | ||
1472 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> | ||
1473 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
1474 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/pubdate"/> | ||
1475 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/pubdate"/> | ||
1476 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
1477 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revision"/> | ||
1478 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/revision"/> | ||
1479 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/revision"/> | ||
1480 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revhistory"/> | ||
1481 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/revhistory"/> | ||
1482 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
1483 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/abstract"/> | ||
1484 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/abstract"/> | ||
1485 | <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/abstract"/> | ||
1486 | </xsl:template> | ||
1487 | |||
1488 | <xsl:template name="preface.titlepage.verso"> | ||
1489 | </xsl:template> | ||
1490 | |||
1491 | <xsl:template name="preface.titlepage.separator"> | ||
1492 | </xsl:template> | ||
1493 | |||
1494 | <xsl:template name="preface.titlepage.before.recto"> | ||
1495 | </xsl:template> | ||
1496 | |||
1497 | <xsl:template name="preface.titlepage.before.verso"> | ||
1498 | </xsl:template> | ||
1499 | |||
1500 | <xsl:template name="preface.titlepage"> | ||
1501 | <div class="titlepage"> | ||
1502 | <xsl:variable name="recto.content"> | ||
1503 | <xsl:call-template name="preface.titlepage.before.recto"/> | ||
1504 | <xsl:call-template name="preface.titlepage.recto"/> | ||
1505 | </xsl:variable> | ||
1506 | <xsl:variable name="recto.elements.count"> | ||
1507 | <xsl:choose> | ||
1508 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1509 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1510 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1511 | <xsl:otherwise>1</xsl:otherwise> | ||
1512 | </xsl:choose> | ||
1513 | </xsl:variable> | ||
1514 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
1515 | <div><xsl:copy-of select="$recto.content"/></div> | ||
1516 | </xsl:if> | ||
1517 | <xsl:variable name="verso.content"> | ||
1518 | <xsl:call-template name="preface.titlepage.before.verso"/> | ||
1519 | <xsl:call-template name="preface.titlepage.verso"/> | ||
1520 | </xsl:variable> | ||
1521 | <xsl:variable name="verso.elements.count"> | ||
1522 | <xsl:choose> | ||
1523 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1524 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1525 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1526 | <xsl:otherwise>1</xsl:otherwise> | ||
1527 | </xsl:choose> | ||
1528 | </xsl:variable> | ||
1529 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
1530 | <div><xsl:copy-of select="$verso.content"/></div> | ||
1531 | </xsl:if> | ||
1532 | <xsl:call-template name="preface.titlepage.separator"/> | ||
1533 | </div> | ||
1534 | </xsl:template> | ||
1535 | |||
1536 | <xsl:template match="*" mode="preface.titlepage.recto.mode"> | ||
1537 | <!-- if an element isn't found in this mode, --> | ||
1538 | <!-- try the generic titlepage.mode --> | ||
1539 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1540 | </xsl:template> | ||
1541 | |||
1542 | <xsl:template match="*" mode="preface.titlepage.verso.mode"> | ||
1543 | <!-- if an element isn't found in this mode, --> | ||
1544 | <!-- try the generic titlepage.mode --> | ||
1545 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1546 | </xsl:template> | ||
1547 | |||
1548 | <xsl:template match="title" mode="preface.titlepage.recto.auto.mode"> | ||
1549 | <div xsl:use-attribute-sets="preface.titlepage.recto.style"> | ||
1550 | <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> | ||
1551 | </div> | ||
1552 | </xsl:template> | ||
1553 | |||
1554 | <xsl:template match="subtitle" mode="preface.titlepage.recto.auto.mode"> | ||
1555 | <div xsl:use-attribute-sets="preface.titlepage.recto.style"> | ||
1556 | <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> | ||
1557 | </div> | ||
1558 | </xsl:template> | ||
1559 | |||
1560 | <xsl:template match="corpauthor" mode="preface.titlepage.recto.auto.mode"> | ||
1561 | <div xsl:use-attribute-sets="preface.titlepage.recto.style"> | ||
1562 | <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> | ||
1563 | </div> | ||
1564 | </xsl:template> | ||
1565 | |||
1566 | <xsl:template match="authorgroup" mode="preface.titlepage.recto.auto.mode"> | ||
1567 | <div xsl:use-attribute-sets="preface.titlepage.recto.style"> | ||
1568 | <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> | ||
1569 | </div> | ||
1570 | </xsl:template> | ||
1571 | |||
1572 | <xsl:template match="author" mode="preface.titlepage.recto.auto.mode"> | ||
1573 | <div xsl:use-attribute-sets="preface.titlepage.recto.style"> | ||
1574 | <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> | ||
1575 | </div> | ||
1576 | </xsl:template> | ||
1577 | |||
1578 | <xsl:template match="othercredit" mode="preface.titlepage.recto.auto.mode"> | ||
1579 | <div xsl:use-attribute-sets="preface.titlepage.recto.style"> | ||
1580 | <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> | ||
1581 | </div> | ||
1582 | </xsl:template> | ||
1583 | |||
1584 | <xsl:template match="releaseinfo" mode="preface.titlepage.recto.auto.mode"> | ||
1585 | <div xsl:use-attribute-sets="preface.titlepage.recto.style"> | ||
1586 | <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> | ||
1587 | </div> | ||
1588 | </xsl:template> | ||
1589 | |||
1590 | <xsl:template match="copyright" mode="preface.titlepage.recto.auto.mode"> | ||
1591 | <div xsl:use-attribute-sets="preface.titlepage.recto.style"> | ||
1592 | <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> | ||
1593 | </div> | ||
1594 | </xsl:template> | ||
1595 | |||
1596 | <xsl:template match="legalnotice" mode="preface.titlepage.recto.auto.mode"> | ||
1597 | <div xsl:use-attribute-sets="preface.titlepage.recto.style"> | ||
1598 | <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> | ||
1599 | </div> | ||
1600 | </xsl:template> | ||
1601 | |||
1602 | <xsl:template match="pubdate" mode="preface.titlepage.recto.auto.mode"> | ||
1603 | <div xsl:use-attribute-sets="preface.titlepage.recto.style"> | ||
1604 | <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> | ||
1605 | </div> | ||
1606 | </xsl:template> | ||
1607 | |||
1608 | <xsl:template match="revision" mode="preface.titlepage.recto.auto.mode"> | ||
1609 | <div xsl:use-attribute-sets="preface.titlepage.recto.style"> | ||
1610 | <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> | ||
1611 | </div> | ||
1612 | </xsl:template> | ||
1613 | |||
1614 | <xsl:template match="revhistory" mode="preface.titlepage.recto.auto.mode"> | ||
1615 | <div xsl:use-attribute-sets="preface.titlepage.recto.style"> | ||
1616 | <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> | ||
1617 | </div> | ||
1618 | </xsl:template> | ||
1619 | |||
1620 | <xsl:template match="abstract" mode="preface.titlepage.recto.auto.mode"> | ||
1621 | <div xsl:use-attribute-sets="preface.titlepage.recto.style"> | ||
1622 | <xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> | ||
1623 | </div> | ||
1624 | </xsl:template> | ||
1625 | |||
1626 | <xsl:template name="chapter.titlepage.recto"> | ||
1627 | <xsl:choose> | ||
1628 | <xsl:when test="chapterinfo/title"> | ||
1629 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/title"/> | ||
1630 | </xsl:when> | ||
1631 | <xsl:when test="docinfo/title"> | ||
1632 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/title"/> | ||
1633 | </xsl:when> | ||
1634 | <xsl:when test="info/title"> | ||
1635 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/title"/> | ||
1636 | </xsl:when> | ||
1637 | <xsl:when test="title"> | ||
1638 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="title"/> | ||
1639 | </xsl:when> | ||
1640 | </xsl:choose> | ||
1641 | |||
1642 | <xsl:choose> | ||
1643 | <xsl:when test="chapterinfo/subtitle"> | ||
1644 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/subtitle"/> | ||
1645 | </xsl:when> | ||
1646 | <xsl:when test="docinfo/subtitle"> | ||
1647 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
1648 | </xsl:when> | ||
1649 | <xsl:when test="info/subtitle"> | ||
1650 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
1651 | </xsl:when> | ||
1652 | <xsl:when test="subtitle"> | ||
1653 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="subtitle"/> | ||
1654 | </xsl:when> | ||
1655 | </xsl:choose> | ||
1656 | |||
1657 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/corpauthor"/> | ||
1658 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> | ||
1659 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
1660 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/authorgroup"/> | ||
1661 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> | ||
1662 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
1663 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/author"/> | ||
1664 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/author"/> | ||
1665 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/author"/> | ||
1666 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/othercredit"/> | ||
1667 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/othercredit"/> | ||
1668 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
1669 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/releaseinfo"/> | ||
1670 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> | ||
1671 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
1672 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/copyright"/> | ||
1673 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/copyright"/> | ||
1674 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/copyright"/> | ||
1675 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/legalnotice"/> | ||
1676 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> | ||
1677 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
1678 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/pubdate"/> | ||
1679 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/pubdate"/> | ||
1680 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
1681 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revision"/> | ||
1682 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/revision"/> | ||
1683 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/revision"/> | ||
1684 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revhistory"/> | ||
1685 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/revhistory"/> | ||
1686 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
1687 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/abstract"/> | ||
1688 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/abstract"/> | ||
1689 | <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/abstract"/> | ||
1690 | </xsl:template> | ||
1691 | |||
1692 | <xsl:template name="chapter.titlepage.verso"> | ||
1693 | </xsl:template> | ||
1694 | |||
1695 | <xsl:template name="chapter.titlepage.separator"> | ||
1696 | </xsl:template> | ||
1697 | |||
1698 | <xsl:template name="chapter.titlepage.before.recto"> | ||
1699 | </xsl:template> | ||
1700 | |||
1701 | <xsl:template name="chapter.titlepage.before.verso"> | ||
1702 | </xsl:template> | ||
1703 | |||
1704 | <xsl:template name="chapter.titlepage"> | ||
1705 | <div class="titlepage"> | ||
1706 | <xsl:variable name="recto.content"> | ||
1707 | <xsl:call-template name="chapter.titlepage.before.recto"/> | ||
1708 | <xsl:call-template name="chapter.titlepage.recto"/> | ||
1709 | </xsl:variable> | ||
1710 | <xsl:variable name="recto.elements.count"> | ||
1711 | <xsl:choose> | ||
1712 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1713 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1714 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1715 | <xsl:otherwise>1</xsl:otherwise> | ||
1716 | </xsl:choose> | ||
1717 | </xsl:variable> | ||
1718 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
1719 | <div><xsl:copy-of select="$recto.content"/></div> | ||
1720 | </xsl:if> | ||
1721 | <xsl:variable name="verso.content"> | ||
1722 | <xsl:call-template name="chapter.titlepage.before.verso"/> | ||
1723 | <xsl:call-template name="chapter.titlepage.verso"/> | ||
1724 | </xsl:variable> | ||
1725 | <xsl:variable name="verso.elements.count"> | ||
1726 | <xsl:choose> | ||
1727 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1728 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1729 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1730 | <xsl:otherwise>1</xsl:otherwise> | ||
1731 | </xsl:choose> | ||
1732 | </xsl:variable> | ||
1733 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
1734 | <div><xsl:copy-of select="$verso.content"/></div> | ||
1735 | </xsl:if> | ||
1736 | <xsl:call-template name="chapter.titlepage.separator"/> | ||
1737 | </div> | ||
1738 | </xsl:template> | ||
1739 | |||
1740 | <xsl:template match="*" mode="chapter.titlepage.recto.mode"> | ||
1741 | <!-- if an element isn't found in this mode, --> | ||
1742 | <!-- try the generic titlepage.mode --> | ||
1743 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1744 | </xsl:template> | ||
1745 | |||
1746 | <xsl:template match="*" mode="chapter.titlepage.verso.mode"> | ||
1747 | <!-- if an element isn't found in this mode, --> | ||
1748 | <!-- try the generic titlepage.mode --> | ||
1749 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1750 | </xsl:template> | ||
1751 | |||
1752 | <xsl:template match="title" mode="chapter.titlepage.recto.auto.mode"> | ||
1753 | <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> | ||
1754 | <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> | ||
1755 | </div> | ||
1756 | </xsl:template> | ||
1757 | |||
1758 | <xsl:template match="subtitle" mode="chapter.titlepage.recto.auto.mode"> | ||
1759 | <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> | ||
1760 | <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> | ||
1761 | </div> | ||
1762 | </xsl:template> | ||
1763 | |||
1764 | <xsl:template match="corpauthor" mode="chapter.titlepage.recto.auto.mode"> | ||
1765 | <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> | ||
1766 | <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> | ||
1767 | </div> | ||
1768 | </xsl:template> | ||
1769 | |||
1770 | <xsl:template match="authorgroup" mode="chapter.titlepage.recto.auto.mode"> | ||
1771 | <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> | ||
1772 | <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> | ||
1773 | </div> | ||
1774 | </xsl:template> | ||
1775 | |||
1776 | <xsl:template match="author" mode="chapter.titlepage.recto.auto.mode"> | ||
1777 | <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> | ||
1778 | <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> | ||
1779 | </div> | ||
1780 | </xsl:template> | ||
1781 | |||
1782 | <xsl:template match="othercredit" mode="chapter.titlepage.recto.auto.mode"> | ||
1783 | <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> | ||
1784 | <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> | ||
1785 | </div> | ||
1786 | </xsl:template> | ||
1787 | |||
1788 | <xsl:template match="releaseinfo" mode="chapter.titlepage.recto.auto.mode"> | ||
1789 | <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> | ||
1790 | <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> | ||
1791 | </div> | ||
1792 | </xsl:template> | ||
1793 | |||
1794 | <xsl:template match="copyright" mode="chapter.titlepage.recto.auto.mode"> | ||
1795 | <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> | ||
1796 | <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> | ||
1797 | </div> | ||
1798 | </xsl:template> | ||
1799 | |||
1800 | <xsl:template match="legalnotice" mode="chapter.titlepage.recto.auto.mode"> | ||
1801 | <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> | ||
1802 | <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> | ||
1803 | </div> | ||
1804 | </xsl:template> | ||
1805 | |||
1806 | <xsl:template match="pubdate" mode="chapter.titlepage.recto.auto.mode"> | ||
1807 | <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> | ||
1808 | <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> | ||
1809 | </div> | ||
1810 | </xsl:template> | ||
1811 | |||
1812 | <xsl:template match="revision" mode="chapter.titlepage.recto.auto.mode"> | ||
1813 | <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> | ||
1814 | <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> | ||
1815 | </div> | ||
1816 | </xsl:template> | ||
1817 | |||
1818 | <xsl:template match="revhistory" mode="chapter.titlepage.recto.auto.mode"> | ||
1819 | <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> | ||
1820 | <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> | ||
1821 | </div> | ||
1822 | </xsl:template> | ||
1823 | |||
1824 | <xsl:template match="abstract" mode="chapter.titlepage.recto.auto.mode"> | ||
1825 | <div xsl:use-attribute-sets="chapter.titlepage.recto.style"> | ||
1826 | <xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> | ||
1827 | </div> | ||
1828 | </xsl:template> | ||
1829 | |||
1830 | <xsl:template name="appendix.titlepage.recto"> | ||
1831 | <xsl:choose> | ||
1832 | <xsl:when test="appendixinfo/title"> | ||
1833 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/title"/> | ||
1834 | </xsl:when> | ||
1835 | <xsl:when test="docinfo/title"> | ||
1836 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/title"/> | ||
1837 | </xsl:when> | ||
1838 | <xsl:when test="info/title"> | ||
1839 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/title"/> | ||
1840 | </xsl:when> | ||
1841 | <xsl:when test="title"> | ||
1842 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="title"/> | ||
1843 | </xsl:when> | ||
1844 | </xsl:choose> | ||
1845 | |||
1846 | <xsl:choose> | ||
1847 | <xsl:when test="appendixinfo/subtitle"> | ||
1848 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/subtitle"/> | ||
1849 | </xsl:when> | ||
1850 | <xsl:when test="docinfo/subtitle"> | ||
1851 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
1852 | </xsl:when> | ||
1853 | <xsl:when test="info/subtitle"> | ||
1854 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
1855 | </xsl:when> | ||
1856 | <xsl:when test="subtitle"> | ||
1857 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="subtitle"/> | ||
1858 | </xsl:when> | ||
1859 | </xsl:choose> | ||
1860 | |||
1861 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/corpauthor"/> | ||
1862 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> | ||
1863 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
1864 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/authorgroup"/> | ||
1865 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> | ||
1866 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
1867 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/author"/> | ||
1868 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/author"/> | ||
1869 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/author"/> | ||
1870 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/othercredit"/> | ||
1871 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/othercredit"/> | ||
1872 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
1873 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/releaseinfo"/> | ||
1874 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> | ||
1875 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
1876 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/copyright"/> | ||
1877 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/copyright"/> | ||
1878 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/copyright"/> | ||
1879 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/legalnotice"/> | ||
1880 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> | ||
1881 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
1882 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/pubdate"/> | ||
1883 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/pubdate"/> | ||
1884 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
1885 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revision"/> | ||
1886 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/revision"/> | ||
1887 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/revision"/> | ||
1888 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revhistory"/> | ||
1889 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/revhistory"/> | ||
1890 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
1891 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/abstract"/> | ||
1892 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/abstract"/> | ||
1893 | <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/abstract"/> | ||
1894 | </xsl:template> | ||
1895 | |||
1896 | <xsl:template name="appendix.titlepage.verso"> | ||
1897 | </xsl:template> | ||
1898 | |||
1899 | <xsl:template name="appendix.titlepage.separator"> | ||
1900 | </xsl:template> | ||
1901 | |||
1902 | <xsl:template name="appendix.titlepage.before.recto"> | ||
1903 | </xsl:template> | ||
1904 | |||
1905 | <xsl:template name="appendix.titlepage.before.verso"> | ||
1906 | </xsl:template> | ||
1907 | |||
1908 | <xsl:template name="appendix.titlepage"> | ||
1909 | <div class="titlepage"> | ||
1910 | <xsl:variable name="recto.content"> | ||
1911 | <xsl:call-template name="appendix.titlepage.before.recto"/> | ||
1912 | <xsl:call-template name="appendix.titlepage.recto"/> | ||
1913 | </xsl:variable> | ||
1914 | <xsl:variable name="recto.elements.count"> | ||
1915 | <xsl:choose> | ||
1916 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1917 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1918 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
1919 | <xsl:otherwise>1</xsl:otherwise> | ||
1920 | </xsl:choose> | ||
1921 | </xsl:variable> | ||
1922 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
1923 | <div><xsl:copy-of select="$recto.content"/></div> | ||
1924 | </xsl:if> | ||
1925 | <xsl:variable name="verso.content"> | ||
1926 | <xsl:call-template name="appendix.titlepage.before.verso"/> | ||
1927 | <xsl:call-template name="appendix.titlepage.verso"/> | ||
1928 | </xsl:variable> | ||
1929 | <xsl:variable name="verso.elements.count"> | ||
1930 | <xsl:choose> | ||
1931 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1932 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
1933 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
1934 | <xsl:otherwise>1</xsl:otherwise> | ||
1935 | </xsl:choose> | ||
1936 | </xsl:variable> | ||
1937 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
1938 | <div><xsl:copy-of select="$verso.content"/></div> | ||
1939 | </xsl:if> | ||
1940 | <xsl:call-template name="appendix.titlepage.separator"/> | ||
1941 | </div> | ||
1942 | </xsl:template> | ||
1943 | |||
1944 | <xsl:template match="*" mode="appendix.titlepage.recto.mode"> | ||
1945 | <!-- if an element isn't found in this mode, --> | ||
1946 | <!-- try the generic titlepage.mode --> | ||
1947 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1948 | </xsl:template> | ||
1949 | |||
1950 | <xsl:template match="*" mode="appendix.titlepage.verso.mode"> | ||
1951 | <!-- if an element isn't found in this mode, --> | ||
1952 | <!-- try the generic titlepage.mode --> | ||
1953 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
1954 | </xsl:template> | ||
1955 | |||
1956 | <xsl:template match="title" mode="appendix.titlepage.recto.auto.mode"> | ||
1957 | <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> | ||
1958 | <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> | ||
1959 | </div> | ||
1960 | </xsl:template> | ||
1961 | |||
1962 | <xsl:template match="subtitle" mode="appendix.titlepage.recto.auto.mode"> | ||
1963 | <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> | ||
1964 | <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> | ||
1965 | </div> | ||
1966 | </xsl:template> | ||
1967 | |||
1968 | <xsl:template match="corpauthor" mode="appendix.titlepage.recto.auto.mode"> | ||
1969 | <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> | ||
1970 | <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> | ||
1971 | </div> | ||
1972 | </xsl:template> | ||
1973 | |||
1974 | <xsl:template match="authorgroup" mode="appendix.titlepage.recto.auto.mode"> | ||
1975 | <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> | ||
1976 | <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> | ||
1977 | </div> | ||
1978 | </xsl:template> | ||
1979 | |||
1980 | <xsl:template match="author" mode="appendix.titlepage.recto.auto.mode"> | ||
1981 | <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> | ||
1982 | <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> | ||
1983 | </div> | ||
1984 | </xsl:template> | ||
1985 | |||
1986 | <xsl:template match="othercredit" mode="appendix.titlepage.recto.auto.mode"> | ||
1987 | <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> | ||
1988 | <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> | ||
1989 | </div> | ||
1990 | </xsl:template> | ||
1991 | |||
1992 | <xsl:template match="releaseinfo" mode="appendix.titlepage.recto.auto.mode"> | ||
1993 | <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> | ||
1994 | <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> | ||
1995 | </div> | ||
1996 | </xsl:template> | ||
1997 | |||
1998 | <xsl:template match="copyright" mode="appendix.titlepage.recto.auto.mode"> | ||
1999 | <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> | ||
2000 | <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> | ||
2001 | </div> | ||
2002 | </xsl:template> | ||
2003 | |||
2004 | <xsl:template match="legalnotice" mode="appendix.titlepage.recto.auto.mode"> | ||
2005 | <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> | ||
2006 | <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> | ||
2007 | </div> | ||
2008 | </xsl:template> | ||
2009 | |||
2010 | <xsl:template match="pubdate" mode="appendix.titlepage.recto.auto.mode"> | ||
2011 | <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> | ||
2012 | <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> | ||
2013 | </div> | ||
2014 | </xsl:template> | ||
2015 | |||
2016 | <xsl:template match="revision" mode="appendix.titlepage.recto.auto.mode"> | ||
2017 | <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> | ||
2018 | <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> | ||
2019 | </div> | ||
2020 | </xsl:template> | ||
2021 | |||
2022 | <xsl:template match="revhistory" mode="appendix.titlepage.recto.auto.mode"> | ||
2023 | <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> | ||
2024 | <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> | ||
2025 | </div> | ||
2026 | </xsl:template> | ||
2027 | |||
2028 | <xsl:template match="abstract" mode="appendix.titlepage.recto.auto.mode"> | ||
2029 | <div xsl:use-attribute-sets="appendix.titlepage.recto.style"> | ||
2030 | <xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> | ||
2031 | </div> | ||
2032 | </xsl:template> | ||
2033 | |||
2034 | <xsl:template name="section.titlepage.recto"> | ||
2035 | <xsl:choose> | ||
2036 | <xsl:when test="sectioninfo/title"> | ||
2037 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/title"/> | ||
2038 | </xsl:when> | ||
2039 | <xsl:when test="info/title"> | ||
2040 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/title"/> | ||
2041 | </xsl:when> | ||
2042 | <xsl:when test="title"> | ||
2043 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="title"/> | ||
2044 | </xsl:when> | ||
2045 | </xsl:choose> | ||
2046 | |||
2047 | <xsl:choose> | ||
2048 | <xsl:when test="sectioninfo/subtitle"> | ||
2049 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/subtitle"/> | ||
2050 | </xsl:when> | ||
2051 | <xsl:when test="info/subtitle"> | ||
2052 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
2053 | </xsl:when> | ||
2054 | <xsl:when test="subtitle"> | ||
2055 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="subtitle"/> | ||
2056 | </xsl:when> | ||
2057 | </xsl:choose> | ||
2058 | |||
2059 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/corpauthor"/> | ||
2060 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
2061 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/authorgroup"/> | ||
2062 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
2063 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/author"/> | ||
2064 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/author"/> | ||
2065 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/othercredit"/> | ||
2066 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
2067 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/releaseinfo"/> | ||
2068 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
2069 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/copyright"/> | ||
2070 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/copyright"/> | ||
2071 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/legalnotice"/> | ||
2072 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
2073 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/pubdate"/> | ||
2074 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
2075 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revision"/> | ||
2076 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/revision"/> | ||
2077 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revhistory"/> | ||
2078 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
2079 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/abstract"/> | ||
2080 | <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/abstract"/> | ||
2081 | </xsl:template> | ||
2082 | |||
2083 | <xsl:template name="section.titlepage.verso"> | ||
2084 | </xsl:template> | ||
2085 | |||
2086 | <xsl:template name="section.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> | ||
2087 | </xsl:template> | ||
2088 | |||
2089 | <xsl:template name="section.titlepage.before.recto"> | ||
2090 | </xsl:template> | ||
2091 | |||
2092 | <xsl:template name="section.titlepage.before.verso"> | ||
2093 | </xsl:template> | ||
2094 | |||
2095 | <xsl:template name="section.titlepage"> | ||
2096 | <div class="titlepage"> | ||
2097 | <xsl:variable name="recto.content"> | ||
2098 | <xsl:call-template name="section.titlepage.before.recto"/> | ||
2099 | <xsl:call-template name="section.titlepage.recto"/> | ||
2100 | </xsl:variable> | ||
2101 | <xsl:variable name="recto.elements.count"> | ||
2102 | <xsl:choose> | ||
2103 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
2104 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
2105 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
2106 | <xsl:otherwise>1</xsl:otherwise> | ||
2107 | </xsl:choose> | ||
2108 | </xsl:variable> | ||
2109 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
2110 | <div><xsl:copy-of select="$recto.content"/></div> | ||
2111 | </xsl:if> | ||
2112 | <xsl:variable name="verso.content"> | ||
2113 | <xsl:call-template name="section.titlepage.before.verso"/> | ||
2114 | <xsl:call-template name="section.titlepage.verso"/> | ||
2115 | </xsl:variable> | ||
2116 | <xsl:variable name="verso.elements.count"> | ||
2117 | <xsl:choose> | ||
2118 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
2119 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
2120 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
2121 | <xsl:otherwise>1</xsl:otherwise> | ||
2122 | </xsl:choose> | ||
2123 | </xsl:variable> | ||
2124 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
2125 | <div><xsl:copy-of select="$verso.content"/></div> | ||
2126 | </xsl:if> | ||
2127 | <xsl:call-template name="section.titlepage.separator"/> | ||
2128 | </div> | ||
2129 | </xsl:template> | ||
2130 | |||
2131 | <xsl:template match="*" mode="section.titlepage.recto.mode"> | ||
2132 | <!-- if an element isn't found in this mode, --> | ||
2133 | <!-- try the generic titlepage.mode --> | ||
2134 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
2135 | </xsl:template> | ||
2136 | |||
2137 | <xsl:template match="*" mode="section.titlepage.verso.mode"> | ||
2138 | <!-- if an element isn't found in this mode, --> | ||
2139 | <!-- try the generic titlepage.mode --> | ||
2140 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
2141 | </xsl:template> | ||
2142 | |||
2143 | <xsl:template match="title" mode="section.titlepage.recto.auto.mode"> | ||
2144 | <div xsl:use-attribute-sets="section.titlepage.recto.style"> | ||
2145 | <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> | ||
2146 | </div> | ||
2147 | </xsl:template> | ||
2148 | |||
2149 | <xsl:template match="subtitle" mode="section.titlepage.recto.auto.mode"> | ||
2150 | <div xsl:use-attribute-sets="section.titlepage.recto.style"> | ||
2151 | <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> | ||
2152 | </div> | ||
2153 | </xsl:template> | ||
2154 | |||
2155 | <xsl:template match="corpauthor" mode="section.titlepage.recto.auto.mode"> | ||
2156 | <div xsl:use-attribute-sets="section.titlepage.recto.style"> | ||
2157 | <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> | ||
2158 | </div> | ||
2159 | </xsl:template> | ||
2160 | |||
2161 | <xsl:template match="authorgroup" mode="section.titlepage.recto.auto.mode"> | ||
2162 | <div xsl:use-attribute-sets="section.titlepage.recto.style"> | ||
2163 | <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> | ||
2164 | </div> | ||
2165 | </xsl:template> | ||
2166 | |||
2167 | <xsl:template match="author" mode="section.titlepage.recto.auto.mode"> | ||
2168 | <div xsl:use-attribute-sets="section.titlepage.recto.style"> | ||
2169 | <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> | ||
2170 | </div> | ||
2171 | </xsl:template> | ||
2172 | |||
2173 | <xsl:template match="othercredit" mode="section.titlepage.recto.auto.mode"> | ||
2174 | <div xsl:use-attribute-sets="section.titlepage.recto.style"> | ||
2175 | <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> | ||
2176 | </div> | ||
2177 | </xsl:template> | ||
2178 | |||
2179 | <xsl:template match="releaseinfo" mode="section.titlepage.recto.auto.mode"> | ||
2180 | <div xsl:use-attribute-sets="section.titlepage.recto.style"> | ||
2181 | <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> | ||
2182 | </div> | ||
2183 | </xsl:template> | ||
2184 | |||
2185 | <xsl:template match="copyright" mode="section.titlepage.recto.auto.mode"> | ||
2186 | <div xsl:use-attribute-sets="section.titlepage.recto.style"> | ||
2187 | <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> | ||
2188 | </div> | ||
2189 | </xsl:template> | ||
2190 | |||
2191 | <xsl:template match="legalnotice" mode="section.titlepage.recto.auto.mode"> | ||
2192 | <div xsl:use-attribute-sets="section.titlepage.recto.style"> | ||
2193 | <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> | ||
2194 | </div> | ||
2195 | </xsl:template> | ||
2196 | |||
2197 | <xsl:template match="pubdate" mode="section.titlepage.recto.auto.mode"> | ||
2198 | <div xsl:use-attribute-sets="section.titlepage.recto.style"> | ||
2199 | <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> | ||
2200 | </div> | ||
2201 | </xsl:template> | ||
2202 | |||
2203 | <xsl:template match="revision" mode="section.titlepage.recto.auto.mode"> | ||
2204 | <div xsl:use-attribute-sets="section.titlepage.recto.style"> | ||
2205 | <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> | ||
2206 | </div> | ||
2207 | </xsl:template> | ||
2208 | |||
2209 | <xsl:template match="revhistory" mode="section.titlepage.recto.auto.mode"> | ||
2210 | <div xsl:use-attribute-sets="section.titlepage.recto.style"> | ||
2211 | <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> | ||
2212 | </div> | ||
2213 | </xsl:template> | ||
2214 | |||
2215 | <xsl:template match="abstract" mode="section.titlepage.recto.auto.mode"> | ||
2216 | <div xsl:use-attribute-sets="section.titlepage.recto.style"> | ||
2217 | <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> | ||
2218 | </div> | ||
2219 | </xsl:template> | ||
2220 | |||
2221 | <xsl:template name="sect1.titlepage.recto"> | ||
2222 | <xsl:choose> | ||
2223 | <xsl:when test="sect1info/title"> | ||
2224 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/title"/> | ||
2225 | </xsl:when> | ||
2226 | <xsl:when test="info/title"> | ||
2227 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/title"/> | ||
2228 | </xsl:when> | ||
2229 | <xsl:when test="title"> | ||
2230 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="title"/> | ||
2231 | </xsl:when> | ||
2232 | </xsl:choose> | ||
2233 | |||
2234 | <xsl:choose> | ||
2235 | <xsl:when test="sect1info/subtitle"> | ||
2236 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/subtitle"/> | ||
2237 | </xsl:when> | ||
2238 | <xsl:when test="info/subtitle"> | ||
2239 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
2240 | </xsl:when> | ||
2241 | <xsl:when test="subtitle"> | ||
2242 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="subtitle"/> | ||
2243 | </xsl:when> | ||
2244 | </xsl:choose> | ||
2245 | |||
2246 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/corpauthor"/> | ||
2247 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
2248 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/authorgroup"/> | ||
2249 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
2250 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/author"/> | ||
2251 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/author"/> | ||
2252 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/othercredit"/> | ||
2253 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
2254 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/releaseinfo"/> | ||
2255 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
2256 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/copyright"/> | ||
2257 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/copyright"/> | ||
2258 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/legalnotice"/> | ||
2259 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
2260 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/pubdate"/> | ||
2261 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
2262 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revision"/> | ||
2263 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/revision"/> | ||
2264 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revhistory"/> | ||
2265 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
2266 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/abstract"/> | ||
2267 | <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/abstract"/> | ||
2268 | </xsl:template> | ||
2269 | |||
2270 | <xsl:template name="sect1.titlepage.verso"> | ||
2271 | </xsl:template> | ||
2272 | |||
2273 | <xsl:template name="sect1.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> | ||
2274 | </xsl:template> | ||
2275 | |||
2276 | <xsl:template name="sect1.titlepage.before.recto"> | ||
2277 | </xsl:template> | ||
2278 | |||
2279 | <xsl:template name="sect1.titlepage.before.verso"> | ||
2280 | </xsl:template> | ||
2281 | |||
2282 | <xsl:template name="sect1.titlepage"> | ||
2283 | <div class="titlepage"> | ||
2284 | <xsl:variable name="recto.content"> | ||
2285 | <xsl:call-template name="sect1.titlepage.before.recto"/> | ||
2286 | <xsl:call-template name="sect1.titlepage.recto"/> | ||
2287 | </xsl:variable> | ||
2288 | <xsl:variable name="recto.elements.count"> | ||
2289 | <xsl:choose> | ||
2290 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
2291 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
2292 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
2293 | <xsl:otherwise>1</xsl:otherwise> | ||
2294 | </xsl:choose> | ||
2295 | </xsl:variable> | ||
2296 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
2297 | <div><xsl:copy-of select="$recto.content"/></div> | ||
2298 | </xsl:if> | ||
2299 | <xsl:variable name="verso.content"> | ||
2300 | <xsl:call-template name="sect1.titlepage.before.verso"/> | ||
2301 | <xsl:call-template name="sect1.titlepage.verso"/> | ||
2302 | </xsl:variable> | ||
2303 | <xsl:variable name="verso.elements.count"> | ||
2304 | <xsl:choose> | ||
2305 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
2306 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
2307 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
2308 | <xsl:otherwise>1</xsl:otherwise> | ||
2309 | </xsl:choose> | ||
2310 | </xsl:variable> | ||
2311 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
2312 | <div><xsl:copy-of select="$verso.content"/></div> | ||
2313 | </xsl:if> | ||
2314 | <xsl:call-template name="sect1.titlepage.separator"/> | ||
2315 | </div> | ||
2316 | </xsl:template> | ||
2317 | |||
2318 | <xsl:template match="*" mode="sect1.titlepage.recto.mode"> | ||
2319 | <!-- if an element isn't found in this mode, --> | ||
2320 | <!-- try the generic titlepage.mode --> | ||
2321 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
2322 | </xsl:template> | ||
2323 | |||
2324 | <xsl:template match="*" mode="sect1.titlepage.verso.mode"> | ||
2325 | <!-- if an element isn't found in this mode, --> | ||
2326 | <!-- try the generic titlepage.mode --> | ||
2327 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
2328 | </xsl:template> | ||
2329 | |||
2330 | <xsl:template match="title" mode="sect1.titlepage.recto.auto.mode"> | ||
2331 | <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> | ||
2332 | <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> | ||
2333 | </div> | ||
2334 | </xsl:template> | ||
2335 | |||
2336 | <xsl:template match="subtitle" mode="sect1.titlepage.recto.auto.mode"> | ||
2337 | <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> | ||
2338 | <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> | ||
2339 | </div> | ||
2340 | </xsl:template> | ||
2341 | |||
2342 | <xsl:template match="corpauthor" mode="sect1.titlepage.recto.auto.mode"> | ||
2343 | <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> | ||
2344 | <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> | ||
2345 | </div> | ||
2346 | </xsl:template> | ||
2347 | |||
2348 | <xsl:template match="authorgroup" mode="sect1.titlepage.recto.auto.mode"> | ||
2349 | <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> | ||
2350 | <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> | ||
2351 | </div> | ||
2352 | </xsl:template> | ||
2353 | |||
2354 | <xsl:template match="author" mode="sect1.titlepage.recto.auto.mode"> | ||
2355 | <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> | ||
2356 | <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> | ||
2357 | </div> | ||
2358 | </xsl:template> | ||
2359 | |||
2360 | <xsl:template match="othercredit" mode="sect1.titlepage.recto.auto.mode"> | ||
2361 | <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> | ||
2362 | <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> | ||
2363 | </div> | ||
2364 | </xsl:template> | ||
2365 | |||
2366 | <xsl:template match="releaseinfo" mode="sect1.titlepage.recto.auto.mode"> | ||
2367 | <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> | ||
2368 | <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> | ||
2369 | </div> | ||
2370 | </xsl:template> | ||
2371 | |||
2372 | <xsl:template match="copyright" mode="sect1.titlepage.recto.auto.mode"> | ||
2373 | <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> | ||
2374 | <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> | ||
2375 | </div> | ||
2376 | </xsl:template> | ||
2377 | |||
2378 | <xsl:template match="legalnotice" mode="sect1.titlepage.recto.auto.mode"> | ||
2379 | <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> | ||
2380 | <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> | ||
2381 | </div> | ||
2382 | </xsl:template> | ||
2383 | |||
2384 | <xsl:template match="pubdate" mode="sect1.titlepage.recto.auto.mode"> | ||
2385 | <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> | ||
2386 | <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> | ||
2387 | </div> | ||
2388 | </xsl:template> | ||
2389 | |||
2390 | <xsl:template match="revision" mode="sect1.titlepage.recto.auto.mode"> | ||
2391 | <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> | ||
2392 | <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> | ||
2393 | </div> | ||
2394 | </xsl:template> | ||
2395 | |||
2396 | <xsl:template match="revhistory" mode="sect1.titlepage.recto.auto.mode"> | ||
2397 | <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> | ||
2398 | <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> | ||
2399 | </div> | ||
2400 | </xsl:template> | ||
2401 | |||
2402 | <xsl:template match="abstract" mode="sect1.titlepage.recto.auto.mode"> | ||
2403 | <div xsl:use-attribute-sets="sect1.titlepage.recto.style"> | ||
2404 | <xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> | ||
2405 | </div> | ||
2406 | </xsl:template> | ||
2407 | |||
2408 | <xsl:template name="sect2.titlepage.recto"> | ||
2409 | <xsl:choose> | ||
2410 | <xsl:when test="sect2info/title"> | ||
2411 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/title"/> | ||
2412 | </xsl:when> | ||
2413 | <xsl:when test="info/title"> | ||
2414 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/title"/> | ||
2415 | </xsl:when> | ||
2416 | <xsl:when test="title"> | ||
2417 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="title"/> | ||
2418 | </xsl:when> | ||
2419 | </xsl:choose> | ||
2420 | |||
2421 | <xsl:choose> | ||
2422 | <xsl:when test="sect2info/subtitle"> | ||
2423 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/subtitle"/> | ||
2424 | </xsl:when> | ||
2425 | <xsl:when test="info/subtitle"> | ||
2426 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
2427 | </xsl:when> | ||
2428 | <xsl:when test="subtitle"> | ||
2429 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="subtitle"/> | ||
2430 | </xsl:when> | ||
2431 | </xsl:choose> | ||
2432 | |||
2433 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/corpauthor"/> | ||
2434 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
2435 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/authorgroup"/> | ||
2436 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
2437 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/author"/> | ||
2438 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/author"/> | ||
2439 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/othercredit"/> | ||
2440 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
2441 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/releaseinfo"/> | ||
2442 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
2443 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/copyright"/> | ||
2444 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/copyright"/> | ||
2445 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/legalnotice"/> | ||
2446 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
2447 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/pubdate"/> | ||
2448 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
2449 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revision"/> | ||
2450 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/revision"/> | ||
2451 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revhistory"/> | ||
2452 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
2453 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/abstract"/> | ||
2454 | <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/abstract"/> | ||
2455 | </xsl:template> | ||
2456 | |||
2457 | <xsl:template name="sect2.titlepage.verso"> | ||
2458 | </xsl:template> | ||
2459 | |||
2460 | <xsl:template name="sect2.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> | ||
2461 | </xsl:template> | ||
2462 | |||
2463 | <xsl:template name="sect2.titlepage.before.recto"> | ||
2464 | </xsl:template> | ||
2465 | |||
2466 | <xsl:template name="sect2.titlepage.before.verso"> | ||
2467 | </xsl:template> | ||
2468 | |||
2469 | <xsl:template name="sect2.titlepage"> | ||
2470 | <div class="titlepage"> | ||
2471 | <xsl:variable name="recto.content"> | ||
2472 | <xsl:call-template name="sect2.titlepage.before.recto"/> | ||
2473 | <xsl:call-template name="sect2.titlepage.recto"/> | ||
2474 | </xsl:variable> | ||
2475 | <xsl:variable name="recto.elements.count"> | ||
2476 | <xsl:choose> | ||
2477 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
2478 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
2479 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
2480 | <xsl:otherwise>1</xsl:otherwise> | ||
2481 | </xsl:choose> | ||
2482 | </xsl:variable> | ||
2483 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
2484 | <div><xsl:copy-of select="$recto.content"/></div> | ||
2485 | </xsl:if> | ||
2486 | <xsl:variable name="verso.content"> | ||
2487 | <xsl:call-template name="sect2.titlepage.before.verso"/> | ||
2488 | <xsl:call-template name="sect2.titlepage.verso"/> | ||
2489 | </xsl:variable> | ||
2490 | <xsl:variable name="verso.elements.count"> | ||
2491 | <xsl:choose> | ||
2492 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
2493 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
2494 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
2495 | <xsl:otherwise>1</xsl:otherwise> | ||
2496 | </xsl:choose> | ||
2497 | </xsl:variable> | ||
2498 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
2499 | <div><xsl:copy-of select="$verso.content"/></div> | ||
2500 | </xsl:if> | ||
2501 | <xsl:call-template name="sect2.titlepage.separator"/> | ||
2502 | </div> | ||
2503 | </xsl:template> | ||
2504 | |||
2505 | <xsl:template match="*" mode="sect2.titlepage.recto.mode"> | ||
2506 | <!-- if an element isn't found in this mode, --> | ||
2507 | <!-- try the generic titlepage.mode --> | ||
2508 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
2509 | </xsl:template> | ||
2510 | |||
2511 | <xsl:template match="*" mode="sect2.titlepage.verso.mode"> | ||
2512 | <!-- if an element isn't found in this mode, --> | ||
2513 | <!-- try the generic titlepage.mode --> | ||
2514 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
2515 | </xsl:template> | ||
2516 | |||
2517 | <xsl:template match="title" mode="sect2.titlepage.recto.auto.mode"> | ||
2518 | <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> | ||
2519 | <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> | ||
2520 | </div> | ||
2521 | </xsl:template> | ||
2522 | |||
2523 | <xsl:template match="subtitle" mode="sect2.titlepage.recto.auto.mode"> | ||
2524 | <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> | ||
2525 | <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> | ||
2526 | </div> | ||
2527 | </xsl:template> | ||
2528 | |||
2529 | <xsl:template match="corpauthor" mode="sect2.titlepage.recto.auto.mode"> | ||
2530 | <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> | ||
2531 | <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> | ||
2532 | </div> | ||
2533 | </xsl:template> | ||
2534 | |||
2535 | <xsl:template match="authorgroup" mode="sect2.titlepage.recto.auto.mode"> | ||
2536 | <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> | ||
2537 | <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> | ||
2538 | </div> | ||
2539 | </xsl:template> | ||
2540 | |||
2541 | <xsl:template match="author" mode="sect2.titlepage.recto.auto.mode"> | ||
2542 | <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> | ||
2543 | <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> | ||
2544 | </div> | ||
2545 | </xsl:template> | ||
2546 | |||
2547 | <xsl:template match="othercredit" mode="sect2.titlepage.recto.auto.mode"> | ||
2548 | <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> | ||
2549 | <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> | ||
2550 | </div> | ||
2551 | </xsl:template> | ||
2552 | |||
2553 | <xsl:template match="releaseinfo" mode="sect2.titlepage.recto.auto.mode"> | ||
2554 | <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> | ||
2555 | <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> | ||
2556 | </div> | ||
2557 | </xsl:template> | ||
2558 | |||
2559 | <xsl:template match="copyright" mode="sect2.titlepage.recto.auto.mode"> | ||
2560 | <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> | ||
2561 | <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> | ||
2562 | </div> | ||
2563 | </xsl:template> | ||
2564 | |||
2565 | <xsl:template match="legalnotice" mode="sect2.titlepage.recto.auto.mode"> | ||
2566 | <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> | ||
2567 | <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> | ||
2568 | </div> | ||
2569 | </xsl:template> | ||
2570 | |||
2571 | <xsl:template match="pubdate" mode="sect2.titlepage.recto.auto.mode"> | ||
2572 | <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> | ||
2573 | <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> | ||
2574 | </div> | ||
2575 | </xsl:template> | ||
2576 | |||
2577 | <xsl:template match="revision" mode="sect2.titlepage.recto.auto.mode"> | ||
2578 | <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> | ||
2579 | <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> | ||
2580 | </div> | ||
2581 | </xsl:template> | ||
2582 | |||
2583 | <xsl:template match="revhistory" mode="sect2.titlepage.recto.auto.mode"> | ||
2584 | <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> | ||
2585 | <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> | ||
2586 | </div> | ||
2587 | </xsl:template> | ||
2588 | |||
2589 | <xsl:template match="abstract" mode="sect2.titlepage.recto.auto.mode"> | ||
2590 | <div xsl:use-attribute-sets="sect2.titlepage.recto.style"> | ||
2591 | <xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> | ||
2592 | </div> | ||
2593 | </xsl:template> | ||
2594 | |||
2595 | <xsl:template name="sect3.titlepage.recto"> | ||
2596 | <xsl:choose> | ||
2597 | <xsl:when test="sect3info/title"> | ||
2598 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/title"/> | ||
2599 | </xsl:when> | ||
2600 | <xsl:when test="info/title"> | ||
2601 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/title"/> | ||
2602 | </xsl:when> | ||
2603 | <xsl:when test="title"> | ||
2604 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="title"/> | ||
2605 | </xsl:when> | ||
2606 | </xsl:choose> | ||
2607 | |||
2608 | <xsl:choose> | ||
2609 | <xsl:when test="sect3info/subtitle"> | ||
2610 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/subtitle"/> | ||
2611 | </xsl:when> | ||
2612 | <xsl:when test="info/subtitle"> | ||
2613 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
2614 | </xsl:when> | ||
2615 | <xsl:when test="subtitle"> | ||
2616 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="subtitle"/> | ||
2617 | </xsl:when> | ||
2618 | </xsl:choose> | ||
2619 | |||
2620 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/corpauthor"/> | ||
2621 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
2622 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/authorgroup"/> | ||
2623 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
2624 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/author"/> | ||
2625 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/author"/> | ||
2626 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/othercredit"/> | ||
2627 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
2628 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/releaseinfo"/> | ||
2629 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
2630 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/copyright"/> | ||
2631 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/copyright"/> | ||
2632 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/legalnotice"/> | ||
2633 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
2634 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/pubdate"/> | ||
2635 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
2636 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revision"/> | ||
2637 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/revision"/> | ||
2638 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revhistory"/> | ||
2639 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
2640 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/abstract"/> | ||
2641 | <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/abstract"/> | ||
2642 | </xsl:template> | ||
2643 | |||
2644 | <xsl:template name="sect3.titlepage.verso"> | ||
2645 | </xsl:template> | ||
2646 | |||
2647 | <xsl:template name="sect3.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> | ||
2648 | </xsl:template> | ||
2649 | |||
2650 | <xsl:template name="sect3.titlepage.before.recto"> | ||
2651 | </xsl:template> | ||
2652 | |||
2653 | <xsl:template name="sect3.titlepage.before.verso"> | ||
2654 | </xsl:template> | ||
2655 | |||
2656 | <xsl:template name="sect3.titlepage"> | ||
2657 | <div class="titlepage"> | ||
2658 | <xsl:variable name="recto.content"> | ||
2659 | <xsl:call-template name="sect3.titlepage.before.recto"/> | ||
2660 | <xsl:call-template name="sect3.titlepage.recto"/> | ||
2661 | </xsl:variable> | ||
2662 | <xsl:variable name="recto.elements.count"> | ||
2663 | <xsl:choose> | ||
2664 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
2665 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
2666 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
2667 | <xsl:otherwise>1</xsl:otherwise> | ||
2668 | </xsl:choose> | ||
2669 | </xsl:variable> | ||
2670 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
2671 | <div><xsl:copy-of select="$recto.content"/></div> | ||
2672 | </xsl:if> | ||
2673 | <xsl:variable name="verso.content"> | ||
2674 | <xsl:call-template name="sect3.titlepage.before.verso"/> | ||
2675 | <xsl:call-template name="sect3.titlepage.verso"/> | ||
2676 | </xsl:variable> | ||
2677 | <xsl:variable name="verso.elements.count"> | ||
2678 | <xsl:choose> | ||
2679 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
2680 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
2681 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
2682 | <xsl:otherwise>1</xsl:otherwise> | ||
2683 | </xsl:choose> | ||
2684 | </xsl:variable> | ||
2685 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
2686 | <div><xsl:copy-of select="$verso.content"/></div> | ||
2687 | </xsl:if> | ||
2688 | <xsl:call-template name="sect3.titlepage.separator"/> | ||
2689 | </div> | ||
2690 | </xsl:template> | ||
2691 | |||
2692 | <xsl:template match="*" mode="sect3.titlepage.recto.mode"> | ||
2693 | <!-- if an element isn't found in this mode, --> | ||
2694 | <!-- try the generic titlepage.mode --> | ||
2695 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
2696 | </xsl:template> | ||
2697 | |||
2698 | <xsl:template match="*" mode="sect3.titlepage.verso.mode"> | ||
2699 | <!-- if an element isn't found in this mode, --> | ||
2700 | <!-- try the generic titlepage.mode --> | ||
2701 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
2702 | </xsl:template> | ||
2703 | |||
2704 | <xsl:template match="title" mode="sect3.titlepage.recto.auto.mode"> | ||
2705 | <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> | ||
2706 | <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> | ||
2707 | </div> | ||
2708 | </xsl:template> | ||
2709 | |||
2710 | <xsl:template match="subtitle" mode="sect3.titlepage.recto.auto.mode"> | ||
2711 | <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> | ||
2712 | <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> | ||
2713 | </div> | ||
2714 | </xsl:template> | ||
2715 | |||
2716 | <xsl:template match="corpauthor" mode="sect3.titlepage.recto.auto.mode"> | ||
2717 | <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> | ||
2718 | <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> | ||
2719 | </div> | ||
2720 | </xsl:template> | ||
2721 | |||
2722 | <xsl:template match="authorgroup" mode="sect3.titlepage.recto.auto.mode"> | ||
2723 | <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> | ||
2724 | <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> | ||
2725 | </div> | ||
2726 | </xsl:template> | ||
2727 | |||
2728 | <xsl:template match="author" mode="sect3.titlepage.recto.auto.mode"> | ||
2729 | <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> | ||
2730 | <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> | ||
2731 | </div> | ||
2732 | </xsl:template> | ||
2733 | |||
2734 | <xsl:template match="othercredit" mode="sect3.titlepage.recto.auto.mode"> | ||
2735 | <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> | ||
2736 | <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> | ||
2737 | </div> | ||
2738 | </xsl:template> | ||
2739 | |||
2740 | <xsl:template match="releaseinfo" mode="sect3.titlepage.recto.auto.mode"> | ||
2741 | <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> | ||
2742 | <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> | ||
2743 | </div> | ||
2744 | </xsl:template> | ||
2745 | |||
2746 | <xsl:template match="copyright" mode="sect3.titlepage.recto.auto.mode"> | ||
2747 | <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> | ||
2748 | <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> | ||
2749 | </div> | ||
2750 | </xsl:template> | ||
2751 | |||
2752 | <xsl:template match="legalnotice" mode="sect3.titlepage.recto.auto.mode"> | ||
2753 | <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> | ||
2754 | <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> | ||
2755 | </div> | ||
2756 | </xsl:template> | ||
2757 | |||
2758 | <xsl:template match="pubdate" mode="sect3.titlepage.recto.auto.mode"> | ||
2759 | <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> | ||
2760 | <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> | ||
2761 | </div> | ||
2762 | </xsl:template> | ||
2763 | |||
2764 | <xsl:template match="revision" mode="sect3.titlepage.recto.auto.mode"> | ||
2765 | <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> | ||
2766 | <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> | ||
2767 | </div> | ||
2768 | </xsl:template> | ||
2769 | |||
2770 | <xsl:template match="revhistory" mode="sect3.titlepage.recto.auto.mode"> | ||
2771 | <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> | ||
2772 | <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> | ||
2773 | </div> | ||
2774 | </xsl:template> | ||
2775 | |||
2776 | <xsl:template match="abstract" mode="sect3.titlepage.recto.auto.mode"> | ||
2777 | <div xsl:use-attribute-sets="sect3.titlepage.recto.style"> | ||
2778 | <xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> | ||
2779 | </div> | ||
2780 | </xsl:template> | ||
2781 | |||
2782 | <xsl:template name="sect4.titlepage.recto"> | ||
2783 | <xsl:choose> | ||
2784 | <xsl:when test="sect4info/title"> | ||
2785 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/title"/> | ||
2786 | </xsl:when> | ||
2787 | <xsl:when test="info/title"> | ||
2788 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/title"/> | ||
2789 | </xsl:when> | ||
2790 | <xsl:when test="title"> | ||
2791 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="title"/> | ||
2792 | </xsl:when> | ||
2793 | </xsl:choose> | ||
2794 | |||
2795 | <xsl:choose> | ||
2796 | <xsl:when test="sect4info/subtitle"> | ||
2797 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/subtitle"/> | ||
2798 | </xsl:when> | ||
2799 | <xsl:when test="info/subtitle"> | ||
2800 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
2801 | </xsl:when> | ||
2802 | <xsl:when test="subtitle"> | ||
2803 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="subtitle"/> | ||
2804 | </xsl:when> | ||
2805 | </xsl:choose> | ||
2806 | |||
2807 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/corpauthor"/> | ||
2808 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
2809 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/authorgroup"/> | ||
2810 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
2811 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/author"/> | ||
2812 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/author"/> | ||
2813 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/othercredit"/> | ||
2814 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
2815 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/releaseinfo"/> | ||
2816 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
2817 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/copyright"/> | ||
2818 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/copyright"/> | ||
2819 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/legalnotice"/> | ||
2820 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
2821 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/pubdate"/> | ||
2822 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
2823 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revision"/> | ||
2824 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/revision"/> | ||
2825 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revhistory"/> | ||
2826 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
2827 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/abstract"/> | ||
2828 | <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/abstract"/> | ||
2829 | </xsl:template> | ||
2830 | |||
2831 | <xsl:template name="sect4.titlepage.verso"> | ||
2832 | </xsl:template> | ||
2833 | |||
2834 | <xsl:template name="sect4.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> | ||
2835 | </xsl:template> | ||
2836 | |||
2837 | <xsl:template name="sect4.titlepage.before.recto"> | ||
2838 | </xsl:template> | ||
2839 | |||
2840 | <xsl:template name="sect4.titlepage.before.verso"> | ||
2841 | </xsl:template> | ||
2842 | |||
2843 | <xsl:template name="sect4.titlepage"> | ||
2844 | <div class="titlepage"> | ||
2845 | <xsl:variable name="recto.content"> | ||
2846 | <xsl:call-template name="sect4.titlepage.before.recto"/> | ||
2847 | <xsl:call-template name="sect4.titlepage.recto"/> | ||
2848 | </xsl:variable> | ||
2849 | <xsl:variable name="recto.elements.count"> | ||
2850 | <xsl:choose> | ||
2851 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
2852 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
2853 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
2854 | <xsl:otherwise>1</xsl:otherwise> | ||
2855 | </xsl:choose> | ||
2856 | </xsl:variable> | ||
2857 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
2858 | <div><xsl:copy-of select="$recto.content"/></div> | ||
2859 | </xsl:if> | ||
2860 | <xsl:variable name="verso.content"> | ||
2861 | <xsl:call-template name="sect4.titlepage.before.verso"/> | ||
2862 | <xsl:call-template name="sect4.titlepage.verso"/> | ||
2863 | </xsl:variable> | ||
2864 | <xsl:variable name="verso.elements.count"> | ||
2865 | <xsl:choose> | ||
2866 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
2867 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
2868 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
2869 | <xsl:otherwise>1</xsl:otherwise> | ||
2870 | </xsl:choose> | ||
2871 | </xsl:variable> | ||
2872 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
2873 | <div><xsl:copy-of select="$verso.content"/></div> | ||
2874 | </xsl:if> | ||
2875 | <xsl:call-template name="sect4.titlepage.separator"/> | ||
2876 | </div> | ||
2877 | </xsl:template> | ||
2878 | |||
2879 | <xsl:template match="*" mode="sect4.titlepage.recto.mode"> | ||
2880 | <!-- if an element isn't found in this mode, --> | ||
2881 | <!-- try the generic titlepage.mode --> | ||
2882 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
2883 | </xsl:template> | ||
2884 | |||
2885 | <xsl:template match="*" mode="sect4.titlepage.verso.mode"> | ||
2886 | <!-- if an element isn't found in this mode, --> | ||
2887 | <!-- try the generic titlepage.mode --> | ||
2888 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
2889 | </xsl:template> | ||
2890 | |||
2891 | <xsl:template match="title" mode="sect4.titlepage.recto.auto.mode"> | ||
2892 | <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> | ||
2893 | <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> | ||
2894 | </div> | ||
2895 | </xsl:template> | ||
2896 | |||
2897 | <xsl:template match="subtitle" mode="sect4.titlepage.recto.auto.mode"> | ||
2898 | <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> | ||
2899 | <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> | ||
2900 | </div> | ||
2901 | </xsl:template> | ||
2902 | |||
2903 | <xsl:template match="corpauthor" mode="sect4.titlepage.recto.auto.mode"> | ||
2904 | <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> | ||
2905 | <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> | ||
2906 | </div> | ||
2907 | </xsl:template> | ||
2908 | |||
2909 | <xsl:template match="authorgroup" mode="sect4.titlepage.recto.auto.mode"> | ||
2910 | <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> | ||
2911 | <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> | ||
2912 | </div> | ||
2913 | </xsl:template> | ||
2914 | |||
2915 | <xsl:template match="author" mode="sect4.titlepage.recto.auto.mode"> | ||
2916 | <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> | ||
2917 | <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> | ||
2918 | </div> | ||
2919 | </xsl:template> | ||
2920 | |||
2921 | <xsl:template match="othercredit" mode="sect4.titlepage.recto.auto.mode"> | ||
2922 | <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> | ||
2923 | <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> | ||
2924 | </div> | ||
2925 | </xsl:template> | ||
2926 | |||
2927 | <xsl:template match="releaseinfo" mode="sect4.titlepage.recto.auto.mode"> | ||
2928 | <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> | ||
2929 | <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> | ||
2930 | </div> | ||
2931 | </xsl:template> | ||
2932 | |||
2933 | <xsl:template match="copyright" mode="sect4.titlepage.recto.auto.mode"> | ||
2934 | <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> | ||
2935 | <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> | ||
2936 | </div> | ||
2937 | </xsl:template> | ||
2938 | |||
2939 | <xsl:template match="legalnotice" mode="sect4.titlepage.recto.auto.mode"> | ||
2940 | <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> | ||
2941 | <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> | ||
2942 | </div> | ||
2943 | </xsl:template> | ||
2944 | |||
2945 | <xsl:template match="pubdate" mode="sect4.titlepage.recto.auto.mode"> | ||
2946 | <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> | ||
2947 | <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> | ||
2948 | </div> | ||
2949 | </xsl:template> | ||
2950 | |||
2951 | <xsl:template match="revision" mode="sect4.titlepage.recto.auto.mode"> | ||
2952 | <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> | ||
2953 | <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> | ||
2954 | </div> | ||
2955 | </xsl:template> | ||
2956 | |||
2957 | <xsl:template match="revhistory" mode="sect4.titlepage.recto.auto.mode"> | ||
2958 | <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> | ||
2959 | <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> | ||
2960 | </div> | ||
2961 | </xsl:template> | ||
2962 | |||
2963 | <xsl:template match="abstract" mode="sect4.titlepage.recto.auto.mode"> | ||
2964 | <div xsl:use-attribute-sets="sect4.titlepage.recto.style"> | ||
2965 | <xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> | ||
2966 | </div> | ||
2967 | </xsl:template> | ||
2968 | |||
2969 | <xsl:template name="sect5.titlepage.recto"> | ||
2970 | <xsl:choose> | ||
2971 | <xsl:when test="sect5info/title"> | ||
2972 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/title"/> | ||
2973 | </xsl:when> | ||
2974 | <xsl:when test="info/title"> | ||
2975 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/title"/> | ||
2976 | </xsl:when> | ||
2977 | <xsl:when test="title"> | ||
2978 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="title"/> | ||
2979 | </xsl:when> | ||
2980 | </xsl:choose> | ||
2981 | |||
2982 | <xsl:choose> | ||
2983 | <xsl:when test="sect5info/subtitle"> | ||
2984 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/subtitle"/> | ||
2985 | </xsl:when> | ||
2986 | <xsl:when test="info/subtitle"> | ||
2987 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
2988 | </xsl:when> | ||
2989 | <xsl:when test="subtitle"> | ||
2990 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="subtitle"/> | ||
2991 | </xsl:when> | ||
2992 | </xsl:choose> | ||
2993 | |||
2994 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/corpauthor"/> | ||
2995 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
2996 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/authorgroup"/> | ||
2997 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
2998 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/author"/> | ||
2999 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/author"/> | ||
3000 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/othercredit"/> | ||
3001 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
3002 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/releaseinfo"/> | ||
3003 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
3004 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/copyright"/> | ||
3005 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/copyright"/> | ||
3006 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/legalnotice"/> | ||
3007 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
3008 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/pubdate"/> | ||
3009 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
3010 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revision"/> | ||
3011 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/revision"/> | ||
3012 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revhistory"/> | ||
3013 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
3014 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/abstract"/> | ||
3015 | <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/abstract"/> | ||
3016 | </xsl:template> | ||
3017 | |||
3018 | <xsl:template name="sect5.titlepage.verso"> | ||
3019 | </xsl:template> | ||
3020 | |||
3021 | <xsl:template name="sect5.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> | ||
3022 | </xsl:template> | ||
3023 | |||
3024 | <xsl:template name="sect5.titlepage.before.recto"> | ||
3025 | </xsl:template> | ||
3026 | |||
3027 | <xsl:template name="sect5.titlepage.before.verso"> | ||
3028 | </xsl:template> | ||
3029 | |||
3030 | <xsl:template name="sect5.titlepage"> | ||
3031 | <div class="titlepage"> | ||
3032 | <xsl:variable name="recto.content"> | ||
3033 | <xsl:call-template name="sect5.titlepage.before.recto"/> | ||
3034 | <xsl:call-template name="sect5.titlepage.recto"/> | ||
3035 | </xsl:variable> | ||
3036 | <xsl:variable name="recto.elements.count"> | ||
3037 | <xsl:choose> | ||
3038 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3039 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3040 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3041 | <xsl:otherwise>1</xsl:otherwise> | ||
3042 | </xsl:choose> | ||
3043 | </xsl:variable> | ||
3044 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
3045 | <div><xsl:copy-of select="$recto.content"/></div> | ||
3046 | </xsl:if> | ||
3047 | <xsl:variable name="verso.content"> | ||
3048 | <xsl:call-template name="sect5.titlepage.before.verso"/> | ||
3049 | <xsl:call-template name="sect5.titlepage.verso"/> | ||
3050 | </xsl:variable> | ||
3051 | <xsl:variable name="verso.elements.count"> | ||
3052 | <xsl:choose> | ||
3053 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3054 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3055 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3056 | <xsl:otherwise>1</xsl:otherwise> | ||
3057 | </xsl:choose> | ||
3058 | </xsl:variable> | ||
3059 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
3060 | <div><xsl:copy-of select="$verso.content"/></div> | ||
3061 | </xsl:if> | ||
3062 | <xsl:call-template name="sect5.titlepage.separator"/> | ||
3063 | </div> | ||
3064 | </xsl:template> | ||
3065 | |||
3066 | <xsl:template match="*" mode="sect5.titlepage.recto.mode"> | ||
3067 | <!-- if an element isn't found in this mode, --> | ||
3068 | <!-- try the generic titlepage.mode --> | ||
3069 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3070 | </xsl:template> | ||
3071 | |||
3072 | <xsl:template match="*" mode="sect5.titlepage.verso.mode"> | ||
3073 | <!-- if an element isn't found in this mode, --> | ||
3074 | <!-- try the generic titlepage.mode --> | ||
3075 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3076 | </xsl:template> | ||
3077 | |||
3078 | <xsl:template match="title" mode="sect5.titlepage.recto.auto.mode"> | ||
3079 | <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> | ||
3080 | <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> | ||
3081 | </div> | ||
3082 | </xsl:template> | ||
3083 | |||
3084 | <xsl:template match="subtitle" mode="sect5.titlepage.recto.auto.mode"> | ||
3085 | <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> | ||
3086 | <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> | ||
3087 | </div> | ||
3088 | </xsl:template> | ||
3089 | |||
3090 | <xsl:template match="corpauthor" mode="sect5.titlepage.recto.auto.mode"> | ||
3091 | <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> | ||
3092 | <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> | ||
3093 | </div> | ||
3094 | </xsl:template> | ||
3095 | |||
3096 | <xsl:template match="authorgroup" mode="sect5.titlepage.recto.auto.mode"> | ||
3097 | <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> | ||
3098 | <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> | ||
3099 | </div> | ||
3100 | </xsl:template> | ||
3101 | |||
3102 | <xsl:template match="author" mode="sect5.titlepage.recto.auto.mode"> | ||
3103 | <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> | ||
3104 | <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> | ||
3105 | </div> | ||
3106 | </xsl:template> | ||
3107 | |||
3108 | <xsl:template match="othercredit" mode="sect5.titlepage.recto.auto.mode"> | ||
3109 | <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> | ||
3110 | <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> | ||
3111 | </div> | ||
3112 | </xsl:template> | ||
3113 | |||
3114 | <xsl:template match="releaseinfo" mode="sect5.titlepage.recto.auto.mode"> | ||
3115 | <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> | ||
3116 | <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> | ||
3117 | </div> | ||
3118 | </xsl:template> | ||
3119 | |||
3120 | <xsl:template match="copyright" mode="sect5.titlepage.recto.auto.mode"> | ||
3121 | <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> | ||
3122 | <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> | ||
3123 | </div> | ||
3124 | </xsl:template> | ||
3125 | |||
3126 | <xsl:template match="legalnotice" mode="sect5.titlepage.recto.auto.mode"> | ||
3127 | <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> | ||
3128 | <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> | ||
3129 | </div> | ||
3130 | </xsl:template> | ||
3131 | |||
3132 | <xsl:template match="pubdate" mode="sect5.titlepage.recto.auto.mode"> | ||
3133 | <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> | ||
3134 | <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> | ||
3135 | </div> | ||
3136 | </xsl:template> | ||
3137 | |||
3138 | <xsl:template match="revision" mode="sect5.titlepage.recto.auto.mode"> | ||
3139 | <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> | ||
3140 | <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> | ||
3141 | </div> | ||
3142 | </xsl:template> | ||
3143 | |||
3144 | <xsl:template match="revhistory" mode="sect5.titlepage.recto.auto.mode"> | ||
3145 | <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> | ||
3146 | <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> | ||
3147 | </div> | ||
3148 | </xsl:template> | ||
3149 | |||
3150 | <xsl:template match="abstract" mode="sect5.titlepage.recto.auto.mode"> | ||
3151 | <div xsl:use-attribute-sets="sect5.titlepage.recto.style"> | ||
3152 | <xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> | ||
3153 | </div> | ||
3154 | </xsl:template> | ||
3155 | |||
3156 | <xsl:template name="simplesect.titlepage.recto"> | ||
3157 | <xsl:choose> | ||
3158 | <xsl:when test="simplesectinfo/title"> | ||
3159 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/title"/> | ||
3160 | </xsl:when> | ||
3161 | <xsl:when test="docinfo/title"> | ||
3162 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/title"/> | ||
3163 | </xsl:when> | ||
3164 | <xsl:when test="info/title"> | ||
3165 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/title"/> | ||
3166 | </xsl:when> | ||
3167 | <xsl:when test="title"> | ||
3168 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="title"/> | ||
3169 | </xsl:when> | ||
3170 | </xsl:choose> | ||
3171 | |||
3172 | <xsl:choose> | ||
3173 | <xsl:when test="simplesectinfo/subtitle"> | ||
3174 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/subtitle"/> | ||
3175 | </xsl:when> | ||
3176 | <xsl:when test="docinfo/subtitle"> | ||
3177 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
3178 | </xsl:when> | ||
3179 | <xsl:when test="info/subtitle"> | ||
3180 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
3181 | </xsl:when> | ||
3182 | <xsl:when test="subtitle"> | ||
3183 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="subtitle"/> | ||
3184 | </xsl:when> | ||
3185 | </xsl:choose> | ||
3186 | |||
3187 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/corpauthor"/> | ||
3188 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/corpauthor"/> | ||
3189 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/corpauthor"/> | ||
3190 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/authorgroup"/> | ||
3191 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/authorgroup"/> | ||
3192 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/authorgroup"/> | ||
3193 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/author"/> | ||
3194 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/author"/> | ||
3195 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/author"/> | ||
3196 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/othercredit"/> | ||
3197 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/othercredit"/> | ||
3198 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/othercredit"/> | ||
3199 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/releaseinfo"/> | ||
3200 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/> | ||
3201 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/releaseinfo"/> | ||
3202 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/copyright"/> | ||
3203 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/copyright"/> | ||
3204 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/copyright"/> | ||
3205 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/legalnotice"/> | ||
3206 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/legalnotice"/> | ||
3207 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/legalnotice"/> | ||
3208 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/pubdate"/> | ||
3209 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/pubdate"/> | ||
3210 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/pubdate"/> | ||
3211 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revision"/> | ||
3212 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/revision"/> | ||
3213 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/revision"/> | ||
3214 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revhistory"/> | ||
3215 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/revhistory"/> | ||
3216 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/revhistory"/> | ||
3217 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/abstract"/> | ||
3218 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/abstract"/> | ||
3219 | <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/abstract"/> | ||
3220 | </xsl:template> | ||
3221 | |||
3222 | <xsl:template name="simplesect.titlepage.verso"> | ||
3223 | </xsl:template> | ||
3224 | |||
3225 | <xsl:template name="simplesect.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> | ||
3226 | </xsl:template> | ||
3227 | |||
3228 | <xsl:template name="simplesect.titlepage.before.recto"> | ||
3229 | </xsl:template> | ||
3230 | |||
3231 | <xsl:template name="simplesect.titlepage.before.verso"> | ||
3232 | </xsl:template> | ||
3233 | |||
3234 | <xsl:template name="simplesect.titlepage"> | ||
3235 | <div class="titlepage"> | ||
3236 | <xsl:variable name="recto.content"> | ||
3237 | <xsl:call-template name="simplesect.titlepage.before.recto"/> | ||
3238 | <xsl:call-template name="simplesect.titlepage.recto"/> | ||
3239 | </xsl:variable> | ||
3240 | <xsl:variable name="recto.elements.count"> | ||
3241 | <xsl:choose> | ||
3242 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3243 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3244 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3245 | <xsl:otherwise>1</xsl:otherwise> | ||
3246 | </xsl:choose> | ||
3247 | </xsl:variable> | ||
3248 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
3249 | <div><xsl:copy-of select="$recto.content"/></div> | ||
3250 | </xsl:if> | ||
3251 | <xsl:variable name="verso.content"> | ||
3252 | <xsl:call-template name="simplesect.titlepage.before.verso"/> | ||
3253 | <xsl:call-template name="simplesect.titlepage.verso"/> | ||
3254 | </xsl:variable> | ||
3255 | <xsl:variable name="verso.elements.count"> | ||
3256 | <xsl:choose> | ||
3257 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3258 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3259 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3260 | <xsl:otherwise>1</xsl:otherwise> | ||
3261 | </xsl:choose> | ||
3262 | </xsl:variable> | ||
3263 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
3264 | <div><xsl:copy-of select="$verso.content"/></div> | ||
3265 | </xsl:if> | ||
3266 | <xsl:call-template name="simplesect.titlepage.separator"/> | ||
3267 | </div> | ||
3268 | </xsl:template> | ||
3269 | |||
3270 | <xsl:template match="*" mode="simplesect.titlepage.recto.mode"> | ||
3271 | <!-- if an element isn't found in this mode, --> | ||
3272 | <!-- try the generic titlepage.mode --> | ||
3273 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3274 | </xsl:template> | ||
3275 | |||
3276 | <xsl:template match="*" mode="simplesect.titlepage.verso.mode"> | ||
3277 | <!-- if an element isn't found in this mode, --> | ||
3278 | <!-- try the generic titlepage.mode --> | ||
3279 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3280 | </xsl:template> | ||
3281 | |||
3282 | <xsl:template match="title" mode="simplesect.titlepage.recto.auto.mode"> | ||
3283 | <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> | ||
3284 | <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> | ||
3285 | </div> | ||
3286 | </xsl:template> | ||
3287 | |||
3288 | <xsl:template match="subtitle" mode="simplesect.titlepage.recto.auto.mode"> | ||
3289 | <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> | ||
3290 | <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> | ||
3291 | </div> | ||
3292 | </xsl:template> | ||
3293 | |||
3294 | <xsl:template match="corpauthor" mode="simplesect.titlepage.recto.auto.mode"> | ||
3295 | <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> | ||
3296 | <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> | ||
3297 | </div> | ||
3298 | </xsl:template> | ||
3299 | |||
3300 | <xsl:template match="authorgroup" mode="simplesect.titlepage.recto.auto.mode"> | ||
3301 | <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> | ||
3302 | <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> | ||
3303 | </div> | ||
3304 | </xsl:template> | ||
3305 | |||
3306 | <xsl:template match="author" mode="simplesect.titlepage.recto.auto.mode"> | ||
3307 | <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> | ||
3308 | <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> | ||
3309 | </div> | ||
3310 | </xsl:template> | ||
3311 | |||
3312 | <xsl:template match="othercredit" mode="simplesect.titlepage.recto.auto.mode"> | ||
3313 | <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> | ||
3314 | <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> | ||
3315 | </div> | ||
3316 | </xsl:template> | ||
3317 | |||
3318 | <xsl:template match="releaseinfo" mode="simplesect.titlepage.recto.auto.mode"> | ||
3319 | <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> | ||
3320 | <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> | ||
3321 | </div> | ||
3322 | </xsl:template> | ||
3323 | |||
3324 | <xsl:template match="copyright" mode="simplesect.titlepage.recto.auto.mode"> | ||
3325 | <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> | ||
3326 | <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> | ||
3327 | </div> | ||
3328 | </xsl:template> | ||
3329 | |||
3330 | <xsl:template match="legalnotice" mode="simplesect.titlepage.recto.auto.mode"> | ||
3331 | <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> | ||
3332 | <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> | ||
3333 | </div> | ||
3334 | </xsl:template> | ||
3335 | |||
3336 | <xsl:template match="pubdate" mode="simplesect.titlepage.recto.auto.mode"> | ||
3337 | <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> | ||
3338 | <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> | ||
3339 | </div> | ||
3340 | </xsl:template> | ||
3341 | |||
3342 | <xsl:template match="revision" mode="simplesect.titlepage.recto.auto.mode"> | ||
3343 | <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> | ||
3344 | <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> | ||
3345 | </div> | ||
3346 | </xsl:template> | ||
3347 | |||
3348 | <xsl:template match="revhistory" mode="simplesect.titlepage.recto.auto.mode"> | ||
3349 | <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> | ||
3350 | <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> | ||
3351 | </div> | ||
3352 | </xsl:template> | ||
3353 | |||
3354 | <xsl:template match="abstract" mode="simplesect.titlepage.recto.auto.mode"> | ||
3355 | <div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> | ||
3356 | <xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> | ||
3357 | </div> | ||
3358 | </xsl:template> | ||
3359 | |||
3360 | <xsl:template name="bibliography.titlepage.recto"> | ||
3361 | <div xsl:use-attribute-sets="bibliography.titlepage.recto.style"> | ||
3362 | <xsl:call-template name="component.title"> | ||
3363 | <xsl:with-param name="node" select="ancestor-or-self::bibliography[1]"/> | ||
3364 | </xsl:call-template></div> | ||
3365 | <xsl:choose> | ||
3366 | <xsl:when test="bibliographyinfo/subtitle"> | ||
3367 | <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="bibliographyinfo/subtitle"/> | ||
3368 | </xsl:when> | ||
3369 | <xsl:when test="docinfo/subtitle"> | ||
3370 | <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
3371 | </xsl:when> | ||
3372 | <xsl:when test="info/subtitle"> | ||
3373 | <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
3374 | </xsl:when> | ||
3375 | <xsl:when test="subtitle"> | ||
3376 | <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="subtitle"/> | ||
3377 | </xsl:when> | ||
3378 | </xsl:choose> | ||
3379 | |||
3380 | </xsl:template> | ||
3381 | |||
3382 | <xsl:template name="bibliography.titlepage.verso"> | ||
3383 | </xsl:template> | ||
3384 | |||
3385 | <xsl:template name="bibliography.titlepage.separator"> | ||
3386 | </xsl:template> | ||
3387 | |||
3388 | <xsl:template name="bibliography.titlepage.before.recto"> | ||
3389 | </xsl:template> | ||
3390 | |||
3391 | <xsl:template name="bibliography.titlepage.before.verso"> | ||
3392 | </xsl:template> | ||
3393 | |||
3394 | <xsl:template name="bibliography.titlepage"> | ||
3395 | <div class="titlepage"> | ||
3396 | <xsl:variable name="recto.content"> | ||
3397 | <xsl:call-template name="bibliography.titlepage.before.recto"/> | ||
3398 | <xsl:call-template name="bibliography.titlepage.recto"/> | ||
3399 | </xsl:variable> | ||
3400 | <xsl:variable name="recto.elements.count"> | ||
3401 | <xsl:choose> | ||
3402 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3403 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3404 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3405 | <xsl:otherwise>1</xsl:otherwise> | ||
3406 | </xsl:choose> | ||
3407 | </xsl:variable> | ||
3408 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
3409 | <div><xsl:copy-of select="$recto.content"/></div> | ||
3410 | </xsl:if> | ||
3411 | <xsl:variable name="verso.content"> | ||
3412 | <xsl:call-template name="bibliography.titlepage.before.verso"/> | ||
3413 | <xsl:call-template name="bibliography.titlepage.verso"/> | ||
3414 | </xsl:variable> | ||
3415 | <xsl:variable name="verso.elements.count"> | ||
3416 | <xsl:choose> | ||
3417 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3418 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3419 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3420 | <xsl:otherwise>1</xsl:otherwise> | ||
3421 | </xsl:choose> | ||
3422 | </xsl:variable> | ||
3423 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
3424 | <div><xsl:copy-of select="$verso.content"/></div> | ||
3425 | </xsl:if> | ||
3426 | <xsl:call-template name="bibliography.titlepage.separator"/> | ||
3427 | </div> | ||
3428 | </xsl:template> | ||
3429 | |||
3430 | <xsl:template match="*" mode="bibliography.titlepage.recto.mode"> | ||
3431 | <!-- if an element isn't found in this mode, --> | ||
3432 | <!-- try the generic titlepage.mode --> | ||
3433 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3434 | </xsl:template> | ||
3435 | |||
3436 | <xsl:template match="*" mode="bibliography.titlepage.verso.mode"> | ||
3437 | <!-- if an element isn't found in this mode, --> | ||
3438 | <!-- try the generic titlepage.mode --> | ||
3439 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3440 | </xsl:template> | ||
3441 | |||
3442 | <xsl:template match="subtitle" mode="bibliography.titlepage.recto.auto.mode"> | ||
3443 | <div xsl:use-attribute-sets="bibliography.titlepage.recto.style"> | ||
3444 | <xsl:apply-templates select="." mode="bibliography.titlepage.recto.mode"/> | ||
3445 | </div> | ||
3446 | </xsl:template> | ||
3447 | |||
3448 | <xsl:template name="glossary.titlepage.recto"> | ||
3449 | <div xsl:use-attribute-sets="glossary.titlepage.recto.style"> | ||
3450 | <xsl:call-template name="component.title"> | ||
3451 | <xsl:with-param name="node" select="ancestor-or-self::glossary[1]"/> | ||
3452 | </xsl:call-template></div> | ||
3453 | <xsl:choose> | ||
3454 | <xsl:when test="glossaryinfo/subtitle"> | ||
3455 | <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="glossaryinfo/subtitle"/> | ||
3456 | </xsl:when> | ||
3457 | <xsl:when test="docinfo/subtitle"> | ||
3458 | <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
3459 | </xsl:when> | ||
3460 | <xsl:when test="info/subtitle"> | ||
3461 | <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
3462 | </xsl:when> | ||
3463 | <xsl:when test="subtitle"> | ||
3464 | <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="subtitle"/> | ||
3465 | </xsl:when> | ||
3466 | </xsl:choose> | ||
3467 | |||
3468 | </xsl:template> | ||
3469 | |||
3470 | <xsl:template name="glossary.titlepage.verso"> | ||
3471 | </xsl:template> | ||
3472 | |||
3473 | <xsl:template name="glossary.titlepage.separator"> | ||
3474 | </xsl:template> | ||
3475 | |||
3476 | <xsl:template name="glossary.titlepage.before.recto"> | ||
3477 | </xsl:template> | ||
3478 | |||
3479 | <xsl:template name="glossary.titlepage.before.verso"> | ||
3480 | </xsl:template> | ||
3481 | |||
3482 | <xsl:template name="glossary.titlepage"> | ||
3483 | <div class="titlepage"> | ||
3484 | <xsl:variable name="recto.content"> | ||
3485 | <xsl:call-template name="glossary.titlepage.before.recto"/> | ||
3486 | <xsl:call-template name="glossary.titlepage.recto"/> | ||
3487 | </xsl:variable> | ||
3488 | <xsl:variable name="recto.elements.count"> | ||
3489 | <xsl:choose> | ||
3490 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3491 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3492 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3493 | <xsl:otherwise>1</xsl:otherwise> | ||
3494 | </xsl:choose> | ||
3495 | </xsl:variable> | ||
3496 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
3497 | <div><xsl:copy-of select="$recto.content"/></div> | ||
3498 | </xsl:if> | ||
3499 | <xsl:variable name="verso.content"> | ||
3500 | <xsl:call-template name="glossary.titlepage.before.verso"/> | ||
3501 | <xsl:call-template name="glossary.titlepage.verso"/> | ||
3502 | </xsl:variable> | ||
3503 | <xsl:variable name="verso.elements.count"> | ||
3504 | <xsl:choose> | ||
3505 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3506 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3507 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3508 | <xsl:otherwise>1</xsl:otherwise> | ||
3509 | </xsl:choose> | ||
3510 | </xsl:variable> | ||
3511 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
3512 | <div><xsl:copy-of select="$verso.content"/></div> | ||
3513 | </xsl:if> | ||
3514 | <xsl:call-template name="glossary.titlepage.separator"/> | ||
3515 | </div> | ||
3516 | </xsl:template> | ||
3517 | |||
3518 | <xsl:template match="*" mode="glossary.titlepage.recto.mode"> | ||
3519 | <!-- if an element isn't found in this mode, --> | ||
3520 | <!-- try the generic titlepage.mode --> | ||
3521 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3522 | </xsl:template> | ||
3523 | |||
3524 | <xsl:template match="*" mode="glossary.titlepage.verso.mode"> | ||
3525 | <!-- if an element isn't found in this mode, --> | ||
3526 | <!-- try the generic titlepage.mode --> | ||
3527 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3528 | </xsl:template> | ||
3529 | |||
3530 | <xsl:template match="subtitle" mode="glossary.titlepage.recto.auto.mode"> | ||
3531 | <div xsl:use-attribute-sets="glossary.titlepage.recto.style"> | ||
3532 | <xsl:apply-templates select="." mode="glossary.titlepage.recto.mode"/> | ||
3533 | </div> | ||
3534 | </xsl:template> | ||
3535 | |||
3536 | <xsl:template name="index.titlepage.recto"> | ||
3537 | <div xsl:use-attribute-sets="index.titlepage.recto.style"> | ||
3538 | <xsl:call-template name="component.title"> | ||
3539 | <xsl:with-param name="node" select="ancestor-or-self::index[1]"/> | ||
3540 | </xsl:call-template></div> | ||
3541 | <xsl:choose> | ||
3542 | <xsl:when test="indexinfo/subtitle"> | ||
3543 | <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="indexinfo/subtitle"/> | ||
3544 | </xsl:when> | ||
3545 | <xsl:when test="docinfo/subtitle"> | ||
3546 | <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
3547 | </xsl:when> | ||
3548 | <xsl:when test="info/subtitle"> | ||
3549 | <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
3550 | </xsl:when> | ||
3551 | <xsl:when test="subtitle"> | ||
3552 | <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="subtitle"/> | ||
3553 | </xsl:when> | ||
3554 | </xsl:choose> | ||
3555 | |||
3556 | </xsl:template> | ||
3557 | |||
3558 | <xsl:template name="index.titlepage.verso"> | ||
3559 | </xsl:template> | ||
3560 | |||
3561 | <xsl:template name="index.titlepage.separator"> | ||
3562 | </xsl:template> | ||
3563 | |||
3564 | <xsl:template name="index.titlepage.before.recto"> | ||
3565 | </xsl:template> | ||
3566 | |||
3567 | <xsl:template name="index.titlepage.before.verso"> | ||
3568 | </xsl:template> | ||
3569 | |||
3570 | <xsl:template name="index.titlepage"> | ||
3571 | <div class="titlepage"> | ||
3572 | <xsl:variable name="recto.content"> | ||
3573 | <xsl:call-template name="index.titlepage.before.recto"/> | ||
3574 | <xsl:call-template name="index.titlepage.recto"/> | ||
3575 | </xsl:variable> | ||
3576 | <xsl:variable name="recto.elements.count"> | ||
3577 | <xsl:choose> | ||
3578 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3579 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3580 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3581 | <xsl:otherwise>1</xsl:otherwise> | ||
3582 | </xsl:choose> | ||
3583 | </xsl:variable> | ||
3584 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
3585 | <div><xsl:copy-of select="$recto.content"/></div> | ||
3586 | </xsl:if> | ||
3587 | <xsl:variable name="verso.content"> | ||
3588 | <xsl:call-template name="index.titlepage.before.verso"/> | ||
3589 | <xsl:call-template name="index.titlepage.verso"/> | ||
3590 | </xsl:variable> | ||
3591 | <xsl:variable name="verso.elements.count"> | ||
3592 | <xsl:choose> | ||
3593 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3594 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3595 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3596 | <xsl:otherwise>1</xsl:otherwise> | ||
3597 | </xsl:choose> | ||
3598 | </xsl:variable> | ||
3599 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
3600 | <div><xsl:copy-of select="$verso.content"/></div> | ||
3601 | </xsl:if> | ||
3602 | <xsl:call-template name="index.titlepage.separator"/> | ||
3603 | </div> | ||
3604 | </xsl:template> | ||
3605 | |||
3606 | <xsl:template match="*" mode="index.titlepage.recto.mode"> | ||
3607 | <!-- if an element isn't found in this mode, --> | ||
3608 | <!-- try the generic titlepage.mode --> | ||
3609 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3610 | </xsl:template> | ||
3611 | |||
3612 | <xsl:template match="*" mode="index.titlepage.verso.mode"> | ||
3613 | <!-- if an element isn't found in this mode, --> | ||
3614 | <!-- try the generic titlepage.mode --> | ||
3615 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3616 | </xsl:template> | ||
3617 | |||
3618 | <xsl:template match="subtitle" mode="index.titlepage.recto.auto.mode"> | ||
3619 | <div xsl:use-attribute-sets="index.titlepage.recto.style"> | ||
3620 | <xsl:apply-templates select="." mode="index.titlepage.recto.mode"/> | ||
3621 | </div> | ||
3622 | </xsl:template> | ||
3623 | |||
3624 | <xsl:template name="setindex.titlepage.recto"> | ||
3625 | <div xsl:use-attribute-sets="setindex.titlepage.recto.style"> | ||
3626 | <xsl:call-template name="component.title"> | ||
3627 | <xsl:with-param name="node" select="ancestor-or-self::setindex[1]"/> | ||
3628 | </xsl:call-template></div> | ||
3629 | <xsl:choose> | ||
3630 | <xsl:when test="setindexinfo/subtitle"> | ||
3631 | <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="setindexinfo/subtitle"/> | ||
3632 | </xsl:when> | ||
3633 | <xsl:when test="docinfo/subtitle"> | ||
3634 | <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
3635 | </xsl:when> | ||
3636 | <xsl:when test="info/subtitle"> | ||
3637 | <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
3638 | </xsl:when> | ||
3639 | <xsl:when test="subtitle"> | ||
3640 | <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="subtitle"/> | ||
3641 | </xsl:when> | ||
3642 | </xsl:choose> | ||
3643 | |||
3644 | </xsl:template> | ||
3645 | |||
3646 | <xsl:template name="setindex.titlepage.verso"> | ||
3647 | </xsl:template> | ||
3648 | |||
3649 | <xsl:template name="setindex.titlepage.separator"> | ||
3650 | </xsl:template> | ||
3651 | |||
3652 | <xsl:template name="setindex.titlepage.before.recto"> | ||
3653 | </xsl:template> | ||
3654 | |||
3655 | <xsl:template name="setindex.titlepage.before.verso"> | ||
3656 | </xsl:template> | ||
3657 | |||
3658 | <xsl:template name="setindex.titlepage"> | ||
3659 | <div class="titlepage"> | ||
3660 | <xsl:variable name="recto.content"> | ||
3661 | <xsl:call-template name="setindex.titlepage.before.recto"/> | ||
3662 | <xsl:call-template name="setindex.titlepage.recto"/> | ||
3663 | </xsl:variable> | ||
3664 | <xsl:variable name="recto.elements.count"> | ||
3665 | <xsl:choose> | ||
3666 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3667 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3668 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3669 | <xsl:otherwise>1</xsl:otherwise> | ||
3670 | </xsl:choose> | ||
3671 | </xsl:variable> | ||
3672 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
3673 | <div><xsl:copy-of select="$recto.content"/></div> | ||
3674 | </xsl:if> | ||
3675 | <xsl:variable name="verso.content"> | ||
3676 | <xsl:call-template name="setindex.titlepage.before.verso"/> | ||
3677 | <xsl:call-template name="setindex.titlepage.verso"/> | ||
3678 | </xsl:variable> | ||
3679 | <xsl:variable name="verso.elements.count"> | ||
3680 | <xsl:choose> | ||
3681 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3682 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3683 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3684 | <xsl:otherwise>1</xsl:otherwise> | ||
3685 | </xsl:choose> | ||
3686 | </xsl:variable> | ||
3687 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
3688 | <div><xsl:copy-of select="$verso.content"/></div> | ||
3689 | </xsl:if> | ||
3690 | <xsl:call-template name="setindex.titlepage.separator"/> | ||
3691 | </div> | ||
3692 | </xsl:template> | ||
3693 | |||
3694 | <xsl:template match="*" mode="setindex.titlepage.recto.mode"> | ||
3695 | <!-- if an element isn't found in this mode, --> | ||
3696 | <!-- try the generic titlepage.mode --> | ||
3697 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3698 | </xsl:template> | ||
3699 | |||
3700 | <xsl:template match="*" mode="setindex.titlepage.verso.mode"> | ||
3701 | <!-- if an element isn't found in this mode, --> | ||
3702 | <!-- try the generic titlepage.mode --> | ||
3703 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3704 | </xsl:template> | ||
3705 | |||
3706 | <xsl:template match="subtitle" mode="setindex.titlepage.recto.auto.mode"> | ||
3707 | <div xsl:use-attribute-sets="setindex.titlepage.recto.style"> | ||
3708 | <xsl:apply-templates select="." mode="setindex.titlepage.recto.mode"/> | ||
3709 | </div> | ||
3710 | </xsl:template> | ||
3711 | |||
3712 | <xsl:template name="sidebar.titlepage.recto"> | ||
3713 | <xsl:choose> | ||
3714 | <xsl:when test="sidebarinfo/title"> | ||
3715 | <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="sidebarinfo/title"/> | ||
3716 | </xsl:when> | ||
3717 | <xsl:when test="docinfo/title"> | ||
3718 | <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="docinfo/title"/> | ||
3719 | </xsl:when> | ||
3720 | <xsl:when test="info/title"> | ||
3721 | <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="info/title"/> | ||
3722 | </xsl:when> | ||
3723 | <xsl:when test="title"> | ||
3724 | <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="title"/> | ||
3725 | </xsl:when> | ||
3726 | </xsl:choose> | ||
3727 | |||
3728 | <xsl:choose> | ||
3729 | <xsl:when test="sidebarinfo/subtitle"> | ||
3730 | <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="sidebarinfo/subtitle"/> | ||
3731 | </xsl:when> | ||
3732 | <xsl:when test="docinfo/subtitle"> | ||
3733 | <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="docinfo/subtitle"/> | ||
3734 | </xsl:when> | ||
3735 | <xsl:when test="info/subtitle"> | ||
3736 | <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="info/subtitle"/> | ||
3737 | </xsl:when> | ||
3738 | <xsl:when test="subtitle"> | ||
3739 | <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="subtitle"/> | ||
3740 | </xsl:when> | ||
3741 | </xsl:choose> | ||
3742 | |||
3743 | </xsl:template> | ||
3744 | |||
3745 | <xsl:template name="sidebar.titlepage.verso"> | ||
3746 | </xsl:template> | ||
3747 | |||
3748 | <xsl:template name="sidebar.titlepage.separator"> | ||
3749 | </xsl:template> | ||
3750 | |||
3751 | <xsl:template name="sidebar.titlepage.before.recto"> | ||
3752 | </xsl:template> | ||
3753 | |||
3754 | <xsl:template name="sidebar.titlepage.before.verso"> | ||
3755 | </xsl:template> | ||
3756 | |||
3757 | <xsl:template name="sidebar.titlepage"> | ||
3758 | <div class="titlepage"> | ||
3759 | <xsl:variable name="recto.content"> | ||
3760 | <xsl:call-template name="sidebar.titlepage.before.recto"/> | ||
3761 | <xsl:call-template name="sidebar.titlepage.recto"/> | ||
3762 | </xsl:variable> | ||
3763 | <xsl:variable name="recto.elements.count"> | ||
3764 | <xsl:choose> | ||
3765 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3766 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3767 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when> | ||
3768 | <xsl:otherwise>1</xsl:otherwise> | ||
3769 | </xsl:choose> | ||
3770 | </xsl:variable> | ||
3771 | <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count > 0)"> | ||
3772 | <div><xsl:copy-of select="$recto.content"/></div> | ||
3773 | </xsl:if> | ||
3774 | <xsl:variable name="verso.content"> | ||
3775 | <xsl:call-template name="sidebar.titlepage.before.verso"/> | ||
3776 | <xsl:call-template name="sidebar.titlepage.verso"/> | ||
3777 | </xsl:variable> | ||
3778 | <xsl:variable name="verso.elements.count"> | ||
3779 | <xsl:choose> | ||
3780 | <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3781 | <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')"> | ||
3782 | <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when> | ||
3783 | <xsl:otherwise>1</xsl:otherwise> | ||
3784 | </xsl:choose> | ||
3785 | </xsl:variable> | ||
3786 | <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count > 0)"> | ||
3787 | <div><xsl:copy-of select="$verso.content"/></div> | ||
3788 | </xsl:if> | ||
3789 | <xsl:call-template name="sidebar.titlepage.separator"/> | ||
3790 | </div> | ||
3791 | </xsl:template> | ||
3792 | |||
3793 | <xsl:template match="*" mode="sidebar.titlepage.recto.mode"> | ||
3794 | <!-- if an element isn't found in this mode, --> | ||
3795 | <!-- try the generic titlepage.mode --> | ||
3796 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3797 | </xsl:template> | ||
3798 | |||
3799 | <xsl:template match="*" mode="sidebar.titlepage.verso.mode"> | ||
3800 | <!-- if an element isn't found in this mode, --> | ||
3801 | <!-- try the generic titlepage.mode --> | ||
3802 | <xsl:apply-templates select="." mode="titlepage.mode"/> | ||
3803 | </xsl:template> | ||
3804 | |||
3805 | <xsl:template match="title" mode="sidebar.titlepage.recto.auto.mode"> | ||
3806 | <div xsl:use-attribute-sets="sidebar.titlepage.recto.style"> | ||
3807 | <xsl:call-template name="formal.object.heading"> | ||
3808 | <xsl:with-param name="object" select="ancestor-or-self::sidebar[1]"/> | ||
3809 | </xsl:call-template> | ||
3810 | </div> | ||
3811 | </xsl:template> | ||
3812 | |||
3813 | <xsl:template match="subtitle" mode="sidebar.titlepage.recto.auto.mode"> | ||
3814 | <div xsl:use-attribute-sets="sidebar.titlepage.recto.style"> | ||
3815 | <xsl:apply-templates select="." mode="sidebar.titlepage.recto.mode"/> | ||
3816 | </div> | ||
3817 | </xsl:template> | ||
3818 | |||
3819 | </xsl:stylesheet> | ||
3820 | |||
diff --git a/documentation/yocto-project-qs/yocto-project-qs.xml b/documentation/yocto-project-qs/yocto-project-qs.xml new file mode 100644 index 0000000..61327f5 --- /dev/null +++ b/documentation/yocto-project-qs/yocto-project-qs.xml | |||
@@ -0,0 +1,948 @@ | |||
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 | |||
5 | <article id='intro'> | ||
6 | <articleinfo> | ||
7 | <title>Yocto Project Quick Start</title> | ||
8 | |||
9 | <copyright> | ||
10 | <year>©RIGHT_YEAR;</year> | ||
11 | <holder>Linux Foundation</holder> | ||
12 | </copyright> | ||
13 | |||
14 | <legalnotice> | ||
15 | <para> | ||
16 | Permission is granted to copy, distribute and/or modify this document under | ||
17 | the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England & Wales</ulink> as published by Creative Commons. | ||
18 | </para> | ||
19 | <note> | ||
20 | For the latest version of this manual associated with this | ||
21 | Yocto Project release, see the | ||
22 | <ulink url='&YOCTO_DOCS_QS_URL;'>Yocto Project Quick Start</ulink> | ||
23 | from the Yocto Project website. | ||
24 | </note> | ||
25 | </legalnotice> | ||
26 | |||
27 | |||
28 | <abstract> | ||
29 | <imagedata fileref="figures/yocto-project-transp.png" | ||
30 | width="6in" depth="1in" | ||
31 | align="right" scale="25" /> | ||
32 | </abstract> | ||
33 | </articleinfo> | ||
34 | |||
35 | <section id='welcome'> | ||
36 | <title>Welcome!</title> | ||
37 | <para> | ||
38 | Welcome to the Yocto Project! | ||
39 | The Yocto Project is an open-source collaboration project focused on | ||
40 | embedded Linux developers. | ||
41 | Among other things, the Yocto Project uses a build system based on the | ||
42 | OpenEmbedded (OE) project, which uses the | ||
43 | <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink> | ||
44 | tool, to construct complete Linux images. | ||
45 | The BitBake and OE components are combined together to form | ||
46 | <ulink url='&YOCTO_DOCS_DEV_URL;#poky'>Poky</ulink>, | ||
47 | a reference build system. | ||
48 | </para> | ||
49 | |||
50 | <para> | ||
51 | If you don't have a system that runs Linux and you want to give the Yocto Project a test run, | ||
52 | you might consider using the Yocto Project Build Appliance. | ||
53 | The Build Appliance allows you to build and boot a custom embedded Linux image with the Yocto | ||
54 | Project using a non-Linux development system. | ||
55 | See the <ulink url='https://www.yoctoproject.org/tools-resources/projects/build-appliance'>Yocto | ||
56 | Project Build Appliance</ulink> for more information. | ||
57 | </para> | ||
58 | |||
59 | <para> | ||
60 | On the other hand, if you know all about open-source development, Linux development environments, | ||
61 | Git source repositories and the like and you just want some quick information that lets you try out | ||
62 | the Yocto Project on your Linux system, skip right to the | ||
63 | "<link linkend='super-user'>Super User</link>" section at the end of this quick start. | ||
64 | </para> | ||
65 | |||
66 | <para> | ||
67 | For the rest of you, this short document will give you some basic information about the environment and | ||
68 | let you experience it in its simplest form. | ||
69 | After reading this document, you will have a basic understanding of what the Yocto Project is | ||
70 | and how to use some of its core components. | ||
71 | This document steps you through a simple example showing you how to build a small image | ||
72 | and run it using the Quick EMUlator (QEMU emulator). | ||
73 | </para> | ||
74 | |||
75 | <para> | ||
76 | For more detailed information on the Yocto Project, you should check out these resources: | ||
77 | <itemizedlist> | ||
78 | <listitem><para><emphasis>Website:</emphasis> The <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink> | ||
79 | provides the latest builds, breaking news, full development documentation, and a rich Yocto | ||
80 | Project Development Community into which you can tap. | ||
81 | </para></listitem> | ||
82 | <listitem><para><emphasis>FAQs:</emphasis> Lists commonly asked Yocto Project questions and answers. | ||
83 | You can find two FAQs: <ulink url='&YOCTO_WIKI_URL;/wiki/FAQ'>Yocto Project FAQ</ulink> on | ||
84 | a wiki, and the | ||
85 | "<ulink url='&YOCTO_DOCS_REF_URL;#faq'>FAQ</ulink>" chapter in | ||
86 | the Yocto Project Reference Manual. | ||
87 | </para></listitem> | ||
88 | <listitem><para><emphasis>Developer Screencast:</emphasis> The | ||
89 | <ulink url='http://vimeo.com/36450321'>Getting Started with the Yocto Project - New | ||
90 | Developer Screencast Tutorial</ulink> provides a 30-minute video | ||
91 | created for users unfamiliar with the Yocto Project but familiar | ||
92 | with Linux build systems.</para></listitem> | ||
93 | </itemizedlist> | ||
94 | </para> | ||
95 | </section> | ||
96 | |||
97 | <section id='yp-intro'> | ||
98 | <title>Introducing the Yocto Project Development Environment</title> | ||
99 | <para> | ||
100 | The Yocto Project through the OpenEmbedded build system provides an open source development | ||
101 | environment targeting the ARM, MIPS, PowerPC and x86 architectures for a variety of | ||
102 | platforms including x86-64 and emulated ones. | ||
103 | You can use components from the Yocto Project to design, develop, build, debug, simulate, | ||
104 | and test the complete software stack using Linux, the X Window System, GNOME Mobile-based | ||
105 | application frameworks, and Qt frameworks. | ||
106 | </para> | ||
107 | |||
108 | <mediaobject> | ||
109 | <imageobject> | ||
110 | <imagedata fileref="figures/yocto-environment.png" | ||
111 | format="PNG" align='center' scalefit='1' width="100%"/> | ||
112 | </imageobject> | ||
113 | <caption> | ||
114 | <para>The Yocto Project Development Environment</para> | ||
115 | </caption> | ||
116 | </mediaobject> | ||
117 | |||
118 | <para> | ||
119 | Here are some highlights for the Yocto Project: | ||
120 | </para> | ||
121 | |||
122 | <itemizedlist> | ||
123 | <listitem> | ||
124 | <para>Provides a recent Linux kernel along with a set of system commands and libraries suitable for the embedded environment.</para> | ||
125 | </listitem> | ||
126 | <listitem> | ||
127 | <para>Makes available system components such as X11, GTK+, Qt, Clutter, and SDL | ||
128 | (among others) so you can create a rich user experience on devices | ||
129 | that have display hardware. | ||
130 | For devices that do not have a display or where you wish to use alternative UI | ||
131 | frameworks, these components need not be installed.</para> | ||
132 | </listitem> | ||
133 | <listitem> | ||
134 | <para>Creates a focused and stable core compatible with the OpenEmbedded | ||
135 | project with which you can easily and reliably build and develop.</para> | ||
136 | </listitem> | ||
137 | <listitem> | ||
138 | <para>Fully supports a wide range of hardware and device emulation through the QEMU | ||
139 | Emulator.</para> | ||
140 | </listitem> | ||
141 | </itemizedlist> | ||
142 | |||
143 | <para> | ||
144 | The Yocto Project can generate images for many kinds of devices. | ||
145 | However, the standard example machines target QEMU full-system emulation for x86, x86-64, ARM, MIPS, | ||
146 | and PPC-based architectures as well as specific hardware such as the | ||
147 | <trademark class='registered'>Intel</trademark> Desktop Board DH55TC. | ||
148 | Because an image developed with the Yocto Project can boot inside a QEMU emulator, the | ||
149 | development environment works nicely as a test platform for developing embedded software. | ||
150 | </para> | ||
151 | |||
152 | <para> | ||
153 | Another important Yocto Project feature is the Sato reference User Interface. | ||
154 | This optional GNOME mobile-based UI, which is intended for devices with | ||
155 | restricted screen sizes, sits neatly on top of a device using the | ||
156 | GNOME Mobile Stack and provides a well-defined user experience. | ||
157 | Implemented in its own layer, it makes it clear to developers how they can implement | ||
158 | their own user interface on top of a Linux image created with the Yocto Project. | ||
159 | </para> | ||
160 | </section> | ||
161 | |||
162 | <section id='yp-resources'> | ||
163 | <title>What You Need and How You Get It</title> | ||
164 | |||
165 | <para> | ||
166 | You need these things to develop projects in the Yocto Project | ||
167 | environment: | ||
168 | </para> | ||
169 | |||
170 | <itemizedlist> | ||
171 | <listitem><para> | ||
172 | A host system with a minimum of 50 Gbytes of free disk space that | ||
173 | is running a supported Linux distribution (i.e. recent releases | ||
174 | of Fedora, openSUSE, CentOS, Debian, or Ubuntu). | ||
175 | If the host system supports multiple cores and threads, you can | ||
176 | configure the Yocto Project build system to significantly | ||
177 | decrease the time needed to build images. | ||
178 | </para></listitem> | ||
179 | <listitem><para> | ||
180 | The right packages. | ||
181 | </para></listitem> | ||
182 | <listitem><para> | ||
183 | A release of the Yocto Project. | ||
184 | </para></listitem> | ||
185 | </itemizedlist> | ||
186 | |||
187 | <section id='the-linux-distro'> | ||
188 | <title>The Linux Distribution</title> | ||
189 | |||
190 | <para> | ||
191 | The Yocto Project team is continually verifying more and more Linux | ||
192 | distributions with each release. | ||
193 | In general, if you have the current release minus one of the following | ||
194 | distributions you should have no problems. | ||
195 | <itemizedlist> | ||
196 | <listitem><para>Ubuntu</para></listitem> | ||
197 | <listitem><para>Fedora</para></listitem> | ||
198 | <listitem><para>openSUSE</para></listitem> | ||
199 | <listitem><para>CentOS</para></listitem> | ||
200 | <listitem><para>Debian</para></listitem> | ||
201 | </itemizedlist> | ||
202 | For a more detailed list of distributions that support the Yocto Project, | ||
203 | see the | ||
204 | "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section | ||
205 | in the Yocto Project Reference Manual. | ||
206 | </para> | ||
207 | <para> | ||
208 | The OpenEmbedded build system should be able to run on any modern | ||
209 | distribution that has the following versions for Git, tar, and | ||
210 | Python. | ||
211 | <itemizedlist> | ||
212 | <listitem><para>Git 1.7.5 or greater</para></listitem> | ||
213 | <listitem><para>tar 1.24 or greater</para></listitem> | ||
214 | <listitem><para>Python 2.7.3 or greater excluding Python | ||
215 | 3.x, which is not supported.</para></listitem> | ||
216 | </itemizedlist> | ||
217 | Earlier releases of Python are known to not work and the | ||
218 | system does not support Python 3 at this time. | ||
219 | If your system does not meet any of these three listed | ||
220 | version requirements, you can | ||
221 | take steps to prepare the system so that you can still use the build | ||
222 | system. | ||
223 | See the | ||
224 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>" | ||
225 | section in the Yocto Project Reference Manual for information. | ||
226 | </para> | ||
227 | <para> | ||
228 | This document assumes you are running one of the previously noted | ||
229 | distributions on your Linux-based host systems. | ||
230 | </para> | ||
231 | <note> | ||
232 | <para> | ||
233 | If you attempt to use a distribution not in the above list, | ||
234 | you may or may not have success. | ||
235 | Yocto Project releases are tested against the stable Linux | ||
236 | distributions listed in the | ||
237 | "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" | ||
238 | section of the Yocto Project Reference Manual. | ||
239 | If you encounter problems, please go to | ||
240 | <ulink url='&YOCTO_BUGZILLA_URL;'>Yocto Project Bugzilla</ulink> | ||
241 | and submit a bug. | ||
242 | We are interested in hearing about your experience. | ||
243 | </para> | ||
244 | </note> | ||
245 | </section> | ||
246 | |||
247 | <section id='packages'> | ||
248 | <title>The Packages</title> | ||
249 | |||
250 | <para> | ||
251 | Packages and package installation vary depending on your development system | ||
252 | and on your intent. | ||
253 | For example, if you want to build an image that can run | ||
254 | on QEMU in graphical mode (a minimal, basic build | ||
255 | requirement), then the number of packages is different than if you want to | ||
256 | build an image on a headless system or build out the Yocto Project | ||
257 | documentation set. | ||
258 | Collectively, the number of required packages is large | ||
259 | if you want to be able to cover all cases. | ||
260 | <note>In general, you need to have root access and then install the | ||
261 | required packages. | ||
262 | Thus, the commands in the following section may or may not work | ||
263 | depending on whether or not your Linux distribution has | ||
264 | <filename>sudo</filename> installed.</note> | ||
265 | </para> | ||
266 | |||
267 | <para> | ||
268 | The next few sections list, by supported Linux Distributions, the required | ||
269 | packages needed to build an image that runs on QEMU in graphical mode | ||
270 | (e.g. essential plus graphics support). | ||
271 | </para> | ||
272 | |||
273 | <para> | ||
274 | For lists of required packages for other scenarios, see the | ||
275 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>" | ||
276 | section in the Yocto Project Reference Manual. | ||
277 | </para> | ||
278 | |||
279 | <section id='ubuntu'> | ||
280 | <title>Ubuntu and Debian</title> | ||
281 | |||
282 | <para> | ||
283 | The essential and graphical support packages you need for a | ||
284 | supported Ubuntu or Debian distribution are shown in the | ||
285 | following command: | ||
286 | <literallayout class='monospaced'> | ||
287 | $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL; libsdl1.2-dev xterm | ||
288 | </literallayout> | ||
289 | </para> | ||
290 | </section> | ||
291 | |||
292 | <section id='fedora'> | ||
293 | <title>Fedora</title> | ||
294 | |||
295 | <para> | ||
296 | The essential and graphical packages you need for a supported | ||
297 | Fedora distribution are shown in the following command: | ||
298 | <literallayout class='monospaced'> | ||
299 | $ sudo yum install &FEDORA_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm | ||
300 | </literallayout> | ||
301 | </para> | ||
302 | </section> | ||
303 | |||
304 | <section id='opensuse'> | ||
305 | <title>OpenSUSE</title> | ||
306 | |||
307 | <para> | ||
308 | The essential and graphical packages you need for a supported | ||
309 | OpenSUSE distribution are shown in the following command: | ||
310 | <literallayout class='monospaced'> | ||
311 | $ sudo zypper install &OPENSUSE_HOST_PACKAGES_ESSENTIAL; libSDL-devel xterm | ||
312 | </literallayout> | ||
313 | </para> | ||
314 | </section> | ||
315 | |||
316 | <section id='centos'> | ||
317 | <title>CentOS</title> | ||
318 | |||
319 | <para> | ||
320 | The essential and graphical packages you need for a supported | ||
321 | CentOS distribution are shown in the following command: | ||
322 | <literallayout class='monospaced'> | ||
323 | $ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm | ||
324 | </literallayout> | ||
325 | <note>Depending on the CentOS version you are using, other requirements | ||
326 | and dependencies might exist. | ||
327 | For details, you should look at the CentOS sections on the | ||
328 | <ulink url='https://wiki.yoctoproject.org/wiki/Poky/GettingStarted/Dependencies'>Poky/GettingStarted/Dependencies</ulink> | ||
329 | wiki page.</note> | ||
330 | </para> | ||
331 | </section> | ||
332 | </section> | ||
333 | |||
334 | <section id='releases'> | ||
335 | <title>Yocto Project Release</title> | ||
336 | |||
337 | <para> | ||
338 | It is recommended that you get the latest Yocto Project files | ||
339 | by setting up (cloning in | ||
340 | <ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink> terms) a local | ||
341 | copy of the | ||
342 | <filename>poky</filename> Git repository on your host development | ||
343 | system. | ||
344 | Doing so allows you to contribute back to the Yocto Project project. | ||
345 | For information on how to get set up using this method, see the | ||
346 | "<ulink url='&YOCTO_DOCS_DEV_URL;#local-yp-release'>Yocto | ||
347 | Project Release</ulink>" item in the Yocto Project Development Manual. | ||
348 | </para> | ||
349 | |||
350 | <para> | ||
351 | You can also get the Yocto Project Files by downloading | ||
352 | Yocto Project releases from the | ||
353 | <ulink url="&YOCTO_HOME_URL;">Yocto Project website</ulink>. | ||
354 | From the website, you just click "Downloads" in the navigation pane | ||
355 | to the left to display all Yocto Project downloads. | ||
356 | Current and archived releases are available for download. | ||
357 | Nightly and developmental builds are also maintained at | ||
358 | <ulink url="&YOCTO_AB_NIGHTLY_URL;"></ulink>. | ||
359 | However, for this document a released version of Yocto Project is used. | ||
360 | </para> | ||
361 | |||
362 | </section> | ||
363 | </section> | ||
364 | |||
365 | <section id='test-run'> | ||
366 | <title>A Quick Test Run</title> | ||
367 | |||
368 | <para> | ||
369 | Now that you have your system requirements in order, you can give the Yocto Project a try. | ||
370 | This section presents some steps that let you do the following: | ||
371 | </para> | ||
372 | |||
373 | <itemizedlist> | ||
374 | <listitem> | ||
375 | <para> | ||
376 | Build an image and run it in the QEMU emulator. | ||
377 | </para> | ||
378 | </listitem> | ||
379 | <listitem> | ||
380 | <para> | ||
381 | Use a pre-built image and run it in the QEMU emulator. | ||
382 | </para> | ||
383 | </listitem> | ||
384 | </itemizedlist> | ||
385 | |||
386 | <section id='building-image'> | ||
387 | <title>Building an Image</title> | ||
388 | |||
389 | <para> | ||
390 | In the development environment you will need to build an image whenever you change hardware | ||
391 | support, add or change system libraries, or add or change services that have dependencies. | ||
392 | </para> | ||
393 | |||
394 | <mediaobject> | ||
395 | <imageobject> | ||
396 | <imagedata fileref="figures/building-an-image.png" format="PNG" align='center' scalefit='1'/> | ||
397 | </imageobject> | ||
398 | <caption> | ||
399 | <para>Building an Image</para> | ||
400 | </caption> | ||
401 | </mediaobject> | ||
402 | |||
403 | <para> | ||
404 | Use the following commands to build your image. | ||
405 | The OpenEmbedded build process creates an entire Linux | ||
406 | distribution, including the toolchain, from source. | ||
407 | <note> | ||
408 | By default, the build process searches for source code using | ||
409 | a pre-determined order through a set of locations. | ||
410 | If you encounter problems with the build process finding and | ||
411 | downloading source code, see the | ||
412 | "<ulink url='&YOCTO_DOCS_REF_URL;#how-does-the-yocto-project-obtain-source-code-and-will-it-work-behind-my-firewall-or-proxy-server'>How does the OpenEmbedded build system obtain source code and will it work behind my firewall or proxy server?</ulink>" | ||
413 | entry in the Yocto Project Reference Manual FAQ. | ||
414 | </note> | ||
415 | </para> | ||
416 | |||
417 | <para> | ||
418 | <literallayout class='monospaced'> | ||
419 | $ git clone &YOCTO_GIT_URL;/git/poky | ||
420 | $ cd poky | ||
421 | $ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME; | ||
422 | $ source &OE_INIT_FILE; | ||
423 | </literallayout> | ||
424 | </para> | ||
425 | |||
426 | <tip> | ||
427 | <para> | ||
428 | To help conserve disk space during builds, you can add the | ||
429 | following statement to your project's configuration file, | ||
430 | which for this example is | ||
431 | <filename>poky/build/conf/local.conf</filename>. | ||
432 | Adding this statement deletes the work directory used for | ||
433 | building a package once the package is built. | ||
434 | <literallayout class='monospaced'> | ||
435 | INHERIT += "rm_work" | ||
436 | </literallayout> | ||
437 | </para> | ||
438 | </tip> | ||
439 | |||
440 | <itemizedlist> | ||
441 | <listitem><para>In the previous example, the first command uses | ||
442 | <ulink url='&YOCTO_DOCS_DEV_URL;#git'>Git</ulink> to create | ||
443 | a local repository named <filename>poky</filename> that is a | ||
444 | clone of the upstream Yocto Project | ||
445 | <filename>poky</filename> repository.</para></listitem> | ||
446 | <listitem><para>The third command checks out a local branch and | ||
447 | names it <filename>&DISTRO_NAME;</filename>. | ||
448 | The local branch tracks the upstream branch of the same name. | ||
449 | Creating your own branch based on the released branch ensures | ||
450 | you are using the latest files for that release. | ||
451 | </para></listitem> | ||
452 | <listitem><para> | ||
453 | The final command runs the Yocto Project | ||
454 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> | ||
455 | environment setup script. | ||
456 | Running this script defines OpenEmbedded build environment | ||
457 | settings needed to complete the build. | ||
458 | The script also creates the | ||
459 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>, | ||
460 | which is <filename>build</filename> in this case and is located | ||
461 | in the | ||
462 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>. | ||
463 | After the script runs, your current working directory is set | ||
464 | to the Build Directory. | ||
465 | Later, when the build completes, the Build Directory contains | ||
466 | all the files created during the build. | ||
467 | <note> | ||
468 | For information on running a memory-resident | ||
469 | <ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-components-bitbake'>BitBake</ulink>, | ||
470 | see the | ||
471 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink> | ||
472 | setup script. | ||
473 | </note></para></listitem> | ||
474 | </itemizedlist> | ||
475 | <para> | ||
476 | Take some time to examine your <filename>local.conf</filename> file | ||
477 | in your project's configuration directory, which is found in the Build Directory. | ||
478 | The defaults in that file should work fine. | ||
479 | However, there are some variables of interest at which you might look. | ||
480 | </para> | ||
481 | |||
482 | <para> | ||
483 | By default, the target architecture for the build is <filename>qemux86</filename>, | ||
484 | which produces an image that can be used in the QEMU emulator and is targeted at an | ||
485 | <trademark class='registered'>Intel</trademark> 32-bit based architecture. | ||
486 | To change this default, edit the value of the | ||
487 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> | ||
488 | variable in the configuration file before launching the build. | ||
489 | </para> | ||
490 | |||
491 | <para> | ||
492 | Another couple of variables of interest are the | ||
493 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></ulink> and the | ||
494 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></ulink> variables. | ||
495 | By default, these variables are set to how ever many processor | ||
496 | cores your build host uses. | ||
497 | However, if your build host uses multiple processor cores, | ||
498 | you should increase these settings to twice the number of | ||
499 | cores used. | ||
500 | Doing so can significantly shorten your build time. | ||
501 | </para> | ||
502 | |||
503 | <para> | ||
504 | Another consideration before you build is the package manager used when creating | ||
505 | the image. | ||
506 | By default, the OpenEmbedded build system uses the RPM package manager. | ||
507 | You can control this configuration by using the | ||
508 | <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink></filename> variable. | ||
509 | For additional package manager selection information, see the | ||
510 | "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-package'><filename>package*.bbclass</filename></ulink>" | ||
511 | section in the Yocto Project Reference Manual. | ||
512 | </para> | ||
513 | |||
514 | <para> | ||
515 | Continue with the following command to build an OS image for the target, which is | ||
516 | <filename>core-image-sato</filename> in this example. | ||
517 | For information on the <filename>-k</filename> option use the | ||
518 | <filename>bitbake --help</filename> command, see the | ||
519 | "<ulink url='&YOCTO_DOCS_REF_URL;#usingpoky-components-bitbake'>BitBake</ulink>" | ||
520 | section in the Yocto Project Reference Manual, or see the | ||
521 | "<ulink url='&YOCTO_DOCS_BB_URL;#user-manual-command'>BitBake Command</ulink>" | ||
522 | section in the BitBake User Manual. | ||
523 | <literallayout class='monospaced'> | ||
524 | $ bitbake -k core-image-sato | ||
525 | </literallayout> | ||
526 | <note> | ||
527 | BitBake requires Python 2.6 or 2.7. For more information on | ||
528 | this requirement, see the | ||
529 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python</ulink>" | ||
530 | section in the Yocto Project Reference Manual. | ||
531 | </note> | ||
532 | The final command runs the image: | ||
533 | <literallayout class='monospaced'> | ||
534 | $ runqemu qemux86 | ||
535 | </literallayout> | ||
536 | <note> | ||
537 | <para> | ||
538 | Depending on the number of processors and cores, the amount | ||
539 | of RAM, the speed of your Internet connection and other | ||
540 | factors, the build process could take several hours the | ||
541 | first time you run it. | ||
542 | Subsequent builds run much faster since parts of the build | ||
543 | are cached. | ||
544 | </para> | ||
545 | </note> | ||
546 | </para> | ||
547 | </section> | ||
548 | |||
549 | <section id='using-pre-built'> | ||
550 | <title>Using Pre-Built Binaries and QEMU</title> | ||
551 | |||
552 | <para> | ||
553 | If hardware, libraries and services are stable, you can get started by using a pre-built binary | ||
554 | of the filesystem image, kernel, and toolchain and run it using the QEMU emulator. | ||
555 | This scenario is useful for developing application software. | ||
556 | </para> | ||
557 | |||
558 | <mediaobject> | ||
559 | <imageobject> | ||
560 | <imagedata fileref="figures/using-a-pre-built-image.png" format="PNG" align='center' scalefit='1'/> | ||
561 | </imageobject> | ||
562 | <caption> | ||
563 | <para>Using a Pre-Built Image</para> | ||
564 | </caption> | ||
565 | </mediaobject> | ||
566 | |||
567 | <para> | ||
568 | For this scenario, you need to do several things: | ||
569 | </para> | ||
570 | |||
571 | <itemizedlist> | ||
572 | <listitem><para>Install the appropriate stand-alone toolchain tarball.</para></listitem> | ||
573 | <listitem><para>Download the pre-built image that will boot with QEMU. | ||
574 | You need to be sure to get the QEMU image that matches your target machine’s | ||
575 | architecture (e.g. x86, ARM, etc.).</para></listitem> | ||
576 | <listitem><para>Download the filesystem image for your target machine's architecture. | ||
577 | </para></listitem> | ||
578 | <listitem><para>Set up the environment to emulate the hardware and then start the QEMU emulator. | ||
579 | </para></listitem> | ||
580 | </itemizedlist> | ||
581 | |||
582 | <section id='installing-the-toolchain'> | ||
583 | <title>Installing the Toolchain</title> | ||
584 | |||
585 | <para> | ||
586 | You can download a tarball installer, which includes the | ||
587 | pre-built toolchain, the <filename>runqemu</filename> | ||
588 | script, and support files from the appropriate directory under | ||
589 | <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'></ulink>. | ||
590 | Toolchains are available for 32-bit and 64-bit x86 development | ||
591 | systems from the <filename>i686</filename> and | ||
592 | <filename>x86_64</filename> directories, respectively. | ||
593 | The toolchains the Yocto Project provides are based off the | ||
594 | <filename>core-image-sato</filename> image and contain | ||
595 | libraries appropriate for developing against that image. | ||
596 | Each type of development system supports five or more target | ||
597 | architectures. | ||
598 | </para> | ||
599 | |||
600 | <para> | ||
601 | The names of the tarball installer scripts are such that a | ||
602 | string representing the host system appears first in the | ||
603 | filename and then is immediately followed by a string | ||
604 | representing the target architecture. | ||
605 | </para> | ||
606 | |||
607 | <literallayout class='monospaced'> | ||
608 | poky-eglibc-<<emphasis>host_system</emphasis>>-<<emphasis>image_type</emphasis>>-<<emphasis>arch</emphasis>>-toolchain-<<emphasis>release_version</emphasis>>.sh | ||
609 | |||
610 | Where: | ||
611 | <<emphasis>host_system</emphasis>> is a string representing your development system: | ||
612 | |||
613 | i686 or x86_64. | ||
614 | |||
615 | <<emphasis>image_type</emphasis>> is a string representing the image you wish to | ||
616 | develop a Software Development Toolkit (SDK) for use against. | ||
617 | The Yocto Project builds toolchain installers using the | ||
618 | following BitBake command: | ||
619 | |||
620 | bitbake core-image-sato -c populate_sdk | ||
621 | |||
622 | <<emphasis>arch</emphasis>> is a string representing the tuned target architecture: | ||
623 | |||
624 | i586, x86_64, powerpc, mips, armv7a or armv5te | ||
625 | |||
626 | <<emphasis>release_version</emphasis>> is a string representing the release number of the | ||
627 | Yocto Project: | ||
628 | |||
629 | &DISTRO;, &DISTRO;+snapshot | ||
630 | </literallayout> | ||
631 | |||
632 | <para> | ||
633 | For example, the following toolchain installer is for a 64-bit | ||
634 | development host system and a i586-tuned target architecture | ||
635 | based off the SDK for <filename>core-image-sato</filename>: | ||
636 | <literallayout class='monospaced'> | ||
637 | poky-eglibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh | ||
638 | </literallayout> | ||
639 | </para> | ||
640 | |||
641 | <para> | ||
642 | Toolchains are self-contained and by default are installed into | ||
643 | <filename>/opt/poky</filename>. | ||
644 | However, when you run the toolchain installer, you can choose an | ||
645 | installation directory. | ||
646 | </para> | ||
647 | |||
648 | <para> | ||
649 | The following command shows how to run the installer given a toolchain tarball | ||
650 | for a 64-bit x86 development host system and a 32-bit x86 target architecture. | ||
651 | You must change the permissions on the toolchain | ||
652 | installer script so that it is executable. | ||
653 | </para> | ||
654 | |||
655 | <para> | ||
656 | The example assumes the toolchain installer is located in <filename>~/Downloads/</filename>. | ||
657 | <note> | ||
658 | If you do not have write permissions for the directory into which you are installing | ||
659 | the toolchain, the toolchain installer notifies you and exits. | ||
660 | Be sure you have write permissions in the directory and run the installer again. | ||
661 | </note> | ||
662 | </para> | ||
663 | |||
664 | <para> | ||
665 | <literallayout class='monospaced'> | ||
666 | $ ~/Downloads/poky-eglibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh | ||
667 | </literallayout> | ||
668 | </para> | ||
669 | |||
670 | <para> | ||
671 | For more information on how to install tarballs, see the | ||
672 | "<ulink url='&YOCTO_DOCS_ADT_URL;#using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball</ulink>" and | ||
673 | "<ulink url='&YOCTO_DOCS_ADT_URL;#using-the-toolchain-from-within-the-build-tree'>Using BitBake and the Build Directory</ulink>" sections in the Yocto Project Application Developer's Guide. | ||
674 | </para> | ||
675 | </section> | ||
676 | |||
677 | <section id='downloading-the-pre-built-linux-kernel'> | ||
678 | <title>Downloading the Pre-Built Linux Kernel</title> | ||
679 | |||
680 | <para> | ||
681 | You can download the pre-built Linux kernel suitable for running in the QEMU emulator from | ||
682 | <ulink url='&YOCTO_QEMU_DL_URL;'></ulink>. | ||
683 | Be sure to use the kernel that matches the architecture you want to simulate. | ||
684 | Download areas exist for the five supported machine architectures: | ||
685 | <filename>qemuarm</filename>, <filename>qemumips</filename>, <filename>qemuppc</filename>, | ||
686 | <filename>qemux86</filename>, and <filename>qemux86-64</filename>. | ||
687 | </para> | ||
688 | |||
689 | <para> | ||
690 | Most kernel files have one of the following forms: | ||
691 | <literallayout class='monospaced'> | ||
692 | *zImage-qemu<<emphasis>arch</emphasis>>.bin | ||
693 | vmlinux-qemu<<emphasis>arch</emphasis>>.bin | ||
694 | |||
695 | Where: | ||
696 | <<emphasis>arch</emphasis>> is a string representing the target architecture: | ||
697 | x86, x86-64, ppc, mips, or arm. | ||
698 | </literallayout> | ||
699 | </para> | ||
700 | |||
701 | <para> | ||
702 | You can learn more about downloading a Yocto Project kernel in the | ||
703 | "<ulink url='&YOCTO_DOCS_DEV_URL;#local-kernel-files'>Yocto Project Kernel</ulink>" | ||
704 | bulleted item in the Yocto Project Development Manual. | ||
705 | </para> | ||
706 | </section> | ||
707 | |||
708 | <section id='downloading-the-filesystem'> | ||
709 | <title>Downloading the Filesystem</title> | ||
710 | |||
711 | <para> | ||
712 | You can also download the filesystem image suitable for your target architecture from | ||
713 | <ulink url='&YOCTO_QEMU_DL_URL;'></ulink>. | ||
714 | Again, be sure to use the filesystem that matches the architecture you want | ||
715 | to simulate. | ||
716 | </para> | ||
717 | |||
718 | <para> | ||
719 | The filesystem image has two tarball forms: <filename>ext3</filename> and | ||
720 | <filename>tar</filename>. | ||
721 | You must use the <filename>ext3</filename> form when booting an image using the | ||
722 | QEMU emulator. | ||
723 | The <filename>tar</filename> form can be flattened out in your host development system | ||
724 | and used for build purposes with the Yocto Project. | ||
725 | <literallayout class='monospaced'> | ||
726 | core-image-<<emphasis>profile</emphasis>>-qemu<<emphasis>arch</emphasis>>.ext3 | ||
727 | core-image-<<emphasis>profile</emphasis>>-qemu<<emphasis>arch</emphasis>>.tar.bz2 | ||
728 | |||
729 | Where: | ||
730 | <<emphasis>profile</emphasis>> is the filesystem image's profile: | ||
731 | lsb, lsb-dev, lsb-sdk, lsb-qt3, minimal, minimal-dev, sato, | ||
732 | sato-dev, or sato-sdk. For information on these types of image | ||
733 | profiles, see the "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" chapter in the Yocto Project | ||
734 | Reference Manual. | ||
735 | |||
736 | <<emphasis>arch</emphasis>> is a string representing the target architecture: | ||
737 | x86, x86-64, ppc, mips, or arm. | ||
738 | </literallayout> | ||
739 | </para> | ||
740 | </section> | ||
741 | |||
742 | <section id='setting-up-the-environment-and-starting-the-qemu-emulator'> | ||
743 | <title>Setting Up the Environment and Starting the QEMU Emulator</title> | ||
744 | |||
745 | <para> | ||
746 | Before you start the QEMU emulator, you need to set up the emulation environment. | ||
747 | The following command form sets up the emulation environment. | ||
748 | <literallayout class='monospaced'> | ||
749 | $ source &YOCTO_ADTPATH_DIR;/environment-setup-<<emphasis>arch</emphasis>>-poky-linux-<<emphasis>if</emphasis>> | ||
750 | |||
751 | Where: | ||
752 | <<emphasis>arch</emphasis>> is a string representing the target architecture: | ||
753 | i586, x86_64, ppc603e, mips, or armv5te. | ||
754 | |||
755 | <<emphasis>if</emphasis>> is a string representing an embedded application binary interface. | ||
756 | Not all setup scripts include this string. | ||
757 | </literallayout> | ||
758 | </para> | ||
759 | |||
760 | <para> | ||
761 | Finally, this command form invokes the QEMU emulator | ||
762 | <literallayout class='monospaced'> | ||
763 | $ runqemu <<emphasis>qemuarch</emphasis>> <<emphasis>kernel-image</emphasis>> <<emphasis>filesystem-image</emphasis>> | ||
764 | |||
765 | Where: | ||
766 | <<emphasis>qemuarch</emphasis>> is a string representing the target architecture: qemux86, qemux86-64, | ||
767 | qemuppc, qemumips, or qemuarm. | ||
768 | |||
769 | <<emphasis>kernel-image</emphasis>> is the architecture-specific kernel image. | ||
770 | |||
771 | <<emphasis>filesystem-image</emphasis>> is the .ext3 filesystem image. | ||
772 | |||
773 | </literallayout> | ||
774 | </para> | ||
775 | |||
776 | <para> | ||
777 | Continuing with the example, the following two commands setup the emulation | ||
778 | environment and launch QEMU. | ||
779 | This example assumes the root filesystem (<filename>.ext3</filename> file) and | ||
780 | the pre-built kernel image file both reside in your home directory. | ||
781 | The kernel and filesystem are for a 32-bit target architecture. | ||
782 | <literallayout class='monospaced'> | ||
783 | $ cd $HOME | ||
784 | $ source &YOCTO_ADTPATH_DIR;/environment-setup-i586-poky-linux | ||
785 | $ runqemu qemux86 bzImage-qemux86.bin \ | ||
786 | core-image-sato-qemux86.ext3 | ||
787 | </literallayout> | ||
788 | </para> | ||
789 | |||
790 | <para> | ||
791 | The environment in which QEMU launches varies depending on the filesystem image and on the | ||
792 | target architecture. | ||
793 | For example, if you source the environment for the ARM target | ||
794 | architecture and then boot the minimal QEMU image, the emulator comes up in a new | ||
795 | shell in command-line mode. | ||
796 | However, if you boot the SDK image, QEMU comes up with a GUI. | ||
797 | <note>Booting the PPC image results in QEMU launching in the same shell in | ||
798 | command-line mode.</note> | ||
799 | </para> | ||
800 | </section> | ||
801 | </section> | ||
802 | </section> | ||
803 | |||
804 | <section id='super-user'> | ||
805 | <title>Super User | ||
806 | </title> | ||
807 | |||
808 | <para> | ||
809 | This section | ||
810 | <footnote> | ||
811 | <para> | ||
812 | Kudos and thanks to Robert P. J. Day of | ||
813 | <ulink url='http://www.crashcourse.ca'>CrashCourse</ulink> for providing the basis | ||
814 | for this "expert" section with information from one of his | ||
815 | <ulink url='http://www.crashcourse.ca/wiki/index.php/Yocto_Project_Quick_Start'>wiki</ulink> | ||
816 | pages. | ||
817 | </para> | ||
818 | </footnote> | ||
819 | gives you a minimal description of how to use the Yocto Project to build | ||
820 | images for Beaglebone hardware starting from scratch. | ||
821 | The steps were performed on a 64-bit Ubuntu 12.04 system that | ||
822 | has four cores. | ||
823 | </para> | ||
824 | |||
825 | <section id='getting-yocto'> | ||
826 | <title>Getting the Yocto Project</title> | ||
827 | |||
828 | <para> | ||
829 | Set up your | ||
830 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> | ||
831 | by using Git to clone the <filename>poky</filename> | ||
832 | repository and then check out the release branch: | ||
833 | <literallayout class='monospaced'> | ||
834 | $ cd ~ | ||
835 | $ git clone git://git.yoctoproject.org/poky | ||
836 | $ cd poky | ||
837 | $ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME; | ||
838 | </literallayout> | ||
839 | </para> | ||
840 | </section> | ||
841 | |||
842 | <section id='setting-up-your-host'> | ||
843 | <title>Setting Up Your Host</title> | ||
844 | |||
845 | <para> | ||
846 | You need some packages for everything to work. | ||
847 | Rather than duplicate them here, look at the | ||
848 | "<link linkend='packages'>The Packages</link>" | ||
849 | section earlier in this quick start. | ||
850 | </para> | ||
851 | </section> | ||
852 | |||
853 | <section id='initializing-the-build-environment'> | ||
854 | <title>Initializing the Build Environment</title> | ||
855 | |||
856 | <para> | ||
857 | From the root directory of your | ||
858 | <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>, | ||
859 | initialize your environment and provide a meaningful | ||
860 | <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> | ||
861 | name: | ||
862 | <literallayout class='monospaced'> | ||
863 | $ source &OE_INIT_FILE; mybuilds | ||
864 | </literallayout> | ||
865 | At this point, the <filename>mybuilds</filename> directory has | ||
866 | been created for you and it is now your current working directory. | ||
867 | If you do not provide your own directory name, | ||
868 | it defaults to <filename>build</filename>, | ||
869 | which is inside the Source Directory. | ||
870 | </para> | ||
871 | </section> | ||
872 | |||
873 | <section id='configuring-the-local.conf-file'> | ||
874 | <title>Configuring the local.conf File</title> | ||
875 | |||
876 | <para> | ||
877 | Initializing the build environment creates a | ||
878 | <filename>conf/local.conf</filename> configuration file | ||
879 | in the Build Directory. | ||
880 | You need to manually edit this file to specify the machine you | ||
881 | are building and to optimize your build time. | ||
882 | Here are the minimal changes to make: | ||
883 | <literallayout class='monospaced'> | ||
884 | BB_NUMBER_THREADS = "8" | ||
885 | PARALLEL_MAKE = "-j 8" | ||
886 | MACHINE ?= "beaglebone" | ||
887 | </literallayout> | ||
888 | Briefly, set | ||
889 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></ulink> | ||
890 | and | ||
891 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></ulink> to | ||
892 | twice your host processor's number of cores. | ||
893 | </para> | ||
894 | |||
895 | <para> | ||
896 | A good deal that goes into a Yocto Project build is simply | ||
897 | downloading all of the source tarballs. | ||
898 | Steps exist that can help you be more efficient with gathering | ||
899 | source files. | ||
900 | For example, you can set up local mirrors that hold your | ||
901 | source tarballs or you can pre-fetch all your source without | ||
902 | initiating a build until later. | ||
903 | For more information, see the | ||
904 | "<ulink url='&YOCTO_DOCS_DEV_URL;#working-with-source-files'>Working with Source Files</ulink>" | ||
905 | section in the Yocto Project Development Manual. | ||
906 | </para> | ||
907 | </section> | ||
908 | |||
909 | <section id='building-the-image'> | ||
910 | <title>Building the Image</title> | ||
911 | |||
912 | <para> | ||
913 | At this point, you need to select an image to build for the | ||
914 | Beaglebone hardware. | ||
915 | If this is your first build using the Yocto Project, you should try | ||
916 | the smallest and simplest image: | ||
917 | <literallayout class='monospaced'> | ||
918 | $ bitbake core-image-minimal | ||
919 | </literallayout> | ||
920 | Now you just wait for the build to finish. | ||
921 | </para> | ||
922 | |||
923 | <para> | ||
924 | By default, BitBake aborts when it encounters an error during | ||
925 | the build. | ||
926 | If you want to make sure the build continues even when BitBake | ||
927 | encounters an error, use this variation: | ||
928 | <literallayout class='monospaced'> | ||
929 | $ bitbake -k core-image-minimal | ||
930 | </literallayout> | ||
931 | </para> | ||
932 | |||
933 | <para> | ||
934 | Once you have your image, you can take steps to load and boot it on | ||
935 | the target hardware. | ||
936 | </para> | ||
937 | |||
938 | <para> | ||
939 | You can learn about BitBake in general by reading the | ||
940 | <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>. | ||
941 | </para> | ||
942 | </section> | ||
943 | </section> | ||
944 | |||
945 | </article> | ||
946 | <!-- | ||
947 | vim: expandtab tw=80 ts=4 | ||
948 | --> | ||