User Tools

Site Tools


doc:howto:generic.flashing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:howto:generic.flashing [2013/04/18 13:47]
70d7a4f46 checklist added
doc:howto:generic.flashing [2016/01/24 18:43] (current)
tmomas Link mit inbox:netboot geändert zu inbox:howto:netboot
Line 1: Line 1:
 +====== Installing OpenWrt ======
 +The installation of OpenWrt is device specific.
 +These device specific procedures should be found in the wiki. See [[toh:​start|Table of Hardware]] for available procedures. If your device is not listed, information in this Howto may be helpful. /* Definitely have a look at the [[doc:​techref:​Flash.Layout]]. */
  
 +{{page>​meta:​infobox:​dangerous&​noheader&​nofooter&​noeditbtn}}
 +
 +:!: If your attempt to install OpenWrt fails, please view [[doc/​howto/​generic.debrick]] for fixes.
 +
 +:!: This HOWTO is VERY generic. You cannot use it in most situations, as you have to adapt values and other parts for specific hardware. Please look at the [[toh:​start|supported hardware page]] for device-specific documentation.
 +
 +In most circumstances;​ you have three options:
 +  * **''​Option 1:''​** install OpenWrt onto the router'​s non-volatile memory
 +  * **''​Option 2:''​** install OpenWrt onto the RAM
 +  * **''​Option 3:''​** boot OpenWrt over the network ([[inbox:​howto:​netboot|netbooting]] is not supported by all [[doc:​techref:​bootloader|bootloaders]]).
 +
 +===== Four Installation Methods =====
 +There are four ways to install OpenWrt on a device:
 +
 +==== Method 1: via OEM firmware ====
 +Open the WebUI of the **OEM firmware** with your web browser and install the OpenWrt **factory** firmware image file using the //"​Firmware Upgrade"//​ option. Your device should reboot with OpenWrt installed.
 +
 +**''​NOTE:''​** Sometimes the OEM firmware will only allow you to flash your device with a specific firmware file. If that is the case, you will not be able to install OpenWrt using this method. However, for some devices the build bots prepare tagged builds such that they are compliant with the firmwares from the manufacturer. This should be documented on the device specific page for your model.
 +
 +==== Method 2: via Bootloader and an Ethernet port ====
 +Most, if not all [[doc:​techref:​bootloader|bootloaders]] provide built-in functionality for this purpose. Some use a [[wp>​Trivial File Transfer Protocol|TFTP]]-client,​ others a TFTP-server,​ others a [[wp>​File Transfer Protocol|FTP]]-client,​ some an FTP-server, some a web server and some use the [[wp>​XMODEM]]-protocol.
 +
 +Before proceeding you need to determine the following:
 +
 +  * the preset IP address of the bootloader (not necessarily identical to the IP address the device has after it has booted the original firmware!)
 +  * the protocol and whether the bootloader acts as client or as server
 +  * the correct port number (if not [[wp>​List of TCP and UDP port numbers|default]])
 +  * the interface you need to connect to
 +  * a user name and login password (if necessary)
 +  * the time window you have after starting the device to obtain a connection
 +Once you know all of the above parameters, you may proceed.
 +  - Install the appropriate software on your PC (i.e. if the bootloader uses an FTP-server, you need a FTP-client).
 +  - Read the appropriate manual page ie: ''​[[http://​linux.die.net/​man/​1/​tftp|tftp]]'',​ ''​[[http://​linux.die.net/​man/​8/​tftpd|tftpd]]'',​ ''​[[http://​linux.die.net/​man/​1/​ftp|ftp]]'',​ ''​[[http://​linux.die.net/​man/​1/​ncftp|ncftp]]'',​ ''​[[http://​linux.die.net/​man/​8/​ftpd|ftpd]]'',​ ''​[[http://​linux.die.net/​man/​8/​pure-ftpd|pure-ftpd]]'',​ etc ...
 +  - Configure a static IP address for your PC interface in the same IP address block as pre-configured in the bootloader.
 +  - Connect your PC to the device.
 +  - Power cycle the device.
 +  - Connect to the bootloader using the software you chose
 +  - Install the OpenWrt firmware file.
 +  - **<color red>Do not overwrite or alter the bootloader</​color>​** until explicitly instructed to do so!
 +
 +**''​NOTES:''​** Sometimes even the bootloader prevents you from flashing a non-OEM firmware.
 +If you have a short time window, the connection between your computer and device needs to be established quickly. To make this as quick possible, you can disable auto-negotiation on your [[wp>​Network interface controller|NIC]] and/or [[http://​support.microsoft.com/​kb/​239924|disable media sensing]].
 +
 +
 +=== Specific Howtos ===
 +  * [[doc:​howto:​generic.flashing.tftp]]
 +  * [[doc:​howto:​generic.flashing.ftp]]
 +  * [[doc:​howto:​generic.flashing.xmodem]]
 +
 +==== Method 3: via Bootloader and Serial port ====
 +  * [[doc:​howto:​generic.flashing.serial]]
 +
 +==== Method 4: via JTAG ====
 +  * [[doc/​hardware/​port.jtag]]
 +
 +==== Install a ramdisk-image into main memory ====
 +This step shows you howto upload a new ramdisk image to the device. The existing firmware on the flash remains unchanged! You require a working serial cable to do the ramdisk upload.
 +
 +  - specifically select the RAMDISK option to make OpenWrt Buildroot create a ramdisk-image for you to upload
 +  - connect an ethernet cable between your computer and one of the LAN ports (doesn'​t matter which, just so long as it's not the WAN port) of the WNDR3700.
 +  - connect your serial cable to the header on the WNDR3700 and set your local terminal program (eg. minicom) to
 +    * 115200 bps 8N1
 +    * no software flow control
 +    * no hardware flow control.
 +  - set your computer'​s ethernet port to use the IP address ''​192.168.0.10/​24''​
 +  - set up a TFTP server on your local computer to respond to requests on the 192.168.0.10 interface. Make sure that the ramdisk image (openwrt-ar71xx-uImage-lzma.bin) is in the directory used by the TFTP server.
 +  - Fix the header for the ramdisk image so that it's recognized by the u-Boot firmware. Use the wndr3700.c program that was posted by *aorlinsk* on the forums here http://​aorlinsk2.free.fr/​openwrt/​wndr3700/​ and run it from the TFTP server'​s data directory. I've also reproduced the code here just in case:
 +    * <code bash>
 +./wndr3700 openwrt-ar71xx-uImage-lzma.bin openwrt-fixed.out
 +</​code>​
 +  - power up the board. When it gets to the message asking you to press any key to interrupt the normal bootup sequence, press a key on the serial console (or just hold down the enter key from first bootup until you get to a prompt):
 +  - enter the following into the serial console:<​code bash>
 +setenv ipaddr 192.168.0.1
 +setenv serverip 192.168.0.10
 +setenv bootargs '​board=WNDR3700'​
 +tftpboot 80800000 openwrt-fixed.out
 +bootm
 +</​code>​(if you forget the bootargs piece below, the board will boot and look normal, but it won't be able to bring up any of the network interfaces!)
 +  - The system should boot!
 +
 +Concrete examples: [[toh/​netgear/​wnr2000]],​ ...
 +
 +Don't forget to consult the other [[doc:​howto:​generic.overview|Generic Basic Howtos for OpenWrt]]
 +
 +
 +===== Installation Checklist =====
 +//This checklist cannot and does not completely cover all the ways you can install OpenWrt.//
 +
 +<​html>​
 +  <​head>​
 +    <style type="​text/​css">​
 +      .checklist label { display: block; }
 +      .lvl1 {margin-left:​1em;​ font-weight:​bold;​ margin-top:​1em;​}
 +      .lvl2 {margin-left:​2em;​}
 +      .lvl3 {margin-left:​4em;​ font-style:​italic;​}
 +    </​style>​
 +  </​head>​
 +  <​body>​
 +    <form class="​checklist">​
 +      <label class="​lvl1"><​input type="​checkbox">​ Pre-Installation</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Say hello in <a href="​http://​webchat.freenode.net/?​channels=#​openwrt">#​openwrt</​a>​ channel at freenode.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Make sure that the router has currently stock/​original firmware installed.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Configure your computer to use static IP address.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Connect to the router with wire, not WiFi.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Do your own research and read all the resources about installing OpenWRT on your router:</​label>​
 +          <label class="​lvl3"><​input type="​checkbox">​ <a href="​http://​wiki.openwrt.org/​doc/​faq/​before.installation">​FAQ before installation</​a></​label>​
 +          <label class="​lvl3"><​input type="​checkbox">​ <a href="​http://​wiki.openwrt.org/​toh/​start">​Table of Hardware</​a></​label>​
 +          <label class="​lvl3"><​input type="​checkbox">​ <a href="​https://​forum.openwrt.org/">​OpenWRT forum</​a></​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Print or save those pages for offline reading:</​label>​
 +          <label class="​lvl3"><​input type="​checkbox">​ <a href="​http://​wiki.openwrt.org/​doc/​howto/​firstlogin">​First login</​a></​label>​
 +          <label class="​lvl3"><​input type="​checkbox">​ <a href="​http://​wiki.openwrt.org/​doc/​howto/​generic.failsafe">​Failsafe</​a></​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ (optional) <a href="​http://​wiki.openwrt.org/​doc/​howto/​generic.backup">​Backup flash of your router.</​a></​label>​
 +      <label class="​lvl1"><​input type="​checkbox">​ <​b>​Installation</​b></​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Reboot router.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Download OpenWRT image in proper location.</​label>​
 +          <label class="​lvl3"><​input type="​checkbox">​ In case of <a href="​http://​wiki.openwrt.org/​doc/​howto/​generic.sysupgrade">​upgrading</​a>​ existing OpenWrt system, the proper location is RAM (usually /​tmp).</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Verify MD5 checksum of the OpenWRT image you downloaded.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Make sure that there is at least as much free RAM as the size of OpenWRT image you have downloaded.</​label>​
 +      <label class="​lvl1"><​input type="​checkbox">​ <​b>​Post-Installation</​b></​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Do <a href="​http://​wiki.openwrt.org/​doc/​howto/​firstlogin">​First login</​a>​ and set root password.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ <a href="​http://​wiki.openwrt.org/​doc/​howto/​generic.backup">​Backup flash of your router.</​a></​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ Make yourself comfortable with the <a href="​http://​wiki.openwrt.org/​doc/​howto/​generic.failsafe">​Failsafe</​a>​ mode.</​label>​
 +        <label class="​lvl2"><​input type="​checkbox">​ <a href="​http://​wiki.openwrt.org/​doc/​howto/​basic.config">​Configure your device</​a></​label>​
 +    </​form>​
 +  </​body>​
 +</​html>​