Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • firmware/gluon
  • 0x4A6F/gluon
  • patrick/gluon
3 results
Select Git revision
Loading items
Show changes
Showing
with 1127 additions and 458 deletions
...@@ -4,489 +4,245 @@ LC_ALL:=C ...@@ -4,489 +4,245 @@ LC_ALL:=C
LANG:=C LANG:=C
export LC_ALL LANG export LC_ALL LANG
export SHELL:=/usr/bin/env bash .SHELLFLAGS = -ec
GLUONPATH ?= $(PATH) # check for spaces & resolve possibly relative paths
export GLUONPATH := $(GLUONPATH) define mkabspath
ifneq (1,$(words [$($(1))]))
empty:= $$(error $(1) must not contain spaces)
space:= $(empty) $(empty) endif
override $(1) := $(abspath $($(1)))
GLUONMAKE_EARLY = PATH=$(GLUONPATH) $(SUBMAKE) -C $(GLUON_ORIGOPENWRTDIR) -f $(GLUONDIR)/Makefile GLUON_TOOLS=0 QUILT= endef
GLUONMAKE = PATH=$(GLUONPATH) $(SUBMAKE) -C $(GLUON_OPENWRTDIR) -f $(GLUONDIR)/Makefile
ifneq ($(OPENWRT_BUILD),1)
GLUONDIR:=${CURDIR}
include $(GLUONDIR)/include/gluon.mk
TOPDIR:=$(GLUON_ORIGOPENWRTDIR)
export TOPDIR
update: FORCE
$(GLUONDIR)/scripts/update.sh
$(GLUONDIR)/scripts/patch.sh
update-patches: FORCE
$(GLUONDIR)/scripts/update.sh
$(GLUONDIR)/scripts/update-patches.sh
$(GLUONDIR)/scripts/patch.sh
-include $(TOPDIR)/include/host.mk escape = '$(subst ','\'',$(1))'
_SINGLE=export MAKEFLAGS=$(space); GLUON_SITEDIR ?= site
$(eval $(call mkabspath,GLUON_SITEDIR))
override OPENWRT_BUILD=1 ifeq ($(realpath $(GLUON_SITEDIR)/site.mk),)
override GLUON_TOOLS=1 $(error No site configuration was found. Please check out a site configuration to $(GLUON_SITEDIR))
GREP_OPTIONS= endif
export OPENWRT_BUILD GLUON_TOOLS GREP_OPTIONS
-include $(TOPDIR)/include/debug.mk include $(GLUON_SITEDIR)/site.mk
-include $(TOPDIR)/include/depends.mk
include $(GLUONDIR)/include/toplevel.mk
GLUON_RELEASE ?= $(error GLUON_RELEASE not set. GLUON_RELEASE can be set in site.mk or on the command line)
include $(GLUONDIR)/targets/targets.mk GLUON_DEPRECATED ?= 0
ifneq ($(GLUON_BRANCH),)
$(warning *** Warning: GLUON_BRANCH has been deprecated, please set GLUON_AUTOUPDATER_BRANCH and GLUON_AUTOUPDATER_ENABLED instead.)
GLUON_AUTOUPDATER_BRANCH ?= $(GLUON_BRANCH)
GLUON_AUTOUPDATER_ENABLED ?= 1
endif
CheckTarget := [ -n '$(GLUON_TARGET)' -a -n '$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)' ] \ ifneq ($(GLUON_FEATURES)$(GLUON_FEATURES_standard)$(GLUON_FEATURES_tiny),)
|| (echo -e 'Please set GLUON_TARGET to a valid target. Gluon supports the following targets:$(subst $(space),\n * ,$(GLUON_TARGETS))'; false) $(error *** Warning: GLUON_FEATURES has been obsolete, please use the image-customization.lua file instead.)
endif
ifneq ($(GLUON_SITE_PACKAGES)$(GLUON_SITE_PACKAGES_standard)$(GLUON_SITE_PACKAGES_tiny),)
$(error *** Warning: GLUON_SITE_PACKAGES has been obsolete, please use the image-customization.lua file instead.)
endif
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) GLUON_AUTOUPDATER_ENABLED ?= 0
# initialize (possibly already user set) directory variables
GLUON_TMPDIR ?= tmp
GLUON_OUTPUTDIR ?= output
GLUON_IMAGEDIR ?= $(GLUON_OUTPUTDIR)/images
GLUON_PACKAGEDIR ?= $(GLUON_OUTPUTDIR)/packages
GLUON_DEBUGDIR ?= $(GLUON_OUTPUTDIR)/debug
GLUON_METADIR ?= $(GLUON_OUTPUTDIR)/meta
GLUON_TARGETSDIR ?= targets
GLUON_PATCHESDIR ?= patches
$(eval $(call mkabspath,GLUON_TMPDIR))
$(eval $(call mkabspath,GLUON_OUTPUTDIR))
$(eval $(call mkabspath,GLUON_IMAGEDIR))
$(eval $(call mkabspath,GLUON_PACKAGEDIR))
$(eval $(call mkabspath,GLUON_TARGETSDIR))
$(eval $(call mkabspath,GLUON_PATCHESDIR))
GLUON_VERSION := $(shell scripts/getversion.sh '.')
# Set default SITE_VERSION if not set by user
GLUON_SITE_VERSION ?= $(shell scripts/getversion.sh '$(GLUON_SITEDIR)')
GLUON_MULTIDOMAIN ?= 0
GLUON_AUTOREMOVE ?= 0
GLUON_DEBUG ?= 1
GLUON_MINIFY ?= 1
# Can be overridden via environment/command line/... to use the Gluon
# build system for non-Gluon builds
define GLUON_BASE_FEEDS ?=
src-link gluon_base ../../package
endef
GLUON_VARS = \
GLUON_VERSION GLUON_SITE_VERSION \
GLUON_RELEASE GLUON_REGION GLUON_MULTIDOMAIN GLUON_AUTOREMOVE GLUON_DEBUG GLUON_MINIFY GLUON_DEPRECATED \
GLUON_DEVICES GLUON_TARGETSDIR GLUON_PATCHESDIR GLUON_TMPDIR GLUON_IMAGEDIR GLUON_PACKAGEDIR GLUON_DEBUGDIR \
GLUON_METADIR GLUON_SITEDIR GLUON_AUTOUPDATER_BRANCH GLUON_AUTOUPDATER_ENABLED GLUON_LANGS GLUON_BASE_FEEDS \
GLUON_TARGET BOARD SUBTARGET
create-key: FORCE unexport $(GLUON_VARS)
@$(CheckExternal) GLUON_ENV = $(foreach var,$(GLUON_VARS),$(var)=$(call escape,$($(var))))
+@$(GLUONMAKE_EARLY) create-key
prepare-target: FORCE show-release:
@$(CheckExternal) @echo '$(GLUON_RELEASE)'
@$(CheckTarget)
+@$(GLUONMAKE_EARLY) prepare-target
all: prepare-target
+@$(GLUONMAKE) build-key
+@$(GLUONMAKE) prepare
+@$(GLUONMAKE) images
+@$(GLUONMAKE) modules
prepare: prepare-target update: FORCE
+@$(GLUONMAKE) build-key @
+@$(GLUONMAKE) $@ export $(GLUON_ENV)
scripts/update.sh
scripts/patch.sh
scripts/feeds.sh
clean download images modules: FORCE update-patches: FORCE
@$(CheckExternal) @
@$(CheckTarget) export $(GLUON_ENV)
+@$(GLUONMAKE_EARLY) maybe-prepare-target scripts/update.sh
+@$(GLUONMAKE) build-key scripts/update-patches.sh
+@$(GLUONMAKE) $@ scripts/patch.sh
refresh-patches: FORCE
@
export $(GLUON_ENV)
scripts/update.sh
scripts/patch.sh
scripts/update-patches.sh
update-feeds: FORCE
@$(GLUON_ENV) scripts/feeds.sh
update-modules: FORCE
@scripts/update-modules.sh
update-ci: FORCE
@$(GLUON_ENV) scripts/update-ci.sh
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
toolchain/% package/% target/% image/%: FORCE include $(GLUON_TARGETSDIR)/targets.mk
@$(CheckExternal)
@$(CheckTarget)
+@$(GLUONMAKE_EARLY) maybe-prepare-target
+@$(GLUONMAKE) build-key
+@$(GLUONMAKE) $@
manifest: FORCE
@[ -n '$(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)
( \ OPENWRTMAKE = $(MAKE) -C openwrt
echo 'BRANCH=$(GLUON_BRANCH)' && \
echo 'DATE=$(shell $(GLUON_ORIGOPENWRTDIR)/staging_dir/host/bin/lua $(GLUONDIR)/scripts/rfc3339date.lua)' && \
echo 'PRIORITY=$(GLUON_PRIORITY)' && \
echo \
) > $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp
+($(foreach GLUON_TARGET,$(GLUON_TARGETS), \ BOARD := $(GLUON_TARGET_$(GLUON_TARGET)_BOARD)
( [ ! -e $(BOARD_BUILDDIR)/prepared ] || ( $(GLUONMAKE) manifest GLUON_TARGET='$(GLUON_TARGET)' V=s$(OPENWRT_VERBOSE) ) ) && \ SUBTARGET := $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)
) :)
mkdir -p $(GLUON_IMAGEDIR)/sysupgrade
mv $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp $(GLUON_IMAGEDIR)/sysupgrade/$(GLUON_BRANCH).manifest
dirclean : FORCE define CheckTarget
for dir in build_dir dl staging_dir tmp; do \ if [ -z '$(BOARD)' ]; then
rm -rf $(GLUON_ORIGOPENWRTDIR)/$$dir; \ echo 'Please set GLUON_TARGET to a valid target. Gluon supports the following targets:'
for target in $(GLUON_TARGETS); do
echo " * $$target"
done done
rm -rf $(GLUON_BUILDDIR) $(GLUON_OUTPUTDIR) exit 1
fi
else
TOPDIR=${CURDIR}
export TOPDIR
include rules.mk
include $(GLUONDIR)/include/gluon.mk
include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/depends.mk
include $(INCLUDE_DIR)/subdir.mk
include package/Makefile
include tools/Makefile
include toolchain/Makefile
include target/Makefile
PROFILES :=
PROFILE_PACKAGES :=
define Profile
$(eval $(call Profile/Default))
$(eval $(call Profile/$(1)))
endef
define GluonProfile
PROFILES += $(1)
PROFILE_PACKAGES += $(filter-out -%,$(2) $(GLUON_$(1)_SITE_PACKAGES))
GLUON_$(1)_PROFILE := $(if $(3),$(3),$(1))
GLUON_$(1)_DEFAULT_PACKAGES := $(2)
GLUON_$(1)_FACTORY_SUFFIX := -squashfs-factory
GLUON_$(1)_SYSUPGRADE_SUFFIX := -squashfs-sysupgrade
GLUON_$(1)_FACTORY_EXT := .bin
GLUON_$(1)_SYSUPGRADE_EXT := .bin
GLUON_$(1)_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)
GLUON_$(1)_MODEL_$(3)_ALIASES :=
endef endef
define GluonModelAlias define CheckSite
GLUON_$(1)_MODEL_$(2)_ALIASES += $(3) if ! GLUON_SITEDIR='$(GLUON_SITEDIR)' GLUON_SITE_CONFIG='$(1).conf' $(LUA) -e 'assert(dofile("scripts/site_config.lua")(os.getenv("GLUON_SITE_CONFIG")))'; then
echo 'Your site configuration ($(1).conf) did not pass validation'
exit 1
fi
endef endef
list-targets: FORCE
export SHA512SUM := $(GLUONDIR)/scripts/sha512sum.sh @for target in $(GLUON_TARGETS); do
echo "$$target"
prereq: FORCE
+$(NO_TRACE_MAKE) prereq
prepare-tmpinfo: FORCE
@+$(MAKE) -r -s staging_dir/host/.prereq-build OPENWRT_BUILD= QUIET=0
mkdir -p tmp/info
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS="$(TOPDIR)/include/package*.mk $(TOPDIR)/overlay/*/*.mk" SCAN_EXTRA=""
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPS="profiles/*.mk $(TOPDIR)/include/kernel*.mk $(TOPDIR)/include/target.mk" SCAN_DEPTH=2 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
for type in package target; do \
f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \
[ "$$t" -nt "$$f" ] || ./scripts/metadata.pl $${type}_config "$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false; break; }; \
done
[ tmp/.config-feeds.in -nt tmp/.packagefeeds ] || ./scripts/feeds feed_config > tmp/.config-feeds.in
./scripts/metadata.pl package_mk tmp/.packageinfo > tmp/.packagedeps || { rm -f tmp/.packagedeps; false; }
./scripts/metadata.pl package_feeds tmp/.packageinfo > tmp/.packagefeeds || { rm -f tmp/.packagefeeds; false; }
touch $(TOPDIR)/tmp/.build
feeds: FORCE
rm -rf $(TOPDIR)/package/feeds
mkdir $(TOPDIR)/package/feeds
[ ! -f $(GLUON_SITEDIR)/modules ] || . $(GLUON_SITEDIR)/modules && for feed in $$GLUON_SITE_FEEDS; do ln -s ../../../packages/$$feed $(TOPDIR)/package/feeds/$$feed; done
ln -s ../../../package $(TOPDIR)/package/feeds/gluon
. $(GLUONDIR)/modules && for feed in $$GLUON_FEEDS; do ln -s ../../../packages/$$feed $(TOPDIR)/package/feeds/module_$$feed; done
+$(GLUONMAKE_EARLY) prepare-tmpinfo
gluon-tools: FORCE
+$(GLUONMAKE_EARLY) tools/patch/install
+$(GLUONMAKE_EARLY) tools/sed/install
+$(GLUONMAKE_EARLY) tools/cmake/install
+$(GLUONMAKE_EARLY) package/lua/host/install package/usign/host/install
early_prepared_stamp := $(GLUON_BUILDDIR)/prepared_$(shell \
( \
$(SHA512SUM) $(GLUONDIR)/modules; \
[ ! -r $(GLUON_SITEDIR)/modules ] || $(SHA512SUM) $(GLUON_SITEDIR)/modules \
) | $(SHA512SUM) )
prepare-early: FORCE
for dir in build_dir dl staging_dir; do \
mkdir -p $(GLUON_ORIGOPENWRTDIR)/$$dir; \
done done
+$(GLUONMAKE_EARLY) feeds lint: lint-editorconfig lint-lua lint-sh
+$(GLUONMAKE_EARLY) gluon-tools
mkdir -p $$(dirname $(early_prepared_stamp))
touch $(early_prepared_stamp)
$(early_prepared_stamp):
rm -f $(GLUON_BUILDDIR)/prepared_*
+$(GLUONMAKE_EARLY) prepare-early
$(GLUON_OPKG_KEY): $(early_prepared_stamp) FORCE
[ -s $(GLUON_OPKG_KEY) -a -s $(GLUON_OPKG_KEY).pub ] || \
( mkdir -p $$(dirname $(GLUON_OPKG_KEY)) && $(STAGING_DIR_HOST)/bin/usign -G -s $(GLUON_OPKG_KEY) -p $(GLUON_OPKG_KEY).pub -c "Gluon opkg key" )
$(GLUON_OPKG_KEY).pub: $(GLUON_OPKG_KEY)
create-key: $(GLUON_OPKG_KEY).pub
include $(GLUONDIR)/targets/targets.mk
ifneq ($(GLUON_TARGET),)
include $(GLUONDIR)/targets/$(GLUON_TARGET)/profiles.mk
BOARD := $(GLUON_TARGET_$(GLUON_TARGET)_BOARD)
override SUBTARGET := $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)
target_prepared_stamp := $(BOARD_BUILDDIR)/target-prepared
gluon_prepared_stamp := $(BOARD_BUILDDIR)/prepared
PREPARED_RELEASE = $$(cat $(gluon_prepared_stamp))
IMAGE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE)
MODULE_PREFIX = gluon-$(GLUON_SITE_CODE)-$(PREPARED_RELEASE)
include $(INCLUDE_DIR)/target.mk
build-key: FORCE
rm -f $(BUILD_KEY) $(BUILD_KEY).pub
cp $(GLUON_OPKG_KEY) $(BUILD_KEY)
cp $(GLUON_OPKG_KEY).pub $(BUILD_KEY).pub
config: FORCE
+$(NO_TRACE_MAKE) scripts/config/conf OPENWRT_BUILD= QUIET=0
+$(GLUONMAKE) prepare-tmpinfo
( \
cat $(GLUONDIR)/include/config; \
echo 'CONFIG_TARGET_$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)=y'; \
$(if $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET), \
echo 'CONFIG_TARGET_$(GLUON_TARGET_$(GLUON_TARGET)_BOARD)_$(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)=y'; \
) \
cat $(GLUONDIR)/targets/$(GLUON_TARGET)/config 2>/dev/null; \
echo 'CONFIG_BUILD_SUFFIX="gluon-$(GLUON_TARGET)"'; \
echo '$(patsubst %,CONFIG_PACKAGE_%=m,$(sort $(filter-out -%,$(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES) $(PROFILE_PACKAGES))))' \
| sed -e 's/ /\n/g'; \
echo '$(patsubst %,CONFIG_LUCI_LANG_%=y,$(GLUON_LANGS))' \
| sed -e 's/ /\n/g'; \
) > $(BOARD_BUILDDIR)/config.tmp
scripts/config/conf --defconfig=$(BOARD_BUILDDIR)/config.tmp Config.in
+$(SUBMAKE) tools/install
prepare-target: $(GLUON_OPKG_KEY).pub
rm $(GLUON_OPENWRTDIR)/tmp || true
mkdir -p $(GLUON_OPENWRTDIR)/tmp
for link in build_dir config Config.in dl include Makefile package rules.mk scripts staging_dir target toolchain tools; do \
ln -sf $(GLUON_ORIGOPENWRTDIR)/$$link $(GLUON_OPENWRTDIR); \
done
+$(GLUONMAKE) config lint-editorconfig: FORCE
touch $(target_prepared_stamp) @scripts/lint-editorconfig.sh
$(target_prepared_stamp): lint-lua: FORCE
+$(GLUONMAKE_EARLY) prepare-target @scripts/lint-lua.sh
maybe-prepare-target: $(target_prepared_stamp) lint-sh: FORCE
+$(GLUONMAKE_EARLY) $(GLUON_OPKG_KEY).pub @scripts/lint-sh.sh
$(BUILD_DIR)/.prepared: Makefile
@mkdir -p $$(dirname $@)
@touch $@
$(toolchain/stamp-install): $(tools/stamp-install) LUA := openwrt/staging_dir/hostpkg/bin/lua
$(package/stamp-compile): $(package/stamp-cleanup)
$(LUA):
+@
clean: FORCE scripts/module_check.sh
+$(SUBMAKE) clean
rm -f $(gluon_prepared_stamp)
$(GLUON_ENV) scripts/basic_openwrt_config.sh > openwrt/.config
$(OPENWRTMAKE) defconfig
$(OPENWRTMAKE) tools/install
$(OPENWRTMAKE) package/lua/host/compile
download: FORCE
+$(SUBMAKE) tools/download
+$(SUBMAKE) toolchain/download
+$(SUBMAKE) package/download
+$(SUBMAKE) target/download
toolchain: $(toolchain/stamp-install) $(tools/stamp-install) config: $(LUA) FORCE
+@
include $(INCLUDE_DIR)/kernel.mk scripts/module_check.sh
$(CheckTarget)
kernel: FORCE $(foreach conf,site $(patsubst $(GLUON_SITEDIR)/%.conf,%,$(wildcard $(GLUON_SITEDIR)/domains/*.conf)),\
+$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) $(LINUX_DIR)/.image TARGET_BUILD=1 $(call CheckSite,$(conf)); \
+$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) $(LINUX_DIR)/.modules TARGET_BUILD=1 )
packages: $(package/stamp-compile)
$(_SINGLE)$(SUBMAKE) -r package/index
prepare-image: FORCE
rm -rf $(BOARD_KDIR)
mkdir -p $(BOARD_KDIR)
-cp $(KERNEL_BUILD_DIR)/* $(BOARD_KDIR)/
+$(SUBMAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image image_prepare KDIR="$(BOARD_KDIR)"
prepare: FORCE
@$(STAGING_DIR_HOST)/bin/lua $(GLUONDIR)/scripts/site_config.lua \
|| (echo 'Your site configuration did not pass validation.'; false)
mkdir -p $(GLUON_IMAGEDIR) $(BOARD_BUILDDIR)
echo 'src packages file:../openwrt/bin/$(BOARD)/packages' > $(BOARD_BUILDDIR)/opkg.conf
+$(GLUONMAKE) toolchain
+$(GLUONMAKE) kernel
+$(GLUONMAKE) packages
+$(GLUONMAKE) prepare-image
echo "$(GLUON_RELEASE)" > $(gluon_prepared_stamp)
$(gluon_prepared_stamp):
+$(GLUONMAKE) prepare
modules: FORCE $(gluon_prepared_stamp)
-rm -f $(GLUON_MODULEDIR)/*/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)/*
-rmdir -p $(GLUON_MODULEDIR)/*/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)
mkdir -p $(GLUON_MODULEDIR)/$(MODULE_PREFIX)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)
cp $(PACKAGE_DIR)/kmod-*.ipk $(GLUON_MODULEDIR)/$(MODULE_PREFIX)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)
$(_SINGLE)$(SUBMAKE) -r package/index PACKAGE_DIR=$(GLUON_MODULEDIR)/$(MODULE_PREFIX)/$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)
include $(INCLUDE_DIR)/package-ipkg.mk
# override variables from rules.mk $(OPENWRTMAKE) prepare-tmpinfo
PACKAGE_DIR = $(GLUON_OPENWRTDIR)/bin/$(BOARD)/packages $(GLUON_ENV) $(LUA) scripts/target_config.lua > openwrt/.config
$(OPENWRTMAKE) defconfig
$(GLUON_ENV) $(LUA) scripts/target_config_check.lua
PROFILE_BUILDDIR = $(BOARD_BUILDDIR)/profiles/$(PROFILE)
PROFILE_KDIR = $(PROFILE_BUILDDIR)/kernel
BIN_DIR = $(PROFILE_BUILDDIR)/images
TARGET_DIR = $(PROFILE_BUILDDIR)/root container: FORCE
@scripts/container.sh
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 all: config
+@
$(GLUON_ENV) $(LUA) scripts/clean_output.lua
$(OPENWRTMAKE)
$(GLUON_ENV) $(LUA) scripts/copy_output.lua
clean download: config
+@$(OPENWRTMAKE) $@
enable_initscripts: FORCE dirclean: FORCE
cd $(TARGET_DIR) && ( export IPKG_INSTROOT=$(TARGET_DIR); \ +@
$(foreach script,$(wildcard $(TARGET_DIR)/etc/init.d/*), \ [ -e openwrt/.config ] || $(OPENWRTMAKE) defconfig
$(call EnableInitscript,$(script)); \ $(OPENWRTMAKE) dirclean
) : \ rm -rf $(GLUON_TMPDIR) $(GLUON_OUTPUTDIR)
)
manifest: $(LUA) FORCE
@
[ '$(GLUON_AUTOUPDATER_BRANCH)' ] || (echo 'Please set GLUON_AUTOUPDATER_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)
scripts/module_check.sh
(
export $(GLUON_ENV)
echo 'BRANCH=$(GLUON_AUTOUPDATER_BRANCH)'
echo "DATE=$$($(LUA) scripts/rfc3339date.lua)"
echo 'PRIORITY=$(GLUON_PRIORITY)'
echo
for target in $(GLUON_TARGETS); do
$(LUA) scripts/generate_manifest.lua "$$target"
done
) > 'tmp/$(GLUON_AUTOUPDATER_BRANCH).manifest.tmp'
mkdir -p '$(GLUON_IMAGEDIR)/sysupgrade'
mv 'tmp/$(GLUON_AUTOUPDATER_BRANCH).manifest.tmp' '$(GLUON_IMAGEDIR)/sysupgrade/$(GLUON_AUTOUPDATER_BRANCH).manifest'
# Generate package list FORCE: ;
$(eval $(call merge-lists,INSTALL_PACKAGES,DEFAULT_PACKAGES GLUON_DEFAULT_PACKAGES GLUON_SITE_PACKAGES GLUON_$(PROFILE)_DEFAULT_PACKAGES GLUON_$(PROFILE)_SITE_PACKAGES))
package_install: FORCE
$(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
include $(INCLUDE_DIR)/version.mk
opkg_config: FORCE
for d in base packages luci routing telephony management; do \
echo "src/gz %n_$$d %U/$$d"; \
done > $(TARGET_DIR)/etc/opkg/distfeeds.conf
$(VERSION_SED) $(TARGET_DIR)/etc/opkg/distfeeds.conf
image: FORCE
rm -rf $(TARGET_DIR) $(BIN_DIR) $(PROFILE_KDIR)
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TARGET_DIR)/tmp $(GLUON_IMAGEDIR)/factory $(GLUON_IMAGEDIR)/sysupgrade
cp -r $(BOARD_KDIR) $(PROFILE_KDIR)
+$(GLUONMAKE) package_install
+$(GLUONMAKE) opkg_config
$(call Image/mkfs/prepare)
$(_SINGLE)$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image install TARGET_BUILD=1 IMG_PREFIX=gluon \
PROFILE="$(GLUON_$(PROFILE)_PROFILE)" KDIR="$(PROFILE_KDIR)" TARGET_DIR="$(TARGET_DIR)" BIN_DIR="$(BIN_DIR)" TMP_DIR="$(TMP_DIR)"
$(foreach model,$(GLUON_$(PROFILE)_MODELS), \
$(if $(GLUON_$(PROFILE)_SYSUPGRADE_EXT), \
rm -f $(GLUON_IMAGEDIR)/sysupgrade/gluon-*-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \
cp $(BIN_DIR)/gluon-$(GLUON_$(PROFILE)_MODEL_$(model))$(GLUON_$(PROFILE)_SYSUPGRADE_SUFFIX)$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) $(GLUON_IMAGEDIR)/sysupgrade/$(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \
) \
$(if $(GLUON_$(PROFILE)_FACTORY_EXT), \
rm -f $(GLUON_IMAGEDIR)/factory/gluon-*-$(model)$(GLUON_$(PROFILE)_FACTORY_EXT) && \
cp $(BIN_DIR)/gluon-$(GLUON_$(PROFILE)_MODEL_$(model))$(GLUON_$(PROFILE)_FACTORY_SUFFIX)$(GLUON_$(PROFILE)_FACTORY_EXT) $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(model)$(GLUON_$(PROFILE)_FACTORY_EXT) && \
) \
\
$(foreach alias,$(GLUON_$(PROFILE)_MODEL_$(model)_ALIASES), \
$(if $(GLUON_$(PROFILE)_SYSUPGRADE_EXT), \
rm -f $(GLUON_IMAGEDIR)/sysupgrade/gluon-*-$(alias)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \
ln -s $(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) $(GLUON_IMAGEDIR)/sysupgrade/$(IMAGE_PREFIX)-$(alias)-sysupgrade$(GLUON_$(PROFILE)_SYSUPGRADE_EXT) && \
) \
$(if $(GLUON_$(PROFILE)_FACTORY_EXT), \
rm -f $(GLUON_IMAGEDIR)/factory/gluon-*-$(alias)$(GLUON_$(PROFILE)_FACTORY_EXT) && \
ln -s $(IMAGE_PREFIX)-$(model)$(GLUON_$(PROFILE)_FACTORY_EXT) $(GLUON_IMAGEDIR)/factory/$(IMAGE_PREFIX)-$(alias)$(GLUON_$(PROFILE)_FACTORY_EXT) && \
) \
) \
) :
image/%: $(gluon_prepared_stamp)
+$(GLUONMAKE) image PROFILE="$(patsubst image/%,%,$@)" V=s$(OPENWRT_VERBOSE)
call_image/%: FORCE
+$(GLUONMAKE) $(patsubst call_image/%,image/%,$@)
images: $(patsubst %,call_image/%,$(PROFILES)) ;
manifest: FORCE
( \
cd $(GLUON_IMAGEDIR)/sysupgrade; \
$(foreach profile,$(PROFILES), \
$(if $(GLUON_$(profile)_SYSUPGRADE_EXT), \
$(foreach model,$(GLUON_$(profile)_MODELS), \
file="$(IMAGE_PREFIX)-$(model)-sysupgrade$(GLUON_$(profile)_SYSUPGRADE_EXT)"; \
[ -e "$$file" ] && echo '$(model)' "$(PREPARED_RELEASE)" "$$($(SHA512SUM) "$$file")" "$$file"; \
\
$(foreach alias,$(GLUON_$(profile)_MODEL_$(model)_ALIASES), \
file="$(IMAGE_PREFIX)-$(alias)-sysupgrade$(GLUON_$(profile)_SYSUPGRADE_EXT)"; \
[ -e "$$file" ] && echo '$(alias)' "$(PREPARED_RELEASE)" "$$($(SHA512SUM) "$$file")" "$$file"; \
) \
) \
) \
) : \
) >> $(GLUON_BUILDDIR)/$(GLUON_BRANCH).manifest.tmp
.PHONY: all create-key prepare images modules clean gluon-tools manifest
endif .PHONY: FORCE
endif .NOTPARALLEL:
.ONESHELL:
Documentation (incomplete at this time, contribute if you can!) may be found at [![Build Gluon](https://github.com/freifunk-gluon/gluon/actions/workflows/build-gluon.yml/badge.svg?branch=main)](https://github.com/freifunk-gluon/gluon/actions/workflows/build-gluon.yml)
http://gluon.readthedocs.org/. [![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/license/bsd-2-clause/)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/freifunk-gluon/gluon?sort=semver)](https://github.com/freifunk-gluon/gluon/releases/latest)
# Gluon
Gluon is a firmware framework to build preconfigured OpenWrt images for public mesh networks.
## Overview
Gluon provides an easy-to-use firmware for a public, decentral WLAN and/or wire based mesh network.
Common network capable devices, like smartphones, laptops or desktop PCs can connect to the mesh network and communicate over it, without the need of passwords for access and without the need of installing special software.
Additionally, internet access and merging mesh clouds can be accomplished over a WAN through VPN connected gateways.
Gluon's features include:
* a decentral mesh network
* easy configuration mode for less techy users
* community-specific technical settings and customizations through a common site.conf and site.mk
* ecdsa signature-based autoupdater
* node status web page
* publication of node information + statistics through respondd
* a variety of preconfigured mesh and VPN protocols:
Supported mesh protocols:
* batman-adv (BATMAN IV fully, BATMAN V partially)
* OLSRv2 (partially)
Supported protocols for node-to-node connections:
* WLAN: 802.11s (with forwarding disabled)
* WAN: VPNs via fastd and Wireguard
* LAN: via VXLAN
## Getting started
We have a huge amount of documentation over at https://gluon.readthedocs.io/.
If you're new to Gluon and ready to get your feet wet, have a look at the 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). [Getting Started Guide](https://gluon.readthedocs.io/en/latest/user/getting_started.html).
**Gluon IRC channel: `#gluon` in [hackint](http://hackint.org/)** Gluon's developers frequent an IRC chatroom at [#gluon](ircs://irc.hackint.org/#gluon)
on [hackint](https://hackint.org/). There is also a [webchat](https://chat.hackint.org/?join=gluon)
that allows for uncomplicated access from within your browser. This channel is also available as a bridged Matrix Room at [#gluon:hackint.org](https://matrix.to/#/#gluon:hackint.org).
## Issues & Feature requests ## Issues & Feature requests
...@@ -12,24 +52,27 @@ Before opening an issue, make sure to check whether any existing issues ...@@ -12,24 +52,27 @@ 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 (open or closed) match. If you're suggesting a new feature, drop by on IRC or
our mailinglist to discuss it first. 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! ## Use a release!
Please refrain from using the `master` branch for anything else but development purposes! Please refrain from using the `main` branch for anything else but development purposes!
Use the most recent release instead. You can list all relaseses by running `git branch -a` Use the most recent release instead. You can list all releases by running `git tag`
and switch to one by running `git checkout v2016.1.4 && make update`. and switch to one by running `git checkout v2023.2.5 && make update`.
If you're using the autoupdater, do not autoupdate nodes with anything but releases. If you're using the autoupdater, do not autoupdate nodes with anything but releases.
If you upgrade using random master commits the nodes *will break* eventually. If you upgrade using random main commits the nodes *might break* eventually.
## Mailinglist ## Mailinglist
To subscribe to the list, send a message to: To subscribe to the list, send a message to:
gluon-subscribe@luebeck.freifunk.net gluon+subscribe@luebeck.freifunk.net
To remove your address from the list, just send a message to To remove your address from the list, just send a message to
the address in the `List-Unsubscribe` header of any list the address in the `List-Unsubscribe` header of any list
message. If you haven't changed addresses since subscribing, message. If you haven't changed addresses since subscribing,
you can also send a message to: you can also send a message to:
gluon-unsubscribe@luebeck.freifunk.net gluon+unsubscribe@luebeck.freifunk.net
#!/usr/bin/env bash
# For a List of pre-installed packages on the runner image see
# https://github.com/actions/runner-images/tree/main?tab=readme-ov-file#available-images
echo "Disk space before cleanup"
df -h
# Remove packages not required to run the Gluon build CI
sudo apt-get -y remove \
dotnet-* \
firefox \
google-chrome-stable \
kubectl \
microsoft-edge-stable \
temurin-*-jdk
# Remove Android SDK tools
sudo rm -rf /usr/local/lib/android
echo "Disk space after cleanup"
df -h
#!/usr/bin/env python3
# Update target filters using
# make update-ci
import re
import os
import sys
import json
# these changes trigger rebuilds on all targets
common = [
".github/workflows/build-gluon.yml",
"modules",
"Makefile",
"patches/**",
"scripts/**",
"targets/generic",
"targets/targets.mk",
]
# these changes are only built on x86-64
extra = [
"contrib/ci/minimal-site/**",
"package/**"
]
_filter = dict()
# INCLUDE_PATTERN matches:
# include '...'
# include "..."
# include("...")
# include('...')
INCLUDE_PATTERN = "^\\s*include *\\(? *[\"']([^\"']+)[\"']"
# construct filters map from stdin
for target in sys.stdin:
target = target.strip()
_filter[target] = [
f"targets/{target}"
] + common
target_file = os.path.join(os.environ['GLUON_TARGETSDIR'], target)
with open(target_file) as f:
includes = re.findall(INCLUDE_PATTERN, f.read(), re.MULTILINE)
_filter[target].extend([f"targets/{i}" for i in includes])
if target == "x86-64":
_filter[target].extend(extra)
# print filters to stdout in json format, because json is stdlib and yaml compatible.
print(json.dumps(_filter, indent=2))
#!/bin/sh
set -e
export BROKEN=1
export GLUON_AUTOREMOVE=1
export GLUON_DEPRECATED=1
export GLUON_SITEDIR="contrib/ci/minimal-site"
export GLUON_TARGET="$1"
export BUILD_LOG=1
BUILD_THREADS="$(($(nproc) + 1))"
echo "Building Gluon with $BUILD_THREADS threads"
make update
make -j$BUILD_THREADS V=s
#!/usr/bin/env bash
echo "-- CPU --"
cat /proc/cpuinfo
echo "-- Memory --"
cat /proc/meminfo
echo "-- Disk --"
df -h
echo "-- Kernel --"
uname -a
echo "-- Network --"
ip addr
#!/usr/bin/env python3
import argparse
import json
import sys
from enum import Enum
# Enum Class for checking image size
class ImageSizeCheck(Enum):
OK = "OK"
TOO_BIG = "TOO_BIG"
IGNORED = "IGNORED"
UNKNOWN = "UNKNOWN"
# Some devices pad their images to IMAGE_SIZE and apply a firmware header.
# Exclude this from the image size check.
excluded_devices = [
"tplink_cpe210-v1",
"tplink_cpe210-v2",
"tplink_cpe210-v3",
"tplink_cpe220-v3",
"tplink_cpe510-v1",
"tplink_cpe510-v2",
"tplink_cpe510-v3",
"tplink_cpe710-v1",
"tplink_wbs210-v1",
"tplink_wbs210-v2",
"tplink_wbs510-v1"
]
def open_json(file_path):
with open(file_path, 'r') as f:
return json.load(f)
def load_openwrt_profile_json(json_path):
profiles = []
profile_json = open_json(json_path)
for profile_name, profile_data in profile_json["profiles"].items():
device_profile = {
"name": profile_name,
}
if "image" in profile_data.get("file_size_limits", {}):
device_profile["max_image_size"] = profile_data["file_size_limits"]["image"]
for image in profile_data["images"]:
if image["type"] != "sysupgrade":
continue
if "size" in image:
device_profile["image_size"] = image["size"]
profiles.append(device_profile)
return profiles
def check_image_size_below_limit(profile, overhead=0):
# Skip devices that pad their images
if profile["name"] in excluded_devices:
return ImageSizeCheck.IGNORED
if "max_image_size" in profile and "image_size" in profile:
if profile["image_size"] + (overhead * 1024) > profile["max_image_size"]:
return ImageSizeCheck.TOO_BIG
else:
return ImageSizeCheck.OK
return ImageSizeCheck.UNKNOWN
def print_github_actions_warning(message):
print('::warning::{}'.format(message))
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Check image size of OpenWrt profiles')
parser.add_argument(
'profile_json',
help='Path to profile.json',
nargs='+'
)
parser.add_argument(
'--github-actions',
help='Generate warnings for use with GitHub Actions',
action='store_true'
)
parser.add_argument(
'--overhead',
type=int,
help='Additional size to add to the image size in kilobyte',
default=0
)
args = parser.parse_args()
if args.profile_json is None:
print('Error: profile.json not specified')
sys.exit(1)
# Load all profile.json files
profiles = []
for profile_file in args.profile_json:
profiles.extend(load_openwrt_profile_json(profile_file))
# Initialize results with all available ImageSizeCheck values
results = {}
for check_result in ImageSizeCheck:
results[check_result] = []
for profile in profiles:
check_result = check_image_size_below_limit(profile, args.overhead)
results[check_result].append(profile)
for check_result, profiles in results.items():
if len(profiles) == 0:
continue
# Group by result type for GitHub Actions
if args.github_actions:
print('::group::{}'.format(check_result.value))
for profile in profiles:
if check_result == ImageSizeCheck.TOO_BIG:
msg = 'Image size of profile {} is too big ({} > {})'.format(
profile["name"],
profile["image_size"] + (args.overhead * 1024),
profile["max_image_size"])
if args.github_actions:
print_github_actions_warning(msg)
else:
print("Warning: {}".format(msg))
elif check_result == ImageSizeCheck.UNKNOWN:
msg = 'Image size of profile {} is unknown'.format(
profile["name"])
print(msg)
elif check_result == ImageSizeCheck.IGNORED:
msg = 'Image size of profile {} is ignored (Image size {})'.format(
profile["name"], profile.get("image_size", "unknown"))
print(msg)
else:
msg = 'Image size of profile {} is OK ({} < {})'.format(
profile["name"],
profile["image_size"] + (args.overhead * 1024),
profile["max_image_size"])
print(msg)
../../../docs/site-example/i18n/
\ No newline at end of file
features {
'autoupdater',
'ebtables-filter-multicast',
'ebtables-filter-ra-dhcp',
'ebtables-limit-arp',
'mesh-batman-adv-15',
'mesh-vpn-fastd',
'respondd',
'status-page',
'web-advanced',
'web-wizard',
}
if not device_class('tiny') then
features {'wireless-encryption-wpa3'}
end
../../../docs/site-example/modules
\ No newline at end of file
-- This is an example site configuration
--
-- Take a look at the documentation located at
-- https://gluon.readthedocs.io/ for details.
--
-- This configuration will not work as is. You're required to make
-- community specific changes to it!
{
-- Used for generated hostnames, e.g. freifunk-abcdef123456. (optional)
-- hostname_prefix = 'freifunk-',
-- Name of the community.
site_name = 'Continuous Integration',
-- Shorthand of the community.
site_code = 'ci',
-- 32 bytes of random data, encoded in hexadecimal
-- This data must be unique among all sites and domains!
-- Can be generated using: echo $(hexdump -v -n 32 -e '1/1 "%02x"' </dev/urandom)
domain_seed = 'e9608c4ff338b920992d629190e9ff11049de1dfc3f299eac07792dfbcda341c',
-- Prefixes used within the mesh.
-- prefix6 is required, prefix4 can be omitted if next_node.ip4
-- is not set.
prefix4 = '10.0.0.0/20',
prefix6 = 'fd::/64',
-- Timezone of your community.
-- See https://openwrt.org/docs/guide-user/base-system/system_configuration#time_zones
timezone = 'CET-1CEST,M3.5.0,M10.5.0/3',
-- List of NTP servers in your community.
-- Must be reachable using IPv6!
-- ntp_servers = {'1.ntp.services.ffxx'},
-- Wireless regulatory domain of your community.
regdom = 'DE',
-- Wireless configuration for 2.4 GHz interfaces.
wifi24 = {
-- Wireless channel.
channel = 1,
-- ESSIDs used for client network.
ap = {
ssid = 'gluon-ci-ssid',
-- disabled = true, -- (optional)
-- Configuration for a backward compatible OWE network below.
owe_ssid = 'owe.gluon-ci-ssid', -- (optional - SSID for OWE client network)
owe_transition_mode = true, -- (optional - enables transition-mode - requires ssid as well as owe_ssid)
},
mesh = {
-- Adjust these values!
id = 'ueH3uXjdp', -- usually you don't want users to connect to this mesh-SSID, so use a cryptic id that no one will accidentally mistake for the client WiFi
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.
wifi5 = {
channel = 44,
outdoor_chanlist = '100-140',
ap = {
ssid = 'gluon-ci-ssid',
},
mesh = {
-- Adjust these values!
id = 'ueH3uXjdp',
mcast_rate = 12000,
},
},
mesh = {
vxlan = true,
batman_adv = {
routing_algo = 'BATMAN_IV',
},
},
-- The next node feature allows clients to always reach the node it is
-- connected to using a known IP address.
next_node = {
-- anycast IPs of all nodes
-- name = { 'nextnode.location.community.example.org', 'nextnode', 'nn' },
ip4 = '10.0.0.1',
ip6 = 'fd::1',
},
-- 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,
fastd = {
-- Refer to https://fastd.readthedocs.io/en/latest/ to better understand
-- what these options do.
-- List of crypto-methods to use.
methods = {'salsa2012+umac'},
mtu = 1312,
-- configurable = true,
-- syslog_level = 'warn',
groups = {
backbone = {
-- Limit number of connected peers to reduce bandwidth.
limit = 1,
-- List of peers.
peers = {
},
-- Optional: nested peer groups
-- groups = {
-- backbone_sub = {
-- ...
-- },
-- ...
-- },
},
-- 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,
},
},
autoupdater = {
-- Default branch (optional), can be overridden by setting GLUON_AUTOUPDATER_BRANCH when building.
-- Set GLUON_AUTOUPDATER_ENABLED to enable the autoupdater by default for newly installed nodes.
branch = 'stable',
-- List of branches. You may define multiple branches.
branches = {
stable = {
name = 'stable',
-- List of mirrors to fetch images from. IPv6 required!
mirrors = {'http://1.updates.services.ffhl/stable/sysupgrade'},
-- Number of good signatures required.
-- Have multiple maintainers sign your build and only
-- accept it when a sufficient number of them have
-- signed it.
good_signatures = 0,
-- List of public keys of maintainers.
pubkeys = {
},
},
},
},
}
../../../docs/site-example/site.mk
\ No newline at end of file
../minimal-site/i18n
\ No newline at end of file
features {
'autoupdater',
'ebtables-filter-multicast',
'ebtables-filter-ra-dhcp',
'ebtables-limit-arp',
'mesh-olsrd',
'mesh-vpn-fastd',
'respondd',
'status-page',
'web-advanced',
'web-wizard',
}
packages {
'iwinfo',
}
if not device_class('tiny') then
features {'wireless-encryption-wpa3'}
end
../minimal-site/modules
\ No newline at end of file
-- This is an example site configuration
--
-- Take a look at the documentation located at
-- https://gluon.readthedocs.io/ for details.
--
-- This configuration will not work as is. You're required to make
-- community specific changes to it!
{
-- Used for generated hostnames, e.g. freifunk-abcdef123456. (optional)
-- hostname_prefix = 'freifunk-',
-- Name of the community.
site_name = 'Continuous Integration',
-- Shorthand of the community.
site_code = 'ci',
-- 32 bytes of random data, encoded in hexadecimal
-- This data must be unique among all sites and domains!
-- Can be generated using: echo $(hexdump -v -n 32 -e '1/1 "%02x"' </dev/urandom)
domain_seed = 'e9608c4ff338b920992d629190e9ff11049de1dfc3f299eac07792dfbcda341c',
-- Prefixes used by clients within the mesh.
-- prefix6 is required, prefix4 can be omitted if next_node.ip4
-- is not set.
prefix6 = 'fdff:cafe:cafe:cafe::/64',
-- Prefixes used by nodes within the mesh
node_prefix6 = 'fdff:cafe:cafe:cafe::/64',
-- Timezone of your community.
-- See https://openwrt.org/docs/guide-user/base-system/system_configuration#time_zones
timezone = 'CET-1CEST,M3.5.0,M10.5.0/3',
-- List of NTP servers in your community.
-- Must be reachable using IPv6!
-- ntp_servers = {'1.ntp.services.ffxx'},
-- Wireless regulatory domain of your community.
regdom = 'DE',
-- Wireless configuration for 2.4 GHz interfaces.
wifi24 = {
-- Wireless channel.
channel = 1,
-- ESSIDs used for client network.
ap = {
ssid = 'gluon-ci-ssid',
-- disabled = true, -- (optional)
-- Configuration for a backward compatible OWE network below.
owe_ssid = 'owe.gluon-ci-ssid', -- (optional - SSID for OWE client network)
owe_transition_mode = true, -- (optional - enables transition-mode - requires ssid as well as owe_ssid)
},
mesh = {
-- Adjust these values!
id = 'ueH3uXjdp', -- usually you don't want users to connect to this mesh-SSID, so use a cryptic id that no one will accidentally mistake for the client WiFi
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.
wifi5 = {
channel = 44,
outdoor_chanlist = '100-140',
ap = {
ssid = 'gluon-ci-ssid',
-- disabled = true, -- (optional)
-- Configuration for a backward compatible OWE network below.
owe_ssid = 'owe.gluon-ci-ssid', -- (optional - SSID for OWE client network)
owe_transition_mode = true, -- (optional - enables transition-mode - requires ssid as well as owe_ssid)
},
mesh = {
-- Adjust these values!
id = 'ueH3uXjdp',
mcast_rate = 12000,
},
},
-- The next node feature allows clients to always reach the node it is
-- connected to using a known IP address.
next_node = {
-- anycast IPs of all nodes
name = { 'nextnode.location.community.example.org', 'nextnode', 'nn' },
ip4 = '10.0.0.1',
ip6 = 'fd::1',
},
-- Options specific to routing protocols (optional)
mesh = {
vxlan = true,
olsrd = {},
},
mesh_vpn = {
-- enabled = true,
fastd = {
-- Refer to https://fastd.readthedocs.io/en/latest/ to better understand
-- what these options do.
-- List of crypto-methods to use.
methods = {'salsa2012+umac'},
mtu = 1312,
-- configurable = true,
-- syslog_level = 'warn',
groups = {
backbone = {
-- Limit number of connected peers to reduce bandwidth.
limit = 1,
-- List of peers.
peers = {
},
-- Optional: nested peer groups
-- groups = {
-- backbone_sub = {
-- ...
-- },
-- ...
-- },
},
-- 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,
},
},
autoupdater = {
-- Default branch (optional), can be overridden by setting GLUON_AUTOUPDATER_BRANCH when building.
-- Set GLUON_AUTOUPDATER_ENABLED to enable the autoupdater by default for newly installed nodes.
branch = 'stable',
-- List of branches. You may define multiple branches.
branches = {
stable = {
name = 'stable',
-- List of mirrors to fetch images from. IPv6 required!
mirrors = {'http://1.updates.services.ffhl/stable/sysupgrade'},
-- Number of good signatures required.
-- Have multiple maintainers sign your build and only
-- accept it when a sufficient number of them have
-- signed it.
good_signatures = 0,
-- List of public keys of maintainers.
pubkeys = {
},
},
},
},
}
## gluon site.mk makefile example
## DEFAULT_GLUON_RELEASE
# version string to use for images
# gluon relies on
# opkg compare-versions "$1" '>>' "$2"
# to decide if a version is newer or not.
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.
# e.g.:
# $ make images GLUON_RELEASE=23.42+5
# would generate images named like this:
# gluon-ff%site_code%-23.42+5-%router_model%.bin
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
#!/bin/bash #!/usr/bin/env bash
# Script to output the dependency graph of Gluon's packages # Script to output the dependency graph of Gluon's packages
# Limitations: # 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 # * Doesn't show dependencies through virtual packages correctly
set -e
shopt -s nullglob shopt -s nullglob
...@@ -25,19 +23,34 @@ print_dep() { ...@@ -25,19 +23,34 @@ print_dep() {
echo "$(escape_name "$1") -> $(escape_name "$2");" echo "$(escape_name "$1") -> $(escape_name "$2");"
} }
echo 'digraph G {' print_package() {
local package="$1" depends="$2"
for makefile in ./package/*/Makefile; do # shellcheck disable=SC2086
dir="$(dirname "$makefile")" set -- $depends
package="$(basename "$dir")"
deps=$(grep -w DEPENDS "$makefile" | cut -d= -f2 | tr -d +)
print_node "$package" print_node "$package"
for dep in $deps; do for dep in "$@"; do
print_node "$dep" print_node "$dep"
print_dep "$package" "$dep" print_dep "$package" "$dep"
done done
}
make -C openwrt -s prepare-tmpinfo
echo 'digraph G {'
cat ./openwrt/tmp/info/.packageinfo-feeds_gluon_base_* | while read -r key value; do
case "$key" in
'Package:')
package="$value"
;;
'Depends:')
depends="${value//+/}"
;;
'@@')
print_package "$package" "$depends"
;;
esac
done | sort -u done | sort -u
popd >/dev/null popd >/dev/null
......
FROM debian:bookworm-slim
ARG TARGETOS
ARG TARGETARCH
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
clang \
ecdsautils \
file \
gawk \
git \
libelf-dev \
libncurses5-dev \
libnss-unknown \
libssl-dev \
llvm \
lua-check \
openssh-client \
python3 \
python3-dev \
python3-pyelftools \
python3-setuptools \
qemu-utils \
rsync \
shellcheck \
swig \
time \
unzip \
wget \
zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /tmp/ec &&\
wget -O /tmp/ec/ec-${TARGETOS}-${TARGETARCH}.tar.gz https://github.com/editorconfig-checker/editorconfig-checker/releases/download/2.7.0/ec-${TARGETOS}-${TARGETARCH}.tar.gz &&\
tar -xvzf /tmp/ec/ec-${TARGETOS}-${TARGETARCH}.tar.gz &&\
mv bin/ec-${TARGETOS}-${TARGETARCH} /usr/local/bin/editorconfig-checker &&\
rm -rf /tmp/ec
RUN useradd -m -d /gluon -u 100 -g 100 -o gluon
USER gluon
VOLUME /gluon
WORKDIR /gluon
#!/usr/bin/perl
use strict;
use warnings;
use Text::Balanced qw(extract_bracketed extract_delimited extract_tagged);
@ARGV >= 1 || die "Usage: $0 <source directory>\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 = <S>;
close S;
my $text = $raw;
while( $text =~ s/ ^ .*? (?:translate|translatef|_) [\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;
}