Edgerouter X wiki points to not working .BIN and other thingies

Hi all,

Linux is not new to me, have been using it over the years, but OpenWRT is semi new to me.

Have used it in the past on TP-Link AP and now after many years on a router device.

Two days ago I install it on a Edgerouter X v2.0. Needed to downgrade it first to v1.10.10.

Could not get it to install following the OpenWRT wiki. It doesn't like OpenWRT .BIN files the original firmware.

The OpenWrt wiki guide must be updated I think to notice this cause users getting to a dead end with that .BIN file.

Finally I got OpenWrt installed with a work around by installing the openwrt-ramips-mt7621-ubnt-erx-initramfs-factory.TAR from:
https://wiki.opennet-initiative.de/wiki/Ubiquiti_EdgeRouter

After installing the Opennet firmware (which is based on LEDE/OpenWRT) I could then proceed and install openwrt-ramips-mt7621-ubnt-erx-squashfs-sysupgrade.tar that I downloaded/made via git.

And now I am finally on OpenWrt.

All works great, getting full speeds from cable provider 500/40.

But I see allot of files in /tmp that makes me wonder if these are left overs from the upgrade:

~# ls /tmp/
TZ                dnsmasq.d         hosts             lock              luci-indexcache   opkg-IJAHNo       overlay           resolv.conf.auto  shm               sysinfo           usr
dhcp.leases       etc               lib               log               luci-modulecache  opkg-lists        resolv.conf       run               state             tmp

Is this normal or should I try to delete those files/directories?

1 Like

/tmp is stored in RAM, it is not permanent. You can check this yourself (note the tmpfs):

root@OpenWrt:~# df /tmp
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                    29572       648     28924   2% /tmp

The files and subdirectories in /tmp are created automatically at every boot, they look normal to me.
They are not leftovers and you should not delete them for tidiness reasons.

1 Like

FWIW, I had to go that route too. Couldn't get any other method to work.

2 Likes

Tagging @tmomas.

2 Likes

Added note:
Trying to sysupgrade to 19.07.0 from 18.06* will brick the device.

When that happens you need to do the whole daunting routine again of ubnt recovery via tftp then sysupgrade via opennet-factory.img and then sysupgrading to openwrt-sysupgrade.tar 18.* the ones what git gives you from source/scripts a .TAR.

The device doesn't like .BIN files. The newer 19.* files are only in .BIN format files.

After many tries I gave up on 19.*, sticking to 18.06.5 for now until somebody can tell what a good upgrade path is to 19.

Hi there.
Probably bad timing, but I just picked up a edgerouter x for a great price. My internet speed isn't superfast, so this little device fits my needs.

After looking at some threads and reading your install @Tommy how does this look from factory edgeos to openwrt. also do i need to change my edgeos version to v2.0.4, or v1.10.10? or doesn't it matter.....


factory install on eth0
 
scp openwrt-ramips-mt7621-ubnt-erx-initramfs-factory.tar ubnt@192.168.1.1:/tmp
ssh ubnt@192.168.1.1 
cd /tmp
add system image /tmp/openwrt-ramips-mt7621-ubnt-erx-initramfs-factory.tar

reboot


sysupgrade on eth1

scp openwrt-18.06.5-ramips-mt7621-ubnt-erx-squashfs-sysupgrade.tar root@192.168.1.1:/tmp
ssh root@192.168.1.1 
cd /tmp
sysupgrade openwrt-18.06.5-ramips-mt7621-ubnt-erx-squashfs-sysupgrade.tar

reboot

I grabbed the factory tar from the German wiki, and the sysupgrade from official download target.
found another factory tar on this link. http://openwrt.jaru.eu.org/openwrt-18.06/targets/ramips/mt7621/ - might be a newer factory than the german wiki?

Also, now 18.06.6 is being released, ... i assume a similar method is needed? what about 19x? Or is it best to flash edgeos using usb to ttl adaptor, and use the official .bin for both kernel and sysupgrade?

