aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/nand
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ath79/nand')
-rwxr-xr-xtarget/linux/ath79/nand/base-files/etc/board.d/01_leds18
-rwxr-xr-xtarget/linux/ath79/nand/base-files/etc/board.d/02_network35
-rw-r--r--target/linux/ath79/nand/base-files/lib/upgrade/platform.sh20
3 files changed, 73 insertions, 0 deletions
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
new file mode 100755
index 0000000000..59c35ed828
--- /dev/null
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+board=$(board_name)
+boardname="${board##*,}"
+
+case "$board" in
+glinet,gl-ar300m-nand)
+ ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth0"
+ ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network
new file mode 100755
index 0000000000..65ce439545
--- /dev/null
+++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+. /lib/functions/system.sh
+. /lib/functions/uci-defaults.sh
+
+ath79_setup_interfaces()
+{
+ local board="$1"
+
+ case "$board" in
+ *)
+ ucidef_set_interfaces_lan_wan "eth0" "eth1"
+ ;;
+ esac
+}
+
+ath79_setup_macs()
+{
+ local board="$1"
+
+ case "$board" in
+ esac
+
+ [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
+ [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
+ [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
+}
+
+board_config_update
+board=$(board_name)
+ath79_setup_interfaces $board
+ath79_setup_macs $board
+board_config_flush
+
+exit 0
diff --git a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
new file mode 100644
index 0000000000..b02ab9a080
--- /dev/null
+++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+
+PART_NAME=firmware
+REQUIRE_IMAGE_METADATA=1
+
+platform_check_image() {
+ return 0
+}
+
+platform_do_upgrade() {
+ local board=$(board_name)
+
+ case "$board" in
+ *)
+ default_do_upgrade "$1"
+ ;;
+ esac
+}