Add a documentation repository and upload the RMLL 2006 (http://rmll.info) presentati...
[openwrt/svn-archive/docs.git] / rmll2006 / presentation_en.tex
1 \documentclass{beamer}
2
3 \usepackage{beamerthemesplit}
4 \usepackage[latin1]{inputenc}
5 \usepackage[french]{babel}
6 \usepackage{pstricks} % Advanced drawings
7 \usepackage{fancyhdr} % Headers
8 \usepackage{epsf}
9 \usepackage{graphicx}
10 \usepackage{fancyhdr}
11
12 \title{OpenWrt : fresh air for (wlan) routers}
13
14 \author{Florian Fainelli \\
15 florian@openwrt.org}
16
17 \institute{Rencontres Mondiales du Logiciel Libre 2006 \\
18 Vandoeuvre-lès-Nancy\\
19 Lenght : 30 minutes}
20
21 \date[]{Thursday July 6th 2006}
22
23 \begin{document}
24
25 \frame{\titlepage}
26 \frame[allowframebreaks]
27 {
28 \frametitle{Summary}
29 \tableofcontents
30 }
31
32 \section{Introduction}
33 \subsection{What is OpenWrt}
34 \frame
35 {
36 \frametitle{What is OpenWrt}
37 \begin{itemize}
38 \item contraction of Opensource Wireless Technology
39 \item minimalist GNU/Linux distribution GPL licensed
40 \item set of Makefile providing the building of a full filesystem
41 \item package and updates repository
42 \end{itemize}
43 }
44
45 \subsection{Project history}
46 \frame
47 {
48 \frametitle{Project history}
49 \begin{itemize}
50 \item OpenWrt was created by Gerry Rozeman (aka Groz) and Mike Baker (aka [mbm]) in november 2003.
51 \item Since the beginning, Gerry and Mike felt the great potential offered by a Linux-based firmware, and at the same time the limitations provided by the Linksys one. That is why they decide to replace the later by a minimalist one, built with the current uClibc buildroot.
52 \item The philosophy is simple : everything is configured in commmand-line using SSH
53 \end{itemize}
54 }
55
56 \subsection{Context}
57 \frame
58 {
59 \frametitle{Context}
60 \begin{itemize}
61 \item At the time the first OpenWrt version is released, Sveasoft firmwares were already available since few months and add various features, configurable through the Linksys web interface.
62 \item Few months later, DD-WRT firmware comes out, an OpenWrt fork, the main reason for its developpement is the lack of an OpenWrt web interface.
63 \end{itemize}
64 }
65
66 \subsection{State of art}
67 \frame
68 {
69 \frametitle{State of art}
70 Nowadays, OpenWrt team is composed of 5 main developpers, helped by many contributors :
71 \begin{itemize}
72 \item Mike Baker ([mbm])
73 \item Imre Kaloz (Kaloz)
74 \item Nicolas Thill (Nico)
75 \item Felix Fietkau (nbd)
76 \item Florian Fainelli (florian)
77 \end{itemize}
78 }
79
80 \section{The different versions}
81 \subsection{Development tools}
82 \frame
83 {
84 \frametitle{Development tools}
85 \begin{itemize}
86 \item subversion repository
87 \item Trac web interface : https://dev.openwrt.org
88 \end{itemize}
89 }
90
91 \frame
92 {
93 \subsection{Subversiion repository organisation}
94 \frametitle{Subversiion repository organisation}
95 The subversion repository is divided into several directories :
96 \begin{itemize}
97 \item 2 branches : \textbf{whiterussian/} and \textbf{buildroot-ng/}
98 \item 5 tags : whiterussian\_rc1 to 5
99 \item 1 packages directory : \textbf{packages/}
100 \item kamikaze in trunk (currently being migrated to \textbf{buildroot-ng/} and \textbf{packages/}
101 \end{itemize}
102 }
103
104 \subsection{Whiterussian}
105 \frame
106 {
107 \frametitle{Whiterussian}
108
109 Whiterussian is currently the stable version of the OpenWrt firmware. It runs fine on devices based on Broadcom 947xx and 953xx boards, such as :
110 \begin{itemize}
111 \item Linksys WRT54G v1.0 to v4
112 \item Asus WL-500g (Deluxe, Premium)
113 \item Motorola WR850G, WE500G
114 \item Buffalo WBR-B11, WBR-G54, WLA-G54
115 \end{itemize}
116
117 It is being used a firmware basis by several Wireless User Groups, and some companies, such as FON(fonbasic firmware).
118 }
119
120 \subsection{Whiterussian limitations}
121 \frame
122 {
123 \frametitle{Whiterussian limitations}
124 Altough the firmware runs fine, it is currently being limited by :
125
126 \begin{itemize}
127 \item the usage of a binary Broadcom Wi-Fi driver, thus restricting to a 2.4 kernel
128 \item the difficulty to maintain and port packages
129 \item the hardware support limited to Broadcom 47xx/53xx boards
130 \item a web interface too much relying on the existence of a NVRAM
131 \end{itemize}
132 }
133
134 \subsection{Kamikaze}
135 \frame[allowframebreaks]
136 {
137 \frametitle{Kamikaze}
138 As a consequence to these difficulties, and the more and more increasing market of Linux-based hardware, the \textbf{Kamikaze} branch was opened.
139
140 New hardware platforms were then supported~:
141 \begin{itemize}
142 \item Texas Instruments AR7 (noyau 2.4)
143 \item Atheros AR531x (noyau 2.4)
144 \item Aruba (noyau 2.6)
145 \item x86 (noyaux 2.4 et 2.6)
146 \item Broadcom SiByte (noyau 2.6)
147 \item AMD Alchemy (noyau 2.6)
148 \item Intel Xscale IX42x (noyau 2.6)
149 \item Router Board RB532 (noyau 2.6)
150 \end{itemize}
151 }
152
153 \subsection{Kamikaze limitations}
154 \frame
155 {
156 \frametitle{Kamikaze limitations}
157 Kamikaze has a certain number of drawbacks :
158 \begin{itemize}
159 \item difficulty in stabilising the kernels, most of the hardware platforms are not fully functionnal (Wi-Fi is not working most of the time)
160 \item adding and maintaining packages is too close to the whiterussian way
161 \item maintaining 2 distinct repository using different toolchains
162 \end{itemize}
163 }
164
165 \subsection{buildroot-ng}
166 \frame
167 {
168 \frametitle{buildroot-ng}
169 \begin{itemize}
170 \item abstraction et simplication d'écriture des fichiers \textbf{Makefile} et compatibilité avec la syntaxe précédente
171 \item les paquetages dépendant fortement du noyau vont dans \textbf{buildroot-ng}, les autres dans \textbf{packages/}
172 \item dépôt multi-architectures indépendamment du du système de base
173 \end{itemize}
174 }
175
176 \subsection{Main tasks}
177 \frame
178 {
179 \frametitle{Main tasks}
180 \begin{itemize}
181 \item Finish \textbf{buildroot-ng}
182 \item Porting AR7-2.4 to AR7-2.6
183 \item Porting Broadcom 63xx 2.6
184 \item Rewriting \textbf{webif}
185 \item Rewrite of the user documentation
186 \end{itemize}
187 }
188
189 \subsection{Interests of OpenWrt}
190 \frame
191 {
192 \frametitle{Interests of OpenWrt}
193 \begin{itemize}
194 \item fully customizable system from kernel to filesystem
195 \item strictly identical firware independently from the platform runned on
196 \item vendor version independent
197 \item fully GPL code
198 \end{itemize}
199 }
200
201 \section{Adding support for a new target}
202 \subsection{Legal concerns}
203 \frame
204 {
205 \frametitle{Legal concerns}
206 Some legal concerns are raised when you know a hardware is running Linux~:
207 Plusieurs questions légales se posent lorsque vous avez connaissance qu'un matériel donné fonctionne sous Linux~:
208 \begin{itemize}
209 \item does the manufacturer provide the firmware source code ?
210 \item does this hardware use binary drivers ?
211 \item are we sure it is Linux or uClinux ?
212 \item is the GPL code compliant with GPL or compatible ?
213 \end{itemize}
214 }
215
216 \subsection{Proving that a hardare is running Linux}
217 \frame
218 {
219 \frametitle{Proving that a hardare is running Linux}
220 You have different ways of proving that a hardware is running Linux~:
221 \begin{itemize}
222 \item downloading a firmware and trying to split it in : bootloader, kernel, filesystem (beware of the Big/Little Endian traps !)
223 \item pluging a serial console and/or JTAG
224 \item using a bug in the web interface to get the result of a dmes, cat /proc/xxxx
225 \end{itemize}
226 }
227
228 \subsection{What if the manufacturer does not provide sources}
229 \frame
230 {
231 \frametitle{GPL violation}
232 In conformance to the GPL, using GPL codes for commercial products implies the following things :
233 \begin{itemize}
234 \item publishing kernel sources
235 \item publishing source code of the GPL applications used in the filesystem
236 \item publishing sources of the GNU toolchain and the filesystem creation tools
237 \end{itemize}
238 In cas of a GPL violation, please inform : \texttt{http://gpl-violations.org}
239 }
240
241 \subsection{Working basis}
242 \frame
243 {
244 \frametitle{Working basis}
245 Your working basis is composed of the following elements :
246 \begin{itemize}
247 \item Linux kernel sources, modified to support the hardware, with the latest patches for your architecture (arm, mipsm ppc ...)
248 \item binary drivers and firmwares for the Wi-Fi card, Ethernet, ADSL ...
249 \item binary tools to create the firmware : CRC calculation, version, padding ...
250 \end{itemize}
251 You are very likely not to be able to get a functionnal firmware with the manufacturer tools.
252 }
253 \subsection{Evaluation of the porting effort}
254 \frame
255 {
256 \frametitle{Evaluation of the porting effort}
257 According to what we have, to get a working port for the architecture with OpenWrt and being GPL compliant, we have to :
258 \begin{itemize}
259 \item analyse and generate differences between a vanilla kernel and the given one
260 \item create a program adding the corect header in the firmware file (CRC calculation, version, padding ...)
261 \item keep compatibily with the binary drivers and the current kernel version (beware of the VERSIONING option)
262 \item eventually reverse engineer the binary drivers
263 \end{itemize}
264 }
265
266 \subsection{Adding a new architecture to buildroot-ng}
267 \frame
268 {
269 \frametitle{Adding a new architecture to buildroot-ng}
270 Now that we have the requirements for having an OpenWrt system for our arhictecture, let's add it~:
271 \begin{itemize}
272 \item add and entry in \textbf{target/Config.in}
273 \item add a directory \textbf{target/linux/architecture-2.x} (2.4 or 2.6 kernel) containing the arch-specific patches and kernel configuration
274 \item add a directory \textbf{target/image/architecture} describing how to build the firmware image
275 \item calling the kernel template in \textbf{include/target.mk}
276 \end{itemize}
277 }
278
279 \subsection{Conventions}
280 \frame
281 {
282 \frametitle{Conventions}
283 \begin{itemize}
284 \item Architecture naming must respect the kernel naming in \textbf{arch/}
285 \item We recommend you get a vanilla kernel booting, rather than changing the filesystem
286 \item Please separate patches as much as possible : architecture, drivers, various patches ...
287 \end{itemize}
288 }
289
290 \subsection{target/Config.in}
291 \frame[containsverbatim]
292 {
293 \frametitle{target/Config.in}
294 \begin{verbatim}
295 config LINUX_2_6_ARCHITECTURE
296 bool "Architecture foo [2.6]"
297 select mips
298 select LINUX_2_6
299 select PCI_SUPPORT
300 select PCMCIA_SUPPORT
301 help
302 A short description
303 \end{verbatim}
304 }
305
306 \subsection{target/linux/architecture-2.x/Makefile}
307 \frame[containsverbatim,allowframebreaks]
308 {
309 \frametitle{target/linux/architecture-2.x/Makefile}
310 \begin{verbatim}
311 include $(TOPDIR)/rules.mk
312
313 LINUX_VERSION:=2.6.16.7
314 LINUX_RELEASE:=1
315 LINUX_KERNEL_MD5SUM:=9682b2bd6e02f3087982d7c3f5ba824e
316
317 include ./config
318 include $(INCLUDE_DIR)/kernel.mk
319 include $(INCLUDE_DIR)/kernel-build.mk
320
321 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
322 [ -d ../generic-$(KERNEL)/patches ] &&
323 $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches $(MAKE_TRACE)
324 [ -d ./patches ] &&
325 $(PATCH) $(LINUX_DIR) ./patches $(MAKE_TRACE)
326 @$(CP) config $(LINUX_DIR)/.config
327 touch $@
328 \end{verbatim}
329 }
330
331 \subsection{target/image/architecture/Makefile}
332 \frame[containsverbatim,allowframebreaks]
333 {
334 \frametitle{target/image/architecture/Makefile}
335 \begin{verbatim}
336 include $(TOPDIR)/rules.mk
337 include $(INCLUDE_DIR)/image.mk
338
339 define Build/Compile
340 rm -f $(KDIR)/loader.gz
341 $(MAKE) -C lzma-loader \
342 BUILD_DIR="$(KDIR)" \
343 TARGET="$(KDIR)" \
344 install
345 endef
346
347 define Build/Clean
348 $(MAKE) -C lzma-loader clean
349 endef
350 define Image/Prepare
351 cat $(KDIR)/vmlinux |
352 $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
353 endef
354
355 define Image/Build/hardware
356 dd if=$(KDIR)/loader.elf
357 of=$(BIN_DIR)/openwrt-hardware-$(KERNEL)-$(2).bin
358 bs=131072 conv=sync
359 cat $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).trx
360 >> $(BIN_DIR)/openwrt-hardware-$(KERNEL)-$(2).bin
361 endef
362
363 define trxalign/jffs2-128k
364 -a 0x20000
365 endef
366 define trxalign/jffs2-64k
367 -a 0x10000
368 endef
369 define trxalign/squashfs
370 -a 1024
371 endef
372
373 $(eval $(call BuildImage))
374 \end{verbatim}
375 }
376
377 \subsection{include/target.mk}
378 \frame[containsverbatim]
379 {
380 \frametitle{include/target.mk}
381 \begin{verbatim}
382 ...
383 $(eval $(call kernel_template,2.6,architecture,
384 2_6_ARCHITECTURE))
385 ...
386 \end{verbatim}
387 }
388
389 \subsection{Debuging and stabilising the port}
390
391 \frame
392 {
393 \frametitle{Debuging and stabilizing}
394 Common debuging tools :
395 \begin{itemize}
396 \item GDB
397 \item EJTAG (si disponible)
398 \item ksymoops
399 \item usage of printk
400 \item debug options enabled in the kernel
401 \item bootloader documentation (RedBoot, CFE, YAMON, RomE ...)
402 \item asking for help of users and developpers
403 \end{itemize}
404 }
405
406 \subsection{Further problems}
407 \frame
408 {
409 \frametitle{Further problems}
410 Once you get a kernel booting on your hardware, it is very likely not to be directly usage, you may encounter the following issues~:
411 \begin{itemize}
412 \item drivers working not correctly or not at all
413 \item unrecognized flash mapping
414 \item low reaction system (processor caching)
415 \end{itemize}
416 }
417
418 \section{Customizing the system}
419
420 \frame
421 {
422 \frametitle{Customizing the system}
423 You can highly customize your system, such as~:
424 \begin{itemize}
425 \item adding a captive portal, RADIUS server
426 \item doing advanced filtering using iptables
427 \item adding network stacks and protocols ...
428 \item adding drivers for various hadware : webcam, additionnal Wi-Fi stick ...
429 \item adding features to \textbf{webif}
430 \end{itemize}
431 }
432
433 \subsection{Adding packages}
434 \frame
435 {
436 \frametitle{Adding packages}
437 We invite you to participate to the migrating effort of the packages in \textbf{kamikaze} and make them use the \textbf{buildroot-ng} syntax.
438
439 In opposition to the previous system, where you had to create 3 files :
440 \begin{itemize}
441 \item Makefile
442 \item Config.in
443 \item ipkg/paquetage.control
444 \end{itemize}
445
446 \textbf{buildroot-ng} describes and abdstracts everything in a \textbf{Makefile}.
447 }
448
449 \subsection{Hierarchy}
450 \frame
451 {
452 \frametitle{Hierarchy}
453 Packages are structured this way :
454
455 \begin{tabbing}
456 \hspace{10 pt}\=\hspace{10 pt}\=\hspace{10 pt}\=\kill
457 packages/ \> \> \> \\
458 \> section/ \> \> \\
459 \> \> package-name/ \> \\
460 \> \> \> Makefile \\
461 \> \> \> patches/
462 \end{tabbing}
463 }
464
465 \subsection{packages/section/Makefile}
466 \frame[containsverbatim,allowframebreaks]
467 {
468 \frametitle{packages/section/Makefile}
469 \begin{verbatim}
470 include $(TOPDIR)/rules.mk
471
472 PKG_NAME:=foo
473 PKG_VERSION:=alpha-beta-4
474 PKG_RELEASE:=1
475 PKG_MD5SUM:=5988e7aeb0ae4dac8d83561265984cc9
476
477 PKG_SOURCE_URL:=ftp://ftp.openwrt.org/foo
478 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
479 PKG_CAT:=zcat
480
481 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
482 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
483
484 include $(INCLUDE_DIR)/package.mk
485
486 define Package/foo
487 SECTION:=libs
488 CATEGORY:=Libraries
489 TITLE:=My sample package
490 DESCRIPTION:=My other descriptiong
491 URL:=ftp://ftp.openwrt.org/foo
492 endef
493
494 define Build/Configure
495 $(call Build/Configure/Default,--option-foo=bar)
496 endef
497
498 define Build/Compile
499 rm -rf $(PKG_INSTALL_DIR)
500 mkdir -p $(PKG_INSTALL_DIR)
501 $(MAKE) -C $(PKG_BUILD_DIR) \
502 DESTDIR="$(PKG_INSTALL_DIR)" \
503 all install
504 endef
505
506 define Package/foo/install
507 install -m0755 -d $(1)/usr/lib
508 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfoo.so.* $(1)/usr/lib/
509 endef
510
511 define Build/InstallDev
512 mkdir -p $(STAGING_DIR)/usr/include
513 $(CP) $(PKG_INSTALL_DIR)/usr/include/foo-header.h $(STAGING_DIR)/usr/include/
514 mkdir -p $(STAGING_DIR)/usr/lib
515 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfoo.{a,so*} $(STAGING_DIR)/usr/lib/
516 touch $(STAGING_DIR)/usr/lib/libfoo.so
517 endef
518
519 define Build/UninstallDev
520 rm -rf \
521 $(STAGING_DIR)/usr/include/foo-header.h \
522 $(STAGING_DIR)/usr/lib/libfoo.{a,so*}
523 endef
524
525 $(eval $(call BuildPackage,foo))
526 \end{verbatim}
527 }
528
529 \section{Getting support}
530 \frame
531 {
532 \frametitle{Getting support}
533 Do not hesisate to contact us via the following ways~:
534 \begin{itemize}
535 \item IRC : irc.freenode.net \#openwrt and \#openwrt-devel
536 \item Mailing-list : openwrt-devel@openwrt.org
537 \item Forum : http://forum.openwrt.org
538 \end{itemize}
539 }
540
541 \section{Becoming a developper}
542
543 \frame
544 {
545 \frametitle{Becoming a developper}
546 \begin{itemize}
547 \item Do not hesitate to submit patches adding packages to the repository
548 \item Do as much test and bugreport as you can
549 \item Port OpenWrt to a new device ...
550 \end{itemize}
551 }
552
553 \frame
554 {
555 \frametitle{Thank you very much}
556 Thank you very much for your attention, question session is now open.
557 }
558
559 \end{document}