| #!/bin/sh |
| # |
| # Copyright (C) 2014 OpenWrt.org |
| # |
| |
| MMP_BOARD_NAME= |
| MMP_MODEL= |
| |
| mmp_board_detect() { |
| local machine |
| local name |
| |
| machine=$(cat /etc/mversion) |
| |
| case "$machine" in |
| *"asr1803"*) |
| name="asr1803" |
| ;; |
| *"asr1806"*) |
| name="asr1806" |
| ;; |
| *"asr1828"*) |
| name="asr1828" |
| ;; |
| *"asr1901"*) |
| name="asr1901" |
| ;; |
| *"asr1903"*) |
| name="asr1903" |
| ;; |
| *"asr1906"*) |
| name="asr1906" |
| ;; |
| esac |
| |
| [ -z "$name" ] && name="unknown" |
| |
| [ -z "$MMP_BOARD_NAME" ] && MMP_BOARD_NAME="$name" |
| [ -z "$MMP_MODEL" ] && MMP_MODEL="$machine" |
| |
| [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" |
| |
| echo "$MMP_BOARD_NAME" > /tmp/sysinfo/board_name |
| echo "$MMP_MODEL" > /tmp/sysinfo/model |
| } |
| |
| mmp_board_name() { |
| local name |
| |
| [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name) |
| [ -z "$name" ] && name="unknown" |
| |
| echo "$name" |
| } |