Merge gluon-radio-config into gluon-core
gluon-radio-config contained only a single file. The code has been adjusted to allow creating a Gluon configuration without WLAN support by removing the wifi24 and wifi5 sections from site.conf.
This commit is contained in:
parent
3d862afb17
commit
22130e84e8
@ -43,14 +43,6 @@ Developer Documentation
|
||||
dev/wan
|
||||
dev/i18n
|
||||
|
||||
Packages
|
||||
--------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
package/gluon-radio-config
|
||||
|
||||
Releases
|
||||
--------
|
||||
|
||||
|
@ -1,20 +0,0 @@
|
||||
gluon-radio-config
|
||||
==================
|
||||
|
||||
This package takes care of setting basic wireless settings:
|
||||
|
||||
- regulatory domain
|
||||
- htmode
|
||||
- channel
|
||||
|
||||
site.conf
|
||||
---------
|
||||
|
||||
regdom
|
||||
regulatory domain (e.g. *de*)
|
||||
|
||||
wifi24.channel / wifi5.channel
|
||||
wireless channel for radio
|
||||
|
||||
wifi24.htmode / wifi5.htmode
|
||||
desired HT mode (e.g. *HT20*)
|
@ -72,13 +72,15 @@ opkg : optional
|
||||
- ``%GV`` is replaced by the Gluon version
|
||||
- ``%GR`` is replaced by the Gluon release (as specified in ``site.mk``)
|
||||
|
||||
regdom
|
||||
regdom : optional
|
||||
The wireless regulatory domain responsible for your area, e.g.:
|
||||
::
|
||||
|
||||
regdom = 'DE'
|
||||
|
||||
wifi24
|
||||
Setting ``regdom`` in mandatory if ``wifi24`` or ``wifi5`` is defined.
|
||||
|
||||
wifi24 : optional
|
||||
WLAN configuration for 2.4 GHz devices.
|
||||
``channel`` must be set to a valid wireless channel for your radio.
|
||||
``htmode`` selects the desired htmode (e.g. HT20, HT40- or HT40+).
|
||||
@ -121,7 +123,7 @@ wifi24
|
||||
},
|
||||
},
|
||||
|
||||
wifi5
|
||||
wifi5 : optional
|
||||
Same as `wifi24` but for the 5Ghz radio.
|
||||
|
||||
next_node : package
|
||||
|
@ -21,3 +21,13 @@ need_string_array('ntp_servers', false)
|
||||
|
||||
need_string_match('prefix4', '^%d+.%d+.%d+.%d+/%d+$')
|
||||
need_string_match('prefix6', '^[%x:]+/%d+$')
|
||||
|
||||
|
||||
for _, config in ipairs({'wifi24', 'wifi5'}) do
|
||||
if need_table(config, nil, false) then
|
||||
need_string('regdom') -- regdom is only required when wifi24 or wifi5 is configured
|
||||
|
||||
need_number(config .. '.channel')
|
||||
need_string(config .. '.htmode')
|
||||
end
|
||||
end
|
||||
|
@ -1,5 +1,8 @@
|
||||
#!/usr/bin/lua
|
||||
|
||||
local util = require 'gluon.util'
|
||||
local uci = require('luci.model.uci').cursor()
|
||||
local site = require 'gluon.site_config'
|
||||
local sysconfig = require 'gluon.sysconfig'
|
||||
|
||||
-- Initial
|
||||
@ -7,6 +10,19 @@ if not sysconfig.gluon_version then
|
||||
local uci = require('luci.model.uci').cursor()
|
||||
|
||||
uci:delete_all('wireless', 'wifi-iface')
|
||||
uci:save('wireless')
|
||||
uci:commit('wireless')
|
||||
end
|
||||
|
||||
local function configure_radio(radio, index, config)
|
||||
if config then
|
||||
uci:delete('wireless', radio, 'disabled')
|
||||
|
||||
uci:set('wireless', radio, 'channel', config.channel)
|
||||
uci:set('wireless', radio, 'htmode', config.htmode)
|
||||
uci:set('wireless', radio, 'country', site.regdom)
|
||||
end
|
||||
end
|
||||
|
||||
util.iterate_radios(configure_radio)
|
||||
|
||||
uci:save('wireless')
|
||||
uci:commit('wireless')
|
||||
|
@ -11,7 +11,7 @@ define Package/gluon-mesh-batman-adv-core
|
||||
SECTION:=gluon
|
||||
CATEGORY:=Gluon
|
||||
TITLE:=Support for batman-adv meshing (core)
|
||||
DEPENDS:=+gluon-core +gluon-radio-config +firewall +libiwinfo-lua
|
||||
DEPENDS:=+gluon-core +firewall +libiwinfo-lua
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
|
@ -1,31 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gluon-radio-config
|
||||
PKG_VERSION:=1
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(GLUONDIR)/include/package.mk
|
||||
|
||||
define Package/gluon-radio-config
|
||||
SECTION:=gluon
|
||||
CATEGORY:=Gluon
|
||||
TITLE:=Basic radio config (regdom, channel, htmode)
|
||||
DEPENDS:=+gluon-core
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/gluon-radio-config/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,gluon-radio-config))
|
@ -1,18 +0,0 @@
|
||||
#!/usr/bin/lua
|
||||
|
||||
local util = require 'gluon.util'
|
||||
local uci = require('luci.model.uci').cursor()
|
||||
local site = require 'gluon.site_config'
|
||||
|
||||
local function configure_radio(radio, index, config)
|
||||
uci:delete('wireless', radio, 'disabled')
|
||||
|
||||
uci:set('wireless', radio, 'channel', config.channel)
|
||||
uci:set('wireless', radio, 'htmode', config.htmode)
|
||||
uci:set('wireless', radio, 'country', site.regdom)
|
||||
end
|
||||
|
||||
util.iterate_radios(configure_radio)
|
||||
|
||||
uci:save('wireless')
|
||||
uci:commit('wireless')
|
Loading…
Reference in New Issue
Block a user