aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/base-files
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ath79/base-files')
-rwxr-xr-xtarget/linux/ath79/base-files/etc/board.d/02_network13
-rw-r--r--target/linux/ath79/base-files/lib/upgrade/platform.sh13
2 files changed, 26 insertions, 0 deletions
diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network
index 1a83d56cc7..14f6c59822 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -141,6 +141,14 @@ ath79_setup_interfaces()
tplink,tl-wr941-v2)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
+ ubnt,routerstation)
+ ucidef_set_interfaces_lan_wan "eth1" "eth0"
+ ;;
+ ubnt,routerstation-pro)
+ ucidef_set_interface_wan "eth0"
+ ucidef_add_switch "switch0" \
+ "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
+ ;;
ubnt,unifiac-mesh-pro|\
ubnt,unifiac-pro)
ucidef_add_switch "switch0" \
@@ -194,6 +202,11 @@ ath79_setup_macs()
base_mac=$(mtd_get_mac_binary u-boot 130048)
wan_mac=$(macaddr_add "$base_mac" 1)
;;
+ ubnt,routerstation|\
+ ubnt,routerstation-pro)
+ wan_mac=$(fconfig -s -r -d $(find_mtd_part "RedBoot config") -n ar7100_esa)
+ lan_mac=$(macaddr_add "$wan_mac" 1)
+ ;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
diff --git a/target/linux/ath79/base-files/lib/upgrade/platform.sh b/target/linux/ath79/base-files/lib/upgrade/platform.sh
index 08039e0052..806b3f0787 100644
--- a/target/linux/ath79/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/base-files/lib/upgrade/platform.sh
@@ -5,6 +5,15 @@
PART_NAME=firmware
REQUIRE_IMAGE_METADATA=1
+routerstation_do_upgrade() {
+ local append
+ local kern_length=0x$(dd if="$1" bs=2 skip=1 count=4 2>/dev/null)
+
+ [ -f "$CONF_TAR" -a "$SAVE_CONFIG" -eq 1 ] && append="-j $CONF_TAR"
+ dd if="$1" bs=64k skip=1 2>/dev/null | \
+ mtd -r $append -Fkernel:$kern_length:0x80060000,rootfs write - kernel:rootfs
+}
+
platform_check_image() {
return 0
}
@@ -17,6 +26,10 @@ platform_do_upgrade() {
PART_NAME="rootfs:kernel"
default_do_upgrade "$ARGV"
;;
+ ubnt,routerstation|\
+ ubnt,routerstation-pro)
+ routerstation_do_upgrade "$ARGV"
+ ;;
*)
default_do_upgrade "$ARGV"
;;