1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
|
\subsection{Workflow}
\begin{frame}[fragile]
\includegraphics[width=\textwidth]{images/yp-how-it-works-new-diagram.png}
\end{frame}
\begin{frame}[fragile]
\frametitle{Retrieve Poky}
\begin{verbatim}
$ git clone -b yocto-2.6.1 https://git.yoctoproject.org/git/poky
$ cd poky
$ git checkout -b thud-schulung
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{Prepare Environment}
\begin{itemize}
\item BitBake is typically not installed into regular search paths
\item the environment of the bash shell is modified to find the commands
\item non-bash shells are not supported (!)
\end{itemize}
\begin{verbatim}
$ . ./oe-init-buildenv <builddir>
\end{verbatim}
\begin{itemize}
\item is used to modify the environment and change the current working directory to <builddir>
\end{itemize}
\end{frame}
\subsection{Structure}
\begin{frame}
\frametitle{Classes}
\begin{itemize}
\item denoted by the .bbclass extension
\item base.bbclass is automatically included by all other classes and recipes
\item common tasks and their execution order is defined in base.bbclass
\item tasks can be added, overridden, extended, or used by other classes
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Recipes}
\begin{itemize}
\item denoted by the .bb extension
\item a recipe inherits classes and populates them with data
\item BitBake is used to execute the tasks defined in a recipe
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Layers}
\begin{itemize}
\item a directory containing recipes, configs, and classes
\item used to isolate different types of customization (e.g. own layer for machine specific customization, one for own applications, etc.)
\item extend, add, replace or modify recipes
\item add or replace class files
\item 'conf/layer.conf' of the layer directory is used to configure that layer
\item layers are added and ordered via BBLAYERS variable in 'conf/bblayers.conf' of build directory
\item 'bitbake-layers show-layers' is used to show used layers
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Layers \#2}
Layers Should be Grouped by Functionality
\begin{itemize}
\item custom toolchains (compilers, debuggers, profiling tools)
\item distribution specifications (e.g. meta-poky)
\item BSP/machine settings (e.g. meta-yocto-bsp)
\item functional areas (selinux, networking, etc)
\item project specific changes
\item each layer is typically organized as its own git repository
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Poky Directory Layout}
\begin{verbatim}
poky
├── bitbake
├── documentation
├── meta
├── meta-poky
├── meta-selftest
├── meta-skeleton
├── meta-yocto-bsp
└── scripts
\end{verbatim}
\end{frame}
\subsection{Variable Assignments}
\begin{frame}
\frametitle{Available Operators}
\begin{itemize}
\item =
\item ?=
\item ??=
\item :=
\item += / =+
\item .= / =.
\item \_prepend / \_append
\item \_remove
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Assignment Debugging}
\begin{verbatim}
$ echo 'FOO ??= "123"' >> conf/local.conf
$ echo 'FOO ?= "456"' >> conf/local.conf
$ bitbake -e | grep FOO
# $FOO [2 operations]
FOO="456"
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{Variable Assignment with =}
\begin{verbatim}
VAR = "value"
\end{verbatim}
\begin{itemize}
\item normal assignment
\item values must be surrounded by double quotes
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Variable Usage}
\begin{verbatim}
VAR2 = "${VAR1}"
\end{verbatim}
\begin{itemize}
\item set VAR2 to the value of VAR1
\item the curly brackets are required (this is not shell!)
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Early Default Assignment with ?=}
\begin{verbatim}
VAR ?= "1"
VAR ?= "2"
\end{verbatim}
\begin{itemize}
\item VAR is set to "1" in this example
\item if there are multiple assignments using ?= the first one is used
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Late Default Assignment with ??=}
\begin{verbatim}
VAR ??= "1"
VAR ??= "2"
\end{verbatim}
\begin{itemize}
\item VAR is set to "2" in this example
\item if there are multiple assignments using ??= the last one is used
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Assignment Priorities \#1}
\begin{verbatim}
VAR1 ??= "12"
VAR1 ?= "34"
VAR2 ?= "12"
VAR2 ??= "34"
\end{verbatim}
\begin{itemize}
\item VAR1 contains "34"
\item VAR2 contains "12"
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Assignment Priorities \#2}
\begin{verbatim}
VAR ?= "12"
VAR ??= "34"
VAR = "56"
VAR ?= "78"
VAR ??= "90"
\end{verbatim}
\begin{itemize}
\item VAR contains "56"
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Immediate Variable Expansion with :=}
\begin{verbatim}
VAR1 = "11"
VAR2 = "the value of VAR1 is ${VAR1}"
VAR1 = "22"
VAR3 := "the value of VAR1 is ${VAR1}"
VAR1 = "33"
echo "${VAR1}, ${VAR2}, ${VAR3}"
\end{verbatim}
\begin{itemize}
\item output: 33, the value of VAR1 is 33, the value of var1 is 22
\item the contents of VAR1 and VAR2 are expanded on use
\item the content of VAR3 is recursively expanded immediately on assignment
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Append (+=) or Prepend (=+) a Variable}
\begin{verbatim}
VAR1 = "12"
VAR1 += "34"
VAR2 = "56"
VAR2 =+ "78"
\end{verbatim}
\begin{itemize}
\item VAR1 contains "12 34"
\item VAR2 contains "78 56"
\item spaces are inserted between the appended values
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Append (.=) or Prepend (=.) a Variable}
\begin{verbatim}
VAR1 = "12"
VAR1 .= "34"
VAR2 = "56"
VAR2 =. "78"
\end{verbatim}
\begin{itemize}
\item VAR1 contains "1234"
\item VAR2 contains "7856"
\item no spaces are inserted between the appended values
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Late Append or Prepend a Variable}
\begin{verbatim}
VAR = "34"
VAR_append = "56"
VAR_prepend = "12"
VAR .= "78"
\end{verbatim}
\begin{itemize}
\item VAR contains "12347856"
\item no spaces are inserted between the appended values
\item when specified multiple times, each instance is applied
\item the +=/=+ operators can be used to insert spaces before or after the appended value
\item special operators that are applied after all previous operators (including early and late default assignments!)
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Late Value Removal from a Variable}
\begin{verbatim}
VAR = "34"
VAR_remove = "78"
VAR_append += "56"
VAR_append += "78"
\end{verbatim}
\begin{itemize}
\item VAR contains "34 56"
\item specifies a list of values to remove
\item when specified multiple times, each instance is applied
\item whitespace in the variable contents is required to match values
\item special operator that is applied at the very end (even after \_prepend and \_append operators!)
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Overrides}
\begin{verbatim}
OVERRIDES = "string1:string2"
VAR = "foo"
VAR_string1 = "bar"
\end{verbatim}
\begin{itemize}
\item if string1 is listed in OVERRIDES, use "bar" for value of VAR, otherwise use "foo"
\item overrides apply to all operators
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Variable Flags}
\begin{verbatim}
VAR[some_flag]="foo"
\end{verbatim}
\begin{itemize}
\item associate a subsidiary flag value to a variable
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Key Expansion}
Key expansion happens when the BitBake datastore is finalized just before BitBake expands overrides.
\begin{verbatim}
A${B} = "X"
B = "2"
A2 = "Y"
\end{verbatim}
\begin{itemize}
\item A2 contains "X" (and a warning is generated)
\item key expansion values can only be debugged with 'bitbake -e' when they are used by the recipe
\end{itemize}
\end{frame}
\subsection{Recipes}
\begin{frame}
\frametitle{Typical Steps (Tasks)}
\begin{enumerate}
\item fetch source archives
\item unpack sources
\item patch sources
\item configure sources
\item compile sources
\item install binaries
\item package binaries
\end{enumerate}
\end{frame}
\begin{frame}[fragile]
\frametitle{Skeleton}
\begin{verbatim}
SUMMARY = "short description of the package (1 line)"
DESCRIPTION = "a long version of the description of the package"
HOMEPAGE = "http://url-of-the-os-project.org"
LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://COPYING;md5=xxxx \
file://licfile1.txt;beginline=5;endline=29;md5=yyyy \
file://licfile2.txt;endline=50;md5=zzzz"
SRC_URI = "file://mysw-1.0.tbz"
SRC_URI[md5sum] = "xxx"
SRC_URI[sha256sum] = "yyy"
S = "${WORKDIR}/${PN}-${PV}"
inherit autotools
\end{verbatim}
\end{frame}
\begin{frame}
\frametitle{Syntax}
A recipe typically consists of a human readable description of the project,
references to the open-source project, and:
\begin{description}
\item[LIC*] reference to the used licenses
\item[SRC\_URI] list of source files (local or remote)
\item[PV] package-version (retrived from filename: name\_version.bb)
\item[PN] package-name (retrived from filename: name\_version.bb)
\item[P] ${PN}-${PV}
\item[S] the location where the unpacked recipe source code resides
\item[inherit] use a class (or multiple classes)
\end{description}
\end{frame}
\begin{frame}
\frametitle{The LICENSE Variable}
A list of source licenses for the recipe:
\begin{itemize}
\item do not use spaces within individual license names
\item use spaces between license names
\item separate license names using | (pipe) when there is a choice between
licenses
\item separate license names using \& (and) if parts of the code are licensed
with different licenses
\item for standard licenses, use the names of the files in
meta/files/common-licenses/ or the SPDXLICENSEMAP
\footnote{Applications commonly use license names from the SPDX counterparts found in
meta/files/common-licenses/. For the default SPDXLICENSEMAP mappings, see the
meta/conf/licenses.conf file.}
flag names defined in meta/conf/licenses.conf
\item use "CLOSED" for closed source software
(LIC\_FILES\_CHKSUM is not needed to be defined then)
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{The LIC\_FILE\_CHKSUM Variable}
Checksums of the license text in the recipe source code.
\vspace{2em}
This variable tracks changes in license text of the source code files.
If the license text is changed, it will trigger a build failure,
which gives the developer an opportunity to review any license change.
\end{frame}
\begin{frame}[fragile]
\frametitle{The SRC\_URI Variable}
\begin{verbatim}
SRC_URI = "<protocol>://<host>/<path>;<OptionA=xxx>;<OptionB=xxx>"
\end{verbatim}
Multiple urls can be set in a SRC\_URI variable:
\begin{verbatim}
SRC_URI = "<url1>;name=url1 <url2>;name=url2"
\end{verbatim}
For each url an MD5 and SHA256 checksum needs to be added:
\begin{verbatim}
SRC_URI[url1.md5sum] = xxx
SRC_URI[url1.sha256sum] = yyy
SRC_URI[url2.md5sum] = zzz
SRC_URI[url2.sha256sum] = xyz
\end{verbatim}
To get these checksums, you can not specify them and run a build and copy them from
the error message. (For some cases, such as license parts, this may be the easiest way to get the checksums.)
\end{frame}
\begin{frame}[fragile]
\frametitle{Local SRC\_URI Files (file://)}
The path is relative to the FILESPATH variable. To modify the FILESPATH use
FILESEXTRAPATHS.
\vspace{2em}
Additional files are searched in subdirectories of the directory in which the
recipe file (.bb) or append file (.bbappend) resides.
To find out which paths can be used, it is best practice to use
\begin{verbatim}
$ bitbake -e <recipe-name> | grep '^FILESPATH='
\end{verbatim}
\end{frame}
\begin{frame}
\frametitle{Remote SRC\_URI Files}
\begin{description}
\item[bzr://]Bazaar revision control repository
\item[ccrc://]ClearCase repository
\item[cvs://]CVS revision control repository
\item[ftp://]Internet using FTP
\item[git://]Git revision control repository
\item[hg://]Mercurial (hg) revision control repository
\item[http://]Internet using HTTP
\item[https://]Internet using HTTPS
\item[osc://]OSC (OpenSUSE Build service) revision control repository
\item[p4://]Perforce (p4) revision control repository
\item[ssh://]Internet using SSH
\item[svn://]Subversion (svn) revision control repository
\end{description}
\end{frame}
\begin{frame}
\frametitle{SRC\_URI Patch Options}
\begin{itemize}
\item patches are applied in the order they appear in SRC\_URI
\item quilt is used to apply the patches
\end{itemize}
\begin{description}
\item[apply=no] apply patch or not; default is yes
\item[striplevel=0] striplevel to use when applying a patch; default is 1
\item[patchdir=\$\{S\}/foo] directory in which the patch should be applied;
default is \$\{S\}
\end{description}
\end{frame}
\begin{frame}
\frametitle{SRC\_URI Patch Options \#2}
\begin{description}
\item[mindate=] apply patch only if SRCDATE
\footnote{The date of the source code used to build the package.
This variable applies only if the source was fetched from a
Source Code Manager (SCM)} is equal to or greater than the specified date
\item[maxdate=] apply patch only if SRCDATE is not later than the specified date
\item[minrev=] apply the patch only if SRCREV
\footnote{The revision of the source code used to build the package.
This variable applies to Subversion, Git, Mercurial and Bazaar only}
is equal to or greater than the specified revision
\item[maxrev=] apply patch only if SRCREV is not later than the specified revision
\item[rev=] apply patch only if SRCREV is equal to the specified revision
\item[notrev=] apply patch only if SRCREV is not equal to the specified revision
\end{description}
\end{frame}
\begin{frame}
\frametitle{SRC\_URI Options}
\begin{description}
\item[unpack=no] controls if an archive is unpacked; default is yes
\item[subdir=bla] places the file (or extracts its contents) into the
specified subdirectory of WORKDIR
\footnote{${TMPDIR}/work/${MULTIMACH\_TARGET\_SYS}/${PN}/${EXTENDPE}${PV}-${PR};
e.g. /home/devel/poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0}
\item[name=mydl] name to be used for association with SRC\_URI checksums when
you have more than one file specified in SRC\_URI
\item[downloadfilename=my.tar.gz] the filename used when storing the downloaded file
\end{description}
\end{frame}
\begin{frame}
\frametitle{Inheriting Classes}
'inherit' is specified to use the functionality defined in a .bblcass file. Popular
predefined classes are:
\begin{itemize}
\item autotools
\item cmake
\item cpan
\item distutils / setuptools
\item kernel / module
\item mime
\item pkgconfig
\item scons
\item systemd
\item vala
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Optionally Including Files}
'include' is specified to include a complete file.
\begin{itemize}
\item include example-defs.inc
\item includes the first file it can find within BBPATH and THISDIR
\item no error or warning if the file is not found
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Including Required Files}
'require' is the same as include, but returns an error, if the file is not found.
\begin{itemize}
\item includes the first file it can find within BBPATH and THISDIR
\end{itemize}
\end{frame}
%\subsection{Classes}
%\begin{frame}
%\frametitle{basics}
%\begin{itemize}
%\item python can be used to write functions
%\item e.g. write your own image generation class
%\end{itemize}
%\end{frame}
\begin{frame}[fragile]
\frametitle{Tasks}
\begin{itemize}
\item are defined and ordered in classes
\item can be overridden or extended by recipes
\item these are functions that are written in shell or python
\end{itemize}
\begin{verbatim}
do_func1() {
echo "my shell task"
}
python do_func2() {
print("my python task")
}
\end{verbatim}
\end{frame}
%\begin{frame}
%\frametitle{download \& patch}
%\begin{description}
%\item [do\_checkuri] validates the SRC\_URI value
%\item [do\_checkuriall] validates the SRC\_URI value for all recipes required
% to build a target"
%\item [do\_fetch] fetches the source code
%\item [do\_fetchall] fetches all remote sources required to build a target
%\item [do\_unpack] unpacks the source code into a working directory
%\item [do\_patch] locates patch files and applies them to the source code
%\end{description}
%end{frame}
%\begin{frame}
%\frametitle{configure \& compile}
%\begin{description}
%\item [do\_configure] configures the source by enabling and disabling any
% build-time and configuration options for the software being built
%\item [do\_configure\_ptest\_base] configures the runtime test suite included
% in the software being built
%\item [do\_compile] compiles the source in the compilation directory
%\item [do\_install] copies files from the compilation directory to a holding
% area
%\item [do\_populate\_sysroot] copies a subset of files installed by
% do\_install into the sysroot in order to make them available to other
% recipes
%\end{description}
%\end{frame}
%\begin{frame}
%\frametitle{packaging}
%\begin{description}
%\item [do\_packagedata] creates package metadata used by the build system to
% generate the final packages
%\item [do\_package] analyzes the content of the holding area and splits it
% into subsets based on available packages and files
%\item [do\_package\_write] creates the actual packages and places them in the
% Package Feed area
%\item [do\_package\_write\_deb] creates the actual DEB packages and places
% them in the Package Feed area
%\item [do\_package\_write\_ipk] creates the actual IPK packages and places
% them in the Package Feed area
%\item [do\_package\_write\_rpm] creates the actual RPM packages and places
% them in the Package Feed area
%\item [do\_package\_write\_tar] creates tar archives for packages and places
% them in the Package Feed area
%\item [do\_package\_index] creates or updates the index in the Package Feed
% area
%\end{description}
%\end{frame}
%\begin{frame}
%\frametitle{deploy}
%\begin{description}
%\item [do\_rootfs] creates the root filesystem (file and directory structure)
% for an image
%\item [do\_vmdkimg] creates a .vmdk image for use with VMware and compatible
% virtual machine hosts"
%\item [do\_deploy] writes deployable output files to the deploy directory
%\item [do\_populate\_sdk] creates the file and directory structure for an
% installable SDK
%\end{description}
%\end{frame}
%\begin{frame}
%\frametitle{cleanup}
%\begin{description}
%\item [do\_clean] removes all output files for a target
%\item [do\_cleanall] removes all output files, shared state cache, and
% downloaded source files for a target
%\item [do\_cleansstate] removes all output files and shared state cache for a
% target
%\item [do\_rm\_work] removes work files after the build system has finished
% with them
%\item [do\_rm\_work\_all] top-level task for removing work files after the
% build system has finished with them
%\end{description}
%\end{frame}
%\begin{frame}
%\frametitle{kernel}
%\begin{description}
%\item [do\_kernel\_checkout] checks out source/meta branches for a linux-yocto
% style kernel
%\item [do\_validate\_branches] ensures that the source/meta branches are on
% the locations specified by their SRCREV values for a linux-yocto style
% kernel"
%\item [do\_kernel\_configme] assembles the kernel configuration for a
% linux-yocto style kernel
%\item [do\_menuconfig] runs 'make menuconfig' for the kernel
%\item [do\_diffconfig] compares the old and new config files after running
% do\_menuconfig for the kernel
%\item [do\_savedefconfig] creates a minimal Linux kernel configuration file
%\item [do\_kernel\_configcheck] validates the kernel configuration for a
% linux-yocto style kernel
%\item [do\_sizecheck] checks the size of the kernel image against
% KERNEL\_IMAGE\_MAXSIZE (if set)
%\end{description}
%\end{frame}
%\begin{frame}
%\frametitle{kernel}
%\begin{description}
%\item [do\_compile\_kernelmodules] compiles loadable modules for the Linux
% kernel
%\item [do\_strip] strips unneeded sections out of the Linux kernel image
%\item [do\_kernel\_link\_vmlinux] creates a symbolic link in arch/\$arch/boot
% for vmlinux kernel images
%\item [do\_bundle\_initramfs] combines an initial ramdisk image and kernel
% together to form a single image
%\end{description}
%\end{frame}
%\begin{frame}
%\frametitle{licenses}
%\begin{description}
%\item [do\_populate\_lic] writes license information for the recipe that is
% collected later when the image is constructed
%\item [do\_spdx] a build stage that takes the source code and scans it on a
% remote FOSSOLOGY server in order to produce an SPDX document
%\end{description}
%\end{frame}
%\begin{frame}
%\frametitle{special stuff}
%\begin{description}
%\item [do\_uboot\_mkimage] creates a uImage file from the kernel for the
% U-Boot bootloader
%\item [do\_generate\_qt\_config\_file] writes a qt.conf file for building a
% Qt-based application
%\item [do\_devshell] starts a shell with the environment set up for
% development/debugging
%\item [do\_listtasks] lists all defined tasks for a target
%\end{description}
%\end{frame}
\begin{frame}[fragile]
\frametitle{Extending Tasks}
Existing tasks can be modified directly with \_prepend/\_append
\footnote{The language (shell or python) must match the task function.} or
using prefuncs/postfuncs variable flags.
\begin{verbatim}
do_patch_append() {
print("done patching ${PN}")
}
do_configure_append() {
echo "done configuring ${PN}"
}
my_compile_success() {
echo "done compiling ${PN}"
}
do_compile[postfuncs] += "my_compile_success"
\end{verbatim}
\end{frame}
\subsection{Extending Recipes}
\begin{frame}
\frametitle{Append Files}
\begin{itemize}
\item append files are typically used to modify or extend the functionality
of a base recipe
\item anything can be modified (e.g. variables, functions, tasks)
\item it is recommended by the Yocto project to use append files instead
of copying and modyfiing a recipe in an own layer
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Append File Naming}
An append file must be named after the base package:
\begin{verbatim}
<base-pn>_<base-pv>.bbappend
\end{verbatim}
A \% can be used as a wildcard to match any part of the version (e.g. bc\_1.\%.bbappend).
\end{frame}
\subsection{Machines}
\begin{frame}
\frametitle{The Machine Config}
A machine config is used to describe a board.
\begin{itemize}
\item machine configs are stored in the layers: conf/machine/
\item settings may be split into different include files
\item e.g. one include for the CPU that is used by the SoC include file,
which is used by the machine .conf file
\item the include files can be stored in different layers
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Hardware Settings}
\begin{description}
\item[SOC\_FAMILY] groups together machines based upon the same family of SOC
(System On Chip)
\item [MACHINEOVERRIDES] lists overrides specific to the current machine.
By default, this list includes the value of MACHINE. This can be used in
recipes; e.g. MACHINEOVERRIDES =. "mymachine" and in the recipe
SRC\_URI\_append\_mymachine = "file://mymachine-quirk.patch"
\item [MACHINE\_FEATURES] list of hardware features the MACHINE supports
\footnote{acpi, alsa, bluetooth, pci, pcmcia, serial, wifi, ...}
\item [MACHINE\_EXTRA\_RRECOMMENDS] list of machine-specific packages to
install as part of the image being built that are not essential for booting
the machine. The image being built has no build dependencies on the packages
in this list.
\item [SERIAL\_CONSOLE] speed and device for the serial port used to attach
the serial console. This variable is given to the kernel as the 'console'
parameter. After booting occurs, getty is started on that port so remote
login is possible.
\end{description}
\end{frame}
\begin{frame}
\frametitle{Compiler Settings}
\begin{description}
\item [DEFAULTTUNE] e.g. armv6hf or cortexa8hf-neon, x86-64, \dots
\item [TUNE\_FEATURES] e.g. "armv7a vfp neon"
\item [TUNEVALID] Descriptions, stored as flags, of valid tuning features
\item [TUNECONFLICTS] list of conflicting features for a given feature
\end{description}
\end{frame}
\begin{frame}
\frametitle{U-Boot \& Kernel Settings}
\begin{description}
\item [UBOOT\_MACHINE] value passed on the make command line when building a
U-Boot image
\item [UBOOT\_MAKE\_TARGET] target called in the Makefile
\item [UBOOT\_ENTRYPOINT] entry point for the U-Boot image
\item [PREFERRED\_PROVIDER\_virtual/kernel] default kernel
\item [KERNEL\_DEVICETREE] default devicetree
\item [KERNEL\_IMAGETYPE] type of kernel to build for a device,
defaults to 'zImage'
\end{description}
\end{frame}
\begin{frame}
\frametitle{Software Settings}
\begin{description}
\item [PREFERRED\_VERSION\_xserver-xorg] compatible xserver version
\item [PREFERRED\_PROVIDER\_virtual/kernel] recommended kernel
\item [IMAGE\_FSTYPES] formats for the rootfs, e.g. "ext3 tar.bz2"
\item [IMAGE\_CLASSES] list of classes that all images should inherit, default
is image\_types, e.g. to hook in own image generation code
\end{description}
\end{frame}
|