Operational OpenWrt 19.07.2 Factory Tar file for EdgeRouter X

Here is the link to my repository where you can find my custom made "short receipt" "OpenWRT 19.07 factory tar file" called "openwrt-ramips-mt7621-ubnt-erx-initramfs-factory.tar"

You can flash it directly over any EdgeOS, and then replacing it by sysupgrading the router again with a usual "OpenWRT official stock image", like the lastest 19.07.2 sysupgrade stock bin file found here :

http://downloads.openwrt.org/releases/19.07.2/targets/ramips/mt7621/openwrt-19.07.2-ramips-mt7621-ubnt-erx-squashfs-sysupgrade.bin

Kind regards to all.

Stman.
Crypto-Anarchist Federation
@stman@mastodon.social

3 Likes

Hello again.

Here is the detailed procedure to compile an equivalent operational "short receipt" Tar factory image as I have been doing in my previous post.

These things where done under Xubuntu 18.04.2 :

Open a terminal.

Then type the following commands (One of them related to feeds install is doubled because some errors happen on the first launch):

sudo apt-get update
sudo apt-get install subversion g++ zlib1g-dev build-essential git python python3 python3-distutils libncurses5-dev gawk gettext unzip file libssl-dev wget libelf-dev ecj fastjar java-propose-classpath libldap2-dev libcap-dev libidn2-dev liblzma-dev libjansson-dev libpam-dev
git clone https://www.github.com/openwrt/openwrt -b openwrt-19.07
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
./scripts/feeds install -a
make menuconfig

Now, from the menuconfig main screen,

  • Set Target System to : MediaTek Ralink MIPS
  • Set Subtarget to : MT7621 based board
  • Set Target Profile to : Ubiquiti EdgeRouter X

Then select Save and accept to save the configuration under the proposed default filename .config and then select Exit until you quit the menuconfig utility and are back to the terminal bash prompt.

From here, enter the following bash commands :

make defconfig
make menuconfig

Go into Global Build Options submenu, and then :

  • Set Strip unnecessary export from the kernel image to *
  • Set Strip unnecessary functions from libraries to *

From this screen, enter the submenu Kernel build options and then :

  • Unset Compile the kernel with debug filesystem enabled
  • Unset Compile the kernel with symbol table information
  • Unset Compile the kernel with debug information

Then select Exit until you back reach the menuconfig main screen, then select Save , it will propose you to save the configuration under the default filename .config , accept it, and then select Exit until you are back to the terminal bash prompt.

Back to the terminal bash prompt, enter the following commands :

make download
make -jXXX

For the last command above please replace XXX by the number of processor cores your computer has. In my case, I used the command make -j8 because I have an 8 cores computer. If you ignore how many cores your microprocessor has, please just type make alone.

The compilation should take about 10 minutes with 8 cores.
Once it is finished, enter the following bash commands :

cd ./bin/targets/ramips/mt7621
ls -al

And you should see the following files :

user@PC:~/openwrt/bin/targets/ramips/mt7621$ ls -al
total 8684
drwxr-xr-x 3 user user    4096 mai   18 14:01 .
drwxr-xr-x 3 user user    4096 mai   18 13:55 ..
-rw-r--r-- 1 user user     335 mai   18 13:55 config.buildinfo
-rw-r--r-- 1 user user     263 mai   18 13:55 feeds.buildinfo
-rw-r--r-- 1 user user    1880 mai   18 14:01 openwrt-ramips-mt7621-device-ubnt-erx.manifest
-rw-r--r-- 1 user user 2938880 mai   18 14:01 openwrt-ramips-mt7621-ubnt-erx-initramfs-factory.tar
-rw-r--r-- 1 user user 2923299 mai   18 14:01 openwrt-ramips-mt7621-ubnt-erx-initramfs-kernel.bin
-rw-r--r-- 1 user user 2990868 mai   18 14:01 openwrt-ramips-mt7621-ubnt-erx-squashfs-sysupgrade.bin
drwxr-xr-x 2 user user    4096 mai   18 14:01 packages
-rw-r--r-- 1 user user     720 mai   18 14:01 sha256sums
-rw-r--r-- 1 user user      18 mai   18 13:55 version.buildinfo

