Changeset cd78f74 in freewrt for docs


Ignore:
Timestamp:
Jan 24, 2007, 8:45:40 AM (19 years ago)
Author:
Waldemar Brodkorb <wbx@…>
Branches:
freewrt_1_0, freewrt_2_0
Children:
7d6779bf
Parents:
9ba8799
Message:

add sections about fwcf, startup scripts and ipkg

git-svn-id: svn://www.freewrt.org/branches/freewrt_1_0@1741 afb5a338-a214-0410-bd46-81f09a774fd1

Location:
docs/handbook/user
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • docs/handbook/user/00-allinone.tex

    r9ba8799 rcd78f74  
    309309The FreeWRT ADK produces a single image holding both kernel and root
    310310filesystem. This image can be written into your hardware's builtin flash memory
    311 on serveral ways (ordered by needed skillz, increasing downwards):
     311on serveral ways (ordered by needed skills, increasing downwards):
    312312\begin{itemize} % TODO: insert \ref's to jump to the appropriate section?
    313313\item via the original firmware's web interface
     
    323323guide should fit more or less fine for other systems, too.
    324324
     325If you flash a router from Linksys, we strongly suggest to use the popular
     326\textbf{ping exploit} to allow recovery, if your image is broken or the flash
     327process was interrupted by a power shortage.
     328
    325329There are some things that you should have done previously:
    326330\begin{itemize}
     331\item read the special documentation page about your hardware in our wiki, some
     332      systems need special precaution before flashing
    327333\item a firmware image has to be built (matching the used hardware, of course)
    328334\item the router has to be powered on
     
    345351Finally click \textit{Upload}. As the whole process of writing the image to
    346352flash and rebooting (don't forget that it creates ssh hostkeys on first boot)
    347 takes quite long, better go and get coffee.
    348 
    349 When everything went good, you can login using ssh.
     353takes quite long, better go and get a coffee or tea.
     354
     355When everything went good, you can login using ssh. The default username is
     356\dq{}admin\dq{}. The default password for images created via WIB or ADK is
     357\dq{}FreeWRT\dq{}. It is possible to change this password in the ADK, before image
     358creation.
    350359
    351360\subsection{\texttt{mtd} -- The Flash Utility}
     361
    352362For this method to work, you need to copy the file containing the firmware
    353 image to the router, preferably into /tmp (the tmpfs should be big enough to
    354 hold the full image). Then the image is written to flash using
     363image to the router, preferably into /tmp, the memory filesystem should be
     364big enough to hold the full image. If not, use wget to get the image
     365via http or ftp and pipe the result into \texttt{mtd}.
     366
     367Then the image is written to flash using
    355368\texttt{mtd}, optionally giving additional options (see below).
    356369
     
    370383        in use
    371384\end{description}
    372 further it can request your system to reboot. Some of the features mentioned here can
     385
     386Further it can request your system to reboot. Some of the features mentioned here can
    373387also be combined, so it is e.g. possible to immediately reboot the system after
    374388the flash has been written.
     
    377391done to write the firmware to flash:
    378392\begin{Verbatim}
    379 # mtd -e linux -r write freewrt.bin linux
     393# mtd -e linux -r write freewrt.bin linux &
     394\end{Verbatim}
     395Or via wget pipe:
     396\begin{Verbatim}
     397# wget -O - http://www.yourserver.com/freewrt.bin | mtd -e linux -r write - linux &
    380398\end{Verbatim}
    381399The parameters explained in detail: \\
     
    385403write & write the firmware image contained in the file given as next parameter
    386404                        to flash\\
    387 linux.trx & the actual image to write - ignore the suffix, it is detected at
     405freewrt.bin & the actual image to write - ignore the suffix, it is detected at
    388406                                runtime\\
    389407linux & this is an abstract identifier for a certain partition in flash, so
    390408don't change this\\
     409\& & put the process into background, to prevent accidentally stopping\\
    391410\end{tabular}
    392411
    393412\subsection{Installation using TFTP}
    394 All supported target devices are shipped with a builtin firmware, comparable to
    395 the BIOS of x86--machines. This firmware is used to bootstrap the system until
    396 it can boot a regular operating system. Besides the (obvious) ability to load
     413
     414All supported target devices are shipped with a builtin bootloader, comparable to
     415the BIOS of x86--machines. This bootloader is used to bootstrap the system until
     416it can boot a regular operating system. Besides the ability to load
    397417the executable code from flash, it can be received from another node in the
    398418local area network via the famous TFTP protocol.
     
    405425any TFTP client to connect and send the file
    406426\end{itemize}
    407 All the hardware supported by FreeWRT-1.0 uses the second method. % TODO: righty?
    408 Though this may be a little confusing to people being familiar with netboot
    409 technologies, it is definitely the easier way of doing it. Otherwise one had to
    410 setup both DHCP and TFTP servers and configure them right.
     427
     428Most of the hardware supported by FreeWRT 1.0 uses the second method.  Only the
     429device Netgear WGT634u is using the first method, the bootloader provides a
     430DHCP/TFTP client. Though this may be a little confusing to people being familiar
     431with netboot technologies, it is definitely the easier way of doing it. Otherwise
     432one had to setup both DHCP and TFTP servers and configure them right.
    411433
    412434The even quite simple task of sending the flash image to the target device is
     
    430452\textbf{Target Device} & \textbf{Action to be taken} & \textbf{Comments} \\
    431453\hline
    432 \ldots & \ldots & \ldots \\
     454All supported Linksys models & Ping Exploit & nvram variable boot\_wait needs to be on \\
     455All supported Asus models & Recovery mode & power off, push and hold the
     456reset button, power on, power led is flashing\\
    433457\end{tabular}\end{center}
    434458
    435459\chapter{FreeWRT Administration}
     460
    436461After the FreeWRT firmware image has been built by the ADK and later flashed
    437 onto the hardware, the resulting operating system has to be aministrated. This
     462onto the hardware, the resulting operating system has to be configured. This
    438463section provides the necessary information to do that, including tips and
    439464guides for using FreeWRT in general, of course.
    440465
    441466\section{Network Configuration}
     467
    442468The device names for real network interfaces in Linux are named ethx (x is
    4434690-9). If the device has a switch, the different ports are separated via VLAN
     
    469495Each interface needs a unique name which, depending on the method, represents
    470496either a physical interface or a logical interface name like "eth0.1" for a
    471 physical VLAN or "umts" as a logical name for a ppp interface.
     497physical VLAN or "umts" as a logical name for a PPP interface.
    472498
    473499Possible methods are:
     
    536562
    537563\subsection{Bridging}
    538 This is mostly needed to combine LAN and WLAN to a homogeneous network like:
     564
     565This is mostly needed to combine LAN and WLAN to a homogeneous network.
     566Be sure you have installed the package \texttt{bridge-utils}.
     567
    539568\begin{Verbatim}[label=/etc/network/interfaces]
    540569auto eth0.0
     
    552581    netmask 255.255.255.0
    553582\end{Verbatim}
     583
    554584This creates a new bridging interface \texttt{br0} which combines the VLAN
    555 interface \texttt{eth0.0} (representing the LAN-ports 1-4) and the WLAN
    556 interface \texttt{eth1} (on some devices like Asus WL500g or Linksys WRT54G
    557 v1.1 this might be \texttt{eth2}).
     585interface \texttt{eth0.0} (representing the LAN-ports 1-4) and the WLAN interface
     586\texttt{eth1} (on some devices like Asus WL500gP this might be \texttt{eth2}).
    558587
    559588\subsection{WLAN}
    560589A router containing a WLAN interface has an additional ethernet device
    561590representing it. On Broadcom-based hardware it is typically \texttt{eth1}
    562 (Linksys) or \texttt{eth2} (Asus) (in the current driver version), on Madwifi
    563 devices it is \texttt{ath0}, \texttt{ath1}, etc. You can use these interfaces
     591(Linksys),\texttt{eth2} (Asus WL500gP) or on Netgear WGT634u which has a Madwifi
     592WLAN chip, it is \texttt{ath0}, \texttt{ath1}, etc. You can use these interfaces
    564593standalone or bridged with other devices, e.g. the internal LAN.
    565594
     
    776805
    777806\subsection{PPP}
     807
    778808PPP comes in various flavours for different situations, the most commonly
    779809needed will likely be DSL and for WRT54G3G users UMTS. So there exists a
    780810hook-script that evaluates a "use-template" option and generates a ppp-peer.
    781811This way everything needed so far can be configured within the
    782 \texttt{interfaces} file.
     812\texttt{interfaces} file. Be sure you have installed the packages
     813\texttt{kmod-ppp}, \texttt{ppp} and \texttt{ppp-mod-pppoe}.
    783814
    784815\subsubsection{DSL}
     
    824855installed, this is a small daemon that monitors the UMTS-button of the router
    825856and executes \texttt{ifup umts} or \texttt{ifdown umts} on a button press.
    826 You have to set \texttt{watchdog=YES} in /etc/rc.conf to have it start automatically.
     857You have to set \texttt{watchbutton=YES} in /etc/rc.conf to have it start automatically.
    827858
    828859This is totally independent from the \texttt{auto umts} setting. Even if you
     
    860891Same semantics as above.
    861892
    862 \section{Troubleshooting}
    863 
    864 \subsection{Failsafe Mode}
     893\section{FWCF - FreeWRT Configuration Filesystem}
     894
     895FWCF is a separate flash partition for all changes made to the /etc directory.
     896There is a small tool named \texttt{fwcf}, which is used to setup the system or
     897to commit changes to the fwcf partition.
     898
     899On bootup the script \texttt{/sbin/mount\_root} is executed, which calls \dq{}fwcf
     900setup\dq{} to setup /etc as memory filesystem and overlay the changes committet
     901to the fwcf partition.
     902
     903If you change anything in /etc and like to keep the change, it is required to
     904execute \dq{}fwcf commit\dq{}. This will compress all changed or new files in /etc
     905and write the result into the fwcf partition.  The fwcf partition is 128 Kb in
     906size. This size is not changeable at the moment.
     907
     908If you need more detailed information, please read the specification of FWCF,
     909which can be found
     910here\ref{http://www.freewrt.org/trac/wiki/Documentation/Specs/FwCf}
     911
     912If you want to remove all your changes and start your configuration from scratch,
     913use \dq{}fwcf erase\dq{}. This is also required if you switch between compression
     914plugins. Right now LZO plugin is default. 
     915
     916\section{IPKG - Packagemanagement}
     917
     918All software for FreeWRT is available as a IPKG package. IPKG is a package manager
     919very similar to Debian's dpkg/apt-get utilities. It is specially designed for
     920embedded systems and is widely used. The FreeWRT project use a special version,
     921which is embedded to the busybox binary. Normally the command line tool
     922\texttt{ipkg} is pre-installed.
     923
     924IPKG uses a configuration file similar to /etc/apt/sources.list, which
     925contains a list of software repositories available via HTTP or FTP.
     926The configuration file \texttt{/etc/ipkg.conf} contains the official
     927FreeWRT 1.0 repository for your board and kernel version.
     928
     929To update the list of available packages execute following command as root:
     930\begin{verbatim}
     931# ipkg update
     932\end{verbatim}
     933
     934This command requires a working internet connection, because it will fetch a
     935package list from every repository declared in /etc/ipkg.conf.
     936
     937To install a new package use following command:
     938\begin{verbatim}
     939# ipkg install tcpdump
     940\end{verbatim}
     941
     942This will install the package tcpdump and all dependencies onto the flash.
     943Where the data is saved depends on the root filesystem you decided to use while
     944installing FreeWRT. If you use jffs2 as root filesystem, then the package is
     945installed on the big linux partition. If you use squashfs-overlay, then the
     946package is installed on the mini-fo overlay filesystem which writes its data
     947to the jffs2 data partition. If you use a squashfs-symlinks filesystem, then the
     948package data is directly install into the jffs2 data partition, containing
     949symlinks to the read-only squashfs partition.
     950
     951You can also remove packages, but this is only useful if you are using JFFS2
     952as root filesystem:
     953\begin{verbatim}
     954# ipkg remove tcpdump
     955\end{verbatim}
     956
     957This will not remove any dependencies, installed earlier. For example, libpcap
     958is still installed after executing this command.
     959On jffs2 root filesystem you should never remove any essential packages like
     960busybox, fwcf or uclibc, otherwise you make the embedded system unusable.
     961
     962Nearly the same as for removing packages, counts for ipkg upgrade.  Please
     963\textbf{never ever} use ipkg upgrade to update your embedded system.  This command
     964is only useful to upgrade single packages on a jffs2 rootfilesystem or data
     965partition.
     966
     967\section{Startup scripts}
     968
     969Some of the available packages containing software which start services at boot
     970time. For that we provide simple startup scripts, which are installed into the
     971directory \texttt{/etc/init.d}. See following example for
     972the package \texttt{dnsmasq}, a combined dns and dhcp
     973server daemon:
     974
     975\begin{verbatim}
     976#!/bin/sh
     977
     978. /etc/rc.conf
     979
     980case $1 in
     981autostart)
     982        test x"${dns_dhcp:-NO}" = x"NO" && exit 0
     983        exec $0 start
     984        ;;
     985start)
     986        [ -f /etc/dnsmasq.conf ] || exit
     987        /usr/sbin/dnsmasq
     988        ;;
     989stop)
     990        killall dnsmasq
     991        ;;
     992restart)
     993        $0 stop
     994        $0 start
     995        ;;
     996*)
     997        echo "Usage: $0 {start | stop | restart}"
     998        ;;
     999esac
     1000exit 0
     1001\end{verbatim}
     1002
     1003After installation the package postinst script will add all needed changes to the
     1004/etc directory. For example packages can add new user and groups, add new
     1005variables to /etc/rc.conf or just add new values to existing files as
     1006/etc/services. It is FreeWRT policy to do not start any services after
     1007installation or in case of a new boot. To start services on bootup you need to set
     1008\$servicename=YES in /etc/rc.conf and commit your changes via \dq{}fwcf
     1009commit\dq{}. For every policy exist a exception, we start all essential services
     1010by default, like ssh daemon, syslog and network initialisation.
     1011
     1012For some services you can control the startup behavior by modifying
     1013the services\_flags variable in /etc/rc.conf.
     1014
     1015For example the variable \$ssh\_opts is provided as argument to the dropbear
     1016ssh daemon to control its behavior.
     1017
     1018Having this policy helps you to configure your FreeWRT embedded system without
     1019shooting yourself in the foot. For example if you try to realize a firewall system
     1020and trying to set the rules in /etc/firewall.user, which is read by
     1021/etc/init.d/S45firewall, if the iptables package is installed. You can just
     1022reload the changed ruleset via /etc/init.d/S45firewall restart. If you managed
     1023to kick you out of the system, you can just reboot the system and you gain access
     1024again. As soon as your are ready with the firewall configuration and you decide
     1025to activate the firewall rules on bootup, you set \$firewall=YES in /etc/rc.conf,
     1026commit your changes via \dq{}fwcf commit\dq{} and reboot. Now the firewall
     1027rules will be activated on bootup.
     1028
     1029
     1030\chapter{Troubleshooting}
     1031
     1032\section{Failsafe Mode}
    8651033
    8661034Failsafe mode is very useful if you misconfigured your embedded system,
     
    8751043you get straight access (without depending on the installed SSH--daemon).
    8761044
    877 \subsubsection{How It Works}
     1045\subsection{How It Works}
    8781046
    8791047To get FreeWRT into failsafe mode you need physical access to the device and
     
    8901058For some operating systems we provide ready to go binaries of failsafe.
    8911059Take a look at http://www.freewrt.org/downloads/tools/failsafe
    892 % TODO: \ref fuer link
    8931060
    8941061The tool just opens a network socket and waits for a special UDP packet
     
    8961063recognized network interface (eth0).
    8971064
    898 \subsubsection{Enabling Failsafe Mode}
     1065\subsection{Enabling Failsafe Mode}
    8991066
    9001067Connect your computer to the embedded system via direct or crossed network
     
    9311098\end{Verbatim}
    9321099
    933 \subsubsection{Repairing Your FreeWRT Configuration}
     1100\subsection{Repairing Your FreeWRT Configuration}
    9341101
    9351102If you want to repair your configuration, you first need to
     
    9621129You can either use "reboot -f" or "-r" for mtd to reboot the system.
    9631130
     1131\section{Serial Console}
     1132
     1133\section{JTAG}
  • docs/handbook/user/cover.tex

    r9ba8799 rcd78f74  
    1818\\
    1919\rightline{%
    20 Revision 1.0}
     20Revision 1.0.1}
    2121\\
    2222\rightline{%
Note: See TracChangeset for help on using the changeset viewer.