From cce8b43e5b6cebd6884fb07afab3d88942666949 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Fri, 29 Aug 2014 20:35:42 +0200 Subject: lx-trainer add a disk dump script Signed-off-by: Manuel Traut --- lx-trainer-vm/dd.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 lx-trainer-vm/dd.sh (limited to 'lx-trainer-vm') diff --git a/lx-trainer-vm/dd.sh b/lx-trainer-vm/dd.sh new file mode 100755 index 0000000..9e57c42 --- /dev/null +++ b/lx-trainer-vm/dd.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +cat build/lx-trainer.img | tee \ + >(dd of=/dev/sdb) \ + >(dd of=/dev/sdc) \ + | dd of=/dev/sdd + +echo -e "n\np\n\n\n\nw" | tee \ + >(fdisk /dev/sdb) \ + >(fdisk /dev/sdc) \ + | fdisk /dev/sdd + +mkfs.ext4 -L home /dev/sdb2 +mkfs.ext4 -L home /dev/sdc2 +mkfs.ext4 -L home /dev/sdd2 -- cgit v1.2.3 From c8d041fab586ddea59f68a72e6f36272ef0e2750 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Fri, 29 Aug 2014 23:13:04 +0200 Subject: lx-trainer-vm auto create home directory Signed-off-by: Manuel Traut --- lx-trainer-vm/dd.sh | 18 ++++++++++++++++++ lx-trainer-vm/home-overlay/.gitignore | 4 ++++ 2 files changed, 22 insertions(+) create mode 100644 lx-trainer-vm/home-overlay/.gitignore (limited to 'lx-trainer-vm') diff --git a/lx-trainer-vm/dd.sh b/lx-trainer-vm/dd.sh index 9e57c42..1e1fd81 100755 --- a/lx-trainer-vm/dd.sh +++ b/lx-trainer-vm/dd.sh @@ -13,3 +13,21 @@ echo -e "n\np\n\n\n\nw" | tee \ mkfs.ext4 -L home /dev/sdb2 mkfs.ext4 -L home /dev/sdc2 mkfs.ext4 -L home /dev/sdd2 + +mount /dev/sdb2 /mnt +mkdir /mnt/home/devel +chmod 1000:1000 /mnt/devel +cp -a home-overlay/* /mnt/ +umount /mnt + +mount /dev/sdc2 /mnt +mkdir /mnt/home/devel +chmod 1000:1000 /mnt/devel +cp -a home-overlay/* /mnt/ +umount /mnt + +mount /dev/sdd2 /mnt +mkdir /mnt/home/devel +chmod 1000:1000 /mnt/devel +cp -a home-overlay/* /mnt/ +umount /mnt diff --git a/lx-trainer-vm/home-overlay/.gitignore b/lx-trainer-vm/home-overlay/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/lx-trainer-vm/home-overlay/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore -- cgit v1.2.3 From 8a3be81aa128537f79cf3f4f49ac48b6888cb41f Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Sun, 31 Aug 2014 21:42:17 +0200 Subject: lx-tranier-vm fix dd scripts Signed-off-by: Manuel Traut --- lx-trainer-vm/dd.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'lx-trainer-vm') diff --git a/lx-trainer-vm/dd.sh b/lx-trainer-vm/dd.sh index 1e1fd81..caa09f1 100755 --- a/lx-trainer-vm/dd.sh +++ b/lx-trainer-vm/dd.sh @@ -1,33 +1,33 @@ #!/bin/bash cat build/lx-trainer.img | tee \ - >(dd of=/dev/sdb) \ + >(dd of=/dev/sde) \ >(dd of=/dev/sdc) \ | dd of=/dev/sdd -echo -e "n\np\n\n\n\nw" | tee \ - >(fdisk /dev/sdb) \ - >(fdisk /dev/sdc) \ - | fdisk /dev/sdd +echo -e "n\np\n\n\n\nw" | fdisk /dev/sde +echo -e "n\np\n\n\n\nw" | fdisk /dev/sdc +echo -e "n\np\n\n\n\nw" | fdisk /dev/sdd +partprobe -mkfs.ext4 -L home /dev/sdb2 -mkfs.ext4 -L home /dev/sdc2 -mkfs.ext4 -L home /dev/sdd2 +mkfs.ext4 -F -L lxhome /dev/sde2 +mkfs.ext4 -F -L lxhome /dev/sdc2 +mkfs.ext4 -F -L lxhome /dev/sdd2 -mount /dev/sdb2 /mnt -mkdir /mnt/home/devel -chmod 1000:1000 /mnt/devel +mount /dev/sde2 /mnt +mkdir /mnt/devel +chown 1000:1000 /mnt/devel cp -a home-overlay/* /mnt/ umount /mnt mount /dev/sdc2 /mnt -mkdir /mnt/home/devel -chmod 1000:1000 /mnt/devel +mkdir /mnt/devel +chown 1000:1000 /mnt/devel cp -a home-overlay/* /mnt/ umount /mnt mount /dev/sdd2 /mnt -mkdir /mnt/home/devel -chmod 1000:1000 /mnt/devel +mkdir /mnt/devel +chown 1000:1000 /mnt/devel cp -a home-overlay/* /mnt/ umount /mnt -- cgit v1.2.3 From 284629b6bccaaf2417934c46f7c21b85b6070304 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Mon, 1 Sep 2014 13:28:51 +0200 Subject: yocto: rework layout Signed-off-by: Manuel Traut --- .../yocto-advanced/pres_yocto-advanced.tex | 188 +++++++++++++++++++-- distribution/yocto-basic/pres_yocto-basic.tex | 8 +- distribution/yocto-intro/pres_yocto-intro.tex | 25 ++- lx-trainer-vm/home-overlay/.gitignore | 4 - 4 files changed, 200 insertions(+), 25 deletions(-) delete mode 100644 lx-trainer-vm/home-overlay/.gitignore (limited to 'lx-trainer-vm') 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 \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 " 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} diff --git a/lx-trainer-vm/home-overlay/.gitignore b/lx-trainer-vm/home-overlay/.gitignore deleted file mode 100644 index 5e7d273..0000000 --- a/lx-trainer-vm/home-overlay/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore -- cgit v1.2.3 From 5a742942933d2ef714886db3dba9850e71958c33 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Wed, 3 Sep 2014 12:28:51 +0200 Subject: removed gedit - to big an pluma is quiet the same.. Signed-off-by: Manuel Traut --- lx-trainer-vm/lx-trainer-vm.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'lx-trainer-vm') diff --git a/lx-trainer-vm/lx-trainer-vm.xml b/lx-trainer-vm/lx-trainer-vm.xml index 0267fcf..f617922 100644 --- a/lx-trainer-vm/lx-trainer-vm.xml +++ b/lx-trainer-vm/lx-trainer-vm.xml @@ -131,7 +131,6 @@ diffstat quilt git - gedit gksu bridge-utils -- cgit v1.2.3 From d5433dd648bf2e20d9f2544c0488af00791d0385 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Wed, 3 Sep 2014 12:36:31 +0200 Subject: lx-trainer: add sudo Signed-off-by: Manuel Traut --- lx-trainer-vm/lx-trainer-vm.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'lx-trainer-vm') diff --git a/lx-trainer-vm/lx-trainer-vm.xml b/lx-trainer-vm/lx-trainer-vm.xml index f617922..15646db 100644 --- a/lx-trainer-vm/lx-trainer-vm.xml +++ b/lx-trainer-vm/lx-trainer-vm.xml @@ -124,6 +124,7 @@ openssh-client openssh-server less + sudo bash vim-nox emacs-nox -- cgit v1.2.3 From 8fd4748549d41a8fe356a59957850d0fa2578ed0 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Thu, 4 Sep 2014 12:32:41 +0200 Subject: add lzop to trainer vm; needed for kernel build Signed-off-by: Manuel Traut --- lx-trainer-vm/lx-trainer-vm.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'lx-trainer-vm') diff --git a/lx-trainer-vm/lx-trainer-vm.xml b/lx-trainer-vm/lx-trainer-vm.xml index 15646db..5009968 100644 --- a/lx-trainer-vm/lx-trainer-vm.xml +++ b/lx-trainer-vm/lx-trainer-vm.xml @@ -129,6 +129,7 @@ vim-nox emacs-nox mc + lzop diffstat quilt git -- cgit v1.2.3 From 7032a45ced955efc7d369b3ccf6491654d6549b0 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 17 May 2016 15:55:39 +0200 Subject: yocto-basics: split slides Signed-off-by: Manuel Traut --- distribution/Kconfig | 1 + distribution/yocto-basic/pres_yocto-basic.tex | 1175 +------------------- distribution/yocto-basic/yocto-adt.tex | 193 ++++ .../yocto-basic/yocto-imgbuild-predefined.tex | 13 + distribution/yocto-basic/yocto-imgbuild1.tex | 13 + distribution/yocto-basic/yocto-imgbuild2.tex | 265 +++++ distribution/yocto-basic/yocto-workflow.tex | 681 ++++++++++++ lx-trainer-vm/dd-dual.sh | 10 + lx-trainer-vm/dd-single.sh | 7 +- lx-trainer-vm/dd.sh | 25 +- 10 files changed, 1201 insertions(+), 1182 deletions(-) create mode 100644 distribution/yocto-basic/yocto-adt.tex create mode 100644 distribution/yocto-basic/yocto-imgbuild-predefined.tex create mode 100644 distribution/yocto-basic/yocto-imgbuild1.tex create mode 100644 distribution/yocto-basic/yocto-imgbuild2.tex create mode 100644 distribution/yocto-basic/yocto-workflow.tex (limited to 'lx-trainer-vm') diff --git a/distribution/Kconfig b/distribution/Kconfig index 1cc108e..ffac90f 100644 --- a/distribution/Kconfig +++ b/distribution/Kconfig @@ -16,4 +16,5 @@ if YOCTO source "distribution/yocto-intro/Kconfig" source "distribution/yocto-basic/Kconfig" source "distribution/yocto-advanced/Kconfig" + source "distribution/yocto-x86/Kconfig" endif diff --git a/distribution/yocto-basic/pres_yocto-basic.tex b/distribution/yocto-basic/pres_yocto-basic.tex index 77b17fc..b779a1d 100644 --- a/distribution/yocto-basic/pres_yocto-basic.tex +++ b/distribution/yocto-basic/pres_yocto-basic.tex @@ -18,1175 +18,10 @@ \end{itemize} \end{frame} -\subsection{Workflow} -\begin{frame}[fragile] -\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} -\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 -\end{verbatim} -\begin{itemize} -\item is used to modify the environment and change the CWD to -\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 -\item base.bbclass is automatically included by all other classes and recipes. -\item common tasks and there 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 a .bb file inherits classes and populates them with data -\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 -\item used to isolate different types of customizations from each other -\item e.g. own layer for machine specific stuff, one for own applications -\item extend, add, replace or modify recipes -\item add or replace class files -\item 'conf/layer.conf' is used to configure the layer -\item are added and ordered via BBLAYERS variable in build/conf/bblayers.conf -\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 (i.e. meta-yocto) -\item BSP/machine settings (i.e. meta-yocto-bsp) -\item functional areas (selinux, networking, etc) -\item project specific changes -\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 -\item extract sources -\item patch sources -\item configure sources -\item compilation -\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: -\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 in the Build Directory where unpacked recipe source code resides. -\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 -\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{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 -\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. -\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 = ":///;;" -\end{verbatim} -\pause -multiple urls can be set in a SRC\_URI variable: -\begin{verbatim} -SRC_URI = ";name=url1 ;name=url2" -\end{verbatim} -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} -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}[fragile] -\frametitle{local SRC\_URI (file://)} -The path is relative to the FILESPATH variable. To modify the FILESPATH use -FILESEXTRAPATH. -\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 | grep FILESPATH -\end{verbatim} -\end{frame} - -\begin{frame} -\frametitle{remote SRC\_URI} -\begin{description} -\item[bzr://]Bazaar revision control repository -\item[git://]Git revision control repository -\item[osc://]OSC (OpenSUSE Build service) revision control repository -\item[ccrc://]ClearCase repository -\item[http://]Internet using http -\item[https://]Internet using https -\item[ftp://]Internet using ftp -\item[cvs://]CVS revision control repository -\item[hg://]Mercurial (hg) revision control repository -\item[p4://]Perforce (p4) revision control repository -\item[ssh://]secure shell -\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 mindate -\item[maxdate] apply patch only if SRCDATE is not later than maxdate -\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 -\item[rev] apply patch only if SRCREV is equal to rev -\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 -\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 -\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 autotools -\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 - \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} -_.bbappend -\end{verbatim} -\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} - -\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 -\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{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 -\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} - -\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/* - \item settings can be splitted in different include *.inc files - \item e.g. one include for CPU that is used by the SoC inc file, -that is used by the Board .conf file - \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 - \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{hardware} -\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, apm, bluetooth, ext2, irda, keyboard, pci, pcmcia, - screen, serial, touchscreen, usbgadget, usbhost, 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{software} -\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} - -\subsection{Images} -\begin{frame} -\frametitle{basics} -\begin{itemize} -\item images are constructed using the packages built earlier and put into the - Package Feeds -\item decisions of what to install on the image is based on the minimum - defined set of required components in an image recipe -\item this minimum set is then expanded based on dependencies to produce a - package solution -\item variety of formats (tar.bz2, ext2, ext3, jffs, \dots) are supported -\end{itemize} -\end{frame} - -\begin{frame}[fragile] -\frametitle{build a predefined image} -edit the local build configuration './conf/local.conf' -\begin{verbatim} -DL_DIR ?= "${TOPDIR}/../downloads" -PACKAGE_CLASSES ?= "package_deb" -EXTRA_IMAGE_FEATURES = "debug-tweaks eclipse-debug tools-profile tools-debug" -\end{verbatim} -and start the image build -\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} -├── % cat sstate-control/manifest-. -| /home/devel/poky/build/tmp/sysroots/x86_64-linux/usr/include/zconf.h -| /home/devel/poky/build/tmp/sysroots/x86_64-linux/usr/include/zlib.h -| /home/devel/poky/build/tmp/sysroots/x86_64-linux/usr/lib/libz.so.1 -\end{verbatim} -\pause -\begin{verbatim} -├── 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{execute a specific task} -\begin{verbatim} -bitbake -c -\end{verbatim} -use -\begin{verbatim} -bitbake -c listtasks -\end{verbatim} -to get a list of all available tasks -\end{frame} - -\begin{frame}[fragile] -\frametitle{build dependencies} -dependency graphs (sucks because they're really huge) -\begin{verbatim} -bitbake -g -\end{verbatim} -\pause -it is better to use the dependency explorer -\begin{verbatim} -bitbake -g -u depexp -\end{verbatim} -\end{frame} - -\begin{frame}[fragile] -\frametitle{developer shell} -\begin{verbatim} -bitbake -c devshell -\end{verbatim} -use ./configure and make to debug build issues -\end{frame} - -\begin{frame}[fragile] -\frametitle{cleanup} -\begin{verbatim} -% bitbake -c clean 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} -To start from scratch backup the conf directory -and remove everything from build. Otherwise -sstate-cache will be used. -\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 restoring files from sstate-cache -\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-cache -\item triggers fetch, compilation and packaging of the component -\item BUT changes will not be in the image -\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 an external usable toolchain} -\begin{verbatim} -poky/build % bitbake meta-toolchain -# OR to include headers and static version of all used libraries -poky/build % bitbake -c populate_sdk core-image-minimal -\end{verbatim} -\vspace{2em} -\pause -to install the toolchain: -\begin{verbatim} -% ./tmp/deploy/sdk/poky-glibc-x86\_64-meta-toolchain-i586-toolchain-2.0.sh -Enter target directory for SDK (default: /opt/poky/2.0): /home/devel/sdk -\end{verbatim} -\pause -to use the toolchain: -\begin{verbatim} -source /home/devel/sdk/environment-setup-i586-poky-linux -\end{verbatim} -\end{frame} - -\begin{frame}[fragile] -\frametitle{export a nfsroot} -\begin{verbatim} -poky/build % runqemu-extract-sdk \ -tmp/deploy/images/qemux86/core-image-minimal-qemux86.tar.bz2 \ -~/sdk/core-image-minimal -\end{verbatim} -\end{frame} - -\begin{frame}[fragile] -\frametitle{build a internal usable toolchain} -\begin{verbatim} -poky/build % bitbake meta-ide-support -\end{verbatim} -\vspace{2em} -\end{frame} - -\begin{frame}[fragile] -\frametitle{build ADT installer script} -\begin{verbatim} -poky/build % bitbake adt-installer -poky/build % cp tmp/deploy/sdk/adt_installer.tar.bz2 ~/ -poky/build % cd -% cp tmp/deploy/sdk/adt_installer.tar.bz2 ~/ -% tar xjf adt_installer.tar.bz2 -% cd adt-installer -\end{verbatim} -\end{frame} - -\begin{frame} -\frametitle{configure ADT installer} -general configuration -\begin{description} -\item[YOCTOADT\_REPO] http repo with rootfs images and ipkg packages. - Needs to match the layout from 'http://adtrepo.yoctoproject.org' -\item[YOCTOADT\_TARGETS] machine target architectures to setup cross SDKs -\item[YOCTOADT\_QEMU] install qemu? \[Y/N\] -\item[YOCTOADT\_NFS\_UTIL] needed for eclipse \[Y/N\] -\end{description} -\end{frame} - -\begin{frame} -\frametitle{configure ADT installer \#2} -configuration for each supported BSP -\begin{description} -\item[YOCTOADT\_TARGET\_MACHINE\_] qemu that should be used, e.g. qemux86 -\item[YOCTOADT\_ROOTFS\_] rfs images that should be used, e.g. sato-sdk -\item[YOCTOADT\_TARGET\_SYSROOT\_] needs to match above variable -\item[YOCTOADT\_TARGET\_SYSROOT\_LOC\_] path where the sysroot will be - stored -\end{description} -\end{frame} - -\begin{frame}[fragile] -\frametitle{run ADT installer} -\begin{verbatim} -adt-installer % ./adt_installer -Please enter the install location (default: /opt/poky/2.0): -... -[ADT_INST] Please enter your selections here: -S -... -\end{verbatim} -\pause -to use the ADT, the environment needs to be sourced: -\begin{verbatim} -% . /opt/poky/2.0/environment-setup-i586-poky-linux -\end{verbatim} -\end{frame} - -\begin{frame}[fragile] -\frametitle{ADT \& Eclipse} -install and start eclipse: -\begin{verbatim} -% wget http://ftp.fau.de/eclipse/technology/epp/downloads/release/kepler/R/eclipse-cpp-kepler-R-linux-gtk.tar.gz -% tar xzf eclipse-*.tar.gz -% ./eclipse/eclipse -\end{verbatim} -\pause -add the yocto update-site (Help, Install New Software, Add\dots) -\begin{verbatim} -http://downloads.yoctoproject.org/releases/eclipse-plugin/1.9/kepler/ -\end{verbatim} -select and install all components, by clicking - -'Next, Next, Accept Licenses, Finish, Accept installing from insecure source, -and accept to restart eclipse' -\pause -goto 'Help, Install New Software, Add\dots' again and -select 'Kepler' as update site and select 'Linux Tools' and -'Mobile and Device Development'; select 'Next' until you can -'Finish' and quit eclipse -\end{frame} - -\begin{frame} -\frametitle{configure Eclipse} -\begin{itemize} - \item select 'Window, Preferences, Yocto Project ADT' - \item select 'Standalone pre-built toolchain' - \item set Toolchain Root Location '/home/devel/sdk' - \item set Sysroot Location '/home/devel/sdk/core-image-minimal' - \item use 'native' as 'Target Options' - \item 'Apply' the Settings and close the dialog with 'OK' -\end{itemize} -\end{frame} - -\begin{frame} -\frametitle{Hello World example} -\begin{itemize} - \item select 'File, New, Project\dots' - \item select 'C/C++, C Project' - \item select 'Yocto Project ADT Autotools Project, Hello World ANSI C Project' - \item enter a 'Project name' and select 'Next' - \item enter 'Basic settings' and select 'Finish' - \item if opened, close the 'Welcome' window - \item right click on the root project folder and select 'Reconfigure Project' - \item right click on the root project folder and select 'Build Project' -\end{itemize} -\end{frame} - -\begin{frame} -\frametitle{remote execution and debugging} -\begin{itemize} - \item switch to 'Remote System Explorer' perspective - \item create a new 'TCF' connection - \item switch to 'C/C++' perspective and select 'Run / Debug Configurations' - \item select the preconfigured 'C/C++ Application' and select the correct - 'Connection' - \item set 'Remote Absolute File Path' to sth. like '/usr/bin/' - \item select 'Apply', 'Debug' - Next time you can use this preconfigured debug - configuration -\end{itemize} -\end{frame} +\input{yocto-workflow} +\input{yocto-imgbuild1} +\input{yocto-imgbuild-predefined} +\input{yocto-imgbuild2} +\input{yocto-adt} \input{tailpres} diff --git a/distribution/yocto-basic/yocto-adt.tex b/distribution/yocto-basic/yocto-adt.tex new file mode 100644 index 0000000..17d0733 --- /dev/null +++ b/distribution/yocto-basic/yocto-adt.tex @@ -0,0 +1,193 @@ +\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 an external usable toolchain} +\begin{verbatim} +poky/build % bitbake meta-toolchain +# OR to include headers and static version of all used libraries +poky/build % bitbake -c populate_sdk core-image-minimal +\end{verbatim} +\vspace{2em} +\pause +to install the toolchain: +\begin{verbatim} +% ./tmp/deploy/sdk/poky-glibc-x86\_64-meta-toolchain-i586-toolchain-2.0.sh +Enter target directory for SDK (default: /opt/poky/2.0): /home/devel/sdk +\end{verbatim} +\pause +to use the toolchain: +\begin{verbatim} +source /home/devel/sdk/environment-setup-i586-poky-linux +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{export a nfsroot} +\begin{verbatim} +poky/build % runqemu-extract-sdk \ +tmp/deploy/images/qemux86/core-image-minimal-qemux86.tar.bz2 \ +~/sdk/core-image-minimal +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{build a internal usable toolchain} +\begin{verbatim} +poky/build % bitbake meta-ide-support +\end{verbatim} +\vspace{2em} +\end{frame} + +\begin{frame}[fragile] +\frametitle{build ADT installer script} +\begin{verbatim} +poky/build % bitbake adt-installer +poky/build % cp tmp/deploy/sdk/adt_installer.tar.bz2 ~/ +poky/build % cd +% cp tmp/deploy/sdk/adt_installer.tar.bz2 ~/ +% tar xjf adt_installer.tar.bz2 +% cd adt-installer +\end{verbatim} +\end{frame} + +\begin{frame} +\frametitle{configure ADT installer} +general configuration +\begin{description} +\item[YOCTOADT\_REPO] http repo with rootfs images and ipkg packages. + Needs to match the layout from 'http://adtrepo.yoctoproject.org' +\item[YOCTOADT\_TARGETS] machine target architectures to setup cross SDKs +\item[YOCTOADT\_QEMU] install qemu? \[Y/N\] +\item[YOCTOADT\_NFS\_UTIL] needed for eclipse \[Y/N\] +\end{description} +\end{frame} + +\begin{frame} +\frametitle{configure ADT installer \#2} +configuration for each supported BSP +\begin{description} +\item[YOCTOADT\_TARGET\_MACHINE\_] qemu that should be used, e.g. qemux86 +\item[YOCTOADT\_ROOTFS\_] rfs images that should be used, e.g. sato-sdk +\item[YOCTOADT\_TARGET\_SYSROOT\_] needs to match above variable +\item[YOCTOADT\_TARGET\_SYSROOT\_LOC\_] path where the sysroot will be + stored +\end{description} +\end{frame} + +\begin{frame}[fragile] +\frametitle{run ADT installer} +\begin{verbatim} +adt-installer % ./adt_installer +Please enter the install location (default: /opt/poky/2.0): +... +[ADT_INST] Please enter your selections here: +S +... +\end{verbatim} +\pause +to use the ADT, the environment needs to be sourced: +\begin{verbatim} +% . /opt/poky/2.0/environment-setup-i586-poky-linux +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{ADT \& Eclipse} +install and start eclipse: +\begin{verbatim} +% wget http://ftp.fau.de/eclipse/technology/epp/downloads/release/kepler/R/eclipse-cpp-kepler-R-linux-gtk.tar.gz +% tar xzf eclipse-*.tar.gz +% ./eclipse/eclipse +\end{verbatim} +\pause +add the yocto update-site (Help, Install New Software, Add\dots) +\begin{verbatim} +http://downloads.yoctoproject.org/releases/eclipse-plugin/1.9/kepler/ +\end{verbatim} +select and install all components, by clicking + +'Next, Next, Accept Licenses, Finish, Accept installing from insecure source, +and accept to restart eclipse' +\pause +goto 'Help, Install New Software, Add\dots' again and +select 'Kepler' as update site and select 'Linux Tools' and +'Mobile and Device Development'; select 'Next' until you can +'Finish' and quit eclipse +\end{frame} + +\begin{frame} +\frametitle{configure Eclipse} +\begin{itemize} + \item select 'Window, Preferences, Yocto Project ADT' + \item select 'Standalone pre-built toolchain' + \item set Toolchain Root Location '/home/devel/sdk' + \item set Sysroot Location '/home/devel/sdk/core-image-minimal' + \item use 'native' as 'Target Options' + \item 'Apply' the Settings and close the dialog with 'OK' +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Hello World example} +\begin{itemize} + \item select 'File, New, Project\dots' + \item select 'C/C++, C Project' + \item select 'Yocto Project ADT Autotools Project, Hello World ANSI C Project' + \item enter a 'Project name' and select 'Next' + \item enter 'Basic settings' and select 'Finish' + \item if opened, close the 'Welcome' window + \item right click on the root project folder and select 'Reconfigure Project' + \item right click on the root project folder and select 'Build Project' +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{remote execution and debugging} +\begin{itemize} + \item switch to 'Remote System Explorer' perspective + \item create a new 'TCF' connection + \item switch to 'C/C++' perspective and select 'Run / Debug Configurations' + \item select the preconfigured 'C/C++ Application' and select the correct + 'Connection' + \item set 'Remote Absolute File Path' to sth. like '/usr/bin/' + \item select 'Apply', 'Debug' - Next time you can use this preconfigured debug + configuration +\end{itemize} +\end{frame} diff --git a/distribution/yocto-basic/yocto-imgbuild-predefined.tex b/distribution/yocto-basic/yocto-imgbuild-predefined.tex new file mode 100644 index 0000000..fb74586 --- /dev/null +++ b/distribution/yocto-basic/yocto-imgbuild-predefined.tex @@ -0,0 +1,13 @@ +\begin{frame}[fragile] +\frametitle{build a predefined image} +edit the local build configuration './conf/local.conf' +\begin{verbatim} +DL_DIR ?= "${TOPDIR}/../downloads" +PACKAGE_CLASSES ?= "package_deb" +EXTRA_IMAGE_FEATURES = "debug-tweaks eclipse-debug" +\end{verbatim} +and start the image build +\begin{verbatim} +% bitbake core-image-minimal +\end{verbatim} +\end{frame} diff --git a/distribution/yocto-basic/yocto-imgbuild1.tex b/distribution/yocto-basic/yocto-imgbuild1.tex new file mode 100644 index 0000000..7437ab7 --- /dev/null +++ b/distribution/yocto-basic/yocto-imgbuild1.tex @@ -0,0 +1,13 @@ +\subsection{Images} +\begin{frame} +\frametitle{basics} +\begin{itemize} +\item images are constructed using the packages built earlier and put into the + Package Feeds +\item decisions of what to install on the image is based on the minimum + defined set of required components in an image recipe +\item this minimum set is then expanded based on dependencies to produce a + package solution +\item variety of formats (tar.bz2, ext2, ext3, jffs, \dots) are supported +\end{itemize} +\end{frame} diff --git a/distribution/yocto-basic/yocto-imgbuild2.tex b/distribution/yocto-basic/yocto-imgbuild2.tex new file mode 100644 index 0000000..b6a04bb --- /dev/null +++ b/distribution/yocto-basic/yocto-imgbuild2.tex @@ -0,0 +1,265 @@ +\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} +├── % cat sstate-control/manifest-. +| /home/devel/poky/build/tmp/sysroots/x86_64-linux/usr/include/zconf.h +| /home/devel/poky/build/tmp/sysroots/x86_64-linux/usr/include/zlib.h +| /home/devel/poky/build/tmp/sysroots/x86_64-linux/usr/lib/libz.so.1 +\end{verbatim} +\pause +\begin{verbatim} +├── 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{execute a specific task} +\begin{verbatim} +bitbake -c +\end{verbatim} +use +\begin{verbatim} +bitbake -c listtasks +\end{verbatim} +to get a list of all available tasks +\end{frame} + +\begin{frame}[fragile] +\frametitle{build dependencies} +dependency graphs (sucks because they're really huge) +\begin{verbatim} +bitbake -g +\end{verbatim} +\pause +it is better to use the dependency explorer +\begin{verbatim} +bitbake -g -u depexp +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{developer shell} +\begin{verbatim} +bitbake -c devshell +\end{verbatim} +use ./configure and make to debug build issues +\end{frame} + +\begin{frame}[fragile] +\frametitle{cleanup} +\begin{verbatim} +% bitbake -c clean 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} +To start from scratch backup the conf directory +and remove everything from build. Otherwise +sstate-cache will be used. +\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 restoring files from sstate-cache +\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-cache +\item triggers fetch, compilation and packaging of the component +\item BUT changes will not be in the image +\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} diff --git a/distribution/yocto-basic/yocto-workflow.tex b/distribution/yocto-basic/yocto-workflow.tex new file mode 100644 index 0000000..3810acb --- /dev/null +++ b/distribution/yocto-basic/yocto-workflow.tex @@ -0,0 +1,681 @@ +\subsection{Workflow} +\begin{frame}[fragile] +\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/krogoth -b krogoth -t +\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 is modified to find the commands +\item non-bash shells are not supported +\end{itemize} +\begin{verbatim} +% . ./oe-init-buildenv +\end{verbatim} +\begin{itemize} +\item is used to modify the environment and change the CWD to +\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 +\item base.bbclass is automatically included by all other classes and recipes. +\item common tasks and there 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 a .bb file inherits classes and populates them with data +\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 +\item used to isolate different types of customizations from each other +\item e.g. own layer for machine specific stuff, one for own applications +\item extend, add, replace or modify recipes +\item add or replace class files +\item 'conf/layer.conf' is used to configure the layer +\item are added and ordered via BBLAYERS variable in build/conf/bblayers.conf +\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 (i.e. meta-yocto) +\item BSP/machine settings (i.e. meta-yocto-bsp) +\item functional areas (selinux, networking, etc) +\item project specific changes +\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 +\item extract sources +\item patch sources +\item configure sources +\item compilation +\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: +\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 in the Build Directory where unpacked recipe source code resides. +\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 +\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{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 +\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. +\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 = ":///;;" +\end{verbatim} +\pause +multiple urls can be set in a SRC\_URI variable: +\begin{verbatim} +SRC_URI = ";name=url1 ;name=url2" +\end{verbatim} +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} +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}[fragile] +\frametitle{local SRC\_URI (file://)} +The path is relative to the FILESPATH variable. To modify the FILESPATH use +FILESEXTRAPATH. +\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 | grep FILESPATH +\end{verbatim} +\end{frame} + +\begin{frame} +\frametitle{remote SRC\_URI} +\begin{description} +\item[bzr://]Bazaar revision control repository +\item[git://]Git revision control repository +\item[osc://]OSC (OpenSUSE Build service) revision control repository +\item[ccrc://]ClearCase repository +\item[http://]Internet using http +\item[https://]Internet using https +\item[ftp://]Internet using ftp +\item[cvs://]CVS revision control repository +\item[hg://]Mercurial (hg) revision control repository +\item[p4://]Perforce (p4) revision control repository +\item[ssh://]secure shell +\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 mindate +\item[maxdate] apply patch only if SRCDATE is not later than maxdate +\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 +\item[rev] apply patch only if SRCREV is equal to rev +\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 +\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 +\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 autotools +\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 + \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} +_.bbappend +\end{verbatim} +\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} + +\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 +\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} + +\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/* + \item settings can be splitted in different include *.inc files + \item e.g. one include for CPU that is used by the SoC inc file, +that is used by the Board .conf file + \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 + \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{hardware} +\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, apm, bluetooth, ext2, irda, keyboard, pci, pcmcia, + screen, serial, touchscreen, usbgadget, usbhost, 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{software} +\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} diff --git a/lx-trainer-vm/dd-dual.sh b/lx-trainer-vm/dd-dual.sh index 0fdec98..1881221 100755 --- a/lx-trainer-vm/dd-dual.sh +++ b/lx-trainer-vm/dd-dual.sh @@ -4,11 +4,13 @@ dd if=/dev/zero of=/dev/sdb bs=512 count=1 dd if=/dev/zero of=/dev/sdc bs=512 count=1 dd if=/dev/zero of=/dev/sdd bs=512 count=1 +dd if=/dev/zero of=/dev/sde bs=512 count=1 sync partprobe cat build/lx-trainer.img | tee \ + >(dd of=/dev/sde) \ >(dd of=/dev/sdb) \ >(dd of=/dev/sdc) \ | dd of=/dev/sdd @@ -18,11 +20,13 @@ sync echo -e "n\np\n\n\n\nw" | fdisk /dev/sdb echo -e "n\np\n\n\n\nw" | fdisk /dev/sdc echo -e "n\np\n\n\n\nw" | fdisk /dev/sdd +echo -e "n\np\n\n\n\nw" | fdisk /dev/sde partprobe mkfs.ext4 -F -L lxhome /dev/sdb2 mkfs.ext4 -F -L lxhome /dev/sdc2 mkfs.ext4 -F -L lxhome /dev/sdd2 +mkfs.ext4 -F -L lxhome /dev/sde2 mount /dev/sdb2 /mnt mkdir /mnt/devel @@ -41,3 +45,9 @@ mkdir /mnt/devel chown 1000:1000 /mnt/devel cp -a home-overlay/* /mnt/ umount /mnt + +mount /dev/sde2 /mnt +mkdir /mnt/devel +chown 1000:1000 /mnt/devel +cp -a home-overlay/* /mnt/ +umount /mnt diff --git a/lx-trainer-vm/dd-single.sh b/lx-trainer-vm/dd-single.sh index fb66814..1c17f5e 100755 --- a/lx-trainer-vm/dd-single.sh +++ b/lx-trainer-vm/dd-single.sh @@ -1,14 +1,13 @@ #!/bin/bash -dd if=build/lx-trainer.img of=/dev/sdb +dd if=build/lx-trainer.img of=/dev/sdb bs=5M echo -e "n\np\n\n\n\nw" | fdisk /dev/sdb partprobe -mkfs.ext4 -F -L lxhome /dev/sdb2 +mkfs.ext4 -F -L scratch /dev/sdb2 mount /dev/sdb2 /mnt mkdir /mnt/devel -chown 1000:1000 /mnt/devel -cp -a home-overlay/* /mnt/ +cp -a scratch/* /mnt/ umount /mnt diff --git a/lx-trainer-vm/dd.sh b/lx-trainer-vm/dd.sh index caa09f1..44685bc 100755 --- a/lx-trainer-vm/dd.sh +++ b/lx-trainer-vm/dd.sh @@ -2,32 +2,41 @@ cat build/lx-trainer.img | tee \ >(dd of=/dev/sde) \ + >(dd of=/dev/sdb) \ >(dd of=/dev/sdc) \ | dd of=/dev/sdd -echo -e "n\np\n\n\n\nw" | fdisk /dev/sde +echo -e "n\np\n\n\n\nw" | fdisk /dev/sdb echo -e "n\np\n\n\n\nw" | fdisk /dev/sdc echo -e "n\np\n\n\n\nw" | fdisk /dev/sdd +echo -e "n\np\n\n\n\nw" | fdisk /dev/sde partprobe -mkfs.ext4 -F -L lxhome /dev/sde2 -mkfs.ext4 -F -L lxhome /dev/sdc2 -mkfs.ext4 -F -L lxhome /dev/sdd2 +mkfs.ext4 -F -L scratch /dev/sdb2 +mkfs.ext4 -F -L scratch /dev/sdc2 +mkfs.ext4 -F -L scratch /dev/sdd2 +mkfs.ext4 -F -L scratch /dev/sde2 -mount /dev/sde2 /mnt +mount /dev/sdb2 /mnt mkdir /mnt/devel chown 1000:1000 /mnt/devel -cp -a home-overlay/* /mnt/ +cp -a scratch/* /mnt/ umount /mnt mount /dev/sdc2 /mnt mkdir /mnt/devel chown 1000:1000 /mnt/devel -cp -a home-overlay/* /mnt/ +cp -a scratch/* /mnt/ umount /mnt mount /dev/sdd2 /mnt mkdir /mnt/devel chown 1000:1000 /mnt/devel -cp -a home-overlay/* /mnt/ +cp -a scratch/* /mnt/ +umount /mnt + +mount /dev/sde2 /mnt +mkdir /mnt/devel +chown 1000:1000 /mnt/devel +cp -a scratch/* /mnt/ umount /mnt -- cgit v1.2.3