As you can see, there is an openwrt-ramips-mt7621-ubnt-erx-initramfs-factory.tar that was generated. Use this file to update your router from EdgeOS with usual procedures.

Then, update again the router under this temporary OpenWRT 19.07 built with the official stock sysupgrade 19.07.2 bin file from the OpenWRT website, and you're done.

4 Likes

Hello

I have flashed *openwrt-ramips-mt7621-ubnt-erx-initramfs-factory.tar
just realized my erx is SFP model, would this initramfs working?
what I meant I can just continue the sysupgrading with the SFP one?

I was checking the current bin https://downloads.openwrt.org/releases/19.07.3/targets/ramips/mt7621/openwrt-19.07.3-ramips-mt7621-ubnt-erx-sfp-squashfs-sysupgrade.bin

it comes with SFP version too for initramfs below https://downloads.openwrt.org/releases/19.07.3/targets/ramips/mt7621/openwrt-19.07.3-ramips-mt7621-ubnt-erx-sfp-initramfs-kernel.bin

will it become a problem?

Thanks

I would try it, it could work perfectly, as both routers are very similar : Sysupgrade it with the ERX SFP software instead of the ERX bin image.

If it doesn't, if it refuses the ERX SFP bin file, reflash your router with EdgeOS signed image, it takes 5 minutes to do so, it's easy, I can help you if you don't know how to do it.

Then follow the same instructions I wrote for compiling a custom version of ERX tar file, but do it with the ERX SFP configuration instead.

I was thinking about generating the image for the ERX SFP too, but I've been lazy doing it. Still, with the compilation instructions I gave, it will take you half an ahour to do so, it's easy to do.

Please let me know how you went with sysupgrading with the ERX SFP bin sysupgrade file...

Kind regards,

Frederic.

what I did

sysupgrade -F /tmp/openwrt-19.07.3-ramips-mt7621-ubnt-erx-sfp-squashfs-sysupgrade.bin

but came with an image is not match but flash anyway since it was

force upgrade and got stuck with no clue, ssh and luci working perfectly but the WAN won't connect.

and I did button reset, it works now few minutes ago !

My concern about the POE later as the SFP has all ports POE

I am just wondering if the switch is correct? as I have more ports than regular ERX

it would be appreciated If anybody has SFP version can let me know the switch status in OpenWRT

btw

Could you please let me know the steps?

I don't have a backup at all since I was ok if later I have a problem I still can get access with serial console

Thank you

Eganov

Hello.

Will write later on this afternoon a complete procedure to reinstall the latest EdgeOS signed image. Will also provide it on my github repository, it will save you finding it and the procedure on Ubiquiti website. You will need to TFTP from a computer to the Router to reinstall the original image, the procedure will describe how to do this easily.

But then, you should prepare an ERX SFP temporary image factory tar file the same way I did it, just change the board profile with "menuconfig" and choose "ERX SFP" board instead of "ERX board", all other instructions of my procedure should not change.

Going to eat and will be back later on with the procedure.

Kind regards,

Stman

1 Like

Here is the procedure to reflash the factory Edge OS signed image :

Kind regards,

1 Like

Thank you for helping me

