oxnas.sh 883 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2013 OpenWrt.org
  4. #
  5. OXNAS_BOARD_NAME=
  6. OXNAS_MODEL=
  7. oxnas_board_detect() {
  8. local machine
  9. local name
  10. machine=$(cat /proc/device-tree/model)
  11. case "$machine" in
  12. *"Akitio MyCloud mini"*)
  13. name="akitio"
  14. ;;
  15. *"MitraStar Technology Corp. STG-212"*)
  16. name="stg212"
  17. ;;
  18. *"Shuttle KD20"*)
  19. name="kd20"
  20. ;;
  21. *"Pogoplug Pro"*)
  22. name="pogoplug-pro"
  23. ;;
  24. *"Pogoplug V3"*)
  25. name="pogoplug-v3"
  26. ;;
  27. esac
  28. [ -z "$name" ] && name="unknown"
  29. [ -z "$OXNAS_BOARD_NAME" ] && OXNAS_BOARD_NAME="$name"
  30. [ -z "$OXNAS_MODEL" ] && OXNAS_MODEL="$machine"
  31. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  32. echo "$OXNAS_BOARD_NAME" > /tmp/sysinfo/board_name
  33. echo "$OXNAS_MODEL" > /tmp/sysinfo/model
  34. }
  35. oxnas_board_name() {
  36. local name
  37. [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
  38. [ -z "$name" ] && name="unknown"
  39. echo "$name"
  40. }