Skip to content
Snippets Groups Projects
Unverified Commit 17e1aa4f authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-core: migrate wireless configuration from hwmode to band

The migration is done very early, as other upgrade scripts depend on the
band setting through platform.device_uses_11a().
parent c52089fc
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/lua
local uci = require('simple-uci').cursor()
-- Migration from hwmode to band (OpenWrt 21.02)
-- Use uci:foreach(), as wireless.foreach_radio() depends on band already being set
uci:foreach('wireless', 'wifi-device', function(radio)
local radio_name = radio['.name']
local hwmode = radio.hwmode
if not radio.band then
if hwmode == '11g' or hwmode == '11ng' then
uci:set('wireless', radio_name, 'band', '2g')
elseif hwmode == '11a' or hwmode == '11na' then
uci:set('wireless', radio_name, 'band', '5g')
end
end
uci:delete('wireless', radio_name, 'hwmode')
end)
uci:save('wireless')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment