diff --git a/files/etc/uci-defaults/12_mikrotik_boot b/files/etc/uci-defaults/12_mikrotik_boot new file mode 100755 index 00000000..34bc7587 --- /dev/null +++ b/files/etc/uci-defaults/12_mikrotik_boot @@ -0,0 +1,11 @@ +#! /bin/sh +# +# On Mikrotik devices, make sure the boot mode is 'flasheth' otherwise +# the node can fail to boot. +# +if [ -f /sys/firmware/mikrotik/soft_config/boot_device ]; then + if [ "$(grep '\[flasheth\]' /sys/firmware/mikrotik/soft_config/boot_device)" = "" ]; then + echo "flasheth" > /sys/firmware/mikrotik/soft_config/boot_device + echo "1" > /sys/firmware/mikrotik/soft_config/commit + fi +fi