diff options
Diffstat (limited to 'target/linux/mediatek/base-files/lib/mediatek.sh')
-rw-r--r-- | target/linux/mediatek/base-files/lib/mediatek.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/target/linux/mediatek/base-files/lib/mediatek.sh b/target/linux/mediatek/base-files/lib/mediatek.sh new file mode 100644 index 0000000000..8466c72ee3 --- /dev/null +++ b/target/linux/mediatek/base-files/lib/mediatek.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Copyright (C) 2015 OpenWrt.org +# + +mediatek_board_detect() { + local machine + local name + + machine=$(cat /proc/device-tree/model) + + case "$machine" in + "MediaTek MT7623 Evaluation Board") + name="mt7623_evb" + ;; + esac + + [ -z "$name" ] && name="unknown" + + [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" + + echo "$name" > /tmp/sysinfo/board_name + echo "$machine" > /tmp/sysinfo/model +} + +mediatek_board_name() { + local name + + [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name) + [ -z "$name" ] && name="unknown" + + echo "$name" +} |