From f8b811b951def89677e6c38d04f653d79885de4d Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Fri, 3 Jan 2014 17:07:59 +0100 Subject: update to elbe v0.5.5-git Signed-off-by: Manuel Traut --- distribution/elbe-usage/pres_elbe-usage_en.tex | 393 ++++++++++++++++--------- 1 file changed, 248 insertions(+), 145 deletions(-) diff --git a/distribution/elbe-usage/pres_elbe-usage_en.tex b/distribution/elbe-usage/pres_elbe-usage_en.tex index 8e37ad5..7965509 100644 --- a/distribution/elbe-usage/pres_elbe-usage_en.tex +++ b/distribution/elbe-usage/pres_elbe-usage_en.tex @@ -15,7 +15,7 @@ ELBE is a Debian based system to generate root-filesystems for embedded devices \begin{verbatim} # On a Debian based system $ echo 'deb http://debian.linutronix.de/elbe \ -squeeze main' >> /etc/apt/sources.list +wheezy main' >> /etc/apt/sources.list $ aptitude install elbe \end{verbatim} Or get the latest source from github: @@ -25,7 +25,7 @@ git clone https://github.com/Linutronix/elbe.git \end{frame} \begin{frame} -\frametitle{ELBE: Overview} +\frametitle{Overview} \begin{itemize} \item The Elbe system consists of the program elbe which is implemented in Python \item Similar to git, it can be called with several sub commands @@ -34,10 +34,11 @@ git clone https://github.com/Linutronix/elbe.git \end{frame} \begin{frame} -\frametitle{ELBE: Documentation} +\frametitle{Documentation} \begin{itemize} \item Have a look at /usr/share/doc/elbe/ \item Please read /usr/share/doc/elbe/elbeoverview-en.html +\item There are man pages e.g. 'man elbe', 'man elbe-create', \dots \end{itemize} \end{frame} @@ -60,50 +61,151 @@ git clone https://github.com/Linutronix/elbe.git \begin{frame} \frametitle{The ELBE workflow} \begin{enumerate} -\item Create an XML file +\item Create a XML file \item Create a project based on that XML file \item Change to the project directory an run make \end{enumerate} \end{frame} \begin{frame}[fragile] -\frametitle{ELBE: command overview} +\frametitle{command overview} Create a new project: \begin{verbatim} -elbe create \ +$ elbe create \ --directory /home/user/example example.xml \end{verbatim} \end{frame} \begin{frame}[fragile] -\frametitle{ELBE: start build} +\frametitle{start build} \begin{verbatim} -cd /home/user/example -# Note: the next step might take a while -make +$ cd /home/user/example +$ ls -a +. .. .elbe-in Makefile +$ make \end{verbatim} +.elbe-in contains the files needed inside the virtual build machine \end{frame} \begin{frame}[fragile] -\frametitle{ELBE: Using the VM} +\frametitle{generated files} \begin{verbatim} -cd /home/user/example -make run -# or (without graphics) -make run-con +$ ls -a +. elbe-report.txt sdcard.img +.. install.iso source.xml +buildenv.img licence.txt .stamps +.elbe-gen Makefile validation.txt +.elbe-in rootfs.tar.gz \end{verbatim} \end{frame} +\begin{frame} +\frametitle{buildenv.img} +\begin{itemize} +\item Qemu HD image containing a complete Debian system +\item was used to generate the RFS for the target +\item can be used as build environment for own applications +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{.elbe-gen} +\begin{itemize} +\item files generated by the Makefile +\item including the modified initrd that contains the debian-installer +\item and a list containing the files that are copied from the buildenv to the +host PC +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{elbe-report.txt} +\begin{itemize} +\item logfile of the build process in asciidoc format +\item 'asciidoc elbe-report.txt' generates a html file +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{install.iso} +\begin{itemize} +\item ISO image that contains all used packages +\item the --skip-cds parameter of 'elbe create' can be used to skip the + generation of the image +\item the --build-source parameter of 'elbe create' can be used to also generate + a cdrom image that contains all Debian source packages +\item All mirrors configured in an elbe XML file can be replaced by an ISO image + using the command 'elbe setcdrom' +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{licence.txt} +\begin{itemize} +\item contains the licence text of all used debian packages +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{rootfs.tar.gz, sdcard.img} +\begin{itemize} +\item Images or archives containing the target RFS +\item The 'target' section in the XML file describes which image and archive + files are created; the 'fstab' section describes their content. +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{source.xml} +\begin{itemize} +\item based on the XML file given to 'elbe create' +\item added a 'fullpkgs' section containing informations about all installed + packages and their version +\item added a 'sources\_list' section that contains the used mirrors +\item added a 'apt\_prefs' section that contains the pinning settings +\item added a 'elbe\_version' section that contains the version number of + the elbe tool that generated the file +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{.stamps} +\begin{itemize} +\item status information used by the Makefile +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{validation.txt} +\begin{itemize} +\item if elbe create was called with a XML file containing a 'fullpkgs' section + the file contains informations if a package version differs +\item if a package in the 'pkg-list' was not found on one of the mirrors this + will be logged in this file +\end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Using the VM} +\begin{verbatim} +$ make run +\end{verbatim} +A Qemu with the buildenv.img will be started. +\end{frame} + \begin{frame}[fragile] \frametitle{The ELBE XML format} -/usr/share/doc/elbe/examples/ contains a couple of examples: +/usr/share/doc/elbe/examples/ contains a couple of examples that can be used +as templates for an own project: \begin{verbatim} -$ ls -1 /usr/share/doc/elbe/examples/ -amd64-example.xml -arm-complex-example.xml.gz -arm-example.xml -i386-example.xml +$ ls /usr/share/doc/elbe/examples/ +amd64-example.xml beaglebone.xml +arm-complex-example.xml i386-example.xml +arm-example.xml ppc-example.xml +arm-wheezy-example.xml x86-example.xml \end{verbatim} +Take a look at the different modes and finetuning sections. Also various +iamge generation methods are used. \end{frame} \begin{frame}[fragile] @@ -114,7 +216,12 @@ i386-example.xml ARMexample 08.15 -... + + creates an UBI based target system without debian package management + tools for version control and package build are added to the buildimage + + armel + ... \end{lstlisting} \end{scriptsize} @@ -128,30 +235,17 @@ i386-example.xml ... - debian.tu-bs.de + ftp.de.debian.org /debian http - http://debian.linutronix.de/elbe squeeze main + http://debian.linutronix.de/elbe wheezy main + http://debian.linutronix.de/elbe wheezy main -... - -\end{lstlisting} -\end{scriptsize} -\end{frame} - -\begin{frame}[fragile] -\frametitle{The ELBE XML format: Project setup} -\lstset{language=XML} -\begin{scriptsize} -\begin{lstlisting} - -... - squeeze ... \end{lstlisting} @@ -165,29 +259,15 @@ i386-example.xml \begin{lstlisting} ... + wheezy - armel - 20G - 256 - qemu-system-arm - testrd - ttyAMA0,115200n1 - versatilepb - - smc91c111 - de:ad:be:ef:be:05 - - - - tcp - 22 - 5022 - - + elbe-bootstrap + build-essential + debhelper + git -... \end{lstlisting} \end{scriptsize} @@ -209,62 +289,30 @@ i386-example.xml + usr/share/doc + /usr/share/doc - build-essential bash - less - git - debhelper - nfs-common - openssh-server \end{lstlisting} \end{scriptsize} \end{frame} -\begin{frame}[fragile] -\frametitle{The ELBE XML format: finetuning} -\lstset{language=XML} -\begin{scriptsize} -\begin{lstlisting} - -... - - /usr/share/doc - /var_ro - /my/name/on/target - -... - -\end{lstlisting} -\end{scriptsize} -\end{frame} - -\begin{frame}[fragile] -\frametitle{The ELBE XML format: finetuning} -\lstset{language=XML} -\begin{scriptsize} -\begin{lstlisting} - -... - - cp /etc/passwd etc/ - -... - -\end{lstlisting} -\end{scriptsize} -\end{frame} \begin{frame} \frametitle{ELBE modes} \begin{itemize} -\item default -\item norecommend (can be combined with any of the other modes): Don't install recommended packages -\item setsel: The resulting image will just contain dpkg. This mode offers a finegrained control on which packages should be installed -\item diet: Only copy files referenced in the package management. Only use this for small and simple root filesystems! +\item norecommend (can be combined with any of the other modes): + Don't install recommended packages +\item default: target is a copy of the buildenv +\item diet: Only copy files referenced in the package management. + Only use this for small and simple root filesystems! +\item setsel: The resulting image will just contain dpkg. + This mode offers a finegrained control on which packages should be installed +\item tighten: ignore dependencies, this is useful for very minimalistic busybox + based systems. Normally setsel mode should be used. \end{itemize} \end{frame} @@ -277,7 +325,6 @@ i386-example.xml ... - bash @@ -288,15 +335,21 @@ i386-example.xml \end{frame} \begin{frame}[fragile] -\frametitle{ELBE command overview: elbe-setsel} +\frametitle{elbe-setsel usage} \begin{enumerate} \item Create package list: \begin{verbatim} -dpkg --get-selections > selections.list +hostpc$ make run-con +# remove all pkgs not wanted on the target +target$ dpkg --purge vim-nox libxml2-dev +# export installed package list +target$ dpkg --get-selections > selections.list +# copy list to hostpc +target$ scp selections.list 10.0.2.2:/tmp \end{verbatim} \item Import the package list to your xml file: \begin{verbatim} -elbe setsel selections.list +hostpc$ elbe setsel rfs.xml /tmp/selections.list \end{verbatim} \end{enumerate} \end{frame} @@ -304,56 +357,57 @@ elbe setsel selections.list \begin{frame}[fragile] \frametitle{Using a CDROM} \begin{itemize} -\item Each ELBE build will create a CD-ROM image with the package (which have been used for the installation): install.iso -\item You can use this ISO image for future builds: -\begin{verbatim} - -/home/user/elbe-exmpl/install.iso - -\end{verbatim} -\item You can also use the elbe-setcdrom command +\item Each ELBE build will create a CD-ROM image with the packages + needed for an elbe image build. +\item this ISO image can be used for future builds: \end{itemize} -\end{frame} - -\begin{frame}[fragile] -\frametitle{ELBE command overview: elbe-setcdrom} \begin{verbatim} -$ elbe setcdrom mysqueeze.xml \ +$ elbe setcdrom rfs.xml \ /home/user/elbe-test/install.iso \end{verbatim} -This command removes all configured mirrors and additional urls from the XML file and sets the given ISO image as the only mirror. +This command removes all configured mirrors and additional urls from the XML +file and sets the given ISO image as the only mirror. \end{frame} \begin{frame}[fragile] -\frametitle{ELBE command overview: elbe-chg\_archive} -It is possible to include an archive into the xml file, that is unpacked into the target root-filesystem after the finetuning step: +\frametitle{elbe-chg\_archive} +It is possible to include an archive into the xml file, that is unpacked into +the target RFS before and after the finetuning step: \begin{verbatim} -elbe chg_archive archive.tar.bz2 +$ mkdir archive/testd +$ cd archive +$ echo 'port = 1234' > archive/testd/myconfig +$ tar cjf ../archive.tar.bz2 * +$ cd .. +$ elbe chg_archive archive.tar.bz2 \end{verbatim} NOTE: The file must be a bzip2 compressed tar (.tar.bz2) \end{frame} \begin{frame}[fragile] -\frametitle{ELBE command overview: elbe-get\_archive} +\frametitle{elbe-get\_archive} It is also possible to extract an archive from an XML file: \begin{verbatim} -elbe get_archive +$ elbe get_archive \end{verbatim} \end{frame} \begin{frame}[fragile] -\frametitle{ELBE command overview: elbe-show} -The elbe show command prints out some textual information about an ELBE xml file: +\frametitle{elbe-show} +The elbe show command prints out some textual information about an +ELBE xml file: \begin{verbatim} -$ elbe show arm-example.xml +$ elbe show --verbose arm-example.xml == arm-example.xml: ARMexample - version 08.15 == -Debian suite: squeeze/armel +Debian suite: wheezy/armel [...] \end{verbatim} +The '--verbose' parameter shows more informations, like the complete package +list. \end{frame} \begin{frame}[fragile] -\frametitle{ELBE command overview: elbe-xsdtoasciidoc} +\frametitle{elbe-xsdtoasciidoc} Create an asciidoc documentation from an annotated XML Schema file \begin{verbatim} # Create asciidoc format @@ -361,8 +415,62 @@ $ elbe xsdtoasciidoc --output=myasciidoc dbsfed.xsd # Create HTML doc $ asciidoc myasciidoc \end{verbatim} +This is used to create the documentation of the ELBE XML schema. +\end{frame} + +\begin{frame}[fragile] +\frametitle{elbe-checkupdates} +Use a source.xml file to check if there are updates available for an existing +image: +\begin{verbatim} +$ elbe check_updates source.xml +checking /home/user/rfs/build-release/source.xml +armel +Reading package lists... Done +Building dependency tree... Done +Reading package lists... Done +Building dependency tree... Done +adduser 3.113+nmu1 != 3.113+nmu3 +1 updates required +\end{verbatim} +This can be used e.g. as cronjob to get notifications if updates are availabe. + +Than the person responsible for updates can decide what needs to be done. +\end{frame} + +\begin{frame}[fragile] +\frametitle{elbe-diff} +compares to RFS trees and suggests commands to update the archive tar and a +'finetuning' section: +\begin{verbatim} +$ sudo elbe diff rfs rfs-modified +suggesting: + +/etc/init.d/mountall-bootclean.sh +/etc/init.d/bootmisc.sh +tar rf archive.tar -C build/rfs /sbin/dhclient-script +tar rf archive.tar -C build/rfs /etc/init.d/mountfstab.sh +\end{verbatim} +This can be used if a (nfsroot) filesystem was modified and these modifications +should be included in an ELBE XML file. +\end{frame} + +\begin{frame}[fragile] +\frametitle{elbe-validate} +validates the xmlfile provided, and prints out errors: +\begin{verbatim} +$ elbe validate rfs.xml +rfs.xml:101 error Element 'type': [facet 'enumeration'] The value 'ext5' is +not an element of the set {'ext2', 'ext3', 'ext4', 'xfs', 'ubifs', 'tmpfs', +'debugfs', 'configfs', 'proc', 'sysfs', 'vfat'}. +rfs.xml:101 error Element 'type': 'ext5' is not a valid value of the atomic +type '{https://www.linutronix.de/projects/Elbe}fs_type'. +validation failed +\end{verbatim} +\dots there is an typo in the XML file line 105: ext5 instead of ext4 \end{frame} + \begin{frame}[fragile] \frametitle{Creating UBI images} \lstset{language=XML} @@ -404,15 +512,6 @@ $ asciidoc myasciidoc \begin{scriptsize} \begin{lstlisting} - - - /opt - - ubifs - -x lzo - - rw - / @@ -420,17 +519,21 @@ $ asciidoc myasciidoc ubifs -x lzo - ro - - proc - /proc - - proc - - \end{lstlisting} \end{scriptsize} \end{frame} + +\begin{frame} +\frametitle{BETA: elbe buildchroot} +This may replace 'elbe create; cd build; make' in the future, if reproducability +is not that important: +\begin{lstlisting} +sudo elbe buildchroot -t build-chroot -o buildchroot.log -n myrfs \ +--skip-validation --skip-cdrom --debug --buildtype=armel +\end{lstlisting} +Testing and feedback is welcome! +\end{frame} + \input{tailpres} -- cgit v1.2.3 From 84cb372b2f47ff1f86eae85308f22e3e3d0303aa Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Fri, 3 Jan 2014 17:08:48 +0100 Subject: fix image of elbe inside qemu process archive is extracted before and after finetuning meanwhile Signed-off-by: Manuel Traut --- images/emu-process.png | Bin 11200 -> 20008 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/images/emu-process.png b/images/emu-process.png index f1b1107..0120049 100644 Binary files a/images/emu-process.png and b/images/emu-process.png differ -- cgit v1.2.3 From 94cb9659c53baf8b293cd87c35e7b0f07ece7b61 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Fri, 3 Jan 2014 17:09:28 +0100 Subject: remove 'osadl networking day' headlines Signed-off-by: Manuel Traut --- distribution/debian/pres_debian.tex | 6 +----- distribution/elbe/pres_elbe.tex | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/distribution/debian/pres_debian.tex b/distribution/debian/pres_debian.tex index 0009185..5736c4e 100644 --- a/distribution/debian/pres_debian.tex +++ b/distribution/debian/pres_debian.tex @@ -5,10 +5,6 @@ \includegraphics[width=1.0\textwidth]{debian.png} \end{figure} Manuel Traut, Linutronix GmbH - -OSADL Networking Day 2013 - -May 28, 2013 \end{frame} \subsection{Agenda} @@ -24,7 +20,7 @@ and a clear focus on Security. We also have a look at the open-source infrastructure of Debian. \end{frame} -\subsection{Debian is a community driven distribution} +\subsection{community driven distribution} \begin{frame} The Debian Project is \begin{itemize} diff --git a/distribution/elbe/pres_elbe.tex b/distribution/elbe/pres_elbe.tex index f1c5cd1..8c66cb3 100644 --- a/distribution/elbe/pres_elbe.tex +++ b/distribution/elbe/pres_elbe.tex @@ -7,10 +7,6 @@ \centerline{\large Embedded Linux Build Environment} \vskip20pt Manuel Traut, Linutronix GmbH - -OSADL Networking Day 2013 - -May 28, 2013 \end{frame} \subsection{Agenda} -- cgit v1.2.3 From 7665275241470e80f2f330424a30b73c1c507da9 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Fri, 3 Jan 2014 17:16:53 +0100 Subject: update to wheezy Signed-off-by: Manuel Traut --- distribution/elbe-devel/pres_elbe-devel_en.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/distribution/elbe-devel/pres_elbe-devel_en.tex b/distribution/elbe-devel/pres_elbe-devel_en.tex index c145d9d..c57ad47 100644 --- a/distribution/elbe-devel/pres_elbe-devel_en.tex +++ b/distribution/elbe-devel/pres_elbe-devel_en.tex @@ -113,7 +113,7 @@ at the current working directory \begin{itemize} \item the elbe project has packaged the d-i used by elbe as binary debian packages \begin{lstlisting} -testrd_0.6_armel +elbe-bootstrap_0.1_armel |- opt | +-elbe | +-initrd @@ -123,10 +123,10 @@ testrd_0.6_armel \end{lstlisting} \item the name of the debian package is specified by the 'kinitrd' tag inside the xml file -\item current packages are called testrd and are available at the debian +\item current packages are called elbe-bootstrap and are available at the debian repository: \begin{lstlisting} -deb http://debian.linutronix.de/elbe squeeze main +deb http://debian.linutronix.de/elbe wheezy main \end{lstlisting} \end{itemize} \end{frame} -- cgit v1.2.3 From 515da1c9119646ea3c100c918839f0ac933332c7 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 7 Jan 2014 08:21:05 +0100 Subject: remove BETA from elbe buildchroot ..and call it sth. like proof of concept Signed-off-by: Manuel Traut --- distribution/elbe-usage/pres_elbe-usage_en.tex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/distribution/elbe-usage/pres_elbe-usage_en.tex b/distribution/elbe-usage/pres_elbe-usage_en.tex index 7965509..b605f81 100644 --- a/distribution/elbe-usage/pres_elbe-usage_en.tex +++ b/distribution/elbe-usage/pres_elbe-usage_en.tex @@ -525,10 +525,9 @@ validation failed \end{scriptsize} \end{frame} -\begin{frame} -\frametitle{BETA: elbe buildchroot} -This may replace 'elbe create; cd build; make' in the future, if reproducability -is not that important: +\begin{frame}[fragile] +\frametitle{Future? elbe buildchroot} +Something like this may be used in the future: \begin{lstlisting} sudo elbe buildchroot -t build-chroot -o buildchroot.log -n myrfs \ --skip-validation --skip-cdrom --debug --buildtype=armel -- cgit v1.2.3 From 68d22db2a79b5489024dcefb5de6fe6dd4678baa Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 7 Jan 2014 08:21:27 +0100 Subject: move elbe-devel to elbe-internals Signed-off-by: Manuel Traut --- configpres.tex | 7 - distribution/elbe-devel/Makefile | 9 - distribution/elbe-devel/pres_elbe-devel_en.tex | 602 --------------------- distribution/elbe-internals/Makefile | 9 + distribution/elbe-internals/pres_elbe-devel_en.tex | 602 +++++++++++++++++++++ 5 files changed, 611 insertions(+), 618 deletions(-) delete mode 100644 distribution/elbe-devel/Makefile delete mode 100644 distribution/elbe-devel/pres_elbe-devel_en.tex create mode 100644 distribution/elbe-internals/Makefile create mode 100644 distribution/elbe-internals/pres_elbe-devel_en.tex diff --git a/configpres.tex b/configpres.tex index 2d9a3ae..ae157c1 100644 --- a/configpres.tex +++ b/configpres.tex @@ -35,11 +35,4 @@ \begin{document} -\AtBeginSubsection[] -{ -\begin{frame}{Outline} -\tableofcontents[currentsection,currentsubsection] -\end{frame} -} - \input{section} diff --git a/distribution/elbe-devel/Makefile b/distribution/elbe-devel/Makefile deleted file mode 100644 index d641258..0000000 --- a/distribution/elbe-devel/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -all: - for pdf in `ls -1 *.tex` ; do \ - TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) pdflatex $$pdf; \ - TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) pdflatex $$pdf; \ - done - -clean: - rm -f *.aux *.log *.pdf *.log *.snm *.toc *.vrb *.nav *.out - diff --git a/distribution/elbe-devel/pres_elbe-devel_en.tex b/distribution/elbe-devel/pres_elbe-devel_en.tex deleted file mode 100644 index c57ad47..0000000 --- a/distribution/elbe-devel/pres_elbe-devel_en.tex +++ /dev/null @@ -1,602 +0,0 @@ -\input{configpres} - -\lstset{language=bash} - -\title{ELBE internals} -\maketitle - - -\subsection{source repository} - -\begin{frame}[fragile] -\frametitle{source tree} - -ELBE development is hosted on github: -\begin{lstlisting} -https://github.com/Linutronix/elbe -\end{lstlisting} - -Use git to retrieve the source: -\begin{lstlisting} -git clone git://github.com/Linutronix/elbe.git -\end{lstlisting} - -\begin{lstlisting} -. -|-- debian/ # debian packaging -|-- docs/ # man pages, dia files, overview -|-- elbe # python script calling several scripts from ./elbepack -|-- elbepack/ # implementation of elbe subcommands like 'create' -| |-- mako/ # script and config file templates for the buildenv -|-- examples/ # example XML files -|-- Makefile # calls dpkg-buildpackage to generate a debian package -|-- README # short introduction to ELBE -+-- setup.py # python typical setup script -\end{lstlisting} - -\end{frame} - -\subsection{elbepack/create.py} - -\begin{frame} -\frametitle{create an elbe project} -\begin{itemize} -\item the 'elbe create' command is implemented - -at elbepack/create.py -\item create.py has one mandotary parameter: - -path and name of an elbe xml file -\item create.py accepts optional parameters - -that are parsed by OptionParser -\end{itemize} -\end{frame} - -\begin{frame} -\frametitle{xml validation} -\begin{itemize} -\item verifies given xml file against elbepack/dbsfed.xsd -\item we try to do as much checks as posible with the schema -\item normaly there are no further checks inside the python code -\item validation can be skipped by --skip-validation parameter -\item elbepack/validate.py is used to verify the schema -\item elbepack/validate.py can be also called directly: - -'elbe validate examples/amd64-example.xml' -\item elbepack/validate.py uses etree from lxml - -to verify the schema -\end{itemize} -\end{frame} - -\begin{frame} -\frametitle{create build directory} -\begin{itemize} -\item creates a directory named 'build' - -at the current working directory -\item name can be overridden by --directory parameter -\item the buildenvironment will be created inside this directory -\end{itemize} -\end{frame} - -\begin{frame} -\frametitle{the debian-installer (d-i)} -\begin{itemize} -\item the d-i needs a running linux system -\item the debian project distributes the d-i in different packages: - e.g. as a bootable cd or for use with pxeboot -\item all packages include at least -\begin{itemize} -\item one Linux kernel binary -\item and an initial ramdisk with a minimal rfs and the d-i application -\end{itemize} -\end{itemize} -\end{frame} - -\begin{frame} -\frametitle{d-i common use} -\begin{itemize} -\item d-i is started on the system debian should be installed on -\item d-i does -\begin{itemize} -\item disk detection / partitioning -\item sw installation -\item system configuration -\end{itemize} -\end{itemize} -\end{frame} - -\begin{frame}[fragile] -\frametitle{elbe kinitrd packages} -\begin{itemize} -\item the elbe project has packaged the d-i used by elbe as binary debian packages -\begin{lstlisting} -elbe-bootstrap_0.1_armel -|- opt -| +-elbe -| +-initrd -| +-initrd-cdrom.gz -| +-initrd.gz -| +-vmlinuz -\end{lstlisting} -\item the name of the debian package is specified by the 'kinitrd' tag inside the - xml file -\item current packages are called elbe-bootstrap and are available at the debian -repository: -\begin{lstlisting} -deb http://debian.linutronix.de/elbe wheezy main -\end{lstlisting} -\end{itemize} -\end{frame} - -\begin{frame} -\frametitle{retrieve kinitrd} -\begin{itemize} -\item elbepack/pkgutils.py:copy\_kinitrd() - -is called by elbepack/create.py -\item the pkgutils module uses python virtapt - -to retrieve the kinitrd package - -from a mirror or cdrom specified in the xml file -\item virtapt takes care on using - -the correct debian architecture and suite -\item the kinitrd package will be extracted - -and copied to the build directory -\end{itemize} -\end{frame} - - -\begin{frame}[fragile] -\frametitle{mako} -Mako is a template library written in Python. - -It can be used to generate files from templates. - -It is normally used to generate webpages. - -Documentation and more informations can be found on -\begin{lstlisting} -http://www.makotemplates.org/ -\end{lstlisting} -\end{frame} - -\begin{frame}[fragile] -\frametitle{create Makefile, scripts and config files} -ELBE uses -\begin{lstlisting} -d = {"opt": opt, - "xml": xml, - "prj": xml.node("/project"), - "tgt": xml.node("/target"), - "pkgs": xml.node("/target/pkg-list"), - "fine": xml.node("/finetuning"), - "preseed": get_preseed(xml) } -... -mako.Template(filename=fname).render(**d) -\end{lstlisting} -to insert several values from the XML file into scripts and configfiles. -\begin{description} -\item[fname] the function is called for each *.mako file in elbepack/mako -\item[d] refers to several lxml.etree XML nodes -\item[xml] is a etree initialized with the ELBE XML file -\end{description} -\end{frame} - -\begin{frame}[fragile] -\frametitle{create Makefile, scripts and config files} -For example a simple txt file including all package names defined in the -$\langle$pkg-list$\rangle$ tag can be created by (pkg-list.mako): -\begin{lstlisting} -% for n in pkgs: -% if n.tag == "pkg": -${n.et.text} -% endif -% endfor -\end{lstlisting} -\end{frame} - - -\begin{frame} -\frametitle{preseeding} -Preseeding provides a way to set answers to questions asked during the -installation process, without having to manually enter the answers while -the installation is running. -\end{frame} - -\begin{frame} -\frametitle{preseeding} -Many pre-seeding rules are generated - -from the XML file with mako: - -./elbepack/mako/common.cfg.mako -\end{frame} - -\begin{frame}[fragile] -\frametitle{preseeding} -Project specific preseeding rules can be added to the xml file. -These rules are then included by ./elbepack/mako/custom-preseed.cfg.mako -\end{frame} - - -\subsection{Makefile (pre-install)} - -\begin{frame} -\frametitle{initrd.gz modification} -\begin{itemize} -\item a directory tmp-tree is created -\item all files and scripts needed inside the installer - -are copied to the tmp-tree -\item ungzip the original initrd.gz -\item use cpio to append all files of tmp-tree - -to the unzipped initrd image -\item gzip the new initrd image and remove the tmp-tree -\end{itemize} -\end{frame} - -\begin{frame} -\frametitle{create buildenv.img} -\begin{itemize} -\item qemu-img is used to create a buildenv.img file. This file will be used as -harddisk of the emulated virtual machine. -\item The debian-installer will install - -a full featured debian on this image. -\item After the debian-installer was active, - -this image can be used as a virtual build-environment. -\item The target rootfilesystem is normally - -just a subset of this image. -\end{itemize} -\end{frame} - -\begin{frame}[fragile] -\frametitle{start emulator} -\begin{itemize} -\item the cmdline to start the emulator depends on several specifications made -in the XML file: -\begin{lstlisting} -.. - ${prj.text("buildimage/interpreter")} \ - -M ${prj.text("buildimage/machine")} \ - -drive file=buildenv.img,if=${hd_type},bus=1,unit=0 \ -% if prj.has("mirror/cdrom"): - -drive file=${prj.text("mirror/cdrom")},if=${cdrom_type},media=cdrom,bus=1,unit=1 \ -% endif - -kernel vmlinuz \ - -initrd initrd-preseeded.gz \ - -append 'root=/dev/${hd_name} debconf_priority=critical console=${prj.text("buildimage/console")} DEBIAN_FRONTEND=newt' \ - -no-reboot \ - -net nic,vlan=1,model=${prj.text("buildimage/NIC/model")},macaddr="${prj.text('buildimage/NIC/MAC')}" \ - -net user,vlan=1 \ - -m $(MEMSIZE) \ - -usb && reset -.. -\end{lstlisting} -\end{itemize} -\end{frame} - -\subsection{debian-installer in emulator} - -\begin{frame} -\frametitle{an ordinary debian installation} -runs inside the virtual machine: -\begin{itemize} -\item the buildenv.img will be partitionated and formated -\item the root partition will be mounted at - -/target inside the debian-installer rfs -\item a minimal rootfilesystem will be installed to /target -\item a chroot /target will be executed -\item all packages will be installed and configured -\item the /target chroot will be left -\item the preseed hook - -d-i preseed/late\_command string /post-inst.sh - -will be executed -\end{itemize} -\end{frame} - - -\begin{frame} -\frametitle{post-inst.sh} -\begin{description} -\item [cp-scipts-into-buildenv.sh] copy all (generated) scripts - -from the initrd (/) - -to the buildenv.img (/target/opt/elbe) - -\item [changeroot-into-buildenv.sh] chroot into /target again, - -trigger target (/opt/elbe/create-target-rfs.sh) - -and cdrom (/opt/elbe/mkcdrom.sh) generation. -\end{description} -\end{frame} - -\begin{frame} -\frametitle{target generation (overview)} -\begin{itemize} -\item generate file and pkg lists -\item create /target tree -\item call dump.py to -\begin{itemize} - \item validate packages / write logfile - \item add fullpkgs list to source.xml - \item add content of /etc/apt/sources.list to source.xml - \item add content of /etc/apt/preferences to source.xml - \item modify /target tree with finetuning.sh -\end{itemize} -\item generate licence information file -\item call part-target.sh to generate images from /target tree -\item (optional) generate cpio images and tarballs -\end{itemize} -\end{frame} - - -\begin{frame}[fragile] -\frametitle{create /target tree} -\begin{itemize} -\item depending on the ELBE mode, the filelist is generated. - -E.g. in normal mode: -\begin{lstlisting} -ls -A1 / | \ - grep -v target | grep -v proc | grep -v sys | \ - xargs find >> /opt/elbe/filelist -\end{lstlisting} -\item all files specified to be stored on the target rfs are copied: -\begin{lstlisting} -rsync -a --files-from=/opt/elbe/filelist / /target -\end{lstlisting} -\end{itemize} -\end{frame} - - -\begin{frame}[fragile] -\frametitle{dump.py - check if all req. packages are installed} -\begin{itemize} -\item add lines about missing packages to validation.txt: -\begin{lstlisting} - for name in [p.et.text for p in pkgs] + [kinitrd]: - - if not name in cache: - elog.printo( "- package %s does not exist" % name ) - errors += 1 - continue - - cp = cache[name] - - if not cp.installed and name != kinitrd: - elog.printo( "- package %s is not installed" % name ) - errors += 1 - continue -\end{lstlisting} -\end{itemize} -\end{frame} - - -\begin{frame}[fragile] -\frametitle{dump.py - check version of packages used} -(only done if a fullpkgs tag was specified in the xml file) -\begin{itemize} -\item add lines about packages with wrong version to validation.txt: -\begin{lstlisting} - for p in fullpkgs: - name = p.et.text - ver = p.et.get('version') - md5 = p.et.get('md5') - pindex[name] = p - ... - if cpi.version != ver: - elog.printo("pack %s v%s != installed v%s" % (name, ver, cpi.version)) - errors += 1 - continue - - if cpi.md5 != md5: - elog.printo("pack %s md5 %s != installed md5 %s" % (name, md5, cpi.md5) ) - errors += 1 - ... -\end{lstlisting} -\item there is also a check for packages that are installed but wasn't specified to be installed -\end{itemize} -\end{frame} - - -\begin{frame}[fragile] -\frametitle{dump.py - write fullpkglist to source.xml} -\begin{itemize} -\item all used packages are listed in the source.xml file - -(including version and md5sum): -\begin{lstlisting} - paktree = xml.ensure_child( 'fullpkgs' ) - paktree.clear() - pkgs = [] - for p in cache: - if p.is_installed: - pkgs.append( (p.name, p.installed.version, p.is_auto_installed, p.installed.md5)) - ... - for p in pkgs: - append_pkg_elem( paktree, p[0], p[1], p[2], p[3] ) -\end{lstlisting} -\end{itemize} -\end{frame} - - -\begin{frame} -\frametitle{dump.py - modify /target tree with finetuning.sh} -\begin{itemize} -\item the script is executed from /target. - - So files can be copied - - from the debian rfs to the target rfs - - by e.g. 'cp /etc/passwd etc/' - -\item the output of the finetuning.sh commands is appended to elbe-report.txt -\end{itemize} -\end{frame} - - -\begin{frame} -\frametitle{dump.py - filelist generation} -elbe-report.txt includes a filelist that indicates each file in the target rfs -and its origin -\begin{itemize} -\item a time stamp is recorded before and after finetuning. -\item files that show up with a modification time in that period - -can be identified as modified/created by finetuning.sh -\end{itemize} -\end{frame} - - -\begin{frame}[fragile] -\frametitle{generate licence information file} -all licence informations that are stored in /usr/share/* are collected in one file: -\begin{lstlisting} -find /usr/share/doc -name copyright -exec \ - /opt/elbe/print_licence.sh {} \; >> /opt/elbe/licence.txt -\end{lstlisting} -\end{frame} - - -\begin{frame}[fragile] -\frametitle{call part-target.sh to copy /target tree to (different) images} -currently only UBI image support is functional. - -HD images are under development. They will be created by using python bindings -of libparted and loopback mounts. -\end{frame} - - -\begin{frame}[fragile] -\frametitle{build ubifs images} -\begin{itemize} -\item mkfs.ubifs -r is used to generate a ubifs image - -from a subdirectory -\item the name of the images is defined - -by the label in the fstab tag -\item the image defined first in the fstab is created first -\item the files copied to an image - -are moved temporarily away from /target: -\begin{lstlisting} - /mountA/mountB # mountA shouldn't include files like mountB/test -\end{lstlisting} -\item /target is restored as all images were created -\end{itemize} -\end{frame} - - -\begin{frame}[fragile] -\frametitle{(optional) generate cpio images and tarballs} -\begin{lstlisting} -% if xml.has("target/package/tar"): -tar cf /opt/elbe/target.tar -C /target . -% endif - -% if xml.has("target/package/cpio"): -cd /target -find . -print | cpio -ov -H newc >/opt/elbe/target.cpio -% endif -\end{lstlisting} -\end{frame} - - -\begin{frame} -\frametitle{binary cdrom generation} -An ISO CD image will be created: -\begin{itemize} -\item CD should contain all packages - -needed to reproduce the current ELBE run -\item the kinitrd package is installed into the buildenv - -to get it added to the cdrom like all other packages -\item CD needs to be in a debian repository format - -otherwise it won't be accepted by d-i -\item reprepo and genisoimage is used to create the CD -\end{itemize} -\end{frame} - - -\begin{frame}[fragile] -\frametitle{source cdrom generation} -upon request (by 'elbe create --build-source') - -an ISO image containing all debian source packages is created: -\begin{lstlisting} -% if opt.buildsources: - mkdir -p /opt/elbe/source - dpkg --get-selections | awk '{print $1}' > /opt/elbe/pkg-list.actual - cd /opt/elbe/source - awk '{print "apt-get -d source "$1}' /opt/elbe/pkg-list.actual | sh - cd /opt/elbe - dpkg-scansources source /dev/null | gzip -9c > source/Sources.gz - genisoimage -o /opt/elbe/source.iso -J -R source -% endif -\end{lstlisting} -\end{frame} - - -\begin{frame} -\frametitle{kinitrd package details} -\begin{itemize} -\item in xml the cdrom tag can be used instead of a mirror -\item then d-i needs to load components (udeb) from cdrom instead of web -\item this is the reason for kinitrd including two versions of the initrd: -\begin{itemize} -\item one with the d-i configured to load udebs from a web source -\item a second with d-i configured to load udebs from a cdrom source -\end{itemize} -\item there is a switch in the 'elbe create' path to select the right initrd for - the project -\end{itemize} -\end{frame} - - -\subsection{Makefile (post-install)} - -\begin{frame}[fragile] -\frametitle{copy files to host} -\begin{itemize} -\item all files produced by elbe are stored inside buildenv.img:/opt/elbe -\item they should be transfered into the build dir on the Host PC -\item the emulator is shutdown, - -then e2cp can be used to retrive the files: -\begin{lstlisting} -e2cp buildenv.img?offset=32768:/opt/elbe/licence.txt . -\end{lstlisting} -\item this is done for all files by the Makefile, e.g: -\begin{lstlisting} -% if tgt.has("images"): -% for mtd in tgt.node("images"): -% if mtd.has("partitions"): - e2cp buildenv.img?offset=${loop_offset}:/opt/elbe/${mtd.text("name")} . -% endif -% if mtd.has("binary"): - e2cp buildenv.img?offset=${loop_offset}:${mtd.text("binary")} ${mtd.text("name")} -\end{lstlisting} -\end{itemize} -\end{frame} - - -\input{tailpres} diff --git a/distribution/elbe-internals/Makefile b/distribution/elbe-internals/Makefile new file mode 100644 index 0000000..d641258 --- /dev/null +++ b/distribution/elbe-internals/Makefile @@ -0,0 +1,9 @@ +all: + for pdf in `ls -1 *.tex` ; do \ + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) pdflatex $$pdf; \ + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) pdflatex $$pdf; \ + done + +clean: + rm -f *.aux *.log *.pdf *.log *.snm *.toc *.vrb *.nav *.out + diff --git a/distribution/elbe-internals/pres_elbe-devel_en.tex b/distribution/elbe-internals/pres_elbe-devel_en.tex new file mode 100644 index 0000000..c57ad47 --- /dev/null +++ b/distribution/elbe-internals/pres_elbe-devel_en.tex @@ -0,0 +1,602 @@ +\input{configpres} + +\lstset{language=bash} + +\title{ELBE internals} +\maketitle + + +\subsection{source repository} + +\begin{frame}[fragile] +\frametitle{source tree} + +ELBE development is hosted on github: +\begin{lstlisting} +https://github.com/Linutronix/elbe +\end{lstlisting} + +Use git to retrieve the source: +\begin{lstlisting} +git clone git://github.com/Linutronix/elbe.git +\end{lstlisting} + +\begin{lstlisting} +. +|-- debian/ # debian packaging +|-- docs/ # man pages, dia files, overview +|-- elbe # python script calling several scripts from ./elbepack +|-- elbepack/ # implementation of elbe subcommands like 'create' +| |-- mako/ # script and config file templates for the buildenv +|-- examples/ # example XML files +|-- Makefile # calls dpkg-buildpackage to generate a debian package +|-- README # short introduction to ELBE ++-- setup.py # python typical setup script +\end{lstlisting} + +\end{frame} + +\subsection{elbepack/create.py} + +\begin{frame} +\frametitle{create an elbe project} +\begin{itemize} +\item the 'elbe create' command is implemented + +at elbepack/create.py +\item create.py has one mandotary parameter: + +path and name of an elbe xml file +\item create.py accepts optional parameters + +that are parsed by OptionParser +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{xml validation} +\begin{itemize} +\item verifies given xml file against elbepack/dbsfed.xsd +\item we try to do as much checks as posible with the schema +\item normaly there are no further checks inside the python code +\item validation can be skipped by --skip-validation parameter +\item elbepack/validate.py is used to verify the schema +\item elbepack/validate.py can be also called directly: + +'elbe validate examples/amd64-example.xml' +\item elbepack/validate.py uses etree from lxml + +to verify the schema +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{create build directory} +\begin{itemize} +\item creates a directory named 'build' + +at the current working directory +\item name can be overridden by --directory parameter +\item the buildenvironment will be created inside this directory +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{the debian-installer (d-i)} +\begin{itemize} +\item the d-i needs a running linux system +\item the debian project distributes the d-i in different packages: + e.g. as a bootable cd or for use with pxeboot +\item all packages include at least +\begin{itemize} +\item one Linux kernel binary +\item and an initial ramdisk with a minimal rfs and the d-i application +\end{itemize} +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{d-i common use} +\begin{itemize} +\item d-i is started on the system debian should be installed on +\item d-i does +\begin{itemize} +\item disk detection / partitioning +\item sw installation +\item system configuration +\end{itemize} +\end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{elbe kinitrd packages} +\begin{itemize} +\item the elbe project has packaged the d-i used by elbe as binary debian packages +\begin{lstlisting} +elbe-bootstrap_0.1_armel +|- opt +| +-elbe +| +-initrd +| +-initrd-cdrom.gz +| +-initrd.gz +| +-vmlinuz +\end{lstlisting} +\item the name of the debian package is specified by the 'kinitrd' tag inside the + xml file +\item current packages are called elbe-bootstrap and are available at the debian +repository: +\begin{lstlisting} +deb http://debian.linutronix.de/elbe wheezy main +\end{lstlisting} +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{retrieve kinitrd} +\begin{itemize} +\item elbepack/pkgutils.py:copy\_kinitrd() + +is called by elbepack/create.py +\item the pkgutils module uses python virtapt + +to retrieve the kinitrd package + +from a mirror or cdrom specified in the xml file +\item virtapt takes care on using + +the correct debian architecture and suite +\item the kinitrd package will be extracted + +and copied to the build directory +\end{itemize} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{mako} +Mako is a template library written in Python. + +It can be used to generate files from templates. + +It is normally used to generate webpages. + +Documentation and more informations can be found on +\begin{lstlisting} +http://www.makotemplates.org/ +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{create Makefile, scripts and config files} +ELBE uses +\begin{lstlisting} +d = {"opt": opt, + "xml": xml, + "prj": xml.node("/project"), + "tgt": xml.node("/target"), + "pkgs": xml.node("/target/pkg-list"), + "fine": xml.node("/finetuning"), + "preseed": get_preseed(xml) } +... +mako.Template(filename=fname).render(**d) +\end{lstlisting} +to insert several values from the XML file into scripts and configfiles. +\begin{description} +\item[fname] the function is called for each *.mako file in elbepack/mako +\item[d] refers to several lxml.etree XML nodes +\item[xml] is a etree initialized with the ELBE XML file +\end{description} +\end{frame} + +\begin{frame}[fragile] +\frametitle{create Makefile, scripts and config files} +For example a simple txt file including all package names defined in the +$\langle$pkg-list$\rangle$ tag can be created by (pkg-list.mako): +\begin{lstlisting} +% for n in pkgs: +% if n.tag == "pkg": +${n.et.text} +% endif +% endfor +\end{lstlisting} +\end{frame} + + +\begin{frame} +\frametitle{preseeding} +Preseeding provides a way to set answers to questions asked during the +installation process, without having to manually enter the answers while +the installation is running. +\end{frame} + +\begin{frame} +\frametitle{preseeding} +Many pre-seeding rules are generated + +from the XML file with mako: + +./elbepack/mako/common.cfg.mako +\end{frame} + +\begin{frame}[fragile] +\frametitle{preseeding} +Project specific preseeding rules can be added to the xml file. +These rules are then included by ./elbepack/mako/custom-preseed.cfg.mako +\end{frame} + + +\subsection{Makefile (pre-install)} + +\begin{frame} +\frametitle{initrd.gz modification} +\begin{itemize} +\item a directory tmp-tree is created +\item all files and scripts needed inside the installer + +are copied to the tmp-tree +\item ungzip the original initrd.gz +\item use cpio to append all files of tmp-tree + +to the unzipped initrd image +\item gzip the new initrd image and remove the tmp-tree +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{create buildenv.img} +\begin{itemize} +\item qemu-img is used to create a buildenv.img file. This file will be used as +harddisk of the emulated virtual machine. +\item The debian-installer will install + +a full featured debian on this image. +\item After the debian-installer was active, + +this image can be used as a virtual build-environment. +\item The target rootfilesystem is normally + +just a subset of this image. +\end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{start emulator} +\begin{itemize} +\item the cmdline to start the emulator depends on several specifications made +in the XML file: +\begin{lstlisting} +.. + ${prj.text("buildimage/interpreter")} \ + -M ${prj.text("buildimage/machine")} \ + -drive file=buildenv.img,if=${hd_type},bus=1,unit=0 \ +% if prj.has("mirror/cdrom"): + -drive file=${prj.text("mirror/cdrom")},if=${cdrom_type},media=cdrom,bus=1,unit=1 \ +% endif + -kernel vmlinuz \ + -initrd initrd-preseeded.gz \ + -append 'root=/dev/${hd_name} debconf_priority=critical console=${prj.text("buildimage/console")} DEBIAN_FRONTEND=newt' \ + -no-reboot \ + -net nic,vlan=1,model=${prj.text("buildimage/NIC/model")},macaddr="${prj.text('buildimage/NIC/MAC')}" \ + -net user,vlan=1 \ + -m $(MEMSIZE) \ + -usb && reset +.. +\end{lstlisting} +\end{itemize} +\end{frame} + +\subsection{debian-installer in emulator} + +\begin{frame} +\frametitle{an ordinary debian installation} +runs inside the virtual machine: +\begin{itemize} +\item the buildenv.img will be partitionated and formated +\item the root partition will be mounted at + +/target inside the debian-installer rfs +\item a minimal rootfilesystem will be installed to /target +\item a chroot /target will be executed +\item all packages will be installed and configured +\item the /target chroot will be left +\item the preseed hook + +d-i preseed/late\_command string /post-inst.sh + +will be executed +\end{itemize} +\end{frame} + + +\begin{frame} +\frametitle{post-inst.sh} +\begin{description} +\item [cp-scipts-into-buildenv.sh] copy all (generated) scripts + +from the initrd (/) + +to the buildenv.img (/target/opt/elbe) + +\item [changeroot-into-buildenv.sh] chroot into /target again, + +trigger target (/opt/elbe/create-target-rfs.sh) + +and cdrom (/opt/elbe/mkcdrom.sh) generation. +\end{description} +\end{frame} + +\begin{frame} +\frametitle{target generation (overview)} +\begin{itemize} +\item generate file and pkg lists +\item create /target tree +\item call dump.py to +\begin{itemize} + \item validate packages / write logfile + \item add fullpkgs list to source.xml + \item add content of /etc/apt/sources.list to source.xml + \item add content of /etc/apt/preferences to source.xml + \item modify /target tree with finetuning.sh +\end{itemize} +\item generate licence information file +\item call part-target.sh to generate images from /target tree +\item (optional) generate cpio images and tarballs +\end{itemize} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{create /target tree} +\begin{itemize} +\item depending on the ELBE mode, the filelist is generated. + +E.g. in normal mode: +\begin{lstlisting} +ls -A1 / | \ + grep -v target | grep -v proc | grep -v sys | \ + xargs find >> /opt/elbe/filelist +\end{lstlisting} +\item all files specified to be stored on the target rfs are copied: +\begin{lstlisting} +rsync -a --files-from=/opt/elbe/filelist / /target +\end{lstlisting} +\end{itemize} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{dump.py - check if all req. packages are installed} +\begin{itemize} +\item add lines about missing packages to validation.txt: +\begin{lstlisting} + for name in [p.et.text for p in pkgs] + [kinitrd]: + + if not name in cache: + elog.printo( "- package %s does not exist" % name ) + errors += 1 + continue + + cp = cache[name] + + if not cp.installed and name != kinitrd: + elog.printo( "- package %s is not installed" % name ) + errors += 1 + continue +\end{lstlisting} +\end{itemize} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{dump.py - check version of packages used} +(only done if a fullpkgs tag was specified in the xml file) +\begin{itemize} +\item add lines about packages with wrong version to validation.txt: +\begin{lstlisting} + for p in fullpkgs: + name = p.et.text + ver = p.et.get('version') + md5 = p.et.get('md5') + pindex[name] = p + ... + if cpi.version != ver: + elog.printo("pack %s v%s != installed v%s" % (name, ver, cpi.version)) + errors += 1 + continue + + if cpi.md5 != md5: + elog.printo("pack %s md5 %s != installed md5 %s" % (name, md5, cpi.md5) ) + errors += 1 + ... +\end{lstlisting} +\item there is also a check for packages that are installed but wasn't specified to be installed +\end{itemize} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{dump.py - write fullpkglist to source.xml} +\begin{itemize} +\item all used packages are listed in the source.xml file + +(including version and md5sum): +\begin{lstlisting} + paktree = xml.ensure_child( 'fullpkgs' ) + paktree.clear() + pkgs = [] + for p in cache: + if p.is_installed: + pkgs.append( (p.name, p.installed.version, p.is_auto_installed, p.installed.md5)) + ... + for p in pkgs: + append_pkg_elem( paktree, p[0], p[1], p[2], p[3] ) +\end{lstlisting} +\end{itemize} +\end{frame} + + +\begin{frame} +\frametitle{dump.py - modify /target tree with finetuning.sh} +\begin{itemize} +\item the script is executed from /target. + + So files can be copied + + from the debian rfs to the target rfs + + by e.g. 'cp /etc/passwd etc/' + +\item the output of the finetuning.sh commands is appended to elbe-report.txt +\end{itemize} +\end{frame} + + +\begin{frame} +\frametitle{dump.py - filelist generation} +elbe-report.txt includes a filelist that indicates each file in the target rfs +and its origin +\begin{itemize} +\item a time stamp is recorded before and after finetuning. +\item files that show up with a modification time in that period + +can be identified as modified/created by finetuning.sh +\end{itemize} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{generate licence information file} +all licence informations that are stored in /usr/share/* are collected in one file: +\begin{lstlisting} +find /usr/share/doc -name copyright -exec \ + /opt/elbe/print_licence.sh {} \; >> /opt/elbe/licence.txt +\end{lstlisting} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{call part-target.sh to copy /target tree to (different) images} +currently only UBI image support is functional. + +HD images are under development. They will be created by using python bindings +of libparted and loopback mounts. +\end{frame} + + +\begin{frame}[fragile] +\frametitle{build ubifs images} +\begin{itemize} +\item mkfs.ubifs -r is used to generate a ubifs image + +from a subdirectory +\item the name of the images is defined + +by the label in the fstab tag +\item the image defined first in the fstab is created first +\item the files copied to an image + +are moved temporarily away from /target: +\begin{lstlisting} + /mountA/mountB # mountA shouldn't include files like mountB/test +\end{lstlisting} +\item /target is restored as all images were created +\end{itemize} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{(optional) generate cpio images and tarballs} +\begin{lstlisting} +% if xml.has("target/package/tar"): +tar cf /opt/elbe/target.tar -C /target . +% endif + +% if xml.has("target/package/cpio"): +cd /target +find . -print | cpio -ov -H newc >/opt/elbe/target.cpio +% endif +\end{lstlisting} +\end{frame} + + +\begin{frame} +\frametitle{binary cdrom generation} +An ISO CD image will be created: +\begin{itemize} +\item CD should contain all packages + +needed to reproduce the current ELBE run +\item the kinitrd package is installed into the buildenv + +to get it added to the cdrom like all other packages +\item CD needs to be in a debian repository format + +otherwise it won't be accepted by d-i +\item reprepo and genisoimage is used to create the CD +\end{itemize} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{source cdrom generation} +upon request (by 'elbe create --build-source') + +an ISO image containing all debian source packages is created: +\begin{lstlisting} +% if opt.buildsources: + mkdir -p /opt/elbe/source + dpkg --get-selections | awk '{print $1}' > /opt/elbe/pkg-list.actual + cd /opt/elbe/source + awk '{print "apt-get -d source "$1}' /opt/elbe/pkg-list.actual | sh + cd /opt/elbe + dpkg-scansources source /dev/null | gzip -9c > source/Sources.gz + genisoimage -o /opt/elbe/source.iso -J -R source +% endif +\end{lstlisting} +\end{frame} + + +\begin{frame} +\frametitle{kinitrd package details} +\begin{itemize} +\item in xml the cdrom tag can be used instead of a mirror +\item then d-i needs to load components (udeb) from cdrom instead of web +\item this is the reason for kinitrd including two versions of the initrd: +\begin{itemize} +\item one with the d-i configured to load udebs from a web source +\item a second with d-i configured to load udebs from a cdrom source +\end{itemize} +\item there is a switch in the 'elbe create' path to select the right initrd for + the project +\end{itemize} +\end{frame} + + +\subsection{Makefile (post-install)} + +\begin{frame}[fragile] +\frametitle{copy files to host} +\begin{itemize} +\item all files produced by elbe are stored inside buildenv.img:/opt/elbe +\item they should be transfered into the build dir on the Host PC +\item the emulator is shutdown, + +then e2cp can be used to retrive the files: +\begin{lstlisting} +e2cp buildenv.img?offset=32768:/opt/elbe/licence.txt . +\end{lstlisting} +\item this is done for all files by the Makefile, e.g: +\begin{lstlisting} +% if tgt.has("images"): +% for mtd in tgt.node("images"): +% if mtd.has("partitions"): + e2cp buildenv.img?offset=${loop_offset}:/opt/elbe/${mtd.text("name")} . +% endif +% if mtd.has("binary"): + e2cp buildenv.img?offset=${loop_offset}:${mtd.text("binary")} ${mtd.text("name")} +\end{lstlisting} +\end{itemize} +\end{frame} + + +\input{tailpres} -- cgit v1.2.3 From d7da5da17cad611293c655860b9656d4156eaa1f Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 7 Jan 2014 11:23:29 +0100 Subject: elbe-usage: include elbe pkgdiff Signed-off-by: Manuel Traut --- distribution/elbe-usage/pres_elbe-usage_en.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/distribution/elbe-usage/pres_elbe-usage_en.tex b/distribution/elbe-usage/pres_elbe-usage_en.tex index b605f81..452d678 100644 --- a/distribution/elbe-usage/pres_elbe-usage_en.tex +++ b/distribution/elbe-usage/pres_elbe-usage_en.tex @@ -455,6 +455,18 @@ This can be used if a (nfsroot) filesystem was modified and these modifications should be included in an ELBE XML file. \end{frame} +\begin{frame}[fragile] +\frametitle{elbe-pkgdiff} +compares to RFS trees and displays the difference of the installed packages +\begin{verbatim} +$ sudo elbe pkgdiff `pwd`/rfs `pwd`/rfs-modified +-firmware-ivtv +-firmware-ipw2x00 +\end{verbatim} +This can be used if a (nfsroot) filesystem was modified and these modifications +should be included in an ELBE XML file. +\end{frame} + \begin{frame}[fragile] \frametitle{elbe-validate} validates the xmlfile provided, and prints out errors: -- cgit v1.2.3 From 0996948c27a1c3668bf36fa6ada78ed99da3b561 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Thu, 9 Jan 2014 11:11:53 +0100 Subject: add elbe example and hands-on slides Signed-off-by: Manuel Traut --- distribution/elbe-example/Makefile | 9 + distribution/elbe-example/mini-incl-target.xml | 77 ++++ distribution/elbe-example/mini.xml | 42 ++ distribution/elbe-example/myapp/AUTHORS | 0 distribution/elbe-example/myapp/ChangeLog | 0 distribution/elbe-example/myapp/Makefile.am | 5 + distribution/elbe-example/myapp/NEWS | 0 distribution/elbe-example/myapp/README | 0 distribution/elbe-example/myapp/autogen.sh | 2 + distribution/elbe-example/myapp/configure.ac | 23 ++ distribution/elbe-example/myapp/myapp.c | 12 + .../elbe-example/myrepo/conf/distributions | 9 + distribution/elbe-example/myrepo/conf/updates | 6 + distribution/elbe-example/pres_elbe-example_en.tex | 448 +++++++++++++++++++++ 14 files changed, 633 insertions(+) create mode 100644 distribution/elbe-example/Makefile create mode 100644 distribution/elbe-example/mini-incl-target.xml create mode 100644 distribution/elbe-example/mini.xml create mode 100644 distribution/elbe-example/myapp/AUTHORS create mode 100644 distribution/elbe-example/myapp/ChangeLog create mode 100644 distribution/elbe-example/myapp/Makefile.am create mode 100644 distribution/elbe-example/myapp/NEWS create mode 100644 distribution/elbe-example/myapp/README create mode 100755 distribution/elbe-example/myapp/autogen.sh create mode 100644 distribution/elbe-example/myapp/configure.ac create mode 100644 distribution/elbe-example/myapp/myapp.c create mode 100644 distribution/elbe-example/myrepo/conf/distributions create mode 100644 distribution/elbe-example/myrepo/conf/updates create mode 100644 distribution/elbe-example/pres_elbe-example_en.tex diff --git a/distribution/elbe-example/Makefile b/distribution/elbe-example/Makefile new file mode 100644 index 0000000..d641258 --- /dev/null +++ b/distribution/elbe-example/Makefile @@ -0,0 +1,9 @@ +all: + for pdf in `ls -1 *.tex` ; do \ + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) pdflatex $$pdf; \ + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) pdflatex $$pdf; \ + done + +clean: + rm -f *.aux *.log *.pdf *.log *.snm *.toc *.vrb *.nav *.out + diff --git a/distribution/elbe-example/mini-incl-target.xml b/distribution/elbe-example/mini-incl-target.xml new file mode 100644 index 0000000..fcb8181 --- /dev/null +++ b/distribution/elbe-example/mini-incl-target.xml @@ -0,0 +1,77 @@ + + + mini xml + 1 + + minimal target rfs including a simple app + buildenv to build the simple app + + armel + + ftp.debian.org + /debian + http + + + http://debian.linutronix.de/elbe wheezy main + + + http://LOCALMACHINE/debian wheezy main + http://LOCALMACHINE/debian wheezy main + + + + wheezy + + elbe-bootstrap + + build-essential + debhelper + devscripts + autotools-dev + automake + + + + + mini + linutronix + foo + ttyAMA0,115200 + + + rootfs.tar.gz + + + + + my.img + 200MiB + + remain + + + + + + + + / + + ext4 + -i 0 + + + + + + + var/cache/apt/archives/*.deb + echo "T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100" >> etc/inittab + + + bash + myapp + + + diff --git a/distribution/elbe-example/mini.xml b/distribution/elbe-example/mini.xml new file mode 100644 index 0000000..fe1d65f --- /dev/null +++ b/distribution/elbe-example/mini.xml @@ -0,0 +1,42 @@ + + + mini xml + 1 + + optimal to use as buildenv + + armel + + ftp.debian.org + /debian + http + + + http://debian.linutronix.de/elbe wheezy main + + + + wheezy + + elbe-bootstrap + + build-essential + debhelper + devscripts + autotools-dev + automake + + + + + mini + linutronix + foo + + + + bash + + + diff --git a/distribution/elbe-example/myapp/AUTHORS b/distribution/elbe-example/myapp/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/distribution/elbe-example/myapp/ChangeLog b/distribution/elbe-example/myapp/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/distribution/elbe-example/myapp/Makefile.am b/distribution/elbe-example/myapp/Makefile.am new file mode 100644 index 0000000..73ff4e8 --- /dev/null +++ b/distribution/elbe-example/myapp/Makefile.am @@ -0,0 +1,5 @@ +bin_PROGRAMS = myapp +myapp_SOURCES = myapp.c + +EXTRA_DIST = debian/changelog debian/compat debian/control debian/rules \ + debian/source/format diff --git a/distribution/elbe-example/myapp/NEWS b/distribution/elbe-example/myapp/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/distribution/elbe-example/myapp/README b/distribution/elbe-example/myapp/README new file mode 100644 index 0000000..e69de29 diff --git a/distribution/elbe-example/myapp/autogen.sh b/distribution/elbe-example/myapp/autogen.sh new file mode 100755 index 0000000..9088512 --- /dev/null +++ b/distribution/elbe-example/myapp/autogen.sh @@ -0,0 +1,2 @@ +#!/bin/bash +autoreconf -sif diff --git a/distribution/elbe-example/myapp/configure.ac b/distribution/elbe-example/myapp/configure.ac new file mode 100644 index 0000000..109e8ea --- /dev/null +++ b/distribution/elbe-example/myapp/configure.ac @@ -0,0 +1,23 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([myapp], [1.0], [manut@linutronix.de]) +AM_INIT_AUTOMAKE([-Wall -Werror]) +AC_CONFIG_SRCDIR([myapp.c]) +AC_CONFIG_HEADERS([config.h]) + +# Checks for programs. +AC_PROG_CC + +# Checks for libraries. + +# Checks for header files. + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. + +AC_CONFIG_FILES([Makefile]) + +AC_OUTPUT diff --git a/distribution/elbe-example/myapp/myapp.c b/distribution/elbe-example/myapp/myapp.c new file mode 100644 index 0000000..4e39438 --- /dev/null +++ b/distribution/elbe-example/myapp/myapp.c @@ -0,0 +1,12 @@ +#include +#include + +int main (int argc, char **argv) +{ + while (1) { + printf ("Hello ELBE\n"); + sleep (1); + } + + return 0; +} diff --git a/distribution/elbe-example/myrepo/conf/distributions b/distribution/elbe-example/myrepo/conf/distributions new file mode 100644 index 0000000..f6cb43a --- /dev/null +++ b/distribution/elbe-example/myrepo/conf/distributions @@ -0,0 +1,9 @@ +Origin: myrepo +Label: myrepo +Suite: stable +Codename: wheezy +Update: - myremoterepo +Version: +Architectures: i386 amd64 armel source +Components: main +Description: my debian packages diff --git a/distribution/elbe-example/myrepo/conf/updates b/distribution/elbe-example/myrepo/conf/updates new file mode 100644 index 0000000..8430306 --- /dev/null +++ b/distribution/elbe-example/myrepo/conf/updates @@ -0,0 +1,6 @@ +Name: myremoterepo +Method: http://localhost/debian +Components: main +Architectures: i386 amd64 source +VerifyRelease: blindtrust +IgnoreRelease: yes diff --git a/distribution/elbe-example/pres_elbe-example_en.tex b/distribution/elbe-example/pres_elbe-example_en.tex new file mode 100644 index 0000000..eb64782 --- /dev/null +++ b/distribution/elbe-example/pres_elbe-example_en.tex @@ -0,0 +1,448 @@ +\input{configpres} + +\lstset{language=c} + +\title{ELBE example} +\maketitle + + +\subsection{What will be done?} + +\begin{frame} +\frametitle{Goal} +\begin{itemize} +\item generate an ELBE buildenv +\item generate a software component and manage it with debian tools +\item build own software component inside the ELBE buildenv +\item include own application in target RFS +\item define a stripped target RFS +\end{itemize} +\end{frame} + +\subsection{generate a buildenv} + +\begin{frame}[fragile] +\frametitle{minimal XML file} +\begin{lstlisting} + + + mini xml + 1 + + optimal to use as buildenv + + armel + + ftp.debian.org + /debian + http + + + http://debian.linutronix.de/elbe wheezy main + + + +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{minimal XML file} +\begin{lstlisting} + wheezy + + elbe-bootstrap + + build-essential + debhelper + devscripts + autotools-dev + automake + + + + + mini + linutronix + foo + + + + bash + + + +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{create and build mini.xml} +\begin{lstlisting} +$ elbe create --directory=./buildenv mini.xml +$ cd buildenv +$ make +\end{lstlisting} +\end{frame} + +\subsection{build an own application} + +\begin{frame}[fragile] +\frametitle{myapp.c} +\begin{lstlisting} +$ mkdir myapp +$ cd myapp +$ $EDITOR myapp.c +\end{lstlisting} +\begin{lstlisting} +#include +#include + +int main (int argc, char **argv) +{ + while (1) { + printf ("Hello ELBE\n"); + sleep (1); + } + + return 0; +} +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{use autotools} +\begin{lstlisting} +$ $EDITOR Makefile.am +\end{lstlisting} +\begin{lstlisting} +bin_PROGRAMS = myapp +myapp_SOURCES = myapp.c +\end{lstlisting} +\begin{lstlisting} +$ autoscan +$ mv configure.scan configure.ac +$ rm autoscan.log +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle {use autotools} +\begin{lstlisting} +$ $EDITOR configure.ac +\end{lstlisting} +\begin{lstlisting} +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([myapp], [1.0], [manut@linutronix.de]) +AM_INIT_AUTOMAKE([-Wall -Werror]) +AC_CONFIG_SRCDIR([myapp.c]) +AC_CONFIG_HEADERS([config.h]) + +# Checks for programs. +AC_PROG_CC + +# Checks for libraries. + +# Checks for header files. + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. + +AC_CONFIG_FILES([Makefile]) + +AC_OUTPUT +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{use autotools} +\begin{lstlisting} +$ touch NEWS README AUTHORS ChangeLog +$ $EDITOR autogen.sh +\end{lstlisting} +\begin{lstlisting} +#!/bin/bash +automake --add-missing +autoreconf -sif +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{use autotools} +\begin{lstlisting} +$ chmod +x autogen.sh +$ ls -lh +insgesamt 12K +-rw-r--r-- 1 local local 0 Jan 7 09:45 AUTHORS +-rwxr-xr-x 1 local local 28 Jan 7 09:24 autogen.sh +-rw-r--r-- 1 local local 0 Jan 7 09:45 ChangeLog +-rw-r--r-- 1 local local 496 Jan 7 09:20 configure.ac +-rw-r--r-- 1 local local 35 Jan 7 09:35 Makefile.am +-rw-r--r-- 1 local local 143 Jan 7 09:18 myapp.c +-rw-r--r-- 1 local local 0 Jan 7 09:45 NEWS +-rw-r--r-- 1 local local 0 Jan 7 09:45 README +# these files may be added to your vcs +$ ./autogen.sh +$ ./configure +$ make +$ ./myapp +Hello ELBE +Hello ELBE +Hello ELBE +^C +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{debianize myapp} +\begin{lstlisting} +$ dh_make -n -p myapp_1.0 -e manut@linutronix.de +$ cd debian +$ rm *.ex *.EX docs README* copyright +$ $EDITOR changelog +\end{lstlisting} +\begin{lstlisting} +myapp (1.0) stable; urgency=low + + * Initial Release. + + -- Manuel Traut Tue, 07 Jan 2014 10:20:20 +0100 +\end{lstlisting} +\begin{lstlisting} +$ ls -lh +insgesamt 16K +-rw-r--r-- 1 local local 122 Jan 7 10:20 changelog +-rw-r--r-- 1 local local 2 Jan 7 10:20 compat +-rw-r--r-- 1 local local 517 Jan 7 10:20 control +-rwxr-xr-x 1 local local 135 Jan 7 10:20 rules +drwxr-xr-x 2 local local 19 Jan 7 10:20 source +# these files may be added to your vcs +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{debianize myapp} +\begin{lstlisting} +$ cd .. +$ $EDITOR Makefile.am +\end{lstlisting} +\begin{lstlisting} +bin_PROGRAMS = myapp +myapp_SOURCES = myapp.c + +EXTRA_DIST = debian/changelog debian/compat debian/control debian/rules \ + debian/source/format +\end{lstlisting} +\begin{lstlisting} +$ dpkg-buildpackage +$ ls .. +myapp myapp_1.0_i386.deb +myapp_1.0.dsc myapp_1.0.tar.gz +myapp_1.0_i386.changes +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{host myapp in a debian repository} +\begin{lstlisting} +$ cd .. +$ mkdir -p myrepo/conf +$ cd myrepo +$ $EDITOR conf/distributions +\end{lstlisting} +\begin{lstlisting} +Origin: myrepo +Label: myrepo +Suite: stable +Codename: wheezy +Update: - myremoterepo +Version: +Architectures: i386 amd64 source +Components: main +Description: my debian packages +\end{lstlisting} +\begin{lstlisting} +$ $EDITOR conf/updates +\end{lstlisting} +\begin{lstlisting} +Name: myremoterepo +Method: http://localhost/debian +Components: main +Architectures: i386 amd64 armel source +VerifyRelease: blindtrust +IgnoreRelease: yes +\end{lstlisting} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{host myapp in a debian repository} +\begin{lstlisting} +$ reprepro include wheezy ../myapp_1.0_i386.changes +$ sudo mkdir /var/www/ +$ sudo rsync -av --exclude=db --exclude=conf * /var/www/debian/ +\end{lstlisting} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{build debian package inside the buildenv} +\begin{lstlisting} +$ cd ../buildenv +$ make run-con +# login into buildenv +$ echo 'deb-src http://10.0.2.2/debian wheezy main' >> /etc/apt/sources.list +$ apt-get update +$ apt-get source myapp +$ cd myapp-1.0 +$ ./autogen.sh +$ dpkg-buildpackage -b +$ scp ../myapp*.changes ../myapp*.deb 10.0.2.2:/tmp +$ dpkg -i ../myapp*.deb +\end{lstlisting} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{add myapp armel package to the repo} +\begin{lstlisting} +$ cd ../myrepo +$ reprepro include wheezy /tmp/myapp_1.0_armel.changes +$ sudo rsync -av --exclude=db --exclude=conf * /var/www/debian/ +\end{lstlisting} +\end{frame} + + +\subsection{include own application in target RFS} + +\begin{frame}[fragile] +\frametitle{create target image and add myapp} +\begin{lstlisting} +$ cd .. +$ $EDIT mini.xml +\end{lstlisting} +\begin{lstlisting} + + + mini xml + 1 + + minimal target rfs including a simple app + buildenv to build the simple app + + armel + + ftp.debian.org + /debian + http + + + http://debian.linutronix.de/elbe wheezy main + + + http://LOCALMACHINE/debian wheezy main + http://LOCALMACHINE/debian wheezy main + + + +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{create target image and add myapp} +\begin{lstlisting} + wheezy + + elbe-bootstrap + + build-essential + debhelper + devscripts + autotools-dev + automake + + + + + mini + linutronix + foo + + var/cache/apt/archives/*.deb + + + bash + myapp + + + +\end{lstlisting} +\end{frame} + +\subsection{define a striped target RFS} +\begin{frame}[fragile] +\frametitle{set elbe mode and define images} +\begin{lstlisting} +... + + mini + linutronix + foo + ttyAMA0,115200 + + + rootfs.tar.gz + + + + + my.img + 200MiB + + remain + + + + + + + + / + + ext4 + -i 0 + + + + + + + var/cache/apt/archives/*.deb + echo "T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100" >> etc/inittab + + + bash + myapp + + +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{build target rfs} +\begin{lstlisting} +$ elbe create mini.xml --directory=./target +$ cd target +$ make + +\input{tailpres} -- cgit v1.2.3 From 9aba160745d4e3295a90d9befc4f01f45d991966 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Fri, 17 Jan 2014 22:37:53 +0100 Subject: finish work on elbe example and slides - tested with elbe from git 8c697255bd58437a1466b6d8cc46b7dbcd2a87ed Signed-off-by: Manuel Traut --- .../elbe-example/mini-incl-target-stripped.xml | 934 +++++++++++++++++++++ distribution/elbe-example/mini-incl-target.xml | 9 +- distribution/elbe-example/myrepo/conf/updates | 2 +- distribution/elbe-example/pres_elbe-example_en.tex | 208 +++-- 4 files changed, 1098 insertions(+), 55 deletions(-) create mode 100644 distribution/elbe-example/mini-incl-target-stripped.xml diff --git a/distribution/elbe-example/mini-incl-target-stripped.xml b/distribution/elbe-example/mini-incl-target-stripped.xml new file mode 100644 index 0000000..30f8f48 --- /dev/null +++ b/distribution/elbe-example/mini-incl-target-stripped.xml @@ -0,0 +1,934 @@ + + + mini xml + 1 + + minimal target rfs including a simple app + buildenv to build the simple app + + armel + + ftp.debian.org + /debian + http + + + http://debian.linutronix.de/elbe wheezy main + + + http://LOCALMACHINE/myrepo wheezy main + http://LOCALMACHINE/myrepo wheezy main + + + + + wheezy + + elbe-bootstrap + + build-essential + debhelper + devscripts + autotools-dev + automake + + + + + mini + linutronix + foo + ttyAMA0,115200 + + + rootfs.tar.gz + + + + + my.img + 200MiB + + remain + + + + + + + + / + + ext2 + -i 0 + + + + + + + var/cache/apt/archives/*.deb + echo "T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100" >> etc/inittab + /var/backups + /var/tmp + /var/log + /var/lib/dpkg/updates + /var/lib/dpkg/parts + /var/lib/dpkg/info + /var/lib/dpkg/alternatives + /var/lib/misc + /var/spool + /var/local + /usr/share + /usr/share/debianutils/shells + /usr/share/dict + /usr/share/libc-bin/nsswitch.conf + /usr/share/dpkg/archtable + /usr/share/dpkg/abitable + /usr/share/dpkg/ostable + /usr/share/dpkg/triplettable + /usr/share/dpkg/cputable + /usr/share/locale + /usr/share/locale/ja + /usr/share/locale/ja/LC_MESSAGES/bash.mo + /usr/share/locale/ja/LC_MESSAGES/tar.mo + /usr/share/locale/ja/LC_MESSAGES/dpkg.mo + /usr/share/locale/mr + /usr/share/locale/mr/LC_MESSAGES/dpkg.mo + /usr/share/locale/tr + /usr/share/locale/tr/LC_MESSAGES/bash.mo + /usr/share/locale/tr/LC_MESSAGES/tar.mo + /usr/share/locale/pa + /usr/share/locale/pa/LC_MESSAGES/dpkg.mo + /usr/share/locale/pt_BR + /usr/share/locale/pt_BR/LC_MESSAGES/bash.mo + /usr/share/locale/pt_BR/LC_MESSAGES/tar.mo + /usr/share/locale/pt_BR/LC_MESSAGES/dpkg.mo + /usr/share/locale/nn + /usr/share/locale/nn/LC_MESSAGES/dpkg.mo + /usr/share/locale/dz + /usr/share/locale/dz/LC_MESSAGES/dpkg.mo + /usr/share/locale/zh_TW + /usr/share/locale/zh_TW/LC_MESSAGES/bash.mo + /usr/share/locale/zh_TW/LC_MESSAGES/tar.mo + /usr/share/locale/zh_TW/LC_MESSAGES/dpkg.mo + /usr/share/locale/en@boldquot + /usr/share/locale/en@boldquot/LC_MESSAGES/bash.mo + /usr/share/locale/de + /usr/share/locale/de/LC_MESSAGES/bash.mo + /usr/share/locale/de/LC_MESSAGES/tar.mo + /usr/share/locale/de/LC_MESSAGES/dpkg.mo + /usr/share/locale/vi + /usr/share/locale/vi/LC_MESSAGES/bash.mo + /usr/share/locale/vi/LC_MESSAGES/tar.mo + /usr/share/locale/vi/LC_MESSAGES/dpkg.mo + /usr/share/locale/fr + /usr/share/locale/fr/LC_MESSAGES/bash.mo + /usr/share/locale/fr/LC_MESSAGES/tar.mo + /usr/share/locale/fr/LC_MESSAGES/dpkg.mo + /usr/share/locale/ro + /usr/share/locale/ro/LC_MESSAGES/bash.mo + /usr/share/locale/ro/LC_MESSAGES/tar.mo + /usr/share/locale/ro/LC_MESSAGES/dpkg.mo + /usr/share/locale/et + /usr/share/locale/et/LC_MESSAGES/bash.mo + /usr/share/locale/et/LC_MESSAGES/tar.mo + /usr/share/locale/et/LC_MESSAGES/dpkg.mo + /usr/share/locale/es + /usr/share/locale/es/LC_MESSAGES/bash.mo + /usr/share/locale/es/LC_MESSAGES/tar.mo + /usr/share/locale/es/LC_MESSAGES/dpkg.mo + /usr/share/locale/ga + /usr/share/locale/ga/LC_MESSAGES/bash.mo + /usr/share/locale/ga/LC_MESSAGES/tar.mo + /usr/share/locale/sv + /usr/share/locale/sv/LC_MESSAGES/bash.mo + /usr/share/locale/sv/LC_MESSAGES/tar.mo + /usr/share/locale/sv/LC_MESSAGES/dpkg.mo + /usr/share/locale/eo + /usr/share/locale/eo/LC_MESSAGES/bash.mo + /usr/share/locale/eo/LC_MESSAGES/dpkg.mo + /usr/share/locale/lt + /usr/share/locale/lt/LC_MESSAGES/bash.mo + /usr/share/locale/lt/LC_MESSAGES/dpkg.mo + /usr/share/locale/id + /usr/share/locale/id/LC_MESSAGES/bash.mo + /usr/share/locale/id/LC_MESSAGES/tar.mo + /usr/share/locale/id/LC_MESSAGES/dpkg.mo + /usr/share/locale/nl + /usr/share/locale/nl/LC_MESSAGES/bash.mo + /usr/share/locale/nl/LC_MESSAGES/tar.mo + /usr/share/locale/nl/LC_MESSAGES/dpkg.mo + /usr/share/locale/bg + /usr/share/locale/bg/LC_MESSAGES/bash.mo + /usr/share/locale/bg/LC_MESSAGES/tar.mo + /usr/share/locale/bs + /usr/share/locale/bs/LC_MESSAGES/dpkg.mo + /usr/share/locale/cs + /usr/share/locale/cs/LC_MESSAGES/bash.mo + /usr/share/locale/cs/LC_MESSAGES/tar.mo + /usr/share/locale/cs/LC_MESSAGES/dpkg.mo + /usr/share/locale/it + /usr/share/locale/it/LC_MESSAGES/tar.mo + /usr/share/locale/it/LC_MESSAGES/dpkg.mo + /usr/share/locale/hu + /usr/share/locale/hu/LC_MESSAGES/bash.mo + /usr/share/locale/hu/LC_MESSAGES/tar.mo + /usr/share/locale/hu/LC_MESSAGES/dpkg.mo + /usr/share/locale/hr + /usr/share/locale/hr/LC_MESSAGES/tar.mo + /usr/share/locale/th + /usr/share/locale/th/LC_MESSAGES/dpkg.mo + /usr/share/locale/zh_CN + /usr/share/locale/zh_CN/LC_MESSAGES/bash.mo + /usr/share/locale/zh_CN/LC_MESSAGES/tar.mo + /usr/share/locale/zh_CN/LC_MESSAGES/dpkg.mo + /usr/share/locale/da + /usr/share/locale/da/LC_MESSAGES/tar.mo + /usr/share/locale/da/LC_MESSAGES/dpkg.mo + /usr/share/locale/pl + /usr/share/locale/pl/LC_MESSAGES/bash.mo + /usr/share/locale/pl/LC_MESSAGES/tar.mo + /usr/share/locale/pl/LC_MESSAGES/dpkg.mo + /usr/share/locale/pt + /usr/share/locale/pt/LC_MESSAGES/tar.mo + /usr/share/locale/pt/LC_MESSAGES/dpkg.mo + /usr/share/locale/el + /usr/share/locale/el/LC_MESSAGES/tar.mo + /usr/share/locale/el/LC_MESSAGES/dpkg.mo + /usr/share/locale/ku + /usr/share/locale/ku/LC_MESSAGES/dpkg.mo + /usr/share/locale/af + /usr/share/locale/af/LC_MESSAGES/bash.mo + /usr/share/locale/fi + /usr/share/locale/fi/LC_MESSAGES/bash.mo + /usr/share/locale/fi/LC_MESSAGES/tar.mo + /usr/share/locale/ko + /usr/share/locale/ko/LC_MESSAGES/tar.mo + /usr/share/locale/ko/LC_MESSAGES/dpkg.mo + /usr/share/locale/en@quot + /usr/share/locale/en@quot/LC_MESSAGES/bash.mo + /usr/share/locale/gl + /usr/share/locale/gl/LC_MESSAGES/tar.mo + /usr/share/locale/gl/LC_MESSAGES/dpkg.mo + /usr/share/locale/ne + /usr/share/locale/ne/LC_MESSAGES/dpkg.mo + /usr/share/locale/ast + /usr/share/locale/ast/LC_MESSAGES/dpkg.mo + /usr/share/locale/sl + /usr/share/locale/sl/LC_MESSAGES/tar.mo + /usr/share/locale/ca + /usr/share/locale/ca/LC_MESSAGES/bash.mo + /usr/share/locale/ca/LC_MESSAGES/tar.mo + /usr/share/locale/ca/LC_MESSAGES/dpkg.mo + /usr/share/locale/uk + /usr/share/locale/uk/LC_MESSAGES/bash.mo + /usr/share/locale/uk/LC_MESSAGES/tar.mo + /usr/share/locale/eu + /usr/share/locale/eu/LC_MESSAGES/tar.mo + /usr/share/locale/eu/LC_MESSAGES/dpkg.mo + /usr/share/locale/ms + /usr/share/locale/ms/LC_MESSAGES/tar.mo + /usr/share/locale/nb + /usr/share/locale/nb/LC_MESSAGES/tar.mo + /usr/share/locale/nb/LC_MESSAGES/dpkg.mo + /usr/share/locale/sk + /usr/share/locale/sk/LC_MESSAGES/bash.mo + /usr/share/locale/sk/LC_MESSAGES/tar.mo + /usr/share/locale/sk/LC_MESSAGES/dpkg.mo + /usr/share/locale/ru + /usr/share/locale/ru/LC_MESSAGES/bash.mo + /usr/share/locale/ru/LC_MESSAGES/tar.mo + /usr/share/locale/ru/LC_MESSAGES/dpkg.mo + /usr/share/locale/km + /usr/share/locale/km/LC_MESSAGES/dpkg.mo + /usr/share/locale/ky + /usr/share/locale/ky/LC_MESSAGES/tar.mo + /usr/share/locale/tl + /usr/share/locale/tl/LC_MESSAGES/dpkg.mo + /usr/share/doc + /usr/share/doc/libbz2-1.0/changelog.gz + /usr/share/doc/libbz2-1.0/copyright + /usr/share/doc/libbz2-1.0/changelog.Debian.gz + /usr/share/doc/libc6/README.hesiod.gz + /usr/share/doc/libc6/changelog.gz + /usr/share/doc/libc6/NEWS.Debian.gz + /usr/share/doc/libc6/FAQ.gz + /usr/share/doc/libc6/test-results-arm-linux-gnueabi-libc + /usr/share/doc/libc6/copyright + /usr/share/doc/libc6/changelog.Debian.gz + /usr/share/doc/libc6/NEWS.gz + /usr/share/doc/libc6/BUGS + /usr/share/doc/libc6/README.Debian.gz + /usr/share/doc/libselinux1/changelog.gz + /usr/share/doc/libselinux1/copyright + /usr/share/doc/libselinux1/changelog.Debian.gz + /usr/share/doc/debianutils/changelog.gz + /usr/share/doc/debianutils/copyright + /usr/share/doc/debianutils/README.shells.gz + /usr/share/doc/zlib1g/changelog.gz + /usr/share/doc/zlib1g/copyright + /usr/share/doc/zlib1g/changelog.Debian.gz + /usr/share/doc/sensible-utils/changelog.gz + /usr/share/doc/sensible-utils/copyright + /usr/share/doc/tar/AUTHORS + /usr/share/doc/tar/changelog.1.gz + /usr/share/doc/tar/changelog.gz + /usr/share/doc/tar/NEWS.Debian.gz + /usr/share/doc/tar/THANKS.gz + /usr/share/doc/tar/copyright + /usr/share/doc/tar/changelog.Debian.gz + /usr/share/doc/tar/README.Debian + /usr/share/doc/tar/NEWS.gz + /usr/share/doc/bash/POSIX.gz + /usr/share/doc/bash/COMPAT.gz + /usr/share/doc/bash/FAQ + /usr/share/doc/bash/inputrc.arrows + /usr/share/doc/bash/CHANGES.gz + /usr/share/doc/bash/copyright + /usr/share/doc/bash/changelog.Debian.gz + /usr/share/doc/bash/INTRO.gz + /usr/share/doc/bash/README.commands.gz + /usr/share/doc/bash/README.abs-guide + /usr/share/doc/bash/NEWS.gz + /usr/share/doc/bash/README.Debian.gz + /usr/share/doc/libc-bin/changelog.gz + /usr/share/doc/libc-bin/TODO.Debian + /usr/share/doc/libc-bin/copyright + /usr/share/doc/libc-bin/changelog.Debian.gz + /usr/share/doc/liblzma5/AUTHORS + /usr/share/doc/liblzma5/changelog.gz + /usr/share/doc/liblzma5/THANKS + /usr/share/doc/liblzma5/copyright + /usr/share/doc/liblzma5/changelog.Debian.gz + /usr/share/doc/liblzma5/NEWS.gz + /usr/share/doc/dpkg/AUTHORS + /usr/share/doc/dpkg/changelog.gz + /usr/share/doc/dpkg/usertags.gz + /usr/share/doc/dpkg/README.feature-removal-schedule.gz + /usr/share/doc/dpkg/THANKS.gz + /usr/share/doc/dpkg/copyright + /usr/share/doc/dpkg/changelog.Debian.gz + /usr/share/doc/multiarch-support/changelog.gz + /usr/share/doc/multiarch-support/copyright + /usr/share/doc/multiarch-support/changelog.Debian.gz + /usr/share/doc/gcc-4.7-base/TODO.Debian + /usr/share/doc/gcc-4.7-base/README.Debian.armel.gz + /usr/share/doc/gcc-4.7-base/copyright + /usr/share/doc/gcc-4.7-base/changelog.Debian.gz + /usr/share/doc/base-files/README + /usr/share/doc/base-files/changelog.gz + /usr/share/doc/base-files/README.FHS + /usr/share/doc/base-files/FAQ + /usr/share/doc/base-files/copyright + /usr/share/doc/libtinfo5/changelog.gz + /usr/share/doc/libtinfo5/TODO.Debian + /usr/share/doc/libtinfo5/copyright + /usr/share/doc/libtinfo5/changelog.Debian.gz + /usr/share/doc/myapp/changelog.gz + /usr/share/doc/dash/changelog.gz + /usr/share/doc/dash/NEWS.Debian.gz + /usr/share/doc/dash/README.source + /usr/share/doc/dash/README.Debian.diet + /usr/share/doc/dash/copyright + /usr/share/doc/dash/changelog.Debian.gz + /usr/share/menu/bash + /usr/share/menu/dash + /usr/share/base-files/nsswitch.conf + /usr/share/base-files/info.dir + /usr/share/base-files/dot.bashrc + /usr/share/base-files/profile + /usr/share/base-files/dot.profile + /usr/share/base-files/motd + /usr/share/base-files/profile.md5sums + /usr/share/base-files/staff-group-for-usr-local + /usr/share/misc + /usr/share/lintian + /usr/share/lintian/overrides/libc6 + /usr/share/lintian/overrides/libselinux1 + /usr/share/lintian/overrides/libgcc1 + /usr/share/lintian/overrides/bash + /usr/share/lintian/overrides/libc-bin + /usr/share/lintian/overrides/dpkg + /usr/share/lintian/overrides/base-files + /usr/share/man + /usr/share/man/ja + /usr/share/man/ja/man8/update-alternatives.8.gz + /usr/share/man/ja/man8/start-stop-daemon.8.gz + /usr/share/man/ja/man8/dpkg-statoverride.8.gz + /usr/share/man/ja/man8/dpkg-divert.8.gz + /usr/share/man/ja/man1/sensible-pager.1.gz + /usr/share/man/ja/man1/dpkg-maintscript-helper.1.gz + /usr/share/man/ja/man1/dpkg-deb.1.gz + /usr/share/man/ja/man1/sensible-editor.1.gz + /usr/share/man/ja/man1/dpkg.1.gz + /usr/share/man/ja/man1/sensible-browser.1.gz + /usr/share/man/ja/man1/dpkg-split.1.gz + /usr/share/man/ja/man1/dpkg-trigger.1.gz + /usr/share/man/ja/man1/dpkg-query.1.gz + /usr/share/man/ja/man5/dpkg.cfg.5.gz + /usr/share/man/man8/zic.8.gz + /usr/share/man/man8/update-alternatives.8.gz + /usr/share/man/man8/ld.so.8.gz + /usr/share/man/man8/start-stop-daemon.8.gz + /usr/share/man/man8/add-shell.8.gz + /usr/share/man/man8/remove-shell.8.gz + /usr/share/man/man8/rpcinfo.8.gz + /usr/share/man/man8/dpkg-statoverride.8.gz + /usr/share/man/man8/installkernel.8.gz + /usr/share/man/man8/rmt-tar.8.gz + /usr/share/man/man8/run-parts.8.gz + /usr/share/man/man8/ldconfig.8.gz + /usr/share/man/man8/iconvconfig.8.gz + /usr/share/man/man8/savelog.8.gz + /usr/share/man/man8/dpkg-divert.8.gz + /usr/share/man/de + /usr/share/man/de/man8/update-alternatives.8.gz + /usr/share/man/de/man8/start-stop-daemon.8.gz + /usr/share/man/de/man8/add-shell.8.gz + /usr/share/man/de/man8/remove-shell.8.gz + /usr/share/man/de/man8/dpkg-statoverride.8.gz + /usr/share/man/de/man8/installkernel.8.gz + /usr/share/man/de/man8/run-parts.8.gz + /usr/share/man/de/man8/savelog.8.gz + /usr/share/man/de/man8/dpkg-divert.8.gz + /usr/share/man/de/man1/sensible-pager.1.gz + /usr/share/man/de/man1/dpkg-maintscript-helper.1.gz + /usr/share/man/de/man1/dpkg-deb.1.gz + /usr/share/man/de/man1/which.1.gz + /usr/share/man/de/man1/sensible-editor.1.gz + /usr/share/man/de/man1/dpkg.1.gz + /usr/share/man/de/man1/sensible-browser.1.gz + /usr/share/man/de/man1/dpkg-split.1.gz + /usr/share/man/de/man1/dpkg-trigger.1.gz + /usr/share/man/de/man1/tempfile.1.gz + /usr/share/man/de/man1/dpkg-query.1.gz + /usr/share/man/de/man5/dpkg.cfg.5.gz + /usr/share/man/fr + /usr/share/man/fr/man8/update-alternatives.8.gz + /usr/share/man/fr/man8/start-stop-daemon.8.gz + /usr/share/man/fr/man8/add-shell.8.gz + /usr/share/man/fr/man8/remove-shell.8.gz + /usr/share/man/fr/man8/dpkg-statoverride.8.gz + /usr/share/man/fr/man8/installkernel.8.gz + /usr/share/man/fr/man8/run-parts.8.gz + /usr/share/man/fr/man8/savelog.8.gz + /usr/share/man/fr/man8/dpkg-divert.8.gz + /usr/share/man/fr/man1/sensible-pager.1.gz + /usr/share/man/fr/man1/dpkg-maintscript-helper.1.gz + /usr/share/man/fr/man1/dpkg-deb.1.gz + /usr/share/man/fr/man1/which.1.gz + /usr/share/man/fr/man1/sensible-editor.1.gz + /usr/share/man/fr/man1/dpkg.1.gz + /usr/share/man/fr/man1/sensible-browser.1.gz + /usr/share/man/fr/man1/dpkg-split.1.gz + /usr/share/man/fr/man1/dpkg-trigger.1.gz + /usr/share/man/fr/man1/tempfile.1.gz + /usr/share/man/fr/man1/dpkg-query.1.gz + /usr/share/man/fr/man5/dpkg.cfg.5.gz + /usr/share/man/man1/sh.1.gz + /usr/share/man/man1/bash.1.gz + /usr/share/man/man1/dash.1.gz + /usr/share/man/man1/tar.1.gz + /usr/share/man/man1/getconf.1.gz + /usr/share/man/man1/sensible-pager.1.gz + /usr/share/man/man1/bashbug.1.gz + /usr/share/man/man1/dpkg-maintscript-helper.1.gz + /usr/share/man/man1/dpkg-deb.1.gz + /usr/share/man/man1/which.1.gz + /usr/share/man/man1/locale.1.gz + /usr/share/man/man1/ischroot.1.gz + /usr/share/man/man1/sensible-editor.1.gz + /usr/share/man/man1/dpkg.1.gz + /usr/share/man/man1/ldd.1.gz + /usr/share/man/man1/catchsegv.1.gz + /usr/share/man/man1/sensible-browser.1.gz + /usr/share/man/man1/dpkg-split.1.gz + /usr/share/man/man1/dpkg-trigger.1.gz + /usr/share/man/man1/zdump.1.gz + /usr/share/man/man1/tempfile.1.gz + /usr/share/man/man1/rbash.1.gz + /usr/share/man/man1/clear_console.1.gz + /usr/share/man/man1/tzselect.1.gz + /usr/share/man/man1/iconv.1.gz + /usr/share/man/man1/localedef.1.gz + /usr/share/man/man1/dpkg-query.1.gz + /usr/share/man/es + /usr/share/man/es/man8/update-alternatives.8.gz + /usr/share/man/es/man8/start-stop-daemon.8.gz + /usr/share/man/es/man8/add-shell.8.gz + /usr/share/man/es/man8/remove-shell.8.gz + /usr/share/man/es/man8/dpkg-statoverride.8.gz + /usr/share/man/es/man8/installkernel.8.gz + /usr/share/man/es/man8/run-parts.8.gz + /usr/share/man/es/man8/savelog.8.gz + /usr/share/man/es/man8/dpkg-divert.8.gz + /usr/share/man/es/man1/sensible-pager.1.gz + /usr/share/man/es/man1/dpkg-maintscript-helper.1.gz + /usr/share/man/es/man1/dpkg-deb.1.gz + /usr/share/man/es/man1/which.1.gz + /usr/share/man/es/man1/sensible-editor.1.gz + /usr/share/man/es/man1/dpkg.1.gz + /usr/share/man/es/man1/sensible-browser.1.gz + /usr/share/man/es/man1/dpkg-split.1.gz + /usr/share/man/es/man1/dpkg-trigger.1.gz + /usr/share/man/es/man1/tempfile.1.gz + /usr/share/man/es/man1/dpkg-query.1.gz + /usr/share/man/es/man5/dpkg.cfg.5.gz + /usr/share/man/man7/bash-builtins.7.gz + /usr/share/man/sv + /usr/share/man/sv/man8/update-alternatives.8.gz + /usr/share/man/sv/man8/start-stop-daemon.8.gz + /usr/share/man/sv/man8/dpkg-statoverride.8.gz + /usr/share/man/sv/man8/dpkg-divert.8.gz + /usr/share/man/sv/man1/dpkg-maintscript-helper.1.gz + /usr/share/man/sv/man1/dpkg-deb.1.gz + /usr/share/man/sv/man1/dpkg.1.gz + /usr/share/man/sv/man1/dpkg-split.1.gz + /usr/share/man/sv/man1/dpkg-trigger.1.gz + /usr/share/man/sv/man1/dpkg-query.1.gz + /usr/share/man/sv/man5/dpkg.cfg.5.gz + /usr/share/man/it + /usr/share/man/it/man8/update-alternatives.8.gz + /usr/share/man/it/man8/start-stop-daemon.8.gz + /usr/share/man/it/man1/sensible-pager.1.gz + /usr/share/man/it/man1/dpkg-deb.1.gz + /usr/share/man/it/man1/sensible-editor.1.gz + /usr/share/man/it/man1/dpkg.1.gz + /usr/share/man/it/man1/sensible-browser.1.gz + /usr/share/man/it/man1/dpkg-split.1.gz + /usr/share/man/it/man1/dpkg-query.1.gz + /usr/share/man/it/man5/dpkg.cfg.5.gz + /usr/share/man/hu + /usr/share/man/hu/man5/dpkg.cfg.5.gz + /usr/share/man/pl + /usr/share/man/pl/man8/update-alternatives.8.gz + /usr/share/man/pl/man8/start-stop-daemon.8.gz + /usr/share/man/pl/man8/dpkg-statoverride.8.gz + /usr/share/man/pl/man8/dpkg-divert.8.gz + /usr/share/man/pl/man1/sensible-pager.1.gz + /usr/share/man/pl/man1/dpkg-maintscript-helper.1.gz + /usr/share/man/pl/man1/dpkg-deb.1.gz + /usr/share/man/pl/man1/sensible-editor.1.gz + /usr/share/man/pl/man1/dpkg.1.gz + /usr/share/man/pl/man1/sensible-browser.1.gz + /usr/share/man/pl/man1/dpkg-split.1.gz + /usr/share/man/pl/man1/dpkg-trigger.1.gz + /usr/share/man/pl/man1/dpkg-query.1.gz + /usr/share/man/pl/man5/dpkg.cfg.5.gz + /usr/share/man/man5/gai.conf.5.gz + /usr/share/man/man5/dpkg.cfg.5.gz + /usr/share/man/sl + /usr/share/man/sl/man8/add-shell.8.gz + /usr/share/man/sl/man8/remove-shell.8.gz + /usr/share/man/sl/man8/installkernel.8.gz + /usr/share/man/sl/man8/run-parts.8.gz + /usr/share/man/sl/man8/savelog.8.gz + /usr/share/man/sl/man1/which.1.gz + /usr/share/man/sl/man1/tempfile.1.gz + /usr/share/info + /usr/share/common-licenses/GPL-3 + /usr/share/common-licenses/LGPL-2.1 + /usr/share/common-licenses/BSD + /usr/share/common-licenses/LGPL + /usr/share/common-licenses/GPL-2 + /usr/share/common-licenses/Apache-2.0 + /usr/share/common-licenses/Artistic + /usr/share/common-licenses/GFDL-1.3 + /usr/share/common-licenses/LGPL-2 + /usr/share/common-licenses/GFDL-1.2 + /usr/share/common-licenses/GPL-1 + /usr/share/common-licenses/LGPL-3 + /usr/share/common-licenses/GFDL + /usr/share/common-licenses/GPL + /usr/bin/bashbug + /usr/bin/ischroot + /usr/bin/zdump + /usr/bin/ldd + /usr/bin/dpkg-query + /usr/bin/localedef + /usr/bin/sensible-pager + /usr/bin/rpcinfo + /usr/bin/getent + /usr/bin/dpkg-maintscript-helper + /usr/bin/savelog + /usr/bin/dpkg-trigger + /usr/bin/sensible-editor + /usr/bin/tzselect + /usr/bin/catchsegv + /usr/bin/dpkg-split + /usr/bin/dpkg-statoverride + /usr/bin/update-alternatives + /usr/bin/dpkg-deb + /usr/bin/dpkg + /usr/bin/locale + /usr/bin/iconv + /usr/bin/which + /usr/bin/clear_console + /usr/bin/dpkg-divert + /usr/bin/getconf + /usr/bin/sensible-browser + /usr/sbin/remove-shell + /usr/sbin/rmt-tar + /usr/sbin/add-shell + /usr/sbin/dpkg-statoverride + /usr/sbin/update-alternatives + /usr/sbin/dpkg-divert + /usr/sbin/install-info + /usr/sbin/zic + /usr/sbin/iconvconfig + /usr/lib/pt_chown + /usr/lib/mime + /usr/lib/mime/packages/sensible-utils + /usr/lib/mime/packages/tar + /usr/lib/arm-linux-gnueabi/libtic.so.5.9 + /usr/lib/arm-linux-gnueabi/libtic.so.5 + /usr/lib/arm-linux-gnueabi/gconv/IBM1008.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-9E.so + /usr/lib/arm-linux-gnueabi/gconv/IBM904.so + /usr/lib/arm-linux-gnueabi/gconv/IBM852.so + /usr/lib/arm-linux-gnueabi/gconv/IBM284.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-DK-NO-A.so + /usr/lib/arm-linux-gnueabi/gconv/INIS-CYRILLIC.so + /usr/lib/arm-linux-gnueabi/gconv/BIG5.so + /usr/lib/arm-linux-gnueabi/gconv/ISO_6937-2.so + /usr/lib/arm-linux-gnueabi/gconv/libGB.so + /usr/lib/arm-linux-gnueabi/gconv/CSN_369103.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1149.so + /usr/lib/arm-linux-gnueabi/gconv/CP932.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-2.so + /usr/lib/arm-linux-gnueabi/gconv/EUC-KR.so + /usr/lib/arm-linux-gnueabi/gconv/IBM5347.so + /usr/lib/arm-linux-gnueabi/gconv/IBM933.so + /usr/lib/arm-linux-gnueabi/gconv/DEC-MCS.so + /usr/lib/arm-linux-gnueabi/gconv/VISCII.so + /usr/lib/arm-linux-gnueabi/gconv/IBM285.so + /usr/lib/arm-linux-gnueabi/gconv/IBM855.so + /usr/lib/arm-linux-gnueabi/gconv/MIK.so + /usr/lib/arm-linux-gnueabi/gconv/GBGBK.so + /usr/lib/arm-linux-gnueabi/gconv/IBM875.so + /usr/lib/arm-linux-gnueabi/gconv/CP1125.so + /usr/lib/arm-linux-gnueabi/gconv/ISO_5427.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1004.so + /usr/lib/arm-linux-gnueabi/gconv/ISO-2022-KR.so + /usr/lib/arm-linux-gnueabi/gconv/IBM037.so + /usr/lib/arm-linux-gnueabi/gconv/IBM9066.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1130.so + /usr/lib/arm-linux-gnueabi/gconv/IBM864.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-9.so + /usr/lib/arm-linux-gnueabi/gconv/IBM4899.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-4.so + /usr/lib/arm-linux-gnueabi/gconv/IBM275.so + /usr/lib/arm-linux-gnueabi/gconv/IBM868.so + /usr/lib/arm-linux-gnueabi/gconv/EUC-TW.so + /usr/lib/arm-linux-gnueabi/gconv/IBM862.so + /usr/lib/arm-linux-gnueabi/gconv/IBM4909.so + /usr/lib/arm-linux-gnueabi/gconv/IBM861.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-15.so + /usr/lib/arm-linux-gnueabi/gconv/CP1258.so + /usr/lib/arm-linux-gnueabi/gconv/MAC-SAMI.so + /usr/lib/arm-linux-gnueabi/gconv/IBM4971.so + /usr/lib/arm-linux-gnueabi/gconv/IBM278.so + /usr/lib/arm-linux-gnueabi/gconv/HP-ROMAN9.so + /usr/lib/arm-linux-gnueabi/gconv/ARMSCII-8.so + /usr/lib/arm-linux-gnueabi/gconv/MACINTOSH.so + /usr/lib/arm-linux-gnueabi/gconv/CP1257.so + /usr/lib/arm-linux-gnueabi/gconv/IBM866NAV.so + /usr/lib/arm-linux-gnueabi/gconv/libKSC.so + /usr/lib/arm-linux-gnueabi/gconv/IBM856.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-14.so + /usr/lib/arm-linux-gnueabi/gconv/libISOIR165.so + /usr/lib/arm-linux-gnueabi/gconv/BIG5HKSCS.so + /usr/lib/arm-linux-gnueabi/gconv/ISO-2022-JP-3.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1160.so + /usr/lib/arm-linux-gnueabi/gconv/GOST_19768-74.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1156.so + /usr/lib/arm-linux-gnueabi/gconv/gconv-modules.cache + /usr/lib/arm-linux-gnueabi/gconv/UTF-16.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-ES.so + /usr/lib/arm-linux-gnueabi/gconv/GBBIG5.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-10.so + /usr/lib/arm-linux-gnueabi/gconv/BRF.so + /usr/lib/arm-linux-gnueabi/gconv/IBM9030.so + /usr/lib/arm-linux-gnueabi/gconv/ISO-IR-209.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-1.so + /usr/lib/arm-linux-gnueabi/gconv/UTF-7.so + /usr/lib/arm-linux-gnueabi/gconv/CP775.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1157.so + /usr/lib/arm-linux-gnueabi/gconv/IBM420.so + /usr/lib/arm-linux-gnueabi/gconv/IBM437.so + /usr/lib/arm-linux-gnueabi/gconv/TIS-620.so + /usr/lib/arm-linux-gnueabi/gconv/UNICODE.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1166.so + /usr/lib/arm-linux-gnueabi/gconv/IBM905.so + /usr/lib/arm-linux-gnueabi/gconv/ECMA-CYRILLIC.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1144.so + /usr/lib/arm-linux-gnueabi/gconv/IBM277.so + /usr/lib/arm-linux-gnueabi/gconv/IBM423.so + /usr/lib/arm-linux-gnueabi/gconv/IBM274.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1025.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-AT-DE.so + /usr/lib/arm-linux-gnueabi/gconv/RK1048.so + /usr/lib/arm-linux-gnueabi/gconv/IBM871.so + /usr/lib/arm-linux-gnueabi/gconv/EUC-JP-MS.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-FI-SE-A.so + /usr/lib/arm-linux-gnueabi/gconv/IBM424.so + /usr/lib/arm-linux-gnueabi/gconv/gconv-modules + /usr/lib/arm-linux-gnueabi/gconv/NATS-DANO.so + /usr/lib/arm-linux-gnueabi/gconv/IBM866.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-FR.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1146.so + /usr/lib/arm-linux-gnueabi/gconv/SHIFT_JISX0213.so + /usr/lib/arm-linux-gnueabi/gconv/PT154.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1147.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1145.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-ES-S.so + /usr/lib/arm-linux-gnueabi/gconv/libCNS.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-7.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-US.so + /usr/lib/arm-linux-gnueabi/gconv/IBM297.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1141.so + /usr/lib/arm-linux-gnueabi/gconv/IBM803.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1163.so + /usr/lib/arm-linux-gnueabi/gconv/libJIS.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1158.so + /usr/lib/arm-linux-gnueabi/gconv/IBM860.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-IS-FRISS.so + /usr/lib/arm-linux-gnueabi/gconv/IBM891.so + /usr/lib/arm-linux-gnueabi/gconv/TSCII.so + /usr/lib/arm-linux-gnueabi/gconv/IBM038.so + /usr/lib/arm-linux-gnueabi/gconv/IBM874.so + /usr/lib/arm-linux-gnueabi/gconv/IBM930.so + /usr/lib/arm-linux-gnueabi/gconv/IBM939.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1137.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-ES-A.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-5.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1154.so + /usr/lib/arm-linux-gnueabi/gconv/KOI8-RU.so + /usr/lib/arm-linux-gnueabi/gconv/KOI8-R.so + /usr/lib/arm-linux-gnueabi/gconv/CP1250.so + /usr/lib/arm-linux-gnueabi/gconv/IBM256.so + /usr/lib/arm-linux-gnueabi/gconv/IBM937.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1026.so + /usr/lib/arm-linux-gnueabi/gconv/LATIN-GREEK.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1164.so + /usr/lib/arm-linux-gnueabi/gconv/IBM851.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1167.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-IT.so + /usr/lib/arm-linux-gnueabi/gconv/NATS-SEFI.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1399.so + /usr/lib/arm-linux-gnueabi/gconv/CP1256.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1047.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1390.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-DK-NO.so + /usr/lib/arm-linux-gnueabi/gconv/MAC-CENTRALEUROPE.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1148.so + /usr/lib/arm-linux-gnueabi/gconv/GBK.so + /usr/lib/arm-linux-gnueabi/gconv/CP1255.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-8.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1388.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-11.so + /usr/lib/arm-linux-gnueabi/gconv/HP-TURKISH8.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-16.so + /usr/lib/arm-linux-gnueabi/gconv/T.61.so + /usr/lib/arm-linux-gnueabi/gconv/CWI.so + /usr/lib/arm-linux-gnueabi/gconv/KOI8-T.so + /usr/lib/arm-linux-gnueabi/gconv/IBM943.so + /usr/lib/arm-linux-gnueabi/gconv/IBM932.so + /usr/lib/arm-linux-gnueabi/gconv/IBM850.so + /usr/lib/arm-linux-gnueabi/gconv/IBM4517.so + /usr/lib/arm-linux-gnueabi/gconv/ISO-2022-CN-EXT.so + /usr/lib/arm-linux-gnueabi/gconv/libJISX0213.so + /usr/lib/arm-linux-gnueabi/gconv/TCVN5712-1.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-3.so + /usr/lib/arm-linux-gnueabi/gconv/ISO-2022-JP.so + /usr/lib/arm-linux-gnueabi/gconv/IBM857.so + /usr/lib/arm-linux-gnueabi/gconv/GREEK7-OLD.so + /usr/lib/arm-linux-gnueabi/gconv/IBM9448.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1132.so + /usr/lib/arm-linux-gnueabi/gconv/ISO-IR-197.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-13.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-AT-DE-A.so + /usr/lib/arm-linux-gnueabi/gconv/IBM865.so + /usr/lib/arm-linux-gnueabi/gconv/ISO_10367-BOX.so + /usr/lib/arm-linux-gnueabi/gconv/EUC-JISX0213.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1008_420.so + /usr/lib/arm-linux-gnueabi/gconv/IBM902.so + /usr/lib/arm-linux-gnueabi/gconv/LATIN-GREEK-1.so + /usr/lib/arm-linux-gnueabi/gconv/SJIS.so + /usr/lib/arm-linux-gnueabi/gconv/HP-GREEK8.so + /usr/lib/arm-linux-gnueabi/gconv/IBM918.so + /usr/lib/arm-linux-gnueabi/gconv/ISO-2022-CN.so + /usr/lib/arm-linux-gnueabi/gconv/ISO_2033.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-PT.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1162.so + /usr/lib/arm-linux-gnueabi/gconv/IBM12712.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1123.so + /usr/lib/arm-linux-gnueabi/gconv/GEORGIAN-ACADEMY.so + /usr/lib/arm-linux-gnueabi/gconv/IBM290.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-FI-SE.so + /usr/lib/arm-linux-gnueabi/gconv/GB18030.so + /usr/lib/arm-linux-gnueabi/gconv/IBM500.so + /usr/lib/arm-linux-gnueabi/gconv/UHC.so + /usr/lib/arm-linux-gnueabi/gconv/ISIRI-3342.so + /usr/lib/arm-linux-gnueabi/gconv/ASMO_449.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1142.so + /usr/lib/arm-linux-gnueabi/gconv/IBM273.so + /usr/lib/arm-linux-gnueabi/gconv/IBM16804.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1112.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1122.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-UK.so + /usr/lib/arm-linux-gnueabi/gconv/HP-ROMAN8.so + /usr/lib/arm-linux-gnueabi/gconv/IBM869.so + /usr/lib/arm-linux-gnueabi/gconv/EUC-CN.so + /usr/lib/arm-linux-gnueabi/gconv/GREEK7.so + /usr/lib/arm-linux-gnueabi/gconv/IBM922.so + /usr/lib/arm-linux-gnueabi/gconv/CP1252.so + /usr/lib/arm-linux-gnueabi/gconv/IBM280.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1140.so + /usr/lib/arm-linux-gnueabi/gconv/INIS.so + /usr/lib/arm-linux-gnueabi/gconv/KOI-8.so + /usr/lib/arm-linux-gnueabi/gconv/SAMI-WS2.so + /usr/lib/arm-linux-gnueabi/gconv/GEORGIAN-PS.so + /usr/lib/arm-linux-gnueabi/gconv/MAC-IS.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1364.so + /usr/lib/arm-linux-gnueabi/gconv/CP737.so + /usr/lib/arm-linux-gnueabi/gconv/ISO_11548-1.so + /usr/lib/arm-linux-gnueabi/gconv/IEC_P27-1.so + /usr/lib/arm-linux-gnueabi/gconv/ISO_5427-EXT.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1143.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1161.so + /usr/lib/arm-linux-gnueabi/gconv/IBM281.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1155.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1129.so + /usr/lib/arm-linux-gnueabi/gconv/ISO_6937.so + /usr/lib/arm-linux-gnueabi/gconv/IBM880.so + /usr/lib/arm-linux-gnueabi/gconv/MAC-UK.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1097.so + /usr/lib/arm-linux-gnueabi/gconv/ISO8859-6.so + /usr/lib/arm-linux-gnueabi/gconv/IBM870.so + /usr/lib/arm-linux-gnueabi/gconv/CP1254.so + /usr/lib/arm-linux-gnueabi/gconv/KOI8-U.so + /usr/lib/arm-linux-gnueabi/gconv/GREEK-CCITT.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1046.so + /usr/lib/arm-linux-gnueabi/gconv/IBM901.so + /usr/lib/arm-linux-gnueabi/gconv/IBM903.so + /usr/lib/arm-linux-gnueabi/gconv/INIS-8.so + /usr/lib/arm-linux-gnueabi/gconv/ISO_5428.so + /usr/lib/arm-linux-gnueabi/gconv/IBM863.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1153.so + /usr/lib/arm-linux-gnueabi/gconv/UTF-32.so + /usr/lib/arm-linux-gnueabi/gconv/IBM935.so + /usr/lib/arm-linux-gnueabi/gconv/CP10007.so + /usr/lib/arm-linux-gnueabi/gconv/CP1253.so + /usr/lib/arm-linux-gnueabi/gconv/CP1251.so + /usr/lib/arm-linux-gnueabi/gconv/ANSI_X3.110.so + /usr/lib/arm-linux-gnueabi/gconv/JOHAB.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1133.so + /usr/lib/arm-linux-gnueabi/gconv/EUC-JP.so + /usr/lib/arm-linux-gnueabi/gconv/ISO646.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1124.so + /usr/lib/arm-linux-gnueabi/gconv/EBCDIC-CA-FR.so + /usr/lib/arm-linux-gnueabi/gconv/IBM1371.so + /usr/lib/arm-linux-gnueabi/gconv/HP-THAI8.so + /usr/lib/arm-linux-gnueabi/gconv/IBM921.so + /usr/lib/locale + /usr/lib/locale/C.UTF-8/LC_IDENTIFICATION + /usr/lib/locale/C.UTF-8/LC_NAME + /usr/lib/locale/C.UTF-8/LC_MONETARY + /usr/lib/locale/C.UTF-8/LC_TELEPHONE + /usr/lib/locale/C.UTF-8/LC_ADDRESS + /usr/lib/locale/C.UTF-8/LC_CTYPE + /usr/lib/locale/C.UTF-8/LC_PAPER + /usr/lib/locale/C.UTF-8/LC_TIME + /usr/lib/locale/C.UTF-8/LC_COLLATE + /usr/lib/locale/C.UTF-8/LC_MEASUREMENT + /usr/lib/locale/C.UTF-8/LC_NUMERIC + /usr/lib/locale/C.UTF-8/LC_MESSAGES/SYS_LC_MESSAGES + /usr/lib/gcc + /usr/lib/gcc/arm-linux-gnueabi + /usr/lib/gcc/arm-linux-gnueabi/4.7 + /sbin/start-stop-daemon + /sbin/ldconfig + /sbin/installkernel + /etc/os-release + /etc/bash.bashrc + /etc/debian_version + /etc/issue + /etc/rmt + /etc/fstab + /etc/host.conf + /etc/issue.net + /etc/inittab + /etc/bindresvport.blacklist + /etc/gai.conf + /etc/default/nss + /etc/profile.d + /etc/skel/.profile + /etc/skel/.bash_logout + /etc/skel/.bashrc + /etc/ld.so.conf.d/libc.conf + /etc/ld.so.conf.d/arm-linux-gnueabi.conf + /etc/dpkg/dpkg.cfg + /etc/dpkg/dpkg.cfg.d + /etc/dpkg/origins/debian + /etc/cron.daily/dpkg + /etc/logrotate.d/dpkg + /etc/alternatives/README + /lib/arm-linux-gnueabi/libnss_hesiod.so.2 + /lib/arm-linux-gnueabi/libbz2.so.1.0.4 + /lib/arm-linux-gnueabi/libz.so.1 + /lib/arm-linux-gnueabi/libresolv.so.2 + /lib/arm-linux-gnueabi/liblzma.so.5.0.0 + /lib/arm-linux-gnueabi/libnss_files-2.13.so + /lib/arm-linux-gnueabi/libdl-2.13.so + /lib/arm-linux-gnueabi/libtinfo.so.5.9 + /lib/arm-linux-gnueabi/libselinux.so.1 + /lib/arm-linux-gnueabi/libthread_db.so.1 + /lib/arm-linux-gnueabi/libnss_hesiod-2.13.so + /lib/arm-linux-gnueabi/libz.so.1.2.7 + /lib/arm-linux-gnueabi/libdl.so.2 + /lib/arm-linux-gnueabi/libnss_compat-2.13.so + /lib/arm-linux-gnueabi/libbz2.so.1.0 + /lib/arm-linux-gnueabi/libbz2.so.1 + /lib/arm-linux-gnueabi/libmemusage.so + /lib/arm-linux-gnueabi/libnsl-2.13.so + /lib/arm-linux-gnueabi/libcidn.so.1 + /lib/arm-linux-gnueabi/librt-2.13.so + /lib/arm-linux-gnueabi/libnss_nisplus.so.2 + /lib/arm-linux-gnueabi/libm.so.6 + /lib/arm-linux-gnueabi/librt.so.1 + /lib/arm-linux-gnueabi/libnss_compat.so.2 + /lib/arm-linux-gnueabi/libutil-2.13.so + /lib/arm-linux-gnueabi/libm-2.13.so + /lib/arm-linux-gnueabi/libanl-2.13.so + /lib/arm-linux-gnueabi/libnss_nis-2.13.so + /lib/arm-linux-gnueabi/libthread_db-1.0.so + /lib/arm-linux-gnueabi/libnsl.so.1 + /lib/arm-linux-gnueabi/libcrypt.so.1 + /lib/arm-linux-gnueabi/libpthread-2.13.so + /lib/arm-linux-gnueabi/libnss_files.so.2 + /lib/arm-linux-gnueabi/libcidn-2.13.so + /lib/arm-linux-gnueabi/libnss_dns.so.2 + /lib/arm-linux-gnueabi/libgcc_s.so.1 + /lib/arm-linux-gnueabi/libpcprofile.so + /lib/arm-linux-gnueabi/libnss_nisplus-2.13.so + /lib/arm-linux-gnueabi/libnss_nis.so.2 + /lib/arm-linux-gnueabi/libSegFault.so + /lib/arm-linux-gnueabi/libanl.so.1 + /lib/arm-linux-gnueabi/libcrypt-2.13.so + /lib/arm-linux-gnueabi/libnss_dns-2.13.so + /lib/arm-linux-gnueabi/libutil.so.1 + /lib/arm-linux-gnueabi/libBrokenLocale.so.1 + /lib/arm-linux-gnueabi/libresolv-2.13.so + /lib/arm-linux-gnueabi/libtinfo.so.5 + /lib/arm-linux-gnueabi/libpthread.so.0 + /lib/arm-linux-gnueabi/libBrokenLocale-2.13.so + /lib/arm-linux-gnueabi/liblzma.so.5 + + + bash + myapp + + + diff --git a/distribution/elbe-example/mini-incl-target.xml b/distribution/elbe-example/mini-incl-target.xml index fcb8181..c660969 100644 --- a/distribution/elbe-example/mini-incl-target.xml +++ b/distribution/elbe-example/mini-incl-target.xml @@ -16,11 +16,12 @@ http://debian.linutronix.de/elbe wheezy main - http://LOCALMACHINE/debian wheezy main - http://LOCALMACHINE/debian wheezy main + http://LOCALMACHINE/myrepo wheezy main + http://LOCALMACHINE/myrepo wheezy main + wheezy elbe-bootstrap @@ -46,7 +47,7 @@ my.img - 200MiB + 16MiB remain @@ -58,7 +59,7 @@ / - ext4 + ext2 -i 0 diff --git a/distribution/elbe-example/myrepo/conf/updates b/distribution/elbe-example/myrepo/conf/updates index 8430306..e8df2b1 100644 --- a/distribution/elbe-example/myrepo/conf/updates +++ b/distribution/elbe-example/myrepo/conf/updates @@ -1,5 +1,5 @@ Name: myremoterepo -Method: http://localhost/debian +Method: http://localhost/myrepo Components: main Architectures: i386 amd64 source VerifyRelease: blindtrust diff --git a/distribution/elbe-example/pres_elbe-example_en.tex b/distribution/elbe-example/pres_elbe-example_en.tex index eb64782..db8c2d7 100644 --- a/distribution/elbe-example/pres_elbe-example_en.tex +++ b/distribution/elbe-example/pres_elbe-example_en.tex @@ -1,11 +1,8 @@ \input{configpres} -\lstset{language=c} - \title{ELBE example} \maketitle - \subsection{What will be done?} \begin{frame} @@ -16,11 +13,13 @@ \item build own software component inside the ELBE buildenv \item include own application in target RFS \item define a stripped target RFS +\item setup a local debian mirror \end{itemize} \end{frame} \subsection{generate a buildenv} +\lstset{language=xml} \begin{frame}[fragile] \frametitle{minimal XML file} \begin{lstlisting} @@ -272,7 +271,7 @@ $ $EDITOR conf/updates \end{lstlisting} \begin{lstlisting} Name: myremoterepo -Method: http://localhost/debian +Method: http://localhost/myrepo Components: main Architectures: i386 amd64 armel source VerifyRelease: blindtrust @@ -286,7 +285,7 @@ IgnoreRelease: yes \begin{lstlisting} $ reprepro include wheezy ../myapp_1.0_i386.changes $ sudo mkdir /var/www/ -$ sudo rsync -av --exclude=db --exclude=conf * /var/www/debian/ +$ sudo rsync -av --exclude=db --exclude=conf * /var/www/myrepo/ \end{lstlisting} \end{frame} @@ -296,15 +295,24 @@ $ sudo rsync -av --exclude=db --exclude=conf * /var/www/debian/ \begin{lstlisting} $ cd ../buildenv $ make run-con -# login into buildenv -$ echo 'deb-src http://10.0.2.2/debian wheezy main' >> /etc/apt/sources.list +\end{lstlisting} +login into buildenv and configure apt to use myrepo +\begin{lstlisting} +$ echo 'deb-src http://10.0.2.2/myrepo wheezy main' >> /etc/apt/sources.list $ apt-get update +\end{lstlisting} +retrive myapp source package and build armel binary package +\begin{lstlisting} $ apt-get source myapp $ cd myapp-1.0 $ ./autogen.sh $ dpkg-buildpackage -b +\end{lstlisting} +copy the package to the host PC and install it into the buildenv +\begin{lstlisting} $ scp ../myapp*.changes ../myapp*.deb 10.0.2.2:/tmp $ dpkg -i ../myapp*.deb +$ myapp \end{lstlisting} \end{frame} @@ -314,33 +322,21 @@ $ dpkg -i ../myapp*.deb \begin{lstlisting} $ cd ../myrepo $ reprepro include wheezy /tmp/myapp_1.0_armel.changes -$ sudo rsync -av --exclude=db --exclude=conf * /var/www/debian/ +$ sudo rsync -av --exclude=db --exclude=conf * /var/www/myrepo/ \end{lstlisting} \end{frame} -\subsection{include own application in target RFS} +\subsection{include app in target RFS} \begin{frame}[fragile] -\frametitle{create target image and add myapp} +\frametitle{add repo including myapp} \begin{lstlisting} $ cd .. $ $EDIT mini.xml \end{lstlisting} \begin{lstlisting} - - - mini xml - 1 - - minimal target rfs including a simple app - buildenv to build the simple app - - armel +... ftp.debian.org /debian @@ -350,29 +346,20 @@ $ $EDIT mini.xml http://debian.linutronix.de/elbe wheezy main - http://LOCALMACHINE/debian wheezy main - http://LOCALMACHINE/debian wheezy main + http://LOCALMACHINE/myrepo wheezy main + http://LOCALMACHINE/myrepo wheezy main + +... \end{lstlisting} \end{frame} \begin{frame}[fragile] -\frametitle{create target image and add myapp} +\frametitle{add myapp} \begin{lstlisting} - wheezy - - elbe-bootstrap - - build-essential - debhelper - devscripts - autotools-dev - automake - - - +... mini linutronix @@ -391,7 +378,7 @@ $ $EDIT mini.xml \subsection{define a striped target RFS} \begin{frame}[fragile] -\frametitle{set elbe mode and define images} +\frametitle{define sdcard image} \begin{lstlisting} ... @@ -407,19 +394,28 @@ $ $EDIT mini.xml my.img - 200MiB + 64MiB remain +... +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{create fstab and set elbe mode} +\begin{lstlisting} +... + / - ext4 + ext2 -i 0 @@ -427,22 +423,134 @@ $ $EDIT mini.xml - var/cache/apt/archives/*.deb - echo "T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100" >> etc/inittab - - - bash - myapp - - +... \end{lstlisting} \end{frame} \begin{frame}[fragile] -\frametitle{build target rfs} +\frametitle{build and extract target as nfsroot} \begin{lstlisting} $ elbe create mini.xml --directory=./target $ cd target $ make +\end{lstlisting} +hint: it is possible to generate a html page from the elbe-report.txt: +\begin{lstlisting} +$ asciidoc elbe-report.txt +\end{lstlisting} +host the nfs root filesystem +\begin{lstlisting} +$ sudo mkdir -p /nfs/elbe-armel +$ sudo tar xzf rootfs.tar.gz -C /nfs/elbe-armel +$ su -c 'echo "/nfs *(rw,sync,no_subtree_check,insecure) >> /etc/exports"' +$ sudo /etc/init.d/nfs-kernel-server restart +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{build current kernel for qemu armel boot} +\begin{lstlisting} +$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux +$ cd linux +$ mkdir ../linux-qemu-arm +$ ARCH=arm CROSS_COMPILE=arm-none-eabi- make O=../linux-qemu-arm versatile_defconfig +$ # enable Kernel Features / Use the ARM EABI to compile the kernel +$ # Allow old ABI binaries to run with this kernel +$ # Networking support / Networking options / TCP/IP networking / +$ # IP: kernel level autoconfiguration / IP: DHCP Support +$ ARCH=arm CROSS_COMPILE=arm-none-eabi- make O=../linux-qemu-arm menuconfig +$ ARCH=arm CROSS_COMPILE=arm-none-eabi- make O=../linux-qemu-arm -j5 +$ cd .. +\end{lstlisting} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{boot nfsroot with qemu} +\begin{lstlisting} +qemu-system-arm -M versatilepb -no-reboot \ + -m 256 -usb \ + -kernel linux-qemu-arm/arch/arm/boot/zImage \ + -append 'root=/dev/nfs nfsroot=10.0.2.2:/nfs/elbe-armel ip=dhcp init=/usr/bin/myapp' +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{strip the nfsroot} +\begin{lstlisting} +$ sudo rm -rf /nfs/elbe-armel/etc +$ sudo rm -rf /nfs/elbe-armel/sbin +$ sudo rm -rf /nfs/elbe-armel/var +$ sudo rm -rf /nfs/elbe-armel/usr/share +$ sudo rm -rf /nfs/elbe-armel/usr/lib +$ sudo rm -rf /nfs/elbe-armel/usr/sbin +$ sudo cp /nfs/elbe-armel/usr/bin/myapp . +$ sudo rm -rf /nfs/elbe-armel/usr/bin/* +$ sudo mv myapp /nfs/elbe-armel/usr/bin/ +$ sudo cp -a /nfs/elbe-armel/lib/arm-linux-gnueabi/ld-* . +$ sudo cp -a /nfs/elbe-armel/lib/arm-linux-gnueabi/libc-2.13.so . +$ sudo cp -a /nfs/elbe-armel/lib/arm-linux-gnueabi/libc.so.6 . +$ sudo rm /nfs/elbe-armel/lib/arm-linux-gnueabi/* +$ sudo mv libc-2.13.so /nfs/elbe-armel/lib/arm-linux-gnueabi/ +$ sudo mv libc.so.6 /nfs/elbe-armel/lib/arm-linux-gnueabi/ +$ sudo mv ld-* /nfs/elbe-armel/lib/arm-linux-gnueabi/ +\end{lstlisting} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{update the ELBE XML file} +\begin{lstlisting} +$ sudo mkdir /nfs/elbe-armel-orig +$ sudo tar xzf rootfs.tar.gz -C /nfs/elbe-armel-orig/ +$ elbe pkgdiff +$ sudo elbe diff /nfs/elbe-armel-orig /nfs/elbe-armel > diff.txt +$ cd .. +\end{lstlisting} +\begin{lstlisting} +$ vim mini.xml +$ # place cursor in finetuning section +$ :read target/diff.txt +$ # remove everything until 'suggesting:' +$ :x +\end{lstlisting} +\begin{lstlisting} +$ elbe create --directory=target-stripped mini.xml +$ cd target-stripped +$ make +$ # get debian kernel and initrd from the buildenv: +$ make .elbe-vm/vmkernel .elbe-vm/vminitrd +$ # boot the image +$ qemu-system-arm -M versatilepb \ +-kernel .elbe-vm/vmkernel -initrd .elbe-vm/vminitrd \ +-append 'root=/dev/sda1 init=/usr/bin/myapp' my.img +\end{lstlisting} +\end{frame} + +\subsection{setup own debian mirror} + +\begin{frame}[fragile] +\frametitle{partial clone a remote debian mirror} +\begin{lstlisting} +$ mkdir -p /mirrors/debian +$ cd debian +$ debmirror -p -d wheezy, -a i386,amd64,armel,armhf --di-dist=wheezy \ +--method=http --no-check-gpg -h ftp.de.debian.org . +$ cd /var/www/html +$ ln -s /mirrors/debian +\end{lstlisting} +\end{frame} + +\subsection{Conclusion} +\begin{frame} +\begin{itemize} +\item generate an ELBE buildenv with a minimal XML file +\item manage software components with autotools, dpkg and reprepro +\item build own software component inside the ELBE buildenv +\item include own debian packages in the target RFS +\item edit a running rootfs and make it reproducable +\item setup a partial, local debian mirror +\end{itemize} +\end{frame} \input{tailpres} -- cgit v1.2.3 From 751dc5e4abec89bddf8260d6756d9db8eb72a0c3 Mon Sep 17 00:00:00 2001 From: Jan Altenberg Date: Mon, 3 Feb 2014 18:16:19 +0100 Subject: Update for the tracing chapter: Overview, Event Tracing, Kprobes, Uprobes, Filter --- images/pthread_kernelshark.png | Bin 0 -> 8857 bytes images/trace_overview.dia | Bin 0 -> 2201 bytes images/trace_overview.png | Bin 0 -> 21041 bytes .../kernel-tracing/pres_kernel-tracing_en.tex | 415 +++++++++++++++++++-- 4 files changed, 383 insertions(+), 32 deletions(-) create mode 100644 images/pthread_kernelshark.png create mode 100644 images/trace_overview.dia create mode 100644 images/trace_overview.png diff --git a/images/pthread_kernelshark.png b/images/pthread_kernelshark.png new file mode 100644 index 0000000..d73f913 Binary files /dev/null and b/images/pthread_kernelshark.png differ diff --git a/images/trace_overview.dia b/images/trace_overview.dia new file mode 100644 index 0000000..6b705cf Binary files /dev/null and b/images/trace_overview.dia differ diff --git a/images/trace_overview.png b/images/trace_overview.png new file mode 100644 index 0000000..7156705 Binary files /dev/null and b/images/trace_overview.png differ diff --git a/kernel-devel/kernel-tracing/pres_kernel-tracing_en.tex b/kernel-devel/kernel-tracing/pres_kernel-tracing_en.tex index f185e58..d5a9686 100644 --- a/kernel-devel/kernel-tracing/pres_kernel-tracing_en.tex +++ b/kernel-devel/kernel-tracing/pres_kernel-tracing_en.tex @@ -1,8 +1,14 @@ \input{configpres} \title{Kernel-Tracing} -\section{FTRACE} +\section{Overview} \maketitle + +\begin{frame} +\frametitle{Overview} +\tableofcontents +\end{frame} + \begin{frame}[fragile] \frametitle{Kerneltracing: Overview} \begin{itemize} @@ -13,6 +19,14 @@ \end{itemize} \end{frame} +\begin{frame}[fragile] +\frametitle{Kerneltracing: Overview} +\begin{figure}[h] +\centering +\includegraphics[width=10cm]{images/trace_overview.png} +\end{figure} +\end{frame} + \begin{frame}[fragile] \frametitle{Kernel-Tracing: DebugFS} \begin{verbatim} @@ -23,26 +37,102 @@ blk function_graph mmiotrace wakeup_rt wakeup \end{verbatim} \end{frame} +\section{Event tracing} +\begin{frame}[fragile] +\frametitle{Event tracing} +current\_tracer can be set to NOP +\begin{verbatim} +$ cd /sys/kernel/debug/tracing +$ ls events/ +[...] +irq +sched +scsi +signal +skb +[...] +\end{verbatim} +\end{frame} \begin{frame}[fragile] -\frametitle{Kerneltracing: Trivial example} +\frametitle{Event tracing} \begin{verbatim} -$ echo function_graph > current_tracer -$ echo 1 > tracing_enabled -$ sleep 1 -$ echo 0 > tracing_enabled -$ less trace -# tracer: function_graph -# CPU DURATION FUNCTION CALLS -# | | | | | | | - 1) | enqueue_entity() { - 1) | update_curr() { - 1) 0.336 us | task_of(); - 1) 1.524 us | } - 1) 0.420 us | place_entity(); +$ cd /sys/kernel/debug/tracing +$ ls -1 events/sched/ +enable +filter +sched_kthread_stop +sched_kthread_stop_ret +sched_migrate_task +sched_pi_setprio +[...] +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Event tracing: Enable events} +\begin{verbatim} +$ cd /sys/kernel/debug/tracing +# Enable ALL events of the group ''sched'' +$ echo 1 > events/sched/enable \end{verbatim} \end{frame} +\begin{frame}[fragile] +\frametitle{Record a trace} +After enabling the events you want to see, do: +\begin{verbatim} +$ cd /sys/kernel/debug/tracing +# Start recording to the ringbuffer +$ echo 1 > tracing_on +# Stop recording to the ringbuffer +$ echo 0 > tracing_on +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Analyze a trace} +You can even do this while recording! +\begin{verbatim} +$ cd /sys/kernel/debug/tracing +# Just print the current content of the ring buffer +$ cat trace +# or: do a consuming read on the ring buffer +$ cat trace_pipe +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Trace event format and filters} +Each trace event has a specific format and parameters. +You can put a filter on those parameters for recording a trace: +\begin{verbatim} +$ cat events/sched/sched_switch/format +[...] +field:__u8 prev_comm[15]; +field:pid_t prev_pid; +field:int prev_prio; +field:long prev_state; +[...] +$ echo 'next_comm == bash' \ + > events/sched/sched_switch/filter +$ echo 1 > events/sched/sched_switch/enable +$ echo 1 > tracing_on +$ cat trace +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Tracing on multicore} +\begin{itemize} +\item One ringbuffer per cpu +\item trace contains ALL events +\item the per\_cpu directory contains a trace for each cpu +\item tracing\_cpumask can limit tracing to specific cores +\end{itemize} +\end{frame} + +\section{Tracers} \begin{frame}[fragile] \frametitle{Tracer: function} \begin{verbatim} @@ -58,8 +148,39 @@ wnck-2022 [003] 5766.659918: kfree <-skb \end{verbatim} \end{frame} +\begin{frame}[fragile] +\frametitle{Tracer: function\_graph} +\begin{verbatim} +$ echo function_graph > current_tracer +$ echo 1 > tracing_on +$ sleep 1 +$ echo 0 > tracing_on +$ less trace +# tracer: function_graph +# CPU DURATION FUNCTION CALLS +# | | | | | | | + 1) | enqueue_entity() { + 1) | update_curr() { + 1) 0.336 us | task_of(); + 1) 1.524 us | } + 1) 0.420 us | place_entity(); +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{function\_graph: Set a trigger function} +You can set a trigger function for the function\_graph tracer +if you just want to record specific functions and their childs: +\begin{verbatim} +echo do_IRQ > set_graph_function +# Additionals triggers can be set with +echo another_function >> set_graph_function +\end{verbatim} +\end{frame} + \begin{frame}[fragile] \frametitle{Tracer: function / latency\_format} +\tiny \begin{verbatim} $ echo 1 > options/latency_format # tracer: function @@ -83,23 +204,6 @@ terminol-11964 1.... 11639243us : ep_read_events_proc <-ep_scan_ready_list.isr \end{verbatim} \end{frame} -\begin{frame}[fragile] -\frametitle{Tracer: function (custom tracepoint)} -\begin{verbatim} -$ echo 1 > tracing_enabled -$ echo "MARK" > trace_marker -$ echo 0 > tracing_enabled -$ less trace -... - bash-4328 [003] 5603.687935: get_slab - bash-4328 [003] 5603.687935: _cond_re - bash-4328 [003] 5603.687936: _cond_re - bash-4328 [003] 5603.687939: 0: MARK - bash-4328 [003] 5603.687939: kfree <- -... -\end{verbatim} -\end{frame} - \begin{frame}[fragile] \frametitle{Tracer: wakeup\_rt} \tiny @@ -121,6 +225,44 @@ ls-4579 3dN... 5us : _raw_spin_unlock_irqrestore <-try_to_wake_up \end{verbatim} \end{frame} +\section{Kernel function profiler} + +\begin{frame}[fragile] +\frametitle{Kernel function profiler} +\begin{verbatim} +$ echo 1 > function_profile_enabled +$ echo 1 > tracing_on +# then do something... +$ echo 0 > tracing_on +$ less trace_stat/function0 +Function Hit Time Avg +-------- --- ---- --- +__schedule 7064 1958976725 us 277318.3 us +schedule 6961 1958965845 us 281420.1 us +[...] +\end{verbatim} +\end{frame} + +\section{trace\_marker} +\begin{frame}[fragile] +\frametitle{Custom application tracepoints: ''simple method''} +\begin{verbatim} +$ echo 1 > tracing_on +$ echo "MARK" > trace_marker +$ echo 0 > tracing_on +$ less trace +... + bash-4328 [003] 5603.687935: get_slab + bash-4328 [003] 5603.687935: _cond_re + bash-4328 [003] 5603.687936: _cond_re + bash-4328 [003] 5603.687939: 0: MARK + bash-4328 [003] 5603.687939: kfree <- +... +\end{verbatim} +\end{frame} + +\section{trace\_printk} + \begin{frame}[fragile] \frametitle{trace\_printk()} \begin{itemize} @@ -148,6 +290,10 @@ Only trace specific functions. ftrace_notrace= \end{verbatim} Don't trace specific functions. +\begin{verbatim} +trace_event= +\end{verbatim} +Just enable trace events (comma separated list) \end{frame} \begin{frame}[fragile] @@ -160,6 +306,20 @@ echo z > /proc/sysrq-trigger \end{verbatim} \end{frame} +\begin{frame}[fragile] +\frametitle{Trace instances} +You can have separate trace instances with their own +buffers and events: +\begin{verbatim} +$ cd /sys/kernel/debug/tracing +$ mkdir instances/my_inst1 +$ cd instances/my_inst1 +$ echo 1 > events/sched/enable +$ cat trace +[...] +\end{verbatim} +\end{frame} + \section{trace-cmd} \begin{frame} @@ -316,9 +476,200 @@ $ kernelshark -i mytrace.dat \includegraphics[width=10cm]{images/kernelshark_zoom.png} \end{figure} \end{frame} + +\section{Useful things} + +\begin{frame}[fragile] +\frametitle{Control a trace from your kernel code} +\begin{verbatim} +void my_kernel_function(void) +{ + tracing_on(); + do_some_stuff_i_wanna_trace(); + tracing_off(); +} +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Matching PIDs and process names of your trace(s)} +\begin{verbatim} +$ cat saved_cmdlines +[...] +5112 bash +5223 ARTHUR_DENT +5546 kworker/0:2 +8465 kworker/0:0 +[...] +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Where's my thread in the trace?!} +To ''find'' a specific thread in your trace, you can use the +following function to set the thread's name: +\begin{verbatim} +#define _GNU_SOURCE +#include + +pthread_setname_np(pthread_t thread, + const char *name); +\end{verbatim} +Available since glibc version 2.12 +\end{frame} + +\begin{frame}[fragile] +\frametitle{Thread names: Example} +\begin{verbatim} +/* pthread_example */ +pthread_t test_thread; +[...] +pthread_create(&test_thread, NULL, + my_test_thread, NULL); +[...] +pthread_setname_np(test_thread, "ARTHUR_DENT"); +\end{verbatim} +Check with the ps command: +\begin{verbatim} +$ ps H -C pthread_example -o 'pid tid cmd comm' + PID TID CMD COMMAND +4515 4515 ./pthread_example pthread_example +4515 4516 ./pthread_example ARTHUR_DENT +\end{verbatim} +\end{frame} + \begin{frame} +\frametitle{Thread name in kernelshark} +\begin{figure}[h] +\centering +\includegraphics[width=10cm]{images/pthread_kernelshark.png} +\end{figure} +\end{frame} + +\section{kprobes} +\begin{frame}[fragile] +\frametitle{Dynamic kernel tracepoints: KPROBES} +\begin{itemize} +\item Similar to Tracepoints +\item Can be added / removed dynamically +\end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Dynamic kernel tracepoints: KPROBES} +\begin{verbatim} +$ echo 'p:my_k_event do_IRQ' > kprobe_events +$ echo 1 events/kprobes/my_k_event/enabled +$ echo 1 > tracing_on +$ cat trace +-0 [000] d... 545.173709: my_k_event: (do_IRQ+0x0/0xc0) +-0 [000] d... 545.331051: my_k_event: (do_IRQ+0x0/0xc0) +-0 [000] d... 545.331490: my_k_event: (do_IRQ+0x0/0xc0) +-0 [000] d... 545.490730: my_k_event: (do_IRQ+0x0/0xc0) +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Dynamic kernel tracepoints: KPROBES for custom modules} +Let's assume we want to have a tracepoint for the function +hello\_init in the module hello.ko +\begin{verbatim} +# Note: >> will append a new event +$ echo 'p:my_mod_event hello:hello_init' \ + >> kprobe_events +$ echo 1 > events/kprobes/my_mod_event/enable +$ insmod hello.ko +$ cat trace +insmod-9586 [000] d... 13278.003468: my_mod_event: (0xf878d080) +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Dynamic kernel tracepoints: Question / Exercise} +What happens, if we add the following event. What's different? +\begin{verbatim} +# Note >> will append a new event +$ echo 'r:my_exercise_event hello:hello_init' \ + >> kprobe_events +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{KPROBES statistics} +\begin{verbatim} +$ cat kprobe_profile +my_mod_event_ret 2 0 +my_mod_event 2 0 +\end{verbatim} +\end{frame} + +\section{uprobes} +\begin{frame}[fragile] +\frametitle{Dynamic Userspace Tracepoints: uprobes} +\begin{itemize} +\item Similar to kprobes +\item For userspace applications +\item A uprobe event is set on a specific offset in a userland process +\item Powerful method to correlate your kernel and userland events! +\end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Dynamic Userspace Tracepoints: uprobes} +\begin{verbatim} +$ gcc -Wall -g -o pthread_example \ + pthread_example.c -lpthread +$ objdump -F -D -S pthread_example | less +\end{verbatim} +\begin{verbatim} +08048594 (File Offset: 0x594): +[...] +void *my_test_thread(void *x_void_ptr) +[...] + for (i = 0; i < 10; i++) { +80485a1: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) +80485a8: eb 1c jmp 80485c6 (File Offset: 0x5c6) + printf("The answer is 42!\n"); +80485aa: c7 04 24 50 87 04 08 movl $0x8048750,(%esp) +\end{verbatim} +So, the file offset for the printf call is 0x5aa ! +\end{frame} + +\begin{frame}[fragile] +\frametitle{Dynamic Userspace Tracepoints: uprobes II} +\begin{verbatim} +echo \ +'p:my_ev /home/devel/pthread/pthread_example:0x5aa' \ + > /sys/kernel/debug/tracing/uprobe_events +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Dynamic Userspace Tracepoints: uprobes III} +\begin{verbatim} +$ cd /sys/kernel/debug/tracing/ +$ echo 1 > events/uprobes/my_ev/enable +$ echo 1 > tracing on +$ /home/devel/pthread_example/pthread_example +$ echo 0 > tracing_on +$ less trace +# TASK-PID CPU# |||| TIMESTAMP FUNCTION +# | | | |||| | | +ARTHUR_DENT-5223 [000] d... 5653.154822: my_ev: (0x80485aa) +ARTHUR_DENT-5223 [000] d... 5654.155723: my_ev: (0x80485aa) +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{uprobes: statistics} +\begin{verbatim} +$ cat uprobe_profile +/home/devel/pthread/pthread_example my_ev 10 +\end{verbatim} +\end{frame} \section{sources} +\begin{frame} \frametitle{sources} \begin{thebibliography}{1} \bibitem{trace1} http://lwn.net/Articles/365835/ -- cgit v1.2.3 From 21e79c833fcbd2d7c43380a2f74b5c0173c6c1a0 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 18 Feb 2014 23:24:52 +0100 Subject: corba example: switch to autotools ace/tao is now packaged in debian/experimental. it's definitely easier to use the packaged stuff instead of building ace/tao by your own. the mwc packaging of debian is currently a pain. it is shipped without config files for tao.., but the tao debian packages provide pkg-config support so this patch converts the project into a autotools project :) Signed-off-by: Manuel Traut --- frameworks/middleware/examples/corba/AUTHORS | 0 frameworks/middleware/examples/corba/ChangeLog | 0 frameworks/middleware/examples/corba/Makefile.am | 29 +++++++++++++++++++++++ frameworks/middleware/examples/corba/NEWS | 0 frameworks/middleware/examples/corba/README | 12 ++++++++++ frameworks/middleware/examples/corba/autogen.sh | 3 +++ frameworks/middleware/examples/corba/configure.ac | 28 ++++++++++++++++++++++ frameworks/middleware/examples/corba/ping_I.cpp | 1 - 8 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 frameworks/middleware/examples/corba/AUTHORS create mode 100644 frameworks/middleware/examples/corba/ChangeLog create mode 100644 frameworks/middleware/examples/corba/Makefile.am create mode 100644 frameworks/middleware/examples/corba/NEWS create mode 100644 frameworks/middleware/examples/corba/README create mode 100755 frameworks/middleware/examples/corba/autogen.sh create mode 100644 frameworks/middleware/examples/corba/configure.ac diff --git a/frameworks/middleware/examples/corba/AUTHORS b/frameworks/middleware/examples/corba/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/frameworks/middleware/examples/corba/ChangeLog b/frameworks/middleware/examples/corba/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/frameworks/middleware/examples/corba/Makefile.am b/frameworks/middleware/examples/corba/Makefile.am new file mode 100644 index 0000000..72a6a67 --- /dev/null +++ b/frameworks/middleware/examples/corba/Makefile.am @@ -0,0 +1,29 @@ +IDL_COMPILER=tao_idl +IDL_COMPILER_OPT=-GI + +IDL_GEN_H_SRV = pingI.h pingS.h +IDL_GEN_S_SRV = pingS.cpp +IDL_GEN_H_CLT = pingC.h pingC.inl +IDL_GEN_S_CLT = pingC.cpp + +pingI.h: ping.idl + $(IDL_COMPILER) $(IDL_COMPILER_OPT) ping.idl + +noinst_HEADERS = $(IDL_GEN_H_SRV) $(IDL_GEN_H_CLT) + +CLEANFILES = $(IDL_GEN_H_SRV) $(IDL_GEN_S_SRV) \ + $(IDL_GEN_H_CLT) $(IDL_GEN_S_CLT) pingI.cpp + +CORBA_CFLAGS = $(TAO_CFLAGS) $(TAO_CosNaming_CFLAGS) \ + $(TAO_PortableServer_CFLAGS) $(TAO_RTCORBA_CFLAGS) +CORBA_LIBS = $(TAO_LIBS) $(TAO_CosNaming_LIBS) $(TAO_PortableServer_LIBS) \ + $(TAO_RTCORBA_LIBS) + +bin_PROGRAMS = receiver supplier +receiver_SOURCES = ping_I.cpp $(IDL_GEN_S_SRV) $(IDL_GEN_S_CLT) Receiver.cpp +receiver_CFLAGS = $(CORBA_CFLAGS) +receiver_LDADD = $(CORBA_LIBS) + +supplier_SOURCES = Supplier.cpp $(IDL_GEN_S_CLT) +supplier_CFLAGS = $(CORBA_CFLAGS) +supplier_LDADD = $(CORBA_LIBS) diff --git a/frameworks/middleware/examples/corba/NEWS b/frameworks/middleware/examples/corba/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/frameworks/middleware/examples/corba/README b/frameworks/middleware/examples/corba/README new file mode 100644 index 0000000..74ca9bb --- /dev/null +++ b/frameworks/middleware/examples/corba/README @@ -0,0 +1,12 @@ +apt-get install -t experimental libtao-dev mpc-ace libtao-orbsvcs-dev \ +tao-cosnaming tao-idl tao-utils + +./autogen.sh +./configure +make + +Naming_Service -ORBEndpoint iiop://localhost:55555 + + +./receiver -ORBInitRef NameService=corbaloc:iiop:localhost:55555/NameService +./supplier -ORBInitRef NameService=corbaloc:iiop:localhost:55555/NameService diff --git a/frameworks/middleware/examples/corba/autogen.sh b/frameworks/middleware/examples/corba/autogen.sh new file mode 100755 index 0000000..58c0175 --- /dev/null +++ b/frameworks/middleware/examples/corba/autogen.sh @@ -0,0 +1,3 @@ +#!/bin/bash +automake --add-missing +autoreconf -sif diff --git a/frameworks/middleware/examples/corba/configure.ac b/frameworks/middleware/examples/corba/configure.ac new file mode 100644 index 0000000..6127c33 --- /dev/null +++ b/frameworks/middleware/examples/corba/configure.ac @@ -0,0 +1,28 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([corba-example], [1.0], [manut@linutronix.de]) +AC_CONFIG_SRCDIR([Receiver.cpp]) +AM_INIT_AUTOMAKE([dist-bzip2]) +AC_CONFIG_HEADERS([config.h]) + +# Checks for programs. +AC_PROG_CXX + +# Checks for libraries. +PKG_CHECK_MODULES([TAO], [TAO]) +PKG_CHECK_MODULES([TAO_CosNaming], [TAO_CosNaming]) +PKG_CHECK_MODULES([TAO_PortableServer], [TAO_PortableServer]) +PKG_CHECK_MODULES([TAO_RTCORBA], [TAO_RTCORBA]) + +# Checks for header files. + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. +AC_CHECK_FUNCS([clock_gettime]) + +AC_CONFIG_FILES([Makefile]) + +AC_OUTPUT diff --git a/frameworks/middleware/examples/corba/ping_I.cpp b/frameworks/middleware/examples/corba/ping_I.cpp index 309d1e8..e02924f 100644 --- a/frameworks/middleware/examples/corba/ping_I.cpp +++ b/frameworks/middleware/examples/corba/ping_I.cpp @@ -21,4 +21,3 @@ void Linutronix_Ping_i::send ( clock_gettime(CLOCK_MONOTONIC, &time_rx); std::cout< Date: Tue, 18 Feb 2014 23:27:47 +0100 Subject: dbus example: remove compile.sh and make a autotools project compile.sh was a pain. didn't work with current debian. so this patch removes it and converts the example to an autools project. Signed-off-by: Manuel Traut --- frameworks/middleware/examples/dbus/AUTHORS | 0 frameworks/middleware/examples/dbus/ChangeLog | 0 frameworks/middleware/examples/dbus/Makefile.am | 8 ++++++++ frameworks/middleware/examples/dbus/NEWS | 0 frameworks/middleware/examples/dbus/README | 0 frameworks/middleware/examples/dbus/autogen.sh | 3 +++ frameworks/middleware/examples/dbus/compile.sh | 3 --- frameworks/middleware/examples/dbus/configure.ac | 24 +++++++++++++++++++++++ frameworks/middleware/examples/dbus/ping-client.c | 24 +++++++++++++---------- frameworks/middleware/examples/dbus/ping-server.c | 2 -- 10 files changed, 49 insertions(+), 15 deletions(-) create mode 100644 frameworks/middleware/examples/dbus/AUTHORS create mode 100644 frameworks/middleware/examples/dbus/ChangeLog create mode 100644 frameworks/middleware/examples/dbus/Makefile.am create mode 100644 frameworks/middleware/examples/dbus/NEWS create mode 100644 frameworks/middleware/examples/dbus/README create mode 100755 frameworks/middleware/examples/dbus/autogen.sh delete mode 100755 frameworks/middleware/examples/dbus/compile.sh create mode 100644 frameworks/middleware/examples/dbus/configure.ac diff --git a/frameworks/middleware/examples/dbus/AUTHORS b/frameworks/middleware/examples/dbus/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/frameworks/middleware/examples/dbus/ChangeLog b/frameworks/middleware/examples/dbus/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/frameworks/middleware/examples/dbus/Makefile.am b/frameworks/middleware/examples/dbus/Makefile.am new file mode 100644 index 0000000..830a98e --- /dev/null +++ b/frameworks/middleware/examples/dbus/Makefile.am @@ -0,0 +1,8 @@ +bin_PROGRAMS = pingserver pingclient +pingserver_SOURCES = ping-server.c +pingserver_CFLAGS = $(DBUS_CFLAGS) +pingserver_LDADD = $(DBUS_LIBS) + +pingclient_SOURCES = ping-client.c +pingclient_CFLAGS = $(DBUS_CFLAGS) +pingclient_LDADD = $(DBUS_LIBS) diff --git a/frameworks/middleware/examples/dbus/NEWS b/frameworks/middleware/examples/dbus/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/frameworks/middleware/examples/dbus/README b/frameworks/middleware/examples/dbus/README new file mode 100644 index 0000000..e69de29 diff --git a/frameworks/middleware/examples/dbus/autogen.sh b/frameworks/middleware/examples/dbus/autogen.sh new file mode 100755 index 0000000..58c0175 --- /dev/null +++ b/frameworks/middleware/examples/dbus/autogen.sh @@ -0,0 +1,3 @@ +#!/bin/bash +automake --add-missing +autoreconf -sif diff --git a/frameworks/middleware/examples/dbus/compile.sh b/frameworks/middleware/examples/dbus/compile.sh deleted file mode 100755 index d2b2822..0000000 --- a/frameworks/middleware/examples/dbus/compile.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -gcc -o server -lrt -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0 ping-server.c -gcc -o client -lrt -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0 ping-client.c diff --git a/frameworks/middleware/examples/dbus/configure.ac b/frameworks/middleware/examples/dbus/configure.ac new file mode 100644 index 0000000..bf99b42 --- /dev/null +++ b/frameworks/middleware/examples/dbus/configure.ac @@ -0,0 +1,24 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([dbus-example], [1.0], [manut@linutronix.de]) +AC_CONFIG_SRCDIR([ping-server.c]) +AM_INIT_AUTOMAKE([dist-bzip2]) +AC_CONFIG_HEADERS([config.h]) + +# Checks for programs. +AC_PROG_CC + +# Checks for libraries. +PKG_CHECK_MODULES([DBUS], [dbus-glib-1]) +# Checks for header files. + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. +AC_CHECK_FUNCS([clock_gettime]) + +AC_CONFIG_FILES([Makefile]) + +AC_OUTPUT diff --git a/frameworks/middleware/examples/dbus/ping-client.c b/frameworks/middleware/examples/dbus/ping-client.c index e3035e4..ceb3205 100644 --- a/frameworks/middleware/examples/dbus/ping-client.c +++ b/frameworks/middleware/examples/dbus/ping-client.c @@ -12,10 +12,10 @@ int main (int argc, char **argv) DBusConnection *bus; DBusError error; - if (argc > 1) - v_STRING = argv[1]; - else - v_STRING = "no arg given"; + if (argc > 1) + v_STRING = argv[1]; + else + v_STRING = "no arg given"; /* Create a new event loop to run in */ loop = g_main_loop_new (NULL, FALSE); @@ -42,8 +42,8 @@ int main (int argc, char **argv) static gboolean send_ping (DBusConnection *bus) { DBusMessage *message; - struct timespec tx_time; - struct timespec done_time; + struct timespec tx_time; + struct timespec done_time; message = dbus_message_new_signal ("/de/linutronix/Ping", "de.linutronix.Ping", "Ping"); @@ -51,12 +51,16 @@ static gboolean send_ping (DBusConnection *bus) dbus_message_append_args (message, DBUS_TYPE_STRING, &v_STRING, DBUS_TYPE_INVALID); - clock_gettime(CLOCK_MONOTONIC, &tx_time); + + clock_gettime(CLOCK_MONOTONIC, &tx_time); + /* Send the signal */ dbus_connection_send (bus, message, NULL); - clock_gettime(CLOCK_MONOTONIC, &done_time); - g_print("%d:%d\n%d:%d\n\n", tx_time.tv_sec, tx_time.tv_nsec/1000, - done_time.tv_sec, done_time.tv_nsec/1000); + clock_gettime(CLOCK_MONOTONIC, &done_time); + + g_print("%d:%d\n%d:%d\n\n", tx_time.tv_sec, tx_time.tv_nsec/1000, + done_time.tv_sec, done_time.tv_nsec/1000); + /* Free the signal now we have finished with it */ dbus_message_unref (message); /* Return TRUE to tell the event loop we want to be called again */ diff --git a/frameworks/middleware/examples/dbus/ping-server.c b/frameworks/middleware/examples/dbus/ping-server.c index 36dd122..96b2397 100644 --- a/frameworks/middleware/examples/dbus/ping-server.c +++ b/frameworks/middleware/examples/dbus/ping-server.c @@ -60,7 +60,6 @@ static DBusHandlerResult signal_filter clock_gettime(CLOCK_MONOTONIC, &rx_time); g_print("ping received: %s - %d:%d\n", s, rx_time.tv_sec, rx_time.tv_nsec/1000); - // dbus_free (s); } else { g_print("ping received, but error getting message: %s\n", error.message); dbus_error_free (&error); @@ -69,4 +68,3 @@ static DBusHandlerResult signal_filter } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } - -- cgit v1.2.3 From 6200bc8389548831e6fc345ceb9867b0d0c1b1ab Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 18 Feb 2014 23:29:58 +0100 Subject: update middleware presentation - give an introduction to the topic, what is a middleware, why do we need it - mention some xml based middlewares - update the dbus section, no we don't have HAL anymore :)) - mention the idl workflow in the corba section Signed-off-by: Manuel Traut --- frameworks/middleware/pres_middleware.tex | 571 ++++++++++++++++++++++++++++-- 1 file changed, 546 insertions(+), 25 deletions(-) diff --git a/frameworks/middleware/pres_middleware.tex b/frameworks/middleware/pres_middleware.tex index 2f4c462..d147ceb 100644 --- a/frameworks/middleware/pres_middleware.tex +++ b/frameworks/middleware/pres_middleware.tex @@ -3,23 +3,473 @@ \title{\lq Middleware\rq} \maketitle -\subsection{DBUS} \begin{frame} -\frametitle{DBUS Communication Framework} +\frametitle{Agenda} +\begin{itemize} +\item Overview +\item XML based Middleware +\item Celery +\item DDS +\item D-Bus +\item CORBA +\end{itemize} +GOAL: get an idea about: + +the amount of available middleware solutions + +and for what they can be used. +\end{frame} + +\subsection{Overview} + +\begin{frame} +\frametitle{Use-case} +\begin{center} +\includegraphics[width=0.8\textheight]{images/714px-Middleware_Schema.png} +\end{center} +\tiny Source: http://commons.wikimedia.org/wiki/File:Middleware\_Schema.svg +\end{frame} + +\begin{frame} +\frametitle{Why should we use a middleware?} +\begin{itemize} +\item IPC +\item scalability +\item os abstraction +\item reusability of sw components +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Kinds of Middleware} +\begin{itemize} +\item Message Oriented Middleware (MOM) +\item Remote Procedure Calls (RPC) +\item Webapplications? +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Requirements} +\begin{block}{Abstraction Layers} +\begin{itemize} +\item operating system +\item programing language +\item localization +\item transport +\item concurrent access +\end{itemize} +\end{block} +\end{frame} + +\begin{frame} +\frametitle{Requirements} +\begin{block}{Technical, product specific} +\begin{itemize} +\item os / language support +\item performance +\item requirement coverage +\item commerical, open-source, (long-time) support +\end{itemize} +\end{block} +\end{frame} + +\begin{frame} +\frametitle{Standards, Protocols} +\begin{itemize} +\item XML based Middleware +\item Celery - Job Queue Protocol +\item DDS - Data Distribution Service +\item D-Bus - MOM +\item CORBA - Common Object Request Broker +\end{itemize} +\end{frame} + +\subsection{XML based Middleware} +\begin{frame} +\frametitle{popular protocols} +\begin{description} +\item[XML-RPC] Extensible Markup Language Remote Procedure Call +\item[SOAP/WSDL] many webservices are based on SOAP +\item[XMPP] Extensible Messaging and Presence Protocol +\end{description} +\end{frame} + +\begin{frame} +\frametitle{XML-RPC} +\begin{itemize} +\item native supported by Python (see example) +\item C/C++ Implementation: http://xmlrpc-c.sourceforge.net/ +\item Client- / Serverarchitecture +\item uses http as transport +\end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{XML-RPC example in Python} +server.py\#p1 +\begin{lstlisting}[language=python] +from datetime import datetime +from SimpleXMLRPCServer import SimpleXMLRPCServer +import xmlrpclib + +def today (): + today = datetime.today () + return xmlrpclib.DateTime (today) + +def load (): + fd = open ("/proc/loadavg", "r") + loadavg = fd.read () + sysload = loadavg.split () + return xmlrpclib.FloatType (sysload[0]) +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{XML-RPC example in Python} +server.py\#p2 +\begin{lstlisting}[language=python] +server = SimpleXMLRPCServer (("localhost", + 8000)) + +server.register_function (today, "today") +server.register_function (load, "load") + +print "Listening on port 8000..." +server.serve_forever () +\end{lstlisting} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{XML-RPC example in Python} +client.py\#p1 +\begin{lstlisting}[language=python] +import xmlrpclib +from datetime import datetime + +proxy = xmlrpclib.ServerProxy ( + "http://localhost:8000/") +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{XML-RPC example in Python} +client.py\#p2 +\begin{lstlisting}[language=python] +today = proxy.today () +# today = 20140218T14:23:45 + +conv = datetime.strptime (today.value, + "%Y%m%dT%H:%M:%S") + +print "Today:", conv.strftime ( + "%d.%m.%Y, %H:%M") + +load = proxy.load () +print "system load:", load +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{XML-RPC example in Python} +output: +\begin{lstlisting}[language=bash] + % python client.py +Today: 18.02.2014, 14:26 +system load: 0.45 +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{XML-RPC example in Python} +http payload of today rpc call seen in wireshark: +\begin{lstlisting}[language=XML] + + + today + + +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{XML-RPC example in Python} +http payload of today rpc response seen in wireshark: +\begin{lstlisting}[language=XML] + + + + + + + 20140218T14:26:25 + + + + + +\end{lstlisting} +\end{frame} + +\begin{frame} +\frametitle{SOAP/WSDL} +\begin{block}{Overview} +\begin{itemize} +\item WSDL (Web Services Description Language) + +describes the interface and spcecial datatypes +\item the SOAP protocol is used for communication +\item SOAP can be used with various transports: + +FTP, SMTP, HTTP(S), JMS +\item hopping is supported, with different transports +\item Client- / Serverarchitecture +\end{itemize} +\end{block} +\end{frame} + +\begin{frame} +\frametitle{SOAP/WSDL} +\begin{block}{Implementations} +\begin{itemize} +\item ZSI: Python +\item KDSOAP: Qt4/5 native Library (commercial) +\item gSOAP: C/C++ +\item Apache Axis2: C++, JAVA +\item Apache CXF: JAVA (+ other middleware protocols) +\item SOAP::WSDL: Perl +\item SOAP4R: Ruby +\item wsdl2objc: Objective C +\item .NET, mono +\end{itemize} +\end{block} +\end{frame} + +\begin{frame}[fragile] +\frametitle{SOAP example in Python/ZSI} +server.py +\begin{lstlisting}[language=python] +from datetime import datetime +from ZSI import dispatch + +def today (arg): + print "today arg:", arg + today = datetime.today () + return str (today) +def load (arg): + print "load arg:", arg + fd = open ("/proc/loadavg", "r") + loadavg = fd.read () + sysload = loadavg.split () + return sysload[0] + +dispatch.AsServer (port=8000, rpc=True) +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{SOAP example in Python/ZSI} +client.py +\begin{lstlisting}[language=python] +from datetime import datetime +from ZSI.client import Binding + +b = Binding (url='http://localhost:8000/') +t = b.today (5) +# t = 2014-02-18 15:59:50.571927 +c = datetime.strptime (t, + "%Y-%m-%d %H:%M:%S.%f") +print "Today:", c.strftime ("%d.%m.%Y, %H:%M") +print b.load ("string") +\end{lstlisting} +\end{frame} + + +\begin{frame} +\frametitle{XMPP - Extensible Messaging and Presence Protocol} +\begin{block}{Overview} +\begin{itemize} +\item protocol for MOM based on XML +\item originally named Jabber +\item used for +\begin{itemize} + \item real-time Instant Messaging + \item publishing Presence Informations + \item Contactlist maintenance +\end{itemize} +\end{itemize} +\end{block} +\end{frame} + + +\begin{frame} +\frametitle{Extensible Messaging and Presence Protocol} +\begin{block}{IM for Industry??} +\begin{itemize} +\item free and open standard (IETF RFC 6120, 6121) +\item XMPP servers can be isolated, security is implemented (SASL, TLS) +\item TCP and HTTP(S) transports are supported +\item Priority support: multiple logins from same account, + +login with highest pority gets message +\item not just used for IM: +\begin{itemize} + \item smart grid + \item publish-subscribe systems + \item games + \item signalling for VoIP +\end{itemize} +\end{itemize} +\end{block} +\end{frame} + +\begin{frame} +\frametitle{Extensible Messaging and Presence Protocol} +\begin{block}{Extensible\dots} +\begin{itemize} +\item network management +\item collaboration tools +\item file sharing, gaming +\item remote systems control and monitoring +\item geolocation +\end{itemize} +\end{block} +\end{frame} + +\begin{frame} +\frametitle{Extensible Messaging and Presence Protocol} +\begin{block}{Implemmentations} +\dots too many to mention, have a look at + +http://xmpp.org/xmpp-software/ + +for libraries, clients and servers +\end{block} +\end{frame} + + +\begin{frame}[fragile] +\frametitle{XMPP Client Example} +xmpp\_client.cpp +\begin{lstlisting}[language=C++] +#include +#include "myclient.h" + +int main(int argc, char *argv[]) +{ + QCoreApplication app(argc, argv); + + MyClient client; + client.connectToServer("qtapp@localhost", + "test"); + + return app.exec(); +} +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{XMPP Client Example} +myclient.h +\begin{lstlisting}[language=C++] +#include + +class MyClient : public QXmppClient +{ + Q_OBJECT + + public: + MyClient(); + ~MyClient(); + + public slots: + void message_rx(const QXmppMessage&); +}; +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{XMPP Client Example} +myclient.cpp\#p1 +\begin{lstlisting}[language=C++] +#include +#include + +#include "myclient.h" + +MyClient::MyClient() : QXmppClient() +{ + bool check = connect(this, + SIGNAL(messageReceived(QXmppMessage)), + SLOT(message_rx(QXmppMessage))); + + Q_ASSERT(check); + Q_UNUSED(check); +} +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{XMPP Client Example} +myclient.cpp\#p2 +\begin{lstlisting}[language=C++] +MyClient::~MyClient() { ; } + +void +MyClient::message_rx(const QXmppMessage& msg) +{ + QString from = msg.from(); + QString body = msg.body(); + + std::cout< org.enlightenment.FileManager \ + /org/enlightenment/FileManager \ + org.enlightenment.FileManager.OpenDirectory \ + /home/local +\end{verbatim} \end{frame} -\begin{frame} -\frametitle{Desktop Integration} -\begin{center} -\includegraphics[height=0.8\textheight]{images/dbus-hal.png} -\end{center} -Source: http://www.redhat.com +\begin{frame}[fragile] +\frametitle{System Integration} +e.g. hotplug events +\begin{verbatim} +% mdbus2 -s -l +[SIGNAL] +org.freedesktop.UDisks.DeviceAdded +/org/freedesktop/UDisks :1.25 +('/org/freedesktop/UDisks/devices/sdb',) +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\begin{verbatim} +[SIGNAL] +org.freedesktop.DBus.ObjectManager.InterfacesAdded +/org/freedesktop/UDisks2 :1.40 +('/org/freedesktop/UDisks2/drives/WD_My_Passport_0748_57584D314335325839363238', +{'org.freedesktop.UDisks2.Drive': + {'Vendor': <'WD'>, 'Model': <'My Passport0748'>, + 'Revision': <'1015'>, 'Serial': <'57584D314335325839363238'>, + 'WWN': <''>, 'Id': <'WD-My-Passport-0748-57584D314335325839363238'>, + 'Configuration': <@a{sv} {}>, 'Media': <''>, + 'MediaCompatibility': <@as []>, 'MediaRemovable':, + 'MediaAvailable': , 'MediaChangeDetected': , + 'Size':, + 'TimeDetected': , + 'TimeMediaDetected': , + 'Optical': , OpticalBlank': , + 'OpticalNumTracks': , + 'OpticalNumAudioTracks': , + 'OpticalNumDataTracks': , + 'OpticalNumSessions': , + 'RotationRate': <-1>, 'ConnectionBus':<'usb'>, + 'Seat': <'seat0'>, 'Removable': , 'Ejectable': , + 'SortKey': <'01hotplug/1392720111627238'>, + 'CanPowerOff': , + 'SiblingId':<'/sys/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0'>}}) +\end{verbatim} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Example: Session Bus Signals} +\begin{itemize} +\item have a look at the code +\item start pingserver and pingclient +\item monitor signals with 'mdbus2 -l' +\end{itemize} \end{frame} \subsection{CORBA} @@ -73,13 +567,40 @@ Source: http://www.redhat.com \end{block} \end{frame} +\begin{frame} +\frametitle{well-known implementations} +\begin{itemize} +\item omniORB: C++ / Python +\item ACE/TAO: C++ including RTCORBA support +\item MICO: C++ focus on security +\item JacORB: JAVA +\item IIOP.NET: .NET Remoting integration +\item ORBit2: C with C++ and Python bindings +\end{itemize} +\end{frame} + + \begin{frame} \frametitle{Functional Principle} \begin{center} -\includegraphics[height=0.8\textheight]{images/orb.jpg} +\includegraphics[width=1.0\textwidth]{images/orb.jpg} \end{center} \end{frame} + +\begin{frame} +\frametitle{Functional Principle} +\begin{block}{IDL Interface Description Language} +\begin{itemize} +\item write Interface Description +\item use IDL compiler to produce stubs and skeleton code +\item implement interfaces and use interfaces in native language +\item compile applications +\end{itemize} +\end{block} +\end{frame} + + \begin{frame} \frametitle{Functional Principle} \begin{block}{CORBA Services} -- cgit v1.2.3 From 497737cfb560023d75d500fe7ea410d82d005a2d Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 18 Feb 2014 23:32:02 +0100 Subject: configpres.tex: make lstlistings readable \tiny is not readable on a beamer; or at least not in times of Full HD Beamers Signed-off-by: Manuel Traut --- configpres.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configpres.tex b/configpres.tex index ae157c1..c2bc6e1 100644 --- a/configpres.tex +++ b/configpres.tex @@ -18,12 +18,11 @@ numbers=left, stepnumber=1, numbersep=5pt, - numberstyle=\tiny, breaklines=true, breakautoindent=true, postbreak=\space, tabsize=2, - basicstyle=\ttfamily\tiny, + basicstyle=\ttfamily\small, showspaces=false, showstringspaces=false, extendedchars=true, -- cgit v1.2.3 From 47c3e5d12b1f79de872301de840f41ad58ec326e Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 18 Feb 2014 23:33:17 +0100 Subject: add a graphic about middleware Signed-off-by: Manuel Traut --- images/714px-Middleware_Schema.png | Bin 0 -> 14057 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 images/714px-Middleware_Schema.png diff --git a/images/714px-Middleware_Schema.png b/images/714px-Middleware_Schema.png new file mode 100644 index 0000000..cedabeb Binary files /dev/null and b/images/714px-Middleware_Schema.png differ -- cgit v1.2.3 From de1b78ee51ee99165c7ad1030cc13a24fd05e394 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 18 Feb 2014 23:34:04 +0100 Subject: middleware: add a python xmlrpc example xmlrpc is supported by the python stdlib so let's play around with it! Signed-off-by: Manuel Traut --- frameworks/middleware/examples/xmlrpc/client.py | 14 ++++++++++++++ frameworks/middleware/examples/xmlrpc/server.py | 21 +++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 frameworks/middleware/examples/xmlrpc/client.py create mode 100755 frameworks/middleware/examples/xmlrpc/server.py diff --git a/frameworks/middleware/examples/xmlrpc/client.py b/frameworks/middleware/examples/xmlrpc/client.py new file mode 100755 index 0000000..2b466b7 --- /dev/null +++ b/frameworks/middleware/examples/xmlrpc/client.py @@ -0,0 +1,14 @@ +#!/usr/bin/python + +import xmlrpclib +from datetime import datetime + +proxy = xmlrpclib.ServerProxy ("http://localhost:8000/") + +today = proxy.today () +# today = 20140218T14:23:45 +converted = datetime.strptime (today.value, "%Y%m%dT%H:%M:%S") +print "Today: %s" % converted.strftime ("%d.%m.%Y, %H:%M") + +load = proxy.load () +print "system load:", load diff --git a/frameworks/middleware/examples/xmlrpc/server.py b/frameworks/middleware/examples/xmlrpc/server.py new file mode 100755 index 0000000..ebde5ee --- /dev/null +++ b/frameworks/middleware/examples/xmlrpc/server.py @@ -0,0 +1,21 @@ +#!/usr/bin/python + +from datetime import datetime +from SimpleXMLRPCServer import SimpleXMLRPCServer +import xmlrpclib + +def today (): + today = datetime.today () + return xmlrpclib.DateTime (today) + +def load (): + fd = open ("/proc/loadavg", "r") + loadavg = fd.read () + sysload = loadavg.split () + return xmlrpclib.FloatType (sysload[0]) + +server = SimpleXMLRPCServer (("localhost", 8000)) +server.register_function (today, "today") +server.register_function (load, "load") +print "Listening on port 8000..." +server.serve_forever () -- cgit v1.2.3 From a9f5c60272e630c3de528dc773eb5af491a01e0a Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 18 Feb 2014 23:34:33 +0100 Subject: middleware: add a python soap example it's a quite small one. Maybe we can add an interface description sometimes. Signed-off-by: Manuel Traut --- frameworks/middleware/examples/soap/client.py | 11 +++++++++++ frameworks/middleware/examples/soap/server.py | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 frameworks/middleware/examples/soap/client.py create mode 100755 frameworks/middleware/examples/soap/server.py diff --git a/frameworks/middleware/examples/soap/client.py b/frameworks/middleware/examples/soap/client.py new file mode 100755 index 0000000..9cd35f2 --- /dev/null +++ b/frameworks/middleware/examples/soap/client.py @@ -0,0 +1,11 @@ +#!/usr/bin/python + +from datetime import datetime +from ZSI.client import Binding + +b = Binding(url='http://localhost:8000/') +t = b.today (5) +# t = 2014-02-18 15:59:50.571927 +conv = datetime.strptime (t, "%Y-%m-%d %H:%M:%S.%f") +print "Today: %s" % conv.strftime ("%d.%m.%Y, %H:%M") +print b.load ("string") diff --git a/frameworks/middleware/examples/soap/server.py b/frameworks/middleware/examples/soap/server.py new file mode 100755 index 0000000..32a550a --- /dev/null +++ b/frameworks/middleware/examples/soap/server.py @@ -0,0 +1,18 @@ +#!/usr/bin/python + +from datetime import datetime +from ZSI import dispatch + +def today (arg): + print "today arg:", arg + today = datetime.today () + return str (today) + +def load (arg): + print "load arg:", arg + fd = open ("/proc/loadavg", "r") + loadavg = fd.read () + sysload = loadavg.split () + return sysload[0] + +dispatch.AsServer (port=8000, rpc=True) -- cgit v1.2.3 From 07761742a5a104020c975f649bd188a950a4891c Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 18 Feb 2014 23:36:45 +0100 Subject: middleware/xmpp: add an example - this is a minimal qt client that can be used with a jabber/xmpp server - have a look at the README file for the test setup Signed-off-by: Manuel Traut --- frameworks/middleware/examples/xmpp/README | 28 +++++++++++++++++++++ frameworks/middleware/examples/xmpp/client.cpp | 24 ++++++++++++++++++ frameworks/middleware/examples/xmpp/myclient.cpp | 32 ++++++++++++++++++++++++ frameworks/middleware/examples/xmpp/myclient.h | 17 +++++++++++++ frameworks/middleware/examples/xmpp/xmpp.pro | 15 +++++++++++ 5 files changed, 116 insertions(+) create mode 100644 frameworks/middleware/examples/xmpp/README create mode 100644 frameworks/middleware/examples/xmpp/client.cpp create mode 100644 frameworks/middleware/examples/xmpp/myclient.cpp create mode 100644 frameworks/middleware/examples/xmpp/myclient.h create mode 100644 frameworks/middleware/examples/xmpp/xmpp.pro diff --git a/frameworks/middleware/examples/xmpp/README b/frameworks/middleware/examples/xmpp/README new file mode 100644 index 0000000..ef147ce --- /dev/null +++ b/frameworks/middleware/examples/xmpp/README @@ -0,0 +1,28 @@ +a) apt-get install libqxmpp-dev psi ejabberd + +b) edit /etc/ejabberd/ejabberd.cfg to allow inband registration: + + --8<--- + %% No username can be registered via in-band registration: + %% To enable in-band registration, replace 'deny' with 'allow' + % (note that if you remove mod_register from modules list then users will not + % be able to change their password as well as register). + % This setting is default because it's more safe. + {access, register, [{allow, all}]}. + --8<--- + +c) start psi and configure it to use 'localhost' as server and create two + accounts: : + qtapp:test + +d) login with and qtapp, add both accounts to their contact list, + and try to send messages. logoff the qtapp account. + +e) build the qt client application and start it: + +qmake +make +./client + +f) the qtapp account needs now to be online in psi, write a messagte to qtapp + the message should be displayed in the commandline diff --git a/frameworks/middleware/examples/xmpp/client.cpp b/frameworks/middleware/examples/xmpp/client.cpp new file mode 100644 index 0000000..9390438 --- /dev/null +++ b/frameworks/middleware/examples/xmpp/client.cpp @@ -0,0 +1,24 @@ +/* +* Copyright (C) 2008-2010 Manjeet Dahiya +* +* Author: +* Manjeet Dahiya +* modified 2014 by Manuel Traut +*/ + +#include + +//#include + +#include "myclient.h" + +int main(int argc, char *argv[]) +{ + QCoreApplication a(argc, argv); + // QXmppLogger::getLogger()->setLoggingType(QXmppLogger::StdoutLogging); + + MyClient client; + client.connectToServer("qtapp@localhost", "test"); + + return a.exec(); +} diff --git a/frameworks/middleware/examples/xmpp/myclient.cpp b/frameworks/middleware/examples/xmpp/myclient.cpp new file mode 100644 index 0000000..fa28603 --- /dev/null +++ b/frameworks/middleware/examples/xmpp/myclient.cpp @@ -0,0 +1,32 @@ +/* +* Copyright (C) 2008-2010 Manjeet Dahiya +* +* Author: +* Manjeet Dahiya +* +* modified 2014 by Manuel Traut +*/ + +#include +#include + +#include "myclient.h" + +MyClient::MyClient() : QXmppClient() +{ + bool check = connect(this, + SIGNAL(messageReceived(QXmppMessage)), + SLOT(message_rx(QXmppMessage))); + Q_ASSERT(check); + Q_UNUSED(check); +} + +MyClient::~MyClient() { ; } + +void MyClient::message_rx(const QXmppMessage& message) +{ + QString from = message.from(); + QString msg = message.body(); + std::cout< + +class MyClient : public QXmppClient +{ + Q_OBJECT +public: + MyClient(); + ~MyClient(); + +public slots: + void message_rx(const QXmppMessage&); +}; + +#endif diff --git a/frameworks/middleware/examples/xmpp/xmpp.pro b/frameworks/middleware/examples/xmpp/xmpp.pro new file mode 100644 index 0000000..7f0be00 --- /dev/null +++ b/frameworks/middleware/examples/xmpp/xmpp.pro @@ -0,0 +1,15 @@ +###################################################################### +# Automatically generated by qmake (2.01a) Tue Feb 18 19:47:09 2014 +###################################################################### + +TEMPLATE = app +TARGET = client +DEPENDPATH += . +INCLUDEPATH += . + +# Input +SOURCES += client.cpp myclient.cpp +HEADERS += myclient.h + +QT += network +LIBS += -lqxmpp -- cgit v1.2.3 From fd369b1d74b95904b91bfd0fc6c7c52aacd31872 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 18 Feb 2014 23:50:21 +0100 Subject: middleware/example/corba/README document option of supplier that is send to the receiver Signed-off-by: Manuel Traut --- frameworks/middleware/examples/corba/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/middleware/examples/corba/README b/frameworks/middleware/examples/corba/README index 74ca9bb..5d71b99 100644 --- a/frameworks/middleware/examples/corba/README +++ b/frameworks/middleware/examples/corba/README @@ -9,4 +9,4 @@ Naming_Service -ORBEndpoint iiop://localhost:55555 ./receiver -ORBInitRef NameService=corbaloc:iiop:localhost:55555/NameService -./supplier -ORBInitRef NameService=corbaloc:iiop:localhost:55555/NameService +./supplier test -ORBInitRef NameService=corbaloc:iiop:localhost:55555/NameService -- cgit v1.2.3 From 276f95e75e21e16fb132ea682e6dbf8dec520738 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Wed, 19 Feb 2014 08:10:15 +0100 Subject: middleware: update CORBA section - mention policies - added more details about abstractions (os, language, transports) Signed-off-by: Manuel Traut --- frameworks/middleware/pres_middleware.tex | 55 ++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/frameworks/middleware/pres_middleware.tex b/frameworks/middleware/pres_middleware.tex index d147ceb..c2933ba 100644 --- a/frameworks/middleware/pres_middleware.tex +++ b/frameworks/middleware/pres_middleware.tex @@ -556,17 +556,17 @@ org.freedesktop.DBus.ObjectManager.InterfacesAdded \end{frame} \subsection{CORBA} + \begin{frame} \frametitle{Common Object Request Broker Architecture} -\begin{block}{abstracts} \begin{itemize} -\item operating systems -\item programming language -\item transport protocol +\item hosting of objects / RPC +\item typically a Client- / Serverarchitecture +\item one application can be Client and Server at the same time \end{itemize} -\end{block} \end{frame} + \begin{frame} \frametitle{well-known implementations} \begin{itemize} @@ -580,6 +580,35 @@ org.freedesktop.DBus.ObjectManager.InterfacesAdded \end{frame} +\begin{frame} +\frametitle{communication between different operating systems} +\begin{itemize} +\item hosting of objects is abstracted, e.g. ThreadPool +\item use of OS services, e.g. sockets is abstracted +\end{itemize} +\end{frame} + + +\begin{frame} +\frametitle{communication between programming languages} +\begin{itemize} +\item CORBA uses its own datatypes +\item datatype mapping needs to be implement for each language +\end{itemize} +\end{frame} + + +\begin{frame} +\frametitle{common transports} +\begin{itemize} +\item IIOP +\item socket +\item shared-memory +\item implementing own transports is possible +\end{itemize} +\end{frame} + + \begin{frame} \frametitle{Functional Principle} \begin{center} @@ -600,6 +629,22 @@ org.freedesktop.DBus.ObjectManager.InterfacesAdded \end{block} \end{frame} +\begin{frame} +\frametitle{Functional Principle} +\begin{block}{Policies} +\begin{itemize} +\item Server- or Clientsiede Policies +\item Run-time and compile-time Policies +\item e.g. for +\begin{itemize} +\item Lifetime of objects +\item Activation of objects +\item Thread Policies +\item Connection Polies +\end{itemize} +\end{itemize} +\end{block} +\end{frame} \begin{frame} \frametitle{Functional Principle} -- cgit v1.2.3 From 5ec6915a8f955c8ef72165e7392718a0b1f75bfa Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Wed, 19 Feb 2014 09:36:54 +0100 Subject: middleware: add celery section and example celery is a python framework for job execution Signed-off-by: Manuel Traut --- frameworks/middleware/examples/celery/README | 3 + frameworks/middleware/examples/celery/exec_task.py | 15 +++++ frameworks/middleware/examples/celery/test.py | 36 ++++++++++ frameworks/middleware/examples/celery/worker.sh | 2 + frameworks/middleware/pres_middleware.tex | 77 ++++++++++++++++++++++ 5 files changed, 133 insertions(+) create mode 100644 frameworks/middleware/examples/celery/README create mode 100644 frameworks/middleware/examples/celery/exec_task.py create mode 100755 frameworks/middleware/examples/celery/test.py create mode 100755 frameworks/middleware/examples/celery/worker.sh diff --git a/frameworks/middleware/examples/celery/README b/frameworks/middleware/examples/celery/README new file mode 100644 index 0000000..9045901 --- /dev/null +++ b/frameworks/middleware/examples/celery/README @@ -0,0 +1,3 @@ +apt-get install python-celery +./worker.sh +./test.py diff --git a/frameworks/middleware/examples/celery/exec_task.py b/frameworks/middleware/examples/celery/exec_task.py new file mode 100644 index 0000000..9169250 --- /dev/null +++ b/frameworks/middleware/examples/celery/exec_task.py @@ -0,0 +1,15 @@ +import os + +from celery import Celery + +app = Celery ('tasks', broker='sqla+sqlite:///celerydb.sqlite', + backend='db+sqlite:///results.sqlite') + +@app.task +def execute (command): + return os.system (command) + +@app.task +def execute2 (command): + if os.system (command): + raise Exception ("command not found") diff --git a/frameworks/middleware/examples/celery/test.py b/frameworks/middleware/examples/celery/test.py new file mode 100755 index 0000000..7d79c8e --- /dev/null +++ b/frameworks/middleware/examples/celery/test.py @@ -0,0 +1,36 @@ +#!/usr/bin/python + +import sys +import traceback + +from exec_task import execute, execute2 + +execute.delay ("echo hello world") + +print "\n\n" + +result = execute.delay ("sleep 2") +print "result ready?", result.ready () +print "wait for result..." +ret = result.get (timeout=10) +print "task done", ret + +print "\n\n" + +result = execute.delay ("/bin/false") +print "/bin/false:", result.get (timeout=10) + +print "\n\n" + +result = execute2.delay ("/bin/treu") +try: + print "/bin/treu:", result.get (timeout=10) +except: + print "exception occured; backtrace:" + print result.traceback + +print "\n\n" + +result = execute2.delay ("/bin/true") +print "/bin/true:", result.get (timeout=10) + diff --git a/frameworks/middleware/examples/celery/worker.sh b/frameworks/middleware/examples/celery/worker.sh new file mode 100755 index 0000000..1705198 --- /dev/null +++ b/frameworks/middleware/examples/celery/worker.sh @@ -0,0 +1,2 @@ +#!/bin/sh +celery -A exec_task worker --loglevel=info diff --git a/frameworks/middleware/pres_middleware.tex b/frameworks/middleware/pres_middleware.tex index c2933ba..c2eacc7 100644 --- a/frameworks/middleware/pres_middleware.tex +++ b/frameworks/middleware/pres_middleware.tex @@ -445,6 +445,83 @@ MyClient::message_rx(const QXmppMessage& msg) \subsection{Celery} +\begin{frame} +\frametitle{Overview} +\begin{itemize} +\item Distributed Task Queue +\item based on message passing +\item real-time operation and scheduling +\item Tasks can be hosted on a single or on mulitple workers +\item synchronous and asynchronous execution +\item rate limit support +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{implementations} +\begin{itemize} +\item celery-project: Python +\item celery-php: PHP +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{celeryproject} +\begin{block}{supports multiple message broker} +\begin{itemize} +\item database: Django, or any supported by SQLAlchemy +\item RabbitMQ +\item Redis +\item Amazon SQS (experimental) +\end{itemize} +\end{block} +\end{frame} + +\begin{frame} +\frametitle{celeryproject} +\begin{block}{supports multiple result storage} +\begin{itemize} +\item database: any supported by SQLAlchemy +\item memcached +\item Redis +\item AMQP +\item Cassandra +\item IronCache +\end{itemize} +\end{block} +\end{frame} + +\begin{frame}[fragile] +\frametitle{celeryproject, example} +exec\_task.py +\begin{lstlisting}{language=python} +import os +from celery import Celery + +app = Celery ('tasks', broker='sqla+sqlite:///celerydb.sqlite) + +@app.task +def execute (command): + os.system (command) +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{celeryproject, example} +test.py +\begin{lstlisting}{language=python} +from exec_task import execute + +execute.delay ("echo hello world") +\end{lstlisting} + +start the example: +\begin{lstlisting}{language=bash} +term1% celery -A exec_task worker +term2% ./test.py +\end{lstlisting} +\dots an example using return values and exceptions is in the example dir +\end{frame} \subsection{DDS} -- cgit v1.2.3 From 445b026710cd33745e13e952f25288b4fd87cd1e Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Wed, 19 Feb 2014 09:52:10 +0100 Subject: middleware: don't mention DDS there is only one open-source implementation and the topic is quiet to complex for a short overview! Signed-off-by: Manuel Traut --- frameworks/middleware/pres_middleware.tex | 6 ------ 1 file changed, 6 deletions(-) diff --git a/frameworks/middleware/pres_middleware.tex b/frameworks/middleware/pres_middleware.tex index c2eacc7..b8ccce1 100644 --- a/frameworks/middleware/pres_middleware.tex +++ b/frameworks/middleware/pres_middleware.tex @@ -9,7 +9,6 @@ \item Overview \item XML based Middleware \item Celery -\item DDS \item D-Bus \item CORBA \end{itemize} @@ -79,7 +78,6 @@ and for what they can be used. \begin{itemize} \item XML based Middleware \item Celery - Job Queue Protocol -\item DDS - Data Distribution Service \item D-Bus - MOM \item CORBA - Common Object Request Broker \end{itemize} @@ -524,10 +522,6 @@ term2% ./test.py \end{frame} -\subsection{DDS} - - - \subsection{D-Bus} \begin{frame} -- cgit v1.2.3 From 2f46ad6a6f7393dc7898672a7ea3337395bafae9 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Wed, 19 Feb 2014 10:00:49 +0100 Subject: middleware: add conclusion Signed-off-by: Manuel Traut --- frameworks/middleware/pres_middleware.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frameworks/middleware/pres_middleware.tex b/frameworks/middleware/pres_middleware.tex index b8ccce1..a658f83 100644 --- a/frameworks/middleware/pres_middleware.tex +++ b/frameworks/middleware/pres_middleware.tex @@ -771,4 +771,16 @@ org.freedesktop.DBus.ObjectManager.InterfacesAdded \end{block} \end{frame} +\subsection{Conclusion} +\begin{frame} +\frametitle{Conclusion} +\begin{itemize} +\item many frameworks available +\item different kind of abstraction +\item special frameworks for special problems +\item which framework is best for my problem? +\item is it helpful to use multiple frameworks? +\end{itemize} +\end{frame} + \input{tailpres} -- cgit v1.2.3 From d0eb7de92f33eff43fb32c413582fcb74553999f Mon Sep 17 00:00:00 2001 From: Jan Altenberg Date: Wed, 19 Feb 2014 17:28:22 +0100 Subject: Fixes for kernel tracing pres --- .../kernel-tracing/pres_kernel-tracing_en.tex | 38 +++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/kernel-devel/kernel-tracing/pres_kernel-tracing_en.tex b/kernel-devel/kernel-tracing/pres_kernel-tracing_en.tex index d5a9686..9f19959 100644 --- a/kernel-devel/kernel-tracing/pres_kernel-tracing_en.tex +++ b/kernel-devel/kernel-tracing/pres_kernel-tracing_en.tex @@ -38,6 +38,16 @@ blk function_graph mmiotrace wakeup_rt wakeup \end{frame} \section{Event tracing} +\begin{frame}[fragile] +\frametitle{Event tracing} +\begin{itemize} +\item Pre-defined Events in the kernel +\item Event groups +\item Each event comes with several options +\item Filtering based on event options +\end{itemize} +\end{frame} + \begin{frame}[fragile] \frametitle{Event tracing} current\_tracer can be set to NOP @@ -133,6 +143,32 @@ $ cat trace \end{frame} \section{Tracers} +\begin{frame} +\frametitle{Tracers} +\begin{itemize} +\item Already have some special logic +\item Latency hunting +\item Callgraphs +\item Kernel profiling +\item ... +\end{itemize} +\end{frame} + +\section{Tracers} +\begin{frame} +\frametitle{Tracers} +available\_tracers contains the tracers which are enabled +in the kernel configuration. The tracer ist set by the +current\_tracer file: +\begin{itemize} +\item function: Can turn all functions into trace events +\item function\_graph: Similiar to function, but contains a call graph +\item wakeup / wakeup\_rt: Measure the wakeup time for tasks / rt tasks +\item irqsoff: useful for latency hunting. Identifies long sections with IRQs turned off +\item ... +\end{itemize} +\end{frame} + \begin{frame}[fragile] \frametitle{Tracer: function} \begin{verbatim} @@ -559,7 +595,7 @@ $ ps H -C pthread_example -o 'pid tid cmd comm' \frametitle{Dynamic kernel tracepoints: KPROBES} \begin{verbatim} $ echo 'p:my_k_event do_IRQ' > kprobe_events -$ echo 1 events/kprobes/my_k_event/enabled +$ echo 1 > events/kprobes/my_k_event/enabled $ echo 1 > tracing_on $ cat trace -0 [000] d... 545.173709: my_k_event: (do_IRQ+0x0/0xc0) -- cgit v1.2.3 From 541d5387d74bc185fd95124b1c9071748c859914 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Fri, 2 May 2014 13:33:54 +0200 Subject: update middleware examples Signed-off-by: Manuel Traut --- frameworks/middleware/examples/celery/test.py | 15 --------------- frameworks/middleware/examples/corba/README | 2 +- frameworks/middleware/examples/corba/Receiver.cpp | 9 +++++---- frameworks/middleware/examples/corba/Supplier.cpp | 1 + frameworks/middleware/examples/soap/client.py | 2 ++ frameworks/middleware/examples/xmlrpc/server.py | 2 ++ 6 files changed, 11 insertions(+), 20 deletions(-) diff --git a/frameworks/middleware/examples/celery/test.py b/frameworks/middleware/examples/celery/test.py index 7d79c8e..c64951b 100755 --- a/frameworks/middleware/examples/celery/test.py +++ b/frameworks/middleware/examples/celery/test.py @@ -5,22 +5,7 @@ import traceback from exec_task import execute, execute2 -execute.delay ("echo hello world") -print "\n\n" - -result = execute.delay ("sleep 2") -print "result ready?", result.ready () -print "wait for result..." -ret = result.get (timeout=10) -print "task done", ret - -print "\n\n" - -result = execute.delay ("/bin/false") -print "/bin/false:", result.get (timeout=10) - -print "\n\n" result = execute2.delay ("/bin/treu") try: diff --git a/frameworks/middleware/examples/corba/README b/frameworks/middleware/examples/corba/README index 5d71b99..f17e373 100644 --- a/frameworks/middleware/examples/corba/README +++ b/frameworks/middleware/examples/corba/README @@ -5,7 +5,7 @@ tao-cosnaming tao-idl tao-utils ./configure make -Naming_Service -ORBEndpoint iiop://localhost:55555 +tao_cosnaming -ORBEndpoint iiop://localhost:55555 ./receiver -ORBInitRef NameService=corbaloc:iiop:localhost:55555/NameService diff --git a/frameworks/middleware/examples/corba/Receiver.cpp b/frameworks/middleware/examples/corba/Receiver.cpp index 45ac9dc..f8b0068 100755 --- a/frameworks/middleware/examples/corba/Receiver.cpp +++ b/frameworks/middleware/examples/corba/Receiver.cpp @@ -78,8 +78,9 @@ int main(int argc, char* argv[]){ root_poa->destroy(1,1); orb->destroy(); - } catch(CORBA::Exception &any) { - std::cout<<"Exception: "<