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 75d60d16..231bb861 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac @@ -18,7 +18,10 @@ local try_files = { '/sys/class/net/eth0/address' } -if not util.contains({'x86', 'brcm2708'}, platform.get_target()) then +if not ( + util.contains({'x86', 'brcm2708'}, platform.get_target()) or + platform.match('ar71xx', 'mikrotik') +) then table.insert(try_files, 1, '/sys/class/ieee80211/phy0/macaddress') 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 a2b4f796..3dba79a9 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 @@ -5,13 +5,16 @@ local sysconfig = require 'gluon.sysconfig' if sysconfig.setup_ifname then - os.exit(0) + os.exit(0) end -if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus', 'uap-pro', 'unifiac-pro'}) then - sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.wan_ifname or sysconfig.lan_ifname +if + platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus', 'uap-pro', 'unifiac-pro'}) or + platform.match('ar71xx', 'mikrotik') +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 + sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.lan_ifname or sysconfig.wan_ifname end -- Remove the old sysconfig setting diff --git a/targets/ar71xx-mikrotik/profiles.mk b/targets/ar71xx-mikrotik/profiles.mk new file mode 100644 index 00000000..2dcc65fd --- /dev/null +++ b/targets/ar71xx-mikrotik/profiles.mk @@ -0,0 +1,10 @@ +# List of hardware profiles + +## Mikrotik + +# Will contain both ath5k and ath9k +# ath5k cards are commonly used with Mikrotik hardware +$(eval $(call GluonProfile,DefaultNoWifi,kmod-ath5k)) +$(eval $(call GluonProfileFactorySuffix,DefaultNoWifi,,-rootfs.tar.gz,-vmlinux-lzma.elf)) +$(eval $(call GluonProfileSysupgradeSuffix,DefaultNoWifi)) +$(eval $(call GluonModel,DefaultNoWifi,DefaultNoWifi,mikrotik)) diff --git a/targets/targets.mk b/targets/targets.mk index 95b868be..0e0f05a2 100644 --- a/targets/targets.mk +++ b/targets/targets.mk @@ -7,6 +7,7 @@ $(eval $(call GluonTarget,x86,64)) $(eval $(call GluonTarget,x86,xen_domu)) ifneq ($(BROKEN),) +$(eval $(call GluonTarget,ar71xx,mikrotik)) # BROKEN: no sysupgrade support $(eval $(call GluonTarget,ramips,rt305x)) # BROKEN: No AP+IBSS support $(eval $(call GluonTarget,brcm2708,bcm2708)) # BROKEN: Needs more testing $(eval $(call GluonTarget,brcm2708,bcm2709)) # BROKEN: Needs more testing