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
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
|
\input{configpres}
\title{YOCTO - Basics}
\maketitle
\begin{frame}
\frametitle{Agenda}
\begin{itemize}
\item Workflow
\item Variable asssignments
\item Recipes
\item Append files
\item Classes
\item Tasks
\item Machines
\item Configuration
\item Images
\item ADT
\end{itemize}
\end{frame}
\subsection{Workflow}
\begin{frame}[fragile]
\includegraphics[width=\textwidth]{images/yocto-workflow}
\end{frame}
\begin{frame}
\frametitle{classes}
\begin{itemize}
\item denoted by the .bbclass extension
\pause
\item base.bbclass is automatically included by all other classes and recipes.
\pause
\item common tasks and there execution order is defined in base.bbclass
\pause
\item tasks can be added, overridden, extended or used by other classes
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{recipes}
\begin{itemize}
\item a .bb file inherits classes and populates them with data
\pause
\item bitbake is used to schedule the tasks defined in a recipe
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{layers}
\begin{itemize}
\item a folder containing recipes, configs and classes
\pause
\item used to isolate different types of customizations from each other
\pause
\item e.g. own layer for machine specific stuff, one for own applications
\pause
\item extend, add, replace or modify recipes
\pause
\item add or replace class files
\pause
\item 'conf/layer.conf' is used to define the recipe location(s)
\pause
\item are added and ordered via BBLAYERS variable in build/conf/bblayers.conf
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{layers \#2}
layers should be grouped by functionality
\begin{itemize}
\item custom toolchains (compilers, debuggers, profiling tools)
\pause
\item distribution specifications (i.e. meta-yocto)
\pause
\item BSP/machine settings (i.e. meta-yocto-bsp)
\pause
\item functional areas (selinux, networking, etc)
\pause
\item project specific changes
\pause
\item a layer is typically organized as a git repository
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{directory layout}
\begin{verbatim}
poky
├── bitbake
├── documentation
├── meta
├── meta-selftest
├── meta-skeleton
├── meta-yocto
├── meta-yocto-bsp
└── scripts
\end{verbatim}
\end{frame}
\subsection{Variable assignments}
\begin{frame}
\frametitle{available operators}
\begin{itemize}
\item =
\item ?=
\item ??=
\item :=
\item += / =+
\item .= / =.
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{variable assignment with =}
\begin{verbatim}
VAR = "value"
\end{verbatim}
\pause
\begin{itemize}
\item normal assignment
\item values need to be surrounded by double quotes
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{early default assignment with ?=}
\begin{verbatim}
VAR ?= "1"
VAR ?= "2"
\end{verbatim}
\pause
\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}
\pause
\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}
VAR_A ??= "12"
VAR_A ?= "34"
VAR_B ?= "12"
VAR_B ??= "34"
\end{verbatim}
\pause
\begin{itemize}
\item VAR\_A contains "34"
\item VAR\_B contains "12"
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{assignment priorities \#2}
\begin{verbatim}
VAR ?= "12"
VAR ??= "34"
VAR = "56"
VAR ?= "78"
VAR ??= "78"
\end{verbatim}
\pause
\begin{itemize}
\item VAR contains "56"
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{immediate variable expansion with :=}
\begin{verbatim}
VAR_A = "11"
VAR_B = "B:${VAR_A}"
VAR_A = "22"
VAR_C := "C:${VAR_A}"
VAR_A = "33"
echo ${VAR_A} ${VAR_B} ${VAR_C}
\end{verbatim}
\pause
\begin{itemize}
\item 33 B:33 C:22
\item the content of VAR\_C is expanded immediately on assignment
\item the content of VAR\_B is expanded on use
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{append (+=) or prepend (=+) a variable}
\begin{verbatim}
VAR_A = "12"
VAR_A += "34"
VAR_B = "56"
VAR_B =+ "78"
\end{verbatim}
\pause
\begin{itemize}
\item VAR\_A contains "12 34"
\item VAR\_B contains "78 56"
\item there are spaces between the appended values
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{append (.=) or prepend (=.) a variable}
\begin{verbatim}
VAR_A = "12"
VAR_A .= "34"
VAR_B = "56"
VAR_B =. "78"
\end{verbatim}
\pause
\begin{itemize}
\item VAR\_A contains "1234"
\item VAR\_B contains "7856"
\item there are no spaces between the appended values
\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}
\subsection{Recipes}
\begin{frame}
\frametitle{typical progressing}
\begin{enumerate}
\item fetch source files
\pause
\item extract sources
\pause
\item patch sources
\pause
\item configure sources
\pause
\item compilation
\pause
\item packaging
\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 normaly consists of a human readable description of the project and
references to the open-source project and:
\pause
\begin{description}
\item[LIC*] reference to the used licenses
\pause
\item[SRC\_URI] list of source files (local or remote)
\pause
\item[PV] package-version (retrived from filename name\_version.bb)
\pause
\item[PN] package-name (retrived from filename name\_version.bb)
\pause
\item[P] ${PN}-${PV}
\pause
\item[S] The location in the Build Directory where unpacked recipe source code resides.
\pause
\item[inherit] use a class (or multiple classes)
\end{description}
\end{frame}
\begin{frame}
\frametitle{the LICENSE variable}
list of source licenses for the recipe:
\begin{itemize}
\item do not use spaces within individual license names
\pause
\item use spaces between license names
\pause
\item separate license names using | (pipe) when there is a choice between
licenses
\pause
\item separate license names using \& (AND) if parts of the code are licensed
with different licenses
\pause
\item for standard licenses, use the names of the files in
meta/files/common-licenses/ or the SPDXLICENSEMAP
\footnote{aps commonly used license names to their 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
\pause
\item use "CLOSED" for closed source software
(LIC\_FILES\_CHKSUM is not needed to be defined then)
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{LIC\_FILE\_CHKSUM variable}
Checksums of the license text in the recipe source code.
\pause
\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{SRC\_URI variable}
\begin{verbatim}
SRC_URI = "<protocol>://<host>/<path>;<OptionA=xxx>;<OptionB=xxx>"
\end{verbatim}
\pause
multiple urls can be set in a SRC\_URI variable:
\begin{verbatim}
SRC_URI = "<url1>;name=url1 <url2>;name=url2"
\end{verbatim}
\pause
for each url a 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}
\pause
To get these checksums don't specify them and run a build and copy them from
the error message. (Don't use md5sum or sha256sum on the commandline; they
produce a different checksum.)
\end{frame}
\begin{frame}
\frametitle{local SRC\_URI (file://)}
The path is relative to the FILESPATH variable. To modify the FILESPATH use
FILESEXTRAPATH.
\pause
\vspace{2em}
Additional files are searched in subdirectories of the directory in which the
recipe file (.bb) or append file (.bbappend) resides:
\begin{description}
\item[\${BPN}] base recipe name without any special suffix or version numbers.
\pause
\item[\${BP} - \${BPN}-\${PV}] base recipe name and version but without any special package name suffix.
\pause
\item[files] files within a directory, which is named files and is also alongside the recipe or append file.
\end{description}
\end{frame}
\begin{frame}
\frametitle{the BPN variable}
\begin{itemize}
\item bare name of the recipe
\pause
\item version of PN but without suffixes specified in SPECIAL\_PKGSUFFIX
(-common, -native, -cross)
\pause
\item version of PN but without prefixes specified in MLPREFIX (lib64-, lib32-)
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{remote SRC\_URI}
\begin{description}
\item[bzr://]Bazaar revision control repository
\pause
\item[git://]Git revision control repository
\pause
\item[osc://]OSC (OpenSUSE Build service) revision control repository
\pause
\item[ccrc://]ClearCase repository
\pause
\item[http://]Internet using http
\pause
\item[https://]Internet using https
\pause
\item[ftp://]Internet using ftp
\pause
\item[cvs://]CVS revision control repository
\pause
\item[hg://]Mercurial (hg) revision control repository
\pause
\item[p4://]Perforce (p4) revision control repository
\pause
\item[ssh://]secure shell
\pause
\item[svn://]Subversion (svn) revision control repository
\end{description}
\end{frame}
\begin{frame}
\frametitle{SRC\_URI patch options}
standard options
\begin{description}
\item[apply=no] apply patch or not; default is yes
\pause
\item[striplevel=0] striplevel to use when applying a patch; default is 1
\pause
\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}
specific options
\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 mindate
\pause
\item[maxdate] apply patch only if SRCDATE is not later than maxdate
\pause
\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 minrev
\item[maxrev] apply patch only if SRCREV is not later than maxrev
\pause
\item[rev] apply patch only if SRCREV is equal to rev
\pause
\item[notrev] apply patch only if SRCREV is not equal to rev
\end{description}
\end{frame}
\begin{frame}
\frametitle{SRC\_URI options}
\begin{description}
\item[unpack=no] controls if an archive is unpacked; default is yes
\pause
\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};
eg. 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
\pause
\item[downloadfilename=my.tar.gz] the filename used when storing the downloaded file
\end{description}
\end{frame}
\begin{frame}
\frametitle{inherit}
inherit is used to use the functionality defined in a .bblcass file. Popular
predefined classes are:
\begin{itemize}
\item allarch
\item archiver
\item autotools / autotools-brokensep
\item bin\_package
\item cmake
\item cpan
\item distutils / setuptools
\item kernel / module
\item mime
\item qmake / qmake2
\item qt4e / qt4x11
\item scons
\item systemd
\item u-boot
\item vala
\end{itemize}
\end{frame}
\subsection{Append files}
\begin{frame}
\frametitle{basics}
\begin{itemize}
\item are typically used to modify or extend the functionality of the base
recipe
\pause
\item it's recommended by the Yocto project to use bbappend files instead
of copying and modyfiing a recipe in an own layer
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{naming}
an append file must be named after the base package:
\begin{verbatim}
<base-pn>\_<base-pv>.bbappend
\end{verbatim}
\pause
<base-pv> can be replaced by \% to match all versions.
\end{frame}
\subsection{Classes}
\begin{frame}
\frametitle{basics}
\begin{itemize}
\item python can be used to write functions
\pause
\item there should be no need to write a own class
\end{itemize}
\end{frame}
\subsection{Tasks}
\begin{frame}
\frametitle{basics}
\begin{itemize}
\item are defined and ordered in classes
\item can be overriden by classes and recipes
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{download \& patch}
\begin{description}
\item [do\_checkuri] validates the SRC\_URI value
\pause
\item [do\_checkuriall] validates the SRC\_URI value for all recipes required
to build a target"
\pause
\item [do\_fetch] fetches the source code
\pause
\item [do\_fetchall] fetches all remote sources required to build a target
\pause
\item [do\_unpack] unpacks the source code into a working directory
\pause
\item [do\_patch] locates patch files and applies them to the source code
\end{description}
\end{frame}
\begin{frame}
\frametitle{configue \& compile}
\begin{description}
\item [do\_configure] configures the source by enabling and disabling any
build-time and configuration options for the software being built
\pause
\item [do\_configure\_ptest\_base] configures the runtime test suite included
in the software being built
\pause
\item [do\_compile] compiles the source in the compilation directory
\pause
\item [do\_install] copies files from the compilation directory to a holding
area
\pause
\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
\pause
\item [do\_package] analyzes the content of the holding area and splits it
into subsets based on available packages and files
\pause
\item [do\_package\_write] creates the actual packages and places them in the
Package Feed area
\pause
\item [do\_package\_write\_deb] creates the actual DEB packages and places
them in the Package Feed area
\pause
\item [do\_package\_write\_ipk] creates the actual IPK packages and places
them in the Package Feed area
\pause
\item [do\_package\_write\_rpm] creates the actual RPM packages and places
them in the Package Feed area
\pause
\item [do\_package\_write\_tar] creates tar archives for packages and places
them in the Package Feed area
\pause
\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
\pause
\item [do\_vmdkimg] creates a .vmdk image for use with VMware and compatible
virtual machine hosts"
\pause
\item [do\_deploy] writes deployable output files to the deploy directory
\pause
\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
\pause
\item [do\_cleanall] removes all output files, shared state cache, and
downloaded source files for a target
\pause
\item [do\_cleansstate] removes all output files and shared state cache for a
target
\pause
\item [do\_rm\_work] removes work files after the build system has finished
with them
\pause
\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
\pause
\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"
\pause
\item [do\_kernel\_configme] assembles the kernel configuration for a
linux-yocto style kernel
\pause
\item [do\_menuconfig] runs 'make menuconfig' for the kernel
\pause
\item [do\_diffconfig] compares the old and new config files after running
do\_menuconfig for the kernel
\pause
\item [do\_savedefconfig] creates a minimal Linux kernel configuration file
\pause
\item [do\_kernel\_configcheck] validates the kernel configuration for a
linux-yocto style kernel
\pause
\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
\pause
\item [do\_strip] strips unneeded sections out of the Linux kernel image
\pause
\item [do\_kernel\_link\_vmlinux] creates a symbolic link in arch/\$arch/boot
for vmlinux kernel images
\pause
\item [do\_bundle\_initramfs] combines an initial ramdisk image and kernel
together to form a single image
\end{description}
\end{frame}
\begin{frame}
\frametitle{tests}
\begin{description}
\item [do\_compile\_ptest\_base] compiles the runtime test suite included in
the software being built
\pause
\item [do\_install\_ptest\_base] copies the runtime test suite files from the
compilation directory to a holding area
\pause
\item [do\_testimage] boots an image and performs runtime tests within the
image
\pause
\item [do\_testimage\_auto] boots an image and performs runtime tests within
the image immediately after it has been built
\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
\pause
\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
\pause
\item [do\_generate\_qt\_config\_file] writes a qt.conf file for building a
Qt-based application
\pause
\item [do\_devshell] starts a shell with the environment set up for
development/debugging
\pause
\item [do\_listtasks] lists all defined tasks for a target
\end{description}
\end{frame}
\subsection{Machines}
\begin{frame}
\frametitle{basics}
a machine config is used to describe a board
\begin{itemize}
\item machine configs are stored in the layers: conf/machine/*
\pause
\item settings can be splitted in different include *.inc files
\pause
\item e.g. one include for CPU that is used by the SoC inc file,
that is used by the Board .conf file
\pause
\item the include files can be stored in different layers
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{u-boot \& kernel}
\begin{description}
\item [UBOOT\_MACHINE] value passed on the make command line when building a
U-Boot image
\pause
\item [UBOOT\_MAKE\_TARGET] target called in the Makefile
\pause
\item [UBOOT\_ENTRYPOINT] entry point for the U-Boot image
\pause
\item [PREFERRED\_PROVIDER\_virtual/kernel] default kernel
\pause
\item [KERNEL\_DEVICETREE] default devicetree
\pause
\item [KERNEL\_IMAGETYPE] type of kernel to build for a device,
defaults to 'zImage'
\end{description}
\end{frame}
\begin{frame}
\frametitle{hardware}
\begin{description}
\item[SOC\_FAMILY] groups together machines based upon the same family of SOC
(System On Chip)
\pause
\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"
\pause
\item [MACHINE\_FEATURES] list of hardware features the MACHINE supports
\footnote{acpi, alsa, apm, bluetooth, ext2, irda, keyboard, pci, pcmcia,
screen, serial, touchscreen, usbgadget, usbhost, wifi}
\pause
\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.
\pause
\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
\pause
\item [TUNE\_FEATURES] e.g. "armv7a vfp neon"
\pause
\item [TUNEVALID] Descriptions, stored as flags, of valid tuning features
\pause
\item [TUNECONFLICTS] list of conflicting features for a given feature
\end{description}
\end{frame}
\begin{frame}
\frametitle{software}
\begin{description}
\item [PREFERRED\_VERSION\_xserver-xorg] compatible xserver version
\pause
\item [PREFERRED\_PROVIDER\_virtual/kernel] recommended kernel
\pause
\item [IMAGE\_FSTYPES] formats for the rootfs, e.g. "ext3 tar.bz2"
\pause
\item [IMAGE\_CLASSES] list of classes that all images should inherit, default
is image\_types
\end{description}
\end{frame}
\subsection{Configuration}
\begin{frame}
\frametitle{basics}
bla
\end{frame}
\subsection{Images}
\begin{frame}
\frametitle{basics}
\begin{itemize}
\item images are constructed using the packages built earlier and put into the
Package Feeds
\pause
\item decisions of what to install on the image is based on the minimum
defined set of required components in an image recipe
\pause
\item this minimum set is then expanded based on dependencies to produce a
package solution
\pause
\item variety of formats (tar.bz2, ext2, ext3, jffs, \dots) are supported
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{prepare environment}
\begin{itemize}
\item bitbake is typically not installed into regular search paths
\pause
\item the environment of the bash is modified to find the commands
\pause
\item non-bash shells are not supported
\end{itemize}
\pause
\begin{verbatim}
% . ./oe-init-buildenv <builddir>
\end{verbatim}
\begin{itemize}
\item is used to modify the environment and change the CWD to <builddir>
\item ./oe-init-buildenv-memres is used to keep the bitbake-server running
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{build a predefined image}
\begin{verbatim}
% bitbake core-image-minimal
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{start the image}
\begin{verbatim}
% runqemu qemux86 core-image-minimal
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{inspect the build}
\begin{verbatim}
tmp/
├── buildstats
├── cache
├── deploy
├── log
├── sstate-control
├── stamps
├── sysroots
├── work
└── work-shared
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{inspect the build}
\begin{verbatim}
tmp/buildstats/core-image-minimal-qemux86/201408271416/
├── acl-2.2.52-r0
├── acl-native-2.2.52-r0
├── alsa-lib-native-1.0.27.2-r0
├── attr-2.4.47-r0
├── attr-native-2.4.47-r0
├── autoconf-native-2.69-r11
...
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{inspect the build}
\begin{verbatim}
tmp/buildstats/core-image-minimal-qemux86/201408271416/acl-2.2.52-r0/
├── do_compile
├── do_compile_ptest_base
├── do_configure
├── do_configure_ptest_base
├── do_fetch
├── do_install
├── do_install_ptest_base
├── do_package
├── do_packagedata
├── do_package_write_rpm
├── do_patch
├── do_populate_lic
├── do_populate_sysroot
└── do_unpack
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{inspect the build}
\begin{verbatim}
408271416/acl-2.2.52-r0/do_unpack
Event: TaskStarted
Started: 1409143746.65
acl-2.2.52-r0: do_unpack: Elapsed time: 0.22 seconds
CPU usage: 7.1%
EndIOinProgress: 0
EndReadsComp: 973062
EndReadsMerged: 543875573
EndSectRead: 36860156
EndSectWrite: 1158945211
EndTimeIO: 30104972
EndTimeReads: 5545878
EndTimeWrite: 1455538600
...
StartWritesComp: 12202741
Status: PASSED
Ended: 1409143746.87
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{inspect the build}
\begin{verbatim}
tmp/
├── buildstats
├── cache
├── deploy
├── log
├── sstate-control
├── stamps
├── sysroots
├── work
└── work-shared
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{inspect the build}
\begin{verbatim}
tmp/deploy/
├── images
│ └── qemux86
│ ├── bzImage -> bzImage--3.14+git0+09424...
│ ├── core-image-minimal-qemux86-20140827121546.rootfs.ext3
│ ├── core-image-minimal-qemux86-20140827121546.rootfs.manifest
│ ├── core-image-minimal-qemux86-20140827121546.rootfs.tar.bz2
│ ├── core-image-minimal-qemux86.ext3 -> core-image...
│ ├── ...
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{inspect the build}
\begin{verbatim}
tmp/deploy/
├── licenses
│ ├── acl
│ │ ├── COPYING
│ │ ├── COPYING.LGPL
│ │ ├── generic_GPLv2
│ │ └── generic_LGPLv2.1
│ ├── acl-native
│ ├── alsa-lib-native
│ ├── apr-native
│ ├── ..
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{inspect the build}
\begin{verbatim}
tmp/deploy/
└── rpm
├── all
│ ├── packagegroup-core-standalone-sdk-target-1.0-r8.all.rpm
│ ├── packagegroup-core-standalone-sdk-target-dbg-1.0-r8.all.rpm
│ ├── packagegroup-core-standalone-sdk-target-dev-1.0-r8.all.rpm
│ ├── repodata
│ ├── run-postinsts-1.0-r9.all.rpm
│ ├── ...
├── i586
├── qemux86
└── x86_64_nativesdk
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{inspect the build}
\begin{verbatim}
tmp/
...
├── log/cooker/qemux86/20140827121546.log
\end{verbatim}
\pause
\begin{verbatim}
├── sstate-control/manifest-<pn>.<task>
| /home/local/src/poky/build2/tmp/sysroots/x86_64-linux/usr/include/zconf.h
| /home/local/src/poky/build2/tmp/sysroots/x86_64-linux/usr/include/zlib.h
| /home/local/src/poky/build2/tmp/sysroots/x86_64-linux/usr/lib/libz.so.1
\end{verbatim}
\pause
\begin{verbatim}
├── stamps # cache files
├── sysroots # for the differnet architectures
\end{verbatim}
\pause
\begin{verbatim}
├── work # work directories / where the sources are built
| % ls tmp/work/qemux86-poky-linux/linux-yocto/3.14+gitAUTOINC+0942...
| deploy-linux-yocto linux packages-split
| deploy-rpms linux-qemux86-standard-build pkgdata
| image linux-yocto.spec pseudo
| license-destdir package sysroot-destdir
| temp
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{inspect the build}
\begin{verbatim}
tmp/
└── work-shared
\end{verbatim}
For efficiency, the OpenEmbedded build system creates and uses this directory
to hold recipes that share a work directory with other recipes.
\vspace{2em}
In practice, this is only used for gcc and its variants.
\end{frame}
\begin{frame}[fragile]
\frametitle{inspect the build}
\begin{verbatim}
downloads/
\end{verbatim}
all fetched source tarballs
\end{frame}
\begin{frame}[fragile]
\frametitle{execute a specific task}
\begin{verbatim}
bitbake <recipe> -c <task
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{build dependencies}
dependency graphs (sucks because they're really huge)
\begin{verbatim}
bitbake -g <target>
\end{verbatim}
\pause
dependency explorer
\begin{verbatim}
bitbake -g -u depexp <target>
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{developer shell}
\begin{verbatim}
bitbake <recipe> -c devshell
\end{verbatim}
use ./configure and make to debug build issues
\end{frame}
\begin{frame}[fragile]
\frametitle{inspect builds using toaster}
start toaster web application
\begin{verbatim}
poky/build % source toaster start
\end{verbatim}
\pause
run bitbake
\vspace{2em}
\pause
use 'http://localhost:8000' to browse through the build informations
\pause
\begin{verbatim}
poky/build % source toaster stop
\end{verbatim}
is used to stop toaster (only one toaster per pc possible)
\vspace{2em}
\pause
only actions between toaster start and stop are recorded
\end{frame}
\begin{frame}[fragile]
\frametitle{cleanup}
\begin{verbatim}
% bitbake -c core-image-minimal
\end{verbatim}
\pause
\begin{itemize}
\item doesn't cleanup dependencies
\item doesn't remove deployed files
\item triggers repackaging of all packages
\end{itemize}
\vspace{2em}
\pause
To start from scratch backup the conf directory
and remove everything from build.
\end{frame}
\begin{frame}[fragile]
\frametitle{cleanup}
\begin{verbatim}
% bitbake -c clean xserver-nodm-init
\end{verbatim}
\pause
\begin{itemize}
\item doesn't cleanup dependencies
\item removes deployed files
\item removes downloaded files
\item removes data from work and sysroot directory
\item doesn't remove data from sstate
\item triggers nothing, files from sstate are used
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{cleanup}
\begin{verbatim}
% bitbake -c cleanall xserver-nodm-init
\end{verbatim}
\pause
\begin{itemize}
\item doesn't cleanup dependencies
\item removes deployed files
\item removes downloaded files
\item removes data from work and sysroot directory
\item removes data from sstate
\item triggers fetch, compilation and packaging of the component
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{force recompilation}
\begin{verbatim}
% bitbake -f -c compile xserver-nodm-init
\end{verbatim}
\begin{itemize}
\item changes are not in the image
\item and not in the package
\end{itemize}
\end{frame}
\subsection{ADT}
\begin{frame}
\frametitle{Yocto ADT (Application Development Kit}
Core Components
\vspace{2em}
\begin{itemize}
\item System Root
\item QEMU Emulator
\item Cross Development Toolchain
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Yocto ADT}
Eclipse Plugin
\vspace{2em}
\begin{itemize}
\item Roundtrip Application Development
\item Toolchain/System Root Integration
\item Emulated and Hardware Targets
\item Application Templates
\item On-target Debugging
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Yocto ADT}
Profiling Tools
\vspace{2em}
\begin{itemize}
\item LatencyTOP
\item PowerTOP
\item OProfile
\item Perf
\item SystemTap
\item Lttng-ust
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{build a toolchain}
\begin{verbatim}
poky/build % bitbake meta-toolchain
\end{verbatim}
\vspace{2em}
tmp/deploy/sdk/poky-eglibc-x86\_64-meta-toolchain-i586-toolchain-1.6.1.sh
\end{frame}
\begin{frame}[fragile]
\frametitle{build adt installer}
\begin{verbatim}
poky/build % bitbake adt-installer
\end{verbatim}
\vspace{2em}
tmp/deploy/sdk/adt\_installer.tar.bz2
\end{frame}
\begin{frame}
\frametitle{SDK usage}
bla
\end{frame}
\input{tailpres}
|