[OpenWrt-Devel] [PATCH 2/2] sunxi: introduce sunxi_board_name() in /lib/sunxi.sh

Daniel Golle daniel at makrotopia.org
Thu Jan 15 15:51:22 EST 2015


Simiarl to other hardware targets, this can then be used for board-specific
stuff in preinit and uci-default scripts.

Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 target/linux/sunxi/base-files/lib/sunxi.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/target/linux/sunxi/base-files/lib/sunxi.sh b/target/linux/sunxi/base-files/lib/sunxi.sh
index b0a3874..af9b5eb 100644
--- a/target/linux/sunxi/base-files/lib/sunxi.sh
+++ b/target/linux/sunxi/base-files/lib/sunxi.sh
@@ -135,3 +135,12 @@ sunxi_board_detect() {
 	echo "$SUNXI_BOARD_MODEL" > /tmp/sysinfo/model
 	echo "Detected $SUNXI_BOARD_NAME // $SUNXI_BOARD_MODEL"
 }
+
+sunxi_board_name() {
+	local name
+
+	[ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
+	[ -z "$name" ] && name="unknown"
+
+	echo "$name"
+}
-- 
2.2.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list