From 5d9043ce4f07dbc63a2996874e798de4a83538c2 Mon Sep 17 00:00:00 2001
From: Manuel Traut <manut@linutronix.de>
Date: Tue, 27 Nov 2018 22:57:33 +0100
Subject: add 'yocto-layer-example'

This is a first attemp to create a new slideset for day2 of yocto-trainig.

The slideset is based on 'yocto-advanced' but with integration of
'meta-schulung' explanations.

I used a slightly modified version of 'meta-schulung'. The following changes
are currently not available in git:

I don't use linux-yocto in meta-schulung, but use an own kernel-recipe and
integrate the RT-PREEMPT patch.

wic: i can't see the need for the second partition and the need for huge files
in the kconfig. It works for me by adding ' --align 1024 ' to the wic setup.
I decided to use ext2 instead of ext4.

I renamed the rootfs.bb file into schulung-base.bb

I use the u-boot recipe from poky. However i don't use u-boot for anything atm.
  But bootloader is on our agenda..

Signed-off-by: Manuel Traut <manut@linutronix.de>
---
 distribution/yocto-example-layer/application.tex | 64 ++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 distribution/yocto-example-layer/application.tex

(limited to 'distribution/yocto-example-layer/application.tex')

diff --git a/distribution/yocto-example-layer/application.tex b/distribution/yocto-example-layer/application.tex
new file mode 100644
index 0000000..801a645
--- /dev/null
+++ b/distribution/yocto-example-layer/application.tex
@@ -0,0 +1,64 @@
+\subsection{Applications}
+\begin{frame}
+\frametitle{Adding own applications}
+\begin{itemize}
+\item Recipe already available? check http://layers.openembedded.org
+\item Look for a similar recipe
+\item Proper bbclass available?
+\end{itemize}
+On the next slides, we have a look what is useful for very simple applications,
+autotools and Cmake based projects and QT applications.
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Simple (overview)}
+file layout
+\begin{verbatim}
+example
+├── files
+│   └── example.c
+└── example_0.1.bb
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Simple (add source)}
+\begin{lstlisting}
+$ cd ~/poky/meta-schulung
+$ mkdir -p recipes-example/example/files
+$ pluma recipes-example/example/files/example.c
+\end{lstlisting}
+\begin{verbatim}
+#include <stdio.h>
+int main(int argc, char **argv) {
+    printf("Hello, world!\n");
+    return 0;
+}
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Simple (add recipe)}
+\begin{lstlisting}
+$ cd ~/poky/meta-schulung
+$ pluma recipes-example/example/example_0.1.bb
+\end{lstlisting}
+\begin{verbatim}
+DESCRIPTION = "Simple Example"
+LICENSE = "CLOSED"
+
+SRC_URI = "file://example.c"
+
+do_compile() {
+   $CC $CFLAGS -o example ${WORKDIR}/example.c $LDFLAGS
+}
+
+do_install() {
+   install -D -m 0755 example ${D}${base_bindir}/example
+}
+\end{verbatim}
+\begin{lstlisting}
+$ cd ~/poky/build-schulung
+$ bitbake example
+\end{lstlisting}
+\end{frame}
-- 
cgit v1.2.3

