Skip to content

Commit

Permalink
docs: update to use new site-selection framework
Browse files Browse the repository at this point in the history
  • Loading branch information
blocktrron committed Nov 29, 2023
1 parent e27ddd9 commit 7a5c624
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 44 deletions.
3 changes: 2 additions & 1 deletion docs/dev/packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ Feature flags

Feature flags provide a convenient way to define package selections without
making it necessary to list each package explicitly. The list of features to
enable for a Gluon build is set by the *GLUON_FEATURES* variable in *site.mk*.
enable for a Gluon build is determined by the selection of features using
the feature and package customization framework.

The main feature flag definition file is ``package/features``, but each package
feed can provide additional definitions in a file called ``features`` at the root
Expand Down
2 changes: 1 addition & 1 deletion docs/features/multidomain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Via config mode
^^^^^^^^^^^^^^^

To allow switching the domain via config mode, add ``config-mode-domain-select``
to GLUON_FEATURES in site.mk.
to your list of enabled features.

|image0|

Expand Down
2 changes: 1 addition & 1 deletion docs/features/private-wlan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Please note that you should not enable Wired Mesh on the uplink port at the same

The private WLAN is encrypted using WPA2 by default. On devices with enough flash and a supported radio,
WPA3 or WPA2/WPA3 mixed-mode can be used instead of WPA2. For this to work, the ``wireless-encryption-wpa3``
feature has to be added to ``GLUON_FEATURES``.
feature has to be enabled.

It is recommended to enable IEEE 802.11w management frame protection for WPA2/WPA3 networks, however this
can lead to connectivity problems for older clients. In this case, management frame protection can be
Expand Down
2 changes: 1 addition & 1 deletion docs/features/vpn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Protocol handlers
^^^^^^^^^^^^^^^^^

There are currently three protocol handlers which can be selected
via ``GLUON_FEATURES`` in ``site.mk``:
as features in a site ``package``:

mesh-vpn-fastd
""""""""""""""
Expand Down
99 changes: 59 additions & 40 deletions docs/user/site.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ wifi24 \: optional
For an OWE secured network, the ``owe_ssid`` string has to be set. It sets the
SSID for the opportunistically encrypted wireless network, to which compatible
clients can connect to.
For OWE to work, the ``wireless-encryption-wpa3`` has to be enabled (usually by
adding it to ``GLUON_FEATURES_standard``) in your ``site.mk``.
For OWE to work, the ``wireless-encryption-wpa3`` feature has to be enabled
in your package-selection.
To utilize the OWE transition mode, ``owe_transition_mode`` has to be set to true.
When ``owe_transition_mode`` is enabled, the OWE secured SSID will be hidden.
Compatible devices will automatically connect to the OWE secured SSID when selecting
Expand Down Expand Up @@ -611,33 +611,6 @@ GLUON_DEPRECATED
and ``upgrade`` for existing configurations (where upgrades for existing
deployments of low-flash devices are required). Defaults to ``0``.

GLUON_FEATURES
Defines a list of features to include. Depending on the device, the feature list
defined from this value is combined with the feature list for either the standard
or the tiny device-class. The resulting feature list is used to generate the default
package set.

GLUON_FEATURES_standard
Defines a list of additional features to include or exclude for devices of
the standard device-class.

GLUON_FEATURES_tiny
Defines a list of additional features to include or exclude for devices of
the tiny device-class.

GLUON_SITE_PACKAGES
Defines a list of packages which should be installed in addition to the
default package set. It is also possible to remove packages from the
default set by prepending a minus sign to the package name.

GLUON_SITE_PACKAGES_standard
Defines a list of additional packages to include or exclude for devices of
the standard device-class.

GLUON_SITE_PACKAGES_tiny
Defines a list of additional packages to include or exclude for devices of
the tiny device-class.

GLUON_RELEASE
The current release version Gluon should use.

Expand All @@ -655,6 +628,56 @@ GLUON_LANGS

.. _user-site-feature-flags:

Feature customization
^^^^^^^^^^^^^^^^^^^^^

For inclusion of additional features and packages, Gluon provides a flexible
framework for determining, which features and packages a specific device image
ships with.

Features and package inclusions are defined within the *packages* file in the
site root. Multiple selectors and criteria are available for controlling
per-device package and feature inclusion.

A selector always includes a selection-set. A selection-set is a Lua table
consisting of one or more selectors.

An example can be found in the example site.

The following selectors are available.

Feature(feature-name)
Include a gluon-specific feature in the image.

Package(package-name)
Include a package in the image. This selector should only
be used with non-gluon packages, be it from OpenWrt upstream
or custom package feeds.

The following criteria are available.

default(selection-set)
The default criteria includes packages without any further criteria.
It is functionally equivalent to the *when* selector with an always-true
condition.

when(condition, selection-set)
This criteria includes a selection-set if the condition evaluates to true.

The following conditions are available.

device(device-name)
Match a specific device name. The name is identical with the OpenWrt target name.

target(target, subtarget)
Match a specific target and optionally a subtarget. If subtarget is omitted,
all subtargets belonging to the target are matched.

device_class
Match a specific device-class. Currently supported values are *standard* and *tiny*.

Conditions can be combined using Lua operators like *and* or *or*.

Feature flags
^^^^^^^^^^^^^

Expand All @@ -674,8 +697,8 @@ leading to entangled package names like *gluon-mesh-vpn-fastd-respondd* or
*gluon-status-page-mesh-batman-adv-i18n-de*.

For this reason, we have introduced *feature flags*, which can be specified
in the *GLUON_FEATURES* variable. These flags allow to specify a set of features
on a higher level than individual package names.
in the *packages* file of a site repository. These flags allow to specify a
set of features on a higher level than individual package names.

Most Gluon packages can simply be specified as feature flags by removing the ``gluon-``
prefix: The feature flag corresponding to the package *gluon-mesh-batman-adv-15* is
Expand All @@ -697,7 +720,7 @@ flags using a flexible ruleset defined in the Gluon repo or site package feeds.
To some extent, it will even allow us to further modularize existing Gluon packages,
without necessitating changes to existing site configurations.

It is still possible to override such automatic rules using *GLUON_SITE_PACKAGES*
It is still possible to override such automatic rules by using a *package* selector
(e.g., ``-gluon-status-page-mesh-batman-adv`` to remove the automatically added
package *gluon-status-page-mesh-batman-adv*).

Expand All @@ -707,18 +730,14 @@ package:
* web-wizard

Includes the *gluon-config-mode-...* base packages (hostname, geolocation and contact info),
as well as the *gluon-config-mode-autoupdater* (when *autoupdater* is in *GLUON_FEATURES*),
and *gluon-config-mode-mesh-vpn* (when *mesh-vpn-fastd* or *mesh-vpn-tunneldigger* are in
*GLUON_FEATURES*)
as well as the *gluon-config-mode-autoupdater* (when *autoupdater* is an enabled feature),
and *gluon-config-mode-mesh-vpn* (when *mesh-vpn-fastd* or *mesh-vpn-tunneldigger* are
enabled features)

* web-advanced

Includes the *gluon-web-...* base packages (admin, network, WiFi config),
as well as the *gluon-web-autoupdater* (when *autoupdater* is in *GLUON_FEATURES*)

We recommend to use *GLUON_SITE_PACKAGES* for non-Gluon OpenWrt packages only and
completely rely on *GLUON_FEATURES* for Gluon packages, as it is shown in the
example *site.mk*.
as well as the *gluon-web-autoupdater* (when *autoupdater* is an enabled feature)

.. _site-config-mode-texts:

Expand Down

0 comments on commit 7a5c624

Please sign in to comment.