3 \usepackage{beamerthemesplit
}
4 \usepackage[latin1]{inputenc}
5 \usepackage[french
]{babel
}
6 \usepackage{pstricks
} % Advanced drawings
7 \usepackage{fancyhdr
} % Headers
12 \title{OpenWrt : fresh air for (wlan) routers
}
14 \author{Florian Fainelli \\
17 \institute{Rencontres Mondiales du Logiciel Libre
2006 \\
18 Vandoeuvre-lès-Nancy\\
21 \date[]{Thursday July
6th
2006}
26 \frame[allowframebreaks
]
32 \section{Introduction
}
33 \subsection{What is OpenWrt
}
36 \frametitle{What is OpenWrt
}
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
45 \subsection{Project history
}
48 \frametitle{Project history
}
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
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.
66 \subsection{State of art
}
69 \frametitle{State of art
}
70 Nowadays, OpenWrt team is composed of
5 main developpers, helped by many contributors :
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)
80 \section{The different versions
}
81 \subsection{Development tools
}
84 \frametitle{Development tools
}
86 \item subversion repository
87 \item Trac web interface : https://dev.openwrt.org
93 \subsection{Subversiion repository organisation
}
94 \frametitle{Subversiion repository organisation
}
95 The subversion repository is divided into several directories :
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/
}
104 \subsection{Whiterussian
}
107 \frametitle{Whiterussian
}
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 :
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
117 It is being used a firmware basis by several Wireless User Groups, and some companies, such as FON(fonbasic firmware).
120 \subsection{Whiterussian limitations
}
123 \frametitle{Whiterussian limitations
}
124 Altough the firmware runs fine, it is currently being limited by :
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
134 \subsection{Kamikaze
}
135 \frame[allowframebreaks
]
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.
140 New hardware platforms were then supported~:
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)
153 \subsection{Kamikaze limitations
}
156 \frametitle{Kamikaze limitations
}
157 Kamikaze has a certain number of drawbacks :
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
165 \subsection{buildroot-ng
}
168 \frametitle{buildroot-ng
}
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
176 \subsection{Main tasks
}
179 \frametitle{Main tasks
}
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
189 \subsection{Interests of OpenWrt
}
192 \frametitle{Interests of OpenWrt
}
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
201 \section{Adding support for a new target
}
202 \subsection{Legal concerns
}
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~:
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 ?
216 \subsection{Proving that a hardare is running Linux
}
219 \frametitle{Proving that a hardare is running Linux
}
220 You have different ways of proving that a hardware is running Linux~:
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
228 \subsection{What if the manufacturer does not provide sources
}
231 \frametitle{GPL violation
}
232 In conformance to the GPL, using GPL codes for commercial products implies the following things :
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
238 In cas of a GPL violation, please inform :
\texttt{http://gpl-violations.org
}
241 \subsection{Working basis
}
244 \frametitle{Working basis
}
245 Your working basis is composed of the following elements :
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 ...
251 You are very likely not to be able to get a functionnal firmware with the manufacturer tools.
253 \subsection{Evaluation of the porting effort
}
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 :
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
266 \subsection{Adding a new architecture to buildroot-ng
}
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~:
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
}
279 \subsection{Conventions
}
282 \frametitle{Conventions
}
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 ...
290 \subsection{target/Config.in
}
291 \frame[containsverbatim
]
293 \frametitle{target/Config.in
}
295 config LINUX_2_6_ARCHITECTURE
296 bool "Architecture foo
[2.6]"
300 select PCMCIA_SUPPORT
306 \subsection{target/linux/architecture-
2.x/Makefile
}
307 \frame[containsverbatim,allowframebreaks
]
309 \frametitle{target/linux/architecture-
2.x/Makefile
}
311 include $(TOPDIR)/rules.mk
313 LINUX_VERSION:=
2.6.16.7
315 LINUX_KERNEL_MD5SUM:=
9682b2bd6e02f3087982d7c3f5ba824e
318 include $(INCLUDE_DIR)/kernel.mk
319 include $(INCLUDE_DIR)/kernel-build.mk
321 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
322 [ -d ../generic-$(KERNEL)/patches
] &&
323 $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches $(MAKE_TRACE)
325 $(PATCH) $(LINUX_DIR) ./patches $(MAKE_TRACE)
326 @$(CP) config $(LINUX_DIR)/.config
331 \subsection{target/image/architecture/Makefile
}
332 \frame[containsverbatim,allowframebreaks
]
334 \frametitle{target/image/architecture/Makefile
}
336 include $(TOPDIR)/rules.mk
337 include $(INCLUDE_DIR)/image.mk
340 rm -f $(KDIR)/loader.gz
341 $(MAKE) -C lzma-loader \
342 BUILD_DIR="$(KDIR)" \
348 $(MAKE) -C lzma-loader clean
351 cat $(KDIR)/vmlinux |
352 $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
355 define Image/Build/hardware
356 dd if=$(KDIR)/loader.elf
357 of=$(BIN_DIR)/openwrt-hardware-$(KERNEL)-$(
2).bin
359 cat $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(
1).trx
360 >> $(BIN_DIR)/openwrt-hardware-$(KERNEL)-$(
2).bin
363 define trxalign/jffs2-
128k
366 define trxalign/jffs2-
64k
369 define trxalign/squashfs
373 $(eval $(call BuildImage))
377 \subsection{include/target.mk
}
378 \frame[containsverbatim
]
380 \frametitle{include/target.mk
}
383 $(eval $(call kernel_template,
2.6,architecture,
389 \subsection{Debuging and stabilising the port
}
393 \frametitle{Debuging and stabilizing
}
394 Common debuging tools :
397 \item EJTAG (si disponible)
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
406 \subsection{Further problems
}
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~:
412 \item drivers working not correctly or not at all
413 \item unrecognized flash mapping
414 \item low reaction system (processor caching)
418 \section{Customizing the system
}
422 \frametitle{Customizing the system
}
423 You can highly customize your system, such as~:
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
}
433 \subsection{Adding packages
}
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.
439 In opposition to the previous system, where you had to create
3 files :
443 \item ipkg/paquetage.control
446 \textbf{buildroot-ng
} describes and abdstracts everything in a
\textbf{Makefile
}.
449 \subsection{Hierarchy
}
452 \frametitle{Hierarchy
}
453 Packages are structured this way :
456 \hspace{10 pt
}\=
\hspace{10 pt
}\=
\hspace{10 pt
}\=
\kill
457 packages/ \> \> \> \\
459 \> \> package-name/ \> \\
465 \subsection{packages/section/Makefile
}
466 \frame[containsverbatim,allowframebreaks
]
468 \frametitle{packages/section/Makefile
}
470 include $(TOPDIR)/rules.mk
473 PKG_VERSION:=alpha-beta-
4
475 PKG_MD5SUM:=
5988e7aeb0ae4dac8d83561265984cc9
477 PKG_SOURCE_URL:=ftp://ftp.openwrt.org/foo
478 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
481 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
482 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
484 include $(INCLUDE_DIR)/package.mk
489 TITLE:=My sample package
490 DESCRIPTION:=My other descriptiong
491 URL:=ftp://ftp.openwrt.org/foo
494 define Build/Configure
495 $(call Build/Configure/Default,--option-foo=bar)
499 rm -rf $(PKG_INSTALL_DIR)
500 mkdir -p $(PKG_INSTALL_DIR)
501 $(MAKE) -C $(PKG_BUILD_DIR) \
502 DESTDIR="$(PKG_INSTALL_DIR)" \
506 define Package/foo/install
507 install -m0755 -d $(
1)/usr/lib
508 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfoo.so.* $(
1)/usr/lib/
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
519 define Build/UninstallDev
521 $(STAGING_DIR)/usr/include/foo-header.h \
522 $(STAGING_DIR)/usr/lib/libfoo.
{a,so*
}
525 $(eval $(call BuildPackage,foo))
529 \section{Getting support
}
532 \frametitle{Getting support
}
533 Do not hesisate to contact us via the following ways~:
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
541 \section{Becoming a developper
}
545 \frametitle{Becoming a developper
}
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 ...
555 \frametitle{Thank you very much
}
556 Thank you very much for your attention, question session is now open.