2014-02-20 16:22:06 +00:00
|
|
|
Getting Started
|
|
|
|
===============
|
|
|
|
|
2014-10-12 10:17:02 +00:00
|
|
|
Selecting the right version
|
|
|
|
---------------------------
|
|
|
|
|
2015-11-05 21:42:34 +00:00
|
|
|
Gluon's releases are managed using `Git tags`_. If you are just getting
|
2015-02-26 11:29:53 +00:00
|
|
|
started with Gluon we recommend to use the latest stable release of Gluon.
|
2014-10-12 10:17:02 +00:00
|
|
|
|
2014-10-13 10:23:41 +00:00
|
|
|
Take a look at the `list of gluon releases`_ and notice the latest release,
|
2016-12-18 22:15:12 +00:00
|
|
|
e.g. *v2016.2.2*. Always get Gluon using git and don't try to download it
|
2015-11-05 21:42:34 +00:00
|
|
|
as a Zip archive as the archive will be missing version information.
|
2014-10-13 10:23:41 +00:00
|
|
|
|
2015-11-05 21:42:34 +00:00
|
|
|
Please keep in mind that there is no "default Gluon" build; a site configuration
|
|
|
|
is required to adjust Gluon to your needs. Due to new features being added (or
|
|
|
|
sometimes being removed) the format of the site configuration changes slightly
|
|
|
|
between releases. Please refer to our release notes for instructions to update
|
|
|
|
an old site configuration to a newer release of Gluon.
|
2014-10-12 10:17:02 +00:00
|
|
|
|
2015-11-05 21:42:34 +00:00
|
|
|
An example configuration can be found in the Gluon repository at *docs/site-example/*.
|
2014-10-12 10:17:02 +00:00
|
|
|
|
2014-10-13 10:23:41 +00:00
|
|
|
.. _Git tags: http://git-scm.com/book/en/Git-Basics-Tagging
|
|
|
|
.. _list of gluon releases: https://github.com/freifunk-gluon/gluon/releases
|
2014-10-12 10:17:02 +00:00
|
|
|
|
2015-03-25 18:14:18 +00:00
|
|
|
Dependencies
|
|
|
|
------------
|
|
|
|
To build Gluon, several packages need to be installed on the system. On a
|
|
|
|
freshly installed Debian Wheezy system the following packages are required:
|
|
|
|
|
|
|
|
* `git` (to get Gluon and other dependencies)
|
|
|
|
* `subversion`
|
2015-09-10 21:54:27 +00:00
|
|
|
* `python` (Python 3 doesn't work)
|
2015-03-25 18:14:18 +00:00
|
|
|
* `build-essential`
|
|
|
|
* `gawk`
|
|
|
|
* `unzip`
|
|
|
|
* `libncurses-dev` (actually `libncurses5-dev`)
|
|
|
|
* `libz-dev` (actually `zlib1g-dev`)
|
2015-09-10 21:54:27 +00:00
|
|
|
* `libssl-dev`
|
2016-10-19 17:06:02 +00:00
|
|
|
* `wget`
|
2015-03-25 18:14:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
Building the images
|
|
|
|
-------------------
|
2014-10-12 10:17:02 +00:00
|
|
|
|
2014-10-13 10:29:24 +00:00
|
|
|
To build Gluon, first check out the repository. Replace *RELEASE* with the
|
2016-12-18 22:15:12 +00:00
|
|
|
version you'd like to checkout, e.g. *v2016.2.2*.
|
2014-10-08 21:38:58 +00:00
|
|
|
|
|
|
|
::
|
|
|
|
|
2014-10-13 10:29:24 +00:00
|
|
|
git clone https://github.com/freifunk-gluon/gluon.git gluon -b RELEASE
|
2014-10-08 21:38:58 +00:00
|
|
|
|
2014-10-13 10:23:41 +00:00
|
|
|
This command will create a directory named *gluon/*.
|
|
|
|
It might also tell a scary message about being in a *detached state*.
|
|
|
|
**Don't panic!** Everything's fine.
|
2015-11-05 21:42:34 +00:00
|
|
|
Now, enter the freshly created directory::
|
2014-10-08 21:38:58 +00:00
|
|
|
|
2014-10-13 10:23:41 +00:00
|
|
|
cd gluon
|
|
|
|
|
2015-11-05 21:42:34 +00:00
|
|
|
It's time to add (or create) your site configuration. If you already
|
|
|
|
have a site repository, just clone it::
|
2014-10-13 10:23:41 +00:00
|
|
|
|
2016-12-06 19:02:51 +00:00
|
|
|
git clone https://github.com/freifunk-alpha-centauri/site-ffac.git site
|
2015-11-05 21:42:34 +00:00
|
|
|
|
|
|
|
If you want to build a new site, create a new git repository *site/*::
|
2014-10-13 10:23:41 +00:00
|
|
|
|
|
|
|
mkdir site
|
|
|
|
cd site
|
2015-11-05 21:42:34 +00:00
|
|
|
git init
|
2014-10-13 10:23:41 +00:00
|
|
|
|
2015-11-05 21:42:34 +00:00
|
|
|
Copy *site.conf*, *site.mk* and *i18n* from *docs/site-example*::
|
2014-10-13 10:23:41 +00:00
|
|
|
|
|
|
|
cp ../docs/site-example/site.conf .
|
|
|
|
cp ../docs/site-example/site.mk .
|
2015-03-19 22:09:40 +00:00
|
|
|
cp -r ../docs/site-example/i18n .
|
2014-10-13 10:23:41 +00:00
|
|
|
|
2015-11-05 21:42:34 +00:00
|
|
|
Edit these files as you see fit and commit them into the site repository.
|
|
|
|
Extensive documentation about the site configuration can be found at:
|
|
|
|
:doc:`site`. The
|
|
|
|
site directory should always be a git repository by itself; committing site-specific files
|
|
|
|
to the Gluon main repository should be avoided, as it will make updates more complicated.
|
2014-07-09 10:43:10 +00:00
|
|
|
|
2015-11-05 21:42:34 +00:00
|
|
|
Next go back to the top-level Gluon directory and build Gluon::
|
2014-07-09 10:43:10 +00:00
|
|
|
|
2014-10-13 10:23:41 +00:00
|
|
|
cd ..
|
2015-03-14 18:20:11 +00:00
|
|
|
make update # Get other repositories used by Gluon
|
|
|
|
make GLUON_TARGET=ar71xx-generic # Build Gluon
|
2014-07-09 10:43:10 +00:00
|
|
|
|
2015-03-14 18:20:11 +00:00
|
|
|
When calling make, the OpenWrt build environment is prepared/updated.
|
2014-10-08 21:38:58 +00:00
|
|
|
In case of errors read the messages carefully and try to fix the stated issues (e.g. install tools not available yet).
|
2014-07-09 10:43:10 +00:00
|
|
|
|
2015-11-05 21:42:34 +00:00
|
|
|
``ar71xx-generic`` is the most common target and will generate images for most of the supported hardware.
|
2015-03-14 18:20:11 +00:00
|
|
|
To see a complete list of supported targets, call ``make`` without setting ``GLUON_TARGET``.
|
2014-07-09 10:43:10 +00:00
|
|
|
|
2016-02-05 18:02:49 +00:00
|
|
|
You should reserve about 10GB of disk space for each `GLUON_TARGET`.
|
|
|
|
|
|
|
|
The built images can be found in the directory `output/images`. Of these, the `factory`
|
2014-07-09 10:43:10 +00:00
|
|
|
images are to be used when flashing from the original firmware a device came with,
|
2016-02-05 18:02:49 +00:00
|
|
|
and `sysupgrade` is to upgrade from other versions of Gluon or any other OpenWrt-based
|
2014-07-09 10:43:10 +00:00
|
|
|
system.
|
|
|
|
|
2016-02-05 18:02:49 +00:00
|
|
|
**Note:** The images for some models are identical; to save disk space, symlinks are generated instead
|
|
|
|
of multiple copies of the same image. If your webserver's configuration prohibits following
|
|
|
|
symlinks, you can use the following command to resolve these links while copying the images::
|
|
|
|
|
|
|
|
cp -rL output/images /var/www
|
|
|
|
|
|
|
|
Cleaning the build tree
|
|
|
|
.......................
|
2014-07-09 10:43:10 +00:00
|
|
|
|
2015-11-05 21:42:34 +00:00
|
|
|
There are two levels of `make clean`::
|
2014-02-20 16:22:06 +00:00
|
|
|
|
2015-03-14 18:20:11 +00:00
|
|
|
make clean GLUON_TARGET=ar71xx-generic
|
2014-07-09 10:43:10 +00:00
|
|
|
|
2015-03-14 18:20:11 +00:00
|
|
|
will ensure all packages are rebuilt for a single target; this is what you normally want to do after an update.
|
2014-07-09 10:43:10 +00:00
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
make dirclean
|
|
|
|
|
|
|
|
will clean the entire tree, so the toolchain will be rebuilt as well, which is
|
|
|
|
not necessary in most cases, and will take a while.
|
|
|
|
|
2016-09-11 16:05:28 +00:00
|
|
|
So in summary, to update and rebuild a Gluon build tree, the following commands should be used (repeat the
|
|
|
|
``make clean`` and ``make`` for all targets you want to build):
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
git pull
|
|
|
|
(cd site && git pull)
|
|
|
|
make update
|
|
|
|
make clean GLUON_TARGET=ar71xx-generic
|
|
|
|
make GLUON_TARGET=ar71xx-generic
|
|
|
|
|
2014-08-30 17:55:17 +00:00
|
|
|
|
2015-10-14 18:12:52 +00:00
|
|
|
opkg repositories
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
Gluon is mostly compatible with OpenWrt, so the normal OpenWrt package repositories
|
|
|
|
can be used for Gluon as well. It is advisable to setup a mirror or reverse proxy
|
|
|
|
reachable over IPv6 and add it to ``site.conf`` as http://downloads.openwrt.org/ does
|
|
|
|
not support IPv6.
|
|
|
|
|
|
|
|
This is not true for kernel modules; the Gluon kernel is incompatible with the
|
|
|
|
kernel of the default OpenWrt images. Therefore, Gluon will not only generate images,
|
2016-05-22 17:06:01 +00:00
|
|
|
but also an opkg repository containing all kernel modules provided by OpenWrt/Gluon
|
2015-10-14 18:12:52 +00:00
|
|
|
for the kernel of the generated images.
|
|
|
|
|
|
|
|
Signing keys
|
|
|
|
............
|
|
|
|
|
|
|
|
Gluon does not support HTTPS for downloading packages; fortunately, opkg deploys
|
|
|
|
public-key cryptography to ensure package integrity.
|
|
|
|
|
|
|
|
The Gluon images will contain two public keys: the official OpenWrt signing key
|
|
|
|
(to allow installing userspace packages) and a Gluon-specific key (which is used
|
|
|
|
to sign the generated module repository).
|
|
|
|
|
|
|
|
By default, Gluon will handle the generation and handling of the keys itself.
|
2015-10-30 15:44:14 +00:00
|
|
|
When making firmware releases based on Gluon, it might make sense to store
|
2015-10-14 18:12:52 +00:00
|
|
|
the keypair, so updating the module repository later is possible.
|
|
|
|
|
|
|
|
The location the keys are stored at and read from can be changed
|
2016-09-11 16:05:28 +00:00
|
|
|
(see :ref:`getting-started-make-variables`). To only generate the keypair
|
2015-10-14 18:12:52 +00:00
|
|
|
at the configured location without doing a full build, use ``make create-key``.
|
|
|
|
|
2016-09-11 16:05:28 +00:00
|
|
|
.. _getting-started-make-variables:
|
2015-10-14 18:12:52 +00:00
|
|
|
|
2016-09-11 16:05:28 +00:00
|
|
|
Make variables
|
|
|
|
--------------
|
2014-08-30 17:55:17 +00:00
|
|
|
|
2016-09-11 16:05:28 +00:00
|
|
|
Gluon's build process can be controlled by various variables. They can
|
2016-09-09 00:06:31 +00:00
|
|
|
usually be set on the command line or in ``site.mk``.
|
2014-08-30 17:55:17 +00:00
|
|
|
|
2016-09-11 16:05:28 +00:00
|
|
|
Common variables
|
|
|
|
................
|
2014-08-30 17:55:17 +00:00
|
|
|
|
2016-09-11 16:05:28 +00:00
|
|
|
GLUON_ATH10K_MESH
|
|
|
|
While Gluon does support some hardware with ath10k-based 5GHz WLAN, these WLAN adapters don't work
|
|
|
|
well for meshing at the moment, so building images for these models is disabled by default. In addition,
|
|
|
|
ath10k can't support IBSS and 11s meshing in the same image due to WLAN firmware restrictions.
|
2015-10-14 18:12:52 +00:00
|
|
|
|
2016-09-11 16:05:28 +00:00
|
|
|
Setting GLUON_ATH10K_MESH to ``11s`` or ``ibss`` will enable generation of images for ath10k devices
|
|
|
|
and install the firmware for the corresponding WLAN mode.
|
2015-10-14 18:12:52 +00:00
|
|
|
|
2016-09-11 16:05:28 +00:00
|
|
|
GLUON_BRANCH
|
|
|
|
Sets the default branch of the autoupdater. If unset, the autoupdater is disabled
|
|
|
|
by default. For the ``make manifest`` command, GLUON_BRANCH defines the branch to
|
|
|
|
generate a manifest for.
|
2014-08-30 17:55:17 +00:00
|
|
|
|
2016-09-11 16:05:28 +00:00
|
|
|
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``.
|
|
|
|
|
|
|
|
GLUON_PRIORITY
|
|
|
|
Defines the priority of an automatic update in ``make manifest``. See :doc:`../features/autoupdater` for
|
|
|
|
a detailed description of this value.
|
|
|
|
|
|
|
|
GLUON_REGION
|
|
|
|
Some devices (at the moment the TP-Link Archer C7) contain a region code that restricts
|
|
|
|
firmware installations. Set GLUON_REGION to ``eu`` or ``us`` to make the resulting
|
|
|
|
images installable from the respective stock firmwares.
|
|
|
|
|
|
|
|
GLUON_RELEASE
|
|
|
|
Firmware release number: This string is displayed in the config mode, announced
|
|
|
|
via respondd/alfred and used by the autoupdater to decide if a newer version
|
|
|
|
is available.
|
|
|
|
|
|
|
|
GLUON_TARGET
|
|
|
|
Target architecture to build.
|
|
|
|
|
|
|
|
Special variables
|
|
|
|
.................
|
|
|
|
|
|
|
|
GLUON_BUILDDIR
|
|
|
|
Working directory during build. Defaults to ``build``.
|
2015-10-12 23:18:03 +00:00
|
|
|
|
|
|
|
GLUON_IMAGEDIR
|
2015-10-14 18:12:52 +00:00
|
|
|
Path where images will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/images``.
|
2015-10-12 23:18:03 +00:00
|
|
|
|
2015-10-13 19:36:19 +00:00
|
|
|
GLUON_MODULEDIR
|
|
|
|
Path where the kernel module opkg repository will be stored. Defaults to ``$(GLUON_OUTPUTDIR)/modules``.
|
|
|
|
|
2016-09-11 16:05:28 +00:00
|
|
|
GLUON_OPKG_KEY
|
|
|
|
Path key file used to sign the module opkg repository. Defaults to ``$(GLUON_BULDDIR)/gluon-opkg-key``.
|
2014-08-30 17:55:17 +00:00
|
|
|
|
2016-09-11 16:05:28 +00:00
|
|
|
The private key will be stored as ``$(GLUON_OPKG_KEY)``, the public key as ``$(GLUON_OPKG_KEY).pub``.
|
2014-07-09 10:43:10 +00:00
|
|
|
|
2016-09-11 16:05:28 +00:00
|
|
|
GLUON_OUTPUTDIR
|
|
|
|
Path where output files will be stored. Defaults to ``output``.
|
2014-07-09 10:43:10 +00:00
|
|
|
|
2016-09-11 16:05:28 +00:00
|
|
|
GLUON_SITEDIR
|
|
|
|
Path to the site configuration. Defaults to ``site``.
|