summaryrefslogtreecommitdiff
path: root/distribution/elbe-devel/pres_elbe-devel_en.tex
blob: 44e29bb1dbf421320ffcc305d441004ee6891b44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
\input{configpres}

\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 calls the elbepack/elbe.py script
\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'
\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}
\begin{itemize}
\item the debian-installer is a Linux kernel and a initial ramdisk.
\item the initial ramdisk includes a minimal rootfilesystem and the d-i
  application
\item the debian project distributes the installer in different formats:
  e.g. as a bootable cd or for use with pxeboot
\item normally the debian-installer is booted on the system debian should
  be installed on
\item the debian-installer does disk detection / partitioning, sw installation
  and system configuration
\end{itemize}
\end{frame}

\begin{frame}[fragile]
\frametitle{debian-installer package}
\begin{itemize}
\item the elbe project has packaged the debian-installer as debian package
\item this was done to be able to verify the version of the installer
\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 on the debian
repository:
\begin{lstlisting}
deb http://debian.linutronix.de/elbe squeeze main
\end{lstlisting}
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{retrieve debian-installer package}
\begin{itemize}
\item elbepack/pkgutils.py:copy\_kinitrd() is called by create.py
\item the pkgutils module uses python virtapt to retrieve the debian package
  from a mirror or cdrom specified in the xml file
\item virtapt takes care on using the correct architecture and debian suite
\item then the package contents are 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}
mako.Template(filename=fname).render(**d)
\end{lstlisting}
to insert several values from the XML file into the scripts and configfiles
used in the buildenv. It is called several times, for each *.mako file in
elbepack/mako (fname).

d refers to several lxml.etree XML nodes. etree was initialized with the
ELBE XML file before.
\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) }
\end{lstlisting}
\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
<pkg-list> 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}
\end{frame}

\subsection{Makefile (pre-install)}

\begin{frame}
\frametitle{initrd.gz modification}
\end{frame}

\begin{frame}
\frametitle{create buildenv.img}
\end{frame}

\begin{frame}
\frametitle{start emulator}
\end{frame}

\subsection{debian-installer in emulator}

\begin{frame}
\frametitle{preseeding}
\end{frame}

\begin{frame}
\frametitle{post install}
cp-scipts-into-buildenv.sh
changeroot-into-buildenv.sh
\end{frame}

\begin{frame}
\frametitle{target generation}
\end{frame}

\begin{frame}
\frametitle{cdrom generation}
\end{frame}

\subsection{Makefile (post-install)}

\begin{frame}
\frametitle{copy files to host}
\end{frame}


\input{tailpres}