| [025bc8e] | 1 | \chapter{Introduction}
|
|---|
| 2 |
|
|---|
| 3 | Welcome to FreeWRT! This handbook covers the building, installation and usage
|
|---|
| 4 | aspects of the FreeWRT 1.0 Linux distribution. FreeWRT is a portable, secure
|
|---|
| 5 | and functional Linux distribution for embedded systems. As FreeWRT is a source
|
|---|
| 6 | code distribution, it does not provide any pre-compiled firmware for embedded
|
|---|
| 7 | systems. The latest version of this document is always available at the
|
|---|
| 8 | FreeWRT website. If you have any comments, criticism or found some wrong
|
|---|
| 9 | description, please send us an eMail to freewrt-handbook@freewrt.org, we are
|
|---|
| 10 | always happy about getting feedback to this document, and will try to update
|
|---|
| 11 | or correct the issues mentioned by you.
|
|---|
| 12 |
|
|---|
| 13 | The handbook is split into five distinct sections. Appliance Development Kit
|
|---|
| 14 | covers the building of FreeWRT firmware images. The second section, Installing
|
|---|
| 15 | FreeWRT, covers all aspects regarding the installation and deinstallation of
|
|---|
| 16 | FreeWRT firmware images. The third section is a detailed description of the
|
|---|
| 17 | startup process of FreeWRT. The fourth section, Using FreeWRT, covers
|
|---|
| 18 | administrational tasks, such as network configuration, the FreeWRT
|
|---|
| 19 | configuration filesystem, package management and update mechanism. The last
|
|---|
| 20 | section helps troubleshooting problems and recovering a bad firmware
|
|---|
| 21 | installation. The appendix contains board specific information. For FreeWRT
|
|---|
| 22 | 1.0 these are only Broadcom based embedded systems.
|
|---|
| 23 |
|
|---|
| 24 | The intended audience for this handbook are advanced users with basic
|
|---|
| 25 | knowledge about Linux, networking and software development. The reader should
|
|---|
| 26 | be aware of basic command line tools, the vi editor and a shell. FreeWRT does
|
|---|
| 27 | not contain any high level administration tools (e.g. web based
|
|---|
| 28 | administration) and is fully configured via command line.
|
|---|
| 29 |
|
|---|
| 30 | \section{Typographic Conventions}
|
|---|
| 31 |
|
|---|
| 32 | Examples starting with \# indicate a command that must be invoked as super
|
|---|
| 33 | user. You can use su to gain super user privilges.
|
|---|
| 34 |
|
|---|
| 35 | \begin{Verbatim}
|
|---|
| 36 | # fwcf commit
|
|---|
| 37 | \end{Verbatim}
|
|---|
| 38 |
|
|---|
| 39 | Examples staring with \$ indicate a command that can be invoked as a normal
|
|---|
| 40 | user. The default user account on a freshly installed FreeWRT system is
|
|---|
| 41 | ,,admin''.
|
|---|
| 42 |
|
|---|
| 43 | \begin{Verbatim}
|
|---|
| 44 | $ cat /etc/banner
|
|---|
| 45 | \end{Verbatim}
|
|---|
| 46 |
|
|---|
| 47 | \chapter{Appliance Development Kit (ADK)}
|
|---|
| 48 |
|
|---|
| 49 | Our appliance development kit is called ,,buildroot''. The ADK is the core of
|
|---|
| 50 | FreeWRT and contains all scripts and sources to create firmware images for
|
|---|
| 51 | every supported embedded system. FreeWRT 1.0 supports the following embedded
|
|---|
| 52 | systems:
|
|---|
| 53 |
|
|---|
| 54 | \begin{itemize}
|
|---|
| 55 | \item Asus WL500g
|
|---|
| 56 | \item Asus WL500g deluxe
|
|---|
| 57 | \item Asus WL500g premium
|
|---|
| 58 | \item Linksys WRT54G v1.0
|
|---|
| 59 | \item Linksys WRT54G v1.1
|
|---|
| 60 | \item Linksys WRT54G v2.0
|
|---|
| 61 | \item Linksys WRT54G v2.2
|
|---|
| 62 | \item Linksys WRT54G v3.0
|
|---|
| 63 | \item Linksys WRT54G v3.1
|
|---|
| 64 | \item Linksys WRT54G v4.0
|
|---|
| 65 | \item Linksys WRT54GS v1.0
|
|---|
| 66 | \item Linksys WRT54GS v1.1
|
|---|
| 67 | \item Linksys WRT54GS v4
|
|---|
| 68 | \item Linksys WRT54G3G
|
|---|
| 69 | \item Netgear WGT634u
|
|---|
| 70 | \end{itemize}
|
|---|
| 71 |
|
|---|
| 72 | In this release we only support the Linux 2.4 kernel. The ADK contains over
|
|---|
| 73 | 300 software packages.
|
|---|
| 74 |
|
|---|
| 75 | \section{Prerequisites}
|
|---|
| 76 |
|
|---|
| 77 | Here is a list of all supported and tested host systems. The host system is
|
|---|
| 78 | needed to create a firmware for your embedded system.
|
|---|
| 79 |
|
|---|
| 80 | \begin{itemize}
|
|---|
| 81 | \item Debian GNU/Linux 3.1 or newer
|
|---|
| 82 | \item Gentoo Linux
|
|---|
| 83 | \item Ubuntu Dapper Drake or newer
|
|---|
| 84 | \item Fedora Core 4 or newer
|
|---|
| 85 | \item OpenBSD 3.9 or newer
|
|---|
| 86 | \item MirOS BSD
|
|---|
| 87 | \end{itemize}
|
|---|
| 88 |
|
|---|
| 89 | Please install the following software, which is needed to build a basic
|
|---|
| 90 | firmware image. If you choose more packages some more prerequisites might be
|
|---|
| 91 | needed. Buildroot will warn you about any software you need to install to
|
|---|
| 92 | compile a specific package. Here is a list of the required software:
|
|---|
| 93 |
|
|---|
| 94 | \begin{itemize}
|
|---|
| 95 | \item gcc3 or higher
|
|---|
| 96 | \item g++
|
|---|
| 97 | \item binutils
|
|---|
| 98 | \item patch
|
|---|
| 99 | \item gzip
|
|---|
| 100 | \item bzip2
|
|---|
| 101 | \item unzip
|
|---|
| 102 | \item flex
|
|---|
| 103 | \item bison
|
|---|
| 104 | \item GNU make
|
|---|
| 105 | \item zlib (+headers)
|
|---|
| 106 | \item ncurses (+headers)
|
|---|
| 107 | \item (g)libc headers
|
|---|
| 108 | \item subversion
|
|---|
| 109 | \item perl
|
|---|
| 110 | \end{itemize}
|
|---|
| 111 |
|
|---|
| 112 | The buildroot checks for the required versions of these tools in advance.
|
|---|
| 113 |
|
|---|
| 114 | To build FreeWRT with buildroot it is recommended to have an unprivileged
|
|---|
| 115 | user. Please \underline{never} build FreeWRT as super user. Because all necessary source
|
|---|
| 116 | tarballs are downloaded from the internet automagically, your host system
|
|---|
| 117 | needs a working internet connection.
|
|---|
| 118 |
|
|---|
| 119 | \section{Getting the source}
|
|---|
| 120 |
|
|---|
| 121 | Now go to a directory where you want to build the firmware. Depending on the
|
|---|
| 122 | features you select you will need about 2.5-5 GB free disk space. This
|
|---|
| 123 | includes the buildroot itself, any source archives which will be downloaded
|
|---|
| 124 | and their extracted copies (for compiling).
|
|---|
| 125 |
|
|---|
| 126 | To get the initial FreeWRT 1.0 buildroot try one of these commands:
|
|---|
| 127 | \begin{Verbatim}
|
|---|
| 128 | $ svn co http://www.freewrt.org/svn/branches/freewrt_1_0 freewrt
|
|---|
| 129 | $ svn co svn://www.freewrt.org/branches/freewrt_1_0 freewrt
|
|---|
| 130 | \end{Verbatim}
|
|---|
| 131 |
|
|---|
| 132 | After successfully downloading, enter the directory:
|
|---|
| 133 |
|
|---|
| 134 | \begin{Verbatim}
|
|---|
| 135 | $ cd freewrt
|
|---|
| 136 | \end{Verbatim}
|
|---|
| 137 |
|
|---|
| 138 | This directory will be referred to as the ADK root later on.
|
|---|
| 139 |
|
|---|
| 140 | \section{Some Theory First}
|
|---|
| 141 |
|
|---|
| 142 | Building a FreeWRT firmware image is just like building a new Linux kernel,
|
|---|
| 143 | but a little more complex. There is a ncurses-based configuration menu at the
|
|---|
| 144 | beginning, the changes made are saved into a file named ,,.config'' in the ADK
|
|---|
| 145 | root. The build is done by the various Makefiles, compiling and linking the
|
|---|
| 146 | sources together accordingly to the symbols defined in ,,.config''.
|
|---|
| 147 |
|
|---|
| 148 | Unlike kernel compilation, FreeWRT needs to be cross-compiled always. This
|
|---|
| 149 | leads to special premises, as most of the tools need to be specially build.
|
|---|
| 150 | But no panic, FreeWRT will do this all for you. In fact, this is done at the
|
|---|
| 151 | second run of \texttt{make} (the first one opens the configuration), and
|
|---|
| 152 | therefore can be seen as part of the first firmware build. For clarity
|
|---|
| 153 | though, we will discuss these two things separately.
|
|---|
| 154 |
|
|---|
| 155 | \section{Preparing the Build Process}
|
|---|
| 156 |
|
|---|
| 157 | After downloading the FreeWRT ADK, it's time to prepare the ADK for the
|
|---|
| 158 | building of firmware Images (for explanations see the chapter above).
|
|---|
| 159 |
|
|---|
| 160 | \subsection{Creating A Configuration}
|
|---|
| 161 | The first step is to run \texttt{make}. After checking some prerequisites (see
|
|---|
| 162 | ,,Troubleshooting'' below for aid in problems), a console based configuration
|
|---|
| 163 | menu should start. Theoretically no choices have to be made, but it's proven
|
|---|
| 164 | usefull to at least:
|
|---|
| 165 | \begin{itemize}
|
|---|
| 166 | \item select a target (menu: ,,Embedded System'')
|
|---|
| 167 | \item select the root filesystem type (menu: ,,Target Firmware type'')
|
|---|
| 168 | \end{itemize}
|
|---|
| 169 |
|
|---|
| 170 | Then quit saving changes. If you forgot that, just run \texttt{make} again, redo
|
|---|
| 171 | your changes, then save.
|
|---|
| 172 |
|
|---|
| 173 | \subsection{Building ADK}
|
|---|
| 174 | Now that you have a (first) configuration, it is time to build the toolchain
|
|---|
| 175 | (compiler, libraries) for cross-compiling. To do this, just enter {{{make}}}
|
|---|
| 176 | again. The build starts downloading and compiling each needed part of the
|
|---|
| 177 | toolchain, and later continues with building the first firmware image. Later
|
|---|
| 178 | one can be taken as proof of a working ADK.
|
|---|
| 179 |
|
|---|
| 180 | Already experienced in compiling gcc? Then you know... If not, better be told
|
|---|
| 181 | that it takes \underline{really long} to finish. In the meantime I suggest reading the
|
|---|
| 182 | next (optional) chapter dealing with internals about cross-compiling.
|
|---|
| 183 |
|
|---|
| 184 | \section{Details Of Cross-Compiling}
|
|---|
| 185 |
|
|---|
| 186 | TODO: someone with enough knowledge about this may fill this chapter with
|
|---|
| 187 | \underline{interesting} information!
|
|---|
| 188 |
|
|---|
| 189 | \section{Building A FreeWRT Firmware Image}
|
|---|
| 190 |
|
|---|
| 191 | Ok. Your local copy of the FreeWRT ADK should now be prepared for building
|
|---|
| 192 | images. The next step is to do an extensive configuration for the image you
|
|---|
| 193 | want to create. To start the configuration menu, type {{{make menuconfig}}}.
|
|---|
| 194 |
|
|---|
| 195 | when selecting packages, \texttt{<*>} means it will be inserted into the firmware
|
|---|
| 196 | images and \texttt{<M>} means it will be build as an addon package which can be
|
|---|
| 197 | installed later.
|
|---|
| 198 |
|
|---|
| 199 | The target device and filesystem should already been chosen by you to the
|
|---|
| 200 | right value, if not you will have to issue a \texttt{make clean} before actually
|
|---|
| 201 | building the firmware image, because otherwise things get messed up. (smooth
|
|---|
| 202 | rebuild is a (yet) missing feature in our buildroot.) For the packages, if
|
|---|
| 203 | unsure, you can just select one of the package collections. After that, you
|
|---|
| 204 | can still manually check the choices made by the collection and correct them
|
|---|
| 205 | if appropriate. Do not forget to save your configuration when leaving!
|
|---|
| 206 |
|
|---|
| 207 | Guess ... right, type \texttt{make} again to build the new FreeWRT firmware
|
|---|
| 208 | image. Depending on your package selections and underlying hardware, this will
|
|---|
| 209 | take different amounts of time. For your spare time there is the following
|
|---|
| 210 | chapter giving some explanation about what is done at this point.
|
|---|
| 211 |
|
|---|
| 212 | \section{Firmware Build Process In Detail}
|
|---|
| 213 |
|
|---|
| 214 | Just like when building the ADK's toolchain, the sources for the selected
|
|---|
| 215 | packages are downloaded from the internet first, then build using the
|
|---|
| 216 | cross-compiler and libraries of the ADK.
|
|---|
| 217 |
|
|---|
| 218 | TODO: more to follow by some more skilled people!!
|
|---|
| 219 |
|
|---|
| 220 | \section{Troubleshooting}
|
|---|
| 221 | This section deals with various tips for problems with ADK installation.
|
|---|
| 222 |
|
|---|
| 223 | \subsection{Errors During Prerequisites Check}
|
|---|
| 224 | To re-issue the checks, use ,,make prereq''.
|
|---|
| 225 |
|
|---|
| 226 | \begin{itemize}
|
|---|
| 227 | \item GNU make 3.80 too old
|
|---|
| 228 | On my FC4 buildsystem the first I get is
|
|---|
| 229 | \begin{Verbatim}
|
|---|
| 230 | $ make
|
|---|
| 231 | GNU make 3.80 too old.
|
|---|
| 232 | Please install GNU make 3.81 or higher to continue.
|
|---|
| 233 | You can override this check, see http://www.freewrt.org/faq for details.
|
|---|
| 234 | It is suggested to upgrade your copy of bison to
|
|---|
| 235 | GNU Bison 2.3 because of its bug fixes.
|
|---|
| 236 | make: *** [.prereq_done] Error 1
|
|---|
| 237 | \end{Verbatim}
|
|---|
| 238 |
|
|---|
| 239 | it is quite a nice error that tells me to use more up to date software, but we can
|
|---|
| 240 | anyhow give this hostsystem a try and tell make to ignore those errors/warnings:
|
|---|
| 241 | \begin{Verbatim}
|
|---|
| 242 | make prereq-noerror
|
|---|
| 243 | \end{Verbatim}
|
|---|
| 244 | \end{itemize}
|
|---|