Translate missing sentences and update pdf
[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 (2.4 kernel)
143 \item Atheros AR531x (2.4 kernel)
144 \item Aruba (2.6 kernel)
145 \item x86 (2.4 and 2.6 kernels)
146 \item Broadcom SiByte (2.6 kernel)
147 \item AMD Alchemy (2.6 kernel)
148 \item Intel Xscale IXP42x (2.6 kernel)
149 \item Router Board RB532 (2.6 kernel)
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 ease and abstraction of the \textbf{Makefile} writing with compatibility with the previous syntax
171 \item kernel dependent packages go in \textbf{buildroot-ng}, others in \textbf{packages/}
172 \item multi-architecture repository independent from the base-system.
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 \begin{itemize}
208 \item does the manufacturer provide the firmware source code ?
209 \item does this hardware use binary drivers ?
210 \item are we sure it is Linux or uClinux ?
211 \item is the GPL code compliant with GPL or compatible ?
212 \end{itemize}
213 }
214
215 \subsection{Proving that a hardare is running Linux}
216 \frame
217 {
218 \frametitle{Proving that a hardare is running Linux}
219 You have different ways of proving that a hardware is running Linux~:
220 \begin{itemize}
221 \item downloading a firmware and trying to split it in : bootloader, kernel, filesystem (beware of the Big/Little Endian traps !)
222 \item pluging a serial console and/or JTAG
223 \item using a bug in the web interface to get the result of a dmes, cat /proc/xxxx
224 \end{itemize}
225 }
226
227 \subsection{What if the manufacturer does not provide sources}
228 \frame
229 {
230 \frametitle{GPL violation}
231 In conformance to the GPL, using GPL codes for commercial products implies the following things :
232 \begin{itemize}
233 \item publishing kernel sources
234 \item publishing source code of the GPL applications used in the filesystem
235 \item publishing sources of the GNU toolchain and the filesystem creation tools
236 \end{itemize}
237 In cas of a GPL violation, please inform : \texttt{http://gpl-violations.org}
238 }
239
240 \subsection{Working basis}
241 \frame
242 {
243 \frametitle{Working basis}
244 Your working basis is composed of the following elements :
245 \begin{itemize}
246 \item Linux kernel sources, modified to support the hardware, with the latest patches for your architecture (arm, mipsm ppc ...)
247 \item binary drivers and firmwares for the Wi-Fi card, Ethernet, ADSL ...
248 \item binary tools to create the firmware : CRC calculation, version, padding ...
249 \end{itemize}
250 You are very likely not to be able to get a functionnal firmware with the manufacturer tools.
251 }
252 \subsection{Evaluation of the porting effort}
253 \frame
254 {
255 \frametitle{Evaluation of the porting effort}
256 According to what we have, to get a working port for the architecture with OpenWrt and being GPL compliant, we have to :
257 \begin{itemize}
258 \item analyse and generate differences between a vanilla kernel and the given one
259 \item create a program adding the corect header in the firmware file (CRC calculation, version, padding ...)
260 \item keep compatibily with the binary drivers and the current kernel version (beware of the VERSIONING option)
261 \item eventually reverse engineer the binary drivers
262 \end{itemize}
263 }
264
265 \subsection{Adding a new architecture to buildroot-ng}
266 \frame
267 {
268 \frametitle{Adding a new architecture to buildroot-ng}
269 Now that we have the requirements for having an OpenWrt system for our arhictecture, let's add it~:
270 \begin{itemize}
271 \item add and entry in \textbf{target/Config.in}
272 \item add a directory \textbf{target/linux/architecture-2.x} (2.4 or 2.6 kernel) containing the arch-specific patches and kernel configuration
273 \item add a directory \textbf{target/image/architecture} describing how to build the firmware image
274 \item calling the kernel template in \textbf{include/target.mk}
275 \end{itemize}
276 }
277
278 \subsection{Conventions}
279 \frame
280 {
281 \frametitle{Conventions}
282 \begin{itemize}
283 \item Architecture naming must respect the kernel naming in \textbf{arch/}
284 \item We recommend you get a vanilla kernel booting, rather than changing the filesystem
285 \item Please separate patches as much as possible : architecture, drivers, various patches ...
286 \end{itemize}
287 }
288
289 \subsection{target/Config.in}
290 \frame[containsverbatim]
291 {
292 \frametitle{target/Config.in}
293 \begin{verbatim}
294 config LINUX_2_6_ARCHITECTURE
295 bool "Architecture foo [2.6]"
296 select mips
297 select LINUX_2_6
298 select PCI_SUPPORT
299 select PCMCIA_SUPPORT
300 help
301 A short description
302 \end{verbatim}
303 }
304
305 \subsection{target/linux/architecture-2.x/Makefile}
306 \frame[containsverbatim,allowframebreaks]
307 {
308 \frametitle{target/linux/architecture-2.x/Makefile}
309 \begin{verbatim}
310 include $(TOPDIR)/rules.mk
311
312 LINUX_VERSION:=2.6.16.7
313 LINUX_RELEASE:=1
314 LINUX_KERNEL_MD5SUM:=9682b2bd6e02f3087982d7c3f5ba824e
315
316 include ./config
317 include $(INCLUDE_DIR)/kernel.mk
318 include $(INCLUDE_DIR)/kernel-build.mk
319
320 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
321 [ -d ../generic-$(KERNEL)/patches ] &&
322 $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches $(MAKE_TRACE)
323 [ -d ./patches ] &&
324 $(PATCH) $(LINUX_DIR) ./patches $(MAKE_TRACE)
325 @$(CP) config $(LINUX_DIR)/.config
326 touch $@
327 \end{verbatim}
328 }
329
330 \subsection{target/image/architecture/Makefile}
331 \frame[containsverbatim,allowframebreaks]
332 {
333 \frametitle{target/image/architecture/Makefile}
334 \begin{verbatim}
335 include $(TOPDIR)/rules.mk
336 include $(INCLUDE_DIR)/image.mk
337
338 define Build/Compile
339 rm -f $(KDIR)/loader.gz
340 $(MAKE) -C lzma-loader \
341 BUILD_DIR="$(KDIR)" \
342 TARGET="$(KDIR)" \
343 install
344 endef
345
346 define Build/Clean
347 $(MAKE) -C lzma-loader clean
348 endef
349 define Image/Prepare
350 cat $(KDIR)/vmlinux |
351 $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
352 endef
353
354 define Image/Build/hardware
355 dd if=$(KDIR)/loader.elf
356 of=$(BIN_DIR)/openwrt-hardware-$(KERNEL)-$(2).bin
357 bs=131072 conv=sync
358 cat $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).trx
359 >> $(BIN_DIR)/openwrt-hardware-$(KERNEL)-$(2).bin
360 endef
361
362 define trxalign/jffs2-128k
363 -a 0x20000
364 endef
365 define trxalign/jffs2-64k
366 -a 0x10000
367 endef
368 define trxalign/squashfs
369 -a 1024
370 endef
371
372 $(eval $(call BuildImage))
373 \end{verbatim}
374 }
375
376 \subsection{include/target.mk}
377 \frame[containsverbatim]
378 {
379 \frametitle{include/target.mk}
380 \begin{verbatim}
381 ...
382 $(eval $(call kernel_template,2.6,architecture,
383 2_6_ARCHITECTURE))
384 ...
385 \end{verbatim}
386 }
387
388 \subsection{Debuging and stabilising the port}
389
390 \frame
391 {
392 \frametitle{Debuging and stabilizing}
393 Common debuging tools :
394 \begin{itemize}
395 \item GDB
396 \item EJTAG (if available)
397 \item ksymoops
398 \item usage of printk
399 \item debug options enabled in the kernel
400 \item bootloader documentation (RedBoot, CFE, YAMON, RomE ...)
401 \item asking for help of users and developpers
402 \end{itemize}
403 }
404
405 \subsection{Further problems}
406 \frame
407 {
408 \frametitle{Further problems}
409 Once you get a kernel booting on your hardware, it is very likely not to be directly usage, you may encounter the following issues~:
410 \begin{itemize}
411 \item drivers working not correctly or not at all
412 \item unrecognized flash mapping
413 \item low reaction system (processor caching)
414 \end{itemize}
415 }
416
417 \section{Customizing the system}
418
419 \frame
420 {
421 \frametitle{Customizing the system}
422 You can highly customize your system, such as~:
423 \begin{itemize}
424 \item adding a captive portal, RADIUS server
425 \item doing advanced filtering using iptables
426 \item adding network stacks and protocols ...
427 \item adding drivers for various hadware : webcam, additionnal Wi-Fi stick ...
428 \item adding features to \textbf{webif}
429 \end{itemize}
430 }
431
432 \subsection{Adding packages}
433 \frame
434 {
435 \frametitle{Adding packages}
436 We invite you to participate to the migrating effort of the packages in \textbf{kamikaze} and make them use the \textbf{buildroot-ng} syntax.
437
438 In opposition to the previous system, where you had to create 3 files :
439 \begin{itemize}
440 \item Makefile
441 \item Config.in
442 \item ipkg/paquetage.control
443 \end{itemize}
444
445 \textbf{buildroot-ng} describes and abdstracts everything in a \textbf{Makefile}.
446 }
447
448 \subsection{Hierarchy}
449 \frame
450 {
451 \frametitle{Hierarchy}
452 Packages are structured this way :
453
454 \begin{tabbing}
455 \hspace{10 pt}\=\hspace{10 pt}\=\hspace{10 pt}\=\kill
456 packages/ \> \> \> \\
457 \> section/ \> \> \\
458 \> \> package-name/ \> \\
459 \> \> \> Makefile \\
460 \> \> \> patches/
461 \end{tabbing}
462 }
463
464 \subsection{packages/section/Makefile}
465 \frame[containsverbatim,allowframebreaks]
466 {
467 \frametitle{packages/section/Makefile}
468 \begin{verbatim}
469 include $(TOPDIR)/rules.mk
470
471 PKG_NAME:=foo
472 PKG_VERSION:=alpha-beta-4
473 PKG_RELEASE:=1
474 PKG_MD5SUM:=5988e7aeb0ae4dac8d83561265984cc9
475
476 PKG_SOURCE_URL:=ftp://ftp.openwrt.org/foo
477 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
478 PKG_CAT:=zcat
479
480 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
481 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
482
483 include $(INCLUDE_DIR)/package.mk
484
485 define Package/foo
486 SECTION:=libs
487 CATEGORY:=Libraries
488 TITLE:=My sample package
489 DESCRIPTION:=My other descriptiong
490 URL:=ftp://ftp.openwrt.org/foo
491 endef
492
493 define Build/Configure
494 $(call Build/Configure/Default,--option-foo=bar)
495 endef
496
497 define Build/Compile
498 rm -rf $(PKG_INSTALL_DIR)
499 mkdir -p $(PKG_INSTALL_DIR)
500 $(MAKE) -C $(PKG_BUILD_DIR) \
501 DESTDIR="$(PKG_INSTALL_DIR)" \
502 all install
503 endef
504
505 define Package/foo/install
506 install -m0755 -d $(1)/usr/lib
507 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfoo.so.* $(1)/usr/lib/
508 endef
509
510 define Build/InstallDev
511 mkdir -p $(STAGING_DIR)/usr/include
512 $(CP) $(PKG_INSTALL_DIR)/usr/include/foo-header.h $(STAGING_DIR)/usr/include/
513 mkdir -p $(STAGING_DIR)/usr/lib
514 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfoo.{a,so*} $(STAGING_DIR)/usr/lib/
515 touch $(STAGING_DIR)/usr/lib/libfoo.so
516 endef
517
518 define Build/UninstallDev
519 rm -rf \
520 $(STAGING_DIR)/usr/include/foo-header.h \
521 $(STAGING_DIR)/usr/lib/libfoo.{a,so*}
522 endef
523
524 $(eval $(call BuildPackage,foo))
525 \end{verbatim}
526 }
527
528 \section{Getting support}
529 \frame
530 {
531 \frametitle{Getting support}
532 Do not hesisate to contact us via the following ways~:
533 \begin{itemize}
534 \item IRC : irc.freenode.net \#openwrt and \#openwrt-devel
535 \item Mailing-list : openwrt-devel@openwrt.org
536 \item Forum : http://forum.openwrt.org
537 \end{itemize}
538 }
539
540 \section{Becoming a developper}
541
542 \frame
543 {
544 \frametitle{Becoming a developper}
545 \begin{itemize}
546 \item Do not hesitate to submit patches adding packages to the repository
547 \item Do as much test and bugreport as you can
548 \item Port OpenWrt to a new device ...
549 \end{itemize}
550 }
551
552 \frame
553 {
554 \frametitle{Thank you very much}
555 Thank you very much for your attention, question session is now open.
556 }
557
558 \end{document}