Add GLUON_DEPRECATED flag

This new build flag is mandatory for now (it may default to 0 in a future
Gluon version). It may be set to the following values:

* 0 - Do not build any images for deprecated devices.
* upgrade - Only build sysupgrade images for deprecated devices.
* full - Build both sysupgrade and factory images for deprecated devices.

"Other" images are handled like factory images, as they are also used for
the initial installation of Gluon on a device.
This commit is contained in:
Matthias Schiffer 2019-06-15 14:34:45 +02:00
parent 071cf7b20f
commit 912490c026
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
6 changed files with 63 additions and 13 deletions

View File

@ -22,6 +22,8 @@ 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)
GLUON_DEPRECATED ?= $(error GLUON_DEPRECATED not set. Please consult the documentation)
# initialize (possibly already user set) directory variables
GLUON_TMPDIR ?= tmp
GLUON_OUTPUTDIR ?= output
@ -41,7 +43,7 @@ GLUON_MULTIDOMAIN ?= 0
GLUON_WLAN_MESH ?= 11s
GLUON_DEBUG ?= 0
export GLUON_RELEASE GLUON_REGION GLUON_MULTIDOMAIN GLUON_WLAN_MESH GLUON_DEBUG GLUON_DEVICES \
export GLUON_RELEASE GLUON_REGION GLUON_MULTIDOMAIN GLUON_WLAN_MESH GLUON_DEBUG GLUON_DEPRECATED GLUON_DEVICES \
GLUON_TARGETSDIR GLUON_PATCHESDIR GLUON_TMPDIR GLUON_IMAGEDIR GLUON_PACKAGEDIR
show-release:

View File

@ -59,3 +59,6 @@ GLUON_REGION ?= eu
# Languages to include
GLUON_LANGS ?= en de
# Do not build images for deprecated devices
GLUON_DEPRECATED ?= 0

View File

@ -53,3 +53,6 @@ GLUON_REGION ?= eu
# Languages to include
GLUON_LANGS ?= en de
# Do not build images for deprecated devices
GLUON_DEPRECATED ?= 0

View File

@ -161,6 +161,19 @@ GLUON_BRANCH
by default. For the ``make manifest`` command, GLUON_BRANCH defines the branch to
generate a manifest for.
GLUON_DEPRECATED
Controls whether images for deprecated devices should be built. The following
values are supported:
- ``0``: Do not build any images for deprecated devices.
- ``upgrade``: Only build sysupgrade images for deprecated devices.
- ``full``: Build both sysupgrade and factory images for deprecated devices.
Usually, devices are deprecated because their flash size is insufficient to
support future Gluon versions. The recommended setting is ``0`` for new sites,
and ``upgrade`` for existing configurations (where upgrades for existing
deployments of low-flash devices are required).
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``.

View File

@ -514,6 +514,19 @@ Build configuration
The ``site.mk`` is a Makefile which defines various values
involved in the build process of Gluon.
GLUON_DEPRECATED
Controls whether images for deprecated devices should be built. The following
values are supported:
- ``0``: Do not build any images for deprecated devices.
- ``upgrade``: Only build sysupgrade images for deprecated devices.
- ``full``: Build both sysupgrade and factory images for deprecated devices.
Usually, devices are deprecated because their flash size is insufficient to
support future Gluon versions. The recommended setting is ``0`` for new sites,
and ``upgrade`` for existing configurations (where upgrades for existing
deployments of low-flash devices are required).
GLUON_FEATURES
Defines a list of features to include. The feature list is used to generate
the default package set.

View File

@ -8,6 +8,7 @@ envtrue = setmetatable({}, {
assert(env.GLUON_SITEDIR)
assert(env.GLUON_TARGETSDIR)
assert(env.GLUON_RELEASE)
assert(env.GLUON_DEPRECATED)
site_code = assert(assert(dofile('scripts/site_config.lua')('site.conf')).site_code)
@ -25,6 +26,7 @@ local default_options = {
aliases = {},
manifest_aliases = {},
packages = {},
deprecated = false,
broken = false,
}
@ -39,6 +41,9 @@ local function want_device(dev, options)
if options.broken and not envtrue.BROKEN then
return false
end
if options.deprecated and env.GLUON_DEPRECATED == '0' then
return false
end
if (env.GLUON_DEVICES or '') == '' then
return true
@ -48,6 +53,8 @@ local function want_device(dev, options)
return gluon_devices[dev]
end
local full_deprecated = env.GLUON_DEPRECATED == 'full'
local function merge(a, b)
local ret = {}
@ -148,18 +155,6 @@ function device(image, name, options)
options = options,
})
if options.factory then
add_image {
image = image,
name = name,
subdir = 'factory',
in_suffix = options.factory,
out_suffix = '',
extension = options.factory_ext,
aliases = options.aliases,
manifest_aliases = options.manifest_aliases,
}
end
if options.sysupgrade then
add_image {
image = image,
@ -172,6 +167,23 @@ function device(image, name, options)
manifest_aliases = options.manifest_aliases,
}
end
if options.deprecated and not full_deprecated then
return
end
if options.factory then
add_image {
image = image,
name = name,
subdir = 'factory',
in_suffix = options.factory,
out_suffix = '',
extension = options.factory_ext,
aliases = options.aliases,
manifest_aliases = options.manifest_aliases,
}
end
for _, extra_image in ipairs(options.extra_images) do
add_image {
image = image,
@ -193,6 +205,10 @@ function factory_image(image, name, ext, options)
return
end
if options.deprecated and not full_deprecated then
return
end
add_image {
image = image,
name = name,