Merge branch 'master' into master
This commit is contained in:
commit
d24acdfa82
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,7 +1,6 @@
|
|||||||
*~
|
*~
|
||||||
/build
|
/lede
|
||||||
/output
|
/output
|
||||||
/site
|
/site
|
||||||
/openwrt
|
/tmp
|
||||||
/packages
|
/packages
|
||||||
/modules.local
|
|
||||||
|
10
LICENSE
10
LICENSE
@ -1,7 +1,7 @@
|
|||||||
The code of Project Gluon may be distributed under the following terms, unless
|
The code of Project Gluon may be distributed under the following terms, unless
|
||||||
noted otherwise in individual files or subtrees.
|
noted otherwise in individual files or subtrees.
|
||||||
|
|
||||||
Copyright (c) 2013, Project Gluon
|
Copyright (c) 2013-2017, Project Gluon
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
@ -25,10 +25,10 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
|
||||||
OpenWrt is licensed under the terms of the GNU General Public License Version 2,
|
LEDE and OpenWrt are licensed under the terms of the GNU General Public License
|
||||||
which can be found under openwrt/LICENSE after the openwrt submodule has been
|
Version 2, which can be found at lede/LICENSE after the lede repository has been
|
||||||
obtained. This applies to the following submodules:
|
obtained. This applies to the following repositories:
|
||||||
* openwrt
|
* lede
|
||||||
* packages/openwrt
|
* packages/openwrt
|
||||||
* packages/routing
|
* packages/routing
|
||||||
* packages/luci
|
* packages/luci
|
||||||
|
571
Makefile
571
Makefile
@ -4,502 +4,153 @@ LC_ALL:=C
|
|||||||
LANG:=C
|
LANG:=C
|
||||||
export LC_ALL LANG
|
export LC_ALL LANG
|
||||||
|
|
||||||
export SHELL:=/usr/bin/env bash
|
|
||||||
|
|
||||||
GLUONPATH ?= $(PATH)
|
GLUON_SITEDIR ?= $(CURDIR)/site
|
||||||
export GLUONPATH := $(GLUONPATH)
|
GLUON_TMPDIR ?= $(CURDIR)/tmp
|
||||||
|
|
||||||
empty:=
|
GLUON_OUTPUTDIR ?= $(CURDIR)/output
|
||||||
space:= $(empty) $(empty)
|
GLUON_IMAGEDIR ?= $(GLUON_OUTPUTDIR)/images
|
||||||
|
GLUON_PACKAGEDIR ?= $(GLUON_OUTPUTDIR)/packages
|
||||||
|
|
||||||
GLUONMAKE_EARLY = PATH=$(GLUONPATH) $(SUBMAKE) -C $(GLUON_ORIGOPENWRTDIR) -f $(GLUONDIR)/Makefile GLUON_TOOLS=0 QUILT=
|
export GLUON_TMPDIR GLUON_IMAGEDIR GLUON_PACKAGEDIR DEVICES
|
||||||
GLUONMAKE = PATH=$(GLUONPATH) $(SUBMAKE) -C $(GLUON_OPENWRTDIR) -f $(GLUONDIR)/Makefile
|
|
||||||
|
|
||||||
ifneq ($(OPENWRT_BUILD),1)
|
|
||||||
|
|
||||||
GLUONDIR:=${CURDIR}
|
$(GLUON_SITEDIR)/site.mk:
|
||||||
|
$(error No site configuration was found. Please check out a site configuration to $(GLUON_SITEDIR))
|
||||||
|
|
||||||
include $(GLUONDIR)/include/gluon.mk
|
-include $(GLUON_SITEDIR)/site.mk
|
||||||
|
|
||||||
TOPDIR:=$(GLUON_ORIGOPENWRTDIR)
|
ifeq ($(GLUON_RELEASE),)
|
||||||
export TOPDIR
|
$(error GLUON_RELEASE not set. GLUON_RELEASE can be set in site.mk or on the command line.)
|
||||||
|
endif
|
||||||
|
|
||||||
|
GLUON_LANGS ?= en
|
||||||
|
|
||||||
|
export GLUON_RELEASE GLUON_ATH10K_MESH GLUON_REGION
|
||||||
|
|
||||||
|
|
||||||
update: FORCE
|
update: FORCE
|
||||||
$(GLUONDIR)/scripts/update.sh
|
@GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/update.sh
|
||||||
$(GLUONDIR)/scripts/patch.sh
|
@GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/patch.sh
|
||||||
|
@GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/feeds.sh
|
||||||
|
|
||||||
update-patches: FORCE
|
update-patches: FORCE
|
||||||
$(GLUONDIR)/scripts/update.sh
|
@GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/update.sh
|
||||||
$(GLUONDIR)/scripts/update-patches.sh
|
@GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/update-patches.sh
|
||||||
$(GLUONDIR)/scripts/patch.sh
|
@GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/patch.sh
|
||||||
|
|
||||||
-include $(TOPDIR)/include/host.mk
|
update-feeds: FORCE
|
||||||
|
@GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/feeds.sh
|
||||||
_SINGLE=export MAKEFLAGS=$(space);
|
|
||||||
|
|
||||||
override OPENWRT_BUILD=1
|
|
||||||
override GLUON_TOOLS=1
|
|
||||||
GREP_OPTIONS=
|
|
||||||
export OPENWRT_BUILD GLUON_TOOLS GREP_OPTIONS
|
|
||||||
|
|
||||||
-include $(TOPDIR)/include/debug.mk
|
|
||||||
-include $(TOPDIR)/include/depends.mk
|
|
||||||
include $(GLUONDIR)/include/toplevel.mk
|
|
||||||
|
|
||||||
|
|
||||||
include $(GLUONDIR)/targets/targets.mk
|
GLUON_TARGETS :=
|
||||||
|
|
||||||
|
define GluonTarget
|
||||||
|
gluon_target := $(1)$$(if $(2),-$(2))
|
||||||
|
GLUON_TARGETS += $$(gluon_target)
|
||||||
|
GLUON_TARGET_$$(gluon_target)_BOARD := $(1)
|
||||||
|
GLUON_TARGET_$$(gluon_target)_SUBTARGET := $(if $(3),$(3),$(2))
|
||||||
|
endef
|
||||||
|
|
||||||
|
include targets/targets.mk
|
||||||
|
|
||||||
|
|
||||||
CheckTarget := [ -n '$(GLUON_TARGET)' -a -n '$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)' ] \
|
LEDEMAKE = $(MAKE) -C lede
|
||||||
|| (echo -e 'Please set GLUON_TARGET to a valid target. Gluon supports the following targets:$(subst $(space),\n * ,$(GLUON_TARGETS))'; false)
|
|
||||||
|
BOARD := $(GLUON_TARGET_$(GLUON_TARGET)_BOARD)
|
||||||
|
SUBTARGET := $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)
|
||||||
|
LEDE_TARGET := $(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
|
||||||
|
|
||||||
|
export LEDE_TARGET
|
||||||
|
|
||||||
|
|
||||||
CheckExternal := test -d $(GLUON_ORIGOPENWRTDIR) || (echo 'You don'"'"'t seem to have obtained the external repositories needed by Gluon; please call `make update` first!'; false)
|
CheckTarget := [ '$(LEDE_TARGET)' ] \
|
||||||
|
|| (echo 'Please set GLUON_TARGET to a valid target. Gluon supports the following targets:'; $(foreach target,$(GLUON_TARGETS),echo ' * $(target)';) false)
|
||||||
|
|
||||||
|
CheckExternal := test -d lede || (echo 'You don'"'"'t seem to have obtained the external repositories needed by Gluon; please call `make update` first!'; false)
|
||||||
|
|
||||||
|
|
||||||
create-key: FORCE
|
GLUON_DEFAULT_PACKAGES := -odhcpd -ppp -ppp-mod-pppoe -wpad-mini gluon-core ip6tables hostapd-mini
|
||||||
@$(CheckExternal)
|
|
||||||
+@$(GLUONMAKE_EARLY) create-key
|
|
||||||
|
|
||||||
prepare-target: FORCE
|
GLUON_PACKAGES :=
|
||||||
|
define merge_packages
|
||||||
|
$(foreach pkg,$(1),
|
||||||
|
GLUON_PACKAGES := $$(strip $$(filter-out -$$(patsubst -%,%,$(pkg)) $$(patsubst -%,%,$(pkg)),$$(GLUON_PACKAGES)) $(pkg))
|
||||||
|
)
|
||||||
|
endef
|
||||||
|
$(eval $(call merge_packages,$(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES)))
|
||||||
|
|
||||||
|
GLUON_PACKAGES_YES := $(filter-out -%,$(GLUON_PACKAGES))
|
||||||
|
GLUON_PACKAGES_NO := $(patsubst -%,%,$(filter -%,$(GLUON_PACKAGES)))
|
||||||
|
|
||||||
|
|
||||||
|
config: FORCE
|
||||||
@$(CheckExternal)
|
@$(CheckExternal)
|
||||||
@$(CheckTarget)
|
@$(CheckTarget)
|
||||||
+@$(GLUONMAKE_EARLY) prepare-target
|
|
||||||
|
@( \
|
||||||
|
echo 'CONFIG_TARGET_$(BOARD)=y' \
|
||||||
|
$(if $(SUBTARGET),&& echo 'CONFIG_TARGET_$(BOARD)_$(SUBTARGET)=y') \
|
||||||
|
$(foreach pkg,$(GLUON_PACKAGES_NO),&& echo '# CONFIG_PACKAGE_$(pkg) is not set') \
|
||||||
|
&& scripts/target_config.sh generic \
|
||||||
|
&& GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/target_config.sh '$(GLUON_TARGET)' \
|
||||||
|
$(foreach pkg,$(GLUON_PACKAGES_YES),&& echo 'CONFIG_PACKAGE_$(pkg)=y') \
|
||||||
|
$(foreach lang,$(GLUON_LANGS),&& echo 'CONFIG_LUCI_LANG_$(lang)=y') \
|
||||||
|
&& echo 'CONFIG_GLUON_RELEASE="$(GLUON_RELEASE)"' \
|
||||||
|
&& echo 'CONFIG_GLUON_SITEDIR="$(GLUON_SITEDIR)"' \
|
||||||
|
&& echo 'CONFIG_GLUON_BRANCH="$(GLUON_BRANCH)"' \
|
||||||
|
) > lede/.config
|
||||||
|
+@$(LEDEMAKE) defconfig
|
||||||
|
|
||||||
|
@GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/target_config_check.sh '$(GLUON_TARGET)' '$(GLUON_PACKAGES_YES)'
|
||||||
|
|
||||||
|
|
||||||
|
LUA := lede/staging_dir/hostpkg/bin/lua
|
||||||
|
|
||||||
|
$(LUA):
|
||||||
|
@$(CheckExternal)
|
||||||
|
|
||||||
|
+@[ -e lede/.config ] || $(LEDEMAKE) defconfig
|
||||||
|
+@$(LEDEMAKE) tools/install
|
||||||
|
+@$(LEDEMAKE) package/lua/host/install
|
||||||
|
|
||||||
|
prepare-target: config $(LUA) ;
|
||||||
|
|
||||||
all: prepare-target
|
all: prepare-target
|
||||||
+@$(GLUONMAKE) build-key
|
@GLUON_SITEDIR='$(GLUON_SITEDIR)' $(LUA) scripts/site_config.lua \
|
||||||
+@$(GLUONMAKE) prepare
|
|| (echo 'Your site configuration did not pass validation.'; false)
|
||||||
+@$(GLUONMAKE) images
|
|
||||||
+@$(GLUONMAKE) modules
|
|
||||||
|
|
||||||
prepare: prepare-target
|
@scripts/clean_output.sh
|
||||||
+@$(GLUONMAKE) build-key
|
+@$(LEDEMAKE)
|
||||||
+@$(GLUONMAKE) $@
|
@GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/copy_output.sh '$(GLUON_TARGET)'
|
||||||
|
|
||||||
clean download images modules: FORCE
|
clean download: config
|
||||||
@$(CheckExternal)
|
+@$(LEDEMAKE) $@
|
||||||
@$(CheckTarget)
|
|
||||||
+@$(GLUONMAKE_EARLY) maybe-prepare-target
|
|
||||||
+@$(GLUONMAKE) build-key
|
|
||||||
+@$(GLUONMAKE) $@
|
|
||||||
|
|
||||||
toolchain/% package/% target/% image/%: FORCE
|
dirclean: FORCE
|
||||||
@$(CheckExternal)
|
+@[ -e lede/.config ] || $(LEDEMAKE) defconfig
|
||||||
@$(CheckTarget)
|
+@$(LEDEMAKE) dirclean
|
||||||
+@$(GLUONMAKE_EARLY) maybe-prepare-target
|
@rm -rf $(GLUON_TMPDIR) $(GLUON_OUTPUTDIR)
|
||||||
+@$(GLUONMAKE) build-key
|
|
||||||
+@$(GLUONMAKE) $@
|
|
||||||
|
|
||||||
manifest: FORCE
|
manifest: $(LUA) FORCE
|
||||||
@[ -n '$(GLUON_BRANCH)' ] || (echo 'Please set GLUON_BRANCH to create a manifest.'; false)
|
@[ '$(GLUON_BRANCH)' ] || (echo 'Please set GLUON_BRANCH to create a manifest.'; false)
|
||||||
@echo '$(GLUON_PRIORITY)' | grep -qE '^([0-9]*\.)?[0-9]+$$' || (echo 'Please specify a numeric value for GLUON_PRIORITY to create a manifest.'; false)
|
@echo '$(GLUON_PRIORITY)' | grep -qE '^([0-9]*\.)?[0-9]+$$' || (echo 'Please specify a numeric value for GLUON_PRIORITY to create a manifest.'; false)
|
||||||
@$(CheckExternal)
|
@$(CheckExternal)
|
||||||
|
|
||||||
( \
|
@( \
|
||||||
echo 'BRANCH=$(GLUON_BRANCH)' && \
|
echo 'BRANCH=$(GLUON_BRANCH)' && \
|
||||||
echo 'DATE=$(shell $(GLUON_ORIGOPENWRTDIR)/staging_dir/host/bin/lua $(GLUONDIR)/scripts/rfc3339date.lua)' && \
|
echo "DATE=$$($(LUA) scripts/rfc3339date.lua)" && \
|
||||||
echo 'PRIORITY=$(GLUON_PRIORITY)' && \
|
echo 'PRIORITY=$(GLUON_PRIORITY)' && \
|
||||||
echo \
|
echo && \
|
||||||
) > $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp
|
$(foreach GLUON_TARGET,$(GLUON_TARGETS), \
|
||||||
|
GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/generate_manifest.sh '$(GLUON_TARGET)' && \
|
||||||
+($(foreach GLUON_TARGET,$(GLUON_TARGETS), \
|
|
||||||
( [ ! -e $(BOARD_BUILDDIR)/prepared ] || ( $(GLUONMAKE) manifest GLUON_TARGET='$(GLUON_TARGET)' V=s$(OPENWRT_VERBOSE) ) ) && \
|
|
||||||
) :)
|
|
||||||
|
|
||||||
mkdir -p $(GLUON_IMAGEDIR)/sysupgrade
|
|
||||||
mv $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp $(GLUON_IMAGEDIR)/sysupgrade/$(GLUON_BRANCH).manifest
|
|
||||||
|
|
||||||
dirclean : FORCE
|
|
||||||
for dir in build_dir dl staging_dir tmp; do \
|
|
||||||
rm -rf $(GLUON_ORIGOPENWRTDIR)/$$dir; \
|
|
||||||
done
|
|
||||||
rm -rf $(GLUON_BUILDDIR) $(GLUON_OUTPUTDIR)
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
TOPDIR=${CURDIR}
|
|
||||||
export TOPDIR
|
|
||||||
|
|
||||||
include rules.mk
|
|
||||||
|
|
||||||
include $(GLUONDIR)/include/gluon.mk
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/host.mk
|
|
||||||
include $(INCLUDE_DIR)/depends.mk
|
|
||||||
include $(INCLUDE_DIR)/subdir.mk
|
|
||||||
|
|
||||||
include package/Makefile
|
|
||||||
include tools/Makefile
|
|
||||||
include toolchain/Makefile
|
|
||||||
include target/Makefile
|
|
||||||
|
|
||||||
|
|
||||||
PROFILES :=
|
|
||||||
PROFILE_PACKAGES :=
|
|
||||||
|
|
||||||
define Profile
|
|
||||||
$(eval $(call Profile/Default))
|
|
||||||
$(eval $(call Profile/$(1)))
|
|
||||||
endef
|
|
||||||
|
|
||||||
define GluonProfile
|
|
||||||
PROFILES += $(1)
|
|
||||||
PROFILE_PACKAGES += $(filter-out -%,$(2) $(GLUON_$(1)_SITE_PACKAGES))
|
|
||||||
GLUON_$(1)_PROFILE := $(if $(3),$(3),$(1))
|
|
||||||
GLUON_$(1)_DEFAULT_PACKAGES := $(2)
|
|
||||||
GLUON_$(1)_FACTORY_SUFFIX := -squashfs-factory
|
|
||||||
GLUON_$(1)_SYSUPGRADE_SUFFIX := -squashfs-sysupgrade
|
|
||||||
GLUON_$(1)_FACTORY_EXT := .bin
|
|
||||||
GLUON_$(1)_SYSUPGRADE_EXT := .bin
|
|
||||||
GLUON_$(1)_FACTORY_EXTRA :=
|
|
||||||
GLUON_$(1)_SYSUPGRADE_EXTRA :=
|
|
||||||
GLUON_$(1)_MODELS :=
|
|
||||||
endef
|
|
||||||
|
|
||||||
define GluonProfileFactorySuffix
|
|
||||||
GLUON_$(1)_FACTORY_SUFFIX := $(2)
|
|
||||||
GLUON_$(1)_FACTORY_EXT := $(3)
|
|
||||||
GLUON_$(1)_FACTORY_EXTRA := $(4)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define GluonProfileSysupgradeSuffix
|
|
||||||
GLUON_$(1)_SYSUPGRADE_SUFFIX := $(2)
|
|
||||||
GLUON_$(1)_SYSUPGRADE_EXT := $(3)
|
|
||||||
GLUON_$(1)_SYSUPGRADE_EXTRA := $(4)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define GluonModel
|
|
||||||
GLUON_$(1)_MODELS += $(3)
|
|
||||||
GLUON_$(1)_MODEL_$(3) := $(2)
|
|
||||||
GLUON_$(1)_MODEL_$(3)_ALIASES :=
|
|
||||||
endef
|
|
||||||
|
|
||||||
define GluonModelAlias
|
|
||||||
GLUON_$(1)_MODEL_$(2)_ALIASES += $(3)
|
|
||||||
endef
|
|
||||||
|
|
||||||
|
|
||||||
export SHA512SUM := $(GLUONDIR)/scripts/sha512sum.sh
|
|
||||||
|
|
||||||
|
|
||||||
prereq: FORCE
|
|
||||||
+$(NO_TRACE_MAKE) prereq
|
|
||||||
|
|
||||||
prepare-tmpinfo: FORCE
|
|
||||||
@+$(MAKE) -r -s staging_dir/host/.prereq-build OPENWRT_BUILD= QUIET=0
|
|
||||||
mkdir -p tmp/info
|
|
||||||
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS="$(TOPDIR)/include/package*.mk $(TOPDIR)/overlay/*/*.mk" SCAN_EXTRA=""
|
|
||||||
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPS="profiles/*.mk $(TOPDIR)/include/kernel*.mk $(TOPDIR)/include/target.mk" SCAN_DEPTH=2 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
|
|
||||||
for type in package target; do \
|
|
||||||
f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \
|
|
||||||
[ "$$t" -nt "$$f" ] || ./scripts/metadata.pl $${type}_config "$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false; break; }; \
|
|
||||||
done
|
|
||||||
[ tmp/.config-feeds.in -nt tmp/.packagefeeds ] || ./scripts/feeds feed_config > tmp/.config-feeds.in
|
|
||||||
./scripts/metadata.pl package_mk tmp/.packageinfo > tmp/.packagedeps || { rm -f tmp/.packagedeps; false; }
|
|
||||||
./scripts/metadata.pl package_feeds tmp/.packageinfo > tmp/.packagefeeds || { rm -f tmp/.packagefeeds; false; }
|
|
||||||
touch $(TOPDIR)/tmp/.build
|
|
||||||
|
|
||||||
feeds: FORCE
|
|
||||||
rm -rf $(TOPDIR)/package/feeds
|
|
||||||
mkdir $(TOPDIR)/package/feeds
|
|
||||||
[ ! -f $(GLUON_SITEDIR)/modules ] || . $(GLUON_SITEDIR)/modules && for feed in $$GLUON_SITE_FEEDS; do ln -s ../../../packages/$$feed $(TOPDIR)/package/feeds/$$feed; done
|
|
||||||
ln -s ../../../package $(TOPDIR)/package/feeds/gluon
|
|
||||||
. $(GLUONDIR)/modules && for feed in $$GLUON_FEEDS; do ln -s ../../../packages/$$feed $(TOPDIR)/package/feeds/module_$$feed; done
|
|
||||||
+$(GLUONMAKE_EARLY) prepare-tmpinfo
|
|
||||||
|
|
||||||
gluon-tools: FORCE
|
|
||||||
+$(GLUONMAKE_EARLY) tools/patch/install
|
|
||||||
+$(GLUONMAKE_EARLY) tools/sed/install
|
|
||||||
+$(GLUONMAKE_EARLY) tools/cmake/install
|
|
||||||
+$(GLUONMAKE_EARLY) package/lua/host/install package/usign/host/install
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
early_prepared_stamp := $(GLUON_BUILDDIR)/prepared_$(shell \
|
|
||||||
( \
|
|
||||||
$(SHA512SUM) $(GLUONDIR)/modules; \
|
|
||||||
[ ! -r $(GLUON_SITEDIR)/modules ] || $(SHA512SUM) $(GLUON_SITEDIR)/modules \
|
|
||||||
) | $(SHA512SUM) )
|
|
||||||
|
|
||||||
prepare-early: FORCE
|
|
||||||
for dir in build_dir dl staging_dir; do \
|
|
||||||
mkdir -p $(GLUON_ORIGOPENWRTDIR)/$$dir; \
|
|
||||||
done
|
|
||||||
|
|
||||||
+$(GLUONMAKE_EARLY) feeds
|
|
||||||
+$(GLUONMAKE_EARLY) gluon-tools
|
|
||||||
|
|
||||||
mkdir -p $$(dirname $(early_prepared_stamp))
|
|
||||||
touch $(early_prepared_stamp)
|
|
||||||
|
|
||||||
$(early_prepared_stamp):
|
|
||||||
rm -f $(GLUON_BUILDDIR)/prepared_*
|
|
||||||
+$(GLUONMAKE_EARLY) prepare-early
|
|
||||||
|
|
||||||
$(GLUON_OPKG_KEY): $(early_prepared_stamp) FORCE
|
|
||||||
[ -s $(GLUON_OPKG_KEY) -a -s $(GLUON_OPKG_KEY).pub ] || \
|
|
||||||
( mkdir -p $$(dirname $(GLUON_OPKG_KEY)) && $(STAGING_DIR_HOST)/bin/usign -G -s $(GLUON_OPKG_KEY) -p $(GLUON_OPKG_KEY).pub -c "Gluon opkg key" )
|
|
||||||
|
|
||||||
$(GLUON_OPKG_KEY).pub: $(GLUON_OPKG_KEY)
|
|
||||||
|
|
||||||
create-key: $(GLUON_OPKG_KEY).pub
|
|
||||||
|
|
||||||
include $(GLUONDIR)/targets/targets.mk
|
|
||||||
|
|
||||||
ifneq ($(GLUON_TARGET),)
|
|
||||||
|
|
||||||
include $(GLUONDIR)/targets/$(GLUON_TARGET)/profiles.mk
|
|
||||||
|
|
||||||
BOARD := $(GLUON_TARGET_$(GLUON_TARGET)_BOARD)
|
|
||||||
override SUBTARGET := $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)
|
|
||||||
|
|
||||||
target_prepared_stamp := $(BOARD_BUILDDIR)/target-prepared
|
|
||||||
gluon_prepared_stamp := $(BOARD_BUILDDIR)/prepared
|
|
||||||
|
|
||||||
PREPARED_RELEASE = $$(cat $(gluon_prepared_stamp))
|
|
||||||
IMAGE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE)
|
|
||||||
MODULE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE)
|
|
||||||
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/target.mk
|
|
||||||
|
|
||||||
build-key: FORCE
|
|
||||||
rm -f $(BUILD_KEY) $(BUILD_KEY).pub
|
|
||||||
cp $(GLUON_OPKG_KEY) $(BUILD_KEY)
|
|
||||||
cp $(GLUON_OPKG_KEY).pub $(BUILD_KEY).pub
|
|
||||||
|
|
||||||
config: FORCE
|
|
||||||
+$(NO_TRACE_MAKE) scripts/config/conf OPENWRT_BUILD= QUIET=0
|
|
||||||
+$(GLUONMAKE) prepare-tmpinfo
|
|
||||||
( \
|
|
||||||
cat $(GLUONDIR)/include/config; \
|
|
||||||
echo 'CONFIG_TARGET_$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)=y'; \
|
|
||||||
$(if $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET), \
|
|
||||||
echo 'CONFIG_TARGET_$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)_$(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)=y'; \
|
|
||||||
) \
|
|
||||||
cat $(GLUONDIR)/targets/$(GLUON_TARGET)/config 2>/dev/null; \
|
|
||||||
echo 'CONFIG_BUILD_SUFFIX="gluon-$(GLUON_TARGET)"'; \
|
|
||||||
echo '$(patsubst %,CONFIG_PACKAGE_%=m,$(sort $(filter-out -%,$(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES) $(PROFILE_PACKAGES))))' \
|
|
||||||
| sed -e 's/ /\n/g'; \
|
|
||||||
echo '$(patsubst %,CONFIG_LUCI_LANG_%=y,$(GLUON_LANGS))' \
|
|
||||||
| sed -e 's/ /\n/g'; \
|
|
||||||
) > $(BOARD_BUILDDIR)/config.tmp
|
|
||||||
scripts/config/conf --defconfig=$(BOARD_BUILDDIR)/config.tmp Config.in
|
|
||||||
+$(SUBMAKE) tools/install
|
|
||||||
|
|
||||||
prepare-target: $(GLUON_OPKG_KEY).pub
|
|
||||||
rm $(GLUON_OPENWRTDIR)/tmp || true
|
|
||||||
mkdir -p $(GLUON_OPENWRTDIR)/tmp
|
|
||||||
|
|
||||||
for link in build_dir config Config.in dl include Makefile package rules.mk scripts staging_dir target toolchain tools; do \
|
|
||||||
ln -sf $(GLUON_ORIGOPENWRTDIR)/$$link $(GLUON_OPENWRTDIR); \
|
|
||||||
done
|
|
||||||
|
|
||||||
+$(GLUONMAKE) config
|
|
||||||
touch $(target_prepared_stamp)
|
|
||||||
|
|
||||||
$(target_prepared_stamp):
|
|
||||||
+$(GLUONMAKE_EARLY) prepare-target
|
|
||||||
|
|
||||||
maybe-prepare-target: $(target_prepared_stamp)
|
|
||||||
+$(GLUONMAKE_EARLY) $(GLUON_OPKG_KEY).pub
|
|
||||||
|
|
||||||
$(BUILD_DIR)/.prepared: Makefile
|
|
||||||
@mkdir -p $$(dirname $@)
|
|
||||||
@touch $@
|
|
||||||
|
|
||||||
$(toolchain/stamp-install): $(tools/stamp-install)
|
|
||||||
$(package/stamp-compile): $(package/stamp-cleanup)
|
|
||||||
|
|
||||||
|
|
||||||
clean: FORCE
|
|
||||||
+$(SUBMAKE) clean
|
|
||||||
rm -f $(gluon_prepared_stamp)
|
|
||||||
|
|
||||||
|
|
||||||
download: FORCE
|
|
||||||
+$(SUBMAKE) tools/download
|
|
||||||
+$(SUBMAKE) toolchain/download
|
|
||||||
+$(SUBMAKE) package/download
|
|
||||||
+$(SUBMAKE) target/download
|
|
||||||
|
|
||||||
toolchain: $(toolchain/stamp-install) $(tools/stamp-install)
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/kernel.mk
|
|
||||||
|
|
||||||
kernel: FORCE
|
|
||||||
+$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) $(LINUX_DIR)/.image TARGET_BUILD=1
|
|
||||||
+$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) $(LINUX_DIR)/.modules TARGET_BUILD=1
|
|
||||||
|
|
||||||
packages: $(package/stamp-compile)
|
|
||||||
$(_SINGLE)$(SUBMAKE) -r package/index
|
|
||||||
|
|
||||||
prepare-image: FORCE
|
|
||||||
rm -rf $(BOARD_KDIR)
|
|
||||||
mkdir -p $(BOARD_KDIR)
|
|
||||||
-cp $(KERNEL_BUILD_DIR)/* $(BOARD_KDIR)/
|
|
||||||
+$(SUBMAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image image_prepare KDIR="$(BOARD_KDIR)"
|
|
||||||
|
|
||||||
prepare: FORCE
|
|
||||||
@$(STAGING_DIR_HOST)/bin/lua $(GLUONDIR)/scripts/site_config.lua \
|
|
||||||
|| (echo 'Your site configuration did not pass validation.'; false)
|
|
||||||
|
|
||||||
mkdir -p $(GLUON_IMAGEDIR) $(BOARD_BUILDDIR)
|
|
||||||
echo 'src packages file:../openwrt/bin/$(BOARD)/packages' > $(BOARD_BUILDDIR)/opkg.conf
|
|
||||||
|
|
||||||
+$(GLUONMAKE) toolchain
|
|
||||||
+$(GLUONMAKE) kernel
|
|
||||||
+$(GLUONMAKE) packages
|
|
||||||
+$(GLUONMAKE) prepare-image
|
|
||||||
|
|
||||||
echo "$(GLUON_RELEASE)" > $(gluon_prepared_stamp)
|
|
||||||
|
|
||||||
$(gluon_prepared_stamp):
|
|
||||||
+$(GLUONMAKE) prepare
|
|
||||||
|
|
||||||
modules: FORCE $(gluon_prepared_stamp)
|
|
||||||
-rm -f $(GLUON_MODULEDIR)/*/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)/*
|
|
||||||
-rmdir -p $(GLUON_MODULEDIR)/*/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)
|
|
||||||
mkdir -p $(GLUON_MODULEDIR)/$(MODULE_PREFIX)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)
|
|
||||||
cp $(PACKAGE_DIR)/kmod-*.ipk $(GLUON_MODULEDIR)/$(MODULE_PREFIX)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)
|
|
||||||
|
|
||||||
$(_SINGLE)$(SUBMAKE) -r package/index PACKAGE_DIR=$(GLUON_MODULEDIR)/$(MODULE_PREFIX)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)
|
|
||||||
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package-ipkg.mk
|
|
||||||
|
|
||||||
# override variables from rules.mk
|
|
||||||
PACKAGE_DIR = $(GLUON_OPENWRTDIR)/bin/$(BOARD)/packages
|
|
||||||
|
|
||||||
PROFILE_BUILDDIR = $(BOARD_BUILDDIR)/profiles/$(PROFILE)
|
|
||||||
PROFILE_KDIR = $(PROFILE_BUILDDIR)/kernel
|
|
||||||
BIN_DIR = $(PROFILE_BUILDDIR)/images
|
|
||||||
|
|
||||||
TARGET_DIR = $(PROFILE_BUILDDIR)/root
|
|
||||||
|
|
||||||
OPKG:= \
|
|
||||||
IPKG_TMP="$(TMP_DIR)/ipkgtmp" \
|
|
||||||
IPKG_INSTROOT="$(TARGET_DIR)" \
|
|
||||||
IPKG_CONF_DIR="$(TMP_DIR)" \
|
|
||||||
IPKG_OFFLINE_ROOT="$(TARGET_DIR)" \
|
|
||||||
$(STAGING_DIR_HOST)/bin/opkg \
|
|
||||||
-f $(BOARD_BUILDDIR)/opkg.conf \
|
|
||||||
--cache $(TMP_DIR)/dl \
|
|
||||||
--offline-root $(TARGET_DIR) \
|
|
||||||
--force-postinstall \
|
|
||||||
--add-dest root:/ \
|
|
||||||
--add-arch all:100 \
|
|
||||||
--add-arch $(ARCH_PACKAGES):200
|
|
||||||
|
|
||||||
EnableInitscript = ! grep -q '\#!/bin/sh /etc/rc.common' $(1) || bash ./etc/rc.common $(1) enable
|
|
||||||
|
|
||||||
|
|
||||||
enable_initscripts: FORCE
|
|
||||||
cd $(TARGET_DIR) && ( export IPKG_INSTROOT=$(TARGET_DIR); \
|
|
||||||
$(foreach script,$(wildcard $(TARGET_DIR)/etc/init.d/*), \
|
|
||||||
$(call EnableInitscript,$(script)); \
|
|
||||||
) : \
|
) : \
|
||||||
)
|
) > 'tmp/$(GLUON_BRANCH).manifest.tmp'
|
||||||
|
|
||||||
|
@mkdir -p '$(GLUON_IMAGEDIR)/sysupgrade'
|
||||||
|
@mv 'tmp/$(GLUON_BRANCH).manifest.tmp' '$(GLUON_IMAGEDIR)/sysupgrade/$(GLUON_BRANCH).manifest'
|
||||||
|
|
||||||
# Generate package list
|
FORCE: ;
|
||||||
$(eval $(call merge-lists,INSTALL_PACKAGES,DEFAULT_PACKAGES GLUON_DEFAULT_PACKAGES GLUON_SITE_PACKAGES GLUON_$(PROFILE)_DEFAULT_PACKAGES GLUON_$(PROFILE)_SITE_PACKAGES))
|
|
||||||
|
|
||||||
package_install: FORCE
|
.PHONY: FORCE
|
||||||
$(OPKG) update
|
.NOTPARALLEL:
|
||||||
$(OPKG) install $(PACKAGE_DIR)/base-files_*.ipk $(PACKAGE_DIR)/libc_*.ipk
|
|
||||||
$(OPKG) install $(PACKAGE_DIR)/kernel_*.ipk
|
|
||||||
|
|
||||||
$(OPKG) install $(INSTALL_PACKAGES)
|
|
||||||
+$(GLUONMAKE) enable_initscripts
|
|
||||||
|
|
||||||
rm -f $(TARGET_DIR)/usr/lib/opkg/lists/* $(TARGET_DIR)/tmp/opkg.lock
|
|
||||||
|
|
||||||
# Remove opkg database when opkg is not intalled
|
|
||||||
if [ ! -x $(TARGET_DIR)/bin/opkg ]; then rm -rf $(TARGET_DIR)/usr/lib/opkg; fi
|
|
||||||
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/version.mk
|
|
||||||
|
|
||||||
opkg_config: FORCE
|
|
||||||
for d in base packages luci routing telephony management; do \
|
|
||||||
echo "src/gz %n_$$d %U/$$d"; \
|
|
||||||
done > $(TARGET_DIR)/etc/opkg/distfeeds.conf
|
|
||||||
$(VERSION_SED) $(TARGET_DIR)/etc/opkg/distfeeds.conf
|
|
||||||
|
|
||||||
|
|
||||||
image: FORCE
|
|
||||||
rm -rf $(TARGET_DIR) $(BIN_DIR) $(PROFILE_KDIR)
|
|
||||||
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TARGET_DIR)/tmp $(GLUON_IMAGEDIR)/factory $(GLUON_IMAGEDIR)/sysupgrade
|
|
||||||
cp -r $(BOARD_KDIR) $(PROFILE_KDIR)
|
|
||||||
|
|
||||||
+$(GLUONMAKE) package_install
|
|
||||||
+$(GLUONMAKE) opkg_config
|
|
||||||
|
|
||||||
$(call Image/mkfs/prepare)
|
|
||||||
$(_SINGLE)$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image install TARGET_BUILD=1 IMG_PREFIX=gluon \
|
|
||||||
PROFILE="$(GLUON_$(PROFILE)_PROFILE)" KDIR="$(PROFILE_KDIR)" TARGET_DIR="$(TARGET_DIR)" BIN_DIR="$(BIN_DIR)" TMP_DIR="$(TMP_DIR)"
|
|
||||||
|
|
||||||
$(foreach model,$(GLUON_$(PROFILE)_MODELS), \
|
|
||||||
$(if $(GLUON_$(PROFILE)_SYSUPGRADE_EXT), \
|
|
||||||
rm -f $(GLUON_IMAGEDIR)/sysupgrade/gluon-*-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \
|
|
||||||
cp $(BIN_DIR)/gluon-$(GLUON_$(PROFILE)_MODEL_$(model))$(GLUON_$(PROFILE)_SYSUPGRADE_SUFFIX)$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) $(GLUON_IMAGEDIR)/sysupgrade/$(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \
|
|
||||||
) \
|
|
||||||
$(if $(GLUON_$(PROFILE)_FACTORY_EXT), \
|
|
||||||
rm -f $(GLUON_IMAGEDIR)/factory/gluon-*-$(model)$(GLUON_$(PROFILE)_FACTORY_EXT) && \
|
|
||||||
cp $(BIN_DIR)/gluon-$(GLUON_$(PROFILE)_MODEL_$(model))$(GLUON_$(PROFILE)_FACTORY_SUFFIX)$(GLUON_$(PROFILE)_FACTORY_EXT) $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(model)$(GLUON_$(PROFILE)_FACTORY_EXT) && \
|
|
||||||
) \
|
|
||||||
\
|
|
||||||
$(if $(GLUON_$(PROFILE)_SYSUPGRADE_EXTRA), \
|
|
||||||
rm -f $(GLUON_IMAGEDIR)/sysupgrade/gluon-*-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXTRA) && \
|
|
||||||
cp $(BIN_DIR)/gluon$(GLUON_$(PROFILE)_SYSUPGRADE_EXTRA) $(GLUON_IMAGEDIR)/sysupgrade/$(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXTRA) && \
|
|
||||||
) \
|
|
||||||
$(if $(GLUON_$(PROFILE)_FACTORY_EXTRA), \
|
|
||||||
rm -f $(GLUON_IMAGEDIR)/factory/gluon-*-$(model)$(GLUON_$(PROFILE)_FACTORY_EXTRA) && \
|
|
||||||
cp $(BIN_DIR)/gluon$(GLUON_$(PROFILE)_FACTORY_EXTRA) $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(model)$(GLUON_$(PROFILE)_FACTORY_EXTRA) && \
|
|
||||||
) \
|
|
||||||
\
|
|
||||||
$(foreach alias,$(GLUON_$(PROFILE)_MODEL_$(model)_ALIASES), \
|
|
||||||
$(if $(GLUON_$(PROFILE)_SYSUPGRADE_EXT), \
|
|
||||||
rm -f $(GLUON_IMAGEDIR)/sysupgrade/gluon-*-$(alias)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \
|
|
||||||
ln -s $(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) $(GLUON_IMAGEDIR)/sysupgrade/$(IMAGE_PREFIX)-$(alias)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \
|
|
||||||
) \
|
|
||||||
$(if $(GLUON_$(PROFILE)_FACTORY_EXT), \
|
|
||||||
rm -f $(GLUON_IMAGEDIR)/factory/gluon-*-$(alias)$(GLUON_$(PROFILE)_FACTORY_EXT) && \
|
|
||||||
ln -s $(IMAGE_PREFIX)-$(model)$(GLUON_$(PROFILE)_FACTORY_EXT) $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(alias)$(GLUON_$(PROFILE)_FACTORY_EXT) && \
|
|
||||||
) \
|
|
||||||
) \
|
|
||||||
) :
|
|
||||||
|
|
||||||
|
|
||||||
image/%: $(gluon_prepared_stamp)
|
|
||||||
+$(GLUONMAKE) image PROFILE="$(patsubst image/%,%,$@)" V=s$(OPENWRT_VERBOSE)
|
|
||||||
|
|
||||||
call_image/%: FORCE
|
|
||||||
+$(GLUONMAKE) $(patsubst call_image/%,image/%,$@)
|
|
||||||
|
|
||||||
images: $(patsubst %,call_image/%,$(PROFILES)) ;
|
|
||||||
|
|
||||||
manifest: FORCE
|
|
||||||
( \
|
|
||||||
cd $(GLUON_IMAGEDIR)/sysupgrade; \
|
|
||||||
$(foreach profile,$(PROFILES), \
|
|
||||||
$(if $(GLUON_$(profile)_SYSUPGRADE_EXT), \
|
|
||||||
$(foreach model,$(GLUON_$(profile)_MODELS), \
|
|
||||||
file="$(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(profile)_SYSUPGRADE_EXT)"; \
|
|
||||||
[ -e "$$file" ] && echo '$(model)' "$(PREPARED_RELEASE)" "$$($(SHA512SUM) "$$file")" "$$file"; \
|
|
||||||
\
|
|
||||||
$(foreach alias,$(GLUON_$(profile)_MODEL_$(model)_ALIASES), \
|
|
||||||
file="$(IMAGE_PREFIX)-$(alias)-sysupgrade$(GLUON_$(profile)_SYSUPGRADE_EXT)"; \
|
|
||||||
[ -e "$$file" ] && echo '$(alias)' "$(PREPARED_RELEASE)" "$$($(SHA512SUM) "$$file")" "$$file"; \
|
|
||||||
) \
|
|
||||||
) \
|
|
||||||
) \
|
|
||||||
) : \
|
|
||||||
) >> $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp
|
|
||||||
|
|
||||||
.PHONY: all create-key prepare images modules clean gluon-tools manifest
|
|
||||||
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
@ -19,7 +19,7 @@ the future development of Gluon.
|
|||||||
|
|
||||||
Please refrain from using the `master` branch for anything else but development purposes!
|
Please refrain from using the `master` branch for anything else but development purposes!
|
||||||
Use the most recent release instead. You can list all relaseses by running `git branch -a`
|
Use the most recent release instead. You can list all relaseses by running `git branch -a`
|
||||||
and switch to one by running `git checkout v2016.1.6 && make update`.
|
and switch to one by running `git checkout v2016.2.2 && make update`.
|
||||||
|
|
||||||
If you're using the autoupdater, do not autoupdate nodes with anything but releases.
|
If you're using the autoupdater, do not autoupdate nodes with anything but releases.
|
||||||
If you upgrade using random master commits the nodes *will break* eventually.
|
If you upgrade using random master commits the nodes *will break* eventually.
|
||||||
@ -28,11 +28,11 @@ If you upgrade using random master commits the nodes *will break* eventually.
|
|||||||
|
|
||||||
To subscribe to the list, send a message to:
|
To subscribe to the list, send a message to:
|
||||||
|
|
||||||
gluon-subscribe@luebeck.freifunk.net
|
gluon+subscribe@luebeck.freifunk.net
|
||||||
|
|
||||||
To remove your address from the list, just send a message to
|
To remove your address from the list, just send a message to
|
||||||
the address in the `List-Unsubscribe` header of any list
|
the address in the `List-Unsubscribe` header of any list
|
||||||
message. If you haven't changed addresses since subscribing,
|
message. If you haven't changed addresses since subscribing,
|
||||||
you can also send a message to:
|
you can also send a message to:
|
||||||
|
|
||||||
gluon-unsubscribe@luebeck.freifunk.net
|
gluon+unsubscribe@luebeck.freifunk.net
|
||||||
|
@ -54,9 +54,9 @@ copyright = '2015-2016, Project Gluon'
|
|||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '2016.1+'
|
version = '2016.2+'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = '2016.1+'
|
release = '2016.2+'
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
@ -34,21 +34,7 @@ rerun
|
|||||||
`patches`; the resulting branch will be called `patched`, while the commit specified in `modules`
|
`patches`; the resulting branch will be called `patched`, while the commit specified in `modules`
|
||||||
can be refered to by the branch `base`.
|
can be refered to by the branch `base`.
|
||||||
|
|
||||||
::
|
After new patches have been commited on top of the `patched` branch (or existing commits
|
||||||
|
|
||||||
make unpatch
|
|
||||||
|
|
||||||
sets the repositories to the `base` branch,
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
make patch
|
|
||||||
|
|
||||||
re-applies the patches by resetting the `patched` branch to `base` and calling `git am`
|
|
||||||
for the patch files. Calling `make` or a similar command after calling `make unpatch`
|
|
||||||
is generally not a good idea.
|
|
||||||
|
|
||||||
After new patches have been commited on top of the patched branch (or existing commits
|
|
||||||
since the base commit have been edited or removed), the patch directories can be regenerated
|
since the base commit have been edited or removed), the patch directories can be regenerated
|
||||||
using
|
using
|
||||||
|
|
||||||
@ -61,3 +47,19 @@ and you can try rebasing it onto the new `base` branch yourself and after that c
|
|||||||
|
|
||||||
Always call `make update-patches` after making changes to a module repository as `make update` will overwrite your
|
Always call `make update-patches` after making changes to a module repository as `make update` will overwrite your
|
||||||
commits, making `git reflog` the only way to recover them!
|
commits, making `git reflog` the only way to recover them!
|
||||||
|
|
||||||
|
Development Guidelines
|
||||||
|
----------------------
|
||||||
|
lua should be used instead of sh whenever sensible. The following criteria
|
||||||
|
should be considered:
|
||||||
|
|
||||||
|
- Is the script doing more than just executing external commands? if so, use lua
|
||||||
|
- Is the script parsing/editing json-data? If so, use lua for speed
|
||||||
|
- When using sh, use jsonfilter instead of json_* functions for speed
|
||||||
|
|
||||||
|
Code formatting may sound like a topic for the pedantic, however it helps if
|
||||||
|
the code in the project is formatted in the same way. The following rules
|
||||||
|
apply:
|
||||||
|
|
||||||
|
- use tabs instead of spaces
|
||||||
|
- trailing whitespaces must be eliminated
|
||||||
|
@ -11,57 +11,114 @@ is a requirement. At the moment, Gluon's scripts can't handle devices
|
|||||||
without WLAN adapters (although such environments may also be interesting,
|
without WLAN adapters (although such environments may also be interesting,
|
||||||
e.g. for automated testing in virtual machines).
|
e.g. for automated testing in virtual machines).
|
||||||
|
|
||||||
|
|
||||||
.. _hardware-adding-profiles:
|
.. _hardware-adding-profiles:
|
||||||
|
|
||||||
Adding profiles
|
Adding profiles
|
||||||
---------------
|
---------------
|
||||||
The vast majority of devices with ath9k WLAN uses the ar71xx target of OpenWrt.
|
The vast majority of devices with ath9k WLAN uses the ar71xx target of LEDE.
|
||||||
If the hardware you want to add support for is also ar71xx, adding a new profile
|
If the hardware you want to add support for is also ar71xx, adding a new profile
|
||||||
is enough.
|
is enough.
|
||||||
|
|
||||||
Profiles are defined in ``targets/<target>-<subtarget>/profiles.mk``. There are two macros
|
Profiles are defined in ``targets/*`` in a shell-based DSL (so common shell
|
||||||
used to define which images are generated: ``GluonProfile`` and ``GluonModel``. The following examples
|
commands syntax like ``if`` can be used.
|
||||||
are taken from ``profiles.mk`` of the ``ar71xx-generic`` target::
|
|
||||||
|
|
||||||
$(eval $(call GluonProfile,TLWR1043))
|
The ``device`` command is used to define an image build for a device. It takes
|
||||||
$(eval $(call GluonModel,TLWR1043,tl-wr1043nd-v1-squashfs,tp-link-tl-wr1043n-nd-v1))
|
two or three parameters.
|
||||||
$(eval $(call GluonModel,TLWR1043,tl-wr1043nd-v2-squashfs,tp-link-tl-wr1043n-nd-v2))
|
|
||||||
|
|
||||||
The ``GluonProfile`` macro takes at least one parameter, the profile name as it is
|
The first parameter defines the Gluon profile name, which is used to refer to the
|
||||||
defined in the Makefiles of OpenWrt (``openwrt/target/linux/<target>/<subtarget>/profiles/*``
|
device and is part of the generated image name. The profile name must be same as
|
||||||
and ``openwrt/target/linux/<target>/image/Makefile``). If the target you are on doesn't define
|
the output of the following command (on the target device), so the autoupdater
|
||||||
profiles (e.g. on x86), just add a single profile called ``Generic`` or similar.
|
can work::
|
||||||
|
|
||||||
It may optionally take a second parameter which defines additional packages to include for the profile
|
|
||||||
(e.g. ath10k). The additional packages defined in ``openwrt/target/linux/<target>/<subtarget>/profiles/*``
|
|
||||||
aren't used.
|
|
||||||
|
|
||||||
The ``GluonModel`` macro takes three parameters: The profile name, the suffix of the image file
|
|
||||||
generated by OpenWrt (without the file extension), and the final image name of the Gluon image.
|
|
||||||
The final image name must be the same that is returned by the following command.
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
lua -e 'print(require("platform_info").get_image_name())'
|
lua -e 'print(require("platform_info").get_image_name())'
|
||||||
|
|
||||||
|
The second parameter defines the name of the image files generated by LEDE. Usually,
|
||||||
|
it is also the LEDE profile name; for devices that still use the old image build
|
||||||
|
code, a third parameter with the LEDE profile name can be passed. The profile names
|
||||||
|
can be found in the image Makefiles in ``lede/target/linux/<target>/image/Makefile``.
|
||||||
|
|
||||||
This is just so the autoupdater can work. The command has to be executed _on_ the target (eg. the hardware router with a flashed image). So you'll first have to build an image with a guessed name, and afterwards build a new, correctly named image. On targets which aren't supported by the autoupdater,
|
Examples::
|
||||||
``require("platform_info").get_image_name()`` will just return ``nil`` and the final image name
|
|
||||||
may be defined arbitrarily.
|
device tp-link-tl-wr1043n-nd-v1 tl-wr1043nd-v1
|
||||||
|
device alfa-network-hornet-ub hornet-ub HORNETUB
|
||||||
|
|
||||||
|
Suffixes and extensions
|
||||||
|
'''''''''''''''''''''''
|
||||||
|
|
||||||
|
By default, image files are expected to have the extension ``.bin``. In addition,
|
||||||
|
the images generated by LEDE have a suffix before the extension that defaults to
|
||||||
|
``-squashfs-factory`` and ``-squashfs-sysupgrade``.
|
||||||
|
|
||||||
|
This can be changed using the ``factory`` and ``sysupgrade`` commands, either at
|
||||||
|
the top of the file to set the defaults for all images, or for a single image. There
|
||||||
|
are three forms with 0 to 2 arguments (all work with ``sysupgrade`` as well)::
|
||||||
|
|
||||||
|
factory SUFFIX .EXT
|
||||||
|
factory .EXT
|
||||||
|
factory
|
||||||
|
|
||||||
|
When only an extension is given, the default suffix is retained. When no arguments
|
||||||
|
are given, this signals that no factory (or sysupgrade) image exists.
|
||||||
|
|
||||||
|
Aliases
|
||||||
|
'''''''
|
||||||
|
|
||||||
|
Sometimes multiple models use the same LEDE images. In this case, the ``alias``
|
||||||
|
command can be used to create symlinks and additional entries in the autoupdater
|
||||||
|
manifest for the alternative models.
|
||||||
|
|
||||||
|
Standalone images
|
||||||
|
'''''''''''''''''
|
||||||
|
|
||||||
|
On targets without *per-device rootfs* support in LEDE, the commands described above
|
||||||
|
can't be used. Instead, ``factory_image`` and ``sysupgrade_image`` are used::
|
||||||
|
|
||||||
|
factory_image PROFILE IMAGE .EXT
|
||||||
|
sysupgrade_image PROFILE IMAGE .EXT
|
||||||
|
|
||||||
|
Again, the profile name must match the value printed by the aforementioned Lua
|
||||||
|
command. The image name must match the part between the target name and the extension
|
||||||
|
as generated by LEDE and is to be omitted when no such part exists.
|
||||||
|
|
||||||
|
Packages
|
||||||
|
''''''''
|
||||||
|
|
||||||
|
The ``packages`` command takes an arbitrary number of arguments. Each argument
|
||||||
|
defines an additional package to include in the images in addition to the default
|
||||||
|
package sets defined by LEDE. When a package name is prefixed by a minus sign, the
|
||||||
|
packages are excluded instead.
|
||||||
|
|
||||||
|
The ``packages`` command may be used at the top of a target definition to modify
|
||||||
|
the default package list for all images, or just for a single device (when the
|
||||||
|
target supports *per-default rootfs*).
|
||||||
|
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
'''''''''''''
|
||||||
|
|
||||||
|
The ``config`` command allows to add arbitary target-specific LEDE configuration
|
||||||
|
to be emitted to ``.config``.
|
||||||
|
|
||||||
|
Notes
|
||||||
|
'''''
|
||||||
|
|
||||||
On devices with multiple WLAN adapters, care must also be taken that the primary MAC address is
|
On devices with multiple WLAN adapters, care must also be taken that the primary MAC address is
|
||||||
configured correctly. ``/lib/gluon/core/sysconfig/primary_mac`` should contain the MAC address which
|
configured correctly. ``/lib/gluon/core/sysconfig/primary_mac`` should contain the MAC address which
|
||||||
can be found on a label on most hardware; if it does not, ``/lib/gluon/upgrade/010-primary-mac``
|
can be found on a label on most hardware; if it does not, ``/lib/gluon/upgrade/010-primary-mac``
|
||||||
in ``gluon-core`` might need a fix. (There have also been cases in which the address was incorrect
|
in ``gluon-core`` might need a fix. (There have also been cases in which the address was incorrect
|
||||||
even on devices with only one WLAN adapter, in these cases an OpenWrt bug was the cause).
|
even on devices with only one WLAN adapter, in these cases a LEDE bug was the cause).
|
||||||
|
|
||||||
|
|
||||||
Adding support for new hardware targets
|
Adding support for new hardware targets
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
Adding a new target is much more complex than adding a new profile. There are two basic steps
|
Adding a new target is much more complex than adding a new profile. There are two basic steps
|
||||||
required for adding a new target:
|
required for adding a new target:
|
||||||
|
|
||||||
Adjust packages
|
Package adjustments
|
||||||
'''''''''''''''
|
'''''''''''''''''''
|
||||||
|
|
||||||
One package that definitely needs adjustments for every new target added is ``libplatforminfo`` (to be found in
|
One package that definitely needs adjustments for every new target added is ``libplatforminfo`` (to be found in
|
||||||
`packages/gluon/libs/libplatforminfo <https://github.com/freifunk-gluon/packages/tree/master/libs/libplatforminfo>`_).
|
`packages/gluon/libs/libplatforminfo <https://github.com/freifunk-gluon/packages/tree/master/libs/libplatforminfo>`_).
|
||||||
Start with a copy of an existing platform info source file and adjust it for the new target (or just add a symlink if
|
Start with a copy of an existing platform info source file and adjust it for the new target (or just add a symlink if
|
||||||
@ -71,15 +128,14 @@ On many targets, Gluon's network setup scripts (mainly in the packages ``gluon-c
|
|||||||
won't run correctly without some adjustments, so better double check that everything is fine there (and the files
|
won't run correctly without some adjustments, so better double check that everything is fine there (and the files
|
||||||
``primary_mac``, ``lan_ifname`` and ``wan_ifname`` in ``/lib/gluon/core/sysconfig/`` contain sensible values).
|
``primary_mac``, ``lan_ifname`` and ``wan_ifname`` in ``/lib/gluon/core/sysconfig/`` contain sensible values).
|
||||||
|
|
||||||
Add support to the build system
|
Build system support
|
||||||
'''''''''''''''''''''''''''''''
|
''''''''''''''''''''
|
||||||
A directory for the new target must be created under ``targets``, and it must be added
|
|
||||||
to ``targets/targets.mk``. In the new target directory, the following files must be created:
|
|
||||||
|
|
||||||
* profiles.mk
|
A definition for the new target must be created under ``targets``, and it must be added
|
||||||
* config (optional)
|
to ``targets/targets.mk``. The ``GluonTarget`` macro takes one to three arguments:
|
||||||
|
the target name, the Gluon subtarget name (if the target has subtargets), and the
|
||||||
For ``profiles.mk``, see :ref:`hardware-adding-profiles`.
|
LEDE subtarget name (if it differs from the Gluon subtarget). The third argument
|
||||||
The file ``config`` can be used to add additional, target-specific options to the OpenWrt config.
|
can be used to define multiple Gluon targets with different configuration for the
|
||||||
|
same LEDE target, like it is done for the ``ar71xx-tiny`` target.
|
||||||
|
|
||||||
After this, is should be sufficient to call ``make GLUON_TARGET=<target>`` to build the images for the new target.
|
After this, is should be sufficient to call ``make GLUON_TARGET=<target>`` to build the images for the new target.
|
||||||
|
@ -28,7 +28,8 @@ A fully automated nightly build could use the following commands:
|
|||||||
(cd site && git pull)
|
(cd site && git pull)
|
||||||
make update
|
make update
|
||||||
make clean
|
make clean
|
||||||
make -j5 GLUON_TARGET=ar71xx-generic GLUON_BRANCH=experimental
|
NUM_CORES_PLUS_ONE=$(expr $(nproc) + 1)
|
||||||
|
make -j$NUM_CORES_PLUS_ONE GLUON_TARGET=ar71xx-generic GLUON_BRANCH=experimental
|
||||||
make manifest GLUON_BRANCH=experimental
|
make manifest GLUON_BRANCH=experimental
|
||||||
contrib/sign.sh $SECRETKEY output/images/sysupgrade/experimental.manifest
|
contrib/sign.sh $SECRETKEY output/images/sysupgrade/experimental.manifest
|
||||||
|
|
||||||
|
30
docs/features/dns-cache.rst
Normal file
30
docs/features/dns-cache.rst
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
DNS-Caching
|
||||||
|
===========
|
||||||
|
User experience may be greatly improved when dns is accelerated. Also, it
|
||||||
|
seems like a good idea to keep the number of packages being exchanged
|
||||||
|
between node and gateway as small as possible. In order to do this, a
|
||||||
|
dns-cache may be used on a node. The dnsmasq instance listening on port
|
||||||
|
53 on the node will be reconfigured to answer requests, use a list of
|
||||||
|
upstream servers and a specific cache size if the options listed below are
|
||||||
|
added to site.conf. All settings are optional, though if no dns server is
|
||||||
|
set, the configuration will not be altered by gluon-core.
|
||||||
|
|
||||||
|
Besides caching dns requests from clients, the next_node-addresses are set to
|
||||||
|
resolve to a configurable name that may optionally be placed in next_node.name.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
dns = {
|
||||||
|
cacheentries = 5000,
|
||||||
|
servers = { '2001:db8::1', },
|
||||||
|
},
|
||||||
|
|
||||||
|
next_node = {
|
||||||
|
name = 'nextnode',
|
||||||
|
ip6 = '2001:db8:8::1',
|
||||||
|
ip4 = '198.51.100.1',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
The cache will be initialized during startup.
|
||||||
|
Each cache entry will occupy about 90 bytes of RAM.
|
@ -11,18 +11,20 @@ For this the section ``roles`` in ``site.conf`` is needed::
|
|||||||
roles = {
|
roles = {
|
||||||
default = 'node',
|
default = 'node',
|
||||||
list = {
|
list = {
|
||||||
node = 'Normal Node',
|
'node',
|
||||||
test = 'Test Node',
|
'test',
|
||||||
backbone = 'Backbone Node',
|
'backbone',
|
||||||
service = 'Service Node',
|
'service',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
The strings to display in the LuCI interface are configured per language in the
|
||||||
|
``i18n/en.po``, ``i18n/de.po``, etc. files of the site repository using message IDs like
|
||||||
|
``gluon-luci-node-role:role:node`` and ``gluon-luci-node-role:role:backbone``.
|
||||||
|
|
||||||
The value of ``default`` is the role every node will initially own. This value should be part of ``list`` as well.
|
The value of ``default`` is the role every node will initially own. This value should be part of ``list`` as well.
|
||||||
If you want node owners to change the defined roles via config-mode you can add the package
|
If you want node owners to change the defined roles via config-mode you can add the package
|
||||||
``gluon-luci-node-role`` to your ``site.mk``. Then, you can select one of the defined roles from a dropdown list
|
``gluon-luci-node-role`` to your ``site.mk``.
|
||||||
where the right-handed value is the one which is displayed and the left-handed key the one which is configured into
|
|
||||||
the system.
|
|
||||||
|
|
||||||
The role is saved in ``gluon-node-info.system.role``. To change the role using command line do::
|
The role is saved in ``gluon-node-info.system.role``. To change the role using command line do::
|
||||||
|
|
||||||
|
@ -33,12 +33,12 @@ Mesh-on-WAN
|
|||||||
It's possible to enable Mesh-on-WAN like this::
|
It's possible to enable Mesh-on-WAN like this::
|
||||||
|
|
||||||
uci set network.mesh_wan.auto=1
|
uci set network.mesh_wan.auto=1
|
||||||
uci commit
|
uci commit network
|
||||||
|
|
||||||
It may be disabled by running::
|
It may be disabled by running::
|
||||||
|
|
||||||
uci set network.mesh_wan.auto=0
|
uci set network.mesh_wan.auto=0
|
||||||
uci commit
|
uci commit network
|
||||||
|
|
||||||
|
|
||||||
Mesh-on-LAN
|
Mesh-on-LAN
|
||||||
@ -50,7 +50,7 @@ Configuring Mesh-on-LAN is a bit more complicated::
|
|||||||
for ifname in $(cat /lib/gluon/core/sysconfig/lan_ifname); do
|
for ifname in $(cat /lib/gluon/core/sysconfig/lan_ifname); do
|
||||||
uci del_list network.client.ifname=$ifname
|
uci del_list network.client.ifname=$ifname
|
||||||
done
|
done
|
||||||
uci commit
|
uci commit network
|
||||||
|
|
||||||
It may be disabled by running::
|
It may be disabled by running::
|
||||||
|
|
||||||
@ -58,8 +58,8 @@ It may be disabled by running::
|
|||||||
for ifname in $(cat /lib/gluon/core/sysconfig/lan_ifname); do
|
for ifname in $(cat /lib/gluon/core/sysconfig/lan_ifname); do
|
||||||
uci add_list network.client.ifname=$ifname
|
uci add_list network.client.ifname=$ifname
|
||||||
done
|
done
|
||||||
uci commit
|
uci commit network
|
||||||
|
|
||||||
Please note that this configuration has changed in Gluon v2016.1. Using
|
Please note that this configuration has changed in Gluon v2016.1. Using
|
||||||
the old commands on v2016.1 will break the corresponding options in the
|
the old commands on v2016.1 and later will break the corresponding options
|
||||||
*Advanced settings*.
|
in the *Advanced settings*.
|
||||||
|
@ -13,7 +13,7 @@ Upgrade behaviour
|
|||||||
For each of these networks, the site configuration may define a `disabled` flag (by
|
For each of these networks, the site configuration may define a `disabled` flag (by
|
||||||
default, all configured networks are enabled). This flag is merely a default setting,
|
default, all configured networks are enabled). This flag is merely a default setting,
|
||||||
on upgrades the existing setting is always retained (as this setting may have been changed
|
on upgrades the existing setting is always retained (as this setting may have been changed
|
||||||
by the user). This means that is is not possible to enable or disable an existing network
|
by the user). This means that it is not possible to enable or disable an existing network
|
||||||
configurations during upgrades.
|
configurations during upgrades.
|
||||||
|
|
||||||
For the "mesh" and "ibss" networks, the default setting only has an effect if none
|
For the "mesh" and "ibss" networks, the default setting only has an effect if none
|
||||||
|
@ -64,6 +64,8 @@ Releases
|
|||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
|
releases/v2016.2.2
|
||||||
|
releases/v2016.2.1
|
||||||
releases/v2016.2
|
releases/v2016.2
|
||||||
releases/v2016.1.6
|
releases/v2016.1.6
|
||||||
releases/v2016.1.5
|
releases/v2016.1.5
|
||||||
@ -110,11 +112,6 @@ ar71xx-generic
|
|||||||
- WZR-HP-G300NH2
|
- WZR-HP-G300NH2
|
||||||
- WZR-HP-G450H
|
- WZR-HP-G450H
|
||||||
|
|
||||||
* Cisco Meraki
|
|
||||||
|
|
||||||
- MR12 / MR62
|
|
||||||
- MR16 / MR66
|
|
||||||
|
|
||||||
* D-Link
|
* D-Link
|
||||||
|
|
||||||
- DIR-505 (A1, A2)
|
- DIR-505 (A1, A2)
|
||||||
@ -169,11 +166,11 @@ ar71xx-generic
|
|||||||
- TL-WA701N/ND (v1, v2)
|
- TL-WA701N/ND (v1, v2)
|
||||||
- TL-WA750RE (v1)
|
- TL-WA750RE (v1)
|
||||||
- TL-WA7510N (v1)
|
- TL-WA7510N (v1)
|
||||||
- TL-WA801N/ND (v1, v2)
|
- TL-WA801N/ND (v1, v2, v3)
|
||||||
- TL-WA830RE (v1, v2)
|
- TL-WA830RE (v1, v2)
|
||||||
- TL-WA850RE (v1)
|
- TL-WA850RE (v1)
|
||||||
- TL-WA860RE (v1)
|
- TL-WA860RE (v1)
|
||||||
- TL-WA901N/ND (v1, v2, v3)
|
- TL-WA901N/ND (v1, v2, v3, v4)
|
||||||
- TL-WDR3500 (v1)
|
- TL-WDR3500 (v1)
|
||||||
- TL-WDR3600 (v1)
|
- TL-WDR3600 (v1)
|
||||||
- TL-WDR4300 (v1)
|
- TL-WDR4300 (v1)
|
||||||
@ -186,10 +183,12 @@ ar71xx-generic
|
|||||||
- TL-WR841N/ND (v3, v5, v7, v8, v9, v10, v11)
|
- TL-WR841N/ND (v3, v5, v7, v8, v9, v10, v11)
|
||||||
- TL-WR842N/ND (v1, v2, v3)
|
- TL-WR842N/ND (v1, v2, v3)
|
||||||
- TL-WR843N/ND (v1)
|
- TL-WR843N/ND (v1)
|
||||||
- TL-WR940N (v1, v2, v3)
|
- TL-WR940N (v1, v2, v3, v4)
|
||||||
- TL-WR941ND (v2, v3, v4, v5, v6)
|
- TL-WR941ND (v2, v3, v4, v5, v6)
|
||||||
- TL-WR1043N/ND (v1, v2, v3)
|
- TL-WR1043N/ND (v1, v2, v3, v4)
|
||||||
- TL-WR2543N/ND (v1)
|
- TL-WR2543N/ND (v1)
|
||||||
|
- WBS210 (v1.20)
|
||||||
|
- WBS510 (v1.20)
|
||||||
|
|
||||||
* Ubiquiti
|
* Ubiquiti
|
||||||
|
|
||||||
|
59
docs/releases/v2016.2.1.rst
Normal file
59
docs/releases/v2016.2.1.rst
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
Gluon 2016.2.1
|
||||||
|
==============
|
||||||
|
|
||||||
|
Added hardware support
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
ar71xx-generic
|
||||||
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
* TP-Link
|
||||||
|
|
||||||
|
- TL-WA901ND v4
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
~~~~~~~~
|
||||||
|
|
||||||
|
* Make status page work with disabled cookies/local storage
|
||||||
|
(`#912 <https://github.com/freifunk-gluon/gluon/pull/912>`_)
|
||||||
|
|
||||||
|
* Update kernel to 3.18.44
|
||||||
|
|
||||||
|
Fixes CVE-2016-5195 and CVE-2016-7117. It is unlikely that these issues pose
|
||||||
|
a threat to usual Gluon setups, but installing additional packages may make a
|
||||||
|
system vulnerable. In any case, updating is highly recommended.
|
||||||
|
|
||||||
|
* Downgrade mac80211 to an earlier state
|
||||||
|
|
||||||
|
Unfortunately, a mac80211 update that was done shortly before the release of
|
||||||
|
Gluon v2016.2 (that seemed necessary to properly support ath10k devices) had
|
||||||
|
again caused severe ath9k stability issues that remained unreported until v2016.2
|
||||||
|
was out.
|
||||||
|
|
||||||
|
We have now reverted mac80211 to an earlier state that was reported to be very
|
||||||
|
stable (while keeping the ath10k-specific changes); in addition, some patches
|
||||||
|
that were reported to cause connection or performance issues with certain clients
|
||||||
|
have been reverted. While is it still not perfectly stable, is should be at least
|
||||||
|
as good as (and probably better than) the v2016.1.x release series.
|
||||||
|
|
||||||
|
Known Issues
|
||||||
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
|
* Default TX power on many Ubiquiti devices is too high, correct offsets are unknown (`#94 <https://github.com/freifunk-gluon/gluon/issues/94>`_)
|
||||||
|
|
||||||
|
Reducing the TX power in the Advanced Settings is recommended.
|
||||||
|
|
||||||
|
* The MAC address of the WAN interface is modified even when Mesh-on-WAN is disabled (`#496 <https://github.com/freifunk-gluon/gluon/issues/496>`_)
|
||||||
|
|
||||||
|
This may lead to issues in environments where a fixed MAC address is expected (like VMware when promicious mode is disallowed).
|
||||||
|
|
||||||
|
* Inconsistent respondd API (`#522 <https://github.com/freifunk-gluon/gluon/issues/522>`_)
|
||||||
|
|
||||||
|
The current API is inconsistent and will be replaced eventually. The old API will still be supported for a while.
|
||||||
|
|
||||||
|
* Git HTTPS downloads from git.kernel.org fail on Debian Wheezy (`#919 <https://github.com/freifunk-gluon/gluon/issues/919>`_)
|
||||||
|
|
||||||
|
The GnuTLS version on Debian Wheezy is too old and can't establish a connection with
|
||||||
|
git.kernel.org anymore. A newer GnuTLS version is available in wheezy-backports, but
|
||||||
|
as there is no libcurl3-gnutls package linked against the new version, installing the
|
||||||
|
new version has no effect.
|
78
docs/releases/v2016.2.2.rst
Normal file
78
docs/releases/v2016.2.2.rst
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
Gluon 2016.2.2
|
||||||
|
==============
|
||||||
|
|
||||||
|
Added hardware support
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
ar71xx-generic
|
||||||
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
* TP-Link
|
||||||
|
|
||||||
|
- CPE210/510 EU/US versions
|
||||||
|
- TL-WA801N/ND v3
|
||||||
|
- TL-WR841ND v11 EU/US versions
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
~~~~~~~~
|
||||||
|
|
||||||
|
* Fix boot on certain QCA955x-based devices (e.g. OpenMesh OM5P AC v2) (`#965 <https://github.com/freifunk-gluon/gluon/pull/965>`_)
|
||||||
|
|
||||||
|
This issue was a regression in Gluon v2016.2.1.
|
||||||
|
|
||||||
|
* Build: Fix git downloads from git.kernel.org on Debian Wheezy (`#919 <https://github.com/freifunk-gluon/gluon/issues/919>`_)
|
||||||
|
|
||||||
|
We've switched back from HTTPS to the git protocol for now to avoid using
|
||||||
|
the old GnuTLS version of Debian Wheezy which can't establish a HTTPS connection
|
||||||
|
with git.kernel.org anymore.
|
||||||
|
|
||||||
|
This issue was a regression in Gluon v2016.2.
|
||||||
|
|
||||||
|
* Fix RX filter of Ubiquiti UAP Outdoor+ (`d43147a8e03d <https://github.com/freifunk-gluon/gluon/commit/d43147a8e03dd17bc27e4ab203736f2151f9db3d>`_)
|
||||||
|
|
||||||
|
This issue was a regression in Gluon v2016.2.
|
||||||
|
|
||||||
|
* Fix switched WAN/LAN interface assignment on CPE210 (`59deb2064d54 <https://github.com/freifunk-gluon/gluon/commit/59deb2064d54a37e27139b76a3b6064f5f10f364>`_)
|
||||||
|
|
||||||
|
This issue was a regression in Gluon v2016.2.
|
||||||
|
|
||||||
|
* Significantly reduce CPU load used by signal strength LEDs (`#897 <https://github.com/freifunk-gluon/gluon/issues/897>`_)
|
||||||
|
|
||||||
|
* Fix ethernet port of the Ubiquiti UAP AC Lite (`#911 <https://github.com/freifunk-gluon/gluon/issues/911>`_)
|
||||||
|
|
||||||
|
* Build: Don't use host ``/tmp`` directory (`f9072a36411b <https://github.com/freifunk-gluon/gluon/commit/f9072a36411b92089c697b2c0a564155bfe10bd1>`_)
|
||||||
|
|
||||||
|
Fixes build when ``/tmp`` is mounted with *noexec*.
|
||||||
|
|
||||||
|
* Fix mesh interface type respondd/alfred announcements when using VLANs over IBSS (`#941 <https://github.com/freifunk-gluon/gluon/issues/941>`_)
|
||||||
|
|
||||||
|
* Fix next-node ebtables rules without *next_node.ip4* (`9dbe9f785d2b <https://github.com/freifunk-gluon/gluon/commit/9dbe9f785d2b439c3ebdae365b808ebf42b3cf03>`_)
|
||||||
|
|
||||||
|
Gluon v2016.2 added support for using the next-node feature without specifying an IPv4
|
||||||
|
address. Some scripts had not been adjusted, making the next-node unreliable when
|
||||||
|
no IPv4 address was specified.
|
||||||
|
|
||||||
|
Other changes
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
* x86-generic and x86-64 images now have PATA and MMC support to allow using them
|
||||||
|
on various devices that were previously unsupported.
|
||||||
|
|
||||||
|
* Clean up opkg postinst scripts up on image generation
|
||||||
|
|
||||||
|
OpenWrt does this by default to save a little space.
|
||||||
|
|
||||||
|
Known Issues
|
||||||
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
|
* Default TX power on many Ubiquiti devices is too high, correct offsets are unknown (`#94 <https://github.com/freifunk-gluon/gluon/issues/94>`_)
|
||||||
|
|
||||||
|
Reducing the TX power in the Advanced Settings is recommended.
|
||||||
|
|
||||||
|
* The MAC address of the WAN interface is modified even when Mesh-on-WAN is disabled (`#496 <https://github.com/freifunk-gluon/gluon/issues/496>`_)
|
||||||
|
|
||||||
|
This may lead to issues in environments where a fixed MAC address is expected (like VMware when promicious mode is disallowed).
|
||||||
|
|
||||||
|
* Inconsistent respondd API (`#522 <https://github.com/freifunk-gluon/gluon/issues/522>`_)
|
||||||
|
|
||||||
|
The current API is inconsistent and will be replaced eventually. The old API will still be supported for a while.
|
@ -1,5 +1,5 @@
|
|||||||
Gluon 2016.2 (in development)
|
Gluon 2016.2
|
||||||
=============================
|
============
|
||||||
|
|
||||||
Added hardware support
|
Added hardware support
|
||||||
~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -76,7 +76,7 @@ New features
|
|||||||
the ``config_mode.owner.obligatory`` site.conf option
|
the ``config_mode.owner.obligatory`` site.conf option
|
||||||
|
|
||||||
* The *node name* setting in the config mode is no longer restricted to valid DNS
|
* The *node name* setting in the config mode is no longer restricted to valid DNS
|
||||||
hostnames, but allows any UTF-8 string (`#414 <https://github.com/freifunk-gluon/gluon/issues/#414>`_)
|
hostnames, but allows any UTF-8 string (`#414 <https://github.com/freifunk-gluon/gluon/issues/414>`_)
|
||||||
|
|
||||||
* Besides the hostname, public key, site config and primary MAC address, the contact
|
* Besides the hostname, public key, site config and primary MAC address, the contact
|
||||||
information can now be accessed from config mode site texts
|
information can now be accessed from config mode site texts
|
||||||
@ -85,24 +85,35 @@ New features
|
|||||||
site texts. They should always be used when including user-provided information like
|
site texts. They should always be used when including user-provided information like
|
||||||
hostnames and contact information in HTML code or URLs.
|
hostnames and contact information in HTML code or URLs.
|
||||||
|
|
||||||
* Dropbear is updated to a newer version, enabling new SSH crytpo methods and removing
|
* Dropbear has been updated to a newer version, enabling new SSH crypto methods and removing
|
||||||
some old ones like DSA. This reduces the time needed for the first boot and makes
|
some old ones like DSA. This reduces the time needed for the first boot and makes
|
||||||
SSH logins faster (`#223 <https://github.com/freifunk-gluon/gluon/issues/223>`_)
|
SSH logins faster (`#223 <https://github.com/freifunk-gluon/gluon/issues/223>`_)
|
||||||
|
|
||||||
* WLAN basic and supported rate sets have been made configurable, to allow disabling
|
* WLAN basic and supported rate sets have been made configurable, to allow disabling
|
||||||
802.11b rates (`#810 <https://github.com/freifunk-gluon/gluon/pull/810>`_)
|
802.11b rates (`#810 <https://github.com/freifunk-gluon/gluon/pull/810>`_)
|
||||||
|
|
||||||
* ath10k-based devices are now officially supported, it's possible to choose between
|
* ath10k-based devices are now supported officially; it's possible to choose between
|
||||||
IBSS- and 11s-capable firmwares in site.mk (`#864 <https://github.com/freifunk-gluon/gluon/pull/864>`_)
|
IBSS- and 11s-capable firmwares in site.mk (`#864 <https://github.com/freifunk-gluon/gluon/pull/864>`_)
|
||||||
|
|
||||||
* The ``prefix4`` and ``next_node.ip4`` site.conf options are now optional.
|
* The ``prefix4`` and ``next_node.ip4`` site.conf options are optional now.
|
||||||
|
|
||||||
Bugfixes
|
Bugfixes
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
||||||
|
* The stability of the ath9k WLAN driver has been improved significantly
|
||||||
|
(`#605 <https://github.com/freifunk-gluon/gluon/issues/605>`_)
|
||||||
|
|
||||||
|
mac80211, hostapd and other related drivers and services have been backported from LEDE ``42f559e``.
|
||||||
|
|
||||||
* Extremely slow downloads could lead to multiple instances of the autoupdater
|
* Extremely slow downloads could lead to multiple instances of the autoupdater
|
||||||
running concurrently. Use lockfile to prevent this and add timeouts to download
|
running concurrently (`#582 <https://github.com/freifunk-gluon/gluon/pull/582>`_)
|
||||||
processes. (`#582 <https://github.com/freifunk-gluon/gluon/pull/582>`_)
|
|
||||||
|
A lockfile is used to prevent this and timeouts have been added to download processes.
|
||||||
|
|
||||||
|
* Usage of static DNS servers on the WAN port has been fixed
|
||||||
|
(`#886 <https://github.com/freifunk-gluon/gluon/issues/886>`_)
|
||||||
|
|
||||||
|
This is a regression introduced in Gluon v2016.1.6.
|
||||||
|
|
||||||
Other changes
|
Other changes
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
@ -141,8 +152,6 @@ Inside of URLs, ``urlescape`` must be used instead of ``escape``.
|
|||||||
Internals
|
Internals
|
||||||
~~~~~~~~~
|
~~~~~~~~~
|
||||||
|
|
||||||
* mac80211, hostapd and other related drivers and services have been backported from LEDE ``42f559e``
|
|
||||||
|
|
||||||
* Mesh interfaces are now configured in a protocol-independent way in UCI (`#870 <https://github.com/freifunk-gluon/gluon/pull/870>`_)
|
* Mesh interfaces are now configured in a protocol-independent way in UCI (`#870 <https://github.com/freifunk-gluon/gluon/pull/870>`_)
|
||||||
|
|
||||||
The MAC address assignment of all mesh and WLAN interfaces has been modified to prepare for support of
|
The MAC address assignment of all mesh and WLAN interfaces has been modified to prepare for support of
|
||||||
|
@ -12,18 +12,18 @@ msgstr ""
|
|||||||
|
|
||||||
msgid "gluon-config-mode:welcome"
|
msgid "gluon-config-mode:welcome"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Willkommen zum Einrichtungsassistenten für deinen neuen Entenhausener "
|
"Willkommen zum Einrichtungsassistenten für deinen neuen Alpha Centauri "
|
||||||
"Freifunk-Knoten. Fülle das folgende Formular deinen Vorstellungen "
|
"Freifunk-Knoten. Fülle das folgende Formular deinen Vorstellungen "
|
||||||
"entsprechend aus und sende es ab."
|
"entsprechend aus und sende es ab."
|
||||||
|
|
||||||
msgid "gluon-config-mode:pubkey"
|
msgid "gluon-config-mode:pubkey"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"<p>Dies ist der öffentliche Schlüssel deines Freifunk-Knotens. Erst nachdem "
|
"<p>Dies ist der öffentliche Schlüssel deines Freifunk-Knotens. Erst nachdem "
|
||||||
"er auf den Servern des Entenhausener Freifunk-Projektes eingetragen wurde, "
|
"er auf den Servern des Freifunk-Projektes auf Alpha Centauri eingetragen wurde, "
|
||||||
"kann sich dein Knoten mit dem Entenhausener Mesh-VPN verbinden. Bitte "
|
"kann sich dein Knoten mit dem Mesh-VPN dort verbinden. Bitte "
|
||||||
"schicke dazu diesen Schlüssel und den Namen deines Knotens "
|
"schicke dazu diesen Schlüssel und den Namen deines Knotens "
|
||||||
"(<em><%=escape(hostname)%></em>) an "
|
"(<em><%=escape(hostname)%></em>) an "
|
||||||
"<a href=\"mailto:keys@entenhausen.freifunk.net\">keys@entenhausen.freifunk.net</a>."
|
"<a href=\"mailto:keys@alpha-centauri.freifunk.net\">keys@alpha-centauri.freifunk.net</a>."
|
||||||
"</p>"
|
"</p>"
|
||||||
"<div class=\"the-key\">"
|
"<div class=\"the-key\">"
|
||||||
" # <%= escape(hostname) %>"
|
" # <%= escape(hostname) %>"
|
||||||
@ -33,12 +33,20 @@ msgstr ""
|
|||||||
|
|
||||||
msgid "gluon-config-mode:reboot"
|
msgid "gluon-config-mode:reboot"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"<p>Dein Knoten startet gerade neu und wird anschließend versuchen, "
|
"<p>Dein Knoten <em><%= escape(hostname) %></em> startet gerade neu und wird "
|
||||||
"sich mit anderen Freifunkknoten in seiner Nähe zu "
|
"anschließend versuchen, sich mit anderen Freifunkknoten in seiner Nähe zu "
|
||||||
"verbinden. Weitere Informationen zur "
|
"verbinden. Weitere Informationen zur "
|
||||||
"Entenhausener Freifunk-Community findest du auf "
|
"Alpha Centauri Freifunk-Community findest du auf "
|
||||||
"<a href=\"https://entenhausen.freifunk.net/\">unserer Webseite</a>.</p>"
|
"<a href=\"https://alpha-centauri.freifunk.net/\">unserer Webseite</a>.</p>"
|
||||||
"<p>Um zu dieser Konfigurationsseite zurückzugelangen, drücke im normalen "
|
"<p>Um zu dieser Konfigurationsseite zurückzugelangen, drücke im normalen "
|
||||||
"Betrieb für drei Sekunden den Reset-Button. Das Gerät wird dann im Config "
|
"Betrieb für drei Sekunden den Reset-Button. Das Gerät wird dann im Config "
|
||||||
"Mode neustarten.</p>"
|
"Mode neustarten.</p>"
|
||||||
"<p>Viel Spaß mit deinem Knoten und der Erkundung von Freifunk!</p>"
|
"<p>Viel Spaß mit deinem Knoten und der Erkundung von Freifunk!</p>"
|
||||||
|
|
||||||
|
msgid "gluon-config-mode:altitude-label"
|
||||||
|
msgstr "Höhe"
|
||||||
|
|
||||||
|
msgid "gluon-config-mode:altitude-help"
|
||||||
|
msgstr ""
|
||||||
|
"Die Höhenangabe ist optional und sollte nur gesetzt werden, wenn ein "
|
||||||
|
"exakter Wert bekannt ist."
|
||||||
|
@ -12,16 +12,15 @@ msgstr ""
|
|||||||
|
|
||||||
msgid "gluon-config-mode:welcome"
|
msgid "gluon-config-mode:welcome"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Welcome to the setup wizard of your new Freifunk Duckburg node. "
|
"Welcome to the setup wizard of your new Freifunk Alpha Centauri node. "
|
||||||
"Please fill out the following form and submit it."
|
"Please fill out the following form and submit it."
|
||||||
|
|
||||||
msgid "gluon-config-mode:pubkey"
|
msgid "gluon-config-mode:pubkey"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"<p>This is your Freifunk node's public key. The node won't be able to "
|
"<p>This is your Freifunk node's public key. The node won't be able to "
|
||||||
"connect to the mesh VPN until the key has been registered on the Freifunk "
|
"connect to the mesh VPN until the key has been registered on the Freifunk servers. "
|
||||||
"Duckburg servers. "
|
|
||||||
"To register, send the key together with your node's name (<em><%=escape(hostname)%></em>) to "
|
"To register, send the key together with your node's name (<em><%=escape(hostname)%></em>) to "
|
||||||
"<a href=\"mailto:keys@entenhausen.freifunk.net\">keys@entenhausen.freifunk.net</a>."
|
"<a href=\"mailto:keys@alpha-centauri.freifunk.net\">keys@alpha-centauri.freifunk.net</a>."
|
||||||
"</p>"
|
"</p>"
|
||||||
"<div class=\"the-key\">"
|
"<div class=\"the-key\">"
|
||||||
" # <%= escape(hostname) %>"
|
" # <%= escape(hostname) %>"
|
||||||
@ -29,14 +28,21 @@ msgstr ""
|
|||||||
"<%= pubkey %>"
|
"<%= pubkey %>"
|
||||||
"</div>"
|
"</div>"
|
||||||
|
|
||||||
|
|
||||||
msgid "gluon-config-mode:reboot"
|
msgid "gluon-config-mode:reboot"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"<p>The node is currently rebooting and will try to connect to other "
|
"<p>Your node <em><%= escape(hostname) %></em> is currently rebooting and will "
|
||||||
"nearby Freifunk nodes after that. "
|
"try to connect to other nearby Freifunk nodes after that. For more "
|
||||||
"For more information on the Freifunk Duckburg community, have a look at "
|
"information about the Freifunk community on Alpha Centauri, have a look at "
|
||||||
"<a href=\"https://entenhausen.freifunk.net/\">our homepage</a>.</p>"
|
"<a href=\"https://alpha-centauri.freifunk.net/\">our homepage</a>.</p>"
|
||||||
"<p>To get back to this configuration interface, press the reset button for "
|
"<p>To get back to this configuration interface, press the reset button for "
|
||||||
"3 seconds during normal operation. The device will then reboot into config "
|
"3 seconds during normal operation. The device will then reboot into config "
|
||||||
"mode.</p>"
|
"mode.</p>"
|
||||||
"<p>Have fun with your node and exploring of the Freifunk network!</p>"
|
"<p>Have fun with your node and exploring of the Freifunk network!</p>"
|
||||||
|
|
||||||
|
msgid "gluon-config-mode:altitude-label"
|
||||||
|
msgstr "Altitude"
|
||||||
|
|
||||||
|
msgid "gluon-config-mode:altitude-help"
|
||||||
|
msgstr ""
|
||||||
|
"Specifying the altitude is optional and should only be done if a proper "
|
||||||
|
"value is known."
|
||||||
|
@ -23,7 +23,7 @@ msgstr ""
|
|||||||
"sur les serveur Mesh-VPN de votre groupe Freifunk. Veuillez envoyer la clé avec le "
|
"sur les serveur Mesh-VPN de votre groupe Freifunk. Veuillez envoyer la clé avec le "
|
||||||
"nom de votre nœud "
|
"nom de votre nœud "
|
||||||
"(<em><%=escape(hostname)%></em>) à "
|
"(<em><%=escape(hostname)%></em>) à "
|
||||||
"<a href=\"mailto:keys@entenhausen.freifunk.net\">keys@entenhausen.freifunk.net</a>."
|
"<a href=\"mailto:keys@alpha-centauri.freifunk.net\">keys@alpha-centauri.freifunk.net</a>."
|
||||||
"</p>"
|
"</p>"
|
||||||
"<div class=\"the-key\">"
|
"<div class=\"the-key\">"
|
||||||
" # <%= escape(hostname) %>"
|
" # <%= escape(hostname) %>"
|
||||||
@ -33,11 +33,19 @@ msgstr ""
|
|||||||
|
|
||||||
msgid "gluon-config-mode:reboot"
|
msgid "gluon-config-mode:reboot"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"<p>Votre nœud es en train de redémarrer et va ensuite éssayer de se connecter "
|
"<p>Votre nœud <em><%= escape(hostname) %></em> es en train de redémarrer et "
|
||||||
"avec les autres nœuds du réseau Freifunk "
|
"va ensuite éssayer de se connecter avec les autres nœuds du réseau Freifunk "
|
||||||
"Vous pourrez trouver plus d'informations sur votre groupe Freifunk sur la page "
|
"Vous pourrez trouver plus d'informations sur votre groupe Freifunk sur la page "
|
||||||
"<a href=\"https://entenhausen.freifunk.net/\"> de ton groupe </a>.</p> "
|
"<a href=\"https://alpha-centauri.freifunk.net/\"> de ton groupe </a>.</p> "
|
||||||
"<p> Pour retrouver cette page de configuration veuillier appuyez pendant le "
|
"<p> Pour retrouver cette page de configuration veuillier appuyez pendant le "
|
||||||
"fonctionement normal pendant 3 Secondes sur le bouton reset. L'appareil va ensuite "
|
"fonctionement normal pendant 3 Secondes sur le bouton reset. L'appareil va ensuite "
|
||||||
"redémarer en mode configuration.</p> "
|
"redémarer en mode configuration.</p> "
|
||||||
"<p>Profitez votre de nœud et amusez vous à découvrir le réseau Freifunk!</p>"
|
"<p>Profitez votre de nœud et amusez vous à découvrir le réseau Freifunk!</p>"
|
||||||
|
|
||||||
|
msgid "gluon-config-mode:altitude-label"
|
||||||
|
msgstr "Hauteur"
|
||||||
|
|
||||||
|
msgid "gluon-config-mode:altitude-help"
|
||||||
|
msgstr ""
|
||||||
|
"La altitude est optionelle et ne devrait que être ajoutée si la valeur "
|
||||||
|
"exacte est connue."
|
||||||
|
@ -9,3 +9,9 @@ msgstr ""
|
|||||||
|
|
||||||
msgid "gluon-config-mode:reboot"
|
msgid "gluon-config-mode:reboot"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "gluon-config-mode:altitude-label"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "gluon-config-mode:altitude-help"
|
||||||
|
msgstr ""
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
-- This is an example site configuration for Gluon v2016.1+
|
-- This is an example site configuration for Gluon v2016.2+
|
||||||
--
|
--
|
||||||
-- Take a look at the documentation located at
|
-- Take a look at the documentation located at
|
||||||
-- http://gluon.readthedocs.org/ for details.
|
-- http://gluon.readthedocs.org/ for details.
|
||||||
@ -10,7 +10,7 @@
|
|||||||
-- hostname_prefix = 'freifunk-',
|
-- hostname_prefix = 'freifunk-',
|
||||||
|
|
||||||
-- Name of the community.
|
-- Name of the community.
|
||||||
site_name = 'Freifunk Entenhausen',
|
site_name = 'Freifunk Alpha Centauri',
|
||||||
|
|
||||||
-- Shorthand of the community.
|
-- Shorthand of the community.
|
||||||
site_code = 'ffxx',
|
site_code = 'ffxx',
|
||||||
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
-- ESSID used for client network.
|
-- ESSID used for client network.
|
||||||
ap = {
|
ap = {
|
||||||
ssid = 'entenhausen.freifunk.net',
|
ssid = 'alpha-centauri.freifunk.net',
|
||||||
-- disabled = true, (optional)
|
-- disabled = true, (optional)
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -65,7 +65,7 @@
|
|||||||
wifi5 = {
|
wifi5 = {
|
||||||
channel = 44,
|
channel = 44,
|
||||||
ap = {
|
ap = {
|
||||||
ssid = 'entenhausen.freifunk.net',
|
ssid = 'alpha-centauri.freifunk.net',
|
||||||
},
|
},
|
||||||
mesh = {
|
mesh = {
|
||||||
id = 'ffxx-mesh',
|
id = 'ffxx-mesh',
|
||||||
@ -102,6 +102,7 @@
|
|||||||
methods = {'salsa2012+umac'},
|
methods = {'salsa2012+umac'},
|
||||||
-- enabled = true,
|
-- enabled = true,
|
||||||
-- configurable = true,
|
-- configurable = true,
|
||||||
|
-- syslog_level = 'warn',
|
||||||
|
|
||||||
mtu = 1280,
|
mtu = 1280,
|
||||||
groups = {
|
groups = {
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
## gluon site.mk makefile example
|
## gluon site.mk makefile example
|
||||||
|
|
||||||
## GLUON_SITE_PACKAGES
|
## GLUON_SITE_PACKAGES
|
||||||
# specify gluon/openwrt packages to include here
|
# specify Gluon/LEDE packages to include here
|
||||||
# The gluon-mesh-batman-adv-* package must come first because of the dependency resolution
|
|
||||||
|
|
||||||
GLUON_SITE_PACKAGES := \
|
GLUON_SITE_PACKAGES := \
|
||||||
gluon-mesh-batman-adv-15 \
|
|
||||||
gluon-alfred \
|
gluon-alfred \
|
||||||
gluon-respondd \
|
gluon-respondd \
|
||||||
gluon-autoupdater \
|
gluon-autoupdater \
|
||||||
@ -21,7 +19,7 @@ GLUON_SITE_PACKAGES := \
|
|||||||
gluon-luci-autoupdater \
|
gluon-luci-autoupdater \
|
||||||
gluon-luci-portconfig \
|
gluon-luci-portconfig \
|
||||||
gluon-luci-wifi-config \
|
gluon-luci-wifi-config \
|
||||||
gluon-next-node \
|
gluon-mesh-batman-adv-15 \
|
||||||
gluon-mesh-vpn-fastd \
|
gluon-mesh-vpn-fastd \
|
||||||
gluon-radvd \
|
gluon-radvd \
|
||||||
gluon-setup-mode \
|
gluon-setup-mode \
|
||||||
|
@ -8,7 +8,7 @@ Gluon's releases are managed using `Git tags`_. If you are just getting
|
|||||||
started with Gluon we recommend to use the latest stable release of Gluon.
|
started with Gluon we recommend to use the latest stable release of Gluon.
|
||||||
|
|
||||||
Take a look at the `list of gluon releases`_ and notice the latest release,
|
Take a look at the `list of gluon releases`_ and notice the latest release,
|
||||||
e.g. *v2016.1.6*. Always get Gluon using git and don't try to download it
|
e.g. *v2016.2.2*. Always get Gluon using git and don't try to download it
|
||||||
as a Zip archive as the archive will be missing version information.
|
as a Zip archive as the archive will be missing version information.
|
||||||
|
|
||||||
Please keep in mind that there is no "default Gluon" build; a site configuration
|
Please keep in mind that there is no "default Gluon" build; a site configuration
|
||||||
@ -36,13 +36,14 @@ freshly installed Debian Wheezy system the following packages are required:
|
|||||||
* `libncurses-dev` (actually `libncurses5-dev`)
|
* `libncurses-dev` (actually `libncurses5-dev`)
|
||||||
* `libz-dev` (actually `zlib1g-dev`)
|
* `libz-dev` (actually `zlib1g-dev`)
|
||||||
* `libssl-dev`
|
* `libssl-dev`
|
||||||
|
* `wget`
|
||||||
|
|
||||||
|
|
||||||
Building the images
|
Building the images
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
To build Gluon, first check out the repository. Replace *RELEASE* with the
|
To build Gluon, first check out the repository. Replace *RELEASE* with the
|
||||||
version you'd like to checkout, e.g. *v2016.1.6*.
|
version you'd like to checkout, e.g. *v2016.2.2*.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
@ -58,7 +59,7 @@ Now, enter the freshly created directory::
|
|||||||
It's time to add (or create) your site configuration. If you already
|
It's time to add (or create) your site configuration. If you already
|
||||||
have a site repository, just clone it::
|
have a site repository, just clone it::
|
||||||
|
|
||||||
git clone https://github.com/freifunk-duckburg/site-ffdb.git site
|
git clone https://github.com/freifunk-alpha-centauri/site-ffac.git site
|
||||||
|
|
||||||
If you want to build a new site, create a new git repository *site/*::
|
If you want to build a new site, create a new git repository *site/*::
|
||||||
|
|
||||||
@ -84,7 +85,6 @@ Next go back to the top-level Gluon directory and build Gluon::
|
|||||||
make update # Get other repositories used by Gluon
|
make update # Get other repositories used by Gluon
|
||||||
make GLUON_TARGET=ar71xx-generic # Build Gluon
|
make GLUON_TARGET=ar71xx-generic # Build Gluon
|
||||||
|
|
||||||
When calling make, the OpenWrt build environment is prepared/updated.
|
|
||||||
In case of errors read the messages carefully and try to fix the stated issues (e.g. install tools not available yet).
|
In case of errors read the messages carefully and try to fix the stated issues (e.g. install tools not available yet).
|
||||||
|
|
||||||
``ar71xx-generic`` is the most common target and will generate images for most of the supported hardware.
|
``ar71xx-generic`` is the most common target and will generate images for most of the supported hardware.
|
||||||
@ -94,7 +94,7 @@ You should reserve about 10GB of disk space for each `GLUON_TARGET`.
|
|||||||
|
|
||||||
The built images can be found in the directory `output/images`. Of these, the `factory`
|
The built images can be found in the directory `output/images`. Of these, the `factory`
|
||||||
images are to be used when flashing from the original firmware a device came with,
|
images are to be used when flashing from the original firmware a device came with,
|
||||||
and `sysupgrade` is to upgrade from other versions of Gluon or any other OpenWrt-based
|
and `sysupgrade` is to upgrade from other versions of Gluon or any other OpenWrt/LEDE-based
|
||||||
system.
|
system.
|
||||||
|
|
||||||
**Note:** The images for some models are identical; to save disk space, symlinks are generated instead
|
**Note:** The images for some models are identical; to save disk space, symlinks are generated instead
|
||||||
@ -110,39 +110,25 @@ There are two levels of `make clean`::
|
|||||||
|
|
||||||
make clean GLUON_TARGET=ar71xx-generic
|
make clean GLUON_TARGET=ar71xx-generic
|
||||||
|
|
||||||
will ensure all packages are rebuilt for a single target; this is what you normally want to do after an update.
|
will ensure all packages are rebuilt for a single target. This normally not
|
||||||
|
necessary, but may fix certain kinds of build failures.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
make dirclean
|
make dirclean
|
||||||
|
|
||||||
will clean the entire tree, so the toolchain will be rebuilt as well, which is
|
will clean the entire tree, so the toolchain will be rebuilt as well, which will take a while.
|
||||||
not necessary in most cases, and will take a while.
|
|
||||||
|
|
||||||
So in summary, to update and rebuild a Gluon build tree, the following commands should be used (repeat the
|
|
||||||
``make clean`` and ``make`` for all targets you want to build):
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
git pull
|
|
||||||
(cd site && git pull)
|
|
||||||
make update
|
|
||||||
make clean GLUON_TARGET=ar71xx-generic
|
|
||||||
make GLUON_TARGET=ar71xx-generic
|
|
||||||
|
|
||||||
|
|
||||||
opkg repositories
|
opkg repositories
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
Gluon is mostly compatible with OpenWrt, so the normal OpenWrt package repositories
|
Gluon is mostly compatible with LEDE, so the normal LEDE package repositories
|
||||||
can be used for Gluon as well. It is advisable to setup a mirror or reverse proxy
|
can be used for Gluon as well.
|
||||||
reachable over IPv6 and add it to ``site.conf`` as http://downloads.openwrt.org/ does
|
|
||||||
not support IPv6.
|
|
||||||
|
|
||||||
This is not true for kernel modules; the Gluon kernel is incompatible with the
|
This is not true for kernel modules; the Gluon kernel is incompatible with the
|
||||||
kernel of the default OpenWrt images. Therefore, Gluon will not only generate images,
|
kernel of the default LEDE images. Therefore, Gluon will not only generate images,
|
||||||
but also an opkg repository containing all kernel modules provided by OpenWrt/Gluon
|
but also an opkg repository containing all core packages provided by LEDE,
|
||||||
for the kernel of the generated images.
|
including modules for the kernel of the generated images.
|
||||||
|
|
||||||
Signing keys
|
Signing keys
|
||||||
............
|
............
|
||||||
@ -150,18 +136,14 @@ Signing keys
|
|||||||
Gluon does not support HTTPS for downloading packages; fortunately, opkg deploys
|
Gluon does not support HTTPS for downloading packages; fortunately, opkg deploys
|
||||||
public-key cryptography to ensure package integrity.
|
public-key cryptography to ensure package integrity.
|
||||||
|
|
||||||
The Gluon images will contain two public keys: the official OpenWrt signing key
|
The Gluon images will contain public keys from two sources: the official LEDE keyring
|
||||||
(to allow installing userspace packages) and a Gluon-specific key (which is used
|
(to allow installing userspace packages) and a Gluon-specific key (which is used
|
||||||
to sign the generated module repository).
|
to sign the generated package repository).
|
||||||
|
|
||||||
By default, Gluon will handle the generation and handling of the keys itself.
|
LEDE will handle the generation and handling of the keys itself.
|
||||||
When making firmware releases based on Gluon, it might make sense to store
|
When making firmware releases based on Gluon, it might make sense to store
|
||||||
the keypair, so updating the module repository later is possible.
|
the keypair, so updating the module repository later is possible.
|
||||||
|
|
||||||
The location the keys are stored at and read from can be changed
|
|
||||||
(see :ref:`getting-started-make-variables`). To only generate the keypair
|
|
||||||
at the configured location without doing a full build, use ``make create-key``.
|
|
||||||
|
|
||||||
.. _getting-started-make-variables:
|
.. _getting-started-make-variables:
|
||||||
|
|
||||||
Make variables
|
Make variables
|
||||||
@ -216,13 +198,8 @@ GLUON_BUILDDIR
|
|||||||
GLUON_IMAGEDIR
|
GLUON_IMAGEDIR
|
||||||
Path where images will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/images``.
|
Path where images will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/images``.
|
||||||
|
|
||||||
GLUON_MODULEDIR
|
GLUON_PACKAGEDIR
|
||||||
Path where the kernel module opkg repository will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/modules``.
|
Path where the opkg package repository will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/packages``.
|
||||||
|
|
||||||
GLUON_OPKG_KEY
|
|
||||||
Path key file used to sign the module opkg repository. Defaults to ``$(GLUON_BULDDIR)/gluon-opkg-key``.
|
|
||||||
|
|
||||||
The private key will be stored as ``$(GLUON_OPKG_KEY)``, the public key as ``$(GLUON_OPKG_KEY).pub``.
|
|
||||||
|
|
||||||
GLUON_OUTPUTDIR
|
GLUON_OUTPUTDIR
|
||||||
Path where output files will be stored. Defaults to ``output``.
|
Path where output files will be stored. Defaults to ``output``.
|
||||||
|
@ -46,7 +46,7 @@ ntp_server
|
|||||||
List of NTP servers available in your community or used by your community, e.g.:
|
List of NTP servers available in your community or used by your community, e.g.:
|
||||||
::
|
::
|
||||||
|
|
||||||
ntp_servers = {'1.ntp.services.ffeh','2.ntp.services.ffeh'}
|
ntp_servers = {'1.ntp.services.ffac','2.ntp.services.ffac'}
|
||||||
|
|
||||||
This NTP servers must be reachable via IPv6 from the nodes. If you don't want to set an IPv6 address
|
This NTP servers must be reachable via IPv6 from the nodes. If you don't want to set an IPv6 address
|
||||||
explicitly, but use a hostname (which is recommended), see also the :ref:`FAQ <faq-dns>`.
|
explicitly, but use a hostname (which is recommended), see also the :ref:`FAQ <faq-dns>`.
|
||||||
@ -56,23 +56,27 @@ opkg \: optional
|
|||||||
|
|
||||||
There are two optional fields in the ``opkg`` section:
|
There are two optional fields in the ``opkg`` section:
|
||||||
|
|
||||||
- ``openwrt`` overrides the default OpenWrt repository URL
|
- ``lede`` overrides the default LEDE repository URL. The default URL would
|
||||||
|
correspond to ``http://downloads.lede-project.org/snapshots/packages/%A``
|
||||||
|
and usually doesn't need to be changed when nodes are expected to have IPv6
|
||||||
|
internet connectivity.
|
||||||
- ``extra`` specifies a table of additional repositories (with arbitrary keys)
|
- ``extra`` specifies a table of additional repositories (with arbitrary keys)
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
opkg = {
|
opkg = {
|
||||||
openwrt = 'http://opkg.services.ffeh/openwrt/%n/%v/%S/packages',
|
lede = 'http://opkg.services.ffac/lede/snapshots/packages/%A',
|
||||||
extra = {
|
extra = {
|
||||||
modules = 'http://opkg.services.ffeh/modules/gluon-%GS-%GR/%S',
|
gluon = 'http://opkg.services.ffac/modules/gluon-%GS-%GR/%S',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
There are various patterns which can be used in the URLs:
|
There are various patterns which can be used in the URLs:
|
||||||
|
|
||||||
- ``%n`` is replaced by the OpenWrt version codename (e.g. "chaos_calmer")
|
- ``%n`` is replaced by the LEDE version codename
|
||||||
- ``%v`` is replaced by the OpenWrt version number (e.g. "15.05")
|
- ``%v`` is replaced by the LEDE version number (e.g. "17.01")
|
||||||
- ``%S`` is replaced by the target architecture (e.g. "ar71xx/generic")
|
- ``%S`` is replaced by the target board (e.g. "ar71xx/generic")
|
||||||
|
- ``%A`` is replaced by the target architecture (e.g. "mips_24kc")
|
||||||
- ``%GS`` is replaced by the Gluon site code (as specified in ``site.conf``)
|
- ``%GS`` is replaced by the Gluon site code (as specified in ``site.conf``)
|
||||||
- ``%GV`` is replaced by the Gluon version
|
- ``%GV`` is replaced by the Gluon version
|
||||||
- ``%GR`` is replaced by the Gluon release (as specified in ``site.mk``)
|
- ``%GR`` is replaced by the Gluon release (as specified in ``site.mk``)
|
||||||
@ -83,7 +87,7 @@ regdom \: optional
|
|||||||
|
|
||||||
regdom = 'DE'
|
regdom = 'DE'
|
||||||
|
|
||||||
Setting ``regdom`` in mandatory if ``wifi24`` or ``wifi5`` is defined.
|
Setting ``regdom`` is mandatory if ``wifi24`` or ``wifi5`` is defined.
|
||||||
|
|
||||||
wifi24 \: optional
|
wifi24 \: optional
|
||||||
WLAN configuration for 2.4 GHz devices.
|
WLAN configuration for 2.4 GHz devices.
|
||||||
@ -98,7 +102,7 @@ wifi24 \: optional
|
|||||||
|
|
||||||
Each interface may be disabled by setting ``disabled`` to ``true``.
|
Each interface may be disabled by setting ``disabled`` to ``true``.
|
||||||
This will only affect new installations.
|
This will only affect new installations.
|
||||||
Upgrades will not changed the disabled state.
|
Upgrades will not change the disabled state.
|
||||||
|
|
||||||
Additionally it is possible to configure the ``supported_rates`` and ``basic_rate``
|
Additionally it is possible to configure the ``supported_rates`` and ``basic_rate``
|
||||||
of each radio. Both are optional, by default hostapd/driver dictate the rates.
|
of each radio. Both are optional, by default hostapd/driver dictate the rates.
|
||||||
@ -115,7 +119,8 @@ wifi24 \: optional
|
|||||||
An optional parameter ``vlan`` (integer) is supported.
|
An optional parameter ``vlan`` (integer) is supported.
|
||||||
|
|
||||||
Both ``mesh`` and ``ibss`` accept an optional ``mcast_rate`` (kbit/s) parameter for
|
Both ``mesh`` and ``ibss`` accept an optional ``mcast_rate`` (kbit/s) parameter for
|
||||||
setting the default multicast datarate.
|
setting the multicast bitrate. Increasing the default value of 1000 to something
|
||||||
|
like 12000 is recommended.
|
||||||
::
|
::
|
||||||
|
|
||||||
wifi24 = {
|
wifi24 = {
|
||||||
@ -123,10 +128,10 @@ wifi24 \: optional
|
|||||||
supported_rates = {6000, 9000, 12000, 18000, 24000, 36000, 48000, 54000},
|
supported_rates = {6000, 9000, 12000, 18000, 24000, 36000, 48000, 54000},
|
||||||
basic_rate = {6000, 9000, 18000, 36000, 54000},
|
basic_rate = {6000, 9000, 18000, 36000, 54000},
|
||||||
ap = {
|
ap = {
|
||||||
ssid = 'entenhausen.freifunk.net',
|
ssid = 'alpha-centauri.freifunk.net',
|
||||||
},
|
},
|
||||||
mesh = {
|
mesh = {
|
||||||
id = 'entenhausen-mesh',
|
id = 'alpha-centauri-mesh',
|
||||||
mcast_rate = 12000,
|
mcast_rate = 12000,
|
||||||
},
|
},
|
||||||
ibss = {
|
ibss = {
|
||||||
@ -182,12 +187,15 @@ fastd_mesh_vpn
|
|||||||
In any case, the ``null`` method should always be the first method in the list
|
In any case, the ``null`` method should always be the first method in the list
|
||||||
if it is supported at all. You should only set `configurable` to `true` if the
|
if it is supported at all. You should only set `configurable` to `true` if the
|
||||||
configured peers support both the ``null`` method and methods with encryption.
|
configured peers support both the ``null`` method and methods with encryption.
|
||||||
|
|
||||||
|
You can set syslog_level from verbose (default) to warn to reduce syslog output.
|
||||||
::
|
::
|
||||||
|
|
||||||
fastd_mesh_vpn = {
|
fastd_mesh_vpn = {
|
||||||
methods = {'salsa2012+umac'},
|
methods = {'salsa2012+umac'},
|
||||||
-- enabled = true,
|
-- enabled = true,
|
||||||
-- configurable = true,
|
-- configurable = true,
|
||||||
|
-- syslog_level = 'warn',
|
||||||
mtu = 1280,
|
mtu = 1280,
|
||||||
groups = {
|
groups = {
|
||||||
backbone = {
|
backbone = {
|
||||||
@ -198,14 +206,14 @@ fastd_mesh_vpn
|
|||||||
key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
||||||
-- Having multiple domains prevents SPOF in freifunk.net
|
-- Having multiple domains prevents SPOF in freifunk.net
|
||||||
remotes = {
|
remotes = {
|
||||||
'ipv4 "vpn1.entenhausen.freifunk.net" port 10000',
|
'ipv4 "vpn1.alpha-centauri.freifunk.net" port 10000',
|
||||||
'ipv4 "vpn1.entenhausener-freifunk.de" port 10000',
|
'ipv4 "vpn1.alpha-centauri-freifunk.de" port 10000',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
peer2 = {
|
peer2 = {
|
||||||
key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
|
||||||
-- You can also omit the ipv4 to allow both connection via ipv4 and ipv6
|
-- You can also omit the ipv4 to allow both connection via ipv4 and ipv6
|
||||||
remotes = {'"vpn2.entenhausen.freifunk.net" port 10000'},
|
remotes = {'"vpn2.alpha-centauri.freifunk.net" port 10000'},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- Optional: nested peer groups
|
-- Optional: nested peer groups
|
||||||
@ -258,7 +266,7 @@ autoupdater \: package
|
|||||||
name = 'stable',
|
name = 'stable',
|
||||||
mirrors = {
|
mirrors = {
|
||||||
'http://[fdca:ffee:babe:1::fec1]/firmware/stable/sysupgrade/',
|
'http://[fdca:ffee:babe:1::fec1]/firmware/stable/sysupgrade/',
|
||||||
'http://autoupdate.entenhausen.freifunk.net/firmware/stable/sysupgrade/',
|
'http://autoupdate.alpha-centauri.freifunk.net/firmware/stable/sysupgrade/',
|
||||||
},
|
},
|
||||||
-- Number of good signatures required
|
-- Number of good signatures required
|
||||||
good_signatures = 2,
|
good_signatures = 2,
|
||||||
@ -282,7 +290,7 @@ roles \: optional
|
|||||||
part of ``list``. If you want node owners to change the role via config mode add
|
part of ``list``. If you want node owners to change the role via config mode add
|
||||||
the package ``gluon-luci-node-role`` to ``site.mk``.
|
the package ``gluon-luci-node-role`` to ``site.mk``.
|
||||||
|
|
||||||
The strings to display in the LuCI interface can be configured per language in the
|
The strings to display in the LuCI interface are configured per language in the
|
||||||
``i18n/en.po``, ``i18n/de.po``, etc. files of the site repository using message IDs like
|
``i18n/en.po``, ``i18n/de.po``, etc. files of the site repository using message IDs like
|
||||||
``gluon-luci-node-role:role:node`` and ``gluon-luci-node-role:role:backbone``.
|
``gluon-luci-node-role:role:node`` and ``gluon-luci-node-role:role:backbone``.
|
||||||
::
|
::
|
||||||
@ -313,9 +321,9 @@ legacy \: package
|
|||||||
|
|
||||||
legacy = {
|
legacy = {
|
||||||
version_files = {'/etc/.freifunk_version_keep', '/etc/.eff_version_keep'},
|
version_files = {'/etc/.freifunk_version_keep', '/etc/.eff_version_keep'},
|
||||||
old_files = {'/etc/config/config_mode', '/etc/config/ffeh', '/etc/config/freifunk'},
|
old_files = {'/etc/config/config_mode', '/etc/config/ffac', '/etc/config/freifunk'},
|
||||||
config_mode_configs = {'config_mode', 'ffeh', 'freifunk'},
|
config_mode_configs = {'config_mode', 'ffac', 'freifunk'},
|
||||||
fastd_configs = {'ffeh_mesh_vpn', 'mesh_vpn'},
|
fastd_configs = {'ffac_mesh_vpn', 'mesh_vpn'},
|
||||||
mesh_ifname = 'freifunk',
|
mesh_ifname = 'freifunk',
|
||||||
tc_configs = {'ffki', 'freifunk'},
|
tc_configs = {'ffki', 'freifunk'},
|
||||||
wifi_names = {'wifi_freifunk', 'wifi_freifunk5', 'wifi_mesh', 'wifi_mesh5'},
|
wifi_names = {'wifi_freifunk', 'wifi_freifunk5', 'wifi_mesh', 'wifi_mesh5'},
|
||||||
@ -360,6 +368,12 @@ gluon-config-mode:welcome
|
|||||||
gluon-config-mode:pubkey
|
gluon-config-mode:pubkey
|
||||||
Information about the public VPN key on the reboot page.
|
Information about the public VPN key on the reboot page.
|
||||||
|
|
||||||
|
gluon-config-mode:altitude-label
|
||||||
|
Label for the ``altitude`` field
|
||||||
|
|
||||||
|
gluon-config-mode:altitude-help
|
||||||
|
Description for the usage of the ``altitude`` field
|
||||||
|
|
||||||
gluon-config-mode:reboot
|
gluon-config-mode:reboot
|
||||||
General information shown on the reboot page.
|
General information shown on the reboot page.
|
||||||
|
|
||||||
@ -469,7 +483,7 @@ This is a non-exhaustive list of site-repos from various communities:
|
|||||||
* `site-ffhl <https://github.com/freifunk-luebeck/site-ffhl>`_ (Lübeck)
|
* `site-ffhl <https://github.com/freifunk-luebeck/site-ffhl>`_ (Lübeck)
|
||||||
* `site-fflg <https://github.com/kartenkarsten/site-fflg>`_ (Lüneburg)
|
* `site-fflg <https://github.com/kartenkarsten/site-fflg>`_ (Lüneburg)
|
||||||
* `site-ffmd <https://github.com/FreifunkMD/site-ffmd>`_ (Magdeburg)
|
* `site-ffmd <https://github.com/FreifunkMD/site-ffmd>`_ (Magdeburg)
|
||||||
* `site-ffmwu <https://github.com/freifunk-mwu/site-ffmwu>`_ (Mainz, Wiesbaden & Umgebung)
|
* `site-ffmwu <https://github.com/freifunk-mwu/sites-ffmwu>`_ (Mainz, Wiesbaden & Umgebung)
|
||||||
* `site-ffmyk <https://github.com/FreifunkMYK/site-ffmyk>`_ (Mayen-Koblenz)
|
* `site-ffmyk <https://github.com/FreifunkMYK/site-ffmyk>`_ (Mayen-Koblenz)
|
||||||
* `site-ffmo <https://github.com/ffruhr/site-ffmo>`_ (Moers)
|
* `site-ffmo <https://github.com/ffruhr/site-ffmo>`_ (Moers)
|
||||||
* `site-ffmg <https://github.com/ffruhr/site-ffmg>`_ (Mönchengladbach)
|
* `site-ffmg <https://github.com/ffruhr/site-ffmg>`_ (Mönchengladbach)
|
||||||
@ -480,6 +494,7 @@ This is a non-exhaustive list of site-repos from various communities:
|
|||||||
* `site-ffniers <https://github.com/ffruhr/site-ffniers>`_ (Niersufer)
|
* `site-ffniers <https://github.com/ffruhr/site-ffniers>`_ (Niersufer)
|
||||||
* `site-ffnw <https://git.nordwest.freifunk.net/ffnw-firmware/siteconf/tree/master>`_ (Nordwest)
|
* `site-ffnw <https://git.nordwest.freifunk.net/ffnw-firmware/siteconf/tree/master>`_ (Nordwest)
|
||||||
* `site-ffrgb <https://github.com/ffrgb/site-ffrgb>`_ (Regensburg)
|
* `site-ffrgb <https://github.com/ffrgb/site-ffrgb>`_ (Regensburg)
|
||||||
|
* `site-ffrn <https://github.com/Freifunk-Rhein-Neckar/site-ffrn>`_ (Rhein-Neckar)
|
||||||
* `site-ffruhr <https://github.com/ffruhr?utf8=✓&query=site>`_ (Ruhrgebiet, Multi-Communities)
|
* `site-ffruhr <https://github.com/ffruhr?utf8=✓&query=site>`_ (Ruhrgebiet, Multi-Communities)
|
||||||
* `site-ffs <https://github.com/freifunk-stuttgart/site-ffs>`_ (Stuttgart)
|
* `site-ffs <https://github.com/freifunk-stuttgart/site-ffs>`_ (Stuttgart)
|
||||||
* `site-fftr <https://github.com/freifunktrier/site-fftr>`_ (Trier)
|
* `site-fftr <https://github.com/freifunktrier/site-fftr>`_ (Trier)
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
CONFIG_IMAGEOPT=y
|
|
||||||
# CONFIG_PER_FEED_REPO is not set
|
|
||||||
# CONFIG_TARGET_ROOTFS_INITRAMFS is not set
|
|
||||||
CONFIG_DEVEL=y
|
|
||||||
CONFIG_ALL_KMODS=y
|
|
||||||
|
|
||||||
CONFIG_BUSYBOX_CUSTOM=y
|
|
||||||
CONFIG_BUSYBOX_CONFIG_SHA512SUM=y
|
|
||||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set
|
|
||||||
CONFIG_BUSYBOX_CONFIG_IP=y
|
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_IP_ADDRESS=y
|
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_IP_LINK=y
|
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_IP_ROUTE=y
|
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_IP_TUNNEL=y
|
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_IP_RULE=y
|
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS=y
|
|
||||||
CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT=y
|
|
||||||
|
|
||||||
CONFIG_ATH_USER_REGD=y
|
|
||||||
CONFIG_PACKAGE_ATH_DEBUG=y
|
|
||||||
|
|
||||||
CONFIG_LUCI_SRCDIET=y
|
|
@ -1,82 +0,0 @@
|
|||||||
ifneq ($(__gluon_inc),1)
|
|
||||||
__gluon_inc=1
|
|
||||||
|
|
||||||
GLUON_SITEDIR ?= $(GLUONDIR)/site
|
|
||||||
GLUON_BUILDDIR ?= $(GLUONDIR)/build
|
|
||||||
|
|
||||||
GLUON_ORIGOPENWRTDIR := $(GLUONDIR)/openwrt
|
|
||||||
GLUON_SITE_CONFIG := $(GLUON_SITEDIR)/site.conf
|
|
||||||
|
|
||||||
GLUON_OUTPUTDIR ?= $(GLUONDIR)/output
|
|
||||||
GLUON_IMAGEDIR ?= $(GLUON_OUTPUTDIR)/images
|
|
||||||
GLUON_MODULEDIR ?= $(GLUON_OUTPUTDIR)/modules
|
|
||||||
|
|
||||||
GLUON_OPKG_KEY ?= $(GLUON_BUILDDIR)/gluon-opkg-key
|
|
||||||
|
|
||||||
export GLUONDIR GLUON_SITEDIR GLUON_BUILDDIR GLUON_SITE_CONFIG GLUON_OUTPUTDIR GLUON_IMAGEDIR GLUON_MODULEDIR
|
|
||||||
|
|
||||||
|
|
||||||
BOARD_BUILDDIR = $(GLUON_BUILDDIR)/$(GLUON_TARGET)
|
|
||||||
BOARD_KDIR = $(BOARD_BUILDDIR)/kernel
|
|
||||||
|
|
||||||
export BOARD_BUILDDIR
|
|
||||||
|
|
||||||
|
|
||||||
LINUX_RELEASE := 2
|
|
||||||
export LINUX_RELEASE
|
|
||||||
|
|
||||||
|
|
||||||
GLUON_OPENWRTDIR = $(BOARD_BUILDDIR)/openwrt
|
|
||||||
|
|
||||||
|
|
||||||
$(GLUON_SITEDIR)/site.mk:
|
|
||||||
$(error There was no site configuration found. Please check out a site configuration to $(GLUON_SITEDIR))
|
|
||||||
|
|
||||||
-include $(GLUON_SITEDIR)/site.mk
|
|
||||||
|
|
||||||
|
|
||||||
GLUON_VERSION := $(shell cd $(GLUONDIR) && git describe --always 2>/dev/null || echo unknown)
|
|
||||||
export GLUON_VERSION
|
|
||||||
|
|
||||||
GLUON_LANGS ?= en
|
|
||||||
export GLUON_LANGS
|
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(OPENWRT_BUILD),1)
|
|
||||||
ifeq ($(GLUON_TOOLS),1)
|
|
||||||
|
|
||||||
GLUON_OPENWRT_FEEDS := base packages luci routing telephony management
|
|
||||||
export GLUON_OPENWRT_FEEDS
|
|
||||||
|
|
||||||
GLUON_SITE_CODE := $(shell $(GLUONDIR)/scripts/site.sh site_code)
|
|
||||||
export GLUON_SITE_CODE
|
|
||||||
|
|
||||||
ifeq ($(GLUON_RELEASE),)
|
|
||||||
$(error GLUON_RELEASE not set. GLUON_RELEASE can be set in site.mk or on the command line.)
|
|
||||||
endif
|
|
||||||
export GLUON_RELEASE
|
|
||||||
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
define merge-lists
|
|
||||||
$(1) :=
|
|
||||||
$(foreach var,$(2),$(1) := $$(filter-out -% $$(patsubst -%,%,$$(filter -%,$$($(var)))),$$($(1)) $$($(var)))
|
|
||||||
)
|
|
||||||
endef
|
|
||||||
|
|
||||||
GLUON_TARGETS :=
|
|
||||||
|
|
||||||
define GluonTarget
|
|
||||||
gluon_target := $(1)$$(if $(2),-$(2))
|
|
||||||
GLUON_TARGETS += $$(gluon_target)
|
|
||||||
GLUON_TARGET_$$(gluon_target)_BOARD := $(1)
|
|
||||||
GLUON_TARGET_$$(gluon_target)_SUBTARGET := $(2)
|
|
||||||
endef
|
|
||||||
|
|
||||||
GLUON_DEFAULT_PACKAGES := gluon-core firewall ip6tables -uboot-envtools -wpad-mini hostapd-mini
|
|
||||||
|
|
||||||
override DEFAULT_PACKAGES.router :=
|
|
||||||
|
|
||||||
endif #__gluon_inc
|
|
@ -1,62 +0,0 @@
|
|||||||
# Makefile for OpenWrt
|
|
||||||
#
|
|
||||||
# Copyright (C) 2007-2012 OpenWrt.org
|
|
||||||
# Copyright (C) 2013-2014 Project Gluon
|
|
||||||
#
|
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
|
||||||
# See /LICENSE for more information.
|
|
||||||
#
|
|
||||||
|
|
||||||
RELEASE:=Chaos Calmer
|
|
||||||
PREP_MK= OPENWRT_BUILD= QUIET=0
|
|
||||||
|
|
||||||
export IS_TTY=$(shell tty -s && echo 1 || echo 0)
|
|
||||||
|
|
||||||
include $(GLUONDIR)/include/verbose.mk
|
|
||||||
|
|
||||||
REVISION:=$(shell [ -d $(TOPDIR) ] && cd $(TOPDIR) && ./scripts/getver.sh 2>/dev/null)
|
|
||||||
|
|
||||||
HOSTCC ?= gcc
|
|
||||||
OPENWRTVERSION:=$(RELEASE)$(if $(REVISION), ($(REVISION)))
|
|
||||||
export RELEASE
|
|
||||||
export REVISION
|
|
||||||
export OPENWRTVERSION
|
|
||||||
export IS_TTY=$(shell tty -s && echo 1 || echo 0)
|
|
||||||
export LD_LIBRARY_PATH:=$(subst ::,:,$(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):)$(STAGING_DIR_HOST)/lib)
|
|
||||||
export DYLD_LIBRARY_PATH:=$(subst ::,:,$(if $(DYLD_LIBRARY_PATH),$(DYLD_LIBRARY_PATH):)$(STAGING_DIR_HOST)/lib)
|
|
||||||
export GIT_CONFIG_PARAMETERS='core.autocrlf=false'
|
|
||||||
export MAKE_JOBSERVER=$(filter --jobserver%,$(MAKEFLAGS))
|
|
||||||
|
|
||||||
# prevent perforce from messing with the patch utility
|
|
||||||
unexport P4PORT P4USER P4CONFIG P4CLIENT
|
|
||||||
|
|
||||||
# prevent user defaults for quilt from interfering
|
|
||||||
unexport QUILT_PATCHES QUILT_PATCH_OPTS
|
|
||||||
|
|
||||||
unexport C_INCLUDE_PATH CROSS_COMPILE ARCH
|
|
||||||
|
|
||||||
# prevent distro default LPATH from interfering
|
|
||||||
unexport LPATH
|
|
||||||
|
|
||||||
# make sure that a predefined CFLAGS variable does not disturb packages
|
|
||||||
export CFLAGS=
|
|
||||||
|
|
||||||
ifneq ($(shell $(HOSTCC) 2>&1 | grep clang),)
|
|
||||||
export HOSTCC_REAL?=$(HOSTCC)
|
|
||||||
export HOSTCC_WRAPPER:=$(TOPDIR)/scripts/clang-gcc-wrapper
|
|
||||||
else
|
|
||||||
export HOSTCC_WRAPPER:=$(HOSTCC)
|
|
||||||
endif
|
|
||||||
|
|
||||||
SCAN_COOKIE?=$(shell echo $$$$)
|
|
||||||
export SCAN_COOKIE
|
|
||||||
|
|
||||||
SUBMAKE:=umask 022; $(SUBMAKE)
|
|
||||||
|
|
||||||
ULIMIT_FIX=_limit=`ulimit -n`; [ "$$_limit" = "unlimited" -o "$$_limit" -ge 1024 ] || ulimit -n 1024;
|
|
||||||
|
|
||||||
FORCE: ;
|
|
||||||
|
|
||||||
.PHONY: FORCE
|
|
||||||
.NOTPARALLEL:
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2006 OpenWrt.org
|
|
||||||
#
|
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
|
||||||
# See /LICENSE for more information.
|
|
||||||
#
|
|
||||||
|
|
||||||
ifndef OPENWRT_VERBOSE
|
|
||||||
OPENWRT_VERBOSE:=
|
|
||||||
endif
|
|
||||||
ifeq ("$(origin V)", "command line")
|
|
||||||
OPENWRT_VERBOSE:=$(V)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OPENWRT_VERBOSE),1)
|
|
||||||
OPENWRT_VERBOSE:=w
|
|
||||||
endif
|
|
||||||
ifeq ($(OPENWRT_VERBOSE),99)
|
|
||||||
OPENWRT_VERBOSE:=s
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(NO_TRACE_MAKE),)
|
|
||||||
NO_TRACE_MAKE := $(MAKE) V=s$(OPENWRT_VERBOSE)
|
|
||||||
export NO_TRACE_MAKE
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(IS_TTY),1)
|
|
||||||
ifneq ($(strip $(NO_COLOR)),1)
|
|
||||||
_Y:=\\033[33m
|
|
||||||
_R:=\\033[31m
|
|
||||||
_N:=\\033[m
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
|
|
||||||
define MESSAGE
|
|
||||||
printf "$(_Y)%s$(_N)\n" "$(1)" >&8
|
|
||||||
endef
|
|
||||||
|
|
||||||
define ERROR_MESSAGE
|
|
||||||
printf "$(_R)%s$(_N)\n" "$(1)" >&8
|
|
||||||
endef
|
|
||||||
|
|
||||||
ifeq ($(QUIET),1)
|
|
||||||
ifneq ($(CURDIR),$(TOPDIR))
|
|
||||||
_DIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR})
|
|
||||||
else
|
|
||||||
_DIR:=
|
|
||||||
endif
|
|
||||||
_NULL:=$(if $(MAKECMDGOALS),$(shell \
|
|
||||||
$(call MESSAGE, make[$(MAKELEVEL)]$(if $(_DIR), -C $(_DIR)) $(MAKECMDGOALS)); \
|
|
||||||
))
|
|
||||||
SUBMAKE=$(MAKE)
|
|
||||||
else
|
|
||||||
SILENT:=>/dev/null $(if $(findstring w,$(OPENWRT_VERBOSE)),,2>&1)
|
|
||||||
export QUIET:=1
|
|
||||||
SUBMAKE=cmd() { $(SILENT) $(MAKE) -s $$* < /dev/null || { echo "make $$*: build failed. Please re-run make with V=s to see what's going on"; false; } } 8>&1 9>&2; cmd
|
|
||||||
endif
|
|
||||||
|
|
||||||
.SILENT: $(MAKECMDGOALS)
|
|
||||||
else
|
|
||||||
SUBMAKE=$(MAKE) -w
|
|
||||||
define MESSAGE
|
|
||||||
printf "%s\n" "$(1)"
|
|
||||||
endef
|
|
||||||
ERROR_MESSAGE=$(MESSAGE)
|
|
||||||
endif
|
|
15
modules
15
modules
@ -1,19 +1,16 @@
|
|||||||
GLUON_FEEDS='openwrt gluon routing luci'
|
GLUON_FEEDS='openwrt gluon routing luci'
|
||||||
|
|
||||||
OPENWRT_REPO=git://github.com/openwrt/openwrt.git
|
LEDE_REPO=git://git.lede-project.org/source.git
|
||||||
OPENWRT_COMMIT=e663db7bb1797740c4a29ac0fc96eda1b88f9e6e
|
LEDE_COMMIT=b9a408c2b49ccfa0e906bda00ef77f4002e401fd
|
||||||
OPENWRT_BRANCH=chaos_calmer
|
|
||||||
|
|
||||||
PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git
|
PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git
|
||||||
PACKAGES_OPENWRT_COMMIT=73776792f7d58e982be9e5819450d4875b273159
|
PACKAGES_OPENWRT_COMMIT=ee211f94ec292f7ec3d563fcbc147359b6cf8290
|
||||||
PACKAGES_OPENWRT_BRANCH=for-15.05
|
|
||||||
|
|
||||||
PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git
|
PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git
|
||||||
PACKAGES_GLUON_COMMIT=90380414f10842238b7ebc21c34dbaf986659320
|
PACKAGES_GLUON_COMMIT=485186ace270564393b464bb4ff07686df31cd96
|
||||||
|
|
||||||
PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git
|
PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git
|
||||||
PACKAGES_ROUTING_COMMIT=a4eae82c155079a4372e4b910ec733f77288b717
|
PACKAGES_ROUTING_COMMIT=d848d49d2443448b147c564c2dd8f64433b5fb9c
|
||||||
|
|
||||||
PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git
|
PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git
|
||||||
PACKAGES_LUCI_COMMIT=70a4d43cc895b7d728b4fc201f2b6fd9f4b8aaec
|
PACKAGES_LUCI_COMMIT=d7328360632d7fbf5fd4006b4172a9fe9861d838
|
||||||
PACKAGES_LUCI_BRANCH=for-15.05
|
|
||||||
|
2
overlay/opkg.mk
Normal file
2
overlay/opkg.mk
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
FEEDS_ENABLED := $(FEEDS_DISABLED)
|
||||||
|
FEEDS_DISABLED :=
|
@ -6,13 +6,13 @@ PKG_RELEASE:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
|
|
||||||
define Package/gluon-alfred
|
define Package/gluon-alfred
|
||||||
SECTION:=gluon
|
SECTION:=gluon
|
||||||
CATEGORY:=Gluon
|
CATEGORY:=Gluon
|
||||||
DEPENDS:=+gluon-core +gluon-respondd +gluon-neighbour-info +micrond +alfred
|
DEPENDS:=+gluon-core +gluon-respondd +gluon-neighbour-info gluon-mesh-batman-adv +micrond +alfred
|
||||||
TITLE:=Configure alfred
|
TITLE:=Configure alfred
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ local c = uci.cursor()
|
|||||||
c:delete('alfred', 'alfred')
|
c:delete('alfred', 'alfred')
|
||||||
c:section('alfred', 'alfred', 'alfred',
|
c:section('alfred', 'alfred', 'alfred',
|
||||||
{
|
{
|
||||||
interface = 'br-client',
|
interface = 'local-node',
|
||||||
mode = 'slave',
|
mode = 'slave',
|
||||||
batmanif = 'bat0',
|
batmanif = 'bat0',
|
||||||
start_vis = '1',
|
start_vis = '1',
|
||||||
|
@ -5,7 +5,7 @@ PKG_VERSION:=2
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
|
|
||||||
define Package/gluon-authorized-keys
|
define Package/gluon-authorized-keys
|
||||||
|
@ -2,12 +2,14 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=gluon-autoupdater
|
PKG_NAME:=gluon-autoupdater
|
||||||
PKG_VERSION:=4
|
PKG_VERSION:=4
|
||||||
PKG_RELEASE:=$(GLUON_BRANCH)
|
|
||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
PKG_CONFIG_DEPENDS := CONFIG_GLUON_BRANCH
|
||||||
PKG_BUILD_DEPENDS := respondd
|
PKG_BUILD_DEPENDS := respondd
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
|
||||||
|
include ../gluon.mk
|
||||||
|
|
||||||
|
|
||||||
define Package/gluon-autoupdater
|
define Package/gluon-autoupdater
|
||||||
@ -17,6 +19,13 @@ define Package/gluon-autoupdater
|
|||||||
TITLE:=Automatically update firmware
|
TITLE:=Automatically update firmware
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Package/gluon-autoupdater/config
|
||||||
|
config GLUON_BRANCH
|
||||||
|
string "Gluon autoupdater branch"
|
||||||
|
depends on PACKAGE_gluon-autoupdater
|
||||||
|
default ""
|
||||||
|
endef
|
||||||
|
|
||||||
define Build/Prepare
|
define Build/Prepare
|
||||||
mkdir -p $(PKG_BUILD_DIR)
|
mkdir -p $(PKG_BUILD_DIR)
|
||||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||||
@ -34,10 +43,10 @@ define Package/gluon-autoupdater/install
|
|||||||
$(INSTALL_DIR) $(1)/lib/gluon/respondd
|
$(INSTALL_DIR) $(1)/lib/gluon/respondd
|
||||||
$(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/autoupdater.so
|
$(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/autoupdater.so
|
||||||
|
|
||||||
if [ '$(GLUON_BRANCH)' ]; then \
|
ifneq ($(CONFIG_GLUON_BRANCH),"")
|
||||||
$(INSTALL_DIR) $(1)/lib/gluon/autoupdater; \
|
$(INSTALL_DIR) $(1)/lib/gluon/autoupdater
|
||||||
echo '$(GLUON_BRANCH)' > $(1)/lib/gluon/autoupdater/default_branch; \
|
echo '$(call qstrip,$(CONFIG_GLUON_BRANCH))' > $(1)/lib/gluon/autoupdater/default_branch
|
||||||
fi
|
endif
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/gluon-autoupdater/postinst
|
define Package/gluon-autoupdater/postinst
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
if [ -x /etc/init.d/$1 ]; then
|
if [ -x /etc/init.d/"$1" ]; then
|
||||||
echo "Stopping $1..."
|
echo "Stopping $1..."
|
||||||
/etc/init.d/$1 stop
|
/etc/init.d/"$1" stop
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
start_enabled() {
|
start_enabled() {
|
||||||
if [ -x /etc/init.d/$1 ] && /etc/init.d/$1 enabled; then
|
if [ -x /etc/init.d/"$1" ] && /etc/init.d/"$1" enabled; then
|
||||||
echo "Starting $1..."
|
echo "Starting $1..."
|
||||||
/etc/init.d/$1 start
|
/etc/init.d/"$1" start
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ PKG_VERSION:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
|
|
||||||
define Package/gluon-client-bridge
|
define Package/gluon-client-bridge
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
need_string_match('next_node.mac', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$')
|
||||||
|
|
||||||
|
if need_string_match('next_node.ip4', '^%d+.%d+.%d+.%d+$', false) then
|
||||||
|
need_string_match('prefix4', '^%d+.%d+.%d+.%d+/%d+$')
|
||||||
|
end
|
||||||
|
|
||||||
|
need_string_match('next_node.ip6', '^[%x:]+$', false)
|
||||||
|
|
||||||
|
|
||||||
for _, config in ipairs({'wifi24', 'wifi5'}) do
|
for _, config in ipairs({'wifi24', 'wifi5'}) do
|
||||||
if need_table(config .. '.ap', nil, false) then
|
if need_table(config .. '.ap', nil, false) then
|
||||||
need_string(config .. '.ap.ssid')
|
need_string(config .. '.ap.ssid')
|
||||||
|
@ -1,33 +1,73 @@
|
|||||||
#!/usr/bin/lua
|
#!/usr/bin/lua
|
||||||
|
|
||||||
|
local site = require 'gluon.site_config'
|
||||||
local sysconfig = require 'gluon.sysconfig'
|
local sysconfig = require 'gluon.sysconfig'
|
||||||
|
local util = require 'gluon.util'
|
||||||
|
|
||||||
|
local ip = require 'luci.ip'
|
||||||
local lutil = require 'luci.util'
|
local lutil = require 'luci.util'
|
||||||
local uci = require('luci.model.uci').cursor()
|
local uci = require('luci.model.uci').cursor()
|
||||||
|
|
||||||
|
|
||||||
|
local ip4, netmask, ip6
|
||||||
|
|
||||||
|
if site.next_node.ip4 then
|
||||||
|
ip4 = site.next_node.ip4
|
||||||
|
netmask = ip.IPv4(site.prefix4):mask():string()
|
||||||
|
end
|
||||||
|
|
||||||
|
if site.next_node.ip6 then
|
||||||
|
ip6 = site.next_node.ip6 .. '/128'
|
||||||
|
end
|
||||||
|
|
||||||
uci:section('network', 'interface', 'client',
|
uci:section('network', 'interface', 'client',
|
||||||
{
|
{
|
||||||
type = 'bridge',
|
type = 'bridge',
|
||||||
}
|
proto = 'static',
|
||||||
|
macaddr = site.next_node.mac,
|
||||||
|
ipaddr = ip4,
|
||||||
|
netmask = netmask,
|
||||||
|
ip6addr = ip6,
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
local ifname = uci:get('network', 'client', 'ifname')
|
uci:delete('network', 'client', 'reqprefix')
|
||||||
|
uci:delete('network', 'client', 'peerdns')
|
||||||
|
uci:delete('network', 'client', 'sourcefilter')
|
||||||
|
|
||||||
if type(ifname) == 'string' then
|
|
||||||
uci:delete('network', 'client', 'ifname')
|
local interfaces = uci:get('network', 'client', 'ifname') or {}
|
||||||
for x in ifname:gmatch("[^%s]+") do
|
|
||||||
uci:add_to_set('network', 'client', 'ifname', x)
|
if type(interfaces) == 'string' then
|
||||||
end
|
local ifname = interfaces
|
||||||
|
interfaces = {}
|
||||||
|
for iface in ifname:gmatch("[^%s]+") do
|
||||||
|
util.add_to_set(interfaces, iface)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if sysconfig.lan_ifname and not ifname and not uci:get_bool('network', 'mesh_lan', 'auto') then
|
if sysconfig.lan_ifname and not ifname and not uci:get_bool('network', 'mesh_lan', 'auto') then
|
||||||
for _, lanif in ipairs(lutil.split(sysconfig.lan_ifname, ' ')) do
|
for _, lanif in ipairs(lutil.split(sysconfig.lan_ifname, ' ')) do
|
||||||
uci:add_to_set('network', 'client', 'ifname', lanif)
|
util.add_to_set(interfaces, lanif)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
uci:set_list('network', 'client', 'ifname', interfaces)
|
||||||
uci:set('network', 'client', 'macaddr', sysconfig.primary_mac)
|
|
||||||
|
|
||||||
uci:save('network')
|
uci:save('network')
|
||||||
|
|
||||||
|
|
||||||
|
local dnsmasq = uci:get_first('dhcp', 'dnsmasq')
|
||||||
|
uci:set('dhcp', dnsmasq, 'boguspriv', 0)
|
||||||
|
uci:set('dhcp', dnsmasq, 'localise_queries', 0)
|
||||||
|
uci:set('dhcp', dnsmasq, 'rebind_protection', 0)
|
||||||
|
|
||||||
|
uci:delete('dhcp', 'client')
|
||||||
|
uci:section('dhcp', 'dhcp', 'client',
|
||||||
|
{
|
||||||
|
interface = 'client',
|
||||||
|
ignore = 1,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
uci:save('dhcp')
|
||||||
|
@ -5,7 +5,7 @@ PKG_VERSION:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ PKG_VERSION:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ PKG_VERSION:=2
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
<form method="post" enctype="multipart/form-data" action="<%=REQUEST_URI%>">
|
<form method="post" enctype="multipart/form-data" action="<%=REQUEST_URI%>">
|
||||||
<div>
|
<div>
|
||||||
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
|
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
|
||||||
|
<input type="hidden" name="token" value="<%=token%>" />
|
||||||
<input type="hidden" name="cbi.submit" value="1" />
|
<input type="hidden" name="cbi.submit" value="1" />
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -1,3 +1,23 @@
|
|||||||
local i18n = require 'luci.i18n'
|
local i18n = require 'luci.i18n'
|
||||||
|
local site = require 'gluon.site_config'
|
||||||
|
local gluon_luci = require 'gluon.luci'
|
||||||
|
local sysconfig = require 'gluon.sysconfig'
|
||||||
|
local pretty_hostname = require 'pretty_hostname'
|
||||||
|
|
||||||
return function () luci.template.render_string(i18n.translate('gluon-config-mode:reboot')) end
|
local uci = luci.model.uci.cursor()
|
||||||
|
|
||||||
|
local hostname = pretty_hostname.get(uci)
|
||||||
|
local contact = uci:get_first('gluon-node-info', 'owner', 'contact')
|
||||||
|
|
||||||
|
local msg = i18n.translate('gluon-config-mode:reboot')
|
||||||
|
|
||||||
|
return function ()
|
||||||
|
luci.template.render_string(msg, {
|
||||||
|
hostname = hostname,
|
||||||
|
site = site,
|
||||||
|
sysconfig = sysconfig,
|
||||||
|
contact = contact,
|
||||||
|
escape = gluon_luci.escape,
|
||||||
|
urlescape = gluon_luci.urlescape,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
@ -32,11 +32,11 @@ function index()
|
|||||||
page.title = _("Wizard")
|
page.title = _("Wizard")
|
||||||
page.target = alias("gluon-config-mode", "wizard")
|
page.target = alias("gluon-config-mode", "wizard")
|
||||||
page.order = 5
|
page.order = 5
|
||||||
page.setuser = "root"
|
page.sysauth = "root"
|
||||||
page.setgroup = "root"
|
page.sysauth_authenticator = function() return "root" end
|
||||||
page.index = true
|
page.index = true
|
||||||
|
|
||||||
entry({"gluon-config-mode", "wizard"}, form("gluon-config-mode/wizard")).index = true
|
entry({"gluon-config-mode", "wizard"}, cbi("gluon-config-mode/wizard")).index = true
|
||||||
entry({"gluon-config-mode", "reboot"}, call("action_reboot"))
|
entry({"gluon-config-mode", "reboot"}, call("action_reboot"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -5,7 +5,7 @@ PKG_VERSION:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||||
|
|
||||||
|
@ -17,22 +17,12 @@ msgstr ""
|
|||||||
"Um deinen Knoten auf der Karte anzeigen zu können, benötigen wir seine "
|
"Um deinen Knoten auf der Karte anzeigen zu können, benötigen wir seine "
|
||||||
"Koordinaten. Hier hast du die Möglichkeit, diese zu hinterlegen."
|
"Koordinaten. Hier hast du die Möglichkeit, diese zu hinterlegen."
|
||||||
|
|
||||||
msgid ""
|
|
||||||
"Specifying the altitude is optional and should only be done if a proper "
|
|
||||||
"value is known."
|
|
||||||
msgstr ""
|
|
||||||
"Die Höhenangabe ist optional und sollte nur gesetzt werden, wenn ein "
|
|
||||||
"exakter Wert bekannt ist."
|
|
||||||
|
|
||||||
msgid "Latitude"
|
msgid "Latitude"
|
||||||
msgstr "Breitengrad"
|
msgstr "Breitengrad"
|
||||||
|
|
||||||
msgid "Longitude"
|
msgid "Longitude"
|
||||||
msgstr "Längengrad"
|
msgstr "Längengrad"
|
||||||
|
|
||||||
msgid "Altitude"
|
|
||||||
msgstr "Höhe"
|
|
||||||
|
|
||||||
msgid "Show node on the map"
|
msgid "Show node on the map"
|
||||||
msgstr "Knoten auf der Karte anzeigen"
|
msgstr "Knoten auf der Karte anzeigen"
|
||||||
|
|
||||||
|
@ -17,22 +17,12 @@ msgstr ""
|
|||||||
"Pour Afficher votre nœud sur la Carte nous avons besoin de ses coordonnées. "
|
"Pour Afficher votre nœud sur la Carte nous avons besoin de ses coordonnées. "
|
||||||
"Ici vous pouvez entrer sa position."
|
"Ici vous pouvez entrer sa position."
|
||||||
|
|
||||||
msgid ""
|
|
||||||
"Specifying the altitude is optional and should only be done if a proper "
|
|
||||||
"value is known."
|
|
||||||
msgstr ""
|
|
||||||
"La altitude est optionelle et ne devrait que être ajoutée si la valeur "
|
|
||||||
"exacte est connue."
|
|
||||||
|
|
||||||
msgid "Latitude"
|
msgid "Latitude"
|
||||||
msgstr "Latitude"
|
msgstr "Latitude"
|
||||||
|
|
||||||
msgid "Longitude"
|
msgid "Longitude"
|
||||||
msgstr "Longitude"
|
msgstr "Longitude"
|
||||||
|
|
||||||
msgid "Altitude"
|
|
||||||
msgstr "Hauteur"
|
|
||||||
|
|
||||||
msgid "Show node on the map"
|
msgid "Show node on the map"
|
||||||
msgstr "Afficher le nœud sur la carte"
|
msgstr "Afficher le nœud sur la carte"
|
||||||
|
|
||||||
|
@ -6,20 +6,12 @@ msgid ""
|
|||||||
"enter its coordinates here."
|
"enter its coordinates here."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid ""
|
|
||||||
"Specifying the altitude is optional and should only be done if a proper "
|
|
||||||
"value is known."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgid "Latitude"
|
msgid "Latitude"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Longitude"
|
msgid "Longitude"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Altitude"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
msgid "Show node on the map"
|
msgid "Show node on the map"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -19,8 +19,7 @@ function M.section(form)
|
|||||||
local text = i18n.translate('If you want the location of your node to '
|
local text = i18n.translate('If you want the location of your node to '
|
||||||
.. 'be displayed on the map, you can enter its coordinates here.')
|
.. 'be displayed on the map, you can enter its coordinates here.')
|
||||||
if show_altitude() then
|
if show_altitude() then
|
||||||
text = text .. ' ' .. i18n.translate('Specifying the altitude is '
|
text = text .. ' ' .. i18n.translate("gluon-config-mode:altitude-help")
|
||||||
.. 'optional and should only be done if a proper value is known.')
|
|
||||||
end
|
end
|
||||||
local s = form:section(cbi.SimpleSection, nil, text)
|
local s = form:section(cbi.SimpleSection, nil, text)
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ function M.section(form)
|
|||||||
o.description = i18n.translatef("e.g. %s", "10.689901")
|
o.description = i18n.translatef("e.g. %s", "10.689901")
|
||||||
|
|
||||||
if show_altitude() then
|
if show_altitude() then
|
||||||
o = s:option(cbi.Value, "_altitude", i18n.translate("Altitude"))
|
o = s:option(cbi.Value, "_altitude", i18n.translate("gluon-config-mode:altitude-label"))
|
||||||
o.default = uci:get_first("gluon-node-info", "location", "altitude")
|
o.default = uci:get_first("gluon-node-info", "location", "altitude")
|
||||||
o:depends("_location", "1")
|
o:depends("_location", "1")
|
||||||
o.rmempty = true
|
o.rmempty = true
|
||||||
|
@ -5,7 +5,7 @@ PKG_VERSION:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ PKG_VERSION:=2
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||||
|
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=gluon-core
|
PKG_NAME:=gluon-core
|
||||||
PKG_VERSION:=3
|
|
||||||
PKG_RELEASE:=$(GLUON_VERSION)
|
GLUON_VERSION = $(shell git describe --always --dirty=+ 2>/dev/null || echo unknown)
|
||||||
|
PKG_VERSION:=$(if $(DUMP),x,$(GLUON_VERSION))
|
||||||
|
|
||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
|
|
||||||
define Package/gluon-core
|
define Package/gluon-core
|
||||||
@ -20,10 +22,6 @@ define Package/gluon-core/description
|
|||||||
Gluon community wifi mesh firmware framework: core
|
Gluon community wifi mesh firmware framework: core
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/Prepare
|
|
||||||
mkdir -p $(PKG_BUILD_DIR)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/Configure
|
define Build/Configure
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@ -34,10 +32,9 @@ endef
|
|||||||
define Package/gluon-core/install
|
define Package/gluon-core/install
|
||||||
$(CP) ./files/* $(1)/
|
$(CP) ./files/* $(1)/
|
||||||
$(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
|
$(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
|
||||||
$(SED) 's/__GLUON_OPENWRT_FEEDS__/{$(GLUON_OPENWRT_FEEDS:%="%",)}/' $(1)/lib/gluon/upgrade/500-opkg
|
|
||||||
|
|
||||||
$(INSTALL_DIR) $(1)/lib/gluon
|
$(INSTALL_DIR) $(1)/lib/gluon
|
||||||
echo "$(GLUON_VERSION)" > $(1)/lib/gluon/gluon-version
|
echo '$(GLUON_VERSION)' > $(1)/lib/gluon/gluon-version
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/gluon-core/postinst
|
define Package/gluon-core/postinst
|
||||||
|
@ -2,16 +2,16 @@ need_string 'site_code'
|
|||||||
need_string 'site_name'
|
need_string 'site_name'
|
||||||
|
|
||||||
if need_table('opkg', nil, false) then
|
if need_table('opkg', nil, false) then
|
||||||
need_string('opkg.openwrt', false)
|
need_string('opkg.lede', false)
|
||||||
|
|
||||||
function check_repo(k, _)
|
function check_repo(k, _)
|
||||||
-- this is not actually a uci name, but using the same naming rules here is fine
|
-- this is not actually a uci name, but using the same naming rules here is fine
|
||||||
assert_uci_name(k)
|
assert_uci_name(k)
|
||||||
|
|
||||||
need_string(string.format('opkg.extra[%q]', k))
|
need_string(string.format('opkg.extra[%q]', k))
|
||||||
end
|
end
|
||||||
|
|
||||||
need_table('opkg.extra', check_repo, false)
|
need_table('opkg.extra', check_repo, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
need_string('hostname_prefix', false)
|
need_string('hostname_prefix', false)
|
||||||
@ -19,23 +19,32 @@ need_string 'timezone'
|
|||||||
|
|
||||||
need_string_array('ntp_servers', false)
|
need_string_array('ntp_servers', false)
|
||||||
|
|
||||||
need_string_match('prefix6', '^[%x:]+/%d+$')
|
need_string_match('prefix6', '^[%x:]+/64$')
|
||||||
|
|
||||||
|
|
||||||
for _, config in ipairs({'wifi24', 'wifi5'}) do
|
for _, config in ipairs({'wifi24', 'wifi5'}) do
|
||||||
if need_table(config, nil, false) then
|
if need_table(config, nil, false) then
|
||||||
need_string('regdom') -- regdom is only required when wifi24 or wifi5 is configured
|
need_string('regdom') -- regdom is only required when wifi24 or wifi5 is configured
|
||||||
|
|
||||||
need_number(config .. '.channel')
|
need_number(config .. '.channel')
|
||||||
|
|
||||||
local rates = {1000, 2000, 5500, 6000, 9000, 11000, 12000, 18000, 24000, 36000, 48000, 54000}
|
local rates = {1000, 2000, 5500, 6000, 9000, 11000, 12000, 18000, 24000, 36000, 48000, 54000}
|
||||||
local supported_rates = need_array_of(config .. '.supported_rates', rates, false)
|
local supported_rates = need_array_of(config .. '.supported_rates', rates, false)
|
||||||
if supported_rates then
|
if supported_rates then
|
||||||
need_array_of(config .. '.basic_rate', supported_rates, true)
|
need_array_of(config .. '.basic_rate', supported_rates, true)
|
||||||
else
|
else
|
||||||
need_array_of(config .. '.basic_rate', rates, false)
|
need_array_of(config .. '.basic_rate', rates, false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
need_boolean('poe_passthrough', false)
|
need_boolean('poe_passthrough', false)
|
||||||
|
if need_table('dns', nil, false) then
|
||||||
|
need_number('dns.cacheentries', false)
|
||||||
|
need_string_array('dns.servers', false)
|
||||||
|
end
|
||||||
|
|
||||||
|
if need_table('next_node', nil, false) then
|
||||||
|
need_string_match('next_node.ip6', '^[%x:]+$', false)
|
||||||
|
need_string_match('next_node.ip4', '^%d+.%d+.%d+.%d+$', false)
|
||||||
|
end
|
||||||
|
@ -16,7 +16,7 @@ if not (sysconfig.lan_ifname or sysconfig.wan_ifname) then
|
|||||||
local lan_ifname = uci:get('network', 'lan', 'ifname')
|
local lan_ifname = uci:get('network', 'lan', 'ifname')
|
||||||
local wan_ifname = uci:get('network', 'wan', 'ifname')
|
local wan_ifname = uci:get('network', 'wan', 'ifname')
|
||||||
|
|
||||||
if platform.match('ar71xx', 'generic', {'cpe510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus', 'uap-pro', 'unifiac-pro'}) then
|
if platform.match('ar71xx', 'generic', {'cpe210', 'cpe510', 'wbs210', 'wbs510', 'nanostation-m', 'nanostation-m-xw', 'unifi-outdoor-plus', 'uap-pro', 'unifiac-pro'}) then
|
||||||
lan_ifname, wan_ifname = wan_ifname, lan_ifname
|
lan_ifname, wan_ifname = wan_ifname, lan_ifname
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -8,42 +8,53 @@ local util = require 'luci.util'
|
|||||||
local subst = {}
|
local subst = {}
|
||||||
|
|
||||||
subst['%%v'] = util.trim(fs.readfile('/etc/openwrt_version'))
|
subst['%%v'] = util.trim(fs.readfile('/etc/openwrt_version'))
|
||||||
subst['%%n'], subst['%%S'] = util.exec('. /etc/openwrt_release; echo $DISTRIB_CODENAME; echo $DISTRIB_TARGET'):match('([^\n]*)\n([^\n]*)')
|
subst['%%n'], subst['%%S'], subst['%%A'] = util.exec('. /etc/openwrt_release; echo "$DISTRIB_CODENAME"; echo "$DISTRIB_TARGET"; echo "$DISTRIB_ARCH"'):match('([^\n]*)\n([^\n]*)\n([^\n]*)')
|
||||||
subst['%%GS'] = site.site_code
|
subst['%%GS'] = site.site_code
|
||||||
subst['%%GV'] = util.trim(fs.readfile('/lib/gluon/gluon-version'))
|
subst['%%GV'] = util.trim(fs.readfile('/lib/gluon/gluon-version'))
|
||||||
subst['%%GR'] = util.trim(fs.readfile('/lib/gluon/release'))
|
subst['%%GR'] = util.trim(fs.readfile('/lib/gluon/release'))
|
||||||
|
|
||||||
function replace_patterns(url)
|
function replace_patterns(url)
|
||||||
for k, v in pairs(subst) do
|
for k, v in pairs(subst) do
|
||||||
url = url:gsub(k, v)
|
url = url:gsub(k, v)
|
||||||
end
|
end
|
||||||
|
|
||||||
return url
|
return url
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if site.opkg then
|
local prefix = subst['%%n'] .. '_'
|
||||||
if site.opkg.openwrt then
|
|
||||||
local url = replace_patterns(site.opkg.openwrt)
|
|
||||||
local f = io.open('/etc/opkg/distfeeds.conf', 'w')
|
|
||||||
|
|
||||||
for _, v in ipairs(__GLUON_OPENWRT_FEEDS__) do
|
if fs.access('/etc/opkg/distfeeds.conf') then
|
||||||
f:write(replace_patterns(string.format('src/gz %%n_%s %s/%s\n', v, site.opkg.openwrt, v)))
|
local distfeeds = {}
|
||||||
end
|
for line in io.lines('/etc/opkg/distfeeds.conf') do
|
||||||
|
table.insert(distfeeds, line)
|
||||||
|
end
|
||||||
|
|
||||||
f:close()
|
local f = io.open('/etc/opkg/distfeeds.conf', 'w')
|
||||||
end
|
|
||||||
|
|
||||||
if site.opkg.extra and next(site.opkg.extra) then
|
for _, line in ipairs(distfeeds) do
|
||||||
local f = io.open('/etc/opkg/gluon.conf', 'w')
|
local name = line:match('^src/gz%s' .. prefix .. '(%S+)%s')
|
||||||
|
if name == 'core' then
|
||||||
|
f:write('# ' .. line .. '\n')
|
||||||
|
elseif name and site.opkg and site.opkg.lede then
|
||||||
|
f:write(string.format('src/gz %s %s/%s\n', prefix .. name, replace_patterns(site.opkg.lede), name))
|
||||||
|
else
|
||||||
|
f:write(line .. '\n')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
for k, v in pairs(site.opkg.extra) do
|
f:close()
|
||||||
f:write(string.format('src/gz %s %s\n', k, replace_patterns(v)))
|
|
||||||
end
|
|
||||||
|
|
||||||
f:close()
|
if site.opkg and site.opkg.extra and next(site.opkg.extra) then
|
||||||
|
local f = io.open('/etc/opkg/gluon.conf', 'w')
|
||||||
|
|
||||||
else
|
for k, v in pairs(site.opkg.extra) do
|
||||||
os.remove('/etc/opkg/gluon.conf')
|
f:write(string.format('src/gz %s %s\n', k, replace_patterns(v)))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
f:close()
|
||||||
|
|
||||||
|
else
|
||||||
|
os.remove('/etc/opkg/gluon.conf')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
40
package/gluon-core/luasrc/lib/gluon/upgrade/820-dns-config
Executable file
40
package/gluon-core/luasrc/lib/gluon/upgrade/820-dns-config
Executable file
@ -0,0 +1,40 @@
|
|||||||
|
#!/usr/bin/lua
|
||||||
|
local site = require 'gluon.site_config'
|
||||||
|
local uci = require('luci.model.uci').cursor()
|
||||||
|
|
||||||
|
dnsmasq=uci:get_first("dhcp", "dnsmasq")
|
||||||
|
|
||||||
|
uci:set('dhcp', dnsmasq, 'localise_queries', '1')
|
||||||
|
uci:set('dhcp', dnsmasq, 'localservice', '0')
|
||||||
|
|
||||||
|
if site.dns and site.dns.servers then
|
||||||
|
uci:set('dhcp', dnsmasq, 'server', site.dns.servers)
|
||||||
|
else
|
||||||
|
uci:delete('dhcp', dnsmasq, 'server')
|
||||||
|
end
|
||||||
|
|
||||||
|
if site.dns and site.dns.cacheentries then
|
||||||
|
uci:set('dhcp', dnsmasq, 'cachesize', site.dns.cacheentries)
|
||||||
|
else
|
||||||
|
uci:delete('dhcp', dnsmasq, 'cachesize')
|
||||||
|
end
|
||||||
|
|
||||||
|
if site.next_node and site.next_node.name and site.next_node.ip4 then
|
||||||
|
uci:section('dhcp','domain','nextnode4',{
|
||||||
|
name=site.next_node.name,
|
||||||
|
ip=site.next_node.ip4,
|
||||||
|
})
|
||||||
|
else
|
||||||
|
uci:delete('dhcp', 'domain', 'nextnode4')
|
||||||
|
end
|
||||||
|
|
||||||
|
if site.next_node and site.next_node.name and site.next_node.ip6 then
|
||||||
|
uci:section('dhcp','domain','nextnode6',{
|
||||||
|
name=site.next_node.name,
|
||||||
|
ip=site.next_node.ip6,
|
||||||
|
})
|
||||||
|
else
|
||||||
|
uci:delete('dhcp', 'domain', 'nextnode6')
|
||||||
|
end
|
||||||
|
uci:save('dhcp')
|
||||||
|
|
@ -4,5 +4,9 @@ local util = require 'gluon.util'
|
|||||||
module 'gluon.sysctl'
|
module 'gluon.sysctl'
|
||||||
|
|
||||||
function set(name, value)
|
function set(name, value)
|
||||||
util.replace_prefix('/etc/sysctl.conf', name .. '=', name .. '=' .. value .. '\n')
|
local new
|
||||||
|
if value then
|
||||||
|
new = name .. '=' .. value .. '\n'
|
||||||
|
end
|
||||||
|
util.replace_prefix('/etc/sysctl.conf', name .. '=', new)
|
||||||
end
|
end
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
-- Writes all lines from the file input to the file output except those starting with prefix
|
-- Writes all lines from the file input to the file output except those starting with prefix
|
||||||
-- Doesn't close the output file, but returns the file object
|
-- Doesn't close the output file, but returns the file object
|
||||||
local function do_filter_prefix(input, output, prefix)
|
local function do_filter_prefix(input, output, prefix)
|
||||||
local f = io.open(output, 'w+')
|
local f = io.open(output, 'w+')
|
||||||
local l = prefix:len()
|
local l = prefix:len()
|
||||||
|
|
||||||
for line in io.lines(input) do
|
for line in io.lines(input) do
|
||||||
if line:sub(1, l) ~= prefix then
|
if line:sub(1, l) ~= prefix then
|
||||||
f:write(line, '\n')
|
f:write(line, '\n')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return f
|
return f
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function escape_args(ret, arg0, ...)
|
local function escape_args(ret, arg0, ...)
|
||||||
if not arg0 then
|
if not arg0 then
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
return escape_args(ret .. "'" .. string.gsub(arg0, "'", "'\\''") .. "' ", ...)
|
return escape_args(ret .. "'" .. string.gsub(arg0, "'", "'\\''") .. "' ", ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -41,76 +41,109 @@ local fs = require 'nixio.fs'
|
|||||||
|
|
||||||
module 'gluon.util'
|
module 'gluon.util'
|
||||||
|
|
||||||
|
function add_to_set(t, itm)
|
||||||
|
for _,v in ipairs(t) do
|
||||||
|
if v == itm then return false end
|
||||||
|
end
|
||||||
|
table.insert(t, itm)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
function remove_from_set(t, itm)
|
||||||
|
local i = 1
|
||||||
|
local changed = false
|
||||||
|
while i <= #t do
|
||||||
|
if t[i] == itm then
|
||||||
|
table.remove(t, i)
|
||||||
|
changed = true
|
||||||
|
else
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return changed
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function exec(...)
|
function exec(...)
|
||||||
return os.execute(escape_args('', 'exec', ...))
|
return os.execute(escape_args('', 'exec', ...))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Removes all lines starting with a prefix from a file, optionally adding a new one
|
-- Removes all lines starting with a prefix from a file, optionally adding a new one
|
||||||
function replace_prefix(file, prefix, add)
|
function replace_prefix(file, prefix, add)
|
||||||
local tmp = file .. '.tmp'
|
local tmp = file .. '.tmp'
|
||||||
local f = do_filter_prefix(file, tmp, prefix)
|
local f = do_filter_prefix(file, tmp, prefix)
|
||||||
if add then
|
if add then
|
||||||
f:write(add)
|
f:write(add)
|
||||||
end
|
end
|
||||||
f:close()
|
f:close()
|
||||||
os.rename(tmp, file)
|
os.rename(tmp, file)
|
||||||
end
|
end
|
||||||
|
|
||||||
function readline(fd)
|
function readline(fd)
|
||||||
local line = fd:read('*l')
|
local line = fd:read('*l')
|
||||||
fd:close()
|
fd:close()
|
||||||
return line
|
return line
|
||||||
end
|
end
|
||||||
|
|
||||||
function lock(file)
|
function lock(file)
|
||||||
exec('lock', file)
|
exec('lock', file)
|
||||||
end
|
end
|
||||||
|
|
||||||
function unlock(file)
|
function unlock(file)
|
||||||
exec('lock', '-u', file)
|
exec('lock', '-u', file)
|
||||||
end
|
end
|
||||||
|
|
||||||
function node_id()
|
function node_id()
|
||||||
return string.gsub(sysconfig.primary_mac, ':', '')
|
return string.gsub(sysconfig.primary_mac, ':', '')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function get_mesh_devices(uconn)
|
||||||
|
local dump = uconn:call("network.interface", "dump", {})
|
||||||
|
local devices = {}
|
||||||
|
for _, interface in ipairs(dump.interface) do
|
||||||
|
if ( (interface.proto == "gluon_mesh") and interface.up ) then
|
||||||
|
table.insert(devices, interface.device)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return devices
|
||||||
|
end
|
||||||
|
|
||||||
local function find_phy_by_path(path)
|
local function find_phy_by_path(path)
|
||||||
for phy in fs.glob('/sys/devices/' .. path .. '/ieee80211/phy*') do
|
for phy in fs.glob('/sys/devices/' .. path .. '/ieee80211/phy*') do
|
||||||
return phy:match('([^/]+)$')
|
return phy:match('([^/]+)$')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function find_phy_by_macaddr(macaddr)
|
local function find_phy_by_macaddr(macaddr)
|
||||||
local addr = macaddr:lower()
|
local addr = macaddr:lower()
|
||||||
for file in fs.glob('/sys/class/ieee80211/*/macaddress') do
|
for file in fs.glob('/sys/class/ieee80211/*/macaddress') do
|
||||||
if lutil.trim(fs.readfile(file)) == addr then
|
if lutil.trim(fs.readfile(file)) == addr then
|
||||||
return file:match('([^/]+)/macaddress$')
|
return file:match('([^/]+)/macaddress$')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function find_phy(radio)
|
local function find_phy(radio)
|
||||||
local config = uci:get_all('wireless', radio)
|
local config = uci:get_all('wireless', radio)
|
||||||
|
|
||||||
if not config or config.type ~= 'mac80211' then
|
if not config or config.type ~= 'mac80211' then
|
||||||
return nil
|
return nil
|
||||||
elseif config.path then
|
elseif config.path then
|
||||||
return find_phy_by_path(config.path)
|
return find_phy_by_path(config.path)
|
||||||
elseif config.macaddr then
|
elseif config.macaddr then
|
||||||
return find_phy_by_macaddr(config.macaddr)
|
return find_phy_by_macaddr(config.macaddr)
|
||||||
else
|
else
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_addresses(radio)
|
local function get_addresses(radio)
|
||||||
local phy = find_phy(radio)
|
local phy = find_phy(radio)
|
||||||
if not phy then
|
if not phy then
|
||||||
return function() end
|
return function() end
|
||||||
end
|
end
|
||||||
|
|
||||||
return io.lines('/sys/class/ieee80211/' .. phy .. '/addresses')
|
return io.lines('/sys/class/ieee80211/' .. phy .. '/addresses')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Generates a (hopefully) unique MAC address
|
-- Generates a (hopefully) unique MAC address
|
||||||
@ -126,70 +159,70 @@ end
|
|||||||
-- 6: ibss1
|
-- 6: ibss1
|
||||||
-- 7: wan_radio1 (private WLAN); mesh VPN
|
-- 7: wan_radio1 (private WLAN); mesh VPN
|
||||||
function generate_mac(i)
|
function generate_mac(i)
|
||||||
if i > 7 or i < 0 then return nil end -- max allowed id (0b111)
|
if i > 7 or i < 0 then return nil end -- max allowed id (0b111)
|
||||||
|
|
||||||
local hashed = string.sub(hash.md5(sysconfig.primary_mac), 0, 12)
|
local hashed = string.sub(hash.md5(sysconfig.primary_mac), 0, 12)
|
||||||
local m1, m2, m3, m4, m5, m6 = string.match(hashed, '(%x%x)(%x%x)(%x%x)(%x%x)(%x%x)(%x%x)')
|
local m1, m2, m3, m4, m5, m6 = string.match(hashed, '(%x%x)(%x%x)(%x%x)(%x%x)(%x%x)(%x%x)')
|
||||||
|
|
||||||
m1 = tonumber(m1, 16)
|
m1 = tonumber(m1, 16)
|
||||||
m6 = tonumber(m6, 16)
|
m6 = tonumber(m6, 16)
|
||||||
|
|
||||||
m1 = nixio.bit.bor(m1, 0x02) -- set locally administered bit
|
m1 = nixio.bit.bor(m1, 0x02) -- set locally administered bit
|
||||||
m1 = nixio.bit.band(m1, 0xFE) -- unset the multicast bit
|
m1 = nixio.bit.band(m1, 0xFE) -- unset the multicast bit
|
||||||
|
|
||||||
-- It's necessary that the first 45 bits of the MAC address don't
|
-- It's necessary that the first 45 bits of the MAC address don't
|
||||||
-- vary on a single hardware interface, since some chips are using
|
-- vary on a single hardware interface, since some chips are using
|
||||||
-- a hardware MAC filter. (e.g 'rt305x')
|
-- a hardware MAC filter. (e.g 'rt305x')
|
||||||
|
|
||||||
m6 = nixio.bit.band(m6, 0xF8) -- zero the last three bits (space needed for counting)
|
m6 = nixio.bit.band(m6, 0xF8) -- zero the last three bits (space needed for counting)
|
||||||
m6 = m6 + i -- add virtual interface id
|
m6 = m6 + i -- add virtual interface id
|
||||||
|
|
||||||
return string.format('%02x:%s:%s:%s:%s:%02x', m1, m2, m3, m4, m5, m6)
|
return string.format('%02x:%s:%s:%s:%s:%02x', m1, m2, m3, m4, m5, m6)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_wlan_mac_from_driver(radio, vif)
|
local function get_wlan_mac_from_driver(radio, vif)
|
||||||
local primary = sysconfig.primary_mac:lower()
|
local primary = sysconfig.primary_mac:lower()
|
||||||
|
|
||||||
local i = 1
|
local i = 1
|
||||||
for addr in get_addresses(radio) do
|
for addr in get_addresses(radio) do
|
||||||
if addr:lower() ~= primary then
|
if addr:lower() ~= primary then
|
||||||
if i == vif then
|
if i == vif then
|
||||||
return addr
|
return addr
|
||||||
end
|
end
|
||||||
|
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function get_wlan_mac(radio, index, vif)
|
function get_wlan_mac(radio, index, vif)
|
||||||
local addr = get_wlan_mac_from_driver(radio, vif)
|
local addr = get_wlan_mac_from_driver(radio, vif)
|
||||||
if addr then
|
if addr then
|
||||||
return addr
|
return addr
|
||||||
end
|
end
|
||||||
|
|
||||||
return generate_mac(4*(index-1) + (vif-1))
|
return generate_mac(4*(index-1) + (vif-1))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Iterate over all radios defined in UCI calling
|
-- Iterate over all radios defined in UCI calling
|
||||||
-- f(radio, index, site.wifiX) for each radio found while passing
|
-- f(radio, index, site.wifiX) for each radio found while passing
|
||||||
-- site.wifi24 for 2.4 GHz devices and site.wifi5 for 5 GHz ones.
|
-- site.wifi24 for 2.4 GHz devices and site.wifi5 for 5 GHz ones.
|
||||||
function iterate_radios(f)
|
function iterate_radios(f)
|
||||||
local radios = {}
|
local radios = {}
|
||||||
|
|
||||||
uci:foreach('wireless', 'wifi-device',
|
uci:foreach('wireless', 'wifi-device',
|
||||||
function(s)
|
function(s)
|
||||||
table.insert(radios, s['.name'])
|
table.insert(radios, s['.name'])
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
for index, radio in ipairs(radios) do
|
for index, radio in ipairs(radios) do
|
||||||
local hwmode = uci:get('wireless', radio, 'hwmode')
|
local hwmode = uci:get('wireless', radio, 'hwmode')
|
||||||
|
|
||||||
if hwmode == '11g' or hwmode == '11ng' then
|
if hwmode == '11g' or hwmode == '11ng' then
|
||||||
f(radio, index, site.wifi24)
|
f(radio, index, site.wifi24)
|
||||||
elseif hwmode == '11a' or hwmode == '11na' then
|
elseif hwmode == '11a' or hwmode == '11na' then
|
||||||
f(radio, index, site.wifi5)
|
f(radio, index, site.wifi5)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -5,7 +5,7 @@ PKG_VERSION:=2
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
|
|
||||||
define Package/gluon-legacy
|
define Package/gluon-legacy
|
||||||
|
@ -9,7 +9,7 @@ PKG_RELEASE:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||||
|
|
||||||
|
@ -1,56 +0,0 @@
|
|||||||
<% if not self.embedded then %>
|
|
||||||
<form method="post" enctype="multipart/form-data" action="<%=REQUEST_URI%>">
|
|
||||||
<div>
|
|
||||||
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
|
|
||||||
<input type="hidden" name="cbi.submit" value="1" />
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<div class="cbi-map" id="cbi-<%=self.config%>">
|
|
||||||
<% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %>
|
|
||||||
<%- if self.message then %>
|
|
||||||
<p class="message success"><%=self.message%></p>
|
|
||||||
<%- end %>
|
|
||||||
<%- if self.errmessage then %>
|
|
||||||
<p class="message error"><%=self.errmessage%></p>
|
|
||||||
<%- end %>
|
|
||||||
<% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
|
|
||||||
<% self:render_children() %>
|
|
||||||
</div>
|
|
||||||
<% if not self.embedded then %>
|
|
||||||
<div class="cbi-page-actions">
|
|
||||||
<%-
|
|
||||||
if type(self.hidden) == "table" then
|
|
||||||
for k, v in pairs(self.hidden) do
|
|
||||||
-%>
|
|
||||||
<input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" />
|
|
||||||
<%-
|
|
||||||
end
|
|
||||||
end
|
|
||||||
%>
|
|
||||||
<% if redirect then %>
|
|
||||||
<div style="float:left">
|
|
||||||
<input class="cbi-button cbi-button-link" type="button" value="<%:Back to Overview%>" onclick="location.href='<%=pcdata(redirect)%>'" />
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<%- if self.flow and self.flow.skip then %>
|
|
||||||
<input class="cbi-button cbi-button-skip" type="submit" name="cbi.skip" value="<%:Skip%>" />
|
|
||||||
<% end %>
|
|
||||||
<%- if self.submit ~= false then %>
|
|
||||||
<input class="cbi-button cbi-button-save" type="submit" name="cbi.apply" value="
|
|
||||||
<%- if not self.submit then -%><%-:Submit-%><%-else-%><%=self.submit%><%end-%>
|
|
||||||
" />
|
|
||||||
<% end %>
|
|
||||||
<%- if self.reset ~= false then %>
|
|
||||||
<input class="cbi-button cbi-button-reset" type="reset" value="
|
|
||||||
<%- if not self.reset then -%><%-:Reset-%><%-else-%><%=self.reset%><%end-%>
|
|
||||||
" />
|
|
||||||
<% end %>
|
|
||||||
<%- if self.cancel ~= false and self.on_cancel then %>
|
|
||||||
<input class="cbi-button cbi-button-reset" type="submit" name="cbi.cancel" value="
|
|
||||||
<%- if not self.cancel then -%><%-:Cancel-%><%-else-%><%=self.cancel%><%end-%>
|
|
||||||
" />
|
|
||||||
<% end %>
|
|
||||||
<script type="text/javascript">cbi_d_update();</script>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<% end %>
|
|
@ -48,8 +48,8 @@ $Id$
|
|||||||
|
|
||||||
<div class="cbi-page-actions right">
|
<div class="cbi-page-actions right">
|
||||||
<input type="hidden" name="step" value="2" />
|
<input type="hidden" name="step" value="2" />
|
||||||
|
<input type="hidden" name="token" value="<%=token%>" />
|
||||||
<input class="cbi-button cbi-button-apply" type="submit" value="<%:Upload image%>" />
|
<input class="cbi-button cbi-button-apply" type="submit" value="<%:Upload image%>" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<%+footer%>
|
<%+footer%>
|
||||||
|
|
||||||
|
@ -45,23 +45,24 @@ $Id$
|
|||||||
if flashsize > 0 then
|
if flashsize > 0 then
|
||||||
write(luci.i18n.translatef(
|
write(luci.i18n.translatef(
|
||||||
" (%s available)",
|
" (%s available)",
|
||||||
w.byte_format(flashsize)
|
byte_format(flashsize)
|
||||||
))
|
))
|
||||||
end
|
end
|
||||||
%></li>
|
%></li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
<div class="cbi-page-actions">
|
<div class="cbi-page-actions">
|
||||||
<form style="display:inline">
|
<form method="post" action="<%=REQUEST_URI%>" style="display:inline">
|
||||||
<input type="hidden" name="step" value="3" />
|
<input type="hidden" name="step" value="3" />
|
||||||
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
|
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
|
||||||
|
<input type="hidden" name="token" value="<%=token%>" />
|
||||||
<input class="cbi-button cbi-button-apply" type="submit" value="<%:Continue%>" />
|
<input class="cbi-button cbi-button-apply" type="submit" value="<%:Continue%>" />
|
||||||
</form>
|
</form>
|
||||||
<form style="display:inline">
|
<form method="post" action="<%=REQUEST_URI%>" style="display:inline">
|
||||||
<input type="hidden" name="step" value="1" />
|
<input type="hidden" name="step" value="1" />
|
||||||
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
|
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
|
||||||
|
<input type="hidden" name="token" value="<%=token%>" />
|
||||||
<input class="cbi-button cbi-button-reset" type="submit" value="<%:Cancel%>" />
|
<input class="cbi-button cbi-button-reset" type="submit" value="<%:Cancel%>" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<%+footer%>
|
<%+footer%>
|
||||||
|
|
||||||
|
@ -44,6 +44,12 @@ function action_upgrade()
|
|||||||
|
|
||||||
-- Determine state
|
-- Determine state
|
||||||
local step = tonumber(luci.http.formvalue("step") or 1)
|
local step = tonumber(luci.http.formvalue("step") or 1)
|
||||||
|
|
||||||
|
if step ~= 1 and not luci.dispatcher.test_post_security() then
|
||||||
|
nixio.fs.unlink(tmpfile)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local has_image = nixio.fs.access(tmpfile)
|
local has_image = nixio.fs.access(tmpfile)
|
||||||
local has_support = image_supported(tmpfile)
|
local has_support = image_supported(tmpfile)
|
||||||
|
|
||||||
|
@ -16,90 +16,74 @@ $Id$
|
|||||||
|
|
||||||
local fs = require "nixio.fs"
|
local fs = require "nixio.fs"
|
||||||
|
|
||||||
local m = Map("system", translate("SSH keys"))
|
local f_keys = SimpleForm('keys', translate("SSH keys"), translate("You can provide your SSH keys here (one per line):"))
|
||||||
m.pageaction = false
|
f_keys.hidden = { submit_keys = '1' }
|
||||||
m.template = "admin/expertmode"
|
|
||||||
|
|
||||||
if fs.access("/etc/config/dropbear") then
|
local keys
|
||||||
local s = m:section(TypedSection, "_dummy1", nil,
|
|
||||||
translate("You can provide your SSH keys here (one per line):"))
|
|
||||||
|
|
||||||
s.addremove = false
|
keys = f_keys:field(TextValue, "keys", "")
|
||||||
s.anonymous = true
|
keys.wrap = "off"
|
||||||
|
keys.rows = 5
|
||||||
|
keys.rmempty = true
|
||||||
|
|
||||||
function s.cfgsections()
|
function keys.cfgvalue()
|
||||||
return { "_keys" }
|
return fs.readfile("/etc/dropbear/authorized_keys") or ""
|
||||||
end
|
|
||||||
|
|
||||||
local keys
|
|
||||||
|
|
||||||
keys = s:option(TextValue, "_data", "")
|
|
||||||
keys.wrap = "off"
|
|
||||||
keys.rows = 5
|
|
||||||
keys.rmempty = true
|
|
||||||
|
|
||||||
function keys.cfgvalue()
|
|
||||||
return fs.readfile("/etc/dropbear/authorized_keys") or ""
|
|
||||||
end
|
|
||||||
|
|
||||||
function keys.write(self, section, value)
|
|
||||||
if value then
|
|
||||||
fs.writefile("/etc/dropbear/authorized_keys", value:gsub("\r\n", "\n"):trim() .. "\n")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function keys.remove(self, section)
|
|
||||||
if keys:formvalue("_keys") then
|
|
||||||
fs.remove("/etc/dropbear/authorized_keys")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local m2 = Map("system", translate("Password"))
|
function keys.write(self, section, value)
|
||||||
m2.reset = false
|
if not f_keys:formvalue('submit_keys') then return end
|
||||||
m2.pageaction = false
|
|
||||||
m2.template = "admin/expertmode"
|
|
||||||
|
|
||||||
local s = m2:section(TypedSection, "_dummy2", nil, translate(
|
fs.writefile("/etc/dropbear/authorized_keys", value:gsub("\r\n", "\n"):trim() .. "\n")
|
||||||
"Alternatively, you can set a password to access you node. Please choose a secure password you don't use anywhere else.<br /><br />"
|
end
|
||||||
.. "If you set an empty password, login via password will be disabled. This is the default."))
|
|
||||||
|
|
||||||
s.addremove = false
|
function keys.remove(self, section)
|
||||||
s.anonymous = true
|
if not f_keys:formvalue('submit_keys') then return end
|
||||||
|
|
||||||
local pw1 = s:option(Value, "pw1", translate("Password"))
|
fs.remove("/etc/dropbear/authorized_keys")
|
||||||
|
end
|
||||||
|
|
||||||
|
local f_password = SimpleForm('password', translate("Password"),
|
||||||
|
translate(
|
||||||
|
"Alternatively, you can set a password to access you node. Please choose a secure password you don't use anywhere else.<br /><br />"
|
||||||
|
.. "If you set an empty password, login via password will be disabled. This is the default."
|
||||||
|
)
|
||||||
|
)
|
||||||
|
f_password.hidden = { submit_password = '1' }
|
||||||
|
f_password.reset = false
|
||||||
|
|
||||||
|
local pw1 = f_password:field(Value, "pw1", translate("Password"))
|
||||||
pw1.password = true
|
pw1.password = true
|
||||||
|
function pw1.cfgvalue()
|
||||||
|
return ''
|
||||||
|
end
|
||||||
|
|
||||||
local pw2 = s:option(Value, "pw2", translate("Confirmation"))
|
local pw2 = f_password:field(Value, "pw2", translate("Confirmation"))
|
||||||
pw2.password = true
|
pw2.password = true
|
||||||
|
function pw2.cfgvalue()
|
||||||
function s.cfgsections()
|
return ''
|
||||||
return { "_pass" }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function m2.on_commit(map)
|
function f_password:handle(state, data)
|
||||||
local v1 = pw1:formvalue("_pass")
|
if not f_password:formvalue('submit_password') then return end
|
||||||
local v2 = pw2:formvalue("_pass")
|
|
||||||
|
|
||||||
if v1 and v2 then
|
if data.pw1 ~= data.pw2 then
|
||||||
if v1 == v2 then
|
f_password.errmessage = translate("The password and the confirmation differ.")
|
||||||
if #v1 > 0 then
|
return
|
||||||
if luci.sys.user.setpasswd('root', v1) == 0 then
|
end
|
||||||
m2.message = translate("Password changed.")
|
|
||||||
else
|
if data.pw1 and #data.pw1 > 0 then
|
||||||
m2.errmessage = translate("Unable to change the password.")
|
if luci.sys.user.setpasswd('root', data.pw1) == 0 then
|
||||||
end
|
f_password.message = translate("Password changed.")
|
||||||
else
|
else
|
||||||
-- We don't check the return code here as the error 'password for root is already locked' is normal...
|
f_password.errmessage = translate("Unable to change the password.")
|
||||||
os.execute('passwd -l root >/dev/null')
|
end
|
||||||
m2.message = translate("Password removed.")
|
else
|
||||||
end
|
-- We don't check the return code here as the error 'password for root is already locked' is normal...
|
||||||
else
|
os.execute('passwd -l root >/dev/null')
|
||||||
m2.errmessage = translate("The password and the confirmation differ.")
|
f_password.message = translate("Password removed.")
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local c = Compound(m, m2)
|
local c = Compound(f_keys, f_password)
|
||||||
c.pageaction = false
|
c.pageaction = false
|
||||||
return c
|
return c
|
||||||
|
@ -9,7 +9,7 @@ PKG_RELEASE:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ $Id$
|
|||||||
|
|
||||||
m = Map("autoupdater", translate("Automatic updates"))
|
m = Map("autoupdater", translate("Automatic updates"))
|
||||||
m.pageaction = false
|
m.pageaction = false
|
||||||
m.template = "admin/expertmode"
|
m.template = "cbi/simpleform"
|
||||||
|
|
||||||
s = m:section(TypedSection, "autoupdater", nil)
|
s = m:section(TypedSection, "autoupdater", nil)
|
||||||
s.addremove = false
|
s.addremove = false
|
||||||
|
@ -6,7 +6,7 @@ PKG_RELEASE:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ local uci = luci.model.uci.cursor()
|
|||||||
local util = luci.util
|
local util = luci.util
|
||||||
|
|
||||||
local f = SimpleForm('mesh_vpn', translate('Mesh VPN'))
|
local f = SimpleForm('mesh_vpn', translate('Mesh VPN'))
|
||||||
f.template = "admin/expertmode"
|
|
||||||
|
|
||||||
local s = f:section(SimpleSection)
|
local s = f:section(SimpleSection)
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ PKG_RELEASE:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ local config = 'gluon-node-info'
|
|||||||
local role = uci:get(config, uci:get_first(config, "system"), "role")
|
local role = uci:get(config, uci:get_first(config, "system"), "role")
|
||||||
|
|
||||||
f = SimpleForm("role", i18n.translate("Node role"))
|
f = SimpleForm("role", i18n.translate("Node role"))
|
||||||
f.template = "admin/expertmode"
|
|
||||||
|
|
||||||
s = f:section(SimpleSection, nil, i18n.translate(
|
s = f:section(SimpleSection, nil, i18n.translate(
|
||||||
"If this node has a special role within the freifunk network you can specify this role here. "
|
"If this node has a special role within the freifunk network you can specify this role here. "
|
||||||
|
@ -9,7 +9,7 @@ PKG_RELEASE:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
|
|||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
$Id$
|
$Id$
|
||||||
]]--
|
]]--
|
||||||
@ -15,13 +15,13 @@ $Id$
|
|||||||
local uci = luci.model.uci.cursor()
|
local uci = luci.model.uci.cursor()
|
||||||
local lutil = require 'luci.util'
|
local lutil = require 'luci.util'
|
||||||
local sysconfig = require 'gluon.sysconfig'
|
local sysconfig = require 'gluon.sysconfig'
|
||||||
|
local util = require 'gluon.util'
|
||||||
|
|
||||||
local wan = uci:get_all("network", "wan")
|
local wan = uci:get_all("network", "wan")
|
||||||
local wan6 = uci:get_all("network", "wan6")
|
local wan6 = uci:get_all("network", "wan6")
|
||||||
local dns = uci:get_first("gluon-wan-dnsmasq", "static")
|
local dns = uci:get_first("gluon-wan-dnsmasq", "static")
|
||||||
|
|
||||||
local f = SimpleForm("portconfig", translate("WAN connection"))
|
local f = SimpleForm("portconfig", translate("WAN connection"))
|
||||||
f.template = "admin/expertmode"
|
|
||||||
|
|
||||||
local s
|
local s
|
||||||
local o
|
local o
|
||||||
@ -75,11 +75,11 @@ o.rmempty = false
|
|||||||
|
|
||||||
|
|
||||||
if dns then
|
if dns then
|
||||||
s = f:section(SimpleSection, nil, nil)
|
s = f:section(SimpleSection, nil, nil)
|
||||||
|
|
||||||
o = s:option(DynamicList, "dns", translate("Static DNS servers"))
|
o = s:option(DynamicList, "dns", translate("Static DNS servers"))
|
||||||
o:write(nil, uci:get("gluon-wan-dnsmasq", dns, "server"))
|
o:write(nil, uci:get("gluon-wan-dnsmasq", dns, "server"))
|
||||||
o.datatype = "ipaddr"
|
o.datatype = "ipaddr"
|
||||||
end
|
end
|
||||||
|
|
||||||
s = f:section(SimpleSection, nil, nil)
|
s = f:section(SimpleSection, nil, nil)
|
||||||
@ -89,80 +89,80 @@ o.default = uci:get_bool("network", "mesh_wan", "auto") and o.enabled or o.disab
|
|||||||
o.rmempty = false
|
o.rmempty = false
|
||||||
|
|
||||||
if sysconfig.lan_ifname then
|
if sysconfig.lan_ifname then
|
||||||
o = s:option(Flag, "mesh_lan", translate("Enable meshing on the LAN interface"))
|
o = s:option(Flag, "mesh_lan", translate("Enable meshing on the LAN interface"))
|
||||||
o.default = uci:get_bool("network", "mesh_lan", "auto") and o.enabled or o.disabled
|
o.default = uci:get_bool("network", "mesh_lan", "auto") and o.enabled or o.disabled
|
||||||
o.rmempty = false
|
o.rmempty = false
|
||||||
end
|
end
|
||||||
|
|
||||||
if uci:get('system', 'gpio_switch_poe_passthrough') then
|
if uci:get('system', 'gpio_switch_poe_passthrough') then
|
||||||
s = f:section(SimpleSection, nil, nil)
|
s = f:section(SimpleSection, nil, nil)
|
||||||
o = s:option(Flag, "poe_passthrough", translate("Enable PoE passthrough"))
|
o = s:option(Flag, "poe_passthrough", translate("Enable PoE passthrough"))
|
||||||
o.default = uci:get_bool("system", "gpio_switch_poe_passthrough", "value") and o.enabled or o.disabled
|
o.default = uci:get_bool("system", "gpio_switch_poe_passthrough", "value") and o.enabled or o.disabled
|
||||||
o.rmempty = false
|
o.rmempty = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function f.handle(self, state, data)
|
function f.handle(self, state, data)
|
||||||
if state == FORM_VALID then
|
if state == FORM_VALID then
|
||||||
uci:set("network", "wan", "proto", data.ipv4)
|
uci:set("network", "wan", "proto", data.ipv4)
|
||||||
if data.ipv4 == "static" then
|
if data.ipv4 == "static" then
|
||||||
uci:set("network", "wan", "ipaddr", data.ipv4_addr:trim())
|
uci:set("network", "wan", "ipaddr", data.ipv4_addr:trim())
|
||||||
uci:set("network", "wan", "netmask", data.ipv4_netmask:trim())
|
uci:set("network", "wan", "netmask", data.ipv4_netmask:trim())
|
||||||
uci:set("network", "wan", "gateway", data.ipv4_gateway:trim())
|
uci:set("network", "wan", "gateway", data.ipv4_gateway:trim())
|
||||||
else
|
else
|
||||||
uci:delete("network", "wan", "ipaddr")
|
uci:delete("network", "wan", "ipaddr")
|
||||||
uci:delete("network", "wan", "netmask")
|
uci:delete("network", "wan", "netmask")
|
||||||
uci:delete("network", "wan", "gateway")
|
uci:delete("network", "wan", "gateway")
|
||||||
end
|
end
|
||||||
|
|
||||||
uci:set("network", "wan6", "proto", data.ipv6)
|
uci:set("network", "wan6", "proto", data.ipv6)
|
||||||
if data.ipv6 == "static" then
|
if data.ipv6 == "static" then
|
||||||
uci:set("network", "wan6", "ip6addr", data.ipv6_addr:trim())
|
uci:set("network", "wan6", "ip6addr", data.ipv6_addr:trim())
|
||||||
uci:set("network", "wan6", "ip6gw", data.ipv6_gateway:trim())
|
uci:set("network", "wan6", "ip6gw", data.ipv6_gateway:trim())
|
||||||
else
|
else
|
||||||
uci:delete("network", "wan6", "ip6addr")
|
uci:delete("network", "wan6", "ip6addr")
|
||||||
uci:delete("network", "wan6", "ip6gw")
|
uci:delete("network", "wan6", "ip6gw")
|
||||||
end
|
end
|
||||||
|
|
||||||
uci:set("network", "mesh_wan", "auto", data.mesh_wan)
|
uci:set("network", "mesh_wan", "auto", data.mesh_wan)
|
||||||
|
|
||||||
if sysconfig.lan_ifname then
|
if sysconfig.lan_ifname then
|
||||||
uci:set("network", "mesh_lan", "auto", data.mesh_lan)
|
uci:set("network", "mesh_lan", "auto", data.mesh_lan)
|
||||||
|
|
||||||
local doit
|
local interfaces = uci:get_list("network", "client", "ifname")
|
||||||
if data.mesh_lan == '1' then
|
|
||||||
doit = uci.remove_from_set
|
|
||||||
else
|
|
||||||
doit = uci.add_to_set
|
|
||||||
end
|
|
||||||
|
|
||||||
for _, lanif in ipairs(lutil.split(sysconfig.lan_ifname, ' ')) do
|
for _, lanif in ipairs(lutil.split(sysconfig.lan_ifname, ' ')) do
|
||||||
doit(uci, "network", "client", "ifname", lanif)
|
if data.mesh_lan == '1' then
|
||||||
end
|
util.remove_from_set(interfaces, lanif)
|
||||||
end
|
else
|
||||||
|
util.add_to_set(interfaces, lanif)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
uci:save("network")
|
uci:set_list("network", "client", "ifname", interfaces)
|
||||||
uci:commit("network")
|
end
|
||||||
|
|
||||||
if uci:get('system', 'gpio_switch_poe_passthrough') then
|
uci:save("network")
|
||||||
uci:set('system', 'gpio_switch_poe_passthrough', 'value', data.poe_passthrough)
|
uci:commit("network")
|
||||||
uci:save('system')
|
|
||||||
uci:commit('system')
|
|
||||||
end
|
|
||||||
|
|
||||||
if dns then
|
if uci:get('system', 'gpio_switch_poe_passthrough') then
|
||||||
if #data.dns > 0 then
|
uci:set('system', 'gpio_switch_poe_passthrough', 'value', data.poe_passthrough)
|
||||||
uci:set("gluon-wan-dnsmasq", dns, "server", data.dns)
|
uci:save('system')
|
||||||
else
|
uci:commit('system')
|
||||||
uci:delete("gluon-wan-dnsmasq", dns, "server")
|
end
|
||||||
end
|
|
||||||
|
|
||||||
uci:save("gluon-wan-dnsmasq")
|
if dns then
|
||||||
uci:commit("gluon-wan-dnsmasq")
|
if #data.dns > 0 then
|
||||||
end
|
uci:set("gluon-wan-dnsmasq", dns, "server", data.dns)
|
||||||
end
|
else
|
||||||
|
uci:delete("gluon-wan-dnsmasq", dns, "server")
|
||||||
|
end
|
||||||
|
|
||||||
return true
|
uci:save("gluon-wan-dnsmasq")
|
||||||
|
uci:commit("gluon-wan-dnsmasq")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
return f
|
return f
|
||||||
|
@ -6,7 +6,7 @@ PKG_RELEASE:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ local primary_iface = 'wan_radio0'
|
|||||||
local ssid = uci:get('wireless', primary_iface, "ssid")
|
local ssid = uci:get('wireless', primary_iface, "ssid")
|
||||||
|
|
||||||
f = SimpleForm("wifi", translate("Private WLAN"))
|
f = SimpleForm("wifi", translate("Private WLAN"))
|
||||||
f.template = "admin/expertmode"
|
|
||||||
|
|
||||||
s = f:section(SimpleSection, nil, translate(
|
s = f:section(SimpleSection, nil, translate(
|
||||||
'Your node can additionally extend your private network by bridging the WAN interface '
|
'Your node can additionally extend your private network by bridging the WAN interface '
|
||||||
|
@ -9,7 +9,7 @@ PKG_RELEASE:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
|
|
||||||
define Package/gluon-luci-theme
|
define Package/gluon-luci-theme
|
||||||
|
@ -6,7 +6,7 @@ PKG_RELEASE:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
|
||||||
|
|
||||||
|
@ -41,7 +41,6 @@ end
|
|||||||
|
|
||||||
|
|
||||||
local f = SimpleForm("wifi", translate("WLAN"))
|
local f = SimpleForm("wifi", translate("WLAN"))
|
||||||
f.template = "admin/expertmode"
|
|
||||||
|
|
||||||
local s = f:section(SimpleSection, nil, translate(
|
local s = f:section(SimpleSection, nil, translate(
|
||||||
"You can enable or disable your node's client and mesh network "
|
"You can enable or disable your node's client and mesh network "
|
||||||
|
@ -5,7 +5,7 @@ PKG_VERSION:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
|
|
||||||
define Package/gluon-mesh-batman-adv-14
|
define Package/gluon-mesh-batman-adv-14
|
||||||
|
@ -5,7 +5,7 @@ PKG_VERSION:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
|
|
||||||
define Package/gluon-mesh-batman-adv-15
|
define Package/gluon-mesh-batman-adv-15
|
||||||
|
@ -6,14 +6,14 @@ PKG_VERSION:=1
|
|||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
PKG_BUILD_DEPENDS := respondd
|
PKG_BUILD_DEPENDS := respondd
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
|
|
||||||
define Package/gluon-mesh-batman-adv-core
|
define Package/gluon-mesh-batman-adv-core
|
||||||
SECTION:=gluon
|
SECTION:=gluon
|
||||||
CATEGORY:=Gluon
|
CATEGORY:=Gluon
|
||||||
TITLE:=Support for batman-adv meshing (core)
|
TITLE:=Support for batman-adv meshing (core)
|
||||||
DEPENDS:=+gluon-core +libgluonutil +gluon-client-bridge +firewall +libiwinfo +kmod-dummy
|
DEPENDS:=+gluon-core +libgluonutil +gluon-client-bridge +gluon-ebtables +firewall +libiwinfo +kmod-dummy +kmod-macvlan +libnl-tiny
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/Prepare
|
define Build/Prepare
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
for _, config in ipairs({'wifi24', 'wifi5'}) do
|
for _, config in ipairs({'wifi24', 'wifi5'}) do
|
||||||
local rates = {1000, 2000, 5500, 6000, 9000, 11000, 12000, 18000, 24000, 36000, 48000, 54000}
|
local rates = {1000, 2000, 5500, 6000, 9000, 11000, 12000, 18000, 24000, 36000, 48000, 54000}
|
||||||
rates = need_array_of(config .. '.supported_rates', rates, false) or rates
|
rates = need_array_of(config .. '.supported_rates', rates, false) or rates
|
||||||
|
|
||||||
if need_table(config .. '.ibss', nil, false) then
|
if need_table(config .. '.ibss', nil, false) then
|
||||||
need_string(config .. '.ibss.ssid')
|
need_string(config .. '.ibss.ssid')
|
||||||
need_string_match(config .. '.ibss.bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$')
|
need_string_match(config .. '.ibss.bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$')
|
||||||
need_one_of(config .. '.ibss.mcast_rate', rates, false)
|
need_one_of(config .. '.ibss.mcast_rate', rates, false)
|
||||||
need_number(config .. '.ibss.vlan', false)
|
need_number(config .. '.ibss.vlan', false)
|
||||||
need_boolean(config .. '.ibss.disabled', false)
|
need_boolean(config .. '.ibss.disabled', false)
|
||||||
end
|
end
|
||||||
|
|
||||||
if need_table(config .. '.mesh', nil, false) then
|
if need_table(config .. '.mesh', nil, false) then
|
||||||
need_string(config .. '.mesh.id')
|
need_string(config .. '.mesh.id')
|
||||||
need_one_of(config .. '.mesh.mcast_rate', rates, false)
|
need_one_of(config .. '.mesh.mcast_rate', rates, false)
|
||||||
need_boolean(config .. '.mesh.disabled', false)
|
need_boolean(config .. '.mesh.disabled', false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
need_boolean('mesh_on_wan', false)
|
need_boolean('mesh_on_wan', false)
|
||||||
need_boolean('mesh_on_lan', false)
|
need_boolean('mesh_on_lan', false)
|
||||||
|
|
||||||
if need_table('mesh', nil, false) and need_table('mesh.batman_adv', nil, false) then
|
if need_table('mesh', nil, false) and need_table('mesh.batman_adv', nil, false) then
|
||||||
need_number('mesh.batman_adv.gw_sel_class', false)
|
need_number('mesh.batman_adv.gw_sel_class', false)
|
||||||
end
|
end
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
local site = require 'gluon.site_config'
|
||||||
|
local next_node = site.next_node
|
||||||
|
|
||||||
|
rule('FORWARD --logical-out br-client -o bat0 -d ' .. next_node.mac .. ' -j DROP')
|
||||||
|
rule('OUTPUT --logical-out br-client -o bat0 -d ' .. next_node.mac .. ' -j DROP')
|
||||||
|
rule('FORWARD --logical-out br-client -o bat0 -s ' .. next_node.mac .. ' -j DROP')
|
||||||
|
rule('OUTPUT --logical-out br-client -o bat0 -s ' .. next_node.mac .. ' -j DROP')
|
||||||
|
|
||||||
|
if next_node.ip4 then
|
||||||
|
rule('FORWARD --logical-in br-client -p ARP --arp-ip-src ' .. next_node.ip4 .. ' -j DROP')
|
||||||
|
rule('FORWARD --logical-in br-client -p ARP --arp-ip-dst ' .. next_node.ip4 .. ' -j DROP')
|
||||||
|
|
||||||
|
rule('FORWARD --logical-out br-client -o bat0 -p IPv4 --ip-destination ' .. next_node.ip4 .. ' -j DROP')
|
||||||
|
rule('OUTPUT --logical-out br-client -o bat0 -p IPv4 --ip-destination ' .. next_node.ip4 .. ' -j DROP')
|
||||||
|
rule('FORWARD --logical-out br-client -o bat0 -p IPv4 --ip-source ' .. next_node.ip4 .. ' -j DROP')
|
||||||
|
rule('OUTPUT --logical-out br-client -o bat0 -p IPv4 --ip-source ' .. next_node.ip4 .. ' -j DROP')
|
||||||
|
end
|
||||||
|
|
||||||
|
if next_node.ip6 then
|
||||||
|
rule('FORWARD --logical-out br-client -o bat0 -p IPv6 --ip6-destination ' .. next_node.ip6 .. ' -j DROP')
|
||||||
|
rule('OUTPUT --logical-out br-client -o bat0 -p IPv6 --ip6-destination ' .. next_node.ip6 .. ' -j DROP')
|
||||||
|
rule('FORWARD --logical-out br-client -o bat0 -p IPv6 --ip6-source ' .. next_node.ip6 .. ' -j DROP')
|
||||||
|
rule('OUTPUT --logical-out br-client -o bat0 -p IPv6 --ip6-source ' .. next_node.ip6 .. ' -j DROP')
|
||||||
|
end
|
@ -0,0 +1 @@
|
|||||||
|
local_node
|
@ -1,102 +1,42 @@
|
|||||||
#!/usr/bin/lua
|
#!/usr/bin/lua
|
||||||
|
|
||||||
local sysconfig = require 'gluon.sysconfig'
|
local sysconfig = require 'gluon.sysconfig'
|
||||||
local sysctl = require 'gluon.sysctl'
|
|
||||||
local site = require 'gluon.site_config'
|
local site = require 'gluon.site_config'
|
||||||
|
local util = require 'gluon.util'
|
||||||
|
|
||||||
local uci = require('luci.model.uci').cursor()
|
local uci = require('luci.model.uci').cursor()
|
||||||
|
|
||||||
|
|
||||||
local gw_sel_class
|
local gw_sel_class
|
||||||
if site.mesh and site.mesh.batman_adv then
|
if site.mesh and site.mesh.batman_adv then
|
||||||
gw_sel_class = site.mesh.batman_adv.gw_sel_class
|
gw_sel_class = site.mesh.batman_adv.gw_sel_class
|
||||||
end
|
end
|
||||||
|
|
||||||
uci:delete('batman-adv', 'bat0')
|
uci:delete('batman-adv', 'bat0')
|
||||||
uci:section('batman-adv', 'mesh', 'bat0',
|
uci:section('batman-adv', 'mesh', 'bat0',
|
||||||
{
|
{
|
||||||
orig_interval = 5000,
|
orig_interval = 5000,
|
||||||
gw_mode = 'client',
|
gw_mode = 'client',
|
||||||
gw_sel_class = gw_sel_class,
|
gw_sel_class = gw_sel_class,
|
||||||
hop_penalty = 15,
|
hop_penalty = 15,
|
||||||
multicast_mode = 0,
|
multicast_mode = 0,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
uci:save('batman-adv')
|
uci:save('batman-adv')
|
||||||
|
|
||||||
|
|
||||||
uci:add_to_set('network', 'client', 'ifname', 'bat0')
|
|
||||||
|
|
||||||
uci:set('network', 'client', 'proto', 'dhcpv6')
|
|
||||||
uci:set('network', 'client', 'reqprefix', 'no')
|
|
||||||
uci:delete('network', 'client', 'igmp_snooping')
|
|
||||||
uci:set('network', 'client', 'robustness', 3)
|
|
||||||
uci:set('network', 'client', 'query_interval', 2000)
|
|
||||||
uci:set('network', 'client', 'query_response_interval', 500)
|
|
||||||
uci:set('network', 'client', 'peerdns', 1)
|
|
||||||
uci:set('network', 'client', 'sourcefilter', 0)
|
|
||||||
|
|
||||||
uci:delete('network', 'bat0')
|
uci:delete('network', 'bat0')
|
||||||
uci:section('network', 'interface', 'bat0',
|
uci:section('network', 'interface', 'bat0',
|
||||||
{
|
{
|
||||||
ifname = 'bat0',
|
ifname = 'bat0',
|
||||||
proto = 'none',
|
proto = 'none',
|
||||||
macaddr = sysconfig.primary_mac,
|
macaddr = sysconfig.primary_mac,
|
||||||
multicast_router = 2,
|
multicast_router = 2,
|
||||||
learning = 0,
|
learning = 0,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
uci:delete('network', 'client_lan')
|
local interfaces = uci:get_list('network', 'client', 'ifname')
|
||||||
if sysconfig.lan_ifname then
|
util.add_to_set(interfaces, 'bat0')
|
||||||
uci:section('network', 'interface', 'client_lan',
|
uci:set_list('network', 'client', 'ifname', interfaces)
|
||||||
{
|
|
||||||
unicast_flood = 0,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
uci:set('network', 'client_lan', 'ifname', sysconfig.lan_ifname)
|
|
||||||
end
|
|
||||||
|
|
||||||
uci:save('network')
|
uci:save('network')
|
||||||
|
|
||||||
|
|
||||||
uci:delete('firewall', 'client')
|
|
||||||
uci:section('firewall', 'zone', 'client',
|
|
||||||
{
|
|
||||||
name = 'client',
|
|
||||||
network = {'client'},
|
|
||||||
input = 'ACCEPT',
|
|
||||||
output = 'ACCEPT',
|
|
||||||
forward = 'REJECT',
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
uci:section('firewall', 'rule', 'client_dns',
|
|
||||||
{
|
|
||||||
name = 'client_dns',
|
|
||||||
src = 'client',
|
|
||||||
dest_port = '53',
|
|
||||||
target = 'REJECT',
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
uci:save('firewall')
|
|
||||||
|
|
||||||
|
|
||||||
local dnsmasq = uci:get_first('dhcp', 'dnsmasq')
|
|
||||||
uci:set('dhcp', dnsmasq, 'boguspriv', 0)
|
|
||||||
uci:set('dhcp', dnsmasq, 'localise_queries', 0)
|
|
||||||
uci:set('dhcp', dnsmasq, 'rebind_protection', 0)
|
|
||||||
|
|
||||||
uci:delete('dhcp', 'client')
|
|
||||||
uci:section('dhcp', 'dhcp', 'client',
|
|
||||||
{
|
|
||||||
interface = 'client',
|
|
||||||
ignore = 1,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
uci:save('dhcp')
|
|
||||||
|
|
||||||
|
|
||||||
sysctl.set('net.ipv6.conf.br-client.forwarding', 0)
|
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
#!/usr/bin/lua
|
||||||
|
|
||||||
|
local sysconfig = require 'gluon.sysconfig'
|
||||||
|
local sysctl = require 'gluon.sysctl'
|
||||||
|
|
||||||
|
local uci = require('luci.model.uci').cursor()
|
||||||
|
|
||||||
|
uci:section('network', 'interface', 'client',
|
||||||
|
{
|
||||||
|
robustness = 3,
|
||||||
|
query_interval = 2000,
|
||||||
|
query_response_interval = 500,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
uci:delete('network', 'client', 'igmp_snooping')
|
||||||
|
|
||||||
|
uci:delete('network', 'client_lan')
|
||||||
|
if sysconfig.lan_ifname then
|
||||||
|
uci:section('network', 'interface', 'client_lan',
|
||||||
|
{
|
||||||
|
unicast_flood = 0,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
uci:set('network', 'client_lan', 'ifname', sysconfig.lan_ifname)
|
||||||
|
end
|
||||||
|
|
||||||
|
uci:save('network')
|
||||||
|
|
||||||
|
|
||||||
|
uci:delete('firewall', 'client')
|
||||||
|
uci:section('firewall', 'zone', 'client',
|
||||||
|
{
|
||||||
|
name = 'client',
|
||||||
|
network = {'client'},
|
||||||
|
input = 'ACCEPT',
|
||||||
|
output = 'ACCEPT',
|
||||||
|
forward = 'REJECT',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
uci:delete('firewall', 'client_dns')
|
||||||
|
|
||||||
|
uci:save('firewall')
|
||||||
|
|
||||||
|
sysctl.set('net.ipv6.conf.br-client.forwarding')
|
@ -0,0 +1,82 @@
|
|||||||
|
#!/usr/bin/lua
|
||||||
|
|
||||||
|
local site = require 'gluon.site_config'
|
||||||
|
local sysconfig = require 'gluon.sysconfig'
|
||||||
|
local sysctl = require 'gluon.sysctl'
|
||||||
|
|
||||||
|
local uci = require('luci.model.uci').cursor()
|
||||||
|
|
||||||
|
|
||||||
|
uci:delete('network', 'local_node_dev')
|
||||||
|
uci:section('network', 'device', 'local_node_dev',
|
||||||
|
{
|
||||||
|
name = 'local-node',
|
||||||
|
ifname = 'br-client',
|
||||||
|
type = 'macvlan',
|
||||||
|
macaddr = sysconfig.primary_mac,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
uci:delete('network', 'local_node')
|
||||||
|
uci:section('network', 'interface', 'local_node',
|
||||||
|
{
|
||||||
|
ifname = 'local-node',
|
||||||
|
proto = 'dhcpv6',
|
||||||
|
reqprefix = 'no',
|
||||||
|
peerdns = 1,
|
||||||
|
sourcefilter = 0,
|
||||||
|
keep_ra_dnslifetime = 1,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if site.dns and site.dns.servers then
|
||||||
|
uci:set('network', 'local-node', 'peerdns','0')
|
||||||
|
end
|
||||||
|
|
||||||
|
uci:delete('network', 'local_node_route6')
|
||||||
|
uci:section('network', 'route6', 'local_node_route6',
|
||||||
|
{
|
||||||
|
interface = 'local-node',
|
||||||
|
target = site.prefix6,
|
||||||
|
gateway = '::',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
uci:save('network')
|
||||||
|
|
||||||
|
|
||||||
|
uci:delete('firewall', 'local_node')
|
||||||
|
uci:section('firewall', 'zone', 'local_node',
|
||||||
|
{
|
||||||
|
name = 'local_node',
|
||||||
|
network = {'local_node'},
|
||||||
|
input = 'ACCEPT',
|
||||||
|
output = 'ACCEPT',
|
||||||
|
forward = 'REJECT',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
uci:section('firewall', 'rule', 'local_node_dns',
|
||||||
|
{
|
||||||
|
name = 'local_node_dns',
|
||||||
|
src = 'local_node',
|
||||||
|
dest_port = '53',
|
||||||
|
target = 'REJECT',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
uci:save('firewall')
|
||||||
|
|
||||||
|
|
||||||
|
uci:delete('dhcp', 'local_node')
|
||||||
|
uci:section('dhcp', 'dhcp', 'local_node',
|
||||||
|
{
|
||||||
|
interface = 'local_node',
|
||||||
|
ignore = 1,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
uci:save('dhcp')
|
||||||
|
|
||||||
|
|
||||||
|
sysctl.set('net.ipv6.conf.local_node.forwarding', 0)
|
@ -2,5 +2,23 @@ all: respondd.so
|
|||||||
|
|
||||||
CFLAGS += -Wall
|
CFLAGS += -Wall
|
||||||
|
|
||||||
respondd.so: respondd.c
|
ifeq ($(origin PKG_CONFIG), undefined)
|
||||||
|
PKG_CONFIG = pkg-config
|
||||||
|
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
|
||||||
|
$(error $(PKG_CONFIG) not found)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(origin LIBNL_CFLAGS) $(origin LIBNL_LDLIBS), undefined undefined)
|
||||||
|
LIBNL_NAME ?= libnl-tiny
|
||||||
|
ifeq ($(shell $(PKG_CONFIG) --modversion $(LIBNL_NAME) 2>/dev/null),)
|
||||||
|
$(error No $(LIBNL_NAME) development libraries found!)
|
||||||
|
endif
|
||||||
|
LIBNL_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(LIBNL_NAME))
|
||||||
|
LIBNL_LDLIBS += $(shell $(PKG_CONFIG) --libs $(LIBNL_NAME))
|
||||||
|
endif
|
||||||
|
CFLAGS += $(LIBNL_CFLAGS)
|
||||||
|
LDLIBS += $(LIBNL_LDLIBS)
|
||||||
|
|
||||||
|
respondd.so: respondd.c batadv-netlink.c
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -D_GNU_SOURCE -o $@ $^ $(LDLIBS) -lgluonutil -liwinfo -luci
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -D_GNU_SOURCE -o $@ $^ $(LDLIBS) -lgluonutil -liwinfo -luci
|
||||||
|
149
package/gluon-mesh-batman-adv-core/src/batadv-netlink.c
Normal file
149
package/gluon-mesh-batman-adv-core/src/batadv-netlink.c
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2009-2016 B.A.T.M.A.N. contributors:
|
||||||
|
*
|
||||||
|
* Marek Lindner <mareklindner@neomailbox.ch>, Andrew Lunn <andrew@lunn.ch>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of version 2 of the GNU General Public
|
||||||
|
* License as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
* 02110-1301, USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "batadv-netlink.h"
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <net/ethernet.h>
|
||||||
|
#include <net/if.h>
|
||||||
|
#include <netlink/netlink.h>
|
||||||
|
#include <netlink/genl/genl.h>
|
||||||
|
#include <netlink/genl/ctrl.h>
|
||||||
|
#include <net/ethernet.h>
|
||||||
|
|
||||||
|
#include "batman_adv.h"
|
||||||
|
|
||||||
|
#ifndef __maybe_unused
|
||||||
|
#define __maybe_unused __attribute__((unused))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct nla_policy batadv_netlink_policy[NUM_BATADV_ATTR] = {
|
||||||
|
[BATADV_ATTR_HARD_IFINDEX] = { .type = NLA_U32 },
|
||||||
|
[BATADV_ATTR_ORIG_ADDRESS] = { .type = NLA_UNSPEC,
|
||||||
|
.minlen = ETH_ALEN,
|
||||||
|
.maxlen = ETH_ALEN },
|
||||||
|
[BATADV_ATTR_TT_FLAGS] = { .type = NLA_U32 },
|
||||||
|
[BATADV_ATTR_FLAG_BEST] = { .type = NLA_FLAG },
|
||||||
|
[BATADV_ATTR_LAST_SEEN_MSECS] = { .type = NLA_U32 },
|
||||||
|
[BATADV_ATTR_NEIGH_ADDRESS] = { .type = NLA_UNSPEC,
|
||||||
|
.minlen = ETH_ALEN,
|
||||||
|
.maxlen = ETH_ALEN },
|
||||||
|
[BATADV_ATTR_TQ] = { .type = NLA_U8 },
|
||||||
|
[BATADV_ATTR_ROUTER] = { .type = NLA_UNSPEC,
|
||||||
|
.minlen = ETH_ALEN,
|
||||||
|
.maxlen = ETH_ALEN },
|
||||||
|
};
|
||||||
|
|
||||||
|
static int nlquery_error_cb(struct sockaddr_nl *nla __maybe_unused,
|
||||||
|
struct nlmsgerr *nlerr, void *arg)
|
||||||
|
{
|
||||||
|
struct batadv_nlquery_opts *query_opts = arg;
|
||||||
|
|
||||||
|
query_opts->err = nlerr->error;
|
||||||
|
|
||||||
|
return NL_STOP;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int nlquery_stop_cb(struct nl_msg *msg, void *arg)
|
||||||
|
{
|
||||||
|
struct nlmsghdr *nlh = nlmsg_hdr(msg);
|
||||||
|
struct batadv_nlquery_opts *query_opts = arg;
|
||||||
|
int *error = nlmsg_data(nlh);
|
||||||
|
|
||||||
|
if (*error)
|
||||||
|
query_opts->err = *error;
|
||||||
|
|
||||||
|
return NL_STOP;
|
||||||
|
}
|
||||||
|
|
||||||
|
int batadv_nl_query_common(const char *mesh_iface,
|
||||||
|
enum batadv_nl_commands nl_cmd,
|
||||||
|
nl_recvmsg_msg_cb_t callback, int flags,
|
||||||
|
struct batadv_nlquery_opts *query_opts)
|
||||||
|
{
|
||||||
|
struct nl_sock *sock;
|
||||||
|
struct nl_msg *msg;
|
||||||
|
struct nl_cb *cb;
|
||||||
|
int ifindex;
|
||||||
|
int family;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
query_opts->err = 0;
|
||||||
|
|
||||||
|
sock = nl_socket_alloc();
|
||||||
|
if (!sock)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
ret = genl_connect(sock);
|
||||||
|
if (ret < 0) {
|
||||||
|
query_opts->err = ret;
|
||||||
|
goto err_free_sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
family = genl_ctrl_resolve(sock, BATADV_NL_NAME);
|
||||||
|
if (family < 0) {
|
||||||
|
query_opts->err = -EOPNOTSUPP;
|
||||||
|
goto err_free_sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
ifindex = if_nametoindex(mesh_iface);
|
||||||
|
if (!ifindex) {
|
||||||
|
query_opts->err = -ENODEV;
|
||||||
|
goto err_free_sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
cb = nl_cb_alloc(NL_CB_DEFAULT);
|
||||||
|
if (!cb) {
|
||||||
|
query_opts->err = -ENOMEM;
|
||||||
|
goto err_free_sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, callback, query_opts);
|
||||||
|
nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, nlquery_stop_cb, query_opts);
|
||||||
|
nl_cb_err(cb, NL_CB_CUSTOM, nlquery_error_cb, query_opts);
|
||||||
|
|
||||||
|
msg = nlmsg_alloc();
|
||||||
|
if (!msg) {
|
||||||
|
query_opts->err = -ENOMEM;
|
||||||
|
goto err_free_cb;
|
||||||
|
}
|
||||||
|
|
||||||
|
genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, family, 0, flags,
|
||||||
|
nl_cmd, 1);
|
||||||
|
|
||||||
|
nla_put_u32(msg, BATADV_ATTR_MESH_IFINDEX, ifindex);
|
||||||
|
nl_send_auto_complete(sock, msg);
|
||||||
|
nlmsg_free(msg);
|
||||||
|
|
||||||
|
nl_recvmsgs(sock, cb);
|
||||||
|
|
||||||
|
err_free_cb:
|
||||||
|
nl_cb_put(cb);
|
||||||
|
err_free_sock:
|
||||||
|
nl_socket_free(sock);
|
||||||
|
|
||||||
|
return query_opts->err;
|
||||||
|
}
|
68
package/gluon-mesh-batman-adv-core/src/batadv-netlink.h
Normal file
68
package/gluon-mesh-batman-adv-core/src/batadv-netlink.h
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2009-2016 B.A.T.M.A.N. contributors:
|
||||||
|
*
|
||||||
|
* Marek Lindner <mareklindner@neomailbox.ch>, Andrew Lunn <andrew@lunn.ch>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of version 2 of the GNU General Public
|
||||||
|
* License as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
* 02110-1301, USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _BATADV_NETLINK_H
|
||||||
|
#define _BATADV_NETLINK_H
|
||||||
|
|
||||||
|
#include <netlink/netlink.h>
|
||||||
|
#include <netlink/genl/genl.h>
|
||||||
|
#include <netlink/genl/ctrl.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#include "batman_adv.h"
|
||||||
|
|
||||||
|
struct batadv_nlquery_opts {
|
||||||
|
int err;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifndef ARRAY_SIZE
|
||||||
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef container_of
|
||||||
|
#define container_of(ptr, type, member) __extension__ ({ \
|
||||||
|
const __typeof__(((type *)0)->member) *__pmember = (ptr); \
|
||||||
|
(type *)((char *)__pmember - offsetof(type, member)); })
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int batadv_nl_query_common(const char *mesh_iface,
|
||||||
|
enum batadv_nl_commands nl_cmd,
|
||||||
|
nl_recvmsg_msg_cb_t callback, int flags,
|
||||||
|
struct batadv_nlquery_opts *query_opts);
|
||||||
|
|
||||||
|
static inline bool batadv_nl_missing_attrs(struct nlattr *attrs[],
|
||||||
|
const enum batadv_nl_attrs mandatory[],
|
||||||
|
size_t num)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for (i = 0; i < num; i++) {
|
||||||
|
if (!attrs[mandatory[i]])
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern struct nla_policy batadv_netlink_policy[];
|
||||||
|
|
||||||
|
#endif /* _BATADV_NETLINK_H */
|
208
package/gluon-mesh-batman-adv-core/src/batman_adv.h
Normal file
208
package/gluon-mesh-batman-adv-core/src/batman_adv.h
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
/* Copyright (C) 2016 B.A.T.M.A.N. contributors:
|
||||||
|
*
|
||||||
|
* Matthias Schiffer
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _UAPI_LINUX_BATMAN_ADV_H_
|
||||||
|
#define _UAPI_LINUX_BATMAN_ADV_H_
|
||||||
|
|
||||||
|
#define BATADV_NL_NAME "batadv"
|
||||||
|
|
||||||
|
#define BATADV_NL_MCAST_GROUP_TPMETER "tpmeter"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enum batadv_tt_client_flags - TT client specific flags
|
||||||
|
* @BATADV_TT_CLIENT_DEL: the client has to be deleted from the table
|
||||||
|
* @BATADV_TT_CLIENT_ROAM: the client roamed to/from another node and the new
|
||||||
|
* update telling its new real location has not been received/sent yet
|
||||||
|
* @BATADV_TT_CLIENT_WIFI: this client is connected through a wifi interface.
|
||||||
|
* This information is used by the "AP Isolation" feature
|
||||||
|
* @BATADV_TT_CLIENT_ISOLA: this client is considered "isolated". This
|
||||||
|
* information is used by the Extended Isolation feature
|
||||||
|
* @BATADV_TT_CLIENT_NOPURGE: this client should never be removed from the table
|
||||||
|
* @BATADV_TT_CLIENT_NEW: this client has been added to the local table but has
|
||||||
|
* not been announced yet
|
||||||
|
* @BATADV_TT_CLIENT_PENDING: this client is marked for removal but it is kept
|
||||||
|
* in the table for one more originator interval for consistency purposes
|
||||||
|
* @BATADV_TT_CLIENT_TEMP: this global client has been detected to be part of
|
||||||
|
* the network but no nnode has already announced it
|
||||||
|
*
|
||||||
|
* Bits from 0 to 7 are called _remote flags_ because they are sent on the wire.
|
||||||
|
* Bits from 8 to 15 are called _local flags_ because they are used for local
|
||||||
|
* computations only.
|
||||||
|
*
|
||||||
|
* Bits from 4 to 7 - a subset of remote flags - are ensured to be in sync with
|
||||||
|
* the other nodes in the network. To achieve this goal these flags are included
|
||||||
|
* in the TT CRC computation.
|
||||||
|
*/
|
||||||
|
enum batadv_tt_client_flags {
|
||||||
|
BATADV_TT_CLIENT_DEL = (1 << 0),
|
||||||
|
BATADV_TT_CLIENT_ROAM = (1 << 1),
|
||||||
|
BATADV_TT_CLIENT_WIFI = (1 << 4),
|
||||||
|
BATADV_TT_CLIENT_ISOLA = (1 << 5),
|
||||||
|
BATADV_TT_CLIENT_NOPURGE = (1 << 8),
|
||||||
|
BATADV_TT_CLIENT_NEW = (1 << 9),
|
||||||
|
BATADV_TT_CLIENT_PENDING = (1 << 10),
|
||||||
|
BATADV_TT_CLIENT_TEMP = (1 << 11),
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enum batadv_nl_attrs - batman-adv netlink attributes
|
||||||
|
*
|
||||||
|
* @BATADV_ATTR_UNSPEC: unspecified attribute to catch errors
|
||||||
|
* @BATADV_ATTR_VERSION: batman-adv version string
|
||||||
|
* @BATADV_ATTR_ALGO_NAME: name of routing algorithm
|
||||||
|
* @BATADV_ATTR_MESH_IFINDEX: index of the batman-adv interface
|
||||||
|
* @BATADV_ATTR_MESH_IFNAME: name of the batman-adv interface
|
||||||
|
* @BATADV_ATTR_MESH_ADDRESS: mac address of the batman-adv interface
|
||||||
|
* @BATADV_ATTR_HARD_IFINDEX: index of the non-batman-adv interface
|
||||||
|
* @BATADV_ATTR_HARD_IFNAME: name of the non-batman-adv interface
|
||||||
|
* @BATADV_ATTR_HARD_ADDRESS: mac address of the non-batman-adv interface
|
||||||
|
* @BATADV_ATTR_ORIG_ADDRESS: originator mac address
|
||||||
|
* @BATADV_ATTR_TPMETER_RESULT: result of run (see batadv_tp_meter_status)
|
||||||
|
* @BATADV_ATTR_TPMETER_TEST_TIME: time (msec) the run took
|
||||||
|
* @BATADV_ATTR_TPMETER_BYTES: amount of acked bytes during run
|
||||||
|
* @BATADV_ATTR_TPMETER_COOKIE: session cookie to match tp_meter session
|
||||||
|
* @BATADV_ATTR_PAD: attribute used for padding for 64-bit alignment
|
||||||
|
* @BATADV_ATTR_ACTIVE: Flag indicating if the hard interface is active
|
||||||
|
* @BATADV_ATTR_TT_ADDRESS: Client MAC address
|
||||||
|
* @BATADV_ATTR_TT_TTVN: Translation table version
|
||||||
|
* @BATADV_ATTR_TT_LAST_TTVN: Previous translation table version
|
||||||
|
* @BATADV_ATTR_TT_CRC32: CRC32 over translation table
|
||||||
|
* @BATADV_ATTR_TT_VID: VLAN ID
|
||||||
|
* @BATADV_ATTR_TT_FLAGS: Translation table client flags
|
||||||
|
* @BATADV_ATTR_FLAG_BEST: Flags indicating entry is the best
|
||||||
|
* @BATADV_ATTR_LAST_SEEN_MSECS: Time in milliseconds since last seen
|
||||||
|
* @BATADV_ATTR_NEIGH_ADDRESS: Neighbour MAC address
|
||||||
|
* @BATADV_ATTR_TQ: TQ to neighbour
|
||||||
|
* @BATADV_ATTR_THROUGHPUT: Estimated throughput to Neighbour
|
||||||
|
* @BATADV_ATTR_BANDWIDTH_UP: Reported uplink bandwidth
|
||||||
|
* @BATADV_ATTR_BANDWIDTH_DOWN: Reported downlink bandwidth
|
||||||
|
* @BATADV_ATTR_ROUTER: Gateway router MAC address
|
||||||
|
* @BATADV_ATTR_BLA_OWN: Flag indicating own originator
|
||||||
|
* @BATADV_ATTR_BLA_ADDRESS: Bridge loop avoidance claim MAC address
|
||||||
|
* @BATADV_ATTR_BLA_VID: BLA VLAN ID
|
||||||
|
* @BATADV_ATTR_BLA_BACKBONE: BLA gateway originator MAC address
|
||||||
|
* @BATADV_ATTR_BLA_CRC: BLA CRC
|
||||||
|
* @__BATADV_ATTR_AFTER_LAST: internal use
|
||||||
|
* @NUM_BATADV_ATTR: total number of batadv_nl_attrs available
|
||||||
|
* @BATADV_ATTR_MAX: highest attribute number currently defined
|
||||||
|
*/
|
||||||
|
enum batadv_nl_attrs {
|
||||||
|
BATADV_ATTR_UNSPEC,
|
||||||
|
BATADV_ATTR_VERSION,
|
||||||
|
BATADV_ATTR_ALGO_NAME,
|
||||||
|
BATADV_ATTR_MESH_IFINDEX,
|
||||||
|
BATADV_ATTR_MESH_IFNAME,
|
||||||
|
BATADV_ATTR_MESH_ADDRESS,
|
||||||
|
BATADV_ATTR_HARD_IFINDEX,
|
||||||
|
BATADV_ATTR_HARD_IFNAME,
|
||||||
|
BATADV_ATTR_HARD_ADDRESS,
|
||||||
|
BATADV_ATTR_ORIG_ADDRESS,
|
||||||
|
BATADV_ATTR_TPMETER_RESULT,
|
||||||
|
BATADV_ATTR_TPMETER_TEST_TIME,
|
||||||
|
BATADV_ATTR_TPMETER_BYTES,
|
||||||
|
BATADV_ATTR_TPMETER_COOKIE,
|
||||||
|
BATADV_ATTR_PAD,
|
||||||
|
BATADV_ATTR_ACTIVE,
|
||||||
|
BATADV_ATTR_TT_ADDRESS,
|
||||||
|
BATADV_ATTR_TT_TTVN,
|
||||||
|
BATADV_ATTR_TT_LAST_TTVN,
|
||||||
|
BATADV_ATTR_TT_CRC32,
|
||||||
|
BATADV_ATTR_TT_VID,
|
||||||
|
BATADV_ATTR_TT_FLAGS,
|
||||||
|
BATADV_ATTR_FLAG_BEST,
|
||||||
|
BATADV_ATTR_LAST_SEEN_MSECS,
|
||||||
|
BATADV_ATTR_NEIGH_ADDRESS,
|
||||||
|
BATADV_ATTR_TQ,
|
||||||
|
BATADV_ATTR_THROUGHPUT,
|
||||||
|
BATADV_ATTR_BANDWIDTH_UP,
|
||||||
|
BATADV_ATTR_BANDWIDTH_DOWN,
|
||||||
|
BATADV_ATTR_ROUTER,
|
||||||
|
BATADV_ATTR_BLA_OWN,
|
||||||
|
BATADV_ATTR_BLA_ADDRESS,
|
||||||
|
BATADV_ATTR_BLA_VID,
|
||||||
|
BATADV_ATTR_BLA_BACKBONE,
|
||||||
|
BATADV_ATTR_BLA_CRC,
|
||||||
|
/* add attributes above here, update the policy in netlink.c */
|
||||||
|
__BATADV_ATTR_AFTER_LAST,
|
||||||
|
NUM_BATADV_ATTR = __BATADV_ATTR_AFTER_LAST,
|
||||||
|
BATADV_ATTR_MAX = __BATADV_ATTR_AFTER_LAST - 1
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enum batadv_nl_commands - supported batman-adv netlink commands
|
||||||
|
*
|
||||||
|
* @BATADV_CMD_UNSPEC: unspecified command to catch errors
|
||||||
|
* @BATADV_CMD_GET_MESH_INFO: Query basic information about batman-adv device
|
||||||
|
* @BATADV_CMD_TP_METER: Start a tp meter session
|
||||||
|
* @BATADV_CMD_TP_METER_CANCEL: Cancel a tp meter session
|
||||||
|
* @BATADV_CMD_GET_ROUTING_ALGOS: Query the list of routing algorithms.
|
||||||
|
* @BATADV_CMD_GET_HARDIFS: Query list of hard interfaces
|
||||||
|
* @BATADV_CMD_GET_TRANSTABLE_LOCAL: Query list of local translations
|
||||||
|
* @BATADV_CMD_GET_TRANSTABLE_GLOBAL Query list of global translations
|
||||||
|
* @BATADV_CMD_GET_ORIGINATORS: Query list of originators
|
||||||
|
* @BATADV_CMD_GET_NEIGHBORS: Query list of neighbours
|
||||||
|
* @BATADV_CMD_GET_GATEWAYS: Query list of gateways
|
||||||
|
* @BATADV_CMD_GET_BLA_CLAIM: Query list of bridge loop avoidance claims
|
||||||
|
* @BATADV_CMD_GET_BLA_BACKBONE: Query list of bridge loop avoidance backbones
|
||||||
|
* @__BATADV_CMD_AFTER_LAST: internal use
|
||||||
|
* @BATADV_CMD_MAX: highest used command number
|
||||||
|
*/
|
||||||
|
enum batadv_nl_commands {
|
||||||
|
BATADV_CMD_UNSPEC,
|
||||||
|
BATADV_CMD_GET_MESH_INFO,
|
||||||
|
BATADV_CMD_TP_METER,
|
||||||
|
BATADV_CMD_TP_METER_CANCEL,
|
||||||
|
BATADV_CMD_GET_ROUTING_ALGOS,
|
||||||
|
BATADV_CMD_GET_HARDIFS,
|
||||||
|
BATADV_CMD_GET_TRANSTABLE_LOCAL,
|
||||||
|
BATADV_CMD_GET_TRANSTABLE_GLOBAL,
|
||||||
|
BATADV_CMD_GET_ORIGINATORS,
|
||||||
|
BATADV_CMD_GET_NEIGHBORS,
|
||||||
|
BATADV_CMD_GET_GATEWAYS,
|
||||||
|
BATADV_CMD_GET_BLA_CLAIM,
|
||||||
|
BATADV_CMD_GET_BLA_BACKBONE,
|
||||||
|
/* add new commands above here */
|
||||||
|
__BATADV_CMD_AFTER_LAST,
|
||||||
|
BATADV_CMD_MAX = __BATADV_CMD_AFTER_LAST - 1
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enum batadv_tp_meter_reason - reason of a tp meter test run stop
|
||||||
|
* @BATADV_TP_REASON_COMPLETE: sender finished tp run
|
||||||
|
* @BATADV_TP_REASON_CANCEL: sender was stopped during run
|
||||||
|
* @BATADV_TP_REASON_DST_UNREACHABLE: receiver could not be reached or didn't
|
||||||
|
* answer
|
||||||
|
* @BATADV_TP_REASON_RESEND_LIMIT: (unused) sender retry reached limit
|
||||||
|
* @BATADV_TP_REASON_ALREADY_ONGOING: test to or from the same node already
|
||||||
|
* ongoing
|
||||||
|
* @BATADV_TP_REASON_MEMORY_ERROR: test was stopped due to low memory
|
||||||
|
* @BATADV_TP_REASON_CANT_SEND: failed to send via outgoing interface
|
||||||
|
* @BATADV_TP_REASON_TOO_MANY: too many ongoing sessions
|
||||||
|
*/
|
||||||
|
enum batadv_tp_meter_reason {
|
||||||
|
BATADV_TP_REASON_COMPLETE = 3,
|
||||||
|
BATADV_TP_REASON_CANCEL = 4,
|
||||||
|
/* error status >= 128 */
|
||||||
|
BATADV_TP_REASON_DST_UNREACHABLE = 128,
|
||||||
|
BATADV_TP_REASON_RESEND_LIMIT = 129,
|
||||||
|
BATADV_TP_REASON_ALREADY_ONGOING = 130,
|
||||||
|
BATADV_TP_REASON_MEMORY_ERROR = 131,
|
||||||
|
BATADV_TP_REASON_CANT_SEND = 132,
|
||||||
|
BATADV_TP_REASON_TOO_MANY = 133,
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _UAPI_LINUX_BATMAN_ADV_H_ */
|
@ -51,11 +51,28 @@
|
|||||||
#include <linux/if_addr.h>
|
#include <linux/if_addr.h>
|
||||||
#include <linux/sockios.h>
|
#include <linux/sockios.h>
|
||||||
|
|
||||||
|
#include "batadv-netlink.h"
|
||||||
|
|
||||||
|
|
||||||
#define _STRINGIFY(s) #s
|
#define _STRINGIFY(s) #s
|
||||||
#define STRINGIFY(s) _STRINGIFY(s)
|
#define STRINGIFY(s) _STRINGIFY(s)
|
||||||
|
|
||||||
|
struct neigh_netlink_opts {
|
||||||
|
struct json_object *interfaces;
|
||||||
|
struct batadv_nlquery_opts query_opts;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct gw_netlink_opts {
|
||||||
|
struct json_object *obj;
|
||||||
|
struct batadv_nlquery_opts query_opts;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct clients_netlink_opts {
|
||||||
|
size_t total;
|
||||||
|
size_t wifi;
|
||||||
|
struct batadv_nlquery_opts query_opts;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
static struct json_object * get_addresses(void) {
|
static struct json_object * get_addresses(void) {
|
||||||
FILE *f = fopen("/proc/net/if_inet6", "r");
|
FILE *f = fopen("/proc/net/if_inet6", "r");
|
||||||
@ -85,7 +102,7 @@ static struct json_object * get_addresses(void) {
|
|||||||
&flags, ifname) != 18)
|
&flags, ifname) != 18)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (strcmp(ifname, "br-client"))
|
if (strcmp(ifname, "local-node"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (flags & (IFA_F_TENTATIVE|IFA_F_DEPRECATED))
|
if (flags & (IFA_F_TENTATIVE|IFA_F_DEPRECATED))
|
||||||
@ -121,9 +138,31 @@ static void mesh_add_subif(const char *ifname, struct json_object *wireless,
|
|||||||
struct json_object *tunnel, struct json_object *other) {
|
struct json_object *tunnel, struct json_object *other) {
|
||||||
struct json_object *address = gluonutil_wrap_and_free_string(gluonutil_get_interface_address(ifname));
|
struct json_object *address = gluonutil_wrap_and_free_string(gluonutil_get_interface_address(ifname));
|
||||||
|
|
||||||
if (interface_file_exists(ifname, "wireless"))
|
char lowername[IFNAMSIZ];
|
||||||
|
strncpy(lowername, ifname, sizeof(lowername)-1);
|
||||||
|
lowername[sizeof(lowername)-1] = 0;
|
||||||
|
|
||||||
|
const char *format = "/sys/class/net/%s/lower_*";
|
||||||
|
char pattern[strlen(format) + IFNAMSIZ];
|
||||||
|
|
||||||
|
/* In case of VLAN and bridge interfaces, we want the lower interface
|
||||||
|
* to determine the interface type (but not for the interface address) */
|
||||||
|
while (true) {
|
||||||
|
snprintf(pattern, sizeof(pattern), format, lowername);
|
||||||
|
size_t pattern_len = strlen(pattern);
|
||||||
|
|
||||||
|
glob_t lower;
|
||||||
|
if (glob(pattern, GLOB_NOSORT, NULL, &lower))
|
||||||
|
break;
|
||||||
|
|
||||||
|
strncpy(lowername, lower.gl_pathv[0] + pattern_len - 1, sizeof(lowername)-1);
|
||||||
|
|
||||||
|
globfree(&lower);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (interface_file_exists(lowername, "wireless"))
|
||||||
json_object_array_add(wireless, address);
|
json_object_array_add(wireless, address);
|
||||||
else if (interface_file_exists(ifname, "tun_flags"))
|
else if (interface_file_exists(lowername, "tun_flags"))
|
||||||
json_object_array_add(tunnel, address);
|
json_object_array_add(tunnel, address);
|
||||||
else
|
else
|
||||||
json_object_array_add(other, address);
|
json_object_array_add(other, address);
|
||||||
@ -201,29 +240,70 @@ static struct json_object * respondd_provider_nodeinfo(void) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const enum batadv_nl_attrs gateways_mandatory[] = {
|
||||||
|
BATADV_ATTR_ORIG_ADDRESS,
|
||||||
|
BATADV_ATTR_ROUTER,
|
||||||
|
};
|
||||||
|
|
||||||
|
static int parse_gw_list_netlink_cb(struct nl_msg *msg, void *arg)
|
||||||
|
{
|
||||||
|
struct nlattr *attrs[BATADV_ATTR_MAX+1];
|
||||||
|
struct nlmsghdr *nlh = nlmsg_hdr(msg);
|
||||||
|
struct batadv_nlquery_opts *query_opts = arg;
|
||||||
|
struct genlmsghdr *ghdr;
|
||||||
|
uint8_t *orig;
|
||||||
|
uint8_t *router;
|
||||||
|
struct gw_netlink_opts *opts;
|
||||||
|
char addr[18];
|
||||||
|
|
||||||
|
opts = container_of(query_opts, struct gw_netlink_opts, query_opts);
|
||||||
|
|
||||||
|
if (!genlmsg_valid_hdr(nlh, 0))
|
||||||
|
return NL_OK;
|
||||||
|
|
||||||
|
ghdr = nlmsg_data(nlh);
|
||||||
|
|
||||||
|
if (ghdr->cmd != BATADV_CMD_GET_GATEWAYS)
|
||||||
|
return NL_OK;
|
||||||
|
|
||||||
|
if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
|
||||||
|
genlmsg_len(ghdr), batadv_netlink_policy))
|
||||||
|
return NL_OK;
|
||||||
|
|
||||||
|
if (batadv_nl_missing_attrs(attrs, gateways_mandatory,
|
||||||
|
ARRAY_SIZE(gateways_mandatory)))
|
||||||
|
return NL_OK;
|
||||||
|
|
||||||
|
if (!attrs[BATADV_ATTR_FLAG_BEST])
|
||||||
|
return NL_OK;
|
||||||
|
|
||||||
|
orig = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]);
|
||||||
|
router = nla_data(attrs[BATADV_ATTR_ROUTER]);
|
||||||
|
|
||||||
|
sprintf(addr, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||||
|
orig[0], orig[1], orig[2], orig[3], orig[4], orig[5]);
|
||||||
|
|
||||||
|
json_object_object_add(opts->obj, "gateway", json_object_new_string(addr));
|
||||||
|
|
||||||
|
sprintf(addr, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||||
|
router[0], router[1], router[2], router[3], router[4], router[5]);
|
||||||
|
|
||||||
|
json_object_object_add(opts->obj, "gateway_nexthop", json_object_new_string(addr));
|
||||||
|
|
||||||
|
return NL_STOP;
|
||||||
|
}
|
||||||
|
|
||||||
static void add_gateway(struct json_object *obj) {
|
static void add_gateway(struct json_object *obj) {
|
||||||
FILE *f = fopen("/sys/kernel/debug/batman_adv/bat0/gateways", "r");
|
struct gw_netlink_opts opts = {
|
||||||
if (!f)
|
.obj = obj,
|
||||||
return;
|
.query_opts = {
|
||||||
|
.err = 0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
char *line = NULL;
|
batadv_nl_query_common("bat0", BATADV_CMD_GET_GATEWAYS,
|
||||||
size_t len = 0;
|
parse_gw_list_netlink_cb, NLM_F_DUMP,
|
||||||
|
&opts.query_opts);
|
||||||
while (getline(&line, &len, f) >= 0) {
|
|
||||||
char addr[18];
|
|
||||||
char nexthop[18];
|
|
||||||
|
|
||||||
if (sscanf(line, "=> %17[0-9a-fA-F:] ( %*u) %17[0-9a-fA-F:]", addr, nexthop) != 2)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
json_object_object_add(obj, "gateway", json_object_new_string(addr));
|
|
||||||
json_object_object_add(obj, "gateway_nexthop", json_object_new_string(nexthop));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
free(line);
|
|
||||||
fclose(f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool ethtool_ioctl(int fd, struct ifreq *ifr, void *data) {
|
static inline bool ethtool_ioctl(int fd, struct ifreq *ifr, void *data) {
|
||||||
@ -399,39 +479,69 @@ static void count_stations(size_t *wifi24, size_t *wifi5) {
|
|||||||
uci_free_context(ctx);
|
uci_free_context(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const enum batadv_nl_attrs clients_mandatory[] = {
|
||||||
|
BATADV_ATTR_TT_FLAGS,
|
||||||
|
};
|
||||||
|
|
||||||
|
static int parse_clients_list_netlink_cb(struct nl_msg *msg, void *arg)
|
||||||
|
{
|
||||||
|
struct nlattr *attrs[BATADV_ATTR_MAX+1];
|
||||||
|
struct nlmsghdr *nlh = nlmsg_hdr(msg);
|
||||||
|
struct batadv_nlquery_opts *query_opts = arg;
|
||||||
|
struct genlmsghdr *ghdr;
|
||||||
|
struct clients_netlink_opts *opts;
|
||||||
|
uint32_t flags;
|
||||||
|
|
||||||
|
opts = container_of(query_opts, struct clients_netlink_opts, query_opts);
|
||||||
|
|
||||||
|
if (!genlmsg_valid_hdr(nlh, 0))
|
||||||
|
return NL_OK;
|
||||||
|
|
||||||
|
ghdr = nlmsg_data(nlh);
|
||||||
|
|
||||||
|
if (ghdr->cmd != BATADV_CMD_GET_TRANSTABLE_LOCAL)
|
||||||
|
return NL_OK;
|
||||||
|
|
||||||
|
if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
|
||||||
|
genlmsg_len(ghdr), batadv_netlink_policy))
|
||||||
|
return NL_OK;
|
||||||
|
|
||||||
|
if (batadv_nl_missing_attrs(attrs, clients_mandatory,
|
||||||
|
ARRAY_SIZE(clients_mandatory)))
|
||||||
|
return NL_OK;
|
||||||
|
|
||||||
|
flags = nla_get_u32(attrs[BATADV_ATTR_TT_FLAGS]);
|
||||||
|
|
||||||
|
if (flags & BATADV_TT_CLIENT_NOPURGE)
|
||||||
|
return NL_OK;
|
||||||
|
|
||||||
|
if (flags & BATADV_TT_CLIENT_WIFI)
|
||||||
|
opts->wifi++;
|
||||||
|
|
||||||
|
opts->total++;
|
||||||
|
|
||||||
|
return NL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static struct json_object * get_clients(void) {
|
static struct json_object * get_clients(void) {
|
||||||
size_t total = 0, wifi = 0, wifi24 = 0, wifi5 = 0;
|
size_t wifi24 = 0, wifi5 = 0;
|
||||||
|
struct clients_netlink_opts opts = {
|
||||||
|
.total = 0,
|
||||||
|
.wifi = 0,
|
||||||
|
.query_opts = {
|
||||||
|
.err = 0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
FILE *f = fopen("/sys/kernel/debug/batman_adv/bat0/transtable_local", "r");
|
batadv_nl_query_common("bat0", BATADV_CMD_GET_TRANSTABLE_LOCAL,
|
||||||
if (!f)
|
parse_clients_list_netlink_cb, NLM_F_DUMP,
|
||||||
return NULL;
|
&opts.query_opts);
|
||||||
|
|
||||||
char *line = NULL;
|
|
||||||
size_t len = 0;
|
|
||||||
|
|
||||||
while (getline(&line, &len, f) >= 0) {
|
|
||||||
char flags[16];
|
|
||||||
|
|
||||||
if (sscanf(line, " * %*[^[] [%15[^]]]", flags) != 1)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (strchr(flags, 'P'))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
total++;
|
|
||||||
|
|
||||||
if (strchr(flags, 'W'))
|
|
||||||
wifi++;
|
|
||||||
}
|
|
||||||
|
|
||||||
free(line);
|
|
||||||
fclose(f);
|
|
||||||
|
|
||||||
count_stations(&wifi24, &wifi5);
|
count_stations(&wifi24, &wifi5);
|
||||||
|
|
||||||
struct json_object *ret = json_object_new_object();
|
struct json_object *ret = json_object_new_object();
|
||||||
json_object_object_add(ret, "total", json_object_new_int(total));
|
json_object_object_add(ret, "total", json_object_new_int(opts.total));
|
||||||
json_object_object_add(ret, "wifi", json_object_new_int(wifi));
|
json_object_object_add(ret, "wifi", json_object_new_int(opts.wifi));
|
||||||
json_object_object_add(ret, "wifi24", json_object_new_int(wifi24));
|
json_object_object_add(ret, "wifi24", json_object_new_int(wifi24));
|
||||||
json_object_object_add(ret, "wifi5", json_object_new_int(wifi5));
|
json_object_object_add(ret, "wifi5", json_object_new_int(wifi5));
|
||||||
return ret;
|
return ret;
|
||||||
@ -470,49 +580,104 @@ static struct json_object * ifnames2addrs(struct json_object *interfaces) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct json_object * get_batadv(void) {
|
static const enum batadv_nl_attrs parse_orig_list_mandatory[] = {
|
||||||
FILE *f = fopen("/sys/kernel/debug/batman_adv/bat0/originators", "r");
|
BATADV_ATTR_ORIG_ADDRESS,
|
||||||
if (!f)
|
BATADV_ATTR_NEIGH_ADDRESS,
|
||||||
return NULL;
|
BATADV_ATTR_TQ,
|
||||||
|
BATADV_ATTR_HARD_IFINDEX,
|
||||||
|
BATADV_ATTR_LAST_SEEN_MSECS,
|
||||||
|
};
|
||||||
|
|
||||||
char *line = NULL;
|
static int parse_orig_list_netlink_cb(struct nl_msg *msg, void *arg)
|
||||||
size_t len = 0;
|
{
|
||||||
|
struct nlattr *attrs[BATADV_ATTR_MAX+1];
|
||||||
|
struct nlmsghdr *nlh = nlmsg_hdr(msg);
|
||||||
|
struct batadv_nlquery_opts *query_opts = arg;
|
||||||
|
struct genlmsghdr *ghdr;
|
||||||
|
uint8_t *orig;
|
||||||
|
uint8_t *dest;
|
||||||
|
uint8_t tq;
|
||||||
|
uint32_t hardif;
|
||||||
|
uint32_t lastseen;
|
||||||
|
char ifname_buf[IF_NAMESIZE], *ifname;
|
||||||
|
struct neigh_netlink_opts *opts;
|
||||||
|
char mac1[18];
|
||||||
|
|
||||||
struct json_object *interfaces = json_object_new_object();
|
opts = container_of(query_opts, struct neigh_netlink_opts, query_opts);
|
||||||
|
|
||||||
while (getline(&line, &len, f) >= 0) {
|
if (!genlmsg_valid_hdr(nlh, 0))
|
||||||
char mac1[18], mac2[18];
|
return NL_OK;
|
||||||
/* IF_NAMESIZE would be enough, but adding 1 here is simpler than subtracting 1 in the format string */
|
|
||||||
char ifname[IF_NAMESIZE+1];
|
|
||||||
double lastseen;
|
|
||||||
int tq;
|
|
||||||
|
|
||||||
if (sscanf(line,
|
ghdr = nlmsg_data(nlh);
|
||||||
"%17[0-9a-fA-F:] %lfs ( %i ) %17[0-9a-fA-F:] [ %"STRINGIFY(IF_NAMESIZE)"[^]] ]",
|
|
||||||
mac1, &lastseen, &tq, mac2, ifname) != 5)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (strcmp(mac1, mac2))
|
if (ghdr->cmd != BATADV_CMD_GET_ORIGINATORS)
|
||||||
continue;
|
return NL_OK;
|
||||||
|
|
||||||
struct json_object *interface;
|
if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
|
||||||
if (!json_object_object_get_ex(interfaces, ifname, &interface)) {
|
genlmsg_len(ghdr), batadv_netlink_policy))
|
||||||
interface = json_object_new_object();
|
return NL_OK;
|
||||||
json_object_object_add(interfaces, ifname, interface);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct json_object *obj = json_object_new_object();
|
if (batadv_nl_missing_attrs(attrs, parse_orig_list_mandatory,
|
||||||
json_object_object_add(obj, "tq", json_object_new_int(tq));
|
ARRAY_SIZE(parse_orig_list_mandatory)))
|
||||||
struct json_object *jso = json_object_new_double(lastseen);
|
return NL_OK;
|
||||||
json_object_set_serializer(jso, json_object_double_to_json_string, "%.3f", NULL);
|
|
||||||
json_object_object_add(obj, "lastseen", jso);
|
if (!attrs[BATADV_ATTR_FLAG_BEST])
|
||||||
json_object_object_add(interface, mac1, obj);
|
return NL_OK;
|
||||||
|
|
||||||
|
orig = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]);
|
||||||
|
dest = nla_data(attrs[BATADV_ATTR_NEIGH_ADDRESS]);
|
||||||
|
tq = nla_get_u8(attrs[BATADV_ATTR_TQ]);
|
||||||
|
hardif = nla_get_u32(attrs[BATADV_ATTR_HARD_IFINDEX]);
|
||||||
|
lastseen = nla_get_u32(attrs[BATADV_ATTR_LAST_SEEN_MSECS]);
|
||||||
|
|
||||||
|
if (memcmp(orig, dest, 6) != 0)
|
||||||
|
return NL_OK;
|
||||||
|
|
||||||
|
ifname = if_indextoname(hardif, ifname_buf);
|
||||||
|
if (!ifname)
|
||||||
|
return NL_OK;
|
||||||
|
|
||||||
|
sprintf(mac1, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||||
|
orig[0], orig[1], orig[2], orig[3], orig[4], orig[5]);
|
||||||
|
|
||||||
|
struct json_object *obj = json_object_new_object();
|
||||||
|
if (!obj)
|
||||||
|
return NL_OK;
|
||||||
|
|
||||||
|
struct json_object *interface;
|
||||||
|
if (!json_object_object_get_ex(opts->interfaces, ifname, &interface)) {
|
||||||
|
interface = json_object_new_object();
|
||||||
|
json_object_object_add(opts->interfaces, ifname, interface);
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(f);
|
json_object_object_add(obj, "tq", json_object_new_int(tq));
|
||||||
free(line);
|
json_object_object_add(obj, "lastseen", json_object_new_double(lastseen / 1000.));
|
||||||
|
json_object_object_add(interface, mac1, obj);
|
||||||
|
|
||||||
return ifnames2addrs(interfaces);
|
return NL_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct json_object * get_batadv(void) {
|
||||||
|
struct neigh_netlink_opts opts = {
|
||||||
|
.query_opts = {
|
||||||
|
.err = 0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
opts.interfaces = json_object_new_object();
|
||||||
|
if (!opts.interfaces)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
ret = batadv_nl_query_common("bat0", BATADV_CMD_GET_ORIGINATORS,
|
||||||
|
parse_orig_list_netlink_cb, NLM_F_DUMP,
|
||||||
|
&opts.query_opts);
|
||||||
|
if (ret < 0) {
|
||||||
|
json_object_put(opts.interfaces);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ifnames2addrs(opts.interfaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct json_object * get_wifi_neighbours(const char *ifname) {
|
static struct json_object * get_wifi_neighbours(const char *ifname) {
|
||||||
|
@ -6,7 +6,7 @@ PKG_VERSION:=3
|
|||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
PKG_BUILD_DEPENDS := respondd
|
PKG_BUILD_DEPENDS := respondd
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
|
|
||||||
define Package/gluon-mesh-vpn-fastd
|
define Package/gluon-mesh-vpn-fastd
|
||||||
|
@ -3,6 +3,7 @@ need_number('fastd_mesh_vpn.mtu')
|
|||||||
need_boolean('fastd_mesh_vpn.enabled', false)
|
need_boolean('fastd_mesh_vpn.enabled', false)
|
||||||
need_boolean('fastd_mesh_vpn.configurable', false)
|
need_boolean('fastd_mesh_vpn.configurable', false)
|
||||||
|
|
||||||
|
need_one_of('fastd_mesh_vpn.syslog_level', {'error', 'warn', 'info', 'verbose', 'debug', 'debug2'}, false)
|
||||||
|
|
||||||
local function check_peer(prefix)
|
local function check_peer(prefix)
|
||||||
return function(k, _)
|
return function(k, _)
|
||||||
|
@ -20,6 +20,7 @@ if not enabled then
|
|||||||
enabled = site.fastd_mesh_vpn.enabled and 1 or 0
|
enabled = site.fastd_mesh_vpn.enabled and 1 or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local syslog_level = uci:get('fastd', 'mesh_vpn', 'syslog_level') or 'verbose'
|
||||||
|
|
||||||
local methods
|
local methods
|
||||||
|
|
||||||
@ -31,7 +32,6 @@ if site.fastd_mesh_vpn.configurable then
|
|||||||
has_null = lutil.contains(old_methods, 'null')
|
has_null = lutil.contains(old_methods, 'null')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
methods = {}
|
methods = {}
|
||||||
if has_null then
|
if has_null then
|
||||||
table.insert(methods, 'null')
|
table.insert(methods, 'null')
|
||||||
@ -52,7 +52,7 @@ uci:section('fastd', 'fastd', 'mesh_vpn',
|
|||||||
{
|
{
|
||||||
enabled = enabled,
|
enabled = enabled,
|
||||||
group = 'gluon-fastd',
|
group = 'gluon-fastd',
|
||||||
syslog_level = 'verbose',
|
syslog_level = syslog_level,
|
||||||
interface = 'mesh-vpn',
|
interface = 'mesh-vpn',
|
||||||
mode = 'tap',
|
mode = 'tap',
|
||||||
mtu = site.fastd_mesh_vpn.mtu,
|
mtu = site.fastd_mesh_vpn.mtu,
|
||||||
|
@ -6,7 +6,7 @@ PKG_RELEASE:=1
|
|||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
include ../gluon.mk
|
||||||
|
|
||||||
|
|
||||||
define Package/gluon-neighbour-info
|
define Package/gluon-neighbour-info
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
|
||||||
|
|
||||||
PKG_NAME:=gluon-next-node
|
|
||||||
PKG_VERSION:=3
|
|
||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
|
||||||
|
|
||||||
include $(GLUONDIR)/include/package.mk
|
|
||||||
|
|
||||||
|
|
||||||
define Package/gluon-next-node
|
|
||||||
SECTION:=gluon
|
|
||||||
CATEGORY:=Gluon
|
|
||||||
TITLE:=Next-node anycast address
|
|
||||||
DEPENDS:=+gluon-core +gluon-ebtables +gluon-mesh-batman-adv +kmod-macvlan
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/gluon-next-node/description
|
|
||||||
Gluon community wifi mesh firmware framework: next-node anycast address
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/Prepare
|
|
||||||
mkdir -p $(PKG_BUILD_DIR)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/Configure
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/Compile
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/gluon-next-node/install
|
|
||||||
$(CP) ./files/* $(1)/
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/gluon-next-node/postinst
|
|
||||||
#!/bin/sh
|
|
||||||
$(call GluonCheckSite,check_site.lua)
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(call BuildPackage,gluon-next-node))
|
|
@ -1,7 +0,0 @@
|
|||||||
if need_string_match('next_node.ip4', '^%d+.%d+.%d+.%d+$', false) then
|
|
||||||
need_string_match('prefix4', '^%d+.%d+.%d+.%d+/%d+$')
|
|
||||||
end
|
|
||||||
|
|
||||||
need_string_match('next_node.ip6', '^[%x:]+$')
|
|
||||||
|
|
||||||
need_string_match('next_node.mac', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$')
|
|
@ -1,20 +0,0 @@
|
|||||||
local site = require 'gluon.site_config'
|
|
||||||
local next_node = site.next_node
|
|
||||||
|
|
||||||
rule('FORWARD --logical-in br-client -p ARP --arp-ip-src ' .. next_node.ip4 .. ' -j DROP')
|
|
||||||
rule('FORWARD --logical-in br-client -p ARP --arp-ip-dst ' .. next_node.ip4 .. ' -j DROP')
|
|
||||||
|
|
||||||
rule('FORWARD --logical-out br-client -o bat0 -d ' .. next_node.mac .. ' -j DROP')
|
|
||||||
rule('OUTPUT --logical-out br-client -o bat0 -d ' .. next_node.mac .. ' -j DROP')
|
|
||||||
rule('FORWARD --logical-out br-client -o bat0 -s ' .. next_node.mac .. ' -j DROP')
|
|
||||||
rule('OUTPUT --logical-out br-client -o bat0 -s ' .. next_node.mac .. ' -j DROP')
|
|
||||||
|
|
||||||
rule('FORWARD --logical-out br-client -o bat0 -p IPv4 --ip-destination ' .. next_node.ip4 .. ' -j DROP')
|
|
||||||
rule('OUTPUT --logical-out br-client -o bat0 -p IPv4 --ip-destination ' .. next_node.ip4 .. ' -j DROP')
|
|
||||||
rule('FORWARD --logical-out br-client -o bat0 -p IPv4 --ip-source ' .. next_node.ip4 .. ' -j DROP')
|
|
||||||
rule('OUTPUT --logical-out br-client -o bat0 -p IPv4 --ip-source ' .. next_node.ip4 .. ' -j DROP')
|
|
||||||
|
|
||||||
rule('FORWARD --logical-out br-client -o bat0 -p IPv6 --ip6-destination ' .. next_node.ip6 .. ' -j DROP')
|
|
||||||
rule('OUTPUT --logical-out br-client -o bat0 -p IPv6 --ip6-destination ' .. next_node.ip6 .. ' -j DROP')
|
|
||||||
rule('FORWARD --logical-out br-client -o bat0 -p IPv6 --ip6-source ' .. next_node.ip6 .. ' -j DROP')
|
|
||||||
rule('OUTPUT --logical-out br-client -o bat0 -p IPv6 --ip6-source ' .. next_node.ip6 .. ' -j DROP')
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user