mirror of
https://github.com/LiBwrt-op/openwrt-6.x.git
synced 2025-12-19 10:17:45 +00:00
wifi-scripts: ucode: fix start failed
When using wpad-openssl/wpad-basic-openssl, wpa_supplicant/hostapd may not be ready because of openssl. This cause supplicant.setup and hostapd.setup to be failed. Therefore, wait for wpa_supplicant/hostapd to be ready before supplicant.setup and hostapd.setup. Run-tested: mediatek/filogic GL-MT3000 fixes: #20361 Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
cc3e211264
commit
00e881451a
@ -288,8 +288,11 @@ function setup() {
|
|||||||
wdev_data[v.config.ifname] = config;
|
wdev_data[v.config.ifname] = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
supplicant.setup(supplicant_data, data);
|
if (fs.access('/usr/sbin/wpa_supplicant', 'x'))
|
||||||
hostapd.setup(data);
|
supplicant.setup(supplicant_data, data);
|
||||||
|
|
||||||
|
if (fs.access('/usr/sbin/hostapd', 'x'))
|
||||||
|
hostapd.setup(data);
|
||||||
|
|
||||||
system(`ucode /usr/share/hostap/wdev.uc ${data.phy}${data.phy_suffix} set_config '${printf("%J", wdev_data)}' ${join(' ', active_ifnames)}`);
|
system(`ucode /usr/share/hostap/wdev.uc ${data.phy}${data.phy_suffix} set_config '${printf("%J", wdev_data)}' ${join(' ', active_ifnames)}`);
|
||||||
|
|
||||||
|
|||||||
@ -571,10 +571,12 @@ export function setup(data) {
|
|||||||
config: has_ap ? file_name : "",
|
config: has_ap ? file_name : "",
|
||||||
prev_config: file_name + '.prev'
|
prev_config: file_name + '.prev'
|
||||||
};
|
};
|
||||||
|
if (!global.ubus.list('hostapd'))
|
||||||
|
system('ubus wait_for hostapd');
|
||||||
let ret = global.ubus.call('hostapd', 'config_set', msg);
|
let ret = global.ubus.call('hostapd', 'config_set', msg);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
netifd.add_process('/usr/sbin/hostapd', ret.pid, true, true);
|
netifd.add_process('/usr/sbin/hostapd', ret.pid, true, true);
|
||||||
else if (fs.access('/usr/sbin/hostapd', 'x'))
|
else
|
||||||
netifd.setup_failed('HOSTAPD_START_FAILED');
|
netifd.setup_failed('HOSTAPD_START_FAILED');
|
||||||
};
|
};
|
||||||
|
|||||||
@ -270,6 +270,8 @@ export function generate(config_list, data, interface) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export function setup(config, data) {
|
export function setup(config, data) {
|
||||||
|
if (!global.ubus.list('wpa_supplicant'))
|
||||||
|
system('ubus wait_for wpa_supplicant');
|
||||||
let ret = global.ubus.call('wpa_supplicant', 'config_set', {
|
let ret = global.ubus.call('wpa_supplicant', 'config_set', {
|
||||||
phy: data.phy,
|
phy: data.phy,
|
||||||
radio: data.config.radio,
|
radio: data.config.radio,
|
||||||
@ -281,7 +283,7 @@ export function setup(config, data) {
|
|||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
netifd.add_process('/usr/sbin/wpa_supplicant', ret.pid, true, true);
|
netifd.add_process('/usr/sbin/wpa_supplicant', ret.pid, true, true);
|
||||||
else if (fs.access('/usr/sbin/wpa_supplicant', 'x'))
|
else
|
||||||
netifd.setup_failed('SUPPLICANT_START_FAILED');
|
netifd.setup_failed('SUPPLICANT_START_FAILED');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user