many thanks

1 Like

I just wanted to add that this is apparently not a universal issue for all EdgeRouter X.
Either that or I somehow by pure luck went an update path that avoided this issue, as just yesterday I normally flashed 19.07.0 on my ER-X and it works just fine.
My update path in the past months was
18.06.4 -> snapshot (I had to force the upgrade from 18.06.4 to snapshot because the build target changed, but it still worked fine afterwards) -> 19.07-rc1 -> 19.07-rc2 -> 19.07.0

1 Like

Dear All,

the "german wiki" is our local Freifunk community and we compiled a stock OpenWrt at that point of time we initially created the wiki page for local first installation tests.

At that point of time the OpenWrt image was small and working flawlesly. You can use the old image for the initial change from EdgeOS to OpenWrt. You do not need to our local OpenWrt flavour "Opennet Firmware" at the second step but you can move directly to the lastest OpenWrt via sysupgrade.

We are keep track of this special situation via our local ticket-system as well:
https://dev.opennet-initiative.de/ticket/231 (sadly german as well).

Basically I understand that this PR is the important piece to solve the issue in the future:

Best regards
Mathias

PS: I recently tested a lot with several newly arrived ER-X-SFP and they all had the (direct) upgrade issue.

2 Likes

From edgeos v2.06 > openwrt 18.06.6 > 19.07.0.
Used openwrt-18.06.6-ramips-mt7621-ubnt-erx-squashfs-sysupgrade.tar from the german wiki/Freifunk.

Then ssh back into ERX and forced 19.07.0 sysupgrade. with this command

sysupgrade -F -n openwrt-19.07.0-ramips-mt7621-ubnt-erx-squashfs-sysupgrade.bin

Worked first time without issue.

1 Like

Chiming in with the same issues here. Initial flash to OpenWRT on my ER-X requires using the Freifunk community build and then a sysupgrade -n to latest 18.* build works.

18.* -> 19.* sysupgrade also puts my router in a boot loop. I'm not sure why this is hit or miss for other folks as I wasn't able to diagnose the issue in fail-safe mode. If it helps anyone, I was able to restore the ER-X to using the img.signed build and their reset sequence listed here: https://help.ubnt.com/hc/en-us/articles/360019289113-EdgeRouter-TFTP-Recovery

to return the router to 18.* OpenWRT

1 Like

just out of curiosity, does using that https://dl.ui.com/firmwares/edgemax/v2.0.x/ER-e50.recovery.v2.0.6.5208541.190708.0508.16de5fdde.img.signed Img restore from openwrt to edgeos?
did you hae to use a usb to ttl?
as shown on this link. https://help.ubnt.com/hc/en-us/articles/360018189493

many thanks

Yes, it restores everything to the Edge OS version selected without a need for USB to TTL. Just hold the reset button down while the unit is on until the LEDs start flashing in a repeating and interleaving pattern and run the tftp commands in the doc against 192.168.1.20 using the .img.signed file.

Edit: the above might only be relevant if you have a more recent bootloader installed.

Thank you uglysome. Yes you are right about the more recent bootloader being required. I think it gets automatically updated when installing a 2.x edgeos firmware. anyway, thats good to know there is a easy way to get back to edgeos if needs be.

Weird that some ERX can't update from openwrt 18 to 19 and some can.
Have you tried going straight from edgeos to 19? by using a factory tar from an earlier release, and the 19 bin?

I had the same problem as uglysome - upgrading from 18 to 19 failed and puts the device into an endless boot loop. When attaching a serial console to the device you'll see that booting ends up with a kernel panic

