02_network 922 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2014-2016 OpenWrt.org
  4. # Copyright (C) 2016 LEDE-Project.org
  5. #
  6. . /lib/functions/uci-defaults.sh
  7. . /lib/mvebu.sh
  8. board_config_update
  9. board=$(mvebu_board_name)
  10. case "$board" in
  11. armada-385-linksys-caiman|\
  12. armada-385-linksys-cobra|\
  13. armada-385-linksys-rango|\
  14. armada-385-linksys-shelby|\
  15. armada-xp-linksys-mamba)
  16. ucidef_set_interfaces_lan_wan "eth0" "eth1"
  17. ucidef_add_switch "switch0" \
  18. "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0" "4:wan" "6@eth1"
  19. ;;
  20. armada-385-db-ap)
  21. ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
  22. ;;
  23. armada-xp-gp)
  24. ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
  25. ;;
  26. armada-388-clearfog)
  27. ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
  28. swconfig list 2>&1 | grep -q switch0 && \
  29. ucidef_add_switch "switch0" \
  30. "0:lan:5" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5@eth0" "6:lan:6"
  31. ;;
  32. *)
  33. ucidef_set_interface_lan "eth0"
  34. ;;
  35. esac
  36. board_config_flush
  37. exit 0