diff options
| author | Manuel Traut <manut@linutronix.de> | 2014-09-01 13:28:51 +0200 |
|---|---|---|
| committer | Manuel Traut <manut@linutronix.de> | 2016-01-12 11:19:52 +0100 |
| commit | 284629b6bccaaf2417934c46f7c21b85b6070304 (patch) | |
| tree | 05ef16ab1a3131e4271d51ac23d99e7676b20869 /distribution | |
| parent | 8a3be81aa128537f79cf3f4f49ac48b6888cb41f (diff) | |
yocto: rework layout
Signed-off-by: Manuel Traut <manut@linutronix.de>
Diffstat (limited to 'distribution')
| -rw-r--r-- | distribution/yocto-advanced/pres_yocto-advanced.tex | 188 | ||||
| -rw-r--r-- | distribution/yocto-basic/pres_yocto-basic.tex | 8 | ||||
| -rw-r--r-- | distribution/yocto-intro/pres_yocto-intro.tex | 25 |
3 files changed, 200 insertions, 21 deletions
diff --git a/distribution/yocto-advanced/pres_yocto-advanced.tex b/distribution/yocto-advanced/pres_yocto-advanced.tex index 2edfe36..a0283fc 100644 --- a/distribution/yocto-advanced/pres_yocto-advanced.tex +++ b/distribution/yocto-advanced/pres_yocto-advanced.tex @@ -12,7 +12,7 @@ \item Define a distribution \item Create an image \item Writing recipes -\item Yocto \& ELBE combined +\item Yocto \& ELBE combined? \end{itemize} \end{frame} @@ -71,12 +71,17 @@ meta-mylayer is useful to debug relations between different layers, options are: \begin{description} \item [show-layers] shows the current configured layers + \pause \item [show-recipes] lists available recipes and the layers that provide them. + \pause \item [show-overlayed] lists overlayed recipes + \pause \item [show-appends] lists .bbappend files and the recipe files to which they apply + \pause \item [show-cross-depends] lists dependency relationships between recipes that cross layer boundaries + \pause \item [flatten] flattens the layer configuration into a separate output directory. \end{description} @@ -87,6 +92,7 @@ is useful to debug relations between different layers, options are: \begin{itemize} \item It is possible for a recipe with a lower version number PV in a layer that has a higher priority to take precedence. + \pause \item Also, the layer priority does not currently affect the precedence order of .conf or .bbclass files. Future versions of BitBake might address this. \end{itemize} @@ -100,21 +106,24 @@ poky % git clone git://git.yoctoproject.org/meta-ti poky % git branch -r poky % git checkout <RELEASE> \end{verbatim} + \pause have a look at it's dependencies \begin{verbatim} poky % cat meta-ti/conf/layer.conf | grep LAYERDEPENDS LAYERDEPENDS_ti = "core" \end{verbatim} -and retrieve them also (if not yet done). - -If added a new layer, check its dependencies again. -\end{frame} - -\begin{frame}[fragile] -\frametitle{get example layer for trainig} + \pause +and retrieve them also +\begin{verbatim} +poky % git clone -b daisy git://git.yoctoproject.org/meta-fsl-arm +\end{verbatim} + \pause +check dependencies again \begin{verbatim} poky % git clone /home/devel/yocto/meta-mini \end{verbatim} + \pause +\dots no more dependencies?! \dots OK - finished. \end{frame} \begin{frame}[fragile] @@ -203,18 +212,31 @@ xserver-xorg: is used to configure \begin{itemize} \item the target machine + \pause \item paths + \pause \item the used distribution + \pause \item package formats + \pause \item arch of developer machine + \pause \item additional image features + \pause \item use additional classes + \pause \item enable testing + \pause \item devshell terminal + \pause \item patch resolver + \pause \item disk monitoring + \pause \item sstate mirrors + \pause \item qemu configuration + \pause \item incompatible licenses, e.g. INCOMPATIBLE\_LICENSE = “GPLv3” \end{itemize} \end{frame} @@ -226,6 +248,7 @@ to get a list of currently available machines configs: poky/build-ti % grep -r '@NAME' ../meta*/conf/machine \end{verbatim} beaglebone.conf - seems to be the one for our bord, so set +imx6qsabrelite.conf - seems to be the one for our bord, so set \begin{verbatim} MACHINE ??= "beaglebone" \end{verbatim} @@ -258,6 +281,27 @@ use \begin{verbatim} ls ../*/*/images/ \end{verbatim} +to get a list of predefined images; however none of them fits my needs\dots + \pause +\begin{verbatim} +poky/build-fsl % cd .. +poky % git clone -b daisy https://github.com/Freescale/meta-fsl-demos.git +poky % git clone -b daisy git://git.openembedded.org/meta-openembedded +poky % cd - +\end{verbatim} + \pause +and edit conf/bblayers.conf, to match +\begin{verbatim} +BBLAYERS ?= " \ + /home/devel/poky/meta \ + /home/devel/poky/meta-yocto \ + /home/devel/poky/meta-yocto-bsp \ + /home/devel/poky/meta-fsl-arm \ + /home/devel/poky/meta-fsl-arm-extra \ + /home/devel/poky/meta-openembedded/meta-oe \ + /home/devel/poky/meta-fsl-demos \ + " +\end{verbatim} \end{frame} \begin{frame}[fragile] @@ -277,6 +321,7 @@ ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"! \end{verbatim} what happened?? + \pause \begin{verbatim} poky/build-ti % df -h Filesystem Size Used Avail Use% Mounted on @@ -286,6 +331,7 @@ poky/build-ti % du -sm . poky/build-ti % du -sm ../build 29172 ../build/ \end{verbatim} + \pause \dots so the solution is to cleanup the disk and run \begin{verbatim} poky/build-ti % bitbake qt4e-demo-image @@ -314,10 +360,12 @@ ERROR: Task 1105 (/home/local/src/poky/meta-ti-arm/ gpu-viv-bin-mx6q_3.10.17-1.0.0-hfp.bb, do_unpack) failed with exit code '1' \end{verbatim} + \pause to solve this issue: \begin{verbatim} poky/build-ti % echo 'ACCEPT_FSL_EULA = "1"' >> conf/local.conf \end{verbatim} + \pause \dots and run \begin{verbatim} poky/build-ti % bitbake qt4e-demo-image @@ -404,7 +452,9 @@ BBLAYERS ?= " \ \frametitle{why define a distribution?} \begin{itemize} \item naming of the toolchain (codenames, vendor) + \pause \item version numbers + \pause \item enable default features \end{itemize} \end{frame} @@ -413,9 +463,12 @@ BBLAYERS ?= " \ \frametitle{distro features: file-systems} \begin{description} \item[cramfs] CramFS support + \pause \item[ext2] tools for supporting for devices with internal HDD/Microdrive for storing files (instead of Flash only devices) + \pause \item[nfs] NFS client support (for mounting NFS exports on device) + \pause \item[smbfs] SMB networks client support (for mounting Samba/Microsoft Windows shares on device) \end{description} @@ -426,9 +479,13 @@ BBLAYERS ?= " \ \begin{description} \item[alsa] ALSA/sound support (OSS compatibility kernel modules installed if available) + \pause \item[bluetooth] bluetooth support (integrated BT only) + \pause \item[irda] IrDA support + \pause \item[wifi] WiFi support (integrated only). + \pause \item[keyboard] keyboard support (e.g. keymaps will be loaded during boot) \end{description} \end{frame} @@ -439,6 +496,7 @@ BBLAYERS ?= " \ \item[opengl] the Open Graphics Library, which is a cross-language, multi-platform application programming interface used for rendering two and three-dimensional graphics + \pause \item[directfb] DirectFB support \end{description} \end{frame} @@ -447,7 +505,9 @@ BBLAYERS ?= " \ \frametitle{distro features: networking} \begin{description} \item[ipsec] IPSec support + \pause \item[ipv6] IPv6 support + \pause \item[ppp] PPP dialup support \end{description} \end{frame} @@ -456,8 +516,11 @@ BBLAYERS ?= " \ \frametitle{distro features: bus support} \begin{description} \item[pci] PCI bus support + \pause \item[pcmcia] PCMCIA/CompactFlash support + \pause \item[usbgadget] USB Gadget Device support (for USB networking/serial/storage) + \pause \item[usbhost] USB Host support (allows to connect external keyboard, mouse, storage, network etc) \end{description} @@ -469,8 +532,10 @@ BBLAYERS ?= " \ \item[systemd] support for this init manager, which is a full replacement of for init with parallel starting of services, reduced shell overhead, and other features. This init manager is used by many distributions + \pause \item[wayland] the Wayland display server protocol and the library that supports it + \pause \item[x11] X server and libraries \end{description} \end{frame} @@ -508,23 +573,37 @@ it can be used, to simplify image definitions \begin{frame}[fragile] \frametitle{minimal distribution} distros are defined in a layer, e.g. + +meta-linutronix/conf/distro/mini.conf: +\begin{verbatim} meta-mini/conf/distro/mini.conf: DISTRO = "mini" DISTRO_NAME = "mini 1.0 (for foo devices)" DISTRO_VERSION = "1.0" DISTRO_CODENAME = "mal" +\end{verbatim} +\end{frame} +\begin{frame}[fragile] +\begin{verbatim} SDK_VENDOR = "-linutronix" SDK_VERSION := "${@'${DISTRO_VERSION}'}" +SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${IMAGE_BASENAME}-${TUNE_PKGARCH}" +SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}" +\end{verbatim} +\end{frame} +\begin{frame}[fragile] +\begin{verbatim} MAINTAINER = "Manuel Traut <manut@linutronix.de>" TARGET_VENDOR = "-linutronix" LOCALCONF_VERSION = "1" LAYER_CONF_VERSION ?= "6" DISTRO_FEATURES ?= "opengl ${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC}" DISTRO_FEATURES_append = " systemd" -SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${IMAGE_BASENAME}-${TUNE_PKGARCH}" -SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}" TCLIBCAPPEND = "" - +\end{verbatim} +\end{frame} +\begin{frame}[fragile] +\begin{verbatim} PREMIRRORS ??= "\ bzr://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \ cvs://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \ @@ -534,7 +613,10 @@ osc://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \ p4://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \ svk://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \ svn://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n" - +\end{verbatim} +\end{frame} +\begin{frame}[fragile] +\begin{verbatim} MIRRORS =+ "\ ftp://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \ http://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \ @@ -543,7 +625,10 @@ https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n" CONNECTIVITY_CHECK_URIS ?= " \ https://eula-downloads.yoctoproject.org/index.php \ http://bugzilla.yoctoproject.org/report.cgi" - +\end{verbatim} +\end{frame} +\begin{frame}[fragile] +\begin{verbatim} SANITY_TESTED_DISTROS ?= " \ Ubuntu-14.04 \n \ Debian-7.0 \n \ @@ -577,6 +662,7 @@ DISTRO ?= "mini" \subsection{Creating images} \begin{frame}[fragile] \frametitle{based on core-image class} +build image with ssh support \begin{verbatim} poky/build-ti % bitbake-layers show-recipes | grep ssh Parsing recipes..done. @@ -585,12 +671,14 @@ openssh: packagegroup-core-ssh-dropbear: packagegroup-core-ssh-openssh: \end{verbatim} +\pause create the file 'meta-mini/recipes-bsp/mini-image/mini-image.bb' \begin{verbatim} IMAGE_INSTALL += "openssh" inherit core-image \end{verbatim} +\pause to build the image, use: \begin{verbatim} poky/build-ti % bitbake mini-image @@ -649,6 +737,56 @@ UBOOT_LOADADDRESS = "0x80008000" \end{verbatim} \end{frame} +\begin{frame}[fragile] +\frametitle{user and group configuration} +use this in an image recipe: +\begin{verbatim} +inherit extrausers +EXTRA_USERS_PARAMS = "\ + useradd -p '' tester; \ + groupadd developers; \ + userdel nobody; \ + groupdel -g video; \ + groupmod -g 1020 developers; \ + usermod -s /bin/sh tester; \ + " +\end{verbatim} +or the useradd class, for an example see useradd-example.bb +\end{frame} + +\begin{frame}[fragile] +\frametitle{external sources} +e.g. for a heavily customized kernel +\begin{itemize} +\item kernel source directory on the development machine +\pause +\item inherit externalsrc class +\pause +\item set EXTERNALSRC variable to point to your external source code +\end{itemize} + +this local.conf extension: +\begin{verbatim} +INHERIT += "externalsrc" +EXTERNALSRC_pn-myrecipe = "/some/path/to/your/source/tree" +\end{verbatim} +overrides the SOURCE\_URI of pn-myrecipe.bb +\end{frame} + +\begin{frame}[fragile] +\frametitle{blacklist packages} +To blacklist a package, inherit the blacklist.bbclass globally and set +PNBLACKLIST for each recipe you wish to blacklist. + + +Specify the PN value as a variable flag (varflag) and provide a reason, +which is reported, if the package is requested to be built as the value: +\begin{verbatim} +INHERIT += "blacklist" +PNBLACKLIST[exoticware] = "Not supported by our organization." +\end{verbatim} +\end{frame} + \subsection{Writing recipes} \begin{frame}[fragile] \frametitle{adding a kernel} @@ -673,8 +811,6 @@ KERNEL_DEVICETREE_beaglebone-black = \ "arch/arm/boot/dts/am335x-boneblack.dts" S = "${WORKDIR}/linux-${PV}" - -SRC_URI = " \ https://www.kernel.org/pub/linux/kernel/v3.x/linux-${PV}.tar.xz \ file://defconfig \ " @@ -726,9 +862,12 @@ PREFERRED\_VERSION\_virtual/kernel = "3.18.5" \frametitle{Preferences} \begin{itemize} \item by default, files have a preference of "0" +\pause \item setting DEFAULT\_PREFERENCE to "-1" makes the recipe unlikely to be used unless it is explicitly referenced. +\pause \item setting DEFAULT\_PREFERENCE to "1" makes it likely the recipe is used +\pause \item PREFERRED\_VERSION overrides any DEFAULT\_PREFERENCE setting \end{itemize} \end{frame} @@ -883,7 +1022,9 @@ IMAGE_FSTYPES += "sdcard" \frametitle{adding an own application} \begin{itemize} \item recipe already available? check http://layers.openembedded.org +\pause \item look for a similar recipe +\pause \item proper bbclass available? \end{itemize} on the next slides, we have a look what is useful for very simple applications, @@ -954,6 +1095,7 @@ inherit autotools │ └── hellocm-0.1.tar.bz2 └── hellocm_0.1.bb \end{verbatim} +\pause \begin{verbatim} DESCRIPTION = "hellocm cmake example" LICENSE = "MIT" @@ -975,6 +1117,7 @@ FILES_{PN} = "${bindir}/hellocm" │ └── helloqt-1.0.tar.bz2 └── helloqt_1.0.bb \end{verbatim} +\pause \begin{verbatim} DESCRIPTION = "helloqt QT example" LICENSE = "MIT" @@ -994,11 +1137,14 @@ do_install() { \frametitle{adding a bootscript} \begin{itemize} \item add 'systemd' to DISTRO\_FEATURES +\pause \item inherit from systemd.bbclass +\pause \item your package needs to set SYSTEMD\_SERVICE variable; e.g. \begin{verbatim} SYSTEMD_SERVICE_${PN} = "connman.service" \end{verbatim} +\pause \item to disable the service, set SYSTEMD\_AUTO\_ENABLE to 'disable' \end{itemize} \end{frame} @@ -1049,6 +1195,18 @@ which is reported, if the package is requested to be built as the value: INHERIT += "blacklist" PNBLACKLIST[exoticware] = "Not supported by our organization." \end{verbatim} + +\subsection{Resume} +\begin{frame} + \begin{itemize} + \item Yocto is a huge collection of tools + \pause + \item Bitbake can be used to create Images + \pause + \item The quality of the Images depend on the maintainance of the Layers + \pause + \item Only build your own distribution if you really need to! + \end{itemize} \end{frame} \input{tailpres} diff --git a/distribution/yocto-basic/pres_yocto-basic.tex b/distribution/yocto-basic/pres_yocto-basic.tex index cf86fa9..1f5083d 100644 --- a/distribution/yocto-basic/pres_yocto-basic.tex +++ b/distribution/yocto-basic/pres_yocto-basic.tex @@ -1399,9 +1399,11 @@ interfaces of the PC \begin{frame} \frametitle{remote execution and debugging} \begin{itemize} - \item seems to be broken at the moment, or works different than documented - \item it should be possible, if ssh is added to the image and an ssh - remote connection will be used. + \item Switch to 'Remote System Explorer' perspective + \pause + \item Create a new 'TCF' connection + \pause + \item Run as / Debug as and select the speficied remote connection \end{itemize} \end{frame} diff --git a/distribution/yocto-intro/pres_yocto-intro.tex b/distribution/yocto-intro/pres_yocto-intro.tex index 98b027e..c3eaae8 100644 --- a/distribution/yocto-intro/pres_yocto-intro.tex +++ b/distribution/yocto-intro/pres_yocto-intro.tex @@ -35,10 +35,14 @@ \frametitle{Yocto is \dots} \begin{itemize} \item an Ecosystem (not a single open-source project) + \pause \item a collection of embedded projects and tooling + \pause \item a place for Industry to publish BSPs + \pause \item NOT an embedded Linux distribution \end{itemize} + \pause \dots used to build a Linux system from source in about an hour \footnote{quad i7, 16GB RAM, fast disks, needed} \end{frame} @@ -52,10 +56,8 @@ \item[Hob] graphical user interface for BitBake \item[OpenEmbedded Core] shared base layer of recipes and classes \end{description} - \pause \item[ADT] development environment for user-space applications \item[Eclipse IDE Plugin] integration of ADT into the Eclipse IDE - \item[Matchbox] X-Windows-based open source graphical UI for embedded devices \end{description} \end{frame} @@ -65,9 +67,13 @@ the Yocto key project; a reference distribution consisting of \begin{itemize} \item a build system for Linux (openembedded + customized busybox, psplash, alsa-state, formfactor, uclibc and tiny-init) + \pause \item Yocto Linux kernel + \pause \item build recipes for common open-source software + \pause \item toolchains for several architectures + \pause \item documentation \end{itemize} release cycle: 6 months @@ -93,14 +99,21 @@ release cycle: 6 months \frametitle{statistics 2014} \begin{description} \item[Generated] 2014-08-19 18:16:11 (in 228 seconds) + \pause \item[Generator] GitStats (version 2013.12.07) + \pause \item[Report Period] 2005-08-31 12:45:47 to 2014-08-18 16:21:54 + \pause \item[Age] 3275 days, 2498 active days (76.27%) + \pause \item[Total Files] 4775 + \pause \item[Total Lines of Code] 743995 (15398000 added, 14654005 removed) + \pause \item[Total Commits] 30841 (average 12.3 commits per active day, 9.4 per all days) + \pause \item[Authors] 475 \end{description} \end{frame} @@ -126,6 +139,7 @@ freescale.com 159 (0.52%) \frametitle{OpenEmbedded} \begin{itemize} \item open-source project providing a cross-build framework for embedded Linux + \pause \item recipes for toolchain, bootloader, kernel, lttng, user-space packages \end{itemize} \end{frame} @@ -134,8 +148,11 @@ freescale.com 159 (0.52%) \frametitle{Yocto pincipals} \begin{itemize} \item validated collection of software (toolchain, kernel, user-space) + \pause \item customize blueprints for your own needs + \pause \item distinguishing between app and system developers + \pause \item layer model for modular development, reuse, and customizations \end{itemize} \end{frame} @@ -145,11 +162,13 @@ freescale.com 159 (0.52%) \frametitle{cross-build vs. binary distribution} \begin{itemize} \item men-power needed for building an own distribution? + \pause \item security tracking? + \pause \item optimizations needed on all binaries? + \pause \item cross-compile wanted? \end{itemize} \end{frame} - \input{tailpres} |
