mxs.sh 730 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2013 OpenWrt.org
  4. #
  5. MXS_BOARD_NAME=
  6. MXS_MODEL=
  7. mxs_board_detect() {
  8. local machine
  9. local name
  10. machine=$(cat /proc/device-tree/model)
  11. case "$machine" in
  12. *"I2SE Duckbill"*)
  13. name="duckbill"
  14. ;;
  15. *"i.MX23 Olinuxino Low Cost Board")
  16. name="olinuxino"
  17. ;;
  18. esac
  19. [ -z "$name" ] && name="unknown"
  20. [ -z "$MXS_BOARD_NAME" ] && MXS_BOARD_NAME="$name"
  21. [ -z "$MXS_MODEL" ] && MXS_MODEL="$machine"
  22. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  23. echo "$MXS_BOARD_NAME" > /tmp/sysinfo/board_name
  24. echo "$MXS_MODEL" > /tmp/sysinfo/model
  25. }
  26. mxs_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. }