summaryrefslogtreecommitdiffstats
path: root/rmll2006/presentation_en.tex
blob: a799623f693bccbfc3500a0865c273607bbcab22 (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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
\documentclass{beamer}

\usepackage{beamerthemesplit}
\usepackage[latin1]{inputenc}
\usepackage[french]{babel}
\usepackage{pstricks}               	% Advanced drawings
\usepackage{fancyhdr}               	% Headers
\usepackage{epsf}
\usepackage{graphicx}
\usepackage{fancyhdr}

\title{OpenWrt : fresh air for (wlan) routers}

\author{Florian Fainelli \\
florian@openwrt.org}

\institute{Rencontres Mondiales du Logiciel Libre 2006 \\
Vandoeuvre-lès-Nancy\\
Lenght : 30 minutes}

\date[]{Thursday July 6th 2006}

\begin{document}

\frame{\titlepage}
\frame[allowframebreaks]
{
\frametitle{Summary}
\tableofcontents
}

\section{Introduction}
\subsection{What is OpenWrt}
\frame
{
\frametitle{What is OpenWrt}
\begin{itemize}
\item contraction of Opensource Wireless Technology
\item minimalist GNU/Linux distribution GPL licensed
\item set of Makefile providing the building of a full filesystem
\item package and updates repository
\end{itemize}
}

\subsection{Project history}
\frame
{
\frametitle{Project history}
\begin{itemize}
\item OpenWrt was created  by Gerry Rozeman (aka Groz) and Mike Baker (aka [mbm]) in november 2003.
\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.
\item The philosophy is simple : everything is configured in commmand-line using SSH
\end{itemize}
}

\subsection{Context}
\frame
{
\frametitle{Context}
\begin{itemize}
\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.
\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.
\end{itemize}
}

\subsection{State of art}
\frame
{
\frametitle{State of art}
Nowadays, OpenWrt team is composed of 5 main developpers, helped by many contributors :
\begin{itemize}
\item Mike Baker ([mbm])
\item Imre Kaloz (Kaloz)
\item Nicolas Thill (Nico)
\item Felix Fietkau (nbd)
\item Florian Fainelli (florian)
\end{itemize}
}

\section{The different versions}
\subsection{Development tools}
\frame
{
\frametitle{Development tools}
\begin{itemize}
\item subversion repository
\item Trac web interface : https://dev.openwrt.org
\end{itemize}
}

\frame
{
\subsection{Subversiion repository organisation}
\frametitle{Subversiion repository organisation}
The subversion repository is divided into several directories :
\begin{itemize}
\item 2 branches : \textbf{whiterussian/} and \textbf{buildroot-ng/}
\item 5 tags : whiterussian\_rc1 to 5
\item 1 packages directory : \textbf{packages/}
\item kamikaze in trunk (currently being migrated to \textbf{buildroot-ng/} and \textbf{packages/}
\end{itemize}
}

\subsection{Whiterussian}
\frame
{
\frametitle{Whiterussian}

Whiterussian is currently the stable version of the OpenWrt firmware. It runs fine on devices based on Broadcom 947xx and 953xx boards, such as :
\begin{itemize}
\item Linksys WRT54G v1.0 to v4
\item Asus WL-500g (Deluxe, Premium)
\item Motorola WR850G, WE500G
\item Buffalo WBR-B11, WBR-G54, WLA-G54
\end{itemize}

It is being used a firmware basis by several Wireless User Groups, and some companies, such as FON(fonbasic firmware).
}

\subsection{Whiterussian limitations}
\frame
{
\frametitle{Whiterussian limitations}
Altough the firmware runs fine, it is currently being limited by :

\begin{itemize}
\item the usage of a binary Broadcom Wi-Fi driver, thus restricting to a 2.4 kernel
\item the difficulty to maintain and port packages
\item the hardware support limited to Broadcom 47xx/53xx boards
\item a web interface too much relying on the existence of a NVRAM
\end{itemize}
}

\subsection{Kamikaze}
\frame[allowframebreaks]
{
\frametitle{Kamikaze}
As a consequence to these difficulties, and the more and more increasing market of Linux-based hardware, the \textbf{Kamikaze} branch was opened.

New hardware platforms were then supported~:
\begin{itemize}
\item Texas Instruments AR7 (2.4 kernel)
\item Atheros AR531x (2.4 kernel)
\item Aruba (2.6 kernel)
\item x86 (2.4 and 2.6 kernels)
\item Broadcom SiByte (2.6 kernel)
\item AMD Alchemy (2.6 kernel)
\item Intel Xscale IXP42x (2.6 kernel)
\item Router Board RB532 (2.6 kernel)
\end{itemize}
}

\subsection{Kamikaze limitations}
\frame
{
\frametitle{Kamikaze limitations}
Kamikaze has a certain number of drawbacks :
\begin{itemize}
\item difficulty in stabilising the kernels, most of the hardware platforms are not fully functionnal (Wi-Fi is not working most of the time)
\item adding and maintaining packages is too close to the whiterussian way
\item maintaining 2 distinct repository using different toolchains
\end{itemize}
}

\subsection{buildroot-ng}
\frame
{
\frametitle{buildroot-ng}
\begin{itemize}
\item ease and abstraction of the \textbf{Makefile} writing with compatibility with the previous syntax
\item kernel dependent packages go in \textbf{buildroot-ng}, others in \textbf{packages/}
\item multi-architecture repository independent from the base-system.
\end{itemize}
}

\subsection{Main tasks}
\frame
{
\frametitle{Main tasks}
\begin{itemize}
\item Finish \textbf{buildroot-ng}
\item Porting AR7-2.4 to AR7-2.6
\item Porting Broadcom 63xx 2.6
\item Rewriting \textbf{webif}
\item Rewrite of the user documentation
\end{itemize}
}

\subsection{Interests of OpenWrt}
\frame
{
\frametitle{Interests of OpenWrt}
\begin{itemize}
\item fully customizable system from kernel to filesystem
\item strictly identical firware independently from the platform runned on
\item vendor version independent
\item fully GPL code
\end{itemize}
}

\section{Adding support for a new target}
\subsection{Legal concerns}
\frame
{
\frametitle{Legal concerns}
Some legal concerns are raised when you know a hardware is running Linux~:
\begin{itemize}
\item does the manufacturer provide the firmware source code ?
\item does this hardware use binary drivers ?
\item are we sure it is Linux or uClinux ?
\item is the GPL code compliant with GPL or compatible ?
\end{itemize}
}

\subsection{Proving that a hardare is running Linux}
\frame
{
\frametitle{Proving that a hardare is running Linux}
You have different ways of proving that a hardware is running Linux~:
\begin{itemize}
\item downloading a firmware and trying to split it in : bootloader, kernel, filesystem (beware of the Big/Little Endian traps !)
\item pluging a serial console and/or JTAG
\item using a bug in the web interface to get the result of a dmes, cat /proc/xxxx
\end{itemize}
}

\subsection{What if the manufacturer does not provide sources}
\frame
{
\frametitle{GPL violation}
In conformance to the GPL, using GPL codes for commercial products implies the following things :
\begin{itemize}
\item publishing kernel sources
\item publishing source code of the GPL applications used in the filesystem
\item publishing sources of the GNU toolchain and the filesystem creation tools
\end{itemize}
In cas of a GPL violation, please inform : \texttt{http://gpl-violations.org}
}

\subsection{Working basis}
\frame
{
\frametitle{Working basis}
Your working basis is composed of the following elements :
\begin{itemize}
\item Linux kernel sources, modified to support the hardware, with the latest patches for your architecture (arm, mipsm ppc ...)
\item binary drivers and firmwares for the Wi-Fi card, Ethernet, ADSL ...
\item binary tools to create the firmware : CRC calculation, version, padding ...
\end{itemize}
You are very likely not to be able to get a functionnal firmware with the manufacturer tools.
}
\subsection{Evaluation of the porting effort}
\frame
{
\frametitle{Evaluation of the porting effort}
According to what we have, to get a working port for the architecture with OpenWrt and being GPL compliant, we have to :
\begin{itemize}
\item analyse and generate differences between a vanilla kernel and the given one
\item create a program adding the corect header in the firmware file (CRC calculation, version, padding ...)
\item keep compatibily with the binary drivers and the current kernel version (beware of the VERSIONING option)
\item eventually reverse engineer the binary drivers
\end{itemize}
}

\subsection{Adding a new architecture to buildroot-ng}
\frame
{
\frametitle{Adding a new architecture to buildroot-ng}
Now that we have the requirements for having an OpenWrt system for our arhictecture, let's add it~:
\begin{itemize}
\item add and entry in \textbf{target/Config.in}
\item add a directory \textbf{target/linux/architecture-2.x} (2.4 or 2.6 kernel) containing the arch-specific patches and kernel configuration
\item add a directory \textbf{target/image/architecture} describing how to build the firmware image
\item calling the kernel template in \textbf{include/target.mk}
\end{itemize}
}

\subsection{Conventions}
\frame
{
\frametitle{Conventions}
\begin{itemize}
\item Architecture naming must respect the kernel naming in \textbf{arch/}
\item We recommend you get a vanilla kernel booting, rather than changing the filesystem
\item Please separate patches as much as possible : architecture, drivers, various patches  ...
\end{itemize}
}

\subsection{target/Config.in}
\frame[containsverbatim]
{
\frametitle{target/Config.in}
\begin{verbatim}
config LINUX_2_6_ARCHITECTURE
        bool "Architecture foo [2.6]"
        select mips	
        select LINUX_2_6
        select PCI_SUPPORT
        select PCMCIA_SUPPORT
        help
          A short description
\end{verbatim}
}

\subsection{target/linux/architecture-2.x/Makefile}
\frame[containsverbatim,allowframebreaks]
{
\frametitle{target/linux/architecture-2.x/Makefile}
\begin{verbatim}
include $(TOPDIR)/rules.mk

LINUX_VERSION:=2.6.16.7
LINUX_RELEASE:=1
LINUX_KERNEL_MD5SUM:=9682b2bd6e02f3087982d7c3f5ba824e

include ./config
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/kernel-build.mk

$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
        [ -d ../generic-$(KERNEL)/patches ] && 
$(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches $(MAKE_TRACE)
        [ -d ./patches ] && 
$(PATCH) $(LINUX_DIR) ./patches $(MAKE_TRACE)
        @$(CP) config $(LINUX_DIR)/.config
        touch $@
\end{verbatim}
}

\subsection{target/image/architecture/Makefile}
\frame[containsverbatim,allowframebreaks]
{
\frametitle{target/image/architecture/Makefile}
\begin{verbatim}
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk

define Build/Compile
        rm -f $(KDIR)/loader.gz
        $(MAKE) -C lzma-loader \
                BUILD_DIR="$(KDIR)" \
                TARGET="$(KDIR)" \
                install
endef

define Build/Clean
        $(MAKE) -C lzma-loader clean
endef
define Image/Prepare
        cat $(KDIR)/vmlinux | 
$(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
endef

define Image/Build/hardware
        dd if=$(KDIR)/loader.elf 
of=$(BIN_DIR)/openwrt-hardware-$(KERNEL)-$(2).bin 
bs=131072 conv=sync
        cat $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).trx 
>> $(BIN_DIR)/openwrt-hardware-$(KERNEL)-$(2).bin
endef

define trxalign/jffs2-128k
-a 0x20000
endef
define trxalign/jffs2-64k
-a 0x10000
endef
define trxalign/squashfs
-a 1024
endef

$(eval $(call BuildImage))
\end{verbatim}
}

\subsection{include/target.mk}
\frame[containsverbatim]
{
\frametitle{include/target.mk}
\begin{verbatim}
...
$(eval $(call kernel_template,2.6,architecture,
	2_6_ARCHITECTURE))
...
\end{verbatim}
}

\subsection{Debuging and stabilising the port}

\frame
{
\frametitle{Debuging and stabilizing}
Common debuging tools :
\begin{itemize}
\item GDB
\item EJTAG (if available)
\item ksymoops
\item usage of printk
\item debug options enabled in the kernel
\item bootloader documentation (RedBoot, CFE, YAMON, RomE ...)
\item asking for help of users and developpers
\end{itemize}
}

\subsection{Further problems}
\frame
{
\frametitle{Further problems}
Once you get a kernel booting on your hardware, it is very likely not to be directly usage, you may encounter the following issues~:
\begin{itemize}
\item drivers working not correctly or not at all
\item unrecognized flash mapping
\item low reaction system (processor caching)
\end{itemize}
}

\section{Customizing the system}

\frame
{
\frametitle{Customizing the system}
You can highly customize your system, such as~:
\begin{itemize}
\item adding a captive portal, RADIUS server
\item doing advanced filtering using iptables
\item adding network stacks and protocols ...
\item adding drivers for various hadware : webcam, additionnal Wi-Fi stick ...
\item adding features to \textbf{webif} 
\end{itemize}
}

\subsection{Adding packages}
\frame
{
\frametitle{Adding packages}
We invite you to participate to the migrating effort of the packages in \textbf{kamikaze} and make them use the \textbf{buildroot-ng} syntax.

In opposition to the previous system, where you had to create 3 files :
\begin{itemize}
\item Makefile
\item Config.in
\item ipkg/paquetage.control
\end{itemize}

\textbf{buildroot-ng} describes and abdstracts everything in a \textbf{Makefile}.
}

\subsection{Hierarchy}
\frame
{
\frametitle{Hierarchy}
Packages are structured this way :

\begin{tabbing}
\hspace{10 pt}\=\hspace{10 pt}\=\hspace{10 pt}\=\kill
packages/ \>  \>  \> \\ 
 \>  section/ \>  \> \\ 
 \>  \> package-name/ \> \\ 
 \>  \>  \> Makefile \\
 \>  \>  \> patches/
\end{tabbing} 
}

\subsection{packages/section/Makefile}
\frame[containsverbatim,allowframebreaks]
{
\frametitle{packages/section/Makefile}
\begin{verbatim}
include $(TOPDIR)/rules.mk

PKG_NAME:=foo
PKG_VERSION:=alpha-beta-4
PKG_RELEASE:=1
PKG_MD5SUM:=5988e7aeb0ae4dac8d83561265984cc9

PKG_SOURCE_URL:=ftp://ftp.openwrt.org/foo
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_CAT:=zcat

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install

include $(INCLUDE_DIR)/package.mk

define Package/foo
SECTION:=libs
CATEGORY:=Libraries
TITLE:=My sample package
DESCRIPTION:=My other descriptiong
URL:=ftp://ftp.openwrt.org/foo
endef

define Build/Configure
$(call Build/Configure/Default,--option-foo=bar)
endef

define Build/Compile
        rm -rf $(PKG_INSTALL_DIR)
        mkdir -p $(PKG_INSTALL_DIR)
        $(MAKE) -C $(PKG_BUILD_DIR) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                all install
endef

define Package/foo/install
        install -m0755 -d $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfoo.so.* $(1)/usr/lib/
endef

define Build/InstallDev
        mkdir -p $(STAGING_DIR)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/foo-header.h $(STAGING_DIR)/usr/include/
        mkdir -p $(STAGING_DIR)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfoo.{a,so*} $(STAGING_DIR)/usr/lib/
        touch $(STAGING_DIR)/usr/lib/libfoo.so
endef

define Build/UninstallDev
        rm -rf \
          $(STAGING_DIR)/usr/include/foo-header.h \
          $(STAGING_DIR)/usr/lib/libfoo.{a,so*}
endef

$(eval $(call BuildPackage,foo))
\end{verbatim}
}

\section{Getting support}
\frame
{
\frametitle{Getting support}
Do not hesisate to contact us via the following ways~:
\begin{itemize}
\item IRC : irc.freenode.net \#openwrt and \#openwrt-devel
\item Mailing-list : openwrt-devel@openwrt.org
\item Forum : http://forum.openwrt.org
\end{itemize}
}

\section{Becoming a developper}

\frame
{
\frametitle{Becoming a developper}
\begin{itemize}
\item Do not hesitate to submit patches adding packages to the repository
\item Do as much test and bugreport as you can
\item Port OpenWrt to a new device ...
\end{itemize}
}

\frame
{
\frametitle{Thank you very much}
Thank you very much for your attention, question session is now open.
}

\end{document}