[    5.779239] ubi0 error: 0x802f72d0: bad attaching information, error 1
[    5.792237] Volume attaching information dump:
[    5.801079] 	vol_id         0
[    5.806966] 	highest_lnum   33
[    5.813041] 	leb_count      15
[    5.819117] 	compat         0
[    5.825003] 	vol_type       3
[    5.830905] 	used_ebs       0
[    5.836791] 	last_data_size 0
[    5.842692] 	data_pad       0
[    5.848578] Volume information dump:
[    5.855689] 	vol_id          0
[    5.861770] 	reserved_pebs   14
[    5.868002] 	alignment       1
[    5.874076] 	data_pad        0
[    5.880151] 	vol_type        3
[    5.886211] 	name_len        6
[    5.892285] 	usable_leb_size 126976
[    5.899226] 	used_ebs        14
[    5.905458] 	used_bytes      1777664
[    5.912569] 	last_eb_bytes   126976
[    5.919510] 	corrupted       0
[    5.925570] 	upd_marker      0
[    5.931644] 	name            rootfs
[    5.939215] ubi0 error: 0x802fac9c: failed to attach mtd5, error -22
[    5.951889] UBI error: cannot attach mtd5
[    5.959899] hctosys: unable to open rtc device (rtc0)
[    5.970750] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    5.985701] Please append a correct "root=" boot option; here are the available partitions:
[    6.002352] 1f00             512 mtdblock0 
[    6.002358]  (driver?)
[    6.015366] 1f01             384 mtdblock1 
[    6.015372]  (driver?)
[    6.028371] 1f02             384 mtdblock2 
[    6.028376]  (driver?)
[    6.041400] 1f03            3072 mtdblock3 
[    6.041406]  (driver?)
[    6.054412] 1f04            3072 mtdblock4 
[    6.054418]  (driver?)
[    6.067417] 1f05          253696 mtdblock5 
[    6.067422]  (driver?)
[    6.080445] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    6.098418] Rebooting in 1 seconds..

This stuff is a bit above my league so I can't see what actually is going wrong here - might be helpful to you?!

I decided to skip the fallback to EdgeOS and got 19 running by using the serial connection to load 19 to SDRAM via TFTP (boot option 1) and using the sysupgrade -n.

1 Like

This will brick the router all the time.

You got somehow lucky.

1 Like

I can only comment on how I did this. Really unsure why this method worked for me and not others?

going from stock edgeos, to 18. using the Freifunk factory tar, installing 18.06.6 official tar sysupgrade, then to 19x. bin.

1 Like

Just for the fun, can you reproduce this?

Did anyone find a (tested) way to upgrade from 18.06 to 19.07 without bricking?

I updated from 18.06.4 (installed first time 17.07.7 from official openwrt .tar file, then updated to 18.06.4) to 19.07.0 with .bin file without brick it.

I bought a USB serial cable and connected it directly to the ER-X board.

I should have done this weeks ago!!

The time and stress this saves OMG!

Without a USB serial cable you keep bricking it for the most of us users out there and you have no clue what it is other then resetting it and shooting in a UBNT recovery image via TFTP.

With a USB serial cable I managed to shoot in the latest:
http://downloads.openwrt.org/releases/19.07.0/targets/ramips/mt7621/openwrt-19.07.0-ramips-mt7621-ubnt-erx-initramfs-kernel.bin via a local TFTP server.

Then when I booted in to that image (still connected by USB serial cable) and via ethernet ssh I put in /tmp: http://downloads.openwrt.org/releases/19.07.0/targets/ramips/mt7621/openwrt-19.07.0-ramips-mt7621-ubnt-erx-squashfs-sysupgrade.tar installed it with sysupgrade and all was good after reboot.

Using -v with sysupgrade tool and I saw it was fixing some blocks? Perhaps from the earlier bricking?

Cable costed 3 euro:

Without the work others have done with the ER-X I would not have succeeded getting this far. I followed the information I found here:

http://sector5d.org/openwrt-on-the-ubiquiti-edgerouter-x.html

And of course the wiki at OpenWrt:

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

Without these fine guides I would be totally blind when it comes to all of this. I am just a damn n00b having fun and playing around with Open source for many years now.

2 Likes