Add support for MikroTik RB5009UG

Haha, sorry for the confusing messages English isn't my first language. I know by default tftp isn't enable by default so the jailbreak file was needed in order to enable tftp boot?

No, it's a regular Router OS configuration. Doesn't require any kind of jailbreak or anything. You did read @adron's GitHub readme guide, right?

Yep; I prepared the tftp server but when ever I run this command " ```
/system/routerboard/settings/set boot-device=ethernet"

input does not match any value of boot-device

You got highlighted with this reply earlier:

1 Like

sorry I didn't see it. Thanks again

Keep us posted, I still can't get it going myself, tried ROS 7.0.5, 7.1 RC4 and 7.2 RC1 so far.

What problem were you running into yourself? I am on 7.0.5?

Well the device will pick up the image being fed through TFTP, like this:

dnsmasq-tftp: sent /srv/tftp/openwrt-mvebu-cortexa72-mikrotik_rb5009-initramfs-fit-uImage.elf to 192.168.1.163

But after a while, it would request a new lease from dnsmasq, and I'd end up with RouterOS again. Also tried with the updated aux-loader from today.

1 Like

Have you tried hooking up serial at all? I know, it likely won't help you much as at least MikroTik's crappy RouterBoot doesn't show anything but maybe @adron's auxloader2 or the later Linux kernel shows you something useful.

hello i used to use tinypxe to flash mikrotik is this the equivalent of tftpboot, thanks :slight_smile:

1 Like

First time I heard about tinypxe but as long as it is able to offer BOOTP and TFTP I guess it should be fine.

As mentioned further up in this thread using dnsmasq may be a simpler approach though.

1 Like

Good evening everyone I plan to take this router in the coming days, if I do this following method do you think it is possible because I do not currently understand the flashing method?? thank you

On Windows

Reconfigure your PC Ethernet to a static IP at 192.168.1.10

The freeware Tiny PXE server is a DHCP/TFTP server that implements the RFC951 BOOTP capability. To enable Tiny PXE's rfc951 BOOTP capabilities, rfc951=1 must be set in the [dhcp] section of the Tiny PXE config.ini file.
Select the OpenWrt initramfs file as the Boot file Filename, un-check the gPXE or iPXE Filename option, select the Option 54 IP address for the ethernet cable you have connected to the RouterBoard, and put Tiny PXE Online.
if you have problems running Tiny PXE, you may need to turn off your firewall, run Tiny PXE as administrator, or disable all other ethernet/bluetooth/wifi in Network Connections.

It is especially important to ensure only one DHCP/BOOTP/TFTP server is running on your network while attempting a netboot since BOOTP has no support for Proxy DHCP or authoritative DHCP - so be sure to disconnect from any other routers before running Tiny PXE.

Methods to set RouterBoard so it will TFTP netboot

Connect the ethernet 1 port of your routerboard (typically the WAN port) to a network configured to reach the DHCP/BOOTP/TFTP server that you have set up.

The RouterBoard default boot protocol is BOOTP. You can change the RouterBoot boot protocol from BOOTP to DHCP by using the COM port, RouterOS, or rbcfg from OpenWrt as documented in this list of netboot methods.

The instructions in this wiki tend to assume you have changed the netboot protocol to DHCP since DHCP netboot is readily supported by dnsmasq (the most common DHCP/BOOTP/TFTP server in Linux distributions).
However, if you have chosen to use a DHCP/BOOTP/TFTP netboot server that supports rfc951 BOOTP (such as Tiny PXE, with rfc951=1 set in the [dhcp] section of the config.ini), any of these netboot methods will work fine without any changes to the Routerboot boot protocol.

When a boot protocol is set in RouterBoot, it is remembered: any of the methods here that force a netboot will then use the BOOTP or DHCP boot protocol previously selected in RouterBoot.

Method 1 - Use the RouterBoard Reset button to enable TFTP netboot

This method will work on all RouterBoards, including RouterBoards without a serial port. It is certainly the simplest approach to perform a netboot if using an rfc951 BOOTP-capable DHCP/BOOTP/TFTP server.

Most RouterBoard models generate a short beep when an image begins to netboot or load from flash (unless the RouterBoard has been put in 'silent mode' from the RouterBoot menu). So if you are running without a connection to the serial console COM port to view boot activity from a terminal window, you can use the beep to know when RouterBoot has successfully started to load an image (either a netboot image or the existing flash image).

If you are using Tiny PXE as your netboot PXE DHCP/BOOTP/TFTP server, you can watch its information/log window to see exactly when Tiny PXE begins uploading the initramfs file to the RouterBoard (TFTPd:DoReadFile shows up in the information/log window): this will be the same time the RouterBoard beeps.

To enable a netboot using the Reset button:

  1. Unplug the RouterBoard power jack

  2. Hold the reset button (on some models this is just a hole with a hidden pushbutton switch).

  3. Plug the power jack back in

  4. Observe activity LED(s). The LED behavior varies across models, but can be a good indicator about the boot process. See the Mikrotik wiki https://wiki.mikrotik.com/wiki/Manual:RouterBOOT for details.

  5. Release the reset button after you hear the beep (maximum 15 - 20 seconds).

I ended up getting stuck here multiple times. I couldn't get it to boot the elf file itself...

I just finished backporting of the QCA8081 driver to a 5.10 kernel. Also fixed the problem with Wan work. Try this updated images - it should work. With the new aux-loader, now you can simply hold down the reset button and turn on the power, after 10 seconds release the reset button and the device will start booting from TFTP.

P.S: and who has a 2.5 gigabit port - please test the backported QCA8081 PHY driver work.

2 Likes

Just an introductory note: the RB5009UG also supports UART booting at any time (basically directly by the boot ROM of the SoC). So should anything ever go wrong one may just crack open the case (just a bunch of easily accessible screws really), connect some RPi USB-to-UART adapter with some jumper wires and recover it.

Note that the serial UART is NOT enabled anywhere in any of MikroTik's default crap shit on RB5009UG.

At least my RB5009UG did default to BOOTP. However, that may be changed to DHCP easily just like the boot-device may be changed to try-ethernet-once-then-nand. However, I could not get this crap shit RouterBoot to play nice with my regular DHCP/TFTP infrastructure I use daily professionally for all my work. But at least on Linux just using dnsmasq directly works.

To be honest, I am not so sure whether this is the case on RB5009UG. For some reason, MikroTik seems to have changed their mind on many "regular" things here.

Anyway, I just used regular Router OS settings to set the boot-device to try-ethernet-once-then-nand which worked like a charm.

2 Likes

This method works with latest aux-loader.elf. I wrote about it above.

1 Like

Try to turn it on with the reset pressed and hold for 10-15 seconds. In this case, network activity should appear on the port1. If this is not there, then try another switch for the port1(as it does not work with some switches!). And of course use my latest OpenWrt image with the latest aux loader as I just fixed it yesterday for this mode of operation!

1 Like

Make sure to backport this:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/drivers/net/phy/at803x.c?id=881cc731df6af99a21622e9be25a23b81adcd10b

Wirhout it only 2.5G mode will work

2 Likes

Yes, I know. But it won't help anybody for any initial flashing I suppose.

Yes, I've been through it all. I just took your QCA8081 patches and backported it to 5.10.
And I checked the operation of the port1 at 10, 100 and 1000 Mbit/sec.