Skip to content

Commit

Permalink
Merge 52ddc6f into 0d75b9d
Browse files Browse the repository at this point in the history
  • Loading branch information
edoput committed Aug 23, 2017
2 parents 0d75b9d + 52ddc6f commit f1b4848
Show file tree
Hide file tree
Showing 47 changed files with 6,126 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Expand Up @@ -2,6 +2,11 @@ language: python
sudo: false
cache: pip

addons:
apt:
packages:
- graphviz

python:
- "3.5"
- "3.4"
Expand Down
7 changes: 4 additions & 3 deletions bin/netjsonconfig
Expand Up @@ -56,10 +56,10 @@ output = parser.add_argument_group('output')

output.add_argument('--backend', '-b',
required=True,
choices=['openwrt', 'openwisp', 'openvpn'],
choices=['openwrt', 'openwisp', 'openvpn', 'airos'],
action='store',
type=str,
help='Configuration backend')
help='Configuration backend: openwrt, openwisp or airos')

output.add_argument('--method', '-m',
required=True,
Expand Down Expand Up @@ -169,7 +169,8 @@ method_arguments = parse_method_arguments(args.args)
backends = {
'openwrt': netjsonconfig.OpenWrt,
'openwisp': netjsonconfig.OpenWisp,
'openvpn': netjsonconfig.OpenVpn
'openvpn': netjsonconfig.OpenVpn,
'airos': netjsonconfig.AirOs,
}

backend_class = backends[args.backend]
Expand Down
47 changes: 47 additions & 0 deletions docs/source/backends/airos-upgrade.rst
@@ -0,0 +1,47 @@
.. _airos-configuration-upgrade:

Tools
-----

AirOS is shipped with proprietary tools that can parse the configuration file and upgrade the antenna.

cfgmtd
^^^^^^

This tool can write and read data to the memory that persist between reboots.

ubntcfg
^^^^^^^

This tool can parse the configuration and creates the init scripts that configure the device

rc scripts
^^^^^^^^^^

This are not commands but a collection of scripts that orchestrate the configuration process. As they are stored on the antenna they can be modified to obtain different behaviours.

* update scripts are stored in `/usr/local/rc.d`
* module list is stored in `/etc/startup.list`

The update process is orchestrated by the `/usr/local/rc.d/rc.do.softrestart` script.

Process
-------

AirOS mantains the device configuration in two files, both can be found in `/tmp`.

* `/tmp/system.cfg` the target configuration
* `/tmp/running.cfg` the running configuration

If we want to upgrade the device configuration with our file we can overwrite the target configuration and runt the commands `cfgmtd -w` and `/usr/local/rc.d/rc.do.softrestart save`


Full transcript of the update processs

.. code-block:: bash
cp /path/to/my/config.cfg /tmp/system.cfg
# writes the configuration to the persistent memory
cfgmtd -w /tmp/system.cfg
# initiate the configuration update
/usr/local/rc.d/rc.do.softrestart save

0 comments on commit f1b4848

Please sign in to comment.