Having issues installing OpenWrt on Ubiquiti EdgeRouter X — bootloop after sysupgrade

Hi everyone,

I’m trying to install OpenWrt on my Ubiquiti EdgeRouter X (ER-X) but I’m running into a problem I can’t solve on my own. Hoping someone here has experience and can help.

What I’ve done so far:

  1. Started from the stock EdgeOS firmware.
  2. Downloaded the factory image from this repo (version 22.03):
    openwrt-ramips-mt7621-ubnt_edgerouter-x-initramfs-factory.tar
    https://github.com/stman/OpenWRT-19.07.2-factory-tar-file-for-Ubiquiti-EdgeRouter-x/raw/master/Version%2022.03/openwrt-ramips-mt7621-ubnt_edgerouter-x-initramfs-factory.tar
  3. Flashed the factory image via the EdgeOS Web UI. The router booted into OpenWrt (SSH now on eth1 as root).
  4. Uploaded the sysupgrade image:
    openwrt-ramips-mt7621-ubnt_edgerouter-x-squashfs-sysupgrade.bin
    https://github.com/stman/OpenWRT-19.07.2-factory-tar-file-for-Ubiquiti-EdgeRouter-x/raw/master/Version%2022.03/openwrt-ramips-mt7621-ubnt_edgerouter-x-squashfs-sysupgrade.bin
    to /tmp on the router.
  5. Ran the upgrade command with both -n and -F options:
sysupgrade -n -F /tmp/openwrt-ramips-mt7621-ubnt_edgerouter-x-squashfs-sysupgrade.bin

The problem:
After running sysupgrade, the router reboots but gets stuck in a bootloop and becomes unreachable. No SSH access, no normal boot.

I had to recover back to EdgeOS using the official recovery method.

Questions:

  • Which factory/sysupgrade image versions are currently recommended for the ER-X?
  • Are there any special flags or steps needed during sysupgrade to avoid bootloops?
  • Could this be caused by using a non-official or modified factory image?
  • How can I best troubleshoot this problem?

I’ve reviewed the official OpenWrt ER-X page and stman’s repo, but I feel stuck.

Any help or pointers would be greatly appreciated!

Do not upgrade to the sysupgrade image from that repository. Once you have booted into stman's factory image, you can sysupgrade directly to a regular OpenWrt image such as this one: https://downloads.openwrt.org/releases/23.05.5/targets/ramips/mt7621/openwrt-23.05.5-ramips-mt7621-ubnt_edgerouter-x-squashfs-sysupgrade.bin

Note that OpenWrt after 23.05 requires changing the flash layout. To keep things simple try flashing 23.05 first. If that works, you can upgrade to 24.10 after following the directions at this repository: https://github.com/darkxst/erx-migration

Thank you so much for the help, I manage to sysupgrade now with the file link you provided. Up and running Openwrt, I will try bit later on upgrading to 24.10. Thanks mate for the help:)

1 Like

I upgraded my ER-X a few days ago , following this one

If you download the image(s) + upgrade scripts , and scp them to the ER-X , there's no need for it to be "online" while doing the conversion.

Before doing the above, i upgraded the ER-X to latest stock fw

Some notes i took:

UBi fw prep before OpenWRT.
----------------------------

https://openwrt.org/toh/ubiquiti/edgerouter_x_er-x_ka

It is recommended to update to the latest UBi v2 firmware and Bootloader prior to installing OpenWRT, for the safer bootloader. 

https://help.uisp.com/hc/en-us/articles/22591243829911-EdgeRouter-How-to-Update-the-Bootloader

https://help.uisp.com/hc/en-us/articles/22591203404311-EdgeRouter-How-to-Upgrade-the-EdgeOS-Firmware

https://help.uisp.com/hc/en-us/articles/22591244564887-EdgeRouter-TFTP-Recovery

HTH
/Bingo

If a moderator with wiki permissions is around, I would kindly ask to update the wiki page to include my recipe. I fell into the same trap as @riley1626 , recovered via tftp which was actually very relaxing because stock tools on Ubuntu worked out of the box for recovery.

sudo apt install tftp-hpa
#long press the reset button until all leds flash
#connect host pc with static ipv4 192.168.1.10 to eth0
tftp 192.168.1.20
put ER-e50.recovery.v2.0.6.5208541.190708.0508.16de5fdde.img.signed
# leds start to flash in pattern, wait until done, can take ~5 minutes of patience
quit
# power cycle the device,
# connect via webui
# 192.168.1.1 >> ubnt/ubnt