Have a question if I just TFTP directly (https://downloads.openwrt.org/releases/19.07.3/targets/ramips/mt7621/openwrt-19.07.3-ramips-mt7621-ubnt-erx-sfp-initramfs-kernel.bin)
without going back to edge os

The only problem I don't know how to do nand erase address
do you have an Idea how to do it?

Thanks

Honestly my Router looks fine as I already sysupgrading with the SFP version

I just want to confirm if the kernel for ERX SFP is the same with regular ERX and boot loader as well

I am new to Edgerouter and openwrt
your help is appreciated

I might end-up open the case and see the log from Serial console

and update you soon

It will not work.

In this TFTP recovery mode, it only accepts signed images from ubiquity.

I tried it already.

Yep.

I guess the bootloaders are the same too, and maybe the sysupgrade command update everything except the bootloader.

I understand your concerns.

I shouldn't have pushed you to install an ERX on a ERX SFP and then sysupgrade to ERX SFP image.

I should have motivated you to recompile a clean tar file with my instruction, it only takes 30 minutes to do, and as my instructions are very detailed, you can't fail doing so.

It would be nice to have this ERX SFP factory tar image ready for download for other users that are not used to OpenWRT and publish it as I did, and add a link to it on the OpenWrt website page dedicated to Edge Routers as I did it.

Will do it tonight if I have time.

This is the log I have I obscured Mac and serial number
https://pastebin.com/qTMRjBp4

can you help to check the log is good?

I might need to upgrade the boot loader what is your Idea
Thank you again

It looks ok.

I will try to past my own logs, but I have to open the router to connect to the internal serial port, contrarily to your who has an external connector to gain access to the serial console.

yes but I am at Job site , the machine to compile is limited with low memory and low cpu core

I saw below error on my log
and my board type is E51 instead of E50
which is correct

[ 1.123757] MediaTek Nand driver init, version v2.1 Fix AHB virt2phys error

[ 1.137792] Enable NFI Clock

[ 1.143539] # MTK NAND # : Use HW ECC

[ 1.150849] Device not found, ID: c2da

Can you post your log via dmesg

Thank you

Yep but it's only the linux boot log, not the uboot logs and before... whereas with the console, you get them all sequentially.

Just wondering if you have same error with mine.. Thanks

FYI this is My default env from bootloader

MT7621 # printenv
bootcmd=tftp
bootdelay=1
baudrate=57600
BootType=3
filesize=44ee27
fileaddr=80A00000
ipaddr=172.16.3.212
serverip=172.16.3.210
autostart=no
bootfile=vme50
stdin=serial
stdout=serial
stderr=serial
ethaddr=xx:xx:xx:xx:xx:xx
bootargs=console=ttyS1,57600n8 ubi.mtd=7 root=ubi0_0 rootfstype=ubifs rootsqimg=squashfs.img rootsqwdir=w rw model=e51

Environment size: 341/4092 bytes
MT7621 # version
U-Boot 1.1.3 (UBNT Build Version: e51_002_4c817) (May 27 2019 - 06:37:37)
MT7621 #

My Uboot indicate e51

I am guessing you will have a different one

Hopefully, I will have the correct pair of firmware to get optimum setup

need your idea about my interpretation since I can't make my bin, I am staying in the job site, hard to find the proper machine to compile

Thanks

you might find out your bootloader from your root prompt

root@OpenWrt:/# strings -n 25 /dev/mtdblock0 | grep 'U-Boot'

Thanks

Edit
just found out that my bootloader is current .. (002)
from

Thank you for doing this. Check notes before proceeding.
My steps:

  1. First only keep single system image : latest v1 release (I also had another v2 image which I deleted for space issues).
  2. Then flash using this tar. (Wait few minutes, it usually takes less than a minute but wait anyway).
  3. I used the original sysupgrade 19.07.2 from the openwrt page even though 19.07.3 was available. You just need to scp it into /tmp (beware there is another /tmp inside /tmp dont copy it there). AGAIN WAIT. This takes time and it might need a reboot. So wait 5-10 minutes I'd say (usually takes 1-2 minutes but wait anyway). Then reboot and you should see the LuCi interface.
  4. Then I upgraded to the latest sysupgrade through the UI and reset settings.

I am yet to test it for stability, I just upgraded it few minutes ago.

Note: As good practice hard reset the router to factory defaults (some pin method at the back) and use static IP for your PC. Also backup the firmware as mentioned in the home page on OpenWRT website. Once you do first upgrade from tar, you will have to switch ports from eth0 to eth1-4 so keep that in mind if you don't see anything.

I needed dns over https/tls so I wanted to go something other than EdgeOS (never got it working properly) and had this around for a long time and wasn't using it so I tried it. I wasn't sure if this would brick it since someone on the github repo opened an issue and said it bricked his and I didn't have any hardware at hand for serial console. Maybe he didn't follow the steps properly. I didn't even do any backups of the firmware which was irresponsible I think. Nonetheless glad I have a working OpenWRT router which at first glance looks really snappy. I tried this previously on 841N and those things were slow and rebooted frequently due to stability issues. Next step would be to setup adblock better firewall rules. I already setup dns over https and it took like 10 seconds which was amazing. I think this is the first real device with OpenWRT I will be using so any recommendations would be helpful. I am only using this for a simple home setup though.