From 79f9e5022dc4bc086dffa127c3991351b1c97f0b Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Mon, 2 Feb 2015 17:11:32 +0100 Subject: yocto: switch examples to beaglebone-black (not verified with real hardware at the moment) Signed-off-by: Manuel Traut --- .../yocto-advanced/pres_yocto-advanced.tex | 225 +++++++++++---------- 1 file changed, 116 insertions(+), 109 deletions(-) (limited to 'distribution/yocto-advanced/pres_yocto-advanced.tex') diff --git a/distribution/yocto-advanced/pres_yocto-advanced.tex b/distribution/yocto-advanced/pres_yocto-advanced.tex index ee821a2..881d21f 100644 --- a/distribution/yocto-advanced/pres_yocto-advanced.tex +++ b/distribution/yocto-advanced/pres_yocto-advanced.tex @@ -6,7 +6,7 @@ \begin{frame} \frametitle{Agenda} \begin{itemize} -\item Using BSP layers (sabrelite) +\item Using BSP layers (beaglebone) \item Build a predefined image (sabrelite) \item Creating a layer \item Define a distribution @@ -96,29 +96,30 @@ order of .conf or .bbclass files. Future versions of BitBake might address this. \frametitle{get an existing layer} retrive the layer from your BSP/SoC vendor \begin{verbatim} -poky % git clone -b daisy https://github.com/Freescale/meta-fsl-arm-extra +poky % git clone -b daisy git://git.yoctoproject.org/meta-ti \end{verbatim} have a look at it's dependencies \begin{verbatim} -poky % cat meta-fsl-arm-extra/conf/layer.conf | grep LAYERDEPENDS -LAYERDEPENDS_fsl-arm-extra = "core fsl-arm" +poky % cat meta-ti/conf/layer.conf | grep LAYERDEPENDS +LAYERDEPENDS_ti = "core" \end{verbatim} -and retrieve them also -\begin{verbatim} -poky % git clone -b daisy git://git.yoctoproject.org/meta-fsl-arm -\end{verbatim} -check dependencies again +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} \begin{verbatim} -poky % cat meta-fsl-arm/conf/layer.conf | grep LAYERDEPENDS +poky % git clone /home/devel/yocto/meta-mini \end{verbatim} -\dots no more dependencies?! \dots OK - finished. \end{frame} \begin{frame}[fragile] \frametitle{generate a new build environment} \begin{verbatim} -poky % . oe-init-build-env build-fsl -poky/build-fsl % +poky % . oe-init-build-env build-ti +poky/build-ti % \end{verbatim} \end{frame} @@ -127,8 +128,8 @@ poky/build-fsl % \frametitle{overview} builds are configured using two configuration files \begin{itemize} - \item build-fsl/conf/bblayers.conf - \item build-fsl/conf/local.conf + \item build-ti/conf/bblayers.conf + \item build-ti/conf/local.conf \end{itemize} \end{frame} @@ -154,15 +155,15 @@ meta-yocto-bsp /home/devel/poky/meta-yocto-bsp 5 \end{frame} \begin{frame}[fragile] -\frametitle{add fsl layers} +\frametitle{add ti layers} modify the BBLAYERS variable in bblayers.conf \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-ti \ + /home/devel/poky/meta-mini \ " \end{verbatim} \pause @@ -173,8 +174,8 @@ layer path priority meta /home/devel/poky/meta 5 meta-yocto /home/devel/poky/meta-yocto 5 meta-yocto-bsp /home/devel/poky/meta-yocto-bsp 5 -meta-fsl-arm /home/devel/poky/meta-fsl-arm 5 -meta-fsl-arm-extra /home/devel/poky/meta-fsl-arm-extra 4 +meta-ti /home/devel/poky/meta-ti 5 +meta-mini /home/devel/poky/meta-mini 5 \end{verbatim} \end{frame} @@ -182,18 +183,18 @@ meta-fsl-arm-extra /home/devel/poky/meta-fsl-arm-extra 4 \frametitle{overlayed recipes} to see which recipes replace official ones: \begin{verbatim} -poky/build-fsl % bitbake-layers show-overlayed +poky/build-ti % bitbake-layers show-overlayed Parsing recipes..done. === Overlayed recipes === directfb: meta 1.7.1 - meta-fsl-arm 1.6.3 + meta-ti 1.6.3 directfb-examples: meta 1.7.0 - meta-fsl-arm 1.6.0 + meta-ti 1.6.0 xserver-xorg: meta 2:1.15.0 - meta-fsl-arm 2:1.14.4 + meta-ti 2:1.14.4 \end{verbatim} \end{frame} @@ -222,11 +223,11 @@ is used to configure \frametitle{configure the machine} to get a list of currently available machines configs: \begin{verbatim} -poky/build-fsl % grep -r '@NAME' ../meta*/conf/machine +poky/build-ti % grep -r '@NAME' ../meta*/conf/machine \end{verbatim} -imx6qsabrelite.conf - seems to be the one for our bord, so set +beaglebone-black.conf - seems to be the one for our bord, so set \begin{verbatim} -MACHINE ??= "imx6qsabrelite" +MACHINE ??= "beaglebone-black" \end{verbatim} in conf/local.conf \end{frame} @@ -256,39 +257,51 @@ use \begin{verbatim} ls ../*/*/images/ \end{verbatim} -to get a list of predefined images; however none of them fits my needs\dots +\end{frame} + +\begin{frame}[fragile] +\frametitle{build a qt demo image} \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 - +poky/build-ti % source toaster start +poky/build-ti % bitbake qt4e-demo-image +Currently 4 running tasks (26 of 4459): \end{verbatim} -and edit conf/bblayers.conf, to match +\end{frame} + +\begin{frame}[fragile] +\frametitle{first errors and warnings} \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 \ - " +WARNING: Host distribution "Debian-8.0" has not been validated with this version +of the build system; you may possibly experience unexpected failures. It is +recommended that you use a tested distribution. +ERROR: OE-core's config sanity checker detected a potential misconfiguration. +Either fix the cause of this error or at your own risk disable the checker +see sanity.conf). +Following is the list of potential problems / advisories: + +libsdl-native is set to be ASSUME_PROVIDED but sdl-config can't be +found in PATH. Please either install it, or configure qemu not to +require sdl. +ERROR: Execution of event handler 'check_sanity_eventhandler' failed +ERROR: Command execution failed: Exited with 1 \end{verbatim} \end{frame} \begin{frame}[fragile] -\frametitle{build a fsl demo image} +\frametitle{disable sdl support in qemu} +edit conf/local.conf: \begin{verbatim} -poky/build-fsl % source toaster start -poky/build-fsl % bitbake qt-in-use-image -Currently 4 running tasks (26 of 4459): +# PACKAGECONFIG_pn-qemu-native = "sdl" +# PACKAGECONFIG_pn-nativesdk-qemu = "sdl" +# ASSUME_PROVIDED += "libsdl-native" \end{verbatim} +run 'bitbake qt4e-demo-image' again + \dots coffee break! \end{frame} \begin{frame}[fragile] -\frametitle{build a fsl demo image} +\frametitle{build a ti demo image} \dots back from coffee break \begin{verbatim} ERROR: No new tasks can be executed since the disk space monitor action is @@ -296,43 +309,44 @@ ERROR: No new tasks can be executed since the disk space monitor action is \end{verbatim} what happened?? \begin{verbatim} -poky/build-fsl % df -h +poky/build-ti % df -h Filesystem Size Used Avail Use% Mounted on /dev/sda4 367G 348G 850M 100% / -poky/build-fsl % du -sm . +poky/build-ti % du -sm . 31026 . -poky/build-fsl % du -sm ../build +poky/build-ti % du -sm ../build 29172 ../build/ \end{verbatim} \dots so the solution is to cleanup the disk and run \begin{verbatim} -poky/build-fsl % bitbake qt-in-use-image +poky/build-ti % bitbake qt4e-demo-image \end{verbatim} again. + +A different behaviour can be configured in 'conf/local.conf'. \end{frame} \begin{frame}[fragile] -\frametitle{build a fsl demo image} -\dots one more error +\frametitle{example of an issue with a sabrelite board} \begin{verbatim} ERROR: To use 'gpu-viv-bin-mx6q' you need to accept the Freescale EULA -at '/home/local/src/poky/meta-fsl-arm/EULA'. Please read it and in case +at '/home/local/src/poky/meta-ti-arm/EULA'. Please read it and in case you accept it, write: ACCEPT_FSL_EULA = "1" in your local.conf. ERROR: Function failed: do_unpack -ERROR: Logfile of failure stored in: /home/local/src/poky/build-fsl/tmp +ERROR: Logfile of failure stored in: /home/local/src/poky/build-ti/tmp /work/cortexa9hf-vfp-neon-mx6-poky-linux-gnueabi/gpu-viv-bin-mx6q/1_3.1 0.17-1.0.0-hfp-r0/temp/log.do_unpack.6795 -ERROR: Task 1105 (/home/local/src/poky/meta-fsl-arm/recipes-graphics/gp +ERROR: Task 1105 (/home/local/src/poky/meta-ti-arm/recipes-graphics/gp u-viv-bin-mx6q/gpu-viv-bin-mx6q_3.10.17-1.0.0-hfp.bb, do_unpack) failed with exit code '1' \end{verbatim} to solve this issue: \begin{verbatim} -poky/build-fsl % echo 'ACCEPT\_FSL\_EULA = "1"' >> conf/local.conf +poky/build-ti % echo 'ACCEPT\_FSL\_EULA = "1"' >> conf/local.conf \end{verbatim} \dots and run \begin{verbatim} -poky/build-fsl % bitbake qt-in-use-image +poky/build-ti % bitbake qt4e-demo-image \end{verbatim} again. \end{frame} @@ -341,12 +355,32 @@ again. \frametitle{flashing the image} if the build is completed the image can be transfered to a sdcard: \begin{verbatim} -poky/build-fsl % sudo dd \ -if=tmp/deploy/images/imx6qsabrelite/qt-in-use-image-imx6qsabrelite.sdcard \ -of=/dev/mmcblk0 bs=1M -412+0 records in -412+0 records out -432013312 bytes (432 MB) copied, 90.4824 s, 4.8 MB/s +poky/build-ti % sudo fdisk /dev/mmcblk0 +# create a bootable primary partition with about 100 MB and Windows vFat format +# and a secondary partition with Linux Ext format +poky/build-ti % sudo mkfs.vfat /dev/mmcblk0p1 +poky/build-ti % sudo dd \ +if=tmp/deploy/images/beaglebone-black/qt4e-demo-image-beaglebone-black.ext3 \ + of=/dev/mmcblk0p2 bs=1M +poky/build-ti % sudo mount /dev/mmcblk0p2 /mnt +poky/build-ti % sudo tar xzf tmp/deploy/images/modules-beaglebone-black.tgz -C \ + /mnt +poky/build-ti % sudo umount /mnt +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{flashing the image} +poky/build-ti % sudo mount /dev/mmcblk0p1 /mnt +poky/build-ti % sudo cp -a tmp/deploy/images/beaglebone-black/MLO \ + /dev/mmcblk0p1 /mnt +poky/build-ti % sudo cp -a tmp/deploy/images/beaglebone-black/u-boot* \ + /dev/mmcblk0p1 /mnt +poky/build-ti % sudo cp -a tmp/deploy/images/beaglebone-black/zImage \ + /dev/mmcblk0p1 /mnt +poky/build-ti % sudo cp -a tmp/deploy/images/beaglebone-black/*.dtb \ + /dev/mmcblk0p1 /mnt +poky/build-ti % sudo umount /mnt \end{verbatim} \end{frame} @@ -354,8 +388,8 @@ of=/dev/mmcblk0 bs=1M \begin{frame}[fragile] \frametitle{with yocto helper script} \begin{verbatim} -poky/build-fsl % cd .. -poky % yocto-layer create linutronix +poky/build-ti % cd .. +poky % yocto-layer create mini Please enter the layer priority you'd like to use for the layer: [default: 6] Would you like to have an example recipe created? (y/n) [default: n] @@ -368,10 +402,10 @@ Would you like to have an example bbappend file created? (y/n) [default: n] \begin{frame}[fragile] \frametitle{manage the layer with git} \begin{verbatim} -poky % cd meta-linutronix -poky/meta-linutronix % git init . -poky/meta-linutronix % git add * -poky/meta-linutronix % git commit -sam 'inital version' +poky % cd meta-mini +poky/meta-mini % git init . +poky/meta-mini % git add * +poky/meta-mini % git commit -sam 'inital version' \end{verbatim} \end{frame} @@ -483,7 +517,7 @@ it can be used, to simplify image definitions \begin{frame}[fragile] \frametitle{linutronix distribution} distros are defined in a layer, e.g. -meta-linutronix/conf/distro/linutronix.conf: +meta-mini/conf/distro/linutronix.conf: \begin{verbatim} DISTRO = "linutronix" DISTRO_NAME = "linutronix 1.0 (for foo devices)" @@ -502,29 +536,8 @@ DISTRO_FEATURES_append = " opengl" \begin{frame}[fragile] \frametitle{add distro to git repo} \begin{verbatim} -poky/meta-linutronix % git add conf/distro/linutronix.conf -poky/meta-linutronix % git commit -sam 'add linutronix distro' -\end{verbatim} -\end{frame} - -\begin{frame}[fragile] -\frametitle{enable linutronix layer} -\begin{verbatim} -poky/meta-linutronix % cd ../build-fsl -poky/build-fsl % edit conf/bblayers.conf -\end{verbatim} -to match -\begin{verbatim} -BBLAYERS ?= " \ - /home/local/src/poky/meta \ - /home/local/src/poky/meta-yocto \ - /home/local/src/poky/meta-yocto-bsp \ - /home/local/src/poky/meta-fsl-arm \ - /home/local/src/poky/meta-fsl-arm-extra \ - /home/local/src/poky/meta-openembedded/meta-oe \ - /home/local/src/poky/meta-fsl-demos \ - /home/local/src/poky/meta-linutronix \ - " +poky/meta-mini % git add conf/distro/linutronix.conf +poky/meta-mini % git commit -sam 'add linutronix distro' \end{verbatim} \end{frame} @@ -540,7 +553,7 @@ DISTRO ?= "linutronix" \begin{frame}[fragile] \frametitle{based on core-image class} \begin{verbatim} -poky/build-fsl % bitbake-layers show-recipes | grep ssh +poky/build-ti % bitbake-layers show-recipes | grep ssh Parsing recipes..done. libssh: openssh: @@ -548,14 +561,14 @@ packagegroup-core-ssh-dropbear: packagegroup-core-ssh-openssh: \end{verbatim} create the file -'meta-linutronix/recipes-bsp/linutronix-image/linutronix-image.bb' +'meta-mini/recipes-bsp/linutronix-image/linutronix-image.bb' \begin{verbatim} IMAGE_INSTALL += "openssh" inherit core-image \end{verbatim} to build the image, use: \begin{verbatim} -poky/build-fsl % bitbake linutronix-image +poky/build-ti % bitbake linutronix-image \end{verbatim} \end{frame} @@ -570,7 +583,7 @@ t.b.d. use IMAGE\_FEATURES \subsection{Writing recipes} \begin{frame}[fragile] \frametitle{adding a kernel} -create the file 'meta-linutronix/recipes-bsp/linux-sabrelite/linux-sabrelite\_3.16.bb': +create the file 'meta-mini/recipes-bsp/linux-sabrelite/linux-sabrelite\_3.16.bb': \begin{verbatim} SECTION = "kernel" DESCRIPTION = "Linux 3.16 for sabrelite" @@ -581,8 +594,8 @@ inherit kernel require recipes-kernel/linux/linux-dtb.inc require recipes-kernel/linux/setup-defconfig.inc -COMPATILBE_MACHINE = "imx6qsabrelite" -KERNEL_DEVICETREE_imx6qsabrelite = "arch/arm/boot/dts/imx6q-sabrelite.dts" +COMPATILBE_MACHINE = "beaglebone-black" +KERNEL_DEVICETREE_beaglebone-black = "arch/arm/boot/dts/imx6q-sabrelite.dts" S = "${WORKDIR}/git BRANCH = "master" @@ -602,7 +615,7 @@ KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}" \begin{frame}[fragile] \frametitle{adding a defconfig} copy your .config file to -'meta-linutronix/recipes-bsp/linux-sabrelite/files/imx6qsabrelite/defconfig' +'meta-mini/recipes-bsp/linux-sabrelite/files/beaglebone-black/defconfig' \end{frame} \begin{frame}[fragile] @@ -611,7 +624,7 @@ add \begin{verbatim} PREFERRED_PROVIDER_virtual/kernel = "linux-sabrelite" \end{verbatim} -to meta-linutronix/conf/distro/linutronix.conf +to meta-mini/conf/distro/linutronix.conf \end{frame} \begin{frame}[fragile] @@ -658,7 +671,7 @@ autotools and cmake based projects and qt applications. \frametitle{as simple as posible} use this folder layout \begin{verbatim} -poky/meta-linutronix/recipes-hello % tree +poky/meta-mini/recipes-hello % tree hello ├── files │   └── hello.c @@ -812,10 +825,4 @@ PNBLACKLIST[exoticware] = "Not supported by our organization." \end{verbatim} \end{frame} -\subsection{Yocto \& ELBE} -\begin{frame} -\frametitle{Yocto \& ELBE combined} - bla -\end{frame} - \input{tailpres} -- cgit v1.2.3