mirror of https://github.com/aredn/aredn.git
Merge branch 'develop' of ssh://git.aredn.org/aredn_ar71xx into dyn_css
This commit is contained in:
commit
928e7e720a
|
@ -25,3 +25,4 @@ config interface wan
|
||||||
option netmask <wan_mask>
|
option netmask <wan_mask>
|
||||||
option gateway <wan_gw>
|
option gateway <wan_gw>
|
||||||
|
|
||||||
|
include /etc/aredn_include/swconfig
|
||||||
|
|
|
@ -15,3 +15,4 @@ config button
|
||||||
option min '12'
|
option min '12'
|
||||||
option max '20'
|
option max '20'
|
||||||
|
|
||||||
|
include /etc/aredn_include/system_netled
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
config wifi-device radio0
|
config wifi-device radio0
|
||||||
option type mac80211
|
option type mac80211
|
||||||
option phy phy0
|
|
||||||
option channel <wifi_channel>
|
option channel <wifi_channel>
|
||||||
option chanbw <wifi_chanbw>
|
option chanbw <wifi_chanbw>
|
||||||
option distance <wifi_distance>
|
option distance <wifi_distance>
|
||||||
|
include /etc/aredn_include/radio0path
|
||||||
|
|
||||||
config wifi-iface
|
config wifi-iface
|
||||||
option device radio0
|
option device radio0
|
||||||
|
|
|
@ -19,3 +19,5 @@ config interface lan
|
||||||
config interface wan
|
config interface wan
|
||||||
option ifname "<wifi_intf>"
|
option ifname "<wifi_intf>"
|
||||||
option proto <wifi_proto>
|
option proto <wifi_proto>
|
||||||
|
|
||||||
|
include /etc/aredn_include/swconfig
|
||||||
|
|
|
@ -15,3 +15,4 @@ config button
|
||||||
option min '12'
|
option min '12'
|
||||||
option max '20'
|
option max '20'
|
||||||
|
|
||||||
|
include /etc/aredn_include/system_netled
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
config wifi-device radio0
|
config wifi-device radio0
|
||||||
option type mac80211
|
option type mac80211
|
||||||
option phy phy0
|
|
||||||
option distance <wifi_distance>
|
option distance <wifi_distance>
|
||||||
|
include /etc/aredn_include/radio0path
|
||||||
|
|
||||||
config wifi-iface
|
config wifi-iface
|
||||||
option device radio0
|
option device radio0
|
||||||
|
|
|
@ -41,3 +41,5 @@ config interface dtdlink
|
||||||
|
|
||||||
config interface wifi_mon
|
config interface wifi_mon
|
||||||
option proto none
|
option proto none
|
||||||
|
|
||||||
|
include /etc/aredn_include/swconfig
|
||||||
|
|
|
@ -15,3 +15,4 @@ config button
|
||||||
option min '12'
|
option min '12'
|
||||||
option max '20'
|
option max '20'
|
||||||
|
|
||||||
|
include /etc/aredn_include/system_netled
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
config wifi-device radio0
|
config wifi-device radio0
|
||||||
option type mac80211
|
option type mac80211
|
||||||
option phy phy0
|
|
||||||
option channel <wifi_channel>
|
option channel <wifi_channel>
|
||||||
option chanbw <wifi_chanbw>
|
option chanbw <wifi_chanbw>
|
||||||
option distance <wifi_distance>
|
option distance <wifi_distance>
|
||||||
option country <wifi_country>
|
option country <wifi_country>
|
||||||
|
include /etc/aredn_include/radio0path
|
||||||
|
|
||||||
config wifi-iface
|
config wifi-iface
|
||||||
option device radio0
|
option device radio0
|
||||||
|
|
|
@ -21,3 +21,5 @@ config interface lan
|
||||||
config interface wan
|
config interface wan
|
||||||
option ifname "<wan_intf>"
|
option ifname "<wan_intf>"
|
||||||
option proto <wan_proto>
|
option proto <wan_proto>
|
||||||
|
|
||||||
|
include /etc/aredn_include/swconfig
|
||||||
|
|
|
@ -15,3 +15,4 @@ config button
|
||||||
option min '12'
|
option min '12'
|
||||||
option max '20'
|
option max '20'
|
||||||
|
|
||||||
|
include /etc/aredn_include/system_netled
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
config wifi-device radio0
|
config wifi-device radio0
|
||||||
option type mac80211
|
option type mac80211
|
||||||
option phy phy0
|
|
||||||
option channel <wifi_channel>
|
option channel <wifi_channel>
|
||||||
option chanbw <wifi_chanbw>
|
option chanbw <wifi_chanbw>
|
||||||
option distance <wifi_distance>
|
option distance <wifi_distance>
|
||||||
|
include /etc/aredn_include/radio0path
|
||||||
|
|
||||||
config wifi-iface
|
config wifi-iface
|
||||||
option device radio0
|
option device radio0
|
||||||
|
|
|
@ -25,3 +25,4 @@ config interface wan
|
||||||
option netmask <wan_mask>
|
option netmask <wan_mask>
|
||||||
option gateway <wan_gw>
|
option gateway <wan_gw>
|
||||||
|
|
||||||
|
include /etc/aredn_include/swconfig
|
||||||
|
|
|
@ -15,3 +15,4 @@ config button
|
||||||
option min '12'
|
option min '12'
|
||||||
option max '20'
|
option max '20'
|
||||||
|
|
||||||
|
include /etc/aredn_include/system_netled
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
config wifi-device radio0
|
config wifi-device radio0
|
||||||
option type mac80211
|
option type mac80211
|
||||||
option phy phy0
|
|
||||||
option channel <wifi_channel>
|
option channel <wifi_channel>
|
||||||
option chanbw <wifi_chanbw>
|
option chanbw <wifi_chanbw>
|
||||||
option disabled 1
|
option disabled 1
|
||||||
|
include /etc/aredn_include/radio0path
|
||||||
|
|
||||||
config wifi-iface
|
config wifi-iface
|
||||||
option device radio0
|
option device radio0
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
config wifi-device radio0
|
|
||||||
option type mac80211
|
|
||||||
option phy phy0
|
|
||||||
option distance 0
|
|
||||||
|
|
||||||
config wifi-iface
|
|
||||||
option device radio0
|
|
||||||
option network lan
|
|
||||||
option mode ap
|
|
||||||
option ssid "MeshNode"
|
|
||||||
option hidden 0
|
|
||||||
option encryption none
|
|
|
@ -6,9 +6,113 @@ boot() {
|
||||||
|
|
||||||
[ -x /usr/local/bin/bbhn-postupgrade ] && /usr/local/bin/bbhn-postupgrade
|
[ -x /usr/local/bin/bbhn-postupgrade ] && /usr/local/bin/bbhn-postupgrade
|
||||||
|
|
||||||
# extract kamikaze generated vlan config
|
# extract auto-generated first boot switch config settings
|
||||||
#CMLARA Not needed on BULLETM's maybe needed on other devices
|
# and store them for future use
|
||||||
#[ -f /etc/vlan ] || head -n5 /etc/config/network > /etc/vlan
|
if [ ! -f /etc/aredn_include/swconfig ]
|
||||||
|
then
|
||||||
|
mkdir -p /etc/aredn_include
|
||||||
|
touch /etc/aredn_include/swconfig
|
||||||
|
i=0
|
||||||
|
while true; do
|
||||||
|
uci -q get network.\@switch\[$i\] > /dev/null
|
||||||
|
local status=$?
|
||||||
|
if [ $status == 1 ]
|
||||||
|
then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "config switch" >> /etc/aredn_include/swconfig
|
||||||
|
echo " option name '`uci -q get network.\@switch\[$i\].name`'" >> /etc/aredn_include/swconfig
|
||||||
|
echo " option reset '`uci -q get network.\@switch\[$i\].reset`'" >> /etc/aredn_include/swconfig
|
||||||
|
echo " option enable_vlan '`uci -q get network.\@switch\[$i\].enable_vlan`'" >> /etc/aredn_include/swconfig
|
||||||
|
echo "" >> /etc/aredn_include/swconfig
|
||||||
|
let i++
|
||||||
|
done
|
||||||
|
|
||||||
|
i=0
|
||||||
|
while true; do
|
||||||
|
uci -q get network.\@switch_vlan\[$i\] > /dev/null
|
||||||
|
local status=$?
|
||||||
|
if [ $status == 1 ]
|
||||||
|
then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "config switch_vlan" >> /etc/aredn_include/swconfig
|
||||||
|
echo " option device '`uci -q get network.\@switch_vlan\[$i\].device`'" >> /etc/aredn_include/swconfig
|
||||||
|
echo " option vlan '`uci -q get network.\@switch_vlan\[$i\].vlan`'" >> /etc/aredn_include/swconfig
|
||||||
|
echo " option ports '`uci -q get network.\@switch_vlan\[$i\].ports`'" >> /etc/aredn_include/swconfig
|
||||||
|
echo "" >> /etc/aredn_include/swconfig
|
||||||
|
let i++
|
||||||
|
done
|
||||||
|
|
||||||
|
i=0
|
||||||
|
while true; do
|
||||||
|
uci -q get network.\@switch_port\[$i\] > /dev/null
|
||||||
|
local status=$?
|
||||||
|
if [ $status == 1 ]
|
||||||
|
then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "config switch_port" >> /etc/aredn_include/swconfig
|
||||||
|
echo " option device '`uci -q get network.\@switch_port\[$i\].device`'" >> /etc/aredn_include/swconfig
|
||||||
|
echo " option port '`uci -q get network.\@switch_port\[$i\].port`'" >> /etc/aredn_include/swconfig
|
||||||
|
echo " option pvid '`uci -q get network.\@switch_port\[$i\].pvid`'" >> /etc/aredn_include/swconfig
|
||||||
|
echo "" >> /etc/aredn_include/swconfig
|
||||||
|
let i++
|
||||||
|
done
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Store the unique information about the card, such as its path, mac, and phy
|
||||||
|
# so it can be used later.
|
||||||
|
if [ ! -f /etc/aredn_include/radio0path ]
|
||||||
|
then
|
||||||
|
mkdir -p /etc/aredn_include
|
||||||
|
touch /etc/aredn_include/radio0path
|
||||||
|
local radio0path=`uci -q get wireless.radio0.path`
|
||||||
|
local radio0phy=`uci -q get wireless.radio0.phy`
|
||||||
|
local radio0mac=`uci -q get wireless.radio0.macaddr`
|
||||||
|
if [ "$radio0path" != "" ]
|
||||||
|
then
|
||||||
|
echo " option path '$radio0path'" >> /etc/aredn_include/radio0path
|
||||||
|
fi
|
||||||
|
if [ "$radio0phy" != "" ]
|
||||||
|
then
|
||||||
|
echo " option phy '$radio0phy'" >> /etc/aredn_include/radio0path
|
||||||
|
fi
|
||||||
|
if [ "$radio0mac" != "" ]
|
||||||
|
then
|
||||||
|
echo " option macaddr '$radio0mac'" >> /etc/aredn_include/radio0path
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Save system NET LED settings
|
||||||
|
if [ ! -f /etc/aredn_include/system_netled]
|
||||||
|
then
|
||||||
|
mkdir -p /etc/aredn_include
|
||||||
|
touch /etc/aredn_include/system_netled
|
||||||
|
i=0
|
||||||
|
while true; do
|
||||||
|
uci -q get system.led_lan$i > /dev/null
|
||||||
|
local status=$?
|
||||||
|
if [ $status == 1 ]
|
||||||
|
then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "config led 'led_lan$i'" >> /etc/aredn_include/system_netled
|
||||||
|
echo " option name '`uci -q get system.led_lan$i.name`'" >> /etc/aredn_include/system_netled
|
||||||
|
echo " option sysfs '`uci -q get system.led_lan$i.sysfs`'" >> /etc/aredn_include/system_netled
|
||||||
|
echo " option trigger '`uci -q get system.led_lan$i.trigger`'" >> /etc/aredn_include/system_netled
|
||||||
|
echo " option port_mask '`uci -q get system.led_lan$i.name`'" >> /etc/aredn_include/system_netled
|
||||||
|
echo "" >> /etc/aredn_include/system_netled
|
||||||
|
let i++
|
||||||
|
done
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# setup nvram variables
|
# setup nvram variables
|
||||||
[ -x /usr/local/bin/nvram-setup ] && /usr/local/bin/nvram-setup
|
[ -x /usr/local/bin/nvram-setup ] && /usr/local/bin/nvram-setup
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#CMLARA: Temporary shell script for ar71xx platform models
|
#CMLARA: Temporary shell script for ar71xx platform models
|
||||||
# Just resport what is on the /proc/cpuinfo field --- this will work for most ar71xx devices
|
# Return the model of the device
|
||||||
# This doesn't work for linksys however since they have multiple devices
|
|
||||||
#Eventually we will want to to clean this up to a diffrent method
|
|
||||||
|
|
||||||
echo `awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo`;
|
if [ ! -f /tmp/sysinfo/model ]; then
|
||||||
|
. /lib/functions.sh
|
||||||
|
. /lib/ar71xx.sh
|
||||||
|
ar71xx_board_detect
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat /tmp/sysinfo/model
|
||||||
|
|
|
@ -18,13 +18,15 @@
|
||||||
|
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
|
LINK1LED=`readlink -f /sys/class/leds/*link1`
|
||||||
|
|
||||||
{
|
{
|
||||||
while true; do
|
while true; do
|
||||||
sleep 5;
|
sleep 5;
|
||||||
if echo /neighbors | nc 127.0.0.1 2006 2>/dev/null | grep -q YES; then
|
if echo /neighbors | nc 127.0.0.1 2006 2>/dev/null | grep -q YES; then
|
||||||
echo 1 > /sys/class/leds/ubnt:red:link1/brightness
|
echo 1 > $LINK1LED/brightness
|
||||||
else
|
else
|
||||||
echo 0 > /sys/class/leds/ubnt:red:link1/brightness
|
echo 0 > $LINK1LED//brightness
|
||||||
fi
|
fi
|
||||||
done;
|
done;
|
||||||
} &
|
} &
|
||||||
|
|
|
@ -54,13 +54,17 @@ sub fail
|
||||||
|
|
||||||
$commit = 0;
|
$commit = 0;
|
||||||
|
|
||||||
# Added new wifimac parm, the radio0 wont startup without it, use pci device location
|
# Added new wifimac parm, the radio0 wont startup without it, use the path location in wifi config
|
||||||
# may need to find a better way to allow for wider hardware support
|
# Actually it just needs some path to get to the radio.
|
||||||
|
|
||||||
|
# Using radio0.path as it seems to always be set as method to get to the card.
|
||||||
|
chomp ($wifi_path = `uci -q get wireless.radio0.path`);
|
||||||
|
|
||||||
chomp ($wifi_mac = `uci -c /etc/local/uci/ -q get hsmmmesh.settings.wifimac`);
|
chomp ($wifi_mac = `uci -c /etc/local/uci/ -q get hsmmmesh.settings.wifimac`);
|
||||||
|
|
||||||
if($wifi_mac eq "")
|
if($wifi_mac eq "")
|
||||||
{
|
{
|
||||||
open(FILE, "/sys/devices/pci0000:00/0000:00:00.0/ieee80211/phy0/macaddress") or fail("ERROR: wireless mac not available");
|
open(FILE, "/sys/devices/$wifi_path/ieee80211/phy0/macaddress") or fail("ERROR: wireless mac not available");
|
||||||
while(<FILE>)
|
while(<FILE>)
|
||||||
{
|
{
|
||||||
next unless /(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w)/;
|
next unless /(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w)/;
|
||||||
|
@ -78,7 +82,7 @@ chomp ($mac2 = `uci -c /etc/local/uci/ -q get hsmmmesh.settings.mac2`);
|
||||||
|
|
||||||
if($mac2 eq "")
|
if($mac2 eq "")
|
||||||
{
|
{
|
||||||
open(FILE, "/sys/devices/pci0000:00/0000:00:00.0/ieee80211/phy0/macaddress") or fail("ERROR: wireless mac not available");
|
open(FILE, "/sys/devices/$wifi_path/ieee80211/phy0/macaddress") or fail("ERROR: wireless mac not available");
|
||||||
while(<FILE>)
|
while(<FILE>)
|
||||||
{
|
{
|
||||||
next unless /\w\w:\w\w:\w\w:(\w\w):(\w\w):(\w\w)/;
|
next unless /\w\w:\w\w:\w\w:(\w\w):(\w\w):(\w\w)/;
|
||||||
|
|
|
@ -907,8 +907,16 @@ sub validate_longitude
|
||||||
# Get boardid
|
# Get boardid
|
||||||
sub hardware_boardid
|
sub hardware_boardid
|
||||||
{
|
{
|
||||||
my $boardid = `cat /sys/devices/pci0000:00/0000:00:00.0/subsystem_device`;
|
my $boarid="";
|
||||||
|
# Ubiquiti hardware
|
||||||
|
if ( -f '/sys/devices/pci0000:00/0000:00:00.0/subsystem_device' ) {
|
||||||
|
$boardid = `cat /sys/devices/pci0000:00/0000:00:00.0/subsystem_device`;
|
||||||
chomp($boardid);
|
chomp($boardid);
|
||||||
|
} else {
|
||||||
|
# Can't use the subsystem_device so instead use the model
|
||||||
|
$boardid = `/usr/local/bin/get_model`;
|
||||||
|
chomp($boardid);
|
||||||
|
}
|
||||||
return $boardid;
|
return $boardid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -917,6 +925,17 @@ sub hardware_boardid
|
||||||
sub hardware_info
|
sub hardware_info
|
||||||
{
|
{
|
||||||
%model = (
|
%model = (
|
||||||
|
'TP-Link CPE510 v1.0' => {
|
||||||
|
'name' => 'TP-Link CPE510 v1.0',
|
||||||
|
'comment' => '',
|
||||||
|
'supported' => '-2',
|
||||||
|
'maxpower' => '27',
|
||||||
|
'pwroffset' => '0',
|
||||||
|
'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity" },
|
||||||
|
'defaultant' => 3,
|
||||||
|
'usechains' => 1,
|
||||||
|
'rfband' => '5800ubntus',
|
||||||
|
},
|
||||||
'0xc2a2' => {
|
'0xc2a2' => {
|
||||||
'name' => 'Bullet 2 HP',
|
'name' => 'Bullet 2 HP',
|
||||||
'comment' => 'Not enough Ram or flash',
|
'comment' => 'Not enough Ram or flash',
|
||||||
|
|
Loading…
Reference in New Issue