Support for Ubiquiti Edgerouter 4?

The usb start was properly done in my first test too, it's just a copy/paste mistake. The fatload usb command would have failed otherwise.

Octeon ubnt_e300(ram)# usb start
Octeon ubnt_e300(ram)# fatload usb 0:1 0x20000000 openwrt-octeon-ubnt_edgerouter-4-initramfs-kernel.bin
Octeon ubnt_e300(ram)# bootoctlinux 0 numcores=4 endbootargs mem=0

The issue really was in the initramfs image that failed to see usb devices.

1 Like

@pdecat

Thanks for the tip. No matter what I do I always end here after "bootoctlinux 0 numcores=4 endbootargs mem=0"

[    0.000000] Linux version 5.4.89 (builder@buildhost) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r15541-e87c0d934c)) #0 SMP Tue Jan 19 12:01:03 2021
[    0.000000] Skipping L2 locking due to reduced L2 cache size
[    0.000000] CVMSEG size: 0 cache lines (0 bytes)
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 000d9602 (Cavium Octeon III)
[    0.000000] Checking for the multiply/shift bug... no.
[    0.000000] Checking for the daddiu bug... no.
[    0.000000] Wasting 278528 bytes for tracking 4352 unused pages
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Using appended Device Tree.
[    0.000000] software IO TLB: mapped [mem 0x0330e000-0x0334e000] (0MB)
[    0.000000] Primary instruction cache 78kB, virtually tagged, 39 way, 16 sets, linesize 128 bytes.
[    0.000000] Primary data cache 32kB, 32-way, 8 sets, linesize 128 bytes.
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000001100000-0x00000000efffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000001100000-0x000000000324bfff]
[    0.000000]   node   0: [mem 0x0000000003300000-0x000000000fafffff]
[    0.000000]   node   0: [mem 0x0000000020000000-0x000000004ebfffff]
[    0.000000] Zeroed struct page in unavailable ranges: 10932 pages
[    0.000000] Initmem setup node 0 [mem 0x0000000001100000-0x000000004ebfffff]
[    0.000000] percpu: Embedded 18 pages/cpu s35872 r8192 d29664 u73728
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 247286
[    0.000000] Kernel command line:  root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait console=ttyS0,115200
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)

With a blinking cursor. I can't type or reconnect. Any idea?

Kind regards,

carstino

I flashed my original firmware v.2 & u-boot 3.0 to OpenWRT 21.02 snapshot today. I first tried the original method but it failed so I then tried your method with positive result.
Used console cable connection.

Actually it works so smooth I would have no problem seeing this method as formal install method if the other one doesn’t work.

The only thing I changed was to shorten the filenames a lot because PuTTY didn’t manage well with the longest lines of text.

1 Like

I used the instructions above, had to copy image on EdgeOS to eMMC (uboot is version 3 on my router). After installing snapshot version (USB+terminal cable), I "upgraded" it to May 30 rc2 version using Sysupgrade. I'm more general purpose user than developer and more of GUI than CLI guy, but without these instructions it would have been impossible to get it up and running.

For me, reasons for choosing OpenWRT and EdgeRouter was 4G/5G wireless internet connection. I do have ZTE MC801A modem which has powerful hardware, but quite sad firmware. My ISP has CG-NAT on 4G, public IPv4 costs extra, public IPv6 is free, /64 prefix without PD. So I need something that can handle this IPv6 and is well documented, and I'll use ZTE as bridge. I can do basic things with Cisco IOS, but IPv6/64 without PD seems to be such new thing, that there aren't too many examples on Cisco side, therefore using OpenWRT. For hardware side, EdgeRouter 4 seems very powerful (I do have C897 and I'm used to snappy hardware in metal enclosure!) and is reasonably priced.

Thanks for damex and other people contributing for ER4-version!

soon after device was implemented - there happened to be a bug (not directly related to edgerouter 4) regarding not having a usb storage available for initramfs. it should be fixed by now and if it is still not - please report back so it could be checked even further.

1 Like

Team I'm having the same issue not being able to mount sda1 because it does not exist. I'm at that point in the load instructions and not sure how to continue. I would like to follow pdecat's lead in copying the file locally to then mount it not needing the USB but I'm currently booted into OpenWRT. My understanding (am I wrong) is that if I just power down the device at this point and power it back up I would be back to the very start of the process running the Edgerouter 4 firmware again? I would like to verify this before I proceed with anything...
Thank you everyone for your support as I'm a brand new Openwrt user (trying to be).

The easiest way to install on er4 is to load the initramfs image from a USB flash drive and from the ram running OpenWrt install the sysupgrade image as usual from luci.

1 Like

I was following the instructions here: https://openwrt.org/toh/ubiquiti/edgerouter_4
I ran into the same issue that was experienced above by @pdecat .

I have done everything you mention but stuck at the mount so I can't load sysupgrade.

USB flash drive method

- Download the initramfs-kernel.bin and sysupgrade.tar images to a USB flash drive that is formatted as vfat/fat32
- Connect the flash drive to the Edgerouter's front USB port
- Reboot or power on the Edgerouter
- Interrupt the uboot process by pressing any key
- Start USB detection by typing

usb start  

- Load the initramfs-kernel to memory by typing

fatload usb 0:1 0x20000000 openwrt-21.02.3-octeon-ubnt_edgerouter-4-initramfs-kernel.bin  

- Once loaded, load the image by typing

bootoctlinux 0 numcores=4 endbootargs mem=0

This should have booted the factory image and now prompts you the OpenWrt banner
- Mount the USB flash drive for the sysupgrade image by typing

mkdir /tmp/sda **-- Complete to here**
mount /dev/sda1 /tmp/sda  **--Can't execute this step**

I get:

root@OpenWrt:/# mount /dev/sda1 /tmp/sda
[52199.609403] /dev/sda1: Can't open blockdev
[52199.614360] /dev/sda1: Can't open blockdev
mount: mounting /dev/sda1 on /tmp/sda failed: No such file or directory
root@OpenWrt:/#

Is this truly running openwrt only in RAM so I can start over and do the local copy as others have done?

You only need the initramfs image (with installed luci package) on the USB. Once loaded in ram and booted just open luci in webbrowser and run the sysupgrade image with the luci upgrade process.

Probably, and if you have actually by accident installed in on flash, well I guess it is possible at least once in the universe. But anyway, that is the goal to install it so in that case you have managed your first OpenWrt install.

Just pull the power and see what boots.

Sounds good thank you!

Thank you for the instruction besides having to change the file names to the current version these instructions worked perfectly. Thanks again!

1 Like

Following the chatter here. Just flashed the ER-4 I had sitting on the shelf with 24.10. I had the same issue with no USB (/dev/sda1) to copy the sysupgrade.tar to. So, my workaround was to boot the initial kernel.bin image with the internet(eth0) plugged in. The router was set to 192.168.1.1, and I plugged my laptop into eth1, and it pulled 192.168.1.164. I put a root password, ran 'opkg update and opkg install openssh-sftp-server', and configured those packages. I then just used Filezilla to copy the sysupgrade.tar file to \tmp and ran it from there. It rebooted, and voila, I was all set to go with Openwrt with Luci.

So I think maybe some of the issues around this usb install are related to partition numbers. I created single ext4 partition on my usb stick and copied the .bin and .tar 24.10.1 files onto it.

usb start

  • Load the initramfs-kernel to memory by typing # I changed to using the ext4 loader and partition to 0

ext4load usb 0:0 0x20000000 openwrt-24.10.1-octeon-generic-ubnt_edgerouter-4-initramfs-kernel.bin

  • Once loaded, load the image by typing
    bootoctlinux 0 numcores=4 endbootargs mem=0
    This should have booted the factory image and now prompts you the OpenWrt banner
  • Mount the USB flash drive for the sysupgrade image by typing

mkdir /tmp/sda
mount /dev/sda /tmp/sda #removed the 1 as single partion needs no reference

  • Flash OpenWrt to the internal flash by finally typing

sysupgrade /tmp/sda/openwrt-24.10.1-octeon-generic-ubnt_edgerouter-4-squashfs-sysupgrade.tar

1 Like