From cd34cb2ebb7da0d814744c3d5dc001af192d611e Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 8 Apr 2015 00:42:22 +0200
Subject: [PATCH] gluon-core, gluon-setup-mode: improve support for UAP
 Outdoor+

---
 package/gluon-core/files/lib/gluon/upgrade/010-primary-mac    | 4 ++++
 package/gluon-core/files/lib/gluon/upgrade/020-interfaces     | 2 +-
 .../gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac
index 12128efcb..70aee39d3 100755
--- a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac
+++ b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac
@@ -23,6 +23,10 @@ if platform.match('ar71xx', 'generic', {'tl-wdr3600', 'tl-wdr4300'}) then
   table.insert(try_files, 1, '/sys/class/ieee80211/phy1/macaddress')
 end
 
+if platform.match('ar71xx', 'generic', {'unifi-outdoor-plus'}) then
+  table.insert(try_files, 1, '/sys/class/net/eth0/address')
+end
+
 if platform.match('ar71xx', 'generic', {'archer-c5', 'archer-c7'}) then
   table.insert(try_files, 1, '/sys/class/net/eth1/address')
 end
diff --git a/package/gluon-core/files/lib/gluon/upgrade/020-interfaces b/package/gluon-core/files/lib/gluon/upgrade/020-interfaces
index 077f77be2..a051c738d 100755
--- a/package/gluon-core/files/lib/gluon/upgrade/020-interfaces
+++ b/package/gluon-core/files/lib/gluon/upgrade/020-interfaces
@@ -16,7 +16,7 @@ if not (sysconfig.lan_ifname or sysconfig.wan_ifname) then
   local lan_ifname = uci:get('network', 'lan', 'ifname')
   local wan_ifname = uci:get('network', 'wan', 'ifname')
 
-  if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw'}) then
+  if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus'}) then
     lan_ifname, wan_ifname = wan_ifname, lan_ifname
   end
 
diff --git a/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname b/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname
index f60848148..3c4a8afe8 100755
--- a/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname
+++ b/package/gluon-setup-mode/files/lib/gluon/upgrade/320-setup-ifname
@@ -8,7 +8,7 @@ if sysconfig.setup_ifname then
    os.exit(0)
 end
 
-if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw'}) then
+if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus'}) then
    sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.wan_ifname or sysconfig.lan_ifname
 else
    sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.lan_ifname or sysconfig.wan_ifname
-- 
GitLab