Files
openwrt/target/linux/generic
Matt Eaton 7161fa5814 generic: mikrotik: expose preboot etherboot settings in rb_softconfig
RouterBOOT can be told to look for a netboot server for a few seconds
before falling through to the configured boot device, optionally
restricted to a single Netinstall server. RouterOS calls these
preboot-etherboot and preboot-etherboot-server. Neither was modelled
here, so on a board running Linux rather than RouterOS they could not be
read or changed at all.

That matters most on a board where Linux has replaced RouterOS: without
these, the only way to arrange a netboot is boot_device=ethonce, which
is one-shot and must be rewritten before every attempt. preboot-etherboot
is persistent, needs no write per boot, and still falls through to the
boot device when no server answers.

Add both:

  preboot_etherboot         tag 0x24, 0..30 seconds, zero disabling the wait
  preboot_etherboot_server  tag 0x25, an IPv4 address, 0.0.0.0 for any

RouterBOOT has no interactive presentation of either setting to mimic:
neither appears in its setup menu, and both can only be written from
RouterOS. Rather than borrow the "disabled" and "any" keywords RouterOS
uses for zero, present both tags as they are stored. RouterOS rejects a
timeout of 31, which is where the upper bound comes from.

Note the server address is stored in network byte order, unlike every
other tag in this record, which is a little-endian u32. 192.168.1.142 is
held as c0 a8 01 8e, so reading it as a u32 would yield 142.1.168.192 -
a valid-looking address pointing at a different host.

Verified on a MikroTik E50UG (hEX refresh):

  - the show path decodes a server address written by RouterOS 7.24.2
  - a write of 10.20.30.40 lands in flash as 0a 14 1e 28
  - out-of-range timeouts and malformed addresses are rejected
  - with preboot_etherboot set to 5 from Linux and boot_device left at
    flasheth, RouterBOOT netboots; set back to zero, it boots from NAND

Both tag numbers were confirmed by diffing the soft_config record before
and after changing each setting from RouterOS. They have not been
cross-checked against other MikroTik hardware.

Signed-off-by: Matt Eaton <git@divinehawk.com>
Link: https://github.com/openwrt/openwrt/pull/25044
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-09-08 18:20:49 +02:00
..
2026-09-05 21:50:32 +02:00
2026-08-13 00:22:32 +02:00
2026-09-05 21:50:32 +02:00
2026-08-13 00:22:32 +02:00