Skip to content
Snippets Groups Projects
Commit 9c523650 authored by David Bauer's avatar David Bauer Committed by David Bauer
Browse files

build: introduce device classes

This commit allows to define a device-class flag in the target
definitions. This way, it is possible to distinguish between groups
of devices in the build-process in terms of package or feature
selection.
parent 3d5a6930
No related branches found
No related tags found
No related merge requests found
......@@ -112,6 +112,8 @@ lint-sh: FORCE
@scripts/lint-sh.sh
GLUON_DEFAULT_PACKAGES := hostapd-mini
GLUON_CLASS_PACKAGES_standard :=
GLUON_CLASS_PACKAGES_tiny :=
GLUON_FEATURE_PACKAGES := $(shell scripts/features.sh '$(GLUON_FEATURES)' || echo '__ERROR__')
ifneq ($(filter __ERROR__,$(GLUON_FEATURE_PACKAGES)),)
......@@ -144,12 +146,12 @@ config: $(LUA) FORCE
$(foreach conf,site $(patsubst $(GLUON_SITEDIR)/%.conf,%,$(wildcard $(GLUON_SITEDIR)/domains/*.conf)),$(call CheckSite,$(conf)))
@$(GLUON_CONFIG_VARS) \
$(LUA) scripts/target_config.lua '$(GLUON_TARGET)' '$(GLUON_PACKAGES)' \
$(LUA) scripts/target_config.lua '$(GLUON_TARGET)' '$(GLUON_DEFAULT_PACKAGES)' '$(GLUON_CLASS_PACKAGES_standard)' '$(GLUON_CLASS_PACKAGES_tiny)' \
> openwrt/.config
+@$(OPENWRTMAKE) defconfig
@$(GLUON_CONFIG_VARS) \
$(LUA) scripts/target_config_check.lua '$(GLUON_TARGET)' '$(GLUON_PACKAGES)'
$(LUA) scripts/target_config_check.lua '$(GLUON_TARGET)' '$(GLUON_DEFAULT_PACKAGES)' '$(GLUON_CLASS_PACKAGES_standard)' '$(GLUON_CLASS_PACKAGES_tiny)'
all: config
......
......@@ -7,6 +7,10 @@ return function(funcs)
local target = arg[1]
local extra_packages = arg[2]
local class_packages = {
standard = arg[3],
tiny = arg[4],
}
local openwrt_config_target
if env.SUBTARGET ~= '' then
......@@ -64,13 +68,19 @@ END_MAKE
end
device_pkgs = device_pkgs .. ' ' .. pkg
end
local function handle_pkgs(pkgs)
local packages = string.gmatch(pkgs or '', '%S+')
for pkg in packages do
handle_pkg(pkg)
end
end
for _, pkg in ipairs(dev.options.packages or {}) do
handle_pkg(pkg)
end
for pkg in string.gmatch(site_packages(dev.image), '%S+') do
handle_pkg(pkg)
end
handle_pkgs(site_packages(dev.image))
handle_pkgs(class_packages[dev.options.class])
funcs.config_message(lib.config, string.format("unable to enable device '%s'", profile),
'CONFIG_TARGET_DEVICE_%s_DEVICE_%s=y', openwrt_config_target, profile)
......
......@@ -39,6 +39,7 @@ local default_options = {
aliases = {},
manifest_aliases = {},
packages = {},
class = "standard",
deprecated = false,
broken = false,
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment