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 (
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)
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 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.
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~:
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 ?
215 \subsection{Proving that a hardare is running Linux
}
218 \frametitle{Proving that a hardare is running Linux
}
219 You have different ways of proving that a hardware is running Linux~:
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
227 \subsection{What if the manufacturer does not provide sources
}
230 \frametitle{GPL violation
}
231 In conformance to the GPL, using GPL codes for commercial products implies the following things :
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
237 In cas of a GPL violation, please inform :
\texttt{http://gpl-violations.org
}
240 \subsection{Working basis
}
243 \frametitle{Working basis
}
244 Your working basis is composed of the following elements :
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 ...
250 You are very likely not to be able to get a functionnal firmware with the manufacturer tools.
252 \subsection{Evaluation of the porting effort
}
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 :
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
265 \subsection{Adding a new architecture to buildroot-ng
}
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~:
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
}
278 \subsection{Conventions
}
281 \frametitle{Conventions
}
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 ...
289 \subsection{target/Config.in
}
290 \frame[containsverbatim
]
292 \frametitle{target/Config.in
}
294 config LINUX_2_6_ARCHITECTURE
295 bool "Architecture foo
[2.6]"
299 select PCMCIA_SUPPORT
305 \subsection{target/linux/architecture-
2.x/Makefile
}
306 \frame[containsverbatim,allowframebreaks
]
308 \frametitle{target/linux/architecture-
2.x/Makefile
}
310 include $(TOPDIR)/rules.mk
312 LINUX_VERSION:=
2.6.16.7
314 LINUX_KERNEL_MD5SUM:=
9682b2bd6e02f3087982d7c3f5ba824e
317 include $(INCLUDE_DIR)/kernel.mk
318 include $(INCLUDE_DIR)/kernel-build.mk
320 $(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
321 [ -d ../generic-$(KERNEL)/patches
] &&
322 $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches $(MAKE_TRACE)
324 $(PATCH) $(LINUX_DIR) ./patches $(MAKE_TRACE)
325 @$(CP) config $(LINUX_DIR)/.config
330 \subsection{target/image/architecture/Makefile
}
331 \frame[containsverbatim,allowframebreaks
]
333 \frametitle{target/image/architecture/Makefile
}
335 include $(TOPDIR)/rules.mk
336 include $(INCLUDE_DIR)/image.mk
339 rm -f $(KDIR)/loader.gz
340 $(MAKE) -C lzma-loader \
341 BUILD_DIR="$(KDIR)" \
347 $(MAKE) -C lzma-loader clean
350 cat $(KDIR)/vmlinux |
351 $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
354 define Image/Build/hardware
355 dd if=$(KDIR)/loader.elf
356 of=$(BIN_DIR)/openwrt-hardware-$(KERNEL)-$(
2).bin
358 cat $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(
1).trx
359 >> $(BIN_DIR)/openwrt-hardware-$(KERNEL)-$(
2).bin
362 define trxalign/jffs2-
128k
365 define trxalign/jffs2-
64k
368 define trxalign/squashfs
372 $(eval $(call BuildImage))
376 \subsection{include/target.mk
}
377 \frame[containsverbatim
]
379 \frametitle{include/target.mk
}
382 $(eval $(call kernel_template,
2.6,architecture,
388 \subsection{Debuging and stabilising the port
}
392 \frametitle{Debuging and stabilizing
}
393 Common debuging tools :
396 \item EJTAG (if available)
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
405 \subsection{Further problems
}
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~:
411 \item drivers working not correctly or not at all
412 \item unrecognized flash mapping
413 \item low reaction system (processor caching)
417 \section{Customizing the system
}
421 \frametitle{Customizing the system
}
422 You can highly customize your system, such as~:
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
}
432 \subsection{Adding packages
}
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.
438 In opposition to the previous system, where you had to create
3 files :
442 \item ipkg/paquetage.control
445 \textbf{buildroot-ng
} describes and abdstracts everything in a
\textbf{Makefile
}.
448 \subsection{Hierarchy
}
451 \frametitle{Hierarchy
}
452 Packages are structured this way :
455 \hspace{10 pt
}\=
\hspace{10 pt
}\=
\hspace{10 pt
}\=
\kill
456 packages/ \> \> \> \\
458 \> \> package-name/ \> \\
464 \subsection{packages/section/Makefile
}
465 \frame[containsverbatim,allowframebreaks
]
467 \frametitle{packages/section/Makefile
}
469 include $(TOPDIR)/rules.mk
472 PKG_VERSION:=alpha-beta-
4
474 PKG_MD5SUM:=
5988e7aeb0ae4dac8d83561265984cc9
476 PKG_SOURCE_URL:=ftp://ftp.openwrt.org/foo
477 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
480 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
481 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
483 include $(INCLUDE_DIR)/package.mk
488 TITLE:=My sample package
489 DESCRIPTION:=My other descriptiong
490 URL:=ftp://ftp.openwrt.org/foo
493 define Build/Configure
494 $(call Build/Configure/Default,--option-foo=bar)
498 rm -rf $(PKG_INSTALL_DIR)
499 mkdir -p $(PKG_INSTALL_DIR)
500 $(MAKE) -C $(PKG_BUILD_DIR) \
501 DESTDIR="$(PKG_INSTALL_DIR)" \
505 define Package/foo/install
506 install -m0755 -d $(
1)/usr/lib
507 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfoo.so.* $(
1)/usr/lib/
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
518 define Build/UninstallDev
520 $(STAGING_DIR)/usr/include/foo-header.h \
521 $(STAGING_DIR)/usr/lib/libfoo.
{a,so*
}
524 $(eval $(call BuildPackage,foo))
528 \section{Getting support
}
531 \frametitle{Getting support
}
532 Do not hesisate to contact us via the following ways~:
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
540 \section{Becoming a developper
}
544 \frametitle{Becoming a developper
}
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 ...
554 \frametitle{Thank you very much
}
555 Thank you very much for your attention, question session is now open.