Skip to content

fghorow/linksys-e8450-openwrt-installer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An OpenWrt UBI Installer Image Generator for Linksys E8450 and Belkin RT3200

animated gif showing web UI and serial during installation

Animated GIF showing the installation process. The window on the right displays the serial RX interface for documentation purpose only. The interaction required is shown on the left, which is done entirely within the web browser.

This script downloads the OpenWrt ImageBuilder to generate a release-like (i.e. LuCI included) sysupgrade image. The process involves re-packaging the initramfs image to contain everything necessary for a permanent recovery image within the NAND flash, including the installer script and the prerequisite installation images.

The resulting file openwrt-mediatek-mt7622-linksys_e8450-ubi-initramfs-recovery-installer.itb can be flashed via the vendor/official firmware web interface, as well as OpenWrt firmware running non-UBI builds (by running sysupgrade -F openwrt-mediatek-mt7622-linksys_e8450-ubi-initramfs-recovery-installer.itb).

WARNING #1 This will replace the bootloader (TF-A 2.4, U-Boot 2021.10) and convert the flash layout of the device to UBI. The installer stores a copy of the previous bootchain in a dedicated UBI volume boot_backup.

WARNING #2 Re-flashing the installer when the device is already using UBI flash layout will erase the previously backed up bootchain, which in most cases would be the vendor/official one.

For utmost safety (but not absolutely necessary), you are recommended to make a complete backup of the device flash before running the installer. (see below "Device flash backup procedure while running the stock firmware or non-UBI OpenWrt build")

You'll need the below to use the script to generate the installer image:

If you are not interested in building yourself, the pre-built files are available here.

Installing OpenWrt

Assuming the device is running stock firmware, and is brand new or just after factory reset.

  1. Connect any of the LAN ports of the device directly to the Ethernet port of your computer.
  2. Set the IP address of your computer as 192.168.1.254 with netmask 255.255.255.0, no gateway, no DNS.
  3. Power on the device, wait about a minute for it to be ready.
  4. Open a web browser, navigate to http://192.168.1.1 and wait for the wizard to come up.
  5. Click exactly inside the radio button to confirm the terms and conditions, then abort the wizard.
  6. You should then be greeted by the login screen, the stock password is "admin".
  7. Navigate to Administration -> Firmware Upgrade.
  8. Upload openwrt-mediatek-mt7622-linksys_e8450-ubi-initramfs-recovery-installer.itb.
  9. Wait for a minute, the OpenWrt recovery image should come up.
  10. Navigate to System -> Backup / Flash Firmware.
  11. Upload openwrt-mediatek-mt7622-linksys_e8450-ubi-squashfs-sysupgrade.itb.
  12. The device will reboot, you may proceed to setup OpenWrt.

Upgrading to the latest OpenWrt snapshot

WARNING SNAPSHOTS ARE LARGELY UNTESTED! PROCEED AT YOUR OWN RISK!

  1. Backup the original/vendor bootchain

    Connect to the device via SSH and enter the following commands:

    mkdir /tmp/boot_backup
    mount -t ubifs ubi0:boot_backup /tmp/boot_backup
    

    Then, copy the files under /tmp/boot_backup using scp to your host. These files are needed in case you want to restore the original/vendor firmware. They can also be used in emergency case for reflashing via JTAG.

  2. Both auc (attended sysupgrade command-line client) and luci-app-attendedsysupgrade (LuCI web-interface counterpart) are included since version 0.6. Simply run auc from the command-line, or navigate to System -> Attended Sysupgrade and proceed accordingly.

To enter recovery mode under OpenWrt

  1. Hold down the "reset" button (below the "WPS" button) whilst powering on the device.
  2. Release the button once the power LED turns into orange/yellow.

This will remove any user configuration and allow restoring or upgrading from ssh/http/tftp.

Device flash backup procedure while running the stock firmware or non-UBI OpenWrt build

  1. Flash openwrt-mediatek-mt7622-linksys_e8450-ubi-initramfs-recovery.itb (note that this file doesn't have the word installer in it's filename)
  2. Login and navigate to System, save a copy of each of the mtdblock.
  3. In case of failure (because of ECC/OOB interoperability problems between the old and new SPI-NAND driver), connect to the device via SSH and enter the following commands:
cd /dev
for part in mtd[0123] ; do
  dd if=$part of=/tmp/$part
done

Then, copy the resulting files using scp to your host.

After this, do not attempt to flash openwrt-mediatek-mt7622-linksys_e8450-ubi-initramfs-recovery-installer.itb from the running initramfs system -- it will fail to reboot, possibly requiring serial console access. Instead, power cycle the device to reboot into the original non-ubi firmware, and then flash the installer version.

Restoring the vendor/official firmware

If you have used v0.6.1 or later of installer, skip step #1 and just boot into on-flash recovery/initramfs instead.

  1. Flash openwrt-mediatek-mt7622-linksys_e8450-ubi-initramfs-recovery.itb (note that this file doesn't have the word installer in it's filename)
  2. Use scp to copy the original/vendor bootchain (mtdx files) to the device's /tmp folder
  3. Connect to the device via SSH and enter the following commands:
ubidetach -d 0
insmod mtd-rw i_want_a_brick=1
mtd write /tmp/mtd0 /dev/mtd0
mtd write /tmp/mtd1 /dev/mtd1
mtd write /tmp/mtd2 /dev/mtd2
mtd write /tmp/mtd3 /dev/mtd3
  1. Reboot the device, use TFTP to flash the vendor firmware according to this procedure.

About

OpenWrt firmware installer for the Linksys E8450 aka. Belkin RT3200

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Shell 77.7%
  • C 20.3%
  • CMake 2.0%