diff --git a/.gitignore b/.gitignore
index 7a4602a1..ab2b03cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,6 @@
*~
-/build
-/images
+/lede
+/output
/site
-/openwrt
+/tmp
/packages
-/modules.local
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..1c827fb2
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,53 @@
+Contribution Guidelines
+=======================
+
+Because Gluon is such a universal software package that is used by several
+different communities with different expectations and requirements, it is both
+essential and difficult to have contributions from the communities. While they
+are sometimes necessary to adapt Gluon to the needs of the communities, they
+also have to be adaptable enough to fit as many needs as possible. On the other
+hands, very special needs are better addressed in [packages] in community
+repositories, because the Gluon maintainers would not use or test them and
+thus couldn't do their "job" of maintaining them.
+
+To ease the work for the maintainers and to reduce the frustration of
+contributors, please adhere to the following guidelines:
+
+Discuss first, build later
+--------------------------
+If you have some non-trivial enhancement like a new package, some modification
+of what is announced by a node, it is often best to first discuss the precise
+solution first. The maintainers might have hints as to how a solution could be
+implemented easiest, point out solutions how the same thing can already be done
+using other parts or why the proposed change breaks other parts of the system.
+They might even refuse the idea altogether - after all, they have to sleep well
+after merging the changes, too.
+
+The preferred way to discuss in the IRC channel ([#gluon] on irc.hackint.org)
+or on the [mailing list], however, you can also open a new issue on Github to
+discuss there. We maintain a [list of rejected features] and we'd like to
+kindly ask you to review it first. In general, looking for duplicates may save
+you some time.
+
+Develop on top of master
+------------------------
+If you are not developing something specific to a release (like for example a
+security fix to a feature that got completely rewritten since the release),
+develop it on top of the master branch. New features and even feature changes
+aren't usually backported to old releases, but will be included in the upcoming
+release, which will be built from master.
+
+Use descriptive commit messages
+-------------------------------
+If you modify a single package, start the first line of your commit message
+with the package name followed by a colon. The first line should be enough to
+identify the commit a week later and still know roughly what it did. If you
+fix some bug, detail in the remaining commit message exactly how it could be
+triggered and what you did to fix it. If in question, have a glance at the
+existing commit messages to get the idea.
+
+
+[packages]: http://gluon.readthedocs.org/en/latest/user/site.html#packages
+[#gluon]: https://webirc.hackint.org/#gluon
+[mailing list]: mailto:gluon@luebeck.freifunk.net
+[list of rejected features]: https://github.com/freifunk-gluon/gluon/issues?q=label%3Arejected
diff --git a/LICENSE b/LICENSE
index adc32281..a9adc369 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,7 +1,7 @@
The code of Project Gluon may be distributed under the following terms, unless
-noted otherwise in indiviual files or subtrees.
+noted otherwise in individual files or subtrees.
-Copyright (c) 2013, Project Gluon
+Copyright (c) 2013-2017, Project Gluon
All rights reserved.
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.
-OpenWRT is licensed under the terms of the GNU General Public License Version 2,
-which can be found under openwrt/LICENSE after the openwrt submodule has been
-obtained. This applies to the following submodules:
- * openwrt
+LEDE and OpenWrt are licensed under the terms of the GNU General Public License
+Version 2, which can be found at lede/LICENSE after the lede repository has been
+obtained. This applies to the following repositories:
+ * lede
* packages/openwrt
* packages/routing
* packages/luci
diff --git a/Makefile b/Makefile
index f8a4f85e..fab156c5 100644
--- a/Makefile
+++ b/Makefile
@@ -4,419 +4,155 @@ LC_ALL:=C
LANG:=C
export LC_ALL LANG
-empty:=
-space:= $(empty) $(empty)
-GLUONMAKE_EARLY = $(SUBMAKE) -C $(GLUON_ORIGOPENWRTDIR) -f $(GLUONDIR)/Makefile GLUON_TOOLS=0
-GLUONMAKE = $(SUBMAKE) -C $(GLUON_OPENWRTDIR) -f $(GLUONDIR)/Makefile
+GLUON_SITEDIR ?= $(CURDIR)/site
+GLUON_TMPDIR ?= $(CURDIR)/tmp
-ifneq ($(OPENWRT_BUILD),1)
+GLUON_OUTPUTDIR ?= $(CURDIR)/output
+GLUON_IMAGEDIR ?= $(GLUON_OUTPUTDIR)/images
+GLUON_PACKAGEDIR ?= $(GLUON_OUTPUTDIR)/packages
-GLUONDIR:=${CURDIR}
+export GLUON_TMPDIR GLUON_IMAGEDIR GLUON_PACKAGEDIR DEVICES
-include $(GLUONDIR)/include/gluon.mk
-TOPDIR:=$(GLUON_ORIGOPENWRTDIR)
-export TOPDIR
+$(GLUON_SITEDIR)/site.mk:
+ $(error No site configuration was found. Please check out a site configuration to $(GLUON_SITEDIR))
+
+include $(GLUON_SITEDIR)/site.mk
+
+
+GLUON_RELEASE ?= $(error GLUON_RELEASE not set. GLUON_RELEASE can be set in site.mk or on the command line)
+
+
+export GLUON_RELEASE GLUON_ATH10K_MESH GLUON_REGION GLUON_DEBUG
update: FORCE
- $(GLUONDIR)/scripts/update.sh
- $(GLUONDIR)/scripts/patch.sh
-
-patch: FORCE
- $(GLUONDIR)/scripts/patch.sh
-
-unpatch: FORCE
- $(GLUONDIR)/scripts/unpatch.sh
+ @GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/update.sh
+ @GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/patch.sh
+ @GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/feeds.sh
update-patches: FORCE
- $(GLUONDIR)/scripts/update.sh
- $(GLUONDIR)/scripts/update-patches.sh
- $(GLUONDIR)/scripts/patch.sh
+ @GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/update.sh
+ @GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/update-patches.sh
+ @GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/patch.sh
--include $(TOPDIR)/include/host.mk
-
-_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
+update-feeds: FORCE
+ @GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/feeds.sh
-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)' -a -n '$(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)' ] \
- || (echo -e 'Please set GLUON_TARGET to a valid target. Gluon supports the following targets:$(subst $(space),\n * ,$(GLUON_TARGETS))'; false)
+LEDEMAKE = $(MAKE) -C lede
+
+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)
-prepare-target: FORCE
+list-targets: FORCE
+ @$(foreach target,$(GLUON_TARGETS),echo '$(target)';)
+
+
+GLUON_DEFAULT_PACKAGES := -odhcpd -ppp -ppp-mod-pppoe -wpad-mini gluon-core ip6tables hostapd-mini
+
+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)
@$(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_GLUON_WEB_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
- +@$(GLUONMAKE) prepare
- +@$(GLUONMAKE) images
+ @GLUON_SITEDIR='$(GLUON_SITEDIR)' $(LUA) scripts/site_config.lua \
+ || (echo 'Your site configuration did not pass validation.'; false)
-prepare: prepare-target
- +@$(GLUONMAKE) $@
+ @scripts/clean_output.sh
+ +@$(LEDEMAKE)
+ @GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/copy_output.sh '$(GLUON_TARGET)'
-clean download images: FORCE
- @$(CheckExternal)
- @$(CheckTarget)
- +@$(GLUONMAKE_EARLY) maybe-prepare-target
- +@$(GLUONMAKE) $@
+clean download: config
+ +@$(LEDEMAKE) $@
-toolchain/% package/% target/% image/%: FORCE
- @$(CheckExternal)
- @$(CheckTarget)
- +@$(GLUONMAKE_EARLY) maybe-prepare-target
- +@$(GLUONMAKE) $@
+dirclean: FORCE
+ +@[ -e lede/.config ] || $(LEDEMAKE) defconfig
+ +@$(LEDEMAKE) dirclean
+ @rm -rf $(GLUON_TMPDIR) $(GLUON_OUTPUTDIR)
-manifest: FORCE
- @[ -n '$(GLUON_BRANCH)' ] || (echo 'Please set GLUON_BRANCH to create a manifest.'; false)
+manifest: $(LUA) FORCE
+ @[ '$(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)
@$(CheckExternal)
- ( \
+ @( \
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 \
- ) > $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp
-
- +($(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_IMAGEDIR)
-
-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)_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)_MODELS :=
-endef
-
-define GluonProfileFactorySuffix
-GLUON_$(1)_FACTORY_SUFFIX := $(2)
-GLUON_$(1)_FACTORY_EXT := $(3)
-endef
-
-define GluonProfileSysupgradeSuffix
-GLUON_$(1)_SYSUPGRADE_SUFFIX := $(2)
-GLUON_$(1)_SYSUPGRADE_EXT := $(3)
-endef
-
-define GluonModel
-GLUON_$(1)_MODELS += $(3)
-GLUON_$(1)_MODEL_$(3) := $(2)
-endef
-
-
-include $(GLUONDIR)/targets/targets.mk
-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
-
-
-include $(INCLUDE_DIR)/target.mk
-
-
-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/sed/install
- +$(GLUONMAKE_EARLY) package/lua/host/install
-
-config: FORCE
- +$(NO_TRACE_MAKE) scripts/config/conf OPENWRT_BUILD= QUIET=0
- +$(GLUONMAKE) prepare-tmpinfo
- ( \
- cat $(GLUONDIR)/include/config $(GLUONDIR)/targets/$(GLUON_TARGET)/config; \
- 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
- mv .config $(BOARD_BUILDDIR)/config
-
- echo 'CONFIG_ALL_KMODS=y' >> $(BOARD_BUILDDIR)/config.tmp
- scripts/config/conf --defconfig=$(BOARD_BUILDDIR)/config.tmp Config.in
- mv .config $(BOARD_BUILDDIR)/config-allmods
-
- cp $(BOARD_BUILDDIR)/config .config
-
-prepare-target: FORCE
- rm $(GLUON_OPENWRTDIR)/tmp || true
- mkdir -p $(GLUON_OPENWRTDIR)/tmp
-
- for dir in build_dir dl staging_dir; do \
- mkdir -p $(GLUON_ORIGOPENWRTDIR)/$$dir; \
- done
- 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_EARLY) feeds
- +$(GLUONMAKE_EARLY) gluon-tools
- +$(GLUONMAKE) config
- touch $(target_prepared_stamp)
-
-$(target_prepared_stamp):
- +$(GLUONMAKE_EARLY) prepare-target
-
-maybe-prepare-target: $(target_prepared_stamp)
-
-$(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)
-
-
-export SHA512SUM := $(GLUONDIR)/scripts/sha512sum.sh
-
-
-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) -f $(GLUONDIR)/include/Makefile.target $(LINUX_DIR)/.image TARGET_BUILD=1
- +$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) -f $(GLUONDIR)/include/Makefile.target $(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)
- $(foreach k, vmlinux vmlinux.elf \
- $(if $(KERNEL_IMAGES),$(KERNEL_IMAGES),$(filter-out dtbs,$(KERNELNAME))), \
- $(CP) $(KERNEL_BUILD_DIR)/$(k) $(BOARD_KDIR)/$(k); \
- )
- +$(SUBMAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image image_prepare KDIR="$(BOARD_KDIR)"
-
-prepare: FORCE
- @$(STAGING_DIR_HOST)/bin/lua $(GLUONDIR)/package/gluon-core/files/usr/lib/lua/gluon/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
-
-
-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
-
-PREPARED_RELEASE = $$(cat $(gluon_prepared_stamp))
-IMAGE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE)
-
-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)); \
+ echo && \
+ $(foreach GLUON_TARGET,$(GLUON_TARGETS), \
+ GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/generate_manifest.sh '$(GLUON_TARGET)' && \
) : \
- )
+ ) > '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
-$(eval $(call merge-lists,INSTALL_PACKAGES,DEFAULT_PACKAGES GLUON_DEFAULT_PACKAGES GLUON_SITE_PACKAGES GLUON_$(PROFILE)_DEFAULT_PACKAGES GLUON_$(PROFILE)_SITE_PACKAGES))
+FORCE: ;
-package_install: FORCE
- $(OPKG) update
- $(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
-
-
-ifeq ($(GLUON_OPKG_CONFIG),1)
-include $(INCLUDE_DIR)/version.mk
-endif
-
-opkg_config: FORCE
- cp $(GLUON_OPENWRTDIR)/package/system/opkg/files/opkg.conf $(TARGET_DIR)/etc/opkg.conf
- for d in base luci packages routing telephony management oldpackages; do \
- echo "src/gz %n_$$d %U/$$d" >> $(TARGET_DIR)/etc/opkg.conf; \
- done
- $(VERSION_SED) $(TARGET_DIR)/etc/opkg.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 GLUON_OPKG_CONFIG=1
-
- $(call Image/mkfs/prepare)
- $(_SINGLE)$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image install TARGET_BUILD=1 IMG_PREFIX=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) && \
- ) \
- ) :
-
-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), \
- $(foreach model,$(GLUON_$(profile)_MODELS), \
- file="$(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(profile)_SYSUPGRADE_EXT)"; \
- [ -e "$$file" ] && echo '$(model)' "$(PREPARED_RELEASE)" "$$($(SHA512SUM) "$$file")" "$$file"; \
- ) \
- ) : \
- ) >> $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp
-
-
-.PHONY: all images prepare clean gluon-tools manifest
-
-endif
+.PHONY: FORCE
+.NOTPARALLEL:
diff --git a/README.md b/README.md
index 87750136..151d06b8 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
Documentation (incomplete at this time, contribute if you can!) may be found at
-http://gluon.readthedocs.org/
+http://gluon.readthedocs.org/.
If you're new to Gluon and ready to get your feet wet, have a look at the
[Getting Started Guide](http://gluon.readthedocs.org/en/latest/user/getting_started.html).
@@ -8,15 +8,18 @@ If you're new to Gluon and ready to get your feet wet, have a look at the
## Issues & Feature requests
-Before opening an issue make sure to read check whether any existing issues
+Before opening an issue, make sure to check whether any existing issues
(open or closed) match. If you're suggesting a new feature, drop by on IRC or
our mailinglist to discuss it first.
+We maintain a [Roadmap](https://github.com/freifunk-gluon/gluon/wiki/Roadmap) for
+the future development of Gluon.
+
## Use a release!
-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`
-and switch to one by running `git checkout v2015.1 && make update`.
+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 tag`
+and switch to one by running `git checkout v2017.1 && make update`.
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.
@@ -25,11 +28,11 @@ If you upgrade using random master commits the nodes *will break* eventually.
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
the address in the `List-Unsubscribe` header of any list
message. If you haven't changed addresses since subscribing,
you can also send a message to:
- gluon-unsubscribe@luebeck.freifunk.net
+ gluon+unsubscribe@luebeck.freifunk.net
diff --git a/contrib/depdot.sh b/contrib/depdot.sh
new file mode 100755
index 00000000..c065ea57
--- /dev/null
+++ b/contrib/depdot.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# Script to output the dependency graph of Gluon's packages
+# Limitations:
+# * Works only if directory names and package names are the same (true for all Gluon packages)
+# * Doesn't show dependencies through virtual packages correctly
+
+
+
+shopt -s nullglob
+
+
+pushd "$(dirname "$0")/.." >/dev/null
+
+
+escape_name() {
+ echo -n "_$1" | tr -c '[:alnum:]' _
+}
+
+print_node () {
+ echo "$(escape_name "$1") [label=\"$1\", shape=box];"
+}
+
+print_dep() {
+ echo "$(escape_name "$1") -> $(escape_name "$2");"
+}
+
+echo 'digraph G {'
+
+for makefile in ./package/*/Makefile; do
+ dir="$(dirname "$makefile")"
+ package="$(basename "$dir")"
+
+ deps=$(grep -w DEPENDS "$makefile" | cut -d= -f2 | tr -d +)
+
+ print_node "$package"
+ for dep in $deps; do
+ print_node "$dep"
+ print_dep "$package" "$dep"
+ done
+done | sort -u
+
+popd >/dev/null
+
+echo '}'
diff --git a/contrib/i18n-scan.pl b/contrib/i18n-scan.pl
new file mode 100755
index 00000000..8e7d2597
--- /dev/null
+++ b/contrib/i18n-scan.pl
@@ -0,0 +1,128 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Text::Balanced qw(extract_bracketed extract_delimited extract_tagged);
+
+@ARGV >= 1 || die "Usage: $0 \n";
+
+
+my %stringtable;
+
+sub dec_lua_str
+{
+ my $s = shift;
+ $s =~ s/[\s\n]+/ /g;
+ $s =~ s/\\n/\n/g;
+ $s =~ s/\\t/\t/g;
+ $s =~ s/\\(.)/$1/g;
+ $s =~ s/^ //;
+ $s =~ s/ $//;
+ return $s;
+}
+
+sub dec_tpl_str
+{
+ my $s = shift;
+ $s =~ s/-$//;
+ $s =~ s/[\s\n]+/ /g;
+ $s =~ s/^ //;
+ $s =~ s/ $//;
+ $s =~ s/\\/\\\\/g;
+ return $s;
+}
+
+
+if( open F, "find @ARGV -type f '(' -name '*.html' -o -name '*.lua' ')' |" )
+{
+ while( defined( my $file = readline F ) )
+ {
+ chomp $file;
+
+ if( open S, "< $file" )
+ {
+ local $/ = undef;
+ my $raw = ;
+ close S;
+
+
+ my $text = $raw;
+
+ while( $text =~ s/ ^ .*? (?:translate|translatef|i18n|_) [\n\s]* \( /(/sgx )
+ {
+ ( my $code, $text ) = extract_bracketed($text, q{('")});
+
+ $code =~ s/\\\n/ /g;
+ $code =~ s/^\([\n\s]*//;
+ $code =~ s/[\n\s]*\)$//;
+
+ my $res = "";
+ my $sub = "";
+
+ if( $code =~ /^['"]/ )
+ {
+ while( defined $sub )
+ {
+ ( $sub, $code ) = extract_delimited($code, q{'"}, q{\s*(?:\.\.\s*)?});
+
+ if( defined $sub && length($sub) > 2 )
+ {
+ $res .= substr $sub, 1, length($sub) - 2;
+ }
+ else
+ {
+ undef $sub;
+ }
+ }
+ }
+ elsif( $code =~ /^(\[=*\[)/ )
+ {
+ my $stag = quotemeta $1;
+ my $etag = $stag;
+ $etag =~ s/\[/]/g;
+
+ ( $res ) = extract_tagged($code, $stag, $etag);
+
+ $res =~ s/^$stag//;
+ $res =~ s/$etag$//;
+ }
+
+ $res = dec_lua_str($res);
+ $stringtable{$res}++ if $res;
+ }
+
+
+ $text = $raw;
+
+ while( $text =~ s/ ^ .*? <% -? [:_] /<%/sgx )
+ {
+ ( my $code, $text ) = extract_tagged($text, '<%', '%>');
+
+ if( defined $code )
+ {
+ $code = dec_tpl_str(substr $code, 2, length($code) - 4);
+ $stringtable{$code}++;
+ }
+ }
+ }
+ }
+
+ close F;
+}
+
+
+if( open C, "| msgcat -" )
+{
+ printf C "msgid \"\"\nmsgstr \"Content-Type: text/plain; charset=UTF-8\"\n\n";
+
+ foreach my $key ( sort keys %stringtable )
+ {
+ if( length $key )
+ {
+ $key =~ s/"/\\"/g;
+ printf C "msgid \"%s\"\nmsgstr \"\"\n\n", $key;
+ }
+ }
+
+ close C;
+}
diff --git a/contrib/lsupgrade.sh b/contrib/lsupgrade.sh
index 7fe11299..eca7a852 100755
--- a/contrib/lsupgrade.sh
+++ b/contrib/lsupgrade.sh
@@ -2,10 +2,11 @@
# Script to list all upgrade scripts in a clear manner
# Limitations:
-# * Does only show scripts of packages whose `files' directory represent the whole image filesystem (which are all Gluon packages)
+# * Does only show scripts of packages whose `files'/`luasrc' directories represent the whole image filesystem (which are all Gluon packages)
-SUFFIX=files/lib/gluon/upgrade
+SUFFIX1=files/lib/gluon/upgrade
+SUFFIX2=luasrc/lib/gluon/upgrade
shopt -s nullglob
@@ -35,8 +36,11 @@ find ./package packages -name Makefile | while read makefile; do
dirname="$(dirname "$dir" | cut -d/ -f 3-)"
package="$(basename "$dir")"
- for file in "${SUFFIX}"/*; do
- echo "${GREEN}$(basename "${file}")${RESET}" "(${BLUE}${repo}${RESET}/${dirname}${dirname:+/}${RED}${package}${RESET}/${SUFFIX})"
+ for file in "${SUFFIX1}"/*; do
+ echo "${GREEN}$(basename "${file}")${RESET}" "(${BLUE}${repo}${RESET}/${dirname}${dirname:+/}${RED}${package}${RESET}/${SUFFIX1})"
+ done
+ for file in "${SUFFIX2}"/*; do
+ echo "${GREEN}$(basename "${file}")${RESET}" "(${BLUE}${repo}${RESET}/${dirname}${dirname:+/}${RED}${package}${RESET}/${SUFFIX2})"
done
popd >/dev/null
done | sort
diff --git a/contrib/sign.sh b/contrib/sign.sh
index 082e967e..0923b2dc 100755
--- a/contrib/sign.sh
+++ b/contrib/sign.sh
@@ -1,6 +1,8 @@
#!/bin/sh
-if [ $# -eq 0 -o "-h" = "$1" -o "-help" = "$1" -o "--help" = "$1" ]; then
+set -e
+
+if [ $# -ne 2 -o "-h" = "$1" -o "--help" = "$1" -o ! -r "$1" -o ! -r "$2" ]; then
cat <
@@ -25,16 +27,18 @@ manifest="$2"
upper="$(mktemp)"
lower="$(mktemp)"
-awk "BEGIN { sep=0 }
- /^---\$/ { sep=1; next }
- { if(sep==0) print > \"$upper\";
- else print > \"$lower\"}" \
+trap 'rm -f "$upper" "$lower"' EXIT
+
+awk 'BEGIN { sep=0 }
+ /^---$/ { sep=1; next }
+ { if(sep==0) print > "'"$upper"'";
+ else print > "'"$lower"'"}' \
"$manifest"
ecdsasign "$upper" < "$SECRET" >> "$lower"
-cat "$upper" > "$manifest"
-echo --- >> "$manifest"
-cat "$lower" >> "$manifest"
-
-rm -f "$upper" "$lower"
+(
+ cat "$upper"
+ echo ---
+ cat "$lower"
+) > "$manifest"
diff --git a/contrib/sigtest.sh b/contrib/sigtest.sh
new file mode 100755
index 00000000..2ed06d0f
--- /dev/null
+++ b/contrib/sigtest.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+if [ $# -eq 0 -o "-h" = "$1" -o "-help" = "$1" -o "--help" = "$1" ]; then
+ cat <
+
+sigtest.sh checks if a manifest is signed by the public key . There is
+no output, success or failure is indicated via the return code.
+
+See also:
+ * ecdsautils in https://github.com/tcatm/ecdsautils
+ * http://gluon.readthedocs.org/en/latest/features/autoupdater.html
+
+EOHELP
+ exit 1
+fi
+
+public="$1"
+manifest="$2"
+upper="$(mktemp)"
+lower="$(mktemp)"
+ret=1
+
+awk "BEGIN { sep=0 }
+ /^---\$/ { sep=1; next }
+ { if(sep==0) print > \"$upper\";
+ else print > \"$lower\"}" \
+ "$manifest"
+
+while read line
+do
+ if ecdsaverify -s "$line" -p "$public" "$upper"; then
+ ret=0
+ break
+ fi
+done < "$lower"
+
+rm -f "$upper" "$lower"
+exit $ret
diff --git a/docs/conf.py b/docs/conf.py
index 090de523..c0a54260 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -47,16 +47,16 @@ master_doc = 'index'
# General information about the project.
project = 'Gluon'
-copyright = '2015, Project Gluon'
+copyright = '2015-2017, Project Gluon'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '2015.1+'
+version = '2017.1+'
# The full version, including alpha/beta/rc tags.
-release = '2015.1+'
+release = '2017.1+'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/docs/dev/basics.rst b/docs/dev/basics.rst
index 7e7d9f58..2f4d1d89 100644
--- a/docs/dev/basics.rst
+++ b/docs/dev/basics.rst
@@ -34,21 +34,7 @@ rerun
`patches`; the resulting branch will be called `patched`, while the commit specified in `modules`
can be refered to by the branch `base`.
-::
-
- 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
+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
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
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
diff --git a/docs/dev/configmode.rst b/docs/dev/configmode.rst
deleted file mode 100644
index 9a174d4c..00000000
--- a/docs/dev/configmode.rst
+++ /dev/null
@@ -1,92 +0,0 @@
-Config Mode
-===========
-
-As of 2014.4 `gluon-config-mode` consists of several modules.
-
-gluon-config-mode-core
- This modules provides the core functionality for the config mode.
- All modules must depend on it.
-
-gluon-config-mode-hostname
- Provides a hostname field.
-
-gluon-config-mode-autoupdater
- Informs whether the autoupdater is enabled.
-
-gluon-config-mode-mesh-vpn
- Allows toggling of mesh-vpn-fastd and setting a bandwidth limit.
-
-gluon-config-mode-geo-location
- Enables the user to set the geographical location of the node.
-
-gluon-config-mode-contact-info
- Adds a field where the user can provide contact information.
-
-In order to get a config mode close to the one found in 2014.3.x you may add
-these modules to your `site.mk`:
-gluon-config-mode-hostname,
-gluon-config-mode-autoupdater,
-gluon-config-mode-mesh-vpn,
-gluon-config-mode-geo-location,
-gluon-config-mode-contact-info
-
-Writing Config Mode Modules
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Config mode modules are located at `/lib/gluon/config-mode/wizard` and
-`/lib/gluon/config-mode/reboot`. Modules are named like `0000-name.lua` and
-are executed in lexical order. If you take the standard set of modules, the
-order is, for wizard modules:
-
- - 0050-autoupdater-info
- - 0100-hostname
- - 0300-mesh-vpn
- - 0400-geo-location
- - 0500-contact-info
-
-While for reboot modules it is:
-
- - 0100-mesh-vpn
- - 0900-msg-reboot
-
-Wizards
--------
-
-Wizard modules return a UCI section. A simple module capable of changing the
-hostname might look like this::
-
- local cbi = require "luci.cbi"
- local uci = luci.model.uci.cursor()
-
- local M = {}
-
- function M.section(form)
- local s = form:section(cbi.SimpleSection, nil, nil)
- local o = s:option(cbi.Value, "_hostname", "Hostname")
- o.value = uci:get_first("system", "system", "hostname")
- o.rmempty = false
- o.datatype = "hostname"
- end
-
- function M.handle(data)
- uci:set("system", uci:get_first("system", "system"), "hostname", data._hostname)
- uci:save("system")
- uci:commit("system")
- end
-
- return M
-
-Reboot page
------------
-
-Reboot modules return a function that will be called when the page is to be
-rendered or nil (i.e. the module is skipped)::
-
- if no_hello_world_today then
- return nil
- else
- return function ()
- luci.template.render_string("Hello World!")
- end
- end
-
diff --git a/docs/dev/hardware.rst b/docs/dev/hardware.rst
index a1a7f31c..7c17bcc9 100644
--- a/docs/dev/hardware.rst
+++ b/docs/dev/hardware.rst
@@ -11,85 +11,132 @@ is a requirement. At the moment, Gluon's scripts can't handle devices
without WLAN adapters (although such environments may also be interesting,
e.g. for automated testing in virtual machines).
+
.. _hardware-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
is enough.
-Profiles are defined in ``targets/-/profiles.mk``. There are two macros
-used to define which images are generated: ``GluonProfile`` and ``GluonModel``. The following examples
-are taken from ``profiles.mk`` of the ``ar71xx-generic`` target::
+Profiles are defined in ``targets/*`` in a shell-based DSL (so common shell
+commands syntax like ``if`` can be used.
- $(eval $(call GluonProfile,TLWR1043))
- $(eval $(call GluonModel,TLWR1043,tl-wr1043nd-v1-squashfs,tp-link-tl-wr1043n-nd-v1))
- $(eval $(call GluonModel,TLWR1043,tl-wr1043nd-v2-squashfs,tp-link-tl-wr1043n-nd-v2))
+The ``device`` command is used to define an image build for a device. It takes
+two or three parameters.
-The ``GluonProfile`` macro takes at least one parameter, the profile name as it is
-defined in the Makefiles of OpenWrt (``openwrt/target/linux///profiles/*``
-and ``openwrt/target/linux//image/Makefile``). If the target you are on doesn't define
-profiles (e.g. on x86), just add a single profile called ``Generic`` or similar.
-
-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///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.
-
-::
+The first parameter defines the Gluon profile name, which is used to refer to the
+device and is part of the generated image name. The profile name must be same as
+the output of the following command (on the target device), so the autoupdater
+can work::
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//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,
-``require("platform_info").get_image_name()`` will just return ``nil`` and the final image name
-may be defined arbitrarily.
+Examples::
+
+ 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
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/core/initial/001-sysconfig``
+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
-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 a new target is much more complex than adding a new profile. There are two basic steps
required for adding a new target:
-Adjust packages
-'''''''''''''''
-One package that definitely needs adjustments for every new target added is ``lua-platform-info``. Just
-start with a copy of an existing platform info script, adjust it for the new target, and add the new target
-to the list of supported targets in the package Makefile.
+Package adjustments
+'''''''''''''''''''
-On many targets, Gluon's network setup scripts (mainly in the packages ``gluon-core`` and ``gluon-mesh-batman-adv-core``)
+One package that may need adjustments for new targets is ``libplatforminfo`` (to be found in
+`packages/gluon/libs/libplatforminfo `_).
+If the new platform works fine with the definitions found in ``default.c``, nothing needs to be done. Otherwise,
+create a definition for the added target or subtarget, either by symlinking one of the files in the ``templates``
+directory, or adding a new source file.
+
+On many targets, Gluon's network setup scripts (mainly in the package ``gluon-core``)
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).
-Add support to the build system
-'''''''''''''''''''''''''''''''
-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, three files must be created:
+Build system support
+''''''''''''''''''''
-* config
-* profiles.mk
-* vermagic
+A definition for the new target must be created under ``targets``, and it must be added
+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
+LEDE subtarget name (if it differs from the Gluon subtarget). The third argument
+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.
-The file ``config`` can be used to add additional, target-specific options to the OpenWrt config. It
-must at least select the correct target and subtarget. For ``profiles.mk``, see :ref:`hardware-adding-profiles`.
-
-The files ``vermagic`` must have the correct content so kernel modules from the upstream repositories
-can be installed without dependency issues. The OpenWrt version a Gluon release is based on is defined by the upstream package repo URL in ``include/gluon.mk``
-(in the variable ``CONFIG_VERSION_REPO``); at the time this documentation was written, this was ``barrier_breaker/14.07``; whenever
-the package repo is updated, all ``vermagic`` files must be updated as well.
-
-The content is a hash which is part of the version number of the kernel package. So in the case of ``ar71xx-generic`` on
-``barrier_breaker``, we look for the kernel package in the directory ``https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/``.
-As the kernel package is called ``kernel_3.10.49-1-0114c71ed85677c9c1e4911437af4743_ar71xx.ipk``, the correct ``vermagic`` string
-is ``0114c71ed85677c9c1e4911437af4743``.
-
-After this, is should be sufficient to call ``make GLUON_TARGET=-`` to build the images for the new target.
+After this, is should be sufficient to call ``make GLUON_TARGET=`` to build the images for the new target.
diff --git a/docs/dev/i18n.rst b/docs/dev/i18n.rst
deleted file mode 100644
index b51bfdee..00000000
--- a/docs/dev/i18n.rst
+++ /dev/null
@@ -1,88 +0,0 @@
-Internationalization support
-============================
-
-General guidelines
-------------------
-
-* All config mode packages must be fully translatable, with complete English and German texts.
-* All new expert mode packages be fully translatable. English texts are required, German texts recommended.
-* Existing expert mode packages should be made translatable as soon as possible.
-* The "message IDs" (which are the arguments to the ``translate`` function) should be the
- English texts.
-
-i18n support in LuCI
---------------------
-
-Internationalization support can be found in the ``luci.i18n`` package.
-Strings are translated using the ``i18n.translate`` and ``i18n.translatef`` functions
-(``translate`` for static strings, ``translatef`` for printf-like formatted string).
-
-Example from the ``gluon-config-mode-geo-location`` package::
-
- local i18n = require "luci.i18n"
- o = s:option(cbi.Flag, "_location", i18n.translate("Show node on the map"))
-
-Adding translation templates to Gluon packages
-----------------------------------------------
-
-The i18n support is based on the standard gettext system. For each translatable package,
-a translation template with extension ``.pot`` can be created using the ``i18n-scan.pl``
-script from the LuCI repository::
-
- cd package/gluon-config-mode-geo-location
- mkdir i18n
- cd i18n
- ../../../packages/luci/build/i18n-scan.pl ../files > gluon-config-mode-geo-location.pot
-
-The entries in the template can be reordered after the generation if desirable. Lots of standard
-translations like "Cancel" are already available in the LuCI base translation file (see
-``packages/luci/po/templates/base.pot``) and can be removed from the template.
-
-In addition, some additions to the Makefile must be made. Instead of OpenWrt's default package.mk,
-the Gluon version ``$(GLUONDIR)/include/package.mk`` must be used. The i18n files must be installed
-and PKG_CONFIG_DEPENDS must be added::
-
- ...
- include $(GLUONDIR)/include/package.mk
-
- PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
- ...
- define Build/Compile
- $(call GluonBuildI18N,gluon-config-mode-geo-location,i18n)
- endef
-
- define Package/gluon-config-mode-geo-location/install
- ...
- $(call GluonInstallI18N,gluon-config-mode-geo-location,$(1))
- endef
- ...
-
-
-Adding translations
--------------------
-
-A new translation file for a template can be added using the ``msginit`` command::
-
- cd package/gluon-config-mode-geo-location/i18n
- msginit -l de
-
-This will create the file ``de.po`` in which the translations can be added.
-
-The translation file can be updated to a new template version using the ``msgmerge`` command::
-
- msgmerge -U de.po gluon-config-mode-geo-location.pot
-
-After the merge, the translation file should be checked for "fuzzy matched" entries where
-the original English texts have changed. All entries from the the translation file should be
-translated in the ``.po`` file (or removed from it, so the original English texts are displayed
-instead).
-
-Adding support for new languages
---------------------------------
-
-A list of all languages supported by LuCI can be found in the ``packages/luci/luci.mk`` file after
-Gluon's dependencies have been downloaded using ``make update``. Adding translations for these
-languages is straightforward using the ``msginit`` command.
-
-For other languages, support must be added tu LuCI first, which constitutes completely translating
-the ``base.pot``. Please contact the upstream LuCI maintainers if you'd like to do this.
diff --git a/docs/dev/mac_addresses.rst b/docs/dev/mac_addresses.rst
new file mode 100644
index 00000000..b221a302
--- /dev/null
+++ b/docs/dev/mac_addresses.rst
@@ -0,0 +1,18 @@
+MAC addresses
+=============
+
+Many devices don't have enough unique MAC addresses assigned by the vendor
+(in batman-adv, each mesh interface needs an own MAC address that must be unique
+mesh-wide).
+
+Gluon tries to solve this issue by using a hash of the primary MAC address as a
+45 bit MAC address prefix. The resulting 8 addresses are used as follows:
+
+* 0: client0; WAN
+* 1: mesh0
+* 2: ibss0
+* 3: wan_radio0 (private WLAN); batman-adv primary address
+* 4: client1; LAN
+* 5: mesh1
+* 6: ibss1
+* 7: wan_radio1 (private WLAN); mesh VPN
diff --git a/docs/dev/upgrade.rst b/docs/dev/upgrade.rst
index 3cd57950..2c18604d 100644
--- a/docs/dev/upgrade.rst
+++ b/docs/dev/upgrade.rst
@@ -6,7 +6,7 @@ Basics
After each sysupgrade (including the initial installation), Gluon will execute all scripts
under ``/lib/gluon/upgrade``. These scripts' filenames usually begin with a 3-digit number
-specifying the order of execution.
+specifying the order of execution. Note that the script files need to be executable.
To get an overview of the ordering of all scripts of all packages, the helper script ``contrib/lsupgrade.sh``
in the Gluon repository can be used, which will print all upgrade scripts' filenames and directories. If executed
@@ -16,17 +16,15 @@ Best practices
--------------
* Most upgrade scripts are written in Lua. This allows using lots of helper functions provided
- by LuCi and Gluon, e.g. to access the site configuration or edit UCI configuration files.
+ by Gluon, e.g. to access the site configuration or edit UCI configuration files.
* Whenever possible, scripts shouldn't check if they are running for the first time, but just edit configuration
- files to achive a valid configuration (without overwriting configuration changes made by the user where desirable).
+ files to achieve a valid configuration (without overwriting configuration changes made by the user where desirable).
This allows using the same code to create the initial configuration and upgrade configurations on upgrades.
* If it is unavoidable to run different code during the initial installation, the ``sysconfig.gluon_version`` variable
- can be checked. This variable in ``nil`` during the initial installation and contains the previously install Gluon
- version otherwise. The package ``gluon-legacy`` (which is responsible for upgrades from the old firmwares of
- Hamburg/Kiel/Lübeck) uses the special value ``legacy``; other packages should handle this value just as any other
- string.
+ can be checked. This variable is ``nil`` during the initial installation and contains the previously install Gluon
+ version otherwise.
Script ordering
---------------
diff --git a/docs/dev/web/config-mode.rst b/docs/dev/web/config-mode.rst
new file mode 100644
index 00000000..9c0c2430
--- /dev/null
+++ b/docs/dev/web/config-mode.rst
@@ -0,0 +1,82 @@
+Config Mode
+===========
+
+The `Config Mode` consists of several modules that provide a range of different
+condiguration options:
+
+gluon-config-mode-core
+ This modules provides the core functionality for the config mode.
+ All modules must depend on it.
+
+gluon-config-mode-hostname
+ Provides a hostname field.
+
+gluon-config-mode-autoupdater
+ Informs whether the autoupdater is enabled.
+
+gluon-config-mode-mesh-vpn
+ Allows toggling of mesh-vpn-fastd and setting a bandwidth limit.
+
+gluon-config-mode-geo-location
+ Enables the user to set the geographical location of the node.
+
+gluon-config-mode-contact-info
+ Adds a field where the user can provide contact information.
+
+
+Writing Config Mode modules
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Config mode modules are located at ``/lib/gluon/config-mode/wizard`` and
+``/lib/gluon/config-mode/reboot``. Modules are named like ``0000-name.lua`` and
+are executed in lexical order. In the standard package set, the
+order is, for wizard modules:
+
+ - 0050-autoupdater-info
+ - 0100-hostname
+ - 0300-mesh-vpn
+ - 0400-geo-location
+ - 0500-contact-info
+
+The reboot module order is:
+
+ - 0100-mesh-vpn
+ - 0900-msg-reboot
+
+All modules are run in the gluon-web model context and have access to the same
+variables as "full" gluon-web modules.
+
+Wizards
+-------
+
+Wizard modules must return a function that is provided with the wizard form and an
+UCI cursor. The function can create configuration sections in the form:
+
+.. code-block:: lua
+
+ return function(form, uci)
+ local s = form:section(Section)
+ local o = s:option(Value, "hostname", "Hostname")
+ o.default = uci:get_first("system", "system", "hostname")
+ o.datatype = "hostname"
+
+ function o:write(data)
+ uci:set("system", uci:get_first("system", "system"), "hostname", data)
+ end
+
+ return {'system'}
+ end
+
+The function may return a table of UCI packages to commit after the individual
+fields' `write` methods have been executed. This is done to avoid committing the
+packages repeatedly when multiple wizard modules modify the same package.
+
+Reboot page
+-----------
+
+Reboot modules are simply executed when the reboot page is
+rendered:
+
+.. code-block:: lua
+
+ renderer.render_string("Hello World!")
diff --git a/docs/dev/web/controller.rst b/docs/dev/web/controller.rst
new file mode 100644
index 00000000..cfec73d4
--- /dev/null
+++ b/docs/dev/web/controller.rst
@@ -0,0 +1,117 @@
+Controllers
+===========
+
+Controllers live in ``/lib/gluon/web/controller``. They define which pages ("routes")
+exist under the ``/cgi-bin/gluon`` path, and what code is run when these pages are requested.
+
+Controller scripts mostly consist of calls of the `entry` function, which each define
+one route:
+
+.. code-block:: lua
+
+ entry({"admin"}, alias("admin", "info"), _("Advanced settings"), 10)
+ entry({"admin", "info"}, template("admin/info"), _("Information"), 1)
+
+The entry function expects 4 arguments:
+
+ - `path`: Components of the path to define a route for.
+
+ The above example defines routes for the paths ``admin`` and ``admin/info``.
+
+ - `target`: Dispatcher for the route. See the following section for details.
+ - `title`: Page title (also used in navigation). The underscore function is used
+
+ - `order`: Sort index in navigation (defaults to 100)
+
+Navigation indexes are automatically generated for each path level. Pages can be
+hidden from the navigation by setting the `hidden` property of the node object
+returned by `entry`:
+
+.. code-block:: lua
+
+ entry({"hidden"}, alias("foo"), _("I'm hidden!")).hidden = true
+
+
+Dispatchers
+-----------
+
+ - *alias* (*path*, ...): Redirects to a different page. The path components are
+ passed as individual arguments.
+ - *call* (*func*, ...): Runs a Lua function for custom request handling. The given
+ function is called with the HTTP object and the template renderer as first
+ two arguments, followed by all additional arguments passed to `call`.
+ - *template* (*view*): Renders the given view. See :doc:`view`.
+ - *model* (*name*): Displays and evaluates a form as defined by the given model. See the
+ :doc:`model` page for an explanation of gluon-web models.
+
+
+.. _web-controller-http:
+
+The HTTP object
+---------------
+
+The HTTP object provides information about the HTTP requests and allows to add
+data to the reply. Using it directly is rarely necessary when gluon-web
+models and views are used.
+
+Useful functions:
+
+ - *getenv* (*key*): Returns a value from the CGI environment passed by the webserver.
+ - *formvalue* (*key*): Returns a value passed in a query string or in the content
+ of a POST request. If multiple values with the same name have been passed, only
+ the first is returned.
+ - *formvaluetable* (*key*): Similar to *formvalue*, but returns a table of all
+ values for the given key.
+ - *status* (*code*, *message*): Writes the HTTP status to the reply. Has no effect
+ if a status has already been sent or non-header data has been written.
+ - *header* (*key*, *value*): Adds an HTTP header to the reply to be sent to to
+ the client. Has no effect when non-header data has already been written.
+ - *prepare_content* (*mime*): Sets the *Content-Type* header to the given MIME
+ type, potentially setting additional headers or modifying the MIME type to
+ accommodate browser quirks
+ - *write* (*data*, ...): Sends the given data to the client. If headers have not
+ been sent, it will be done before the data is written.
+
+
+HTTP functions are called in method syntax, for example:
+
+.. code-block:: lua
+
+ http:write('Output!')
+
+
+.. _web-controller-template-renderer:
+
+The template renderer
+---------------------
+
+The template renderer allows to render templates (views). The most useful functions
+are:
+
+ - *render* (*view*, *scope*): Renders the given view, optionally passing a table
+ with additional variables to make available in the template.
+ - *render_string* (*str*, *scope*): Same as *render*, but the template is passed
+ directly instead of being loaded from the view directory.
+
+The renderer functions are called in property syntax, for example:
+
+.. code-block:: lua
+
+ renderer.render('layout')
+
+
+Differences from LuCI
+---------------------
+
+ - Controllers must not use the *module* function to define a Lua module (*gluon-web*
+ will set up a proper environment for each controller itself)
+ - Entries are defined at top level, not inside an *index* function
+ - The *alias* dispatcher triggers an HTTP redirect instead of directly running
+ the dispatcher of the aliased route.
+ - The *call* dispatcher is passed a function instead of a string with a function
+ name.
+ - The *cbi* dispatcher of LuCI has been renamed to *model*.
+ - The HTTP POST handler support the multipart/form-data encoding only, so
+ ``enctype="multipart/form-data"`` must be included in all *
"
"
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 "
"Mode neustarten.
"
"
Viel Spaß mit deinem Knoten und der Erkundung von Freifunk!
"
+
+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."
diff --git a/docs/site-example/i18n/en.po b/docs/site-example/i18n/en.po
index dedc06e1..181ebce1 100644
--- a/docs/site-example/i18n/en.po
+++ b/docs/site-example/i18n/en.po
@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
-"PO-Revision-Date: 2015-03-19 20:28+0100\n"
-"Last-Translator: Matthias Schiffer \n"
+"PO-Revision-Date: 2016-02-04 14:28+0100\n"
+"Last-Translator: David Lutz \n"
"Language-Team: English\n"
"Language: en\n"
"MIME-Version: 1.0\n"
@@ -12,25 +12,44 @@ msgstr ""
msgid "gluon-config-mode:welcome"
msgstr ""
-"Welcome the the setup wizard of your new Freifunk Duckburg node. "
-"Please fill out the following form and transmit it."
+"Welcome to the setup wizard of your new Freifunk Alpha Centauri node. "
+"Please fill out the following form and submit it."
msgid "gluon-config-mode:pubkey"
msgstr ""
-"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 "
-"Duckburg servers. "
-"To register the key send it together with your node's name (<%=hostname%>) to "
-"keys@entenhausen.freifunk.net."
+"
You have selected not to use the mesh VPN. "
+"Your node will only be able to connect to the Freifunk network if other nodes in reach "
+"already have a connection.
"
msgid "gluon-config-mode:reboot"
msgstr ""
-"
The node is currently rebooting and will try to connect to other "
-"nearby Freifunk nodes after that. "
-"Your can find lots of information on the Freifunk Duckburg community on "
-"our homepage.
"
+"
Your node <%= pcdata(hostname) %> is currently rebooting and will "
+"try to connect to other nearby Freifunk nodes after that. For more "
+"information about the Freifunk community on Alpha Centauri, have a look at "
+"our homepage.
"
"
To get back to this configuration interface, press the reset button for "
"3 seconds during normal operation. The device will then reboot into config "
"mode.
"
-"
Have fun with your node and exploring the Freifunk network!
"
+"
Have fun with your node and exploring of the Freifunk network!
"
+
+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."
diff --git a/docs/site-example/i18n/fr.po b/docs/site-example/i18n/fr.po
new file mode 100644
index 00000000..bd4aef44
--- /dev/null
+++ b/docs/site-example/i18n/fr.po
@@ -0,0 +1,58 @@
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2015-08-06 20:28+0100\n"
+"Last-Translator: Tobias Bernot \n"
+"Language-Team: French\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgid "gluon-config-mode:welcome"
+msgstr ""
+"Bienvenue dans l'assistant de configuration pour votre nouveau nœud "
+"Freifunk. Remplissez le formulaire suivant en fonction de vos besoins "
+"et enregistrez le"
+
+msgid "gluon-config-mode:pubkey"
+msgstr ""
+"
Ceci est la clé publique de votre nœud Freifunk. Seulment après que la clé soit "
+"entrée sur les serveurs de votre groupe de Freifunk votre nœud pourra se connecter "
+"sur les serveur Mesh-VPN de votre groupe Freifunk. Veuillez envoyer la clé avec le "
+"nom de votre nœud "
+"(<%=pcdata(hostname)%>) à "
+"&"
+"body=<%= urlencode('# ' .. hostname .. '\n' .. pubkey) %>\">keys@alpha-centauri.freifunk.net."
+"
Vous avez choisi de ne pas utiliser "
+"le réseau VPN. Votre nœud ne pourra se connecter au réseau Freifunk que si "
+"d'autres nœuds à portée ont déjà une connexion.
Votre nœud <%= pcdata(hostname) %> es en train de redémarrer et "
+"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 "
+" de ton groupe .
"
+"
Pour retrouver cette page de configuration veuillier appuyez pendant le "
+"fonctionement normal pendant 3 Secondes sur le bouton reset. L'appareil va ensuite "
+"redémarer en mode configuration.
"
+"
Profitez votre de nœud et amusez vous à découvrir le réseau Freifunk!
"
+
+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."
diff --git a/docs/site-example/i18n/gluon-site.pot b/docs/site-example/i18n/gluon-site.pot
index 670de410..7fe3293c 100644
--- a/docs/site-example/i18n/gluon-site.pot
+++ b/docs/site-example/i18n/gluon-site.pot
@@ -7,5 +7,14 @@ msgstr ""
msgid "gluon-config-mode:pubkey"
msgstr ""
+msgid "gluon-config-mode:novpn"
+msgstr ""
+
msgid "gluon-config-mode:reboot"
msgstr ""
+
+msgid "gluon-config-mode:altitude-label"
+msgstr ""
+
+msgid "gluon-config-mode:altitude-help"
+msgstr ""
diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf
index 6cffded8..4fa426ee 100644
--- a/docs/site-example/site.conf
+++ b/docs/site-example/site.conf
@@ -1,4 +1,4 @@
--- This is an example site configuration for Gluon v2015.1+
+-- This is an example site configuration for Gluon v2017.1+
--
-- Take a look at the documentation located at
-- http://gluon.readthedocs.org/ for details.
@@ -10,12 +10,14 @@
-- hostname_prefix = 'freifunk-',
-- Name of the community.
- site_name = 'Freifunk Entenhausen',
+ site_name = 'Freifunk Alpha Centauri',
-- Shorthand of the community.
site_code = 'ffxx',
- -- Prefixes used within the mesh. Both are required.
+ -- Prefixes used within the mesh.
+ -- prefix6 is required, prefix4 can be omitted if next_node.ip4
+ -- is not set.
prefix4 = '10.xxx.0.0/20',
prefix6 = 'fdxx:xxxx:xxxx::/64',
@@ -35,42 +37,40 @@
-- Wireless channel.
channel = 1,
+ -- List of supported wifi rates (optional)
+ -- Example removes 802.11b compatibility for better performance
+ supported_rates = {6000, 9000, 12000, 18000, 24000, 36000, 48000, 54000},
+
+ -- List of basic wifi rates (optional, required if supported_rates is set)
+ -- Example removes 802.11b compatibility for better performance
+ basic_rate = {6000, 9000, 18000, 36000, 54000},
+
-- ESSID used for client network.
- ssid = 'entenhausen.freifunk.net',
+ ap = {
+ ssid = 'alpha-centauri.freifunk.net',
+ -- disabled = true, (optional)
+ },
- -- Specifies the channel width in 802.11n and 802.11ac mode.
- -- Possible values are:
- -- HT20 (single 20MHz channel),
- -- HT40- (2x 20MHz channels, secondary below)
- -- HT40+ (2x 20MHz channels, secondary above)
- htmode = 'HT20',
-
- -- Adjust these values!
- mesh_ssid = 'xe:xx:xx:xx:xx:xx', -- ESSID used for mesh
- mesh_bssid = 'xe:xx:xx:xx:xx:xx', -- BSSID used for mesh
-
- -- Bitrate used for multicast/broadcast packets.
- mesh_mcast_rate = 12000,
-
- -- (optional) mesh VLAN on 802.11 ad-hoc interface (1-4095)
- -- mesh_vlan = 14,
- -- client_disabled = true,
- -- mesh_disabled = false,
+ mesh = {
+ -- Adjust these values!
+ id = 'ffxx-mesh',
+ mcast_rate = 12000,
+ -- disabled = true, (optional)
+ },
},
-- Wireless configuration for 5 GHz interfaces.
-- This should be equal to the 2.4 GHz variant, except
- -- for channel and htmode.
+ -- for channel.
wifi5 = {
- ssid = 'entenhausen.freifunk.net',
channel = 44,
- htmode = 'HT20',
- mesh_ssid = 'xx:xx:xx:xx:xx:xx',
- mesh_bssid = 'xx:xx:xx:xx:xx:xx',
- mesh_mcast_rate = 12000,
- -- mesh_vlan = 14,
- -- client_disabled = true,
- -- mesh_disabled = false,
+ ap = {
+ ssid = 'alpha-centauri.freifunk.net',
+ },
+ mesh = {
+ id = 'ffxx-mesh',
+ mcast_rate = 12000,
+ },
},
-- The next node feature allows clients to always reach the node it is
@@ -84,47 +84,74 @@
mac = 'xe:xx:xx:xx:xx:xx',
},
- -- Refer to http://fastd.readthedocs.org/en/latest/ to better understand
- -- what these options do.
- fastd_mesh_vpn = {
- -- List of crypto-methods to use.
- methods = {'salsa2012+umac'},
+ -- Options specific to routing protocols (optional)
+ -- mesh = {
+ -- Options specific to the batman-adv routing protocol (optional)
+ -- batman_adv = {
+ -- Gateway selection class (optional)
+ -- The default class 20 is based on the link quality (TQ) only,
+ -- class 1 is calculated from both the TQ and the announced bandwidth
+ -- gw_sel_class = 1,
+ -- },
+ -- },
+
+ mesh_vpn = {
-- enabled = true,
- -- configurable = true,
+ mtu = 1280,
- mtu = 1426,
- groups = {
- backbone = {
- -- Limit number of connected peers to reduce bandwidth.
- limit = 2,
+ fastd = {
+ -- Refer to http://fastd.readthedocs.org/en/latest/ to better understand
+ -- what these options do.
- -- List of peers.
- peers = {
- peer1 = {
- key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
+ -- List of crypto-methods to use.
+ methods = {'salsa2012+umac'},
+ -- configurable = true,
+ -- syslog_level = 'warn',
- -- This is a list, so you might add multiple entries.
- remotes = {'ipv4 "xxx.somehost.invalid" port xxxxxx'},
- },
- peer2 = {
- key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
- -- You can also omit the ipv4 to allow both connection via ipv4 and ipv6
- remotes = {'"xxx.somehost2.invalid" port xxxxx'},
+ groups = {
+ backbone = {
+ -- Limit number of connected peers to reduce bandwidth.
+ limit = 1,
+
+ -- List of peers.
+ peers = {
+ peer1 = {
+ key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
+
+ -- This is a list, so you might add multiple entries.
+ remotes = {'ipv4 "xxx.somehost.invalid" port xxxxxx'},
+ },
+ peer2 = {
+ key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
+ -- You can also omit the ipv4 to allow both connection via ipv4 and ipv6
+ remotes = {'"xxx.somehost2.invalid" port xxxxx'},
+ },
},
+
+ -- Optional: nested peer groups
+ -- groups = {
+ -- backbone_sub = {
+ -- ...
+ -- },
+ -- ...
+ -- },
},
-
- -- Optional: nested peer groups
- -- groups = {
- -- backbone_sub = {
- -- ...
- -- },
+ -- Optional: additional peer groups, possibly with other limits
+ -- backbone2 = {
-- ...
-- },
},
- -- Optional: additional peer groups, possibly with other limits
- -- backbone2 = {
- -- ...
- -- },
+ },
+
+ bandwidth_limit = {
+ -- The bandwidth limit can be enabled by default here.
+ enabled = false,
+
+ -- Default upload limit (kbit/s).
+ egress = 200,
+
+ -- Default download limit (kbit/s).
+ ingress = 3000,
},
},
@@ -167,24 +194,20 @@
-- },
-- },
- -- Bandwidth limiting
- simple_tc = {
- mesh_vpn = {
- ifname = 'mesh-vpn',
-
- -- You may enable it by default here.
- enabled = false,
-
- -- Default upload limit (kbit/s).
- limit_egress = 200,
-
- -- Default download limit (kbit/s).
- limit_ingress = 3000,
- },
- },
-
-- Skip setup mode (config mode) on first boot
-- setup_mode = {
-- skip = true,
-- },
+
+ -- config_mode = {
+ -- Show/hide the altitude field
+ -- geo_location = {
+ -- show_altitude = false,
+ -- },
+ -- define if the contact field is obligatory (optional)
+ -- owner = {
+ -- obligatory = true
+ -- },
+ -- },
+
}
diff --git a/docs/site-example/site.mk b/docs/site-example/site.mk
index 6a16eb53..6ec1172a 100644
--- a/docs/site-example/site.mk
+++ b/docs/site-example/site.mk
@@ -1,13 +1,11 @@
## gluon site.mk makefile example
## GLUON_SITE_PACKAGES
-# specify gluon/openwrt packages to include here
-# The gluon-mesh-batman-adv-* package must come first because of the dependency resolution
+# specify Gluon/LEDE packages to include here
GLUON_SITE_PACKAGES := \
- gluon-mesh-batman-adv-15 \
gluon-alfred \
- gluon-announced \
+ gluon-respondd \
gluon-autoupdater \
gluon-config-mode-autoupdater \
gluon-config-mode-contact-info \
@@ -17,17 +15,16 @@ GLUON_SITE_PACKAGES := \
gluon-config-mode-mesh-vpn \
gluon-ebtables-filter-multicast \
gluon-ebtables-filter-ra-dhcp \
- gluon-luci-admin \
- gluon-luci-autoupdater \
- gluon-luci-portconfig \
- gluon-luci-wifi-config \
- gluon-next-node \
+ gluon-web-admin \
+ gluon-web-autoupdater \
+ gluon-web-network \
+ gluon-web-wifi-config \
+ gluon-mesh-batman-adv-15 \
gluon-mesh-vpn-fastd \
gluon-radvd \
gluon-setup-mode \
gluon-status-page \
haveged \
- iptables \
iwinfo
## DEFAULT_GLUON_RELEASE
@@ -38,6 +35,7 @@ GLUON_SITE_PACKAGES := \
DEFAULT_GLUON_RELEASE := 0.6+exp$(shell date '+%Y%m%d')
+# Variables set with ?= can be overwritten from the command line
## GLUON_RELEASE
# call make with custom GLUON_RELEASE flag, to use your own release version scheme.
@@ -46,11 +44,13 @@ DEFAULT_GLUON_RELEASE := 0.6+exp$(shell date '+%Y%m%d')
# would generate images named like this:
# gluon-ff%site_code%-23.42+5-%router_model%.bin
-# Allow overriding the release number from the command line
GLUON_RELEASE ?= $(DEFAULT_GLUON_RELEASE)
# Default priority for updates.
GLUON_PRIORITY ?= 0
+# Region code required for some images; supported values: us eu
+GLUON_REGION ?= eu
+
# Languages to include
GLUON_LANGS ?= en de
diff --git a/docs/user/faq.rst b/docs/user/faq.rst
index 9da15270..40a4e521 100644
--- a/docs/user/faq.rst
+++ b/docs/user/faq.rst
@@ -1,3 +1,17 @@
Frequently Asked Questions
==========================
+.. _faq-dns:
+
+DNS does not work on the nodes
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Gluon nodes will ignore the DNS server on the WAN port for everything except
+the mesh VPN, which can lead to confusion.
+
+All normal services on the nodes exclusively use the DNS server on the mesh
+interface. This DNS server must be announced in router advertisements (using
+*radvd* or a similar software) from one or more central servers in meshes based
+on *batman-adv*. If your mesh does not have global IPv6 connectivity, you can setup
+your *radvd* not to announce a default route by setting the *default lifetime* to 0;
+in this case, the *radvd* is only used to announce the DNS server.
diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst
index 885a3887..1330bd91 100644
--- a/docs/user/getting_started.rst
+++ b/docs/user/getting_started.rst
@@ -4,18 +4,20 @@ Getting Started
Selecting the right version
---------------------------
-Gluon's releases are managed using `Git tags`_. If you're a community getting
+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.
Take a look at the `list of gluon releases`_ and notice the latest release,
-e.g. *v2014.3*.
+e.g. *v2017.1*. Always get Gluon using git and don't try to download it
+as a Zip archive as the archive will be missing version information.
-Please keep in mind that a matching site configuration for your community
-is required. Due to new features being added (or sometimes being removed)
-the format of the site configuration changes slightly between releases.
+Please keep in mind that there is no "default Gluon" build; a site configuration
+is required to adjust Gluon to your needs. Due to new features being added (or
+sometimes being removed) the format of the site configuration changes slightly
+between releases. Please refer to our release notes for instructions to update
+an old site configuration to a newer release of Gluon.
-Recent releases (starting with *v2014.3.1*) will come with an example
-configuration located in *docs/site-example/*.
+An example configuration can be found in the Gluon repository at *docs/site-example/*.
.. _Git tags: http://git-scm.com/book/en/Git-Basics-Tagging
.. _list of gluon releases: https://github.com/freifunk-gluon/gluon/releases
@@ -27,18 +29,21 @@ freshly installed Debian Wheezy system the following packages are required:
* `git` (to get Gluon and other dependencies)
* `subversion`
+* `python` (Python 3 doesn't work)
* `build-essential`
* `gawk`
* `unzip`
* `libncurses-dev` (actually `libncurses5-dev`)
* `libz-dev` (actually `zlib1g-dev`)
+* `libssl-dev`
+* `wget`
Building the images
-------------------
To build Gluon, first check out the repository. Replace *RELEASE* with the
-version you'd like to checkout, e.g. *v2015.1*.
+version you'd like to checkout, e.g. *v2017.1*.
::
@@ -47,88 +52,157 @@ version you'd like to checkout, e.g. *v2015.1*.
This command will create a directory named *gluon/*.
It might also tell a scary message about being in a *detached state*.
**Don't panic!** Everything's fine.
-Now, enter the freshly created directory:
-
-::
+Now, enter the freshly created directory::
cd gluon
-It's time to add (or create) your site configuration.
-So let's create the directory *site/*:
+It's time to add (or create) your site configuration. If you already
+have a site repository, just clone it::
-::
+ 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/*::
mkdir site
cd site
+ git init
-Copy *site.conf*, *site.mk* and *i18n* from *docs/site-example*:
-
-::
+Copy *site.conf*, *site.mk* and *i18n* from *docs/site-example*::
cp ../docs/site-example/site.conf .
cp ../docs/site-example/site.mk .
cp -r ../docs/site-example/i18n .
-Edit these files to match your community, then go back to the top-level Gluon
-directory and build Gluon:
+Edit these files as you see fit and commit them into the site repository.
+Extensive documentation about the site configuration can be found at:
+:doc:`site`. The
+site directory should always be a git repository by itself; committing site-specific files
+to the Gluon main repository should be avoided, as it will make updates more complicated.
-::
+Next go back to the top-level Gluon directory and build Gluon::
cd ..
make update # Get other repositories used by 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).
-``ar71xx-generic`` is the most common target and will generated images for most of the supported hardware.
+``ar71xx-generic`` is the most common target and will generate images for most of the supported hardware.
To see a complete list of supported targets, call ``make`` without setting ``GLUON_TARGET``.
-The built images can be found in the directory `images`. Of these, the factory
-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
-system.
-
You should reserve about 10GB of disk space for each `GLUON_TARGET`.
-There are two levels of `make clean`:
+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,
+and `sysupgrade` is to upgrade from other versions of Gluon or any other OpenWrt/LEDE-based
+system.
-::
+**Note:** The images for some models are identical; to save disk space, symlinks are generated instead
+of multiple copies of the same image. If your webserver's configuration prohibits following
+symlinks, you can use the following command to resolve these links while copying the images::
+
+ cp -rL output/images /var/www
+
+Cleaning the build tree
+.......................
+
+There are two levels of `make clean`::
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
-will clean the entire tree, so the toolchain will be rebuilt as well, which is
-not necessary in most cases, and will take a while.
+will clean the entire tree, so the toolchain will be rebuilt as well, which will take a while.
+opkg repositories
+-----------------
-Environment variables
----------------------
+Gluon is mostly compatible with LEDE, so the normal LEDE package repositories
+can be used for Gluon as well.
-Gluon's build process can be controlled by various environment variables.
+This is not true for kernel modules; the Gluon kernel is incompatible with the
+kernel of the default LEDE images. Therefore, Gluon will not only generate images,
+but also an opkg repository containing all core packages provided by LEDE,
+including modules for the kernel of the generated images.
-GLUON_SITEDIR
- Path to the site configuration. Defaults to ``site/``.
+Signing keys
+............
-GLUON_IMAGEDIR
- Path where images will be stored. Defaults to ``images/``.
+Gluon does not support HTTPS for downloading packages; fortunately, opkg deploys
+public-key cryptography to ensure package integrity.
+
+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 sign the generated package repository).
+
+LEDE will handle the generation and handling of the keys itself.
+When making firmware releases based on Gluon, it might make sense to store
+the keypair, so updating the module repository later is possible.
+
+.. _getting-started-make-variables:
+
+Make variables
+--------------
+
+Gluon's build process can be controlled by various variables. They can
+usually be set on the command line or in ``site.mk``.
+
+Common variables
+................
+
+GLUON_ATH10K_MESH
+ While Gluon does support some hardware with ath10k-based 5GHz WLAN, these WLAN adapters don't work
+ well for meshing at the moment, so building images for these models is disabled by default. In addition,
+ ath10k can't support IBSS and 11s meshing in the same image due to WLAN firmware restrictions.
+
+ Setting GLUON_ATH10K_MESH to ``11s`` or ``ibss`` will enable generation of images for ath10k devices
+ and install the firmware for the corresponding WLAN mode.
+
+GLUON_BRANCH
+ Sets the default branch of the autoupdater. If unset, the autoupdater is disabled
+ by default. For the ``make manifest`` command, GLUON_BRANCH defines the branch to
+ generate a manifest for.
+
+GLUON_LANGS
+ Space-separated list of languages to include for the config mode/advanced settings. Defaults to ``en``.
+ ``en`` should always be included, other supported languages are ``de`` and ``fr``.
+
+GLUON_PRIORITY
+ Defines the priority of an automatic update in ``make manifest``. See :doc:`../features/autoupdater` for
+ a detailed description of this value.
+
+GLUON_REGION
+ Some devices (at the moment the TP-Link Archer C7) contain a region code that restricts
+ firmware installations. Set GLUON_REGION to ``eu`` or ``us`` to make the resulting
+ images installable from the respective stock firmwares.
+
+GLUON_RELEASE
+ Firmware release number: This string is displayed in the config mode, announced
+ via respondd/alfred and used by the autoupdater to decide if a newer version
+ is available.
+
+GLUON_TARGET
+ Target architecture to build.
+
+Special variables
+.................
GLUON_BUILDDIR
- Working directory during build. Defaults to ``build/``.
+ Working directory during build. Defaults to ``build``.
+GLUON_IMAGEDIR
+ Path where images will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/images``.
-So all in all, 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):
+GLUON_PACKAGEDIR
+ Path where the opkg package repository will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/packages``.
-::
+GLUON_OUTPUTDIR
+ Path where output files will be stored. Defaults to ``output``.
- git pull
- (cd site && git pull)
- make update
- make clean GLUON_TARGET=ar71xx-generic
- make GLUON_TARGET=ar71xx-generic
+GLUON_SITEDIR
+ Path to the site configuration. Defaults to ``site``.
diff --git a/docs/user/site.rst b/docs/user/site.rst
index bf6c1650..011f25d9 100644
--- a/docs/user/site.rst
+++ b/docs/user/site.rst
@@ -1,5 +1,5 @@
-Site
-====
+Site configuration
+==================
The ``site`` consists of the files ``site.conf`` and ``site.mk``.
In the first community based values are defined, which both are processed
@@ -21,12 +21,14 @@ site_code
The code of your community. It is good practice to use the TLD of
your community here.
-prefix4
+prefix4 \: optional
The IPv4 Subnet of your community mesh network in CIDR notation, e.g.
::
prefix4 = '10.111.111.0/18'
+ Required if ``next_node.ip4`` is set.
+
prefix6
The IPv6 subnet of your community mesh network, e.g.
::
@@ -44,48 +46,105 @@ ntp_server
List of NTP servers available in your community or used by your community, e.g.:
::
- ntp_servers = {'1.ntp.services.ffeh','2.tnp.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
+ explicitly, but use a hostname (which is recommended), see also the :ref:`FAQ `.
+
+opkg \: optional
+ ``opkg`` package manager configuration.
+
+ There are two optional fields in the ``opkg`` section:
+
+ - ``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)
-opkg_repo : optional
- Overwrite the default ``opkg`` repository server, e.g.:
::
- opkg_repo = 'http://opkg.services.ffeh/attitude_adjustment/12.09/%S/packages'
+ opkg = {
+ lede = 'http://opkg.services.ffac/lede/snapshots/packages/%A',
+ extra = {
+ gluon = 'http://opkg.services.ffac/modules/gluon-%GS-%GR/%S',
+ },
+ }
- The `%S` is a variable, which is replaced with the platform of an device
- during the build process.
+ There are various patterns which can be used in the URLs:
-regdom
+ - ``%n`` is replaced by the LEDE version codename
+ - ``%v`` is replaced by the LEDE version number (e.g. "17.01")
+ - ``%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``)
+ - ``%GV`` is replaced by the Gluon version
+ - ``%GR`` is replaced by the Gluon release (as specified in ``site.mk``)
+
+regdom \: optional
The wireless regulatory domain responsible for your area, e.g.:
::
regdom = 'DE'
-wifi24
- WLAN Configuration of your community in the 2.4Ghz radio. Consisting
- of ``ssid`` of your client network, the ``channel`` your community is using,
- ``htmode``, the adhoc ssid ``mesh_ssid`` used between devices, the adhoc
- bssid ``mesh_bssid`` and the adhoc multicast rate ``mesh_mcast_rate``.
- Optionally ``mesh_vlan`` can be used to setup VLAN on top of the 802.11
- ad-hoc interface. The options ``mesh_disabled`` and ``client_disabled``
- are optional, too. They allow to disable the SSID by default, e.g. for
- preconfigured node. This only affects first configuraton.
- Combined in an dictionary, e.g.:
+ Setting ``regdom`` is mandatory if ``wifi24`` or ``wifi5`` is defined.
+
+wifi24 \: optional
+ WLAN configuration for 2.4 GHz devices.
+ ``channel`` must be set to a valid wireless channel for your radio.
+
+ There are currently three interface types available. You many choose to
+ configure any subset of them:
+
+ - ``ap`` creates a master interface where clients may connect
+ - ``mesh`` creates an 802.11s mesh interface with forwarding disabled
+ - ``ibss`` creates an ad-hoc interface
+
+ Each interface may be disabled by setting ``disabled`` to ``true``.
+ This will only affect new installations.
+ Upgrades will not change the disabled state.
+
+ 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.
+ If ``supported_rates`` is set, ``basic_rate`` is required, because ``basic_rate``
+ has to be a subset of ``supported_rates``.
+ The example below disables 802.11b rates.
+
+ ``ap`` requires a single parameter, a string, named ``ssid`` which sets the
+ interface's ESSID.
+
+ ``mesh`` requires a single parameter, a string, named ``id`` which sets the mesh id.
+
+ ``ibss`` requires two parametersr: ``ssid`` (a string) and ``bssid`` (a MAC).
+ An optional parameter ``vlan`` (integer) is supported.
+
+ Both ``mesh`` and ``ibss`` accept an optional ``mcast_rate`` (kbit/s) parameter for
+ setting the multicast bitrate. Increasing the default value of 1000 to something
+ like 12000 is recommended.
::
wifi24 = {
- ssid = 'entenhausen.freifunk.net',
channel = 11,
- htmode = 'HT40-',
- mesh_ssid = 'ff:ff:ff:ee:ba:be',
- mesh_bssid = 'ff:ff:ff:ee:ba:be',
- mesh_mcast_rate = 12000,
+ supported_rates = {6000, 9000, 12000, 18000, 24000, 36000, 48000, 54000},
+ basic_rate = {6000, 9000, 18000, 36000, 54000},
+ ap = {
+ ssid = 'alpha-centauri.freifunk.net',
+ },
+ mesh = {
+ id = 'alpha-centauri-mesh',
+ mcast_rate = 12000,
+ },
+ ibss = {
+ ssid = 'ff:ff:ff:ee:ba:be',
+ bssid = 'ff:ff:ff:ee:ba:be',
+ mcast_rate = 12000,
+ },
},
-wifi5
+wifi5 \: optional
Same as `wifi24` but for the 5Ghz radio.
-next_node : package
+next_node \: package
Configuration of the local node feature of Gluon
::
@@ -95,61 +154,156 @@ next_node : package
mac = 'ca:ff:ee:ba:be:00'
}
+ The IPv4 next-node address is optional.
-fastd_mesh_vpn
- Remote server setup for the fastd-based mesh VPN.
+mesh \: optional
+ Options specific to routing protocols.
- The `enabled` option can be set to true to enable the VPN by default.
+ At the moment, only the ``batman_adv`` routing protocol has such options:
- If `configurable` is `false` or unset, the method list will be replaced on updates
- with the list in the site configuration. Setting `configurable` to `true` will allow the user to
- add the method ``null`` to the front of the method list or remove ``null`` from it,
- and make this change survive updates. Settings configurable is necessary for the
- package `gluon-luci-mesh-vpn-fastd`, which adds a UI for this configuration.
+ The optional value ``gw_sel_class`` sets the gateway selection class. The default
+ class 20 is based on the link quality (TQ) only, class 1 is calculated from
+ both the TQ and the announced bandwidth.
+ ::
+
+ mesh = {
+ batman_adv = {
+ gw_sel_class = 1,
+ },
+ }
+
+
+mesh_vpn
+ Remote server setup for the mesh VPN.
+
+ The `enabled` option can be set to true to enable the VPN by default. `mtu`
+ defines the MTU of the VPN interface.
+
+ The `fastd` section configures settings specific to the *fastd* VPN
+ implementation.
+
+ If `configurable` is set to `false` or unset, the method list will be replaced on updates
+ with the list from the site configuration. Setting `configurable` to `true` will allow the user to
+ add the method ``null`` to the beginning of the method list or remove ``null`` from it,
+ and make this change survive updates. Setting `configurable` is necessary for the
+ package `gluon-web-mesh-vpn-fastd`, which adds a UI for this configuration.
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
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.
+
+ The `tunneldigger` section is used to define the *tunneldigger* broker list.
+
+ **Note:** It doesn't make sense to include both `fastd` and `tunneldigger`
+ sections in the same configuration file, as only one of the packages *gluon-mesh-vpn-fastd*
+ and *gluon-mesh-vpn-tunneldigger* should be installed with the current
+ implementation.
+
::
- fastd_mesh_vpn = {
- methods = {'salsa2012+umac'},
- -- enabled = true,
- -- configurable = true,
- mtu = 1426,
- groups = {
- backbone = {
- limit = 2,
- peers = {
- peer1 = {
- key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
- remotes = {'ipv4 "vpn1.entenhausen.freifunk.net" port 10000'},
+ mesh_vpn = {
+ -- enabled = true,
+ mtu = 1280,
+
+ fastd = {
+ methods = {'salsa2012+umac'},
+ -- configurable = true,
+ -- syslog_level = 'warn',
+ groups = {
+ backbone = {
+ -- Limit number of connected peers from this group
+ limit = 1,
+ peers = {
+ peer1 = {
+ key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
+ -- Having multiple domains prevents SPOF in freifunk.net
+ remotes = {
+ 'ipv4 "vpn1.alpha-centauri.freifunk.net" port 10000',
+ 'ipv4 "vpn1.alpha-centauri-freifunk.de" port 10000',
+ },
+ },
+ peer2 = {
+ key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
+ -- You can also omit the ipv4 to allow both connection via ipv4 and ipv6
+ remotes = {'"vpn2.alpha-centauri.freifunk.net" port 10000'},
+ },
+ peer3 = {
+ key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
+ -- In addition to domains you can also add ip addresses, which provides
+ -- resilience in case of dns outages
+ remotes = {
+ '"vpn3.alpha-centauri.freifunk.net" port 10000',
+ '[2001:db8::3:1]:10000',
+ '192.0.2.3:10000',
+ },
+ },
},
- }
- }
- }
+ -- Optional: nested peer groups
+ -- groups = {
+ -- lowend_backbone = {
+ -- limit = 1,
+ -- peers = ...
+ -- },
+ -- },
+ },
+ -- Optional: additional peer groups, possibly with other limits
+ -- peertopeer = {
+ -- limit = 10,
+ -- peers = { ... },
+ -- },
+ },
+ },
+
+ tunneldigger = {
+ brokers = {'vpn1.alpha-centauri.freifunk.net'}
+ },
+
+ bandwidth_limit = {
+ -- The bandwidth limit can be enabled by default here.
+ enabled = false,
+
+ -- Default upload limit (kbit/s).
+ egress = 200,
+
+ -- Default download limit (kbit/s).
+ ingress = 3000,
+ },
}
-mesh_on_wan : optional
+mesh_on_wan \: optional
Enables the mesh on the WAN port (``true`` or ``false``).
+ ::
-mesh_on_lan : optional
+ mesh_on_wan = true,
+
+mesh_on_lan \: optional
Enables the mesh on the LAN port (``true`` or ``false``).
+ ::
+
+ mesh_on_lan = true,
-autoupdater : package
+poe_passthrough \: optional
+ Enable PoE passthrough by default on hardware with such a feature.
+
+autoupdater \: package
Configuration for the autoupdater feature of Gluon.
+
+ The mirrors are checked in random order until the manifest could be downloaded
+ successfully or all mirrors have been tried.
::
autoupdater = {
- branch = 'experimental',
+ branch = 'stable',
branches = {
stable = {
name = 'stable',
mirrors = {
'http://[fdca:ffee:babe:1::fec1]/firmware/stable/sysupgrade/',
- 'http://[fdca:ffee:babe:1::fec2]/firmware/stable/sysupgrade/',
+ 'http://autoupdate.alpha-centauri.freifunk.net/firmware/stable/sysupgrade/',
},
- probability = 0.08,
+ -- Number of good signatures required
good_signatures = 2,
pubkeys = {
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', -- someguy
@@ -159,18 +313,21 @@ autoupdater : package
}
}
-roles : optional
- Optional role definitions. With this nodes will announce their role inside the mesh.
- In the backend this adds the facility to distinguish between normal, backbone and
- service nodes or even gateways (if they advertise the role, also). It is up to
+ All configured mirrors must be reachable from the nodes via IPv6. If you don't want to set an IPv6 address
+ explicitly, but use a hostname (which is recommended), see also the :ref:`FAQ `.
+
+roles \: optional
+ Optional role definitions. Nodes will announce their role inside the mesh.
+ This will allow in the backend to distinguish between normal, backbone and
+ service nodes or even gateways (if they advertise that role). It is up to
the community which roles to define. See the section below as an example.
``default`` takes the default role which is set initially. This value should be
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-web-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 web 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``.
+ ``gluon-web-node-role:role:node`` and ``gluon-web-node-role:role:backbone``.
::
roles = {
@@ -183,20 +340,7 @@ roles : optional
},
},
-simple_tc : package
- Uplink traffic control, ingress and egress values are specified in kbit/s.
- ::
-
- simple_tc = {
- mesh_vpn = {
- ifname = 'mesh-vpn',
- enabled = false,
- limit_egress = 200,
- limit_ingress = 3000,
- },
- },
-
-setup_mode : package
+setup_mode \: package
Allows skipping setup mode (config mode) at first boot when attribute
``skip`` is set to ``true``. This is optional and may be left out.
::
@@ -205,16 +349,16 @@ setup_mode : package
skip = true,
},
-legacy : package
+legacy \: package
Configuration for the legacy upgrade path.
This is only required in communities upgrading from Lübeck's LFF-0.3.x.
::
legacy = {
version_files = {'/etc/.freifunk_version_keep', '/etc/.eff_version_keep'},
- old_files = {'/etc/config/config_mode', '/etc/config/ffeh', '/etc/config/freifunk'},
- config_mode_configs = {'config_mode', 'ffeh', 'freifunk'},
- fastd_configs = {'ffeh_mesh_vpn', 'mesh_vpn'},
+ old_files = {'/etc/config/config_mode', '/etc/config/ffac', '/etc/config/freifunk'},
+ config_mode_configs = {'config_mode', 'ffac', 'freifunk'},
+ fastd_configs = {'ffac_mesh_vpn', 'mesh_vpn'},
mesh_ifname = 'freifunk',
tc_configs = {'ffki', 'freifunk'},
wifi_names = {'wifi_freifunk', 'wifi_freifunk5', 'wifi_mesh', 'wifi_mesh5'},
@@ -227,8 +371,8 @@ The ``site.mk`` is a Makefile which should define constants
involved in the build process of Gluon.
GLUON_SITE_PACKAGES
- Defines a list of packages which should installed additional
- to the ``gluon_core`` package.
+ Defines a list of packages which should be installed additionally
+ to the ``gluon-core`` package.
GLUON_RELEASE
The current release version Gluon should use.
@@ -237,8 +381,12 @@ GLUON_PRIORITY
The default priority for the generated manifests (see the autoupdater documentation
for more information).
+GLUON_REGION
+ Region code to build into images where necessary. Valid values are the empty string,
+ ``us`` and ``eu``.
+
GLUON_LANGS
- List of languages (as two-letter-codes) to include for the web interface. Should always contain
+ List of languages (as two-letter-codes) to be included in the web interface. Should always contain
``en``.
.. _site-config-mode-texts:
@@ -255,14 +403,67 @@ gluon-config-mode:welcome
gluon-config-mode:pubkey
Information about the public VPN key on the reboot page.
+gluon-config-mode:novpn
+ Information shown on the reboot page, if the mesh VPN was not selected.
+
+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
- General information about the reboot page.
+ General information shown on the reboot page.
There is a POT file in the site example directory which can be used to create templates
for the language files. The command ``msginit -l en -i ../../docs/site-example/i18n/gluon-site.pot``
can be used from the ``i18n`` directory to create an initial PO file called ``en.po`` if the ``gettext``
utilities are installed.
+.. note::
+
+ An empty ``msgstr``, as is the default after running ``msginit``, leads to
+ the ``msgid`` being printed as-is. It does *not* hide the whole text, as
+ might be expected.
+
+ Depending on the context, you might be able to use comments like
+ ```` as translations to effectively hide the text.
+
+Site modules
+------------
+
+The file ``modules`` in the site repository is completely optional and can be used
+to supply additional package feeds from which packages are built. The git repositories
+specified here are retrieved in addition to the default feeds when ``make update``
+it called.
+
+This file's format is very similar to the toplevel ``modules`` file of the Gluon
+tree, with the important different that the list of feeds must be assigned to
+the variable ``GLUON_SITE_FEEDS``. Multiple feed names must be separated by spaces,
+for example::
+
+ GLUON_SITE_FEEDS='foo bar'
+
+The feed names may only contain alphanumerical characters, underscores and slashes.
+For each of the feeds, the following variables are used to specify how to update
+the feed:
+
+PACKAGES_${feed}_REPO
+ The URL of the git repository to clone (usually ``git://`` or ``http(s)://``)
+
+PACKAGES_${feed}_COMMIT
+ The commit ID of the repository to use
+
+PACKAGES_${feed}_BRANCH
+ Optional: The branch of the repository the given commit ID can be found in.
+ Defaults to the default branch of the repository (usually ``master``)
+
+These variables are always all uppercase, so for an entry ``foo`` in GLUON_SITE_FEEDS,
+the corresponding configuration variables would be ``PACKAGES_FOO_REPO``,
+``PACKAGES_FOO_COMMIT`` and ``PACKAGES_FOO_BRANCH``. Slashes in feed names are
+replaced by underscores to get valid shell variable identifiers.
+
+
Examples
--------
@@ -301,22 +502,37 @@ site-repos in the wild
This is a non-exhaustive list of site-repos from various communities:
+* `site-ffa `_ (Altdorf, Landshut & Umgebung)
+* `site-ffac `_ (Regio Aachen)
* `site-ffbs `_ (Braunschweig)
* `site-ffhb `_ (Bremen)
* `site-ffda `_ (Darmstadt)
+* `site-ffeh `_ (Ehingen)
+* `site-fffl `_ (Flensburg)
* `site-ffgoe `_ (Göttingen)
+* `site-ffgt-rhw `_ (Guetersloh)
* `site-ffhh `_ (Hamburg)
+* `site-ffho `_ (Hochstift)
* `site-ffhgw `_ (Greifswald)
-* `site-ffhl `_ (Lübeck)
-* `site-ffmd `_ (Magdeburg)
-* `site-ffmwu `_ (Mainz, Wiesbaden & Umgebung)
-* `site-ffmyk `_ (Mayen-Koblenz)
-* `site-ffm `_ (München)
-* `site-ffms `_ (Münster)
-* `site-ffnw `_ (Nordwest)
-* `site-ffpb `_ (Paderborn)
* `site-ffka `_ (Karlsruhe)
-* `site-ffrl `_ (Rheinland)
-* `site-ffrg `_ (Ruhrgebiet)
+* `site-ffki `_ (Kiel)
+* `site-fflz `_ (Lausitz)
+* `site-ffl `_ (Leipzig)
+* `site-ffhl `_ (Lübeck)
+* `site-fflg `_ (Lüneburg)
+* `site-ffmd `_ (Magdeburg)
+* `site-ffmwu `_ (Mainz, Wiesbaden & Umgebung)
+* `site-ffmyk `_ (Mayen-Koblenz)
+* `site-ffmo `_ (Moers)
+* `site-ffmg `_ (Mönchengladbach)
+* `site-ffm `_ (München)
+* `site-ffhmue `_ (Münden)
+* `site-ffms `_ (Münsterland)
+* `site-neuss `_ (Neuss)
+* `site-ffniers `_ (Niersufer)
+* `site-ffnw `_ (Nordwest)
+* `site-ffrgb `_ (Regensburg)
+* `site-ffrn `_ (Rhein-Neckar)
+* `site-ffruhr `_ (Ruhrgebiet, Multi-Communities)
* `site-ffs `_ (Stuttgart)
* `site-fftr `_ (Trier)
diff --git a/docs/user/x86.rst b/docs/user/x86.rst
index b985d6fc..a65edfcc 100644
--- a/docs/user/x86.rst
+++ b/docs/user/x86.rst
@@ -2,12 +2,12 @@ x86 support
===========
Gluon can run on normal x86 systems, for example virtual machines
-and VPN boxes. There is no WLAN support on x86 though.
+and VPN boxes. By default, there is no WLAN support on x86 though.
Targets
^^^^^^^
-There are two targets for x86 images:
+The following targets for x86 images exist:
`x86-generic`
Generic x86 support with many different ethernet drivers; should run on
@@ -22,8 +22,8 @@ There are two targets for x86 images:
These images only differ in the image file format, the content is the same. Therefore there is
only a single `x86-generic` sysupgrade image instead of three.
- Please note that the `x86-generic` image doesn't include VirtIO support, so another virtual NIC
- like `pcnet32` must be chosen when using VirtualBox.
+`x86-geode`
+ x86 image for Geode CPUs.
-`x86-kvm`
- The `x86-kvm` image uses VirtIO as its harddisk and network driver.
+`x86-64`
+ 64bit version of `x86-generic`.
diff --git a/include/Makefile.target b/include/Makefile.target
deleted file mode 100644
index a78a4044..00000000
--- a/include/Makefile.target
+++ /dev/null
@@ -1,19 +0,0 @@
-# code adjusted from openwrt/include/kernel-defaults.mk
-
-override define Kernel/Configure
- $(LINUX_CONF_CMD) > $(LINUX_DIR)/.config.target
-# copy CONFIG_KERNEL_* settings over to .config.target
- awk '/^(#[[:space:]]+)?CONFIG_KERNEL/{sub("CONFIG_KERNEL_","CONFIG_");print}' $(BOARD_BUILDDIR)/config-allmods >> $(LINUX_DIR)/.config.target
- echo "# CONFIG_KALLSYMS_EXTRA_PASS is not set" >> $(LINUX_DIR)/.config.target
- echo "# CONFIG_KALLSYMS_ALL is not set" >> $(LINUX_DIR)/.config.target
- echo "# CONFIG_KALLSYMS_UNCOMPRESSED is not set" >> $(LINUX_DIR)/.config.target
- $(SCRIPT_DIR)/metadata.pl kconfig $(TMP_DIR)/.packageinfo $(BOARD_BUILDDIR)/config-allmods $(KERNEL_PATCHVER) > $(LINUX_DIR)/.config.override
- $(SCRIPT_DIR)/kconfig.pl 'm+' '+' $(LINUX_DIR)/.config.target /dev/null $(LINUX_DIR)/.config.override > $(LINUX_DIR)/.config
- $(call Kernel/SetNoInitramfs)
- rm -rf $(KERNEL_BUILD_DIR)/modules
- $(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(MAKE) $(KERNEL_MAKEOPTS) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
- cp $(GLUONDIR)/targets/$(GLUON_TARGET)/vermagic $(LINUX_DIR)/.vermagic
-endef
-
-# The Makefile included here is $(TOPDIR)/target/linux/$(BOARD)/Makefile
-include Makefile
diff --git a/include/config b/include/config
deleted file mode 100644
index ac1a4f8d..00000000
--- a/include/config
+++ /dev/null
@@ -1,22 +0,0 @@
-CONFIG_IMAGEOPT=y
-# CONFIG_PER_FEED_REPO is not set
-
-CONFIG_DEVEL=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_ATH10K_CT_COMMUNITY_FW=y
-
-CONFIG_LUCI_SRCDIET=y
diff --git a/include/gluon.mk b/include/gluon.mk
deleted file mode 100644
index fdccef20..00000000
--- a/include/gluon.mk
+++ /dev/null
@@ -1,72 +0,0 @@
-ifneq ($(__gluon_inc),1)
-__gluon_inc=1
-
-GLUON_SITEDIR ?= $(GLUONDIR)/site
-GLUON_IMAGEDIR ?= $(GLUONDIR)/images
-GLUON_BUILDDIR ?= $(GLUONDIR)/build
-
-GLUON_ORIGOPENWRTDIR := $(GLUONDIR)/openwrt
-GLUON_SITE_CONFIG := $(GLUON_SITEDIR)/site.conf
-
-export GLUONDIR GLUON_SITEDIR GLUON_SITE_CONFIG GLUON_IMAGEDIR GLUON_BUILDDIR
-
-
-BOARD_BUILDDIR = $(GLUON_BUILDDIR)/$(GLUON_TARGET)
-BOARD_KDIR = $(BOARD_BUILDDIR)/kernel
-
-export BOARD_BUILDDIR
-
-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)
-
-CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo http://downloads.openwrt.org/chaos_calmer/15.05-rc1/%S/packages)
-export CONFIG_VERSION_REPO
-
-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 kmod-ipv6 firewall ip6tables -uboot-envtools -wpad-mini hostapd-mini
-
-override DEFAULT_PACKAGES.router :=
-
-endif #__gluon_inc
diff --git a/include/package.mk b/include/package.mk
deleted file mode 100644
index 76e109e2..00000000
--- a/include/package.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-include $(INCLUDE_DIR)/package.mk
-
-# Annoyingly, make's shell function replaces all newlines with spaces, so we have to do some escaping work. Yuck.
-define GluonCheckSite
-[ -z "$$GLUONDIR" ] || sed -e 's/-@/\n/g' -e 's/+@/@/g' <<'END__GLUON__CHECK__SITE' | "$$GLUONDIR"/scripts/check_site.sh
-$(shell cat $(1) | sed -ne '1h; 1!H; $$ {g; s/@/+@/g; s/\n/-@/g; p}')
-END__GLUON__CHECK__SITE
-endef
-
-# Languages supported by LuCi
-GLUON_SUPPORTED_LANGS := ca zh_cn en fr de el he hu it ja ms no pl pt_br pt ro ru es sv uk vi
-
-GLUON_I18N_PACKAGES := $(foreach lang,$(GLUON_SUPPORTED_LANGS),+LUCI_LANG_$(lang):luci-i18n-base-$(lang))
-GLUON_I18N_CONFIG := $(foreach lang,$(GLUON_SUPPORTED_LANGS),CONFIG_LUCI_LANG_$(lang))
-GLUON_ENABLED_LANGS := $(foreach lang,$(GLUON_SUPPORTED_LANGS),$(if $(CONFIG_LUCI_LANG_$(lang)),$(lang)))
-
-
-define GluonBuildI18N
- mkdir -p $$(PKG_BUILD_DIR)/i18n
- for lang in $$(GLUON_ENABLED_LANGS); do \
- if [ -e $(2)/$$$$lang.po ]; then \
- rm -f $$(PKG_BUILD_DIR)/i18n/$(1).$$$$lang.lmo; \
- po2lmo $(2)/$$$$lang.po $$(PKG_BUILD_DIR)/i18n/$(1).$$$$lang.lmo; \
- fi; \
- done
-endef
-
-define GluonInstallI18N
- $$(INSTALL_DIR) $(2)/usr/lib/lua/luci/i18n
- for lang in $$(GLUON_ENABLED_LANGS); do \
- if [ -e $$(PKG_BUILD_DIR)/i18n/$(1).$$$$lang.lmo ]; then \
- $$(INSTALL_DATA) $$(PKG_BUILD_DIR)/i18n/$(1).$$$$lang.lmo $(2)/usr/lib/lua/luci/i18n/$(1).$$$$lang.lmo; \
- fi; \
- done
-endef
diff --git a/include/toplevel.mk b/include/toplevel.mk
deleted file mode 100644
index 72522da5..00000000
--- a/include/toplevel.mk
+++ /dev/null
@@ -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:=Barrier Breaker
-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:
-
diff --git a/include/verbose.mk b/include/verbose.mk
deleted file mode 100644
index d34f55fc..00000000
--- a/include/verbose.mk
+++ /dev/null
@@ -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
diff --git a/modules b/modules
index 783113be..c3a0802d 100644
--- a/modules
+++ b/modules
@@ -1,19 +1,19 @@
GLUON_FEEDS='openwrt gluon routing luci'
-OPENWRT_REPO=git://git.openwrt.org/openwrt.git
-OPENWRT_COMMIT=08ac77da771204772119aeecf6826a5da4a0a45f
+LEDE_REPO=https://git.lede-project.org/source.git
+LEDE_BRANCH=lede-17.01
+LEDE_COMMIT=65eec8bd5f6337956b972d07fde49eb5db9cb4a0
-PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git
-PACKAGES_OPENWRT_COMMIT=4c4c2dbdae02b38eff4a6abd95cfd54f61702246
-PACKAGES_OPENWRT_BRANCH=for-15.05
+PACKAGES_OPENWRT_REPO=https://github.com/openwrt/packages.git
+PACKAGES_OPENWRT_BRANCH=lede-17.01
+PACKAGES_OPENWRT_COMMIT=8844d7e2d4f717898c55c6345ad3b43fca52c440
-PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git
-PACKAGES_GLUON_COMMIT=dcc5a5ab74822492877eadcba5fc3ad845ee65db
+PACKAGES_GLUON_REPO=https://github.com/freifunk-gluon/packages.git
+PACKAGES_GLUON_COMMIT=71823713c0e9451d1cd459cb10309f468188eb6e
-PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git
-PACKAGES_ROUTING_COMMIT=2bca6fb55f898c08e4227d35533fda2486c8983c
-PACKAGES_ROUTING_BRANCH=for-15.05
+PACKAGES_ROUTING_REPO=https://github.com/openwrt-routing/packages.git
+PACKAGES_ROUTING_COMMIT=8d9d70510b2c86f7503962308846ec874f0eb39f
-PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git
-PACKAGES_LUCI_COMMIT=a497fbab4c4d7e3228c67a93e107000f7e70fd1f
-PACKAGES_LUCI_BRANCH=for-15.05
+PACKAGES_LUCI_REPO=https://github.com/openwrt/luci.git
+PACKAGES_LUCI_BRANCH=lede-17.01
+PACKAGES_LUCI_COMMIT=1f014bd2180b364bec4c3f6457f72a0621884f9a
diff --git a/overlay/opkg.mk b/overlay/opkg.mk
new file mode 100644
index 00000000..ccbd2573
--- /dev/null
+++ b/overlay/opkg.mk
@@ -0,0 +1,10 @@
+# LEDE doesn't have a nice way to set the list of feeds in
+# /etc/opkg/distfeeds.conf, so we use this overlay file (which is included by
+# the opkg package Makefile though LEDE's IncludeOverlay mechanism).
+
+# The following definitions make /etc/opkg/distfeeds.conf match the one included
+# in official LEDE builds (by default, FEEDS_DISABLED contains the original list
+# of feeds (which are unused by Gluon), and FEEDS_ENABLED our own feed list).
+
+FEEDS_ENABLED := $(FEEDS_DISABLED)
+FEEDS_DISABLED :=
diff --git a/package/gluon-alfred/Makefile b/package/gluon-alfred/Makefile
index bb6926a5..be0ff0da 100644
--- a/package/gluon-alfred/Makefile
+++ b/package/gluon-alfred/Makefile
@@ -6,12 +6,13 @@ PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-include $(INCLUDE_DIR)/package.mk
+include ../gluon.mk
+
define Package/gluon-alfred
SECTION:=gluon
CATEGORY:=Gluon
- DEPENDS:=+gluon-core +gluon-announce +gluon-cron +alfred
+ DEPENDS:=+gluon-core +gluon-respondd +gluon-neighbour-info gluon-mesh-batman-adv +micrond +alfred
TITLE:=Configure alfred
endef
@@ -23,10 +24,12 @@ define Build/Configure
endef
define Build/Compile
+ $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
endef
define Package/gluon-alfred/install
$(CP) ./files/* $(1)/
+ $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
endef
$(eval $(call BuildPackage,gluon-alfred))
diff --git a/package/gluon-alfred/files/lib/gluon/cron/alfred b/package/gluon-alfred/files/lib/gluon/cron/alfred
deleted file mode 100644
index 9f79bc64..00000000
--- a/package/gluon-alfred/files/lib/gluon/cron/alfred
+++ /dev/null
@@ -1 +0,0 @@
-* * * * * /lib/gluon/announce/collect.lua nodeinfo | gzip | alfred -s 158; /lib/gluon/announce/collect.lua statistics | gzip | alfred -s 159; /lib/gluon/announce/collect.lua neighbours | gzip | alfred -s 160
diff --git a/package/gluon-alfred/files/lib/gluon/upgrade/500-enable-alfred b/package/gluon-alfred/files/lib/gluon/upgrade/500-enable-alfred
deleted file mode 100755
index 8c52d8a6..00000000
--- a/package/gluon-alfred/files/lib/gluon/upgrade/500-enable-alfred
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/lua
-
-local uci = require 'luci.model.uci'
-local c = uci.cursor()
-
-
-c:delete('alfred', 'alfred')
-c:section('alfred', 'alfred', 'alfred',
- {
- interface = 'br-client',
- mode = 'slave',
- batmanif = 'bat0',
- start_vis = '1',
- run_facters = '0',
- }
-)
-
-c:save('alfred')
-c:commit('alfred')
diff --git a/package/gluon-alfred/files/usr/lib/autoupdater/abort.d/60gluon-alfred b/package/gluon-alfred/files/usr/lib/autoupdater/abort.d/60gluon-alfred
new file mode 100755
index 00000000..621c09a0
--- /dev/null
+++ b/package/gluon-alfred/files/usr/lib/autoupdater/abort.d/60gluon-alfred
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. /lib/gluon/autoupdater/lib.sh
+
+
+start_enabled alfred
diff --git a/package/gluon-alfred/files/usr/lib/autoupdater/download.d/40gluon-alfred b/package/gluon-alfred/files/usr/lib/autoupdater/download.d/40gluon-alfred
new file mode 100755
index 00000000..19427620
--- /dev/null
+++ b/package/gluon-alfred/files/usr/lib/autoupdater/download.d/40gluon-alfred
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. /lib/gluon/autoupdater/lib.sh
+
+
+stop alfred
diff --git a/package/gluon-alfred/files/usr/lib/micron.d/alfred b/package/gluon-alfred/files/usr/lib/micron.d/alfred
new file mode 100644
index 00000000..87c052b2
--- /dev/null
+++ b/package/gluon-alfred/files/usr/lib/micron.d/alfred
@@ -0,0 +1 @@
+* * * * * gluon-neighbour-info -d ::1 -p 1001 -t 1 -c 1 -r nodeinfo | gzip | alfred -s 158; gluon-neighbour-info -d ::1 -p 1001 -t 1 -c 1 -r statistics | gzip | alfred -s 159; gluon-neighbour-info -d ::1 -p 1001 -t 1 -c 1 -r neighbours | gzip | alfred -s 160
diff --git a/package/gluon-alfred/luasrc/lib/gluon/upgrade/500-enable-alfred b/package/gluon-alfred/luasrc/lib/gluon/upgrade/500-enable-alfred
new file mode 100755
index 00000000..e1a28080
--- /dev/null
+++ b/package/gluon-alfred/luasrc/lib/gluon/upgrade/500-enable-alfred
@@ -0,0 +1,14 @@
+#!/usr/bin/lua
+
+local uci = require('simple-uci').cursor()
+
+uci:delete('alfred', 'alfred')
+uci:section('alfred', 'alfred', 'alfred', {
+ interface = 'br-client',
+ mode = 'slave',
+ batmanif = 'bat0',
+ start_vis = true,
+ run_facters = false,
+})
+
+uci:save('alfred')
diff --git a/package/gluon-announce/Makefile b/package/gluon-announce/Makefile
deleted file mode 100644
index 3f62c889..00000000
--- a/package/gluon-announce/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gluon-announce
-PKG_VERSION:=1
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/gluon-announce
- SECTION:=gluon
- CATEGORY:=Gluon
- DEPENDS:=+gluon-core +luci-lib-json +lua-ethtool-stats
- TITLE:=Lua scripts announcing various information
-endef
-
-define Build/Prepare
- mkdir -p $(PKG_BUILD_DIR)
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/gluon-announce/install
- $(CP) ./files/* $(1)/
-endef
-
-$(eval $(call BuildPackage,gluon-announce))
diff --git a/package/gluon-announce/files/lib/gluon/announce/collect.lua b/package/gluon-announce/files/lib/gluon/announce/collect.lua
deleted file mode 100755
index e2974b49..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/collect.lua
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/lua
-
-local announce = require 'gluon.announce'
-local json = require 'luci.json'
-local ltn12 = require 'luci.ltn12'
-
-local announce_dir = '/lib/gluon/announce/' .. arg[1] .. '.d'
-
-encoder = json.Encoder(announce.collect_dir(announce_dir))
-ltn12.pump.all(encoder:source(), ltn12.sink.file(io.stdout))
diff --git a/package/gluon-announce/files/lib/gluon/announce/neighbours.d/node_id b/package/gluon-announce/files/lib/gluon/announce/neighbours.d/node_id
deleted file mode 100644
index 66303f4c..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/neighbours.d/node_id
+++ /dev/null
@@ -1 +0,0 @@
-return require('gluon.util').node_id()
diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/model b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/model
deleted file mode 100644
index aee3cd81..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/model
+++ /dev/null
@@ -1 +0,0 @@
-return require('platform_info').get_model()
diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/nproc b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/nproc
deleted file mode 100644
index 3072f8f8..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hardware/nproc
+++ /dev/null
@@ -1,14 +0,0 @@
-local n = 0
-
-local cpus = util.trim(fs.readfile('/sys/devices/system/cpu/online'))
-
-for _, entry in ipairs(cpus:split(',')) do
- local x, y = entry:match('(%d+)-(%d+)')
- if x then
- n = n + tonumber(y) - tonumber(x) + 1
- else
- n = n + 1
- end
-end
-
-return n
diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hostname b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hostname
deleted file mode 100644
index 7d4f0521..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/hostname
+++ /dev/null
@@ -1 +0,0 @@
-return uci:get_first('system', 'system', 'hostname')
diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/network/mac b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/network/mac
deleted file mode 100644
index 049eea58..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/network/mac
+++ /dev/null
@@ -1 +0,0 @@
-return require('gluon.sysconfig').primary_mac
diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/node_id b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/node_id
deleted file mode 100644
index 66303f4c..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/node_id
+++ /dev/null
@@ -1 +0,0 @@
-return require('gluon.util').node_id()
diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/software/firmware b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/software/firmware
deleted file mode 100644
index cf50f79f..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/software/firmware
+++ /dev/null
@@ -1,4 +0,0 @@
-return {
- base = 'gluon-' .. util.trim(fs.readfile('/lib/gluon/gluon-version')),
- release = util.trim(fs.readfile('/lib/gluon/release')),
-}
diff --git a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/system/site_code b/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/system/site_code
deleted file mode 100644
index 876fb6d8..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/nodeinfo.d/system/site_code
+++ /dev/null
@@ -1,3 +0,0 @@
-local site = require 'gluon.site_config'
-
-return site.site_code
diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/idletime b/package/gluon-announce/files/lib/gluon/announce/statistics.d/idletime
deleted file mode 100644
index 845de268..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/idletime
+++ /dev/null
@@ -1 +0,0 @@
-return tonumber(fs.readfile('/proc/uptime'):match('^[^ ]+ ([^ ]+)'))
diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/loadavg b/package/gluon-announce/files/lib/gluon/announce/statistics.d/loadavg
deleted file mode 100644
index d79973aa..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/loadavg
+++ /dev/null
@@ -1 +0,0 @@
-return tonumber(fs.readfile('/proc/loadavg'):match('^([^ ]+) '))
diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/memory b/package/gluon-announce/files/lib/gluon/announce/statistics.d/memory
deleted file mode 100644
index 7b07a107..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/memory
+++ /dev/null
@@ -1,13 +0,0 @@
-local data = fs.readfile('/proc/meminfo')
-
-local fields = {}
-for k, v in data:gmatch('([^\n:]+):%s*(%d+) kB') do
- fields[k] = tonumber(v)
-end
-
-return {
- total = fields.MemTotal,
- free = fields.MemFree,
- buffers = fields.Buffers,
- cached = fields.Cached,
-}
diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/node_id b/package/gluon-announce/files/lib/gluon/announce/statistics.d/node_id
deleted file mode 100644
index 66303f4c..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/node_id
+++ /dev/null
@@ -1 +0,0 @@
-return require('gluon.util').node_id()
diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/processes b/package/gluon-announce/files/lib/gluon/announce/statistics.d/processes
deleted file mode 100644
index 33ecff66..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/processes
+++ /dev/null
@@ -1,3 +0,0 @@
-local running, total = fs.readfile('/proc/loadavg'):match('^[^ ]+ [^ ]+ [^ ]+ (%d+)/(%d+)')
-
-return { running = tonumber(running), total = tonumber(total) }
diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/rootfs_usage b/package/gluon-announce/files/lib/gluon/announce/statistics.d/rootfs_usage
deleted file mode 100644
index 8426e9e1..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/rootfs_usage
+++ /dev/null
@@ -1,4 +0,0 @@
-local fs = require "nixio.fs"
-
-local st = fs.statvfs("/")
-return 1 - st.bfree / st.blocks
diff --git a/package/gluon-announce/files/lib/gluon/announce/statistics.d/uptime b/package/gluon-announce/files/lib/gluon/announce/statistics.d/uptime
deleted file mode 100644
index 0bc45bea..00000000
--- a/package/gluon-announce/files/lib/gluon/announce/statistics.d/uptime
+++ /dev/null
@@ -1 +0,0 @@
-return tonumber(fs.readfile('/proc/uptime'):match('^([^ ]+) '))
diff --git a/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua b/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua
deleted file mode 100644
index 17109785..00000000
--- a/package/gluon-announce/files/usr/lib/lua/gluon/announce.lua
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/lua
-
-module('gluon.announce', package.seeall)
-
-fs = require 'nixio.fs'
-uci = require('luci.model.uci').cursor()
-util = require 'luci.util'
-
-local function collect_entry(entry)
- if fs.stat(entry, 'type') == 'dir' then
- return collect_dir(entry)
- else
- return setfenv(loadfile(entry), _M)()
- end
-end
-
-function collect_dir(dir)
- local ret = {}
-
- for entry in fs.dir(dir) do
- if entry:sub(1, 1) ~= '.' then
- local ok, val = pcall(collect_entry, dir .. '/' .. entry)
- if ok then
- ret[entry] = val
- else
- io.stderr:write(val, '\n')
- end
- end
- end
-
- return ret
-end
-
diff --git a/package/gluon-announced/Makefile b/package/gluon-announced/Makefile
deleted file mode 100644
index d5b06dce..00000000
--- a/package/gluon-announced/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gluon-announced
-PKG_VERSION:=2
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/gluon-announced
- SECTION:=gluon
- CATEGORY:=Gluon
- TITLE:=Provides node information to the network
- DEPENDS:=+gluon-announce +respondd +lua-deflate
-endef
-
-define Build/Prepare
- mkdir -p $(PKG_BUILD_DIR)
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/gluon-announced/install
- $(CP) ./files/* $(1)/
-endef
-
-$(eval $(call BuildPackage,gluon-announced))
diff --git a/package/gluon-announced/files/etc/hotplug.d/iface/10-gluon-announced b/package/gluon-announced/files/etc/hotplug.d/iface/10-gluon-announced
deleted file mode 100644
index a1e2c45f..00000000
--- a/package/gluon-announced/files/etc/hotplug.d/iface/10-gluon-announced
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-. /usr/share/libubox/jshn.sh
-. /lib/functions/service.sh
-
-DEVLIST=/var/run/gluon-announced.devs
-DAEMON=/usr/bin/respondd
-
-ifname_to_dev () {
- json_load "$(ubus call network.interface.$1 status)"
- json_get_var dev device
-
- echo "$dev"
-}
-
-restart_announced () {
- SERVICE_USE_PID=1
- SERVICE_WRITE_PID=1
- SERVICE_DAEMONIZE=1
-
- DEVS=$(cat $DEVLIST | while read dev iface; do echo -n " -i $dev"; done)
-
- service_stop $DAEMON
- service_start $DAEMON -g ff02::2:1001 -p 1001 -c 'return require("gluon.announced").handle_request' $DEVS
-}
-
-case "$ACTION" in
- ifdown)
- sed -i "/$INTERFACE/d" $DEVLIST
- ;;
- ifup)
- DEVICE="$(ifname_to_dev "$INTERFACE")"
- MESH="$(cat "/sys/class/net/$DEVICE/batman_adv/mesh_iface" 2>/dev/null)"
-
- [ "$MESH" = "bat0" -o "$INTERFACE" = "client" ] || exit 0
-
- DEVS=$(cat $DEVLIST; echo $DEVICE $INTERFACE)
-
- echo "$DEVS" | sort -u > $DEVLIST
-
- restart_announced
-
- ;;
-esac
-
diff --git a/package/gluon-announced/files/lib/gluon/upgrade/400-announced-firewall b/package/gluon-announced/files/lib/gluon/upgrade/400-announced-firewall
deleted file mode 100755
index 77acb1b9..00000000
--- a/package/gluon-announced/files/lib/gluon/upgrade/400-announced-firewall
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/lua
-
-local uci = require('luci.model.uci').cursor()
-
--- Allow announced port on WAN to allow resolving neighbours over mesh-on-wan
-uci:section('firewall', 'rule', 'wan_announced',
- {
- name = 'wan_announced',
- src = 'wan',
- src_ip = 'fe80::/64',
- dest_port = '1001',
- proto = 'udp',
- target = 'ACCEPT',
- }
-)
-
-uci:save('firewall')
-uci:commit('firewall')
diff --git a/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua b/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua
deleted file mode 100644
index 99116b81..00000000
--- a/package/gluon-announced/files/usr/lib/lua/gluon/announced.lua
+++ /dev/null
@@ -1,33 +0,0 @@
-local announce = require 'gluon.announce'
-local deflate = require 'deflate'
-local json = require 'luci.json'
-
-
-local function collect(type)
- return announce.collect_dir('/lib/gluon/announce/' .. type .. '.d')
-end
-
-
-module('gluon.announced', package.seeall)
-
-function handle_request(query)
- if query:match('^nodeinfo$') then
- return json.encode(collect('nodeinfo'))
- end
-
- local m = query:match('^GET ([a-z ]+)$')
- if m then
- local data = {}
-
- for q in m:gmatch('([a-z]+)') do
- local ok, val = pcall(collect, q)
- if ok then
- data[q] = val
- end
- end
-
- if next(data) then
- return deflate.compress(json.encode(data))
- end
- end
-end
diff --git a/package/gluon-authorized-keys/Makefile b/package/gluon-authorized-keys/Makefile
index 6ef90da3..7d010dc9 100644
--- a/package/gluon-authorized-keys/Makefile
+++ b/package/gluon-authorized-keys/Makefile
@@ -5,7 +5,8 @@ PKG_VERSION:=2
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-include $(GLUONDIR)/include/package.mk
+include ../gluon.mk
+
define Package/gluon-authorized-keys
SECTION:=gluon
@@ -22,10 +23,11 @@ define Build/Configure
endef
define Build/Compile
+ $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
endef
define Package/gluon-authorized-keys/install
- $(CP) ./files/* $(1)/
+ $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
endef
define Package/gluon-authorized-keys/postinst
diff --git a/package/gluon-authorized-keys/files/lib/gluon/upgrade/100-authorized-keys b/package/gluon-authorized-keys/luasrc/lib/gluon/upgrade/100-authorized-keys
similarity index 100%
rename from package/gluon-authorized-keys/files/lib/gluon/upgrade/100-authorized-keys
rename to package/gluon-authorized-keys/luasrc/lib/gluon/upgrade/100-authorized-keys
diff --git a/package/gluon-autoupdater/Makefile b/package/gluon-autoupdater/Makefile
index b33bada9..eacf80c1 100644
--- a/package/gluon-autoupdater/Makefile
+++ b/package/gluon-autoupdater/Makefile
@@ -2,36 +2,51 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-autoupdater
PKG_VERSION:=4
-PKG_RELEASE:=$(GLUON_BRANCH)
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-include $(GLUONDIR)/include/package.mk
+PKG_CONFIG_DEPENDS := CONFIG_GLUON_BRANCH
+PKG_BUILD_DEPENDS := respondd
+
+
+include ../gluon.mk
+
define Package/gluon-autoupdater
SECTION:=gluon
CATEGORY:=Gluon
- DEPENDS:=+gluon-core +gluon-cron +autoupdater
+ DEPENDS:=+gluon-core +libgluonutil +micrond +autoupdater
TITLE:=Automatically update firmware
endef
+define Package/gluon-autoupdater/config
+config GLUON_BRANCH
+ string "Gluon autoupdater branch"
+ depends on PACKAGE_gluon-autoupdater
+ default ""
+endef
+
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
-endef
-
-define Build/Configure
+ $(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
+ $(call Build/Compile/Default)
+ $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
endef
define Package/gluon-autoupdater/install
$(CP) ./files/* $(1)/
+ $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
- if [ '$(GLUON_BRANCH)' ]; then \
- $(INSTALL_DIR) $(1)/lib/gluon/autoupdater; \
- echo '$(GLUON_BRANCH)' > $(1)/lib/gluon/autoupdater/default_branch; \
- fi
+ $(INSTALL_DIR) $(1)/lib/gluon/respondd
+ $(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/autoupdater.so
+
+ifneq ($(CONFIG_GLUON_BRANCH),"")
+ $(INSTALL_DIR) $(1)/lib/gluon/autoupdater
+ echo '$(call qstrip,$(CONFIG_GLUON_BRANCH))' > $(1)/lib/gluon/autoupdater/default_branch
+endif
endef
define Package/gluon-autoupdater/postinst
diff --git a/package/gluon-autoupdater/check_site.lua b/package/gluon-autoupdater/check_site.lua
index 1d8996f0..3eb2e721 100644
--- a/package/gluon-autoupdater/check_site.lua
+++ b/package/gluon-autoupdater/check_site.lua
@@ -1,12 +1,14 @@
need_string 'autoupdater.branch'
local function check_branch(k, _)
+ assert_uci_name(k)
+
local prefix = string.format('autoupdater.branches[%q].', k)
need_string(prefix .. 'name')
need_string_array(prefix .. 'mirrors')
need_number(prefix .. 'good_signatures')
- need_string_array(prefix .. 'pubkeys')
+ need_string_array_match(prefix .. 'pubkeys', '^%x+$')
end
need_table('autoupdater.branches', check_branch)
diff --git a/package/gluon-autoupdater/files/lib/gluon/announce/nodeinfo.d/software/autoupdater b/package/gluon-autoupdater/files/lib/gluon/announce/nodeinfo.d/software/autoupdater
deleted file mode 100644
index 75a67578..00000000
--- a/package/gluon-autoupdater/files/lib/gluon/announce/nodeinfo.d/software/autoupdater
+++ /dev/null
@@ -1,7 +0,0 @@
-local autoupdater = uci:get_all('autoupdater', 'settings')
-if autoupdater then
- return {
- branch = autoupdater['branch'],
- enabled = uci:get_bool('autoupdater', 'settings', 'enabled'),
- }
-end
diff --git a/package/gluon-autoupdater/files/lib/gluon/autoupdater/lib.sh b/package/gluon-autoupdater/files/lib/gluon/autoupdater/lib.sh
new file mode 100644
index 00000000..24ef2f90
--- /dev/null
+++ b/package/gluon-autoupdater/files/lib/gluon/autoupdater/lib.sh
@@ -0,0 +1,16 @@
+# Library to be sourced by download.d/abort.d scripts
+
+
+stop() {
+ if [ -x /etc/init.d/"$1" ]; then
+ echo "Stopping $1..."
+ /etc/init.d/"$1" stop
+ fi
+}
+
+start_enabled() {
+ if [ -x /etc/init.d/"$1" ] && /etc/init.d/"$1" enabled; then
+ echo "Starting $1..."
+ /etc/init.d/"$1" start
+ fi
+}
diff --git a/package/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater b/package/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater
deleted file mode 100755
index fec313b3..00000000
--- a/package/gluon-autoupdater/files/lib/gluon/upgrade/500-autoupdater
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/lua
-
-local site = require 'gluon.site_config'
-local uci = require 'luci.model.uci'
-
-local c = uci.cursor()
-
-
-for name, config in pairs(site.autoupdater.branches) do
- c:delete('autoupdater', name)
- c:section('autoupdater', 'branch', name,
- {
- name = config.name,
- mirror = config.mirrors,
- good_signatures = config.good_signatures,
- pubkey = config.pubkeys,
- }
- )
-end
-
-if not c:get('autoupdater', 'settings') then
- local enabled = 0
- local branch = site.autoupdater.branch
-
- local f = io.open('/lib/gluon/autoupdater/default_branch')
- if f then
- enabled = 1
- branch = f:read('*line')
- f:close()
- end
-
- c:section('autoupdater', 'autoupdater', 'settings',
- {
- enabled = enabled,
- branch = branch,
- }
- )
-end
-
-c:set('autoupdater', 'settings', 'version_file', '/lib/gluon/release')
-
-c:save('autoupdater')
-c:commit('autoupdater')
-
-
-local autoupdater_util = require 'autoupdater.util'
-autoupdater_util.randomseed()
-
-
--- Perform updates at a random time between 04:00 and 05:00, and once an hour
--- a fallback update (used after the regular updates haven't
-local minute = math.random(0, 59)
-
-local f = io.open('/lib/gluon/cron/autoupdater', 'w')
-f:write(string.format('%i 4 * * * /usr/sbin/autoupdater\n', minute))
-f:write(string.format('%i 0-3,5-23 * * * /usr/sbin/autoupdater --fallback\n', minute))
-f:close()
diff --git a/package/gluon-autoupdater/files/usr/lib/autoupdater/abort.d/90gluon-autoupdater b/package/gluon-autoupdater/files/usr/lib/autoupdater/abort.d/90gluon-autoupdater
new file mode 100755
index 00000000..19def950
--- /dev/null
+++ b/package/gluon-autoupdater/files/usr/lib/autoupdater/abort.d/90gluon-autoupdater
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+. /lib/gluon/autoupdater/lib.sh
+
+
+start_enabled cron
+start_enabled haveged
+start_enabled micrond
+start_enabled sysntpd
diff --git a/package/gluon-autoupdater/files/usr/lib/autoupdater/download.d/10gluon-autoupdater b/package/gluon-autoupdater/files/usr/lib/autoupdater/download.d/10gluon-autoupdater
new file mode 100755
index 00000000..6f2268fe
--- /dev/null
+++ b/package/gluon-autoupdater/files/usr/lib/autoupdater/download.d/10gluon-autoupdater
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+. /lib/gluon/autoupdater/lib.sh
+
+
+stop cron
+stop haveged
+stop micrond
+stop sysntpd
diff --git a/package/gluon-autoupdater/luasrc/lib/gluon/upgrade/500-autoupdater b/package/gluon-autoupdater/luasrc/lib/gluon/upgrade/500-autoupdater
new file mode 100755
index 00000000..6f3070bf
--- /dev/null
+++ b/package/gluon-autoupdater/luasrc/lib/gluon/upgrade/500-autoupdater
@@ -0,0 +1,52 @@
+#!/usr/bin/lua
+
+local site = require 'gluon.site_config'
+local uci = require('simple-uci').cursor()
+
+
+for name, config in pairs(site.autoupdater.branches) do
+ uci:delete('autoupdater', name)
+ uci:section('autoupdater', 'branch', name, {
+ name = config.name,
+ mirror = config.mirrors,
+ good_signatures = config.good_signatures,
+ pubkey = config.pubkeys,
+ })
+end
+
+if not uci:get('autoupdater', 'settings') then
+ local enabled = false
+ local branch = site.autoupdater.branch
+
+ local f = io.open('/lib/gluon/autoupdater/default_branch')
+ if f then
+ enabled = true
+ branch = f:read('*line')
+ f:close()
+ end
+
+ uci:section('autoupdater', 'autoupdater', 'settings', {
+ enabled = enabled,
+ branch = branch,
+ })
+end
+
+uci:set('autoupdater', 'settings', 'version_file', '/lib/gluon/release')
+
+uci:save('autoupdater')
+
+
+local autoupdater_util = require 'autoupdater.util'
+autoupdater_util.randomseed()
+
+
+-- Perform updates at a random time between 04:00 and 05:00, and once an hour
+-- a fallback update (used after the regular updates haven't worked for
+-- (priority+1) days after a firmware release, for example because the node
+-- is always offline at night)
+local minute = math.random(0, 59)
+
+local f = io.open('/usr/lib/micron.d/autoupdater', 'w')
+f:write(string.format('%i 4 * * * /usr/sbin/autoupdater\n', minute))
+f:write(string.format('%i 0-3,5-23 * * * /usr/sbin/autoupdater --fallback\n', minute))
+f:close()
diff --git a/package/gluon-autoupdater/src/Makefile b/package/gluon-autoupdater/src/Makefile
new file mode 100644
index 00000000..3ddc8a58
--- /dev/null
+++ b/package/gluon-autoupdater/src/Makefile
@@ -0,0 +1,6 @@
+all: respondd.so
+
+CFLAGS += -Wall
+
+respondd.so: respondd.c
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -D_GNU_SOURCE -o $@ $^ $(LDLIBS) -lgluonutil -luci
diff --git a/package/gluon-autoupdater/src/respondd.c b/package/gluon-autoupdater/src/respondd.c
new file mode 100644
index 00000000..66b7a928
--- /dev/null
+++ b/package/gluon-autoupdater/src/respondd.c
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2016, Matthias Schiffer
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ 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.
+*/
+
+
+#include
+
+#include
+#include
+
+#include
+
+#include
+
+
+static struct json_object * get_autoupdater(void) {
+ struct uci_context *ctx = uci_alloc_context();
+ ctx->flags &= ~UCI_FLAG_STRICT;
+
+ struct uci_package *p;
+ if (uci_load(ctx, "autoupdater", &p))
+ goto error;
+
+ struct uci_section *s = uci_lookup_section(ctx, p, "settings");
+ if (!s)
+ goto error;
+
+ struct json_object *ret = json_object_new_object();
+
+ json_object_object_add(ret, "branch", gluonutil_wrap_string(uci_lookup_option_string(ctx, s, "branch")));
+
+ const char *enabled = uci_lookup_option_string(ctx, s, "enabled");
+ json_object_object_add(ret, "enabled", json_object_new_boolean(enabled && !strcmp(enabled, "1")));
+
+ uci_free_context(ctx);
+
+ return ret;
+
+ error:
+ uci_free_context(ctx);
+ return NULL;
+}
+
+static struct json_object * respondd_provider_nodeinfo(void) {
+ struct json_object *ret = json_object_new_object();
+
+ struct json_object *software = json_object_new_object();
+ json_object_object_add(software, "autoupdater", get_autoupdater());
+ json_object_object_add(ret, "software", software);
+
+ return ret;
+}
+
+
+const struct respondd_provider_info respondd_providers[] = {
+ {"nodeinfo", respondd_provider_nodeinfo},
+ {}
+};
diff --git a/package/gluon-client-bridge/Makefile b/package/gluon-client-bridge/Makefile
new file mode 100644
index 00000000..b88b0291
--- /dev/null
+++ b/package/gluon-client-bridge/Makefile
@@ -0,0 +1,38 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gluon-client-bridge
+PKG_VERSION:=1
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+
+include ../gluon.mk
+
+
+define Package/gluon-client-bridge
+ SECTION:=gluon
+ CATEGORY:=Gluon
+ TITLE:=Provides a bridge and a wireless interface for clients to connect to
+ DEPENDS:=+gluon-core +kmod-veth
+endef
+
+define Build/Prepare
+ mkdir -p $(PKG_BUILD_DIR)
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+ $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
+endef
+
+define Package/gluon-client-bridge/install
+ $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
+endef
+
+define Package/gluon-client-bridge/postinst
+#!/bin/sh
+$(call GluonCheckSite,check_site.lua)
+endef
+
+$(eval $(call BuildPackage,gluon-client-bridge))
diff --git a/package/gluon-client-bridge/check_site.lua b/package/gluon-client-bridge/check_site.lua
new file mode 100644
index 00000000..c71f11c0
--- /dev/null
+++ b/package/gluon-client-bridge/check_site.lua
@@ -0,0 +1,15 @@
+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
+ if need_table(config .. '.ap', nil, false) then
+ need_string(config .. '.ap.ssid')
+ need_boolean(config .. '.ap.disabled', false)
+ end
+end
diff --git a/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/300-gluon-client-bridge-network b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/300-gluon-client-bridge-network
new file mode 100755
index 00000000..2f34c9fd
--- /dev/null
+++ b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/300-gluon-client-bridge-network
@@ -0,0 +1,70 @@
+#!/usr/bin/lua
+
+local sysconfig = require 'gluon.sysconfig'
+local sysctl = require 'gluon.sysctl'
+local util = require 'gluon.util'
+
+local uci = require('simple-uci').cursor()
+
+
+local interfaces = uci:get('network', 'client', 'ifname') or {}
+
+if type(interfaces) == 'string' then
+ local ifname = interfaces
+ interfaces = {}
+ for iface in ifname:gmatch('%S+') do
+ util.add_to_set(interfaces, iface)
+ end
+end
+
+if sysconfig.lan_ifname and not ifname and not uci:get_bool('network', 'mesh_lan', 'auto') then
+ for lanif in sysconfig.lan_ifname:gmatch('%S+') do
+ util.add_to_set(interfaces, lanif)
+ end
+end
+
+util.add_to_set(interfaces, 'local-port')
+
+
+uci:delete('network', 'client')
+uci:section('network', 'interface', 'client', {
+ type = 'bridge',
+ ifname = interfaces,
+ proto = 'none',
+ auto = true,
+ ipv6 = false,
+ macaddr = sysconfig.primary_mac,
+ igmp_snooping = true,
+ multicast_querier = true,
+})
+
+uci:save('network')
+
+
+uci:delete('firewall', 'client')
+uci:section('firewall', 'zone', 'client', {
+ name = 'client',
+ network = {'client'},
+ input = 'DROP',
+ output = 'DROP',
+ forward = 'DROP',
+})
+
+uci:save('firewall')
+
+
+local dnsmasq = uci:get_first('dhcp', 'dnsmasq')
+uci:set('dhcp', dnsmasq, 'boguspriv', false)
+uci:set('dhcp', dnsmasq, 'localise_queries', false)
+uci:set('dhcp', dnsmasq, 'rebind_protection', false)
+
+uci:delete('dhcp', 'client')
+uci:section('dhcp', 'dhcp', 'client', {
+ interface = 'client',
+ ignore = true,
+})
+
+uci:save('dhcp')
+
+
+sysctl.set('net.ipv6.conf.br-client.forwarding', 0)
diff --git a/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/310-gluon-client-bridge-local-node b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/310-gluon-client-bridge-local-node
new file mode 100755
index 00000000..43e54145
--- /dev/null
+++ b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/310-gluon-client-bridge-local-node
@@ -0,0 +1,48 @@
+#!/usr/bin/lua
+
+local site = require 'gluon.site_config'
+local sysconfig = require 'gluon.sysconfig'
+
+local uci = require('simple-uci').cursor()
+
+
+uci:delete('network', 'local_node_dev')
+uci:section('network', 'device', 'local_node_dev', {
+ type = 'veth',
+ name = 'local-node',
+ macaddr = site.next_node.mac,
+ peer_name = 'local-port',
+ peer_macaddr = sysconfig.primary_mac,
+})
+
+
+local ip4, ip6
+
+if site.next_node.ip4 then
+ local plen = site.prefix4:match('/%d+$')
+ ip4 = site.next_node.ip4 .. plen
+end
+
+if site.next_node.ip6 then
+ ip6 = site.next_node.ip6 .. '/128'
+end
+
+uci:delete('network', 'local_node')
+uci:section('network', 'interface', 'local_node', {
+ ifname = 'local-node',
+ proto = 'static',
+ ipaddr = ip4,
+ ip6addr = ip6,
+ ip6deprecated = true,
+})
+
+uci:save('network')
+
+
+uci:delete('dhcp', 'local_node')
+uci:section('dhcp', 'dhcp', 'local_node', {
+ interface = 'local_node',
+ ignore = true,
+})
+
+uci:save('dhcp')
diff --git a/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/320-gluon-client-bridge-wireless b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/320-gluon-client-bridge-wireless
new file mode 100755
index 00000000..058dc351
--- /dev/null
+++ b/package/gluon-client-bridge/luasrc/lib/gluon/upgrade/320-gluon-client-bridge-wireless
@@ -0,0 +1,56 @@
+#!/usr/bin/lua
+
+local site = require 'gluon.site_config'
+local util = require 'gluon.util'
+
+local uci = require('simple-uci').cursor()
+
+
+local function is_disabled(config, name)
+ local disabled
+ if uci:get('wireless', name) then
+ disabled = uci:get_bool('wireless', name, 'disabled')
+ else
+ disabled = config and config.disabled
+ end
+
+ return disabled
+end
+
+local function configure_client(config, radio, index, suffix)
+ local name = 'client_' .. radio
+ local disabled = is_disabled(config, name)
+
+ uci:delete('wireless', name)
+
+ if not config then
+ return
+ end
+
+ local macaddr = util.get_wlan_mac(uci, radio, index, 1)
+ if not macaddr then
+ return
+ end
+
+ uci:section('wireless', 'wifi-iface', name,
+ {
+ device = radio,
+ network = 'client',
+ mode = 'ap',
+ ssid = config.ssid,
+ macaddr = macaddr,
+ ifname = suffix and 'client' .. suffix,
+ disabled = disabled or false,
+ }
+ )
+end
+
+local function configure_radio(radio, index, config)
+ local suffix = radio:match('^radio(%d+)$')
+
+ configure_client(config.ap, radio, index, suffix)
+end
+
+util.iterate_radios(uci, configure_radio)
+
+uci:save('wireless')
diff --git a/package/gluon-config-mode-autoupdater/Makefile b/package/gluon-config-mode-autoupdater/Makefile
index 4303940b..a77c07de 100644
--- a/package/gluon-config-mode-autoupdater/Makefile
+++ b/package/gluon-config-mode-autoupdater/Makefile
@@ -5,7 +5,7 @@ PKG_VERSION:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-include $(GLUONDIR)/include/package.mk
+include ../gluon.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
@@ -13,14 +13,10 @@ PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-config-mode-autoupdater
SECTION:=gluon
CATEGORY:=Gluon
- TITLE:=Let the user know whether the autoupdater is enabled or not.
+ TITLE:=Config Mode: Let the user know whether the autoupdater is enabled or not
DEPENDS:=gluon-config-mode-core-virtual +gluon-autoupdater
endef
-define Package/gluon-config-mode-autoupdater/description
- Luci based config mode
-endef
-
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
@@ -30,10 +26,11 @@ endef
define Build/Compile
$(call GluonBuildI18N,gluon-config-mode-autoupdater,i18n)
+ $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
endef
define Package/gluon-config-mode-autoupdater/install
- $(CP) ./files/* $(1)/
+ $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
$(call GluonInstallI18N,gluon-config-mode-autoupdater,$(1))
endef
diff --git a/package/gluon-config-mode-autoupdater/files/lib/gluon/config-mode/wizard/0050-autoupdater-info.lua b/package/gluon-config-mode-autoupdater/files/lib/gluon/config-mode/wizard/0050-autoupdater-info.lua
deleted file mode 100644
index 3bbe0390..00000000
--- a/package/gluon-config-mode-autoupdater/files/lib/gluon/config-mode/wizard/0050-autoupdater-info.lua
+++ /dev/null
@@ -1,19 +0,0 @@
-local cbi = require "luci.cbi"
-local i18n = require "luci.i18n"
-local uci = luci.model.uci.cursor()
-
-local M = {}
-
-function M.section(form)
- local enabled = uci:get_bool("autoupdater", "settings", "enabled")
- if enabled then
- local s = form:section(cbi.SimpleSection, nil,
- i18n.translate('This node will automatically update its firmware when a new version is available.'))
- end
-end
-
-function M.handle(data)
- return
-end
-
-return M
diff --git a/package/gluon-config-mode-autoupdater/i18n/fr.po b/package/gluon-config-mode-autoupdater/i18n/fr.po
new file mode 100644
index 00000000..7ee64f46
--- /dev/null
+++ b/package/gluon-config-mode-autoupdater/i18n/fr.po
@@ -0,0 +1,17 @@
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2015-08-04 20:20+0100\n"
+"Last-Translator: Bernot Tobias \n"
+"Language-Team: French\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgid ""
+"This node will automatically update its firmware when a new version is "
+"available."
+msgstr "Ce nœud s'actualisera automatiquement quand une nouvelle "
+"version sera disponible."
diff --git a/package/gluon-config-mode-autoupdater/luasrc/lib/gluon/config-mode/wizard/0050-autoupdater-info.lua b/package/gluon-config-mode-autoupdater/luasrc/lib/gluon/config-mode/wizard/0050-autoupdater-info.lua
new file mode 100644
index 00000000..6d52744e
--- /dev/null
+++ b/package/gluon-config-mode-autoupdater/luasrc/lib/gluon/config-mode/wizard/0050-autoupdater-info.lua
@@ -0,0 +1,8 @@
+return function(form, uci)
+ if uci:get_bool("autoupdater", "settings", "enabled") then
+ local s = form:section(
+ Section, nil,
+ translate('This node will automatically update its firmware when a new version is available.')
+ )
+ end
+end
diff --git a/package/gluon-config-mode-contact-info/Makefile b/package/gluon-config-mode-contact-info/Makefile
index ff9cb57f..7a3780a6 100644
--- a/package/gluon-config-mode-contact-info/Makefile
+++ b/package/gluon-config-mode-contact-info/Makefile
@@ -5,7 +5,7 @@ PKG_VERSION:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-include $(GLUONDIR)/include/package.mk
+include ../gluon.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
@@ -13,10 +13,15 @@ PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-config-mode-contact-info
SECTION:=gluon
CATEGORY:=Gluon
- TITLE:=Set a custom string that will be distributed in the mesh.
+ TITLE:=Allows the user to provide contact information to be distributed in the mesh
DEPENDS:=gluon-config-mode-core-virtual +gluon-node-info
endef
+define Package/gluon-config-mode-contact-info/description
+ Allows the user to provide contact information to be distributed in the mesh.
+ Can be made obligatory in site.conf
+endef
+
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
@@ -26,11 +31,17 @@ endef
define Build/Compile
$(call GluonBuildI18N,gluon-config-mode-contact-info,i18n)
+ $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
endef
define Package/gluon-config-mode-contact-info/install
- $(CP) ./files/* $(1)/
+ $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
$(call GluonInstallI18N,gluon-config-mode-contact-info,$(1))
endef
+define Package/gluon-config-mode-contact-info/postinst
+#!/bin/sh
+$(call GluonCheckSite,check_site.lua)
+endef
+
$(eval $(call BuildPackage,gluon-config-mode-contact-info))
diff --git a/package/gluon-config-mode-contact-info/check_site.lua b/package/gluon-config-mode-contact-info/check_site.lua
new file mode 100644
index 00000000..fe818616
--- /dev/null
+++ b/package/gluon-config-mode-contact-info/check_site.lua
@@ -0,0 +1,3 @@
+if need_table('config_mode', nil, false) and need_table('config_mode.owner', nil, false) then
+ need_boolean('config_mode.owner.obligatory', false)
+end
diff --git a/package/gluon-config-mode-contact-info/files/lib/gluon/config-mode/wizard/0500-contact-info.lua b/package/gluon-config-mode-contact-info/files/lib/gluon/config-mode/wizard/0500-contact-info.lua
deleted file mode 100644
index a2182f95..00000000
--- a/package/gluon-config-mode-contact-info/files/lib/gluon/config-mode/wizard/0500-contact-info.lua
+++ /dev/null
@@ -1,34 +0,0 @@
-local cbi = require "luci.cbi"
-local i18n = require "luci.i18n"
-local uci = luci.model.uci.cursor()
-
-local M = {}
-
-function M.section(form)
- local s = form:section(cbi.SimpleSection, nil, i18n.translate(
- 'You can provide your contact information here to '
- .. 'allow others to contact you. Please note that '
- .. 'this information will be visible publicly '
- .. 'on the internet together with your node\'s coordinates.'
- )
- )
-
- local o = s:option(cbi.Value, "_contact", i18n.translate("Contact info"))
- o.default = uci:get_first("gluon-node-info", "owner", "contact", "")
- o.rmempty = true
- o.datatype = "string"
- o.description = i18n.translate("e.g. E-mail or phone number")
- o.maxlen = 140
-end
-
-function M.handle(data)
- if data._contact ~= nil then
- uci:set("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact", data._contact)
- else
- uci:delete("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact")
- end
- uci:save("gluon-node-info")
- uci:commit("gluon-node-info")
-end
-
-return M
diff --git a/package/gluon-config-mode-contact-info/i18n/de.po b/package/gluon-config-mode-contact-info/i18n/de.po
index 719246f4..35f0ee95 100644
--- a/package/gluon-config-mode-contact-info/i18n/de.po
+++ b/package/gluon-config-mode-contact-info/i18n/de.po
@@ -14,13 +14,13 @@ msgid "Contact info"
msgstr "Kontakt"
msgid ""
-"You can provide your contact information here to allow others to contact "
-"you. Please note that this information will be visible publicly on "
+"Please provide your contact information here to allow others to contact "
+"you. Note that this information will be visible publicly on "
"the internet together with your node's coordinates."
msgstr ""
-"Hier kannst du einen öffentlichen Hinweis hinterlegen, um anderen "
-"zu ermöglichen, Kontakt mit dir aufzunehmen. Bitte beachte, dass "
-"dieser Hinweis auch öffentlich im Internet, zusammen mit den Koordinaten "
+"Bitte hinterlege hier einen Hinweis, um anderen zu ermöglichen, "
+"Kontakt mit dir aufzunehmen. Beachte, dass dieser Hinweis auch "
+"öffentlich im Internet, zusammen mit den Koordinaten "
"deines Knotens, einsehbar sein wird."
msgid "e.g. E-mail or phone number"
diff --git a/package/gluon-config-mode-contact-info/i18n/fr.po b/package/gluon-config-mode-contact-info/i18n/fr.po
new file mode 100644
index 00000000..624b1864
--- /dev/null
+++ b/package/gluon-config-mode-contact-info/i18n/fr.po
@@ -0,0 +1,26 @@
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2015-08-12 23:30+0100\n"
+"Last-Translator:Tobias Bernot \n"
+"Language-Team: French\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgid "Contact info"
+msgstr "Informations de Contact"
+
+msgid ""
+"Please provide your contact information here to allow others to contact "
+"you. Note that this information will be visible publicly on "
+"the internet together with your node's coordinates."
+msgstr ""
+"S'il vous plaît entrez ici des informations publiques pour "
+"permettre aux autres de vous contacter. "
+"Ces informations seront affichées en ligne, avec les coordonnées du nœud."
+
+msgid "e.g. E-mail or phone number"
+msgstr "Ex : E-mail ou numéro de téléphone"
diff --git a/package/gluon-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot b/package/gluon-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot
index 63939a83..9dcaf9ec 100644
--- a/package/gluon-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot
+++ b/package/gluon-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot
@@ -5,8 +5,8 @@ msgid "Contact info"
msgstr ""
msgid ""
-"You can provide your contact information here to allow others to contact "
-"you. Please note that this information will be visible publicly on "
+"Please provide your contact information here to allow others to contact "
+"you. Note that this information will be visible publicly on "
"the internet together with your node's coordinates."
msgstr ""
diff --git a/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua b/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua
new file mode 100644
index 00000000..1ef5deaf
--- /dev/null
+++ b/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua
@@ -0,0 +1,27 @@
+return function(form, uci)
+ local site = require 'gluon.site_config'
+
+ local owner = uci:get_first("gluon-node-info", "owner")
+
+ local s = form:section(Section, nil, translate(
+ 'Please provide your contact information here to '
+ .. 'allow others to contact you. Note that '
+ .. 'this information will be visible publicly '
+ .. 'on the internet together with your node\'s coordinates.'
+ ))
+
+ local o = s:option(Value, "contact", translate("Contact info"), translate("e.g. E-mail or phone number"))
+ o.default = uci:get("gluon-node-info", owner, "contact")
+ o.optional = not ((site.config_mode or {}).owner or {}).obligatory
+ -- without a minimal length, an empty string will be accepted even with "optional = false"
+ o.datatype = "minlength(1)"
+ function o:write(data)
+ if data then
+ uci:set("gluon-node-info", owner, "contact", data)
+ else
+ uci:delete("gluon-node-info", owner, "contact")
+ end
+ end
+
+ return {'gluon-node-info'}
+end
diff --git a/package/gluon-config-mode-core/Makefile b/package/gluon-config-mode-core/Makefile
index 5d700f7f..91b2e51f 100644
--- a/package/gluon-config-mode-core/Makefile
+++ b/package/gluon-config-mode-core/Makefile
@@ -8,7 +8,7 @@ PKG_VERSION:=2
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-include $(GLUONDIR)/include/package.mk
+include ../gluon.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
@@ -16,8 +16,8 @@ PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-config-mode-core
SECTION:=gluon
CATEGORY:=Gluon
- TITLE:=Luci based config mode for user friendly setup of new mesh nodes
- DEPENDS:=gluon-setup-mode-virtual +gluon-luci-theme +gluon-lock-password $(GLUON_I18N_PACKAGES)
+ TITLE:=Configuration wizard for user friendly setup of new mesh nodes
+ DEPENDS:=gluon-setup-mode-virtual +gluon-web-theme +gluon-lock-password +pretty-hostname
PROVIDES:=gluon-config-mode-core-virtual
endef
@@ -30,10 +30,12 @@ endef
define Build/Compile
$(call GluonBuildI18N,gluon-config-mode-core,i18n)
+ $(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
endef
define Package/gluon-config-mode-core/install
$(CP) ./files/* $(1)/
+ $(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
$(call GluonInstallI18N,gluon-config-mode-core,$(1))
endef
diff --git a/package/gluon-config-mode-core/files/lib/gluon/config-mode/reboot/0900-msg-reboot.lua b/package/gluon-config-mode-core/files/lib/gluon/config-mode/reboot/0900-msg-reboot.lua
deleted file mode 100644
index bf27c07f..00000000
--- a/package/gluon-config-mode-core/files/lib/gluon/config-mode/reboot/0900-msg-reboot.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-local i18n = require 'luci.i18n'
-
-return function () luci.template.render_string(i18n.translate('gluon-config-mode:reboot')) end
diff --git a/package/gluon-config-mode-core/files/lib/gluon/web/view/gluon/config-mode/reboot.html b/package/gluon-config-mode-core/files/lib/gluon/web/view/gluon/config-mode/reboot.html
new file mode 100644
index 00000000..6c65010b
--- /dev/null
+++ b/package/gluon-config-mode-core/files/lib/gluon/web/view/gluon/config-mode/reboot.html
@@ -0,0 +1,22 @@
+
<%:Your node's setup is now complete.%>
+<%
+ local fs = require "nixio.fs"
+ local util = require "nixio.util"
+
+ local parts_dir = "/lib/gluon/config-mode/reboot/"
+ local files = util.consume(fs.dir(parts_dir) or function() end)
+ table.sort(files)
+
+ local parts = {}
+ for _, entry in ipairs(files) do
+ if entry:sub(1, 1) ~= '.' then
+ local p = assert(loadfile(parts_dir .. entry))
+ setfenv(p, getfenv())
+ table.insert(parts, p)
+ end
+ end
+
+ for _, p in ipairs(parts) do
+ p()
+ end
+%>
diff --git a/package/gluon-config-mode-core/files/lib/gluon/web/view/gluon/config-mode/welcome.html b/package/gluon-config-mode-core/files/lib/gluon/web/view/gluon/config-mode/welcome.html
new file mode 100644
index 00000000..22305131
--- /dev/null
+++ b/package/gluon-config-mode-core/files/lib/gluon/web/view/gluon/config-mode/welcome.html
@@ -0,0 +1,14 @@
+<%-
+ local sysconfig = require 'gluon.sysconfig'
+
+ local msg = _translate('gluon-config-mode:welcome')
+ if not msg then return end
+-%>
+
- <%:The firmware is currently being upgraded.%>
- <%:Don't switch off the device in any circumstance!%>
- <%:The upgrade will take a few minutes. When it is finished, your node will reboot automatically.%>
-
-
-
-
-
diff --git a/package/gluon-luci-autoupdater/Makefile b/package/gluon-luci-autoupdater/Makefile
deleted file mode 100644
index 650c4692..00000000
--- a/package/gluon-luci-autoupdater/Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2013 Nils Schneider
-# This is free software, licensed under the Apache 2.0 license.
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gluon-luci-autoupdater
-PKG_VERSION:=1
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(GLUONDIR)/include/package.mk
-
-PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
-
-define Package/gluon-luci-autoupdater
- SECTION:=gluon
- CATEGORY:=Gluon
- TITLE:=Luci module for gluon-autoupdater
- DEPENDS:=+gluon-luci-admin +gluon-autoupdater
-endef
-
-define Build/Prepare
- mkdir -p $(PKG_BUILD_DIR)
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
- $(call GluonBuildI18N,gluon-luci-autoupdater,i18n)
-endef
-
-define Package/gluon-luci-autoupdater/install
- $(CP) ./files/* $(1)/
- $(call GluonInstallI18N,gluon-luci-autoupdater,$(1))
-endef
-
-$(eval $(call BuildPackage,gluon-luci-autoupdater))
diff --git a/package/gluon-luci-autoupdater/files/usr/lib/lua/luci/controller/admin/autoupdater.lua b/package/gluon-luci-autoupdater/files/usr/lib/lua/luci/controller/admin/autoupdater.lua
deleted file mode 100644
index 64e1acbd..00000000
--- a/package/gluon-luci-autoupdater/files/usr/lib/lua/luci/controller/admin/autoupdater.lua
+++ /dev/null
@@ -1,19 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2013 Nils Schneider
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-module("luci.controller.admin.autoupdater", package.seeall)
-
-function index()
- entry({"admin", "autoupdater"}, cbi("admin/autoupdater"), _("Automatic updates"), 80)
-end
diff --git a/package/gluon-luci-autoupdater/files/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua b/package/gluon-luci-autoupdater/files/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua
deleted file mode 100644
index a8f9d3b3..00000000
--- a/package/gluon-luci-autoupdater/files/usr/lib/lua/luci/model/cbi/admin/autoupdater.lua
+++ /dev/null
@@ -1,29 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2013 Nils Schneider
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-m = Map("autoupdater", translate("Automatic updates"))
-m.pageaction = false
-m.template = "admin/expertmode"
-
-s = m:section(TypedSection, "autoupdater", nil)
-s.addremove = false
-s.anonymous = true
-
-s:option(Flag, "enabled", translate("Enable"))
-f = s:option(ListValue, "branch", translate("Branch"))
-
-uci.cursor():foreach("autoupdater", "branch", function (section) f:value(section[".name"]) end)
-
-return m
-
diff --git a/package/gluon-luci-mesh-vpn-fastd/check_site.lua b/package/gluon-luci-mesh-vpn-fastd/check_site.lua
deleted file mode 100644
index 42ff5a50..00000000
--- a/package/gluon-luci-mesh-vpn-fastd/check_site.lua
+++ /dev/null
@@ -1,2 +0,0 @@
-assert(need_boolean('fastd_mesh_vpn.configurable') == true,
- "site.conf error: expected `fastd_mesh_vpn.configurable' to be true")
diff --git a/package/gluon-luci-mesh-vpn-fastd/files/usr/lib/lua/luci/controller/admin/mesh_vpn_fastd.lua b/package/gluon-luci-mesh-vpn-fastd/files/usr/lib/lua/luci/controller/admin/mesh_vpn_fastd.lua
deleted file mode 100644
index 8141c44a..00000000
--- a/package/gluon-luci-mesh-vpn-fastd/files/usr/lib/lua/luci/controller/admin/mesh_vpn_fastd.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-module("luci.controller.admin.mesh_vpn_fastd", package.seeall)
-
-function index()
- entry({"admin", "mesh_vpn_fastd"}, cbi("admin/mesh_vpn_fastd"), _("Mesh VPN"), 20)
-end
diff --git a/package/gluon-luci-mesh-vpn-fastd/files/usr/lib/lua/luci/model/cbi/admin/mesh_vpn_fastd.lua b/package/gluon-luci-mesh-vpn-fastd/files/usr/lib/lua/luci/model/cbi/admin/mesh_vpn_fastd.lua
deleted file mode 100644
index 14bb5783..00000000
--- a/package/gluon-luci-mesh-vpn-fastd/files/usr/lib/lua/luci/model/cbi/admin/mesh_vpn_fastd.lua
+++ /dev/null
@@ -1,41 +0,0 @@
-local uci = luci.model.uci.cursor()
-local util = luci.util
-
-local f = SimpleForm('mesh_vpn', translate('Mesh VPN'))
-f.template = "admin/expertmode"
-
-local s = f:section(SimpleSection)
-
-local o = s:option(Value, 'mode')
-o.template = "gluon/cbi/mesh-vpn-fastd-mode"
-
-local methods = uci:get('fastd', 'mesh_vpn', 'method')
-if util.contains(methods, 'null') then
- o.default = 'performance'
-else
- o.default = 'security'
-end
-
-function f.handle(self, state, data)
- if state == FORM_VALID then
- local site = require 'gluon.site_config'
-
- local methods = {}
- if data.mode == 'performance' then
- table.insert(methods, 'null')
- end
-
- for _, method in ipairs(site.fastd_mesh_vpn.methods) do
- if method ~= 'null' then
- table.insert(methods, method)
- end
- end
-
- uci:set('fastd', 'mesh_vpn', 'method', methods)
-
- uci:save('fastd')
- uci:commit('fastd')
- end
-end
-
-return f
diff --git a/package/gluon-luci-mesh-vpn-fastd/files/usr/lib/lua/luci/view/gluon/cbi/mesh-vpn-fastd-mode.htm b/package/gluon-luci-mesh-vpn-fastd/files/usr/lib/lua/luci/view/gluon/cbi/mesh-vpn-fastd-mode.htm
deleted file mode 100644
index 0899fa1d..00000000
--- a/package/gluon-luci-mesh-vpn-fastd/files/usr/lib/lua/luci/view/gluon/cbi/mesh-vpn-fastd-mode.htm
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
- />
-
-
-
-
- <%= translate(
- 'In security mode, the mesh VPN uses an encrypted tunnel to connect to the VPN servers. ' ..
- 'The encryption ensures that it is impossible for your internet access provider to see what ' ..
- 'data is exchanged over your node.'
- ) %>
-
-
-
-
-
-
-
- />
-
-
-
-
- <%= translate(
- 'In performance mode, no encryption is used. This usually allows for higher throughput, but the data exchanged over your node is not ' ..
- 'protected against eavesdropping.'
- ) %>
-
-
-
-
diff --git a/package/gluon-luci-node-role/Makefile b/package/gluon-luci-node-role/Makefile
deleted file mode 100644
index ded7bd3f..00000000
--- a/package/gluon-luci-node-role/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gluon-luci-node-role
-PKG_VERSION:=0.1
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(GLUONDIR)/include/package.mk
-
-PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
-
-define Package/gluon-luci-node-role
- SECTION:=gluon
- CATEGORY:=Gluon
- DEPENDS:=+gluon-luci-admin +gluon-node-info
- TITLE:=UI for specifying node role
-endef
-
-define Build/Prepare
- mkdir -p $(PKG_BUILD_DIR)
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
- $(call GluonBuildI18N,gluon-luci-node-role,i18n)
-endef
-
-define Package/gluon-luci-node-role/install
- $(CP) ./files/* $(1)/
- $(call GluonInstallI18N,gluon-luci-node-role,$(1))
-endef
-
-define Package/gluon-luci-node-role/postinst
-#!/bin/sh
-$(call GluonCheckSite,check_site.lua)
-endef
-
-$(eval $(call BuildPackage,gluon-luci-node-role))
diff --git a/package/gluon-luci-node-role/files/usr/lib/lua/luci/controller/admin/noderole.lua b/package/gluon-luci-node-role/files/usr/lib/lua/luci/controller/admin/noderole.lua
deleted file mode 100644
index cfca1275..00000000
--- a/package/gluon-luci-node-role/files/usr/lib/lua/luci/controller/admin/noderole.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-module("luci.controller.admin.noderole", package.seeall)
-
-function index()
- entry({"admin", "noderole"}, cbi("admin/noderole"), "Node role", 20)
-end
diff --git a/package/gluon-luci-node-role/files/usr/lib/lua/luci/model/cbi/admin/noderole.lua b/package/gluon-luci-node-role/files/usr/lib/lua/luci/model/cbi/admin/noderole.lua
deleted file mode 100644
index e7832ad9..00000000
--- a/package/gluon-luci-node-role/files/usr/lib/lua/luci/model/cbi/admin/noderole.lua
+++ /dev/null
@@ -1,34 +0,0 @@
-local f, s, o
-local site = require 'gluon.site_config'
-local i18n = require "luci.i18n"
-local uci = luci.model.uci.cursor()
-local config = 'gluon-node-info'
-
--- where to read the configuration from
-local role = uci:get(config, uci:get_first(config, "system"), "role")
-
-f = SimpleForm("role", i18n.translate("Node role"))
-f.template = "admin/expertmode"
-
-s = f:section(SimpleSection, nil, i18n.translate(
- "If this node has a special role within the freifunk network you can specify this role here. "
- .. "Please find out about the available roles and their impact first. "
- .. "Only change the role if you know what you are doing."))
-
-o = s:option(ListValue, "role", i18n.translate("Role"))
-o.default = role
-o.rmempty = false
-for _, role in ipairs(site.roles.list) do
- o:value(role, i18n.translate('gluon-luci-node-role:role:' .. role))
-end
-
-function f.handle(self, state, data)
- if state == FORM_VALID then
- uci:set(config, uci:get_first(config, "system"), "role", data.role)
-
- uci:save(config)
- uci:commit(config)
- end
-end
-
-return f
diff --git a/package/gluon-luci-portconfig/Makefile b/package/gluon-luci-portconfig/Makefile
deleted file mode 100644
index 007c5fea..00000000
--- a/package/gluon-luci-portconfig/Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2013 Nils Schneider
-# This is free software, licensed under the Apache 2.0 license.
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gluon-luci-portconfig
-PKG_VERSION:=1
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(GLUONDIR)/include/package.mk
-
-PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
-
-define Package/gluon-luci-portconfig
- SECTION:=gluon
- CATEGORY:=Gluon
- TITLE:=Luci module for advanced ethernet port configuration
- DEPENDS:=+gluon-luci-admin +gluon-mesh-batman-adv
-endef
-
-define Build/Prepare
- mkdir -p $(PKG_BUILD_DIR)
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
- $(call GluonBuildI18N,gluon-luci-portconfig,i18n)
-endef
-
-define Package/gluon-luci-portconfig/install
- $(CP) ./files/* $(1)/
- $(call GluonInstallI18N,gluon-luci-portconfig,$(1))
-endef
-
-$(eval $(call BuildPackage,gluon-luci-portconfig))
diff --git a/package/gluon-luci-portconfig/files/usr/lib/lua/luci/controller/admin/portconfig.lua b/package/gluon-luci-portconfig/files/usr/lib/lua/luci/controller/admin/portconfig.lua
deleted file mode 100644
index 037b56c8..00000000
--- a/package/gluon-luci-portconfig/files/usr/lib/lua/luci/controller/admin/portconfig.lua
+++ /dev/null
@@ -1,19 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2013 Nils Schneider
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-module("luci.controller.admin.portconfig", package.seeall)
-
-function index()
- entry({"admin", "portconfig"}, cbi("admin/portconfig"), _("Network"), 20)
-end
diff --git a/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua b/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua
deleted file mode 100644
index 8166539c..00000000
--- a/package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua
+++ /dev/null
@@ -1,149 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2014 Nils Schneider
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
-
-local uci = luci.model.uci.cursor()
-local sysconfig = require 'gluon.sysconfig'
-
-local wan = uci:get_all("network", "wan")
-local wan6 = uci:get_all("network", "wan6")
-local dns = uci:get_first("gluon-wan-dnsmasq", "static")
-
-local f = SimpleForm("portconfig", translate("WAN connection"))
-f.template = "admin/expertmode"
-
-local s
-local o
-
-s = f:section(SimpleSection, nil, nil)
-
-o = s:option(ListValue, "ipv4", translate("IPv4"))
-o:value("dhcp", translate("Automatic (DHCP)"))
-o:value("static", translate("Static"))
-o:value("none", translate("Disabled"))
-o.default = wan.proto
-
-o = s:option(Value, "ipv4_addr", translate("IP address"))
-o:depends("ipv4", "static")
-o.value = wan.ipaddr
-o.datatype = "ip4addr"
-o.rmempty = false
-
-o = s:option(Value, "ipv4_netmask", translate("Netmask"))
-o:depends("ipv4", "static")
-o.value = wan.netmask or "255.255.255.0"
-o.datatype = "ip4addr"
-o.rmempty = false
-
-o = s:option(Value, "ipv4_gateway", translate("Gateway"))
-o:depends("ipv4", "static")
-o.value = wan.gateway
-o.datatype = "ip4addr"
-o.rmempty = false
-
-
-s = f:section(SimpleSection, nil, nil)
-
-o = s:option(ListValue, "ipv6", translate("IPv6"))
-o:value("dhcpv6", translate("Automatic (RA/DHCPv6)"))
-o:value("static", translate("Static"))
-o:value("none", translate("Disabled"))
-o.default = wan6.proto
-
-o = s:option(Value, "ipv6_addr", translate("IP address"))
-o:depends("ipv6", "static")
-o.value = wan6.ip6addr
-o.datatype = "ip6addr"
-o.rmempty = false
-
-o = s:option(Value, "ipv6_gateway", translate("Gateway"))
-o:depends("ipv6", "static")
-o.value = wan6.ip6gw
-o.datatype = "ip6addr"
-o.rmempty = false
-
-
-if dns then
- s = f:section(SimpleSection, nil, nil)
-
- o = s:option(DynamicList, "dns", translate("Static DNS servers"))
- o:write(nil, uci:get("gluon-wan-dnsmasq", dns, "server"))
- o.datatype = "ipaddr"
-end
-
-s = f:section(SimpleSection, nil, nil)
-
-o = s:option(Flag, "mesh_wan", translate("Enable meshing on the WAN interface"))
-o.default = uci:get_bool("network", "mesh_wan", "auto") and o.enabled or o.disabled
-o.rmempty = false
-
-if sysconfig.lan_ifname then
- 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.rmempty = false
-end
-
-
-function f.handle(self, state, data)
- if state == FORM_VALID then
- uci:set("network", "wan", "proto", data.ipv4)
- if data.ipv4 == "static" then
- uci:set("network", "wan", "ipaddr", data.ipv4_addr)
- uci:set("network", "wan", "netmask", data.ipv4_netmask)
- uci:set("network", "wan", "gateway", data.ipv4_gateway)
- else
- uci:delete("network", "wan", "ipaddr")
- uci:delete("network", "wan", "netmask")
- uci:delete("network", "wan", "gateway")
- end
-
- uci:set("network", "wan6", "proto", data.ipv6)
- if data.ipv6 == "static" then
- uci:set("network", "wan6", "ip6addr", data.ipv6_addr)
- uci:set("network", "wan6", "ip6gw", data.ipv6_gateway)
- else
- uci:delete("network", "wan6", "ip6addr")
- uci:delete("network", "wan6", "ip6gw")
- end
-
- uci:set("network", "mesh_wan", "auto", data.mesh_wan)
-
- if sysconfig.lan_ifname then
- uci:set("network", "mesh_lan", "auto", data.mesh_lan)
-
- if data.mesh_lan == '1' then
- uci:set("network", "client", "ifname", "bat0")
- else
- uci:set("network", "client", "ifname", sysconfig.lan_ifname .. " bat0")
- end
- end
-
- uci:save("network")
- uci:commit("network")
-
- if dns then
- if #data.dns > 0 then
- uci:set("gluon-wan-dnsmasq", dns, "server", data.dns)
- else
- uci:delete("gluon-wan-dnsmasq", dns, "server")
- end
-
- uci:save("gluon-wan-dnsmasq")
- uci:commit("gluon-wan-dnsmasq")
- end
- end
-
- return true
-end
-
-return f
diff --git a/package/gluon-luci-private-wifi/Makefile b/package/gluon-luci-private-wifi/Makefile
deleted file mode 100644
index 604929dd..00000000
--- a/package/gluon-luci-private-wifi/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gluon-luci-private-wifi
-PKG_VERSION:=1
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(GLUONDIR)/include/package.mk
-
-PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
-
-define Package/gluon-luci-private-wifi
- SECTION:=gluon
- CATEGORY:=Gluon
- DEPENDS:=+gluon-luci-admin
- TITLE:=UI for activating a private WLAN
-endef
-
-define Build/Prepare
- mkdir -p $(PKG_BUILD_DIR)
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
- $(call GluonBuildI18N,gluon-luci-private-wifi,i18n)
-endef
-
-define Package/gluon-luci-private-wifi/install
- $(CP) ./files/* $(1)/
- $(call GluonInstallI18N,gluon-luci-private-wifi,$(1))
-endef
-
-$(eval $(call BuildPackage,gluon-luci-private-wifi))
diff --git a/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/controller/admin/privatewifi.lua b/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/controller/admin/privatewifi.lua
deleted file mode 100644
index e11ba58b..00000000
--- a/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/controller/admin/privatewifi.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-module("luci.controller.admin.privatewifi", package.seeall)
-
-function index()
- entry({"admin", "privatewifi"}, cbi("admin/privatewifi"), _("Private WLAN"), 10)
-end
diff --git a/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua b/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua
deleted file mode 100644
index d3ddcd72..00000000
--- a/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua
+++ /dev/null
@@ -1,63 +0,0 @@
-local f, s, o, ssid
-local uci = luci.model.uci.cursor()
-local config = 'wireless'
-
--- where to read the configuration from
-local primary_iface = 'wan_radio0'
-local ssid = uci:get(config, primary_iface, "ssid")
-
-f = SimpleForm("wifi", translate("Private WLAN"))
-f.template = "admin/expertmode"
-
-s = f:section(SimpleSection, nil, translate(
- 'Your node can additionally extend your private network by bridging the WAN interface '
- .. 'with a seperate WLAN. This feature is completely independent of the mesh functionality. '
- .. 'Please note that the private WLAN and meshing on the WAN interface should not be enabled '
- .. 'at the same time.'
-))
-
-o = s:option(Flag, "enabled", translate("Enabled"))
-o.default = (ssid and not uci:get_bool(config, primary_iface, "disabled")) and o.enabled or o.disabled
-o.rmempty = false
-
-o = s:option(Value, "ssid", translate("Name (SSID)"))
-o:depends("enabled", '1')
-o.default = ssid
-
-o = s:option(Value, "key", translate("Key"), translate("8-63 characters"))
-o:depends("enabled", '1')
-o.datatype = "wpakey"
-o.default = uci:get(config, primary_iface, "key")
-
-function f.handle(self, state, data)
- if state == FORM_VALID then
- uci:foreach(config, "wifi-device",
- function(s)
- local device = s['.name']
- local name = "wan_" .. device
-
- if data.enabled == '1' then
- -- set up WAN wifi-iface
- uci:section(config, "wifi-iface", name,
- {
- device = device,
- network = "wan",
- mode = 'ap',
- encryption = 'psk2',
- ssid = data.ssid,
- key = data.key,
- disabled = 0,
- }
- )
- else
- -- disable WAN wifi-iface
- uci:set(config, name, "disabled", 1)
- end
- end)
-
- uci:save(config)
- uci:commit(config)
- end
-end
-
-return f
diff --git a/package/gluon-luci-theme/files/etc/uci-defaults/luci-theme-gluon b/package/gluon-luci-theme/files/etc/uci-defaults/luci-theme-gluon
deleted file mode 100755
index 795bd186..00000000
--- a/package/gluon-luci-theme/files/etc/uci-defaults/luci-theme-gluon
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-uci batch <<-EOF
- set luci.themes.Gluon=/luci-static/gluon
- commit luci
-EOF
-
diff --git a/package/gluon-luci-theme/files/usr/lib/lua/luci/view/themes/gluon/footer.htm b/package/gluon-luci-theme/files/usr/lib/lua/luci/view/themes/gluon/footer.htm
deleted file mode 100644
index 6b709030..00000000
--- a/package/gluon-luci-theme/files/usr/lib/lua/luci/view/themes/gluon/footer.htm
+++ /dev/null
@@ -1,19 +0,0 @@
-<%#
-LuCI - Lua Configuration Interface
-Copyright 2008 Steven Barth
-Copyright 2008 Jo-Philipp Wich
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
--%>
-
-
-
-