mcs814x.sh 769 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2012 OpenWrt.org
  4. #
  5. MCS814X_BOARD_NAME=
  6. MCS814X_MODEL=
  7. mcs814x_board_detect() {
  8. local machine
  9. local name
  10. machine=$(cat /proc/device-tree/model)
  11. case "$machine" in
  12. *"Devolo dLAN USB Extender")
  13. name="dlan-usb-extender"
  14. ;;
  15. *"Tigal RBT-832")
  16. name="rbt-832"
  17. ;;
  18. esac
  19. [ -z "$name" ] && name="unknown"
  20. [ -z "$MCS814X_BOARD_NAME" ] && MCS814X_BOARD_NAME="$name"
  21. [ -z "$MCS814X_MODEL" ] && MCS814X_MODEL="$machine"
  22. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  23. echo "$MCS814X_BOARD_NAME" > /tmp/sysinfo/board_name
  24. echo "$MCS814X_MODEL" > /tmp/sysinfo/model
  25. }
  26. mcs814x_board_name() {
  27. local name
  28. [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
  29. [ -z "$name" ] && name="unknown"
  30. echo "$name"
  31. }