. /lib/functions.sh

mt7621_bringup_dsa_master() {
    local board=$(board_name)
    local masterif

    case "$board" in
    ubnt,edgerouter-x|\
    ubnt,edgerouter-x-sfp)
        masterif="dsa"
        ;;
    *)
        masterif="eth0"
        ;;
    esac

    ip link set $masterif up
}

boot_hook_add preinit_main mt7621_bringup_dsa_master