mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 09:32:34 +00:00
mcu: support OpenWiFi with uCentral
On device running OpenWiFi with uCentral, additional copy of the initial UCI configuration will be generated in '/etc/config-shadow/'. As part of the MCU configuration is done during runtime, after the 'config-shadow' is created, we should update it as well to keep everything in sync. Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
This commit is contained in:
committed by
John Crispin
parent
9aff26b7fb
commit
e4ed881dd7
@@ -92,6 +92,18 @@ mcu_hotplug_setup() {
|
|||||||
sect="${sn:0:8}_usb"
|
sect="${sn:0:8}_usb"
|
||||||
mcu_logi "no matching MCU config found, adding new (disabled): '$sect'"
|
mcu_logi "no matching MCU config found, adding new (disabled): '$sect'"
|
||||||
|
|
||||||
|
[ -d /etc/config-shadow ] && {
|
||||||
|
uci -c /etc/config-shadow -q batch <<-EOF
|
||||||
|
set mcu.${sect}=mcu
|
||||||
|
set mcu.${sect}.interface=usb
|
||||||
|
set mcu.${sect}.bootloader=mcuboot
|
||||||
|
set mcu.${sect}.sn=$sn
|
||||||
|
set mcu.${sect}.disabled=1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
uci -c /etc/config-shadow -q commit mcu
|
||||||
|
}
|
||||||
|
|
||||||
uci -q batch <<-EOF
|
uci -q batch <<-EOF
|
||||||
set mcu.${sect}=mcu
|
set mcu.${sect}=mcu
|
||||||
set mcu.${sect}.interface=usb
|
set mcu.${sect}.interface=usb
|
||||||
|
|||||||
@@ -351,6 +351,11 @@ mcu_sn_check_and_update() {
|
|||||||
|
|
||||||
[ -n "$sn_dev" ] && {
|
[ -n "$sn_dev" ] && {
|
||||||
if [ -z "$sn" ]; then
|
if [ -z "$sn" ]; then
|
||||||
|
[ -d /etc/config-shadow ] && {
|
||||||
|
uci -c /etc/config-shadow -q set mcu.${SECT}.sn="$sn_dev"
|
||||||
|
uci -c /etc/config-shadow -q commit mcu
|
||||||
|
}
|
||||||
|
|
||||||
uci -q set mcu.${SECT}.sn="$sn_dev"
|
uci -q set mcu.${SECT}.sn="$sn_dev"
|
||||||
uci -q commit mcu
|
uci -q commit mcu
|
||||||
else
|
else
|
||||||
@@ -424,6 +429,11 @@ mcu_fw_check_and_update() {
|
|||||||
[ "$active_slot" = "1" ] && firmware="$slot1_fw"
|
[ "$active_slot" = "1" ] && firmware="$slot1_fw"
|
||||||
|
|
||||||
[ -n "$firmware" ] && {
|
[ -n "$firmware" ] && {
|
||||||
|
[ -d /etc/config-shadow ] && {
|
||||||
|
uci -c /etc/config-shadow -q set mcu.${SECT}.firmware="$firmware"
|
||||||
|
uci -c /etc/config-shadow -q commit mcu
|
||||||
|
}
|
||||||
|
|
||||||
uci -q set mcu.${SECT}.firmware="$firmware"
|
uci -q set mcu.${SECT}.firmware="$firmware"
|
||||||
uci -q commit mcu
|
uci -q commit mcu
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user