sunxi.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #!/bin/sh
  2. # defaults
  3. SUNXI_BOARD_NAME="generic"
  4. SUNXI_BOARD_MODEL="Generic sunxi board"
  5. sunxi_board_detect() {
  6. local board
  7. local model
  8. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  9. model="$( cat /proc/device-tree/model )"
  10. case "$model" in
  11. "Mele A1000")
  12. board="a1000"
  13. ;;
  14. "BA10 tvbox")
  15. board="ba10-tvbox"
  16. ;;
  17. "Cubietech Cubieboard")
  18. board="cubieboard"
  19. ;;
  20. "Miniand Hackberry")
  21. board="hackberry"
  22. ;;
  23. "INet-97F Rev 02")
  24. board="inet97fv2"
  25. ;;
  26. "PineRiver Mini X-Plus")
  27. board="mini-xplus"
  28. ;;
  29. "Olimex A10-OLinuXino-LIME")
  30. board="olinuxino-lime"
  31. ;;
  32. "LinkSprite pcDuino")
  33. board="pcduino"
  34. ;;
  35. "Olimex A10s-Olinuxino Micro")
  36. board="olinuxino-micro"
  37. ;;
  38. "R7 A10s hdmi tv-stick")
  39. board="r7-tv-dongle"
  40. ;;
  41. "HSG H702")
  42. board="hsg-h702"
  43. ;;
  44. "Olimex A13-Olinuxino")
  45. board="olinuxino"
  46. ;;
  47. "Olimex A13-Olinuxino Micro")
  48. board="olinuxino-micro"
  49. ;;
  50. "Allwinner A31 APP4 EVB1 Evaluation Board")
  51. board="app4-evb1"
  52. ;;
  53. "WITS A31 Colombus Evaluation Board")
  54. board="colombus"
  55. ;;
  56. "Merrii A31 Hummingbird")
  57. board="hummingbird"
  58. ;;
  59. "Mele M9 / A1000G Quad top set box")
  60. board="m9"
  61. ;;
  62. "LeMaker Banana Pi")
  63. board="bananapi"
  64. ;;
  65. "LeMaker Banana Pro")
  66. board="bananapro"
  67. ;;
  68. "Cubietech Cubieboard2")
  69. board="cubieboard2"
  70. ;;
  71. "Cubietech Cubietruck")
  72. board="cubietruck"
  73. ;;
  74. "Merrii A20 Hummingbird")
  75. board="hummingbird"
  76. ;;
  77. "I12 / Q5 / QT840A A20 tvbox")
  78. board="i12-tvbox"
  79. ;;
  80. "Lamobo R1")
  81. board="lamobo-r1"
  82. ;;
  83. "Olimex A20-OLinuXino-LIME")
  84. board="olinuxino-lime"
  85. ;;
  86. "Olimex A20-Olinuxino Micro")
  87. board="olinuxino-a20-micro"
  88. ;;
  89. "LinkSprite pcDuino3")
  90. board="pcduino3"
  91. ;;
  92. "Ippo Q8H Dual Core Tablet (v5)")
  93. board="ippo-q8h-v5"
  94. ;;
  95. "HAOYU Electronics Marsboard A10")
  96. board="marsboard_a10"
  97. ;;
  98. esac
  99. if [ "$board" != "" ]; then
  100. SUNXI_BOARD_NAME="$board"
  101. fi
  102. if [ "$model" != "" ]; then
  103. SUNXI_BOARD_MODEL="$model"
  104. fi
  105. echo "$SUNXI_BOARD_NAME" > /tmp/sysinfo/board_name
  106. echo "$SUNXI_BOARD_MODEL" > /tmp/sysinfo/model
  107. echo "Detected $SUNXI_BOARD_NAME // $SUNXI_BOARD_MODEL"
  108. }
  109. sunxi_board_name() {
  110. local name
  111. [ -f /tmp/sysinfo/board_name ] && name="$(cat /tmp/sysinfo/board_name)"
  112. [ -z "$name" ] && name="unknown"
  113. echo "$name"
  114. }