Skip to content

Commit 06d5477

Browse files
authored
Improvements to image customization docs (#3127)
* docs: user/site: add missing image-customization example * doc: user/site: improve wording of image customization section Also add a link to the examples section.
1 parent 9799086 commit 06d5477

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

docs/user/site.rst

+21-6
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ leading to entangled package names like *gluon-mesh-vpn-fastd-respondd* or
647647
*gluon-status-page-mesh-batman-adv-i18n-de*.
648648

649649
For this reason, we have introduced *feature flags*, which can be specified
650-
using the image-customization.lua file. These flags allow to specify
650+
using the ``image-customization.lua`` file. These flags allow to specify
651651
a set of features on a higher level than individual package names.
652652

653653
Most Gluon packages can simply be specified as feature flags by removing the ``gluon-``
@@ -671,7 +671,7 @@ To some extent, it will even allow us to further modularize existing Gluon packa
671671
without necessitating changes to existing site configurations.
672672

673673
It is still possible to override such automatic rules by removing them using
674-
*packages* in the image-customization.lua file
674+
*packages* in the ``image-customization.lua`` file
675675
(e.g., ``features { '-gluon-status-page-mesh-batman-adv' }`` to remove
676676
the automatically added package *gluon-status-page-mesh-batman-adv*).
677677

@@ -699,11 +699,14 @@ example *site.mk*.
699699
Image customization
700700
^^^^^^^^^^^^^^^^^^^
701701

702-
Gluon allows configuration of the build-parameters for the images. A Lua domain-specific-language
703-
has been implemented to facilitate this configuration. This file is interpreted for every device
704-
independently. The file is located in the site root as ``image-customization.lua``.
702+
Gluon allows configuration of the build parameters for the images. This
703+
configuration must always exist to configure the basic features included in a
704+
Gluon build.
705705

706-
A simple example for a device-specific image configuration can be found in the site-example.
706+
The file ``image-customization.lua`` in the root of the site configuration is
707+
used for this purpose, making use of a Domain Specific Language based on Lua.
708+
See the :ref:`site-examples` section for a simple example showing both basic
709+
setup and a device-specific alteration.
707710

708711
The following functions are available:
709712

@@ -737,6 +740,11 @@ disable_factory()
737740
Disables factory image generation. Sysupgrade images are still generated and stored in the image
738741
output directory.
739742

743+
Technically, the image customzation file is evaluated once for each device, allowing
744+
to make use of regular Lua *if* statements for device-specific configuration as
745+
can be seen in the example.
746+
747+
740748
.. _site-config-mode-texts:
741749

742750
Config mode texts
@@ -820,6 +828,7 @@ the corresponding configuration variables would be ``PACKAGES_FOO_REPO``,
820828
``PACKAGES_FOO_COMMIT`` and ``PACKAGES_FOO_BRANCH``. Slashes in feed names are
821829
replaced by underscores to get valid shell variable identifiers.
822830

831+
.. _site-examples:
823832

824833
Examples
825834
--------
@@ -836,6 +845,12 @@ site.conf
836845
.. literalinclude:: ../site-example/site.conf
837846
:language: lua
838847

848+
image-customization.lua
849+
^^^^^^^^^^^^^^^^^^^^^^^
850+
851+
.. literalinclude:: ../site-example/image-customization.lua
852+
:language: lua
853+
839854
i18n/en.po
840855
^^^^^^^^^^
841856

0 commit comments

Comments
 (0)