hardware: CPE510: Retain device path information and import into configs at save time.

Save the intial path at install and include it each time we save the config
This commit is contained in:
Conrad Lara - KG6JEI 2015-04-05 23:04:32 -07:00
parent 8faab9c11c
commit 79902f0876
6 changed files with 30 additions and 5 deletions

View File

@ -1,9 +1,9 @@
config wifi-device radio0
option type mac80211
option phy phy0
option channel <wifi_channel>
option chanbw <wifi_chanbw>
option distance <wifi_distance>
include /etc/aredn_include/radio0path
config wifi-iface
option device radio0

View File

@ -1,7 +1,7 @@
config wifi-device radio0
option type mac80211
option phy phy0
option distance <wifi_distance>
include /etc/aredn_include/radio0path
config wifi-iface
option device radio0

View File

@ -1,10 +1,10 @@
config wifi-device radio0
option type mac80211
option phy phy0
option channel <wifi_channel>
option chanbw <wifi_chanbw>
option distance <wifi_distance>
option country <wifi_country>
include /etc/aredn_include/radio0path
config wifi-iface
option device radio0

View File

@ -1,9 +1,9 @@
config wifi-device radio0
option type mac80211
option phy phy0
option channel <wifi_channel>
option chanbw <wifi_chanbw>
option distance <wifi_distance>
include /etc/aredn_include/radio0path
config wifi-iface
option device radio0

View File

@ -1,9 +1,9 @@
config wifi-device radio0
option type mac80211
option phy phy0
option channel <wifi_channel>
option chanbw <wifi_chanbw>
option disabled 1
include /etc/aredn_include/radio0path
config wifi-iface
option device radio0

View File

@ -45,6 +45,31 @@ boot() {
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
# setup nvram variables
[ -x /usr/local/bin/nvram-setup ] && /usr/local/bin/nvram-setup