diff options
| author | Manuel Traut <manut@linutronix.de> | 2016-01-12 18:03:09 +0100 |
|---|---|---|
| committer | Manuel Traut <manut@linutronix.de> | 2016-01-12 18:03:09 +0100 |
| commit | 0aa4d82f88246d49bf10514a37e1fd4856064d33 (patch) | |
| tree | ca7a46884c45c80fbaaaae2ab4e8dcccccad4cfa /distribution/yocto-basic | |
| parent | 8207c684f71d57bb1d89804876befe2f49162b2e (diff) | |
yocto-basic: adoptions for yocto 2.0
Signed-off-by: Manuel Traut <manut@linutronix.de>
Diffstat (limited to 'distribution/yocto-basic')
| -rw-r--r-- | distribution/yocto-basic/pres_yocto-basic.tex | 193 |
1 files changed, 39 insertions, 154 deletions
diff --git a/distribution/yocto-basic/pres_yocto-basic.tex b/distribution/yocto-basic/pres_yocto-basic.tex index 29ab14d..c0df453 100644 --- a/distribution/yocto-basic/pres_yocto-basic.tex +++ b/distribution/yocto-basic/pres_yocto-basic.tex @@ -23,15 +23,42 @@ \includegraphics[width=\textwidth]{images/yocto-workflow} \end{frame} +\begin{frame}[fragile] +\frametitle{retrieve poky} +\begin{verbatim} +% git clone http://git.yoctoproject.org/git/poky +% cd poky +% git checkout origin/jethro -b jethro -t +\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{prepare environment} +\begin{itemize} +\item bitbake is typically not installed into regular search paths +\item the environment of the bash 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 CWD to <builddir> +\item ./oe-init-buildenv-memres is used to keep the bitbake-server running +\end{itemize} +\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} @@ -40,7 +67,6 @@ \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} @@ -49,19 +75,12 @@ \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 configure the layer -\pause \item are added and ordered via BBLAYERS variable in build/conf/bblayers.conf -\pause \item 'bitbake-layers show-layers' is used to show used layers \end{itemize} \end{frame} @@ -71,15 +90,10 @@ 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} @@ -96,7 +110,7 @@ poky ├── meta-yocto ├── meta-yocto-bsp └── scripts - \end{verbatim} +\end{verbatim} \end{frame} \subsection{Variable assignments} @@ -248,15 +262,10 @@ FOO="456" \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} @@ -287,20 +296,13 @@ inherit autotools \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} @@ -310,22 +312,17 @@ references to the open-source project and: 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} @@ -334,7 +331,6 @@ list of source licenses for the recipe: \begin{frame} \frametitle{LIC\_FILE\_CHKSUM variable} Checksums of the license text in the recipe source code. -\pause \vspace{2em} @@ -353,7 +349,6 @@ 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 @@ -361,68 +356,41 @@ 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} +\begin{frame}[fragile] \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} +recipe file (.bb) or append file (.bbappend) resides. -\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} +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} \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} @@ -443,8 +411,8 @@ standard options \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 @@ -453,17 +421,13 @@ specific options \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} @@ -472,14 +436,12 @@ specific options \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} @@ -510,7 +472,6 @@ predefined classes are: \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} @@ -529,7 +490,6 @@ an append file must be named after the base package: \frametitle{basics} \begin{itemize} \item python can be used to write functions -\pause \item e.g. write your own image generation class \end{itemize} \end{frame} @@ -690,23 +650,6 @@ an append file must be named after the base package: \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 @@ -828,37 +771,15 @@ that is used by the Board .conf file \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 @@ -1099,44 +1020,9 @@ 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} - \includegraphics[height=\textheight]{images/yocto-toaster1} -\end{frame} - -\begin{frame} - \includegraphics[height=\textheight]{images/yocto-toaster2} -\end{frame} - -\begin{frame} - \includegraphics[height=\textheight]{images/yocto-toaster3} -\end{frame} - -\begin{frame}[fragile] \frametitle{cleanup} \begin{verbatim} -% bitbake -c core-image-minimal +% bitbake -c clean core-image-minimal \end{verbatim} \pause \begin{itemize} @@ -1145,7 +1031,6 @@ only actions between toaster start and stop are recorded \item triggers repackaging of all packages \end{itemize} - \vspace{2em} \pause To start from scratch backup the conf directory |
