mediatek.sh 682 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2016 OpenWrt.org
  4. #
  5. mediatek_board_detect() {
  6. local machine
  7. local name
  8. machine=$(cat /proc/device-tree/model)
  9. case "$machine" in
  10. "MediaTek MT7623 evaluation board")
  11. name="mt7623_evb"
  12. ;;
  13. "MediaTek MT7623 eMMC evaluation board")
  14. name="eMMC"
  15. ;;
  16. "MediaTek MT7623 NAND evaluation board")
  17. name="NAND"
  18. ;;
  19. esac
  20. [ -z "$name" ] && name="unknown"
  21. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  22. echo "$name" > /tmp/sysinfo/board_name
  23. echo "$machine" > /tmp/sysinfo/model
  24. }
  25. mediatek_board_name() {
  26. local name
  27. [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
  28. [ -z "$name" ] && name="unknown"
  29. echo "$name"
  30. }