From 4e02d9ba9ff1e1d322bca0983cc107d4fc49a60e Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sat, 7 Mar 2020 16:02:24 +0100
Subject: [PATCH] docs: start doc page on the build system

---
 docs/dev/build.rst | 34 ++++++++++++++++++++++++++++++++++
 docs/index.rst     |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 docs/dev/build.rst

diff --git a/docs/dev/build.rst b/docs/dev/build.rst
new file mode 100644
index 000000000..63ec57a7b
--- /dev/null
+++ b/docs/dev/build.rst
@@ -0,0 +1,34 @@
+Build system
+============
+
+This page explains internals of the Gluon build system. It is currently very
+incomplete; please contribute if you can!
+
+Feed management
+---------------
+
+Rather that relying on the *feed.conf* mechanism of OpenWrt directly, Gluon
+manages its feeds (*"modules"*) using a collection of scripts. This solution was
+selected for multiple reasons:
+
+- Feeds lists from Gluon base and the site repository are combined
+- Patchsets are applied to downloaded feed repositories automatically
+
+The following variables specifically affect the feed management:
+
+GLUON_FEEDS
+    List of base feeds; defined in file *modules* in Gluon base
+
+GLUON_SITE_FEED
+    List of site feeds; defined in file *modules* in site config
+
+\*_REPO, \*_BRANCH, \*_COMMIT
+    Git repository URL, branch and and
+    commit ID of the feeds to use. The branch name may be omitted; the default
+    branch will be used in this case.
+
+GLUON_BASE_FEEDS
+    Additional feed definitions to be added to *feeds.conf*
+    verbatim. By default, this contains a reference to the Gluon base packages;
+    when using the Gluon build system to build a non-Gluon system, the variable
+    can be set to the empty string.
diff --git a/docs/index.rst b/docs/index.rst
index f11dd702e..0d8f1de97 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -42,6 +42,7 @@ Several Freifunk communities in Germany use Gluon as the foundation of their Fre
    dev/wan
    dev/mac_addresses
    dev/site_library
+   dev/build
 
 .. toctree::
    :caption: gluon-web Reference
-- 
GitLab