User Tools

Site Tools


docs:guide-user:installation:sysupgrade.cli

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
docs:guide-user:installation:sysupgrade.cli [2018/09/04 10:32]
tmomas forum link changed from LEDE -> OpenWrt
docs:guide-user:installation:sysupgrade.cli [2018/09/14 05:15] (current)
tmomas LEDE -> OpenWrt
Line 1: Line 1:
-======Upgrading ​LEDE firmware from the Command Line ======+====== Upgrading ​OpenWrt ​firmware from the Command Line ======
 :!: **For experienced users only!** :!: **For experienced users only!**
  
-This howto will upgrade an existing ​LEDE firmware to a new version from the SSH command line.\\+This howto will upgrade an existing ​OpenWrt ​firmware to a new version from the SSH command line.\\
 Non-experienced users are strongly advised to [[docs:​guide-quick-start:​sysupgrade.luci|sysupgrade from the web admin GUI]] instead. Non-experienced users are strongly advised to [[docs:​guide-quick-start:​sysupgrade.luci|sysupgrade from the web admin GUI]] instead.
  
Line 8: Line 8:
 If you do not want to preserve existing configuration or files, feel free to skip this section. If you do not want to preserve existing configuration or files, feel free to skip this section.
  
-The default upgrade on command line will automatically preserve basic LEDE configuration by saving and then restoring configuration files in default locations (/​etc/​config). This will preserve things like network settings, WiFi settings, the device hostname, and so on. A LEDE command line upgrade by default preserves the following configuration files:+The default upgrade on command line will automatically preserve basic OpenWrt ​configuration by saving and then restoring configuration files in default locations (/​etc/​config). This will preserve things like network settings, WiFi settings, the device hostname, and so on. A OpenWrt ​command line upgrade by default preserves the following configuration files:
     * listed by ''​opkg list-changed-conffiles''​     * listed by ''​opkg list-changed-conffiles''​
     * listed within the text files in ''/​lib/​upgrade/​keep.d/''​ (for example, ''/​lib/​upgrade/​keep.d/​base-files-essential''​)     * listed within the text files in ''/​lib/​upgrade/​keep.d/''​ (for example, ''/​lib/​upgrade/​keep.d/​base-files-essential''​)
Line 25: Line 25:
 </​code>​ </​code>​
  
-===== Download and verify the LEDE firmware upgrade image ===== +===== Download and verify the OpenWrt ​firmware upgrade image ===== 
-Download and use only LEDE firmware images ending in **"​-sysupgrade.bin"​** for command line upgrades.\\+Download and use only OpenWrt ​firmware images ending in **"​-sysupgrade.bin"​** for command line upgrades.\\
 For x86 systems there is no "​sysupgrade"​ image, just be sure the new firmware image has the same family of filesystem as your old one. For x86 systems there is no "​sysupgrade"​ image, just be sure the new firmware image has the same family of filesystem as your old one.
  
 :!: Note: upgrade files must be placed in /tmp, as the sysupgrade procedure unmounts flash storage during the upgrade process. If the upgrade file is not in **/tmp**, sysupgrade will NOT perform any upgrade and only reboot the system. :!: Note: upgrade files must be placed in /tmp, as the sysupgrade procedure unmounts flash storage during the upgrade process. If the upgrade file is not in **/tmp**, sysupgrade will NOT perform any upgrade and only reboot the system.
  
-Download the desired upgrade file to your LEDE's ''/​tmp''​ directory, which is stored in the device RAM:+Download the desired upgrade file to your OpenWrt's ''/​tmp''​ directory, which is stored in the device RAM:
  
   - Check free memory is available: Run ''​free''​. Proceed, if "free Mem" is the size of your firmware file + some extra mem (at least twice the size of your firmware file is perfect).   - Check free memory is available: Run ''​free''​. Proceed, if "free Mem" is the size of your firmware file + some extra mem (at least twice the size of your firmware file is perfect).
