mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-26 08:51:13 +00:00
ee96fa15b1
Convert whole target to Device Tree based board detection instead of identifying devices by dts file name. With this we can drop mvebu.sh translation script and rely on common method for model detection. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
57 lines
1.0 KiB
Bash
57 lines
1.0 KiB
Bash
#!/bin/sh
|
|
#
|
|
# Copyright (C) 2015 OpenWrt.org
|
|
#
|
|
|
|
[ ! -e /etc/config/wireless ] && exit 0
|
|
|
|
. /lib/functions.sh
|
|
. /lib/functions/system.sh
|
|
|
|
board=$(board_name)
|
|
|
|
case "$board" in
|
|
linksys,caiman|linksys,cobra|linksys,mamba|linksys,shelby|linksys,venom)
|
|
SKU=$(strings /dev/mtd3|sed -ne 's/^cert_region=//p')
|
|
WIFIMAC2G=$(macaddr_add $(cat /sys/class/net/eth0/address) +1)
|
|
WIFIMAC5G=$(macaddr_add $WIFIMAC2G +1)
|
|
case "$SKU" in
|
|
AP)
|
|
REGD=CN
|
|
;;
|
|
AU)
|
|
REGD=AU
|
|
;;
|
|
CA)
|
|
REGD=CA
|
|
;;
|
|
EU)
|
|
REGD=DE
|
|
;;
|
|
US)
|
|
REGD=US
|
|
;;
|
|
esac
|
|
|
|
case "$board" in
|
|
linksys,mamba)
|
|
WIFIMAC0=$WIFIMAC2G
|
|
WIFIMAC1=$WIFIMAC5G
|
|
;;
|
|
*)
|
|
WIFIMAC0=$WIFIMAC5G
|
|
WIFIMAC1=$WIFIMAC2G
|
|
;;
|
|
esac
|
|
|
|
uci get wireless.radio0.country || uci set wireless.radio0.country=$REGD
|
|
uci get wireless.@wifi-iface[0].macaddr || uci set wireless.@wifi-iface[0].macaddr=$WIFIMAC0
|
|
uci get wireless.radio1.country || uci set wireless.radio1.country=$REGD
|
|
uci get wireless.@wifi-iface[1].macaddr || uci set wireless.@wifi-iface[1].macaddr=$WIFIMAC1
|
|
;;
|
|
esac
|
|
|
|
uci commit wireless
|
|
|
|
exit 0
|