-  - Set the following variables to the download address of your LEDE firmware file (you must customize the URL!): <​code>​DOWNLOAD_LINK="​http://​URLOFFIRMWAREBIN";​ SHA256SUMS="​lhttp://​URLOFSHA256"</​code>​+  - Set the following variables to the download address of your OpenWrt ​firmware file (you must customize the URL!): <​code>​DOWNLOAD_LINK="​http://​URLOFFIRMWAREBIN";​ SHA256SUMS="​lhttp://​URLOFSHA256"</​code>​
   - Download and check the firmware checksum with: <​code>​cd /tmp;wget $DOWNLOAD_LINK;​wget $SHA256SUMS;​sha256sum -c sha256sums 2>/​dev/​null|grep OK</​code>​   - Download and check the firmware checksum with: <​code>​cd /tmp;wget $DOWNLOAD_LINK;​wget $SHA256SUMS;​sha256sum -c sha256sums 2>/​dev/​null|grep OK</​code>​
   - In the screen output, look for the correct checksum verification:​ <​code>​FILE_NAME:​ OK</​code>​   - In the screen output, look for the correct checksum verification:​ <​code>​FILE_NAME:​ OK</​code>​
Line 40: Line 40:
  
 **Troubleshooting:​** **Troubleshooting:​**
-  * If you **cant use '​wget'​** (e.g. because you want to transfer firmware from your PC to your LEDE device)+  * If you **cant use '​wget'​** (e.g. because you want to transfer firmware from your PC to your OpenWrt ​device)
     *  you can use **scp**: ''​scp lede-ar71xx-tl-wr1043nd-v1-squashfs-sysupgrade.bin root@192.168.1.1:/​tmp''​ (Ensure you have set a non-null password for your device root account to properly use scp)     *  you can use **scp**: ''​scp lede-ar71xx-tl-wr1043nd-v1-squashfs-sysupgrade.bin root@192.168.1.1:/​tmp''​ (Ensure you have set a non-null password for your device root account to properly use scp)
     * you can also use **nc/​netcat**:​     * you can also use **nc/​netcat**:​
       - On your Linux PC run: ''​cat [specified firmware].bin | pv -b | nc -l -p 3333''​       - On your Linux PC run: ''​cat [specified firmware].bin | pv -b | nc -l -p 3333''​
-      - On your LEDE device run (Assuming 192.168.1.111 is the IP of your Linux PC): ''​nc 192.168.1.111 3333 > /​tmp/​[specified firmware].bin''​+      - On your OpenWrt ​device run (Assuming 192.168.1.111 is the IP of your Linux PC): ''​nc 192.168.1.111 3333 > /​tmp/​[specified firmware].bin''​
   * If the **checksum mismatches**:​ Redo the firmware download, if the mismatch remains, ask for help in the [[https://​forum.openwrt.org/​c/​installation|"​Installing and Using OpenWrt"​ Forum]]   * If the **checksum mismatches**:​ Redo the firmware download, if the mismatch remains, ask for help in the [[https://​forum.openwrt.org/​c/​installation|"​Installing and Using OpenWrt"​ Forum]]
   * If **low on RAM**: If your device'​s ''/​tmp''​ filesystem is not large enough to store the upgrade image, you have to free up RAM.    * If **low on RAM**: If your device'​s ''/​tmp''​ filesystem is not large enough to store the upgrade image, you have to free up RAM. 
Line 53: Line 53:
 root@lede:/#​ reboot</​code>​ root@lede:/#​ reboot</​code>​
  
-===== Flash the new LEDE firmware =====+===== Flash the new OpenWrt ​firmware =====
  
   - The firmware file is now in /tmp, so you can start the flashing process   - The firmware file is now in /tmp, so you can start the flashing process
Line 85: Line 85:
   * **does not reboot automatically or remains unresponsive**:​ Wait 5 minutes, then do a hard reset: Turn it off, wait 2-3 seconds and turn it back on (or pull the power plug and plug it back in).\\ :!: Doing this while the device is still updating might softbrick it and require serial or even jtag connection to recover it. Such a cold restart has been reported to be required often after a sysupgrade by command line.   * **does not reboot automatically or remains unresponsive**:​ Wait 5 minutes, then do a hard reset: Turn it off, wait 2-3 seconds and turn it back on (or pull the power plug and plug it back in).\\ :!: Doing this while the device is still updating might softbrick it and require serial or even jtag connection to recover it. Such a cold restart has been reported to be required often after a sysupgrade by command line.
   * **OPKG issues**: if after flashing you have issues with package installation or because opkg.conf has outdated data, read [[https://​dev.openwrt.org/​ticket/​13309]]   * **OPKG issues**: if after flashing you have issues with package installation or because opkg.conf has outdated data, read [[https://​dev.openwrt.org/​ticket/​13309]]
-  * **'​sysupgrade'​ not available** on your LEDE device, you can use '​mtd'​ instead to flash the firmware: ''​mtd -r write /​tmp/​lede-ar71xx-generic-wzr-hp-ag300h-squashfs-sysupgrade.bin firmware''​ +  * **'​sysupgrade'​ not available** on your OpenWrt ​device, you can use '​mtd'​ instead to flash the firmware: ''​mtd -r write /​tmp/​lede-ar71xx-generic-wzr-hp-ag300h-squashfs-sysupgrade.bin firmware''​ 
-  * **Low RAM**: Only recommended for devices with really very little RAM, you could try the more risky flashing-by-streaming-to-mtd variant (risky, because the firmware gets streamed from the client to the device during flashing. Any network issues during the process are likely to brick your device). Use this only, if you really cannot free **enough RAM** with other means. Netcat must be installed on the LEDE device for this. If you need help for netcat, refer to external links: [[man>​netcat|1]],​ [[http://​www.g-loaded.eu/​2006/​11/​06/​netcat-a-couple-of-useful-examples/​|2]],​ [[http://​www.screenage.de/​blog/​2007/​12/​30/​using-netcat-and-tar-for-network-file-transfer/​|3]],​ [[https://​help.ubuntu.com/​community/​BackupYourSystem/​TAR|4]],​ [[http://​www.aboutdebian.com/​tar-backup.htm|5]]+  * **Low RAM**: Only recommended for devices with really very little RAM, you could try the more risky flashing-by-streaming-to-mtd variant (risky, because the firmware gets streamed from the client to the device during flashing. Any network issues during the process are likely to brick your device). Use this only, if you really cannot free **enough RAM** with other means. Netcat must be installed on the OpenWrt ​device for this. If you need help for netcat, refer to external links: [[man>​netcat|1]],​ [[http://​www.g-loaded.eu/​2006/​11/​06/​netcat-a-couple-of-useful-examples/​|2]],​ [[http://​www.screenage.de/​blog/​2007/​12/​30/​using-netcat-and-tar-for-network-file-transfer/​|3]],​ [[https://​help.ubuntu.com/​community/​BackupYourSystem/​TAR|4]],​ [[http://​www.aboutdebian.com/​tar-backup.htm|5]]
     - On your Linux PC run:<​code>​nc -q0 192.168.1.1 1234 < lede-ar71xx-tl-wr1043nd-v1-squashfs-sysupgrade.bin</​code>​     - On your Linux PC run:<​code>​nc -q0 192.168.1.1 1234 < lede-ar71xx-tl-wr1043nd-v1-squashfs-sysupgrade.bin</​code>​
-    - On the LEDE device, run:<​code>​nc -l -p 1234 | mtd write - firmware</​code>​+    - On the OpenWrt ​device, run:<​code>​nc -l -p 1234 | mtd write - firmware</​code>​
  
  
docs/guide-user/installation/sysupgrade.cli.txt · Last modified: 2018/09/14 05:15 by tmomas