merge readme

This commit is contained in:
RubenKelevra 2015-05-28 22:15:01 +02:00
commit 4a189f6727
140 changed files with 1981 additions and 36981 deletions

View File

@ -179,11 +179,8 @@ include $(INCLUDE_DIR)/target.mk
prereq: FORCE prereq: FORCE
+$(NO_TRACE_MAKE) prereq +$(NO_TRACE_MAKE) prereq
gluon-tools: FORCE
+$(GLUONMAKE_EARLY) tools/sed/install
+$(GLUONMAKE_EARLY) package/lua/host/install
prepare-tmpinfo: FORCE prepare-tmpinfo: FORCE
@+$(MAKE) -r -s staging_dir/host/.prereq-build OPENWRT_BUILD= QUIET=0
mkdir -p tmp/info mkdir -p tmp/info
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS="$(TOPDIR)/include/package*.mk $(TOPDIR)/overlay/*/*.mk" SCAN_EXTRA="" $(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPS="$(TOPDIR)/include/package*.mk $(TOPDIR)/overlay/*/*.mk" SCAN_EXTRA=""
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPS="profiles/*.mk $(TOPDIR)/include/kernel*.mk $(TOPDIR)/include/target.mk" SCAN_DEPTH=2 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1" $(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPS="profiles/*.mk $(TOPDIR)/include/kernel*.mk $(TOPDIR)/include/target.mk" SCAN_DEPTH=2 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
@ -204,15 +201,19 @@ feeds: FORCE
. $(GLUONDIR)/modules && for feed in $$GLUON_FEEDS; do ln -s ../../../packages/$$feed $(TOPDIR)/package/feeds/module_$$feed; done . $(GLUONDIR)/modules && for feed in $$GLUON_FEEDS; do ln -s ../../../packages/$$feed $(TOPDIR)/package/feeds/module_$$feed; done
+$(GLUONMAKE_EARLY) prepare-tmpinfo +$(GLUONMAKE_EARLY) prepare-tmpinfo
gluon-tools: FORCE
+$(GLUONMAKE_EARLY) tools/sed/install
+$(GLUONMAKE_EARLY) package/lua/host/install
config: FORCE config: FORCE
+$(NO_TRACE_MAKE) scripts/config/conf OPENWRT_BUILD=0 +$(NO_TRACE_MAKE) scripts/config/conf OPENWRT_BUILD= QUIET=0
+$(GLUONMAKE) prepare-tmpinfo +$(GLUONMAKE) prepare-tmpinfo
( \ ( \
cat $(GLUONDIR)/include/config $(GLUONDIR)/targets/$(GLUON_TARGET)/config; \ cat $(GLUONDIR)/include/config $(GLUONDIR)/targets/$(GLUON_TARGET)/config; \
echo 'CONFIG_BUILD_SUFFIX="gluon-$(GLUON_TARGET)"'; \ echo 'CONFIG_BUILD_SUFFIX="gluon-$(GLUON_TARGET)"'; \
echo '$(patsubst %,CONFIG_PACKAGE_%=m,$(sort $(filter-out -%,$(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES) $(PROFILE_PACKAGES))))' \ echo '$(patsubst %,CONFIG_PACKAGE_%=m,$(sort $(filter-out -%,$(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES) $(PROFILE_PACKAGES))))' \
| sed -e 's/ /\n/g'; \ | sed -e 's/ /\n/g'; \
echo '$(patsubst %,CONFIG_GLUON_LANG_%=y,$(GLUON_LANGS))' \ echo '$(patsubst %,CONFIG_LUCI_LANG_%=y,$(GLUON_LANGS))' \
| sed -e 's/ /\n/g'; \ | sed -e 's/ /\n/g'; \
) > $(BOARD_BUILDDIR)/config.tmp ) > $(BOARD_BUILDDIR)/config.tmp
scripts/config/conf --defconfig=$(BOARD_BUILDDIR)/config.tmp Config.in scripts/config/conf --defconfig=$(BOARD_BUILDDIR)/config.tmp Config.in
@ -281,8 +282,11 @@ packages: $(package/stamp-compile)
prepare-image: FORCE prepare-image: FORCE
rm -rf $(BOARD_KDIR) rm -rf $(BOARD_KDIR)
mkdir -p $(BOARD_KDIR) mkdir -p $(BOARD_KDIR)
cp $(KERNEL_BUILD_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux.elf $(BOARD_KDIR)/ $(foreach k, vmlinux vmlinux.elf \
+$(SUBMAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image -f $(GLUONDIR)/include/Makefile.image prepare KDIR="$(BOARD_KDIR)" $(if $(KERNEL_IMAGES),$(KERNEL_IMAGES),$(filter-out dtbs,$(KERNELNAME))), \
$(CP) $(KERNEL_BUILD_DIR)/$(k) $(BOARD_KDIR)/$(k); \
)
+$(SUBMAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image image_prepare KDIR="$(BOARD_KDIR)"
prepare: FORCE prepare: FORCE
@$(STAGING_DIR_HOST)/bin/lua $(GLUONDIR)/package/gluon-core/files/usr/lib/lua/gluon/site_config.lua \ @$(STAGING_DIR_HOST)/bin/lua $(GLUONDIR)/package/gluon-core/files/usr/lib/lua/gluon/site_config.lua \
@ -346,7 +350,7 @@ $(eval $(call merge-lists,INSTALL_PACKAGES,DEFAULT_PACKAGES GLUON_DEFAULT_PACKAG
package_install: FORCE package_install: FORCE
$(OPKG) update $(OPKG) update
$(OPKG) install $(PACKAGE_DIR)/libc_*.ipk $(OPKG) install $(PACKAGE_DIR)/base-files_*.ipk $(PACKAGE_DIR)/libc_*.ipk
$(OPKG) install $(PACKAGE_DIR)/kernel_*.ipk $(OPKG) install $(PACKAGE_DIR)/kernel_*.ipk
$(OPKG) install $(INSTALL_PACKAGES) $(OPKG) install $(INSTALL_PACKAGES)
@ -354,6 +358,10 @@ package_install: FORCE
rm -f $(TARGET_DIR)/usr/lib/opkg/lists/* $(TARGET_DIR)/tmp/opkg.lock rm -f $(TARGET_DIR)/usr/lib/opkg/lists/* $(TARGET_DIR)/tmp/opkg.lock
# Remove opkg database when opkg is not intalled
if [ ! -x $(TARGET_DIR)/bin/opkg ]; then rm -rf $(TARGET_DIR)/usr/lib/opkg; fi
ifeq ($(GLUON_OPKG_CONFIG),1) ifeq ($(GLUON_OPKG_CONFIG),1)
include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/version.mk
endif endif

View File

@ -26,7 +26,7 @@ fi
pushd "$(dirname "$0")/.." >/dev/null pushd "$(dirname "$0")/.." >/dev/null
find package packages -name Makefile | while read makefile; do find ./package packages -name Makefile | while read makefile; do
dir="$(dirname "$makefile")" dir="$(dirname "$makefile")"
pushd "$dir" >/dev/null pushd "$dir" >/dev/null
@ -36,7 +36,7 @@ find package packages -name Makefile | while read makefile; do
package="$(basename "$dir")" package="$(basename "$dir")"
for file in "${SUFFIX}"/*; do for file in "${SUFFIX}"/*; do
echo "${GREEN}$(basename "${file}")${RESET}" "(${BLUE}${repo}${RESET}/${dirname}/${RED}${package}${RESET}/${SUFFIX})" echo "${GREEN}$(basename "${file}")${RESET}" "(${BLUE}${repo}${RESET}/${dirname}${dirname:+/}${RED}${package}${RESET}/${SUFFIX})"
done done
popd >/dev/null popd >/dev/null
done | sort done | sort

View File

@ -54,9 +54,9 @@ copyright = '2015, Project Gluon'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '2014.4+' version = '2015.1+'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '2014.4+' release = '2015.1+'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

View File

@ -80,9 +80,9 @@ instead).
Adding support for new languages Adding support for new languages
-------------------------------- --------------------------------
A list of all languages supported by LuCI can be found in the ``include/package.mk`` file of A list of all languages supported by LuCI can be found in the ``packages/luci/luci.mk`` file after
the Gluon repository. Adding translations for these languages is straightforward using the ``msginit`` Gluon's dependencies have been downloaded using ``make update``. Adding translations for these
command. languages is straightforward using the ``msginit`` command.
For other languages, support must be added tu LuCI first, which constitutes completely translating For other languages, support must be added tu LuCI first, which constitutes completely translating
the ``base.pot``. Please contact the upstream LuCI maintainers if you'd like to do this. the ``base.pot``. Please contact the upstream LuCI maintainers if you'd like to do this.

View File

@ -54,7 +54,7 @@ We suggest to have following directory tree accessible via http:
sysupgrade/ sysupgrade/
factory/ factory/
The server should be available via IPv6. The server must be available via IPv6.
Command Line Command Line
------------ ------------

View File

@ -13,6 +13,7 @@ User Documentation
user/getting_started user/getting_started
user/site user/site
user/x86
user/faq user/faq
Features Features
@ -42,58 +43,6 @@ Developer Documentation
dev/wan dev/wan
dev/i18n dev/i18n
Supported Devices
-----------------
* Buffalo
- WZR-HP-AG300H / WZR-600DHP
- WZR-HP-G450H
* D-Link
- DIR-825 (B1)
* Linksys
- WRT160NL
* TP-Link
- CPE210 (v1)
- CPE220 (v1)
- CPE510 (v1)
- CPE520 (v1)
- TL-MR3020 (v1)
- TL-MR3040 (v1, v2)
- TL-MR3220 (v1)
- TL-MR3420 (v1, v2)
- TL-WA750RE (v1)
- TL-WA801N/ND (v2)
- TL-WA850RE (v1)
- TL-WA901N/ND (v2)
- TL-WDR3500 (v1)
- TL-WDR3600 (v1)
- TL-WDR4300 (v1)
- TL-WR1043N/ND (v1, v2)
- TL-WR703N (v1)
- TL-WR710N (v1)
- TL-WR740N (v1, v3, v4)
- TL-WR741N/ND (v1, v2, v4)
- TL-WR841N/ND (v3, v5, v7, v8, v9)
- TL-WR842N/ND (v1, v2)
- TL-WR941N/ND (v2, v3, v4)
* Ubiquiti
- Bullet M2
- Nanostation M2
- Picostation M2
- Rocket M2
- UniFi AP
- UniFi AP Outdoor
Releases Releases
-------- --------
@ -106,6 +55,112 @@ Releases
releases/v2014.3 releases/v2014.3
Supported Devices & Architectures
---------------------------------
ar71xx-generic
^^^^^^^^^^^^^^
* Allnet
- ALL0315N
* Buffalo
- WZR-HP-AG300H / WZR-600DHP
- WZR-HP-G450H
* D-Link
- DIR-825 (B1)
- DIR-615 (C1)
* GL-Inet
- 6408A (v1)
- 6416A (v1)
* Linksys
- WRT160NL
* Netgear
- WNDR3700 (v1, v2)
- WNDR3800
- WNDRMAC (v2)
* TP-Link
- CPE210 (v1)
- CPE220 (v1)
- CPE510 (v1)
- CPE520 (v1)
- TL-MR3020 (v1)
- TL-MR3040 (v1, v2)
- TL-MR3220 (v1, v2)
- TL-MR3420 (v1, v2)
- TL-WA701N/ND (v1)
- TL-WA750RE (v1)
- TL-WA801N/ND (v2)
- TL-WA850RE (v1)
- TL-WA860RE (v1)
- TL-WA901N/ND (v2, v3)
- TL-WDR3500 (v1)
- TL-WDR3600 (v1)
- TL-WDR4300 (v1)
- TL-WR1043N/ND (v1, v2)
- TL-WR703N (v1)
- TL-WR710N (v1)
- TL-WR740N (v1, v3, v4)
- TL-WR741N/ND (v1, v2, v4)
- TL-WR743N/ND (v1, v2)
- TL-WR841N/ND (v3, v5, v7, v8, v9)
- TL-WR842N/ND (v1, v2)
- TL-WR941N/ND (v2, v3, v4, v5)
- TL-WR2543N/ND (v1)
* Ubiquiti
- Bullet M2
- Nanostation M2
- Nanostation M XW
- Loco M XW
- Picostation M2
- Rocket M2
- UniFi AP
- UniFi AP Pro
- UniFi AP Outdoor
ar71xx-nand
^^^^^^^^^^^
* Netgear
- WNDR3700 (v4)
- WNDR4300 (v1)
mpc85xx-generic
^^^^^^^^^^^^^^^
* TP-Link
- TL-WDR4900 (v1)
x86-generic
^^^^^^^^^^^
* x86-generic
* x86-virtualbox
* x86-vmware
See also: :doc:`user/x86`
x86-kvm_guest
^^^^^^^^^^^^^
* x86-kvm
See also: :doc:`user/x86`
License License
------- -------
@ -118,4 +173,3 @@ Indices and tables
* :ref:`genindex` * :ref:`genindex`
* :ref:`search` * :ref:`search`

View File

@ -1,16 +1,159 @@
Gluon 2015.1 (in development) Gluon 2015.1
============================= ============
Added (and removed) hardware support Added hardware support
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
Gluon v2015.1 is the first release to officially support hardware
that is not handled by the `ar71xx-generic` OpenWrt target. This also
means that `ar71xx-generic` isn't the default target anymore, the ``GLUON_TARGET``
variable must be set for all runs of ``make`` and ``make clean`` now.
ar71xx-generic
^^^^^^^^^^^^^^
* Allnet
- ALL0315N
* D-Link
- DIR-615 (C1)
* GL-Inet
- 6408A (v1)
- 6416A (v1)
- WRT160NL
* Netgear
- WNDR3700 (v1, v2)
- WNDR3800
- WNDRMAC (v2)
* TP-Link
- TL-MR3220 (v2)
- TL-WA701N/ND (v1)
- TL-WA860RE (v1)
- TL-WA901N/ND (v2, v3)
- TL-WR743N/ND (v1, v2)
- TL-WR941N/ND (v5)
- TL-WR2543N/ND (v1)
* Ubiquiti
- Nanostation M XW
- Loco M XW
- UniFi AP Pro
ar71xx-nand
^^^^^^^^^^^
* Netgear
- WNDR3700 (v4)
- WNDR4300 (v1)
mpc85xx-generic
^^^^^^^^^^^^^^^
* TP-Link
- TL-WDR4900 (v1)
x86-generic
^^^^^^^^^^^
* x86-generic
* x86-virtualbox
* x86-vmware
x86-kvm_guest
^^^^^^^^^^^^^
* x86-kvm
New features New features
~~~~~~~~~~~~ ~~~~~~~~~~~~
Multilingual config mode
^^^^^^^^^^^^^^^^^^^^^^^^
All config and expert mode modules contain both English and German texts now. The English
locale should always be enabled in ``site.mk`` (as English is the fallback language),
German can be enabled in addition using the ``GLUON_LANGS`` setting.
The language shown is autmatically determined from the headers sent by the user's
browser.
Mesh-on-LAN
^^^^^^^^^^^
Gluon now supports meshing using a node's LAN ports. It can be enabled by
default in `site.conf`, and configured by the user using the `gluon-luci-portconfig`
expert mode package.
Please note that nodes without the `mesh-on-lan` feature enabled must never be connected
via their LAN ports.
Extended WLAN configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^
The new ``client_disabled`` and ``mesh_disabled`` keys in the ``wifi24`` and ``wifi5`` sections allow
to disable the client and mesh networks by default, which may make sense for images for
special installations.
The new package `gluon-luci-wifi-config` allows the user to change these settings; in addition,
the WLAN adapters' transmission power can be changed in this package.
fastd "performance mode"
^^^^^^^^^^^^^^^^^^^^^^^^
The new package `gluon-luci-mesh-vpn-fastd` allows the user to switch between the `security` and
`performance` VPN settions. In `performance mode`, the method `null` will be prepended to the
method list.
The new option ``configurable`` in the ``fastd_mesh_vpn`` section of ``site.conf`` must be set to `true`
so firmware upgrades don't overwrite the method list completely (non-`null` methods will still
be overwritten). Adding the `gluon-luci-mesh-vpn-fastd` package enforces this setting.
Altitude setting in `gluon-config-mode-geo-location`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The `gluon-config-mode-geo-location` config mode module
now contains an optional altitude field.
`gluon-announced` rework
^^^^^^^^^^^^^^^^^^^^^^^^
The `gluon-announced` package has been reworked to allow querying it from anywhere in the mesh.
In contrast to `gluon-alfred`, it is based on a query-response model (the master multicasts a query,
the nodes respond), while `gluon-alfred` uses periodic announcements.
For now, we recommend including both `gluon-alfred` and `gluon-announced` in Gluon-based firmwares,
until `gluon-announced` is ready to replace `gluon-alfred` completely, and software like the
ffmap backend has been adjusted accordingly.
Nested peer groups
^^^^^^^^^^^^^^^^^^
Nested peer groups for the `fastd-mesh-vpn-fastd` package can now be configured in ``site.conf``,
each with its own peer limit. This allows to add additional constaints, for example to connect
to 2 peers altogether, but only 1 peer in each data center.
Autoupdater manual branch override
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When running the updater manually on the command line, the branch to use can now be
overridden using the ``-b`` option.
Bugfixes Bugfixes
~~~~~~~~ ~~~~~~~~
Accidental factory reset fix
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Pressing a node's reset button for more than 5 seconds would completely reset a node's
configuration under certain conditions.
WAN IPv6 issues
^^^^^^^^^^^^^^^
The WAN port would stop to respond to IPv6 packets sometimes, also breaking IPv6 VPN connectivity.
WDR4900 WAN MAC address
^^^^^^^^^^^^^^^^^^^^^^^
The MAC address on the WAN port of the WDR4900 was broken, making this device unusable for `mesh-on-wan`
configurations.
Site changes Site changes
@ -22,9 +165,88 @@ Site changes
to keep the old behaviour, you have to append the hyphen to the to keep the old behaviour, you have to append the hyphen to the
``hostname_prefix`` field of your ``site.conf``. ``hostname_prefix`` field of your ``site.conf``.
- ``mesh_vpn_fastd``: The default peer group name ``backbone`` isn't hardcoded anymore, any
group name can be used. Instead, the ``fastd_mesh_vpn`` table must now contain an element ``groups``,
for example::
fastd_mesh_vpn = {
methods = {'salsa2012+umac'},
mtu = 1426,
groups = {
backbone = {
limit = 2,
peers = {
-- ...
}
}
}
}
- ``config_mode``: The config mode messages aren't configured in ``site.conf`` anymore. Instead, they are
defined language-specific gettext files in the ``i18n`` subdirectory of the site configuration (see
:ref:`site-config-mode-texts`).
- ``roles``: The display strings for the node roles aren't configured in the ``site.conf`` anymore, but
in the site i18n files. The ``site.conf`` section becomes::
roles = {
default = 'foo',
list = {
'foo',
'bar',
}
}
The display string use i18n message IDs like ``gluon-luci-node-role:role:foo`` and ``gluon-luci-node-role:role:bar``.
* ``site.mk``
- ``gluon-mesh-batman-adv-15`` is now the recommended batman-adv version for new Gluon deployments.
- The packages ``gluon-setup-mode`` and ``gluon-config-mode-core`` must now be
added to ``GLUON_SITE_PACKAGES`` explicitly (to allow replacing them with
community-specific implementations).
- The new ``GLUON_LANGS`` variable selects the config mode languages to include. It defaults to ``en``,
setting it to ``en de`` will select both the English and German locales. ``en`` must always be
included.
Internals Internals
~~~~~~~~~ ~~~~~~~~~
New upgrade script directory
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The distinction between `initial` and `invariant` scripts has been removed,
all scripts are now run on each upgrade. Instead of having one script directory
per package, all upgrade scripts lie in ``/lib/gluon/upgrade`` now, so it is
possible to define the run order across packages.
Merged package repository
^^^^^^^^^^^^^^^^^^^^^^^^^
The Gluon-specific packages have been moved to the ``package`` directory of the Gluon
main repository. The ``packages`` repository now only contains packages that will be
submitted to the OpenWrt upstream eventually.
Known Issues Known Issues
~~~~~~~~~~~~ ~~~~~~~~~~~~
Alfred/respondd crashes
^^^^^^^^^^^^^^^^^^^^^^^
https://github.com/freifunk-gluon/gluon/issues/177
Occasional alfred crashes may still occur. As this is caused by a kernel issue,
we suspect that respondd, which gluon-announced is based on, is affected
in the same way.
Ignored TX power offset on Ubiquiti AirMax devices
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
https://github.com/freifunk-gluon/gluon/issues/94
The default transmission power setting on many of these devices
is too high. It may be necessary to make manual adjustments, for example
using the ``gluon-luci-wifi-config`` package. The values shown by
``gluon-luci-wifi-config`` generally include the TX power offset
(amplifier and antenna gain) where available, but on many devices
the offset is inaccurate or unavailable.

View File

@ -32,4 +32,7 @@ msgstr ""
"verbinden. Weitere Informationen zur " "verbinden. Weitere Informationen zur "
"Entenhausener Freifunk-Community findest du auf " "Entenhausener Freifunk-Community findest du auf "
"<a href=\"https://entenhausen.freifunk.net/\">unserer Webseite</a>.</p>" "<a href=\"https://entenhausen.freifunk.net/\">unserer Webseite</a>.</p>"
"<p>Um zu dieser Konfigurationsseite zurückzugelangen, drücke im normalen "
"Betrieb für drei Sekunden den Reset-Button. Das Gerät wird dann im Config "
"Mode neustarten.</p>"
"<p>Viel Spaß mit deinem Knoten und der Erkundung von Freifunk!</p>" "<p>Viel Spaß mit deinem Knoten und der Erkundung von Freifunk!</p>"

View File

@ -30,4 +30,7 @@ msgstr ""
"nearby Freifunk nodes after that. " "nearby Freifunk nodes after that. "
"Your can find lots of information on the Freifunk Duckburg community on " "Your can find lots of information on the Freifunk Duckburg community on "
"<a href=\"https://entenhausen.freifunk.net/\">our homepage</a>.</p>" "<a href=\"https://entenhausen.freifunk.net/\">our homepage</a>.</p>"
"<p>To get back to this configuration interface, press the reset button for "
"3 seconds during normal operation. The device will then reboot into config "
"mode.</p>"
"<p>Have fun with your node and exploring the Freifunk network!</p>" "<p>Have fun with your node and exploring the Freifunk network!</p>"

View File

@ -1,4 +1,4 @@
-- This is an example site configuration for Gluon v2014.4 -- This is an example site configuration for Gluon v2015.1+
-- --
-- Take a look at the documentation located at -- Take a look at the documentation located at
-- http://gluon.readthedocs.org/ for details. -- http://gluon.readthedocs.org/ for details.
@ -89,25 +89,42 @@
fastd_mesh_vpn = { fastd_mesh_vpn = {
-- List of crypto-methods to use. -- List of crypto-methods to use.
methods = {'salsa2012+umac'}, methods = {'salsa2012+umac'},
-- enabled = true,
-- configurable = true,
mtu = 1426, mtu = 1426,
backbone = { groups = {
-- Limit number of connected peers to reduce bandwidth. backbone = {
limit = 2, -- Limit number of connected peers to reduce bandwidth.
limit = 2,
-- List of peers. -- List of peers.
peers = { peers = {
peer1 = { peer1 = {
key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
-- This is a list, so you might add multiple entries. -- This is a list, so you might add multiple entries.
remotes = {'ipv4 "xxx.somehost.invalid" port xxxxxx'}, remotes = {'ipv4 "xxx.somehost.invalid" port xxxxxx'},
}, },
peer2 = { peer2 = {
key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
-- You can also omit the ipv4 to allow both connection via ipv4 and ipv6 -- You can also omit the ipv4 to allow both connection via ipv4 and ipv6
remotes = {'"xxx.somehost2.invalid" port xxxxx'}, remotes = {'"xxx.somehost2.invalid" port xxxxx'},
},
}, },
-- Optional: nested peer groups
-- groups = {
-- backbone_sub = {
-- ...
-- },
-- ...
-- },
}, },
-- Optional: additional peer groups, possibly with other limits
-- backbone2 = {
-- ...
-- },
}, },
}, },
@ -140,13 +157,13 @@
}, },
-- Node roles -- Node roles
-- roles { -- roles = {
-- default = 'node', -- default = 'node',
-- list = { -- list = {
-- node = 'Normal Node', -- 'node',
-- test = 'Test Node', -- 'test',
-- backbone = 'Backbone Node', -- 'backbone',
-- service = 'Service Node', -- 'service',
-- }, -- },
-- }, -- },

View File

@ -5,7 +5,7 @@
# The gluon-mesh-batman-adv-* package must come first because of the dependency resolution # The gluon-mesh-batman-adv-* package must come first because of the dependency resolution
GLUON_SITE_PACKAGES := \ GLUON_SITE_PACKAGES := \
gluon-mesh-batman-adv-14 \ gluon-mesh-batman-adv-15 \
gluon-alfred \ gluon-alfred \
gluon-announced \ gluon-announced \
gluon-autoupdater \ gluon-autoupdater \
@ -20,6 +20,7 @@ GLUON_SITE_PACKAGES := \
gluon-luci-admin \ gluon-luci-admin \
gluon-luci-autoupdater \ gluon-luci-autoupdater \
gluon-luci-portconfig \ gluon-luci-portconfig \
gluon-luci-wifi-config \
gluon-next-node \ gluon-next-node \
gluon-mesh-vpn-fastd \ gluon-mesh-vpn-fastd \
gluon-radvd \ gluon-radvd \

View File

@ -38,7 +38,7 @@ Building the images
------------------- -------------------
To build Gluon, first check out the repository. Replace *RELEASE* with the To build Gluon, first check out the repository. Replace *RELEASE* with the
version you'd like to checkout, e.g. *v2014.4*. version you'd like to checkout, e.g. *v2015.1*.
:: ::

View File

@ -67,21 +67,19 @@ wifi24
``htmode``, the adhoc ssid ``mesh_ssid`` used between devices, the adhoc ``htmode``, the adhoc ssid ``mesh_ssid`` used between devices, the adhoc
bssid ``mesh_bssid`` and the adhoc multicast rate ``mesh_mcast_rate``. bssid ``mesh_bssid`` and the adhoc multicast rate ``mesh_mcast_rate``.
Optionally ``mesh_vlan`` can be used to setup VLAN on top of the 802.11 Optionally ``mesh_vlan`` can be used to setup VLAN on top of the 802.11
ad-hoc interface. The options``mesh_disabled`` and ``client_disabled`` ad-hoc interface. The options ``mesh_disabled`` and ``client_disabled``
are optional, too. They allow to disable the SSID by default, e.g. for are optional, too. They allow to disable the SSID by default, e.g. for
preconfigured node. This only affects first configuraton. preconfigured node. This only affects first configuraton.
Combined in an dictionary, e.g.: Combined in an dictionary, e.g.:
:: ::
wifi24 = { wifi24 = {
ssid = 'http://kiel.freifunk.net/', ssid = 'entenhausen.freifunk.net',
channel = 11, channel = 11,
htmode = 'HT40-', htmode = 'HT40-',
mesh_ssid = 'ff:ff:ff:ee:ba:be', mesh_ssid = 'ff:ff:ff:ee:ba:be',
mesh_bssid = 'ff:ff:ff:ee:ba:be', mesh_bssid = 'ff:ff:ff:ee:ba:be',
mesh_mcast_rate = 12000, mesh_mcast_rate = 12000,
client_disabled = true,
mesh_disabled = false,
}, },
wifi5 wifi5
@ -94,24 +92,40 @@ next_node : package
next_node = { next_node = {
ip4 = '10.23.42.1', ip4 = '10.23.42.1',
ip6 = 'fdca:ffee:babe:1::1', ip6 = 'fdca:ffee:babe:1::1',
mac = 'ca:ff:ee:ba:be' mac = 'ca:ff:ee:ba:be:00'
} }
fastd_mesh_vpn fastd_mesh_vpn
Remote server setup for vpn. Remote server setup for the fastd-based mesh VPN.
The `enabled` option can be set to true to enable the VPN by default.
If `configurable` is `false` or unset, the method list will be replaced on updates
with the list in the site configuration. Setting `configurable` to `true` will allow the user to
add the method ``null`` to the front of the method list or remove ``null`` from it,
and make this change survive updates. Settings configurable is necessary for the
package `gluon-luci-mesh-vpn-fastd`, which adds a UI for this configuration.
In any case, the ``null`` method should always be the first method in the list
if it is supported at all. You should only set `configurable` to `true` if the
configured peers support both the ``null`` method and methods with encryption.
:: ::
fastd_mesh_vpn = { fastd_mesh_vpn = {
methods = {'salsa2012+gmac'}, methods = {'salsa2012+umac'},
-- enabled = true,
-- configurable = true,
mtu = 1426, mtu = 1426,
backbone = { groups = {
limit = 2, backbone = {
peers = { limit = 2,
ffki_rz = { peers = {
key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', peer1 = {
remotes = {'ipv4 "vpn1.entenhausen.freifunk.net" port 10000'}, key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
}, remotes = {'ipv4 "vpn1.entenhausen.freifunk.net" port 10000'},
},
}
} }
} }
} }
@ -119,6 +133,9 @@ fastd_mesh_vpn
mesh_on_wan : optional mesh_on_wan : optional
Enables the mesh on the WAN port (``true`` or ``false``). Enables the mesh on the WAN port (``true`` or ``false``).
mesh_on_lan : optional
Enables the mesh on the LAN port (``true`` or ``false``).
autoupdater : package autoupdater : package
Configuration for the autoupdater feature of Gluon. Configuration for the autoupdater feature of Gluon.
:: ::
@ -150,15 +167,19 @@ roles : optional
``default`` takes the default role which is set initially. This value should be ``default`` takes the default role which is set initially. This value should be
part of ``list``. If you want node owners to change the role via config mode add part of ``list``. If you want node owners to change the role via config mode add
the package ``gluon-luci-node-role`` to ``site.mk``. the package ``gluon-luci-node-role`` to ``site.mk``.
The strings to display in the LuCI interface can be configured per language in the
``i18n/en.po``, ``i18n/de.po``, etc. files of the site repository using message IDs like
``gluon-luci-node-role:role:node`` and ``gluon-luci-node-role:role:backbone``.
:: ::
roles = { roles = {
default = 'node', default = 'node',
list = { list = {
node = 'Normal Node', 'node',
test = 'Test Node', 'test',
backbone = 'Backbone Node', 'backbone',
service = 'Service Node', 'service',
}, },
}, },
@ -220,6 +241,8 @@ GLUON_LANGS
List of languages (as two-letter-codes) to include for the web interface. Should always contain List of languages (as two-letter-codes) to include for the web interface. Should always contain
``en``. ``en``.
.. _site-config-mode-texts:
Config mode texts Config mode texts
----------------- -----------------
@ -284,7 +307,7 @@ This is a non-exhaustive list of site-repos from various communities:
* `site-ffgoe <https://github.com/freifunk-goettingen/site-ffgoe>`_ (Göttingen) * `site-ffgoe <https://github.com/freifunk-goettingen/site-ffgoe>`_ (Göttingen)
* `site-ffhh <https://github.com/freifunkhamburg/site-ffhh>`_ (Hamburg) * `site-ffhh <https://github.com/freifunkhamburg/site-ffhh>`_ (Hamburg)
* `site-ffhgw <https://github.com/lorenzo-greifswald/site-ffhgw>`_ (Greifswald) * `site-ffhgw <https://github.com/lorenzo-greifswald/site-ffhgw>`_ (Greifswald)
* `site-ffhl <https://github.com/freifunk-gluon/site-ffhl>`_ (Lübeck) * `site-ffhl <https://github.com/freifunk-luebeck/site-ffhl>`_ (Lübeck)
* `site-ffmd <https://github.com/FreifunkMD/site-ffmd>`_ (Magdeburg) * `site-ffmd <https://github.com/FreifunkMD/site-ffmd>`_ (Magdeburg)
* `site-ffmwu <https://github.com/freifunk-mwu/site-ffmwu>`_ (Mainz, Wiesbaden & Umgebung) * `site-ffmwu <https://github.com/freifunk-mwu/site-ffmwu>`_ (Mainz, Wiesbaden & Umgebung)
* `site-ffmyk <https://github.com/FreifunkMYK/site-ffmyk>`_ (Mayen-Koblenz) * `site-ffmyk <https://github.com/FreifunkMYK/site-ffmyk>`_ (Mayen-Koblenz)

29
docs/user/x86.rst Normal file
View File

@ -0,0 +1,29 @@
x86 support
===========
Gluon can run on normal x86 systems, for example virtual machines
and VPN boxes. There is no WLAN support on x86 though.
Targets
^^^^^^^
There are two targets for x86 images:
`x86-generic`
Generic x86 support with many different ethernet drivers; should run on
most x86 systems.
There are three images:
* `generic` (compressed "raw" image, can written to a disk directly or booted with qemu)
* `virtualbox` (VDI image)
* `vmware` (VMDK image)
These images only differ in the image file format, the content is the same. Therefore there is
only a single `x86-generic` sysupgrade image instead of three.
Please note that the `x86-generic` image doesn't include VirtIO support, so another virtual NIC
like `pcnet32` must be chosen when using VirtualBox.
`x86-kvm`
The `x86-kvm` image uses VirtIO as its harddisk and network driver.

View File

@ -1,7 +0,0 @@
override define BuildImage
prepare: FORCE
$(call Image/Prepare)
endef
# The Makefile included here is $(TOPDIR)/target/linux/$(BOARD)/image/Makefile
include Makefile

View File

@ -7,8 +7,7 @@ override define Kernel/Configure
echo "# CONFIG_KALLSYMS_EXTRA_PASS is not set" >> $(LINUX_DIR)/.config.target echo "# CONFIG_KALLSYMS_EXTRA_PASS is not set" >> $(LINUX_DIR)/.config.target
echo "# CONFIG_KALLSYMS_ALL is not set" >> $(LINUX_DIR)/.config.target echo "# CONFIG_KALLSYMS_ALL is not set" >> $(LINUX_DIR)/.config.target
echo "# CONFIG_KALLSYMS_UNCOMPRESSED is not set" >> $(LINUX_DIR)/.config.target echo "# CONFIG_KALLSYMS_UNCOMPRESSED is not set" >> $(LINUX_DIR)/.config.target
echo "# CONFIG_KPROBES is not set" >> $(LINUX_DIR)/.config.target $(SCRIPT_DIR)/metadata.pl kconfig $(TMP_DIR)/.packageinfo $(BOARD_BUILDDIR)/config-allmods $(KERNEL_PATCHVER) > $(LINUX_DIR)/.config.override
$(SCRIPT_DIR)/metadata.pl kconfig $(TMP_DIR)/.packageinfo $(BOARD_BUILDDIR)/config-allmods > $(LINUX_DIR)/.config.override
$(SCRIPT_DIR)/kconfig.pl 'm+' '+' $(LINUX_DIR)/.config.target /dev/null $(LINUX_DIR)/.config.override > $(LINUX_DIR)/.config $(SCRIPT_DIR)/kconfig.pl 'm+' '+' $(LINUX_DIR)/.config.target /dev/null $(LINUX_DIR)/.config.override > $(LINUX_DIR)/.config
$(call Kernel/SetNoInitramfs) $(call Kernel/SetNoInitramfs)
rm -rf $(KERNEL_BUILD_DIR)/modules rm -rf $(KERNEL_BUILD_DIR)/modules

View File

@ -19,4 +19,4 @@ CONFIG_ATH_USER_REGD=y
CONFIG_PACKAGE_ATH_DEBUG=y CONFIG_PACKAGE_ATH_DEBUG=y
CONFIG_ATH10K_CT_COMMUNITY_FW=y CONFIG_ATH10K_CT_COMMUNITY_FW=y
CONFIG_PACKAGE_luci-base_srcdiet=y CONFIG_LUCI_SRCDIET=y

View File

@ -35,7 +35,7 @@ export GLUON_LANGS
ifeq ($(OPENWRT_BUILD),1) ifeq ($(OPENWRT_BUILD),1)
ifeq ($(GLUON_TOOLS),1) ifeq ($(GLUON_TOOLS),1)
CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo http://downloads.openwrt.org/barrier_breaker/14.07/%S/packages) CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo http://downloads.openwrt.org/chaos_calmer/15.05-rc1/%S/packages)
export CONFIG_VERSION_REPO export CONFIG_VERSION_REPO
GLUON_SITE_CODE := $(shell $(GLUONDIR)/scripts/site.sh site_code) GLUON_SITE_CODE := $(shell $(GLUONDIR)/scripts/site.sh site_code)
@ -65,7 +65,7 @@ GLUON_TARGET_$$(gluon_target)_BOARD := $(1)
GLUON_TARGET_$$(gluon_target)_SUBTARGET := $(2) GLUON_TARGET_$$(gluon_target)_SUBTARGET := $(2)
endef endef
GLUON_DEFAULT_PACKAGES := gluon-core kmod-ipv6 firewall ip6tables -uboot-envtools GLUON_DEFAULT_PACKAGES := gluon-core kmod-ipv6 firewall ip6tables -uboot-envtools -wpad-mini hostapd-mini
override DEFAULT_PACKAGES.router := override DEFAULT_PACKAGES.router :=

View File

@ -7,45 +7,20 @@ $(shell cat $(1) | sed -ne '1h; 1!H; $$ {g; s/@/+@/g; s/\n/-@/g; p}')
END__GLUON__CHECK__SITE END__GLUON__CHECK__SITE
endef endef
# Languages supported by LuCi # Languages supported by LuCi
GLUON_SUPPORTED_LANGS := ca zh_cn en fr de el he hu it ja ms no pl pt_br pt ro ru es sv uk vi GLUON_SUPPORTED_LANGS := ca zh_cn en fr de el he hu it ja ms no pl pt_br pt ro ru es sv uk vi
GLUON_LANG_ca := catalan GLUON_I18N_PACKAGES := $(foreach lang,$(GLUON_SUPPORTED_LANGS),+LUCI_LANG_$(lang):luci-i18n-base-$(lang))
GLUON_LANG_zh_cn := chinese GLUON_I18N_CONFIG := $(foreach lang,$(GLUON_SUPPORTED_LANGS),CONFIG_LUCI_LANG_$(lang))
GLUON_LANG_en := english GLUON_ENABLED_LANGS := $(foreach lang,$(GLUON_SUPPORTED_LANGS),$(if $(CONFIG_LUCI_LANG_$(lang)),$(lang)))
GLUON_LANG_fr := french
GLUON_LANG_de := german
GLUON_LANG_el := greek
GLUON_LANG_he := hebrew
GLUON_LANG_hu := hungarian
GLUON_LANG_it := italian
GLUON_LANG_ja := japanese
GLUON_LANG_ms := malay
GLUON_LANG_no := norwegian
GLUON_LANG_pl := polish
GLUON_LANG_pt_br := portuguese-brazilian
GLUON_LANG_pt := portuguese
GLUON_LANG_ro := romanian
GLUON_LANG_ru := russian
GLUON_LANG_es := spanish
GLUON_LANG_sv := swedish
GLUON_LANG_uk := ukrainian
GLUON_LANG_vi := vietnamese
GLUON_I18N_PACKAGES := $(foreach lang,$(GLUON_SUPPORTED_LANGS),+GLUON_LANG_$(lang):luci-i18n-$(GLUON_LANG_$(lang)))
GLUON_I18N_CONFIG := $(foreach lang,$(GLUON_SUPPORTED_LANGS),CONFIG_GLUON_LANG_$(lang))
GLUON_ENABLED_LANGS := $(foreach lang,$(GLUON_SUPPORTED_LANGS),$(if $(CONFIG_GLUON_LANG_$(lang)),$(lang)))
GLUON_PO2LMO := $(BUILD_DIR)/luci/build/po2lmo
define GluonBuildI18N define GluonBuildI18N
mkdir -p $$(PKG_BUILD_DIR)/i18n mkdir -p $$(PKG_BUILD_DIR)/i18n
for lang in $$(GLUON_ENABLED_LANGS); do \ for lang in $$(GLUON_ENABLED_LANGS); do \
if [ -e $(2)/$$$$lang.po ]; then \ if [ -e $(2)/$$$$lang.po ]; then \
rm -f $$(PKG_BUILD_DIR)/i18n/$(1).$$$$lang.lmo; \ rm -f $$(PKG_BUILD_DIR)/i18n/$(1).$$$$lang.lmo; \
$(GLUON_PO2LMO) $(2)/$$$$lang.po $$(PKG_BUILD_DIR)/i18n/$(1).$$$$lang.lmo; \ po2lmo $(2)/$$$$lang.po $$(PKG_BUILD_DIR)/i18n/$(1).$$$$lang.lmo; \
fi; \ fi; \
done done
endef endef

View File

@ -48,10 +48,6 @@ else
export HOSTCC_WRAPPER:=$(HOSTCC) export HOSTCC_WRAPPER:=$(HOSTCC)
endif endif
ifeq ($(FORCE),)
.config scripts/config/conf scripts/config/mconf: tmp/.prereq-build
endif
SCAN_COOKIE?=$(shell echo $$$$) SCAN_COOKIE?=$(shell echo $$$$)
export SCAN_COOKIE export SCAN_COOKIE

17
modules
View File

@ -1,18 +1,19 @@
GLUON_FEEDS='openwrt gluon routing luci' GLUON_FEEDS='openwrt gluon routing luci'
OPENWRT_REPO=git://git.openwrt.org/14.07/openwrt.git OPENWRT_REPO=git://git.openwrt.org/openwrt.git
OPENWRT_COMMIT=229d60fdb45c34902d402938e231c006f7c73931 OPENWRT_COMMIT=53a178af743eb1a463c806ee79d1e622969ad6ef
PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git
PACKAGES_OPENWRT_COMMIT=01fcd1f29174a56d6ddb59901ed8c67ea42c3a8f PACKAGES_OPENWRT_COMMIT=914beae80e848c161214464fba7a9826c66bbf26
PACKAGES_OPENWRT_BRANCH=for-14.07 PACKAGES_OPENWRT_BRANCH=for-15.05
PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git
PACKAGES_GLUON_COMMIT=e8ee21d116a0abc2e328b0ee181d79845654582e PACKAGES_GLUON_COMMIT=dcc5a5ab74822492877eadcba5fc3ad845ee65db
PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git
PACKAGES_ROUTING_COMMIT=5d4ad63897b435d5df0f39a49bd58962c22c33b8 PACKAGES_ROUTING_COMMIT=b1c3bdfbf47003088198bf8ef699a94cc29e3eca
PACKAGES_ROUTING_BRANCH=for-14.07 PACKAGES_ROUTING_BRANCH=for-15.05
PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git PACKAGES_LUCI_REPO=git://github.com/openwrt/luci.git
PACKAGES_LUCI_COMMIT=f81be49ae756dab82e1758a6c9de145f0d36960e PACKAGES_LUCI_COMMIT=7a54785ea616df1e72f20b9cad2f1a6b3097f7b5
PACKAGES_LUCI_BRANCH=for-15.05

View File

@ -2,12 +2,12 @@
module('gluon.announce', package.seeall) module('gluon.announce', package.seeall)
fs = require 'luci.fs' fs = require 'nixio.fs'
uci = require('luci.model.uci').cursor() uci = require('luci.model.uci').cursor()
util = require 'luci.util' util = require 'luci.util'
local function collect_entry(entry) local function collect_entry(entry)
if fs.isdirectory(entry) then if fs.stat(entry, 'type') == 'dir' then
return collect_dir(entry) return collect_dir(entry)
else else
return setfenv(loadfile(entry), _M)() return setfenv(loadfile(entry), _M)()
@ -17,7 +17,7 @@ end
function collect_dir(dir) function collect_dir(dir)
local ret = {} local ret = {}
for _, entry in ipairs(fs.dir(dir)) do for entry in fs.dir(dir) do
if entry:sub(1, 1) ~= '.' then if entry:sub(1, 1) ~= '.' then
local ok, val = pcall(collect_entry, dir .. '/' .. entry) local ok, val = pcall(collect_entry, dir .. '/' .. entry)
if ok then if ok then

View File

@ -0,0 +1,18 @@
#!/usr/bin/lua
local uci = require('luci.model.uci').cursor()
-- Allow announced port on WAN to allow resolving neighbours over mesh-on-wan
uci:section('firewall', 'rule', 'wan_announced',
{
name = 'wan_announced',
src = 'wan',
src_ip = 'fe80::/64',
dest_port = '1001',
proto = 'udp',
target = 'ACCEPT',
}
)
uci:save('firewall')
uci:commit('firewall')

View File

@ -49,10 +49,11 @@ function action_reboot()
uci:commit("gluon-setup-mode") uci:commit("gluon-setup-mode")
if nixio.fork() ~= 0 then if nixio.fork() ~= 0 then
local fs = require "luci.fs" local fs = require "nixio.fs"
local util = require "nixio.util"
local parts_dir = "/lib/gluon/config-mode/reboot/" local parts_dir = "/lib/gluon/config-mode/reboot/"
local files = fs.dir(parts_dir) local files = util.consume(fs.dir(parts_dir))
table.sort(files) table.sort(files)
@ -69,7 +70,7 @@ function action_reboot()
local hostname = uci:get_first("system", "system", "hostname") local hostname = uci:get_first("system", "system", "hostname")
luci.template.render("gluon-config-mode/reboot", { parts=parts luci.template.render("gluon/config-mode/reboot", { parts=parts
, hostname=hostname , hostname=hostname
}) })
else else

View File

@ -1,11 +1,12 @@
local wizard_dir = "/lib/gluon/config-mode/wizard/" local wizard_dir = "/lib/gluon/config-mode/wizard/"
local i18n = luci.i18n local i18n = luci.i18n
local uci = luci.model.uci.cursor() local uci = luci.model.uci.cursor()
local fs = require "luci.fs" local fs = require "nixio.fs"
local util = require "nixio.util"
local f, s local f, s
local wizard = {} local wizard = {}
local files = fs.dir(wizard_dir) local files = util.consume(fs.dir(wizard_dir))
table.sort(files) table.sort(files)
@ -17,7 +18,7 @@ end
f = SimpleForm("wizard") f = SimpleForm("wizard")
f.reset = false f.reset = false
f.template = "gluon-config-mode/cbi/wizard" f.template = "gluon/cbi/config-mode"
for _, s in ipairs(wizard) do for _, s in ipairs(wizard) do
s.section(f) s.section(f)

View File

@ -12,21 +12,7 @@ define Package/gluon-core
SECTION:=gluon SECTION:=gluon
CATEGORY:=Gluon CATEGORY:=Gluon
TITLE:=Base files of Gluon TITLE:=Base files of Gluon
DEPENDS:=+gluon-site +lua-platform-info +luci-lib-nixio +odhcp6c +firewall DEPENDS:=+gluon-site +lua-platform-info +luci-base +odhcp6c +firewall
endef
define LangConfig
config GLUON_LANG_$(1)
bool "$(GLUON_LANG_$(1)) language support"
depends on PACKAGE_gluon-core
default n
endef
define Package/gluon-core/config
$(foreach lang,$(GLUON_SUPPORTED_LANGS),$(call LangConfig,$(lang)))
endef endef

View File

@ -1,10 +1,10 @@
#!/usr/bin/lua #!/usr/bin/lua
local fs = require 'luci.fs' local fs = require 'nixio.fs'
local sysconfig = require 'gluon.sysconfig' local sysconfig = require 'gluon.sysconfig'
if fs.isfile('/lib/gluon/version/core') and not sysconfig.gluon_version then if fs.stat('/lib/gluon/version/core') and not sysconfig.gluon_version then
-- This isn't an initial upgrade, so set gluon_version -- This isn't an initial upgrade, so set gluon_version
sysconfig.gluon_version = '' sysconfig.gluon_version = ''
end end

View File

@ -10,7 +10,7 @@ end
local platform = require 'gluon.platform' local platform = require 'gluon.platform'
local fs = require 'luci.fs' local fs = require 'nixio.fs'
local util = require 'luci.util' local util = require 'luci.util'

View File

@ -9,6 +9,7 @@ uci:section('network', 'interface', 'wan',
{ {
ifname = sysconfig.wan_ifname, ifname = sysconfig.wan_ifname,
type = 'bridge', type = 'bridge',
igmp_snooping = 0,
peerdns = 0, peerdns = 0,
auto = 1, auto = 1,
} }

View File

@ -2,7 +2,7 @@
local sysconfig = require 'gluon.sysconfig' local sysconfig = require 'gluon.sysconfig'
local fs = require 'luci.fs' local fs = require 'nixio.fs'
local util = require 'luci.util' local util = require 'luci.util'

View File

@ -4,12 +4,14 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-luci-admin PKG_NAME:=gluon-luci-admin
PKG_VERSION:=0.1 PKG_VERSION:=1
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-luci-admin define Package/gluon-luci-admin
SECTION:=gluon SECTION:=gluon
@ -18,10 +20,6 @@ define Package/gluon-luci-admin
DEPENDS:=gluon-config-mode-core-virtual DEPENDS:=gluon-config-mode-core-virtual
endef endef
define Package/gluon-luci-admin/description
Luci based config mode
endef
define Build/Prepare define Build/Prepare
mkdir -p $(PKG_BUILD_DIR) mkdir -p $(PKG_BUILD_DIR)
endef endef
@ -30,10 +28,12 @@ define Build/Configure
endef endef
define Build/Compile define Build/Compile
$(call GluonBuildI18N,gluon-luci-admin,i18n)
endef endef
define Package/gluon-luci-admin/install define Package/gluon-luci-admin/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-luci-admin,$(1))
endef endef
$(eval $(call BuildPackage,gluon-luci-admin)) $(eval $(call BuildPackage,gluon-luci-admin))

View File

@ -29,11 +29,11 @@ function index()
root.index = true root.index = true
end end
local page = entry({"admin"}, alias("admin", "index"), "Expert Mode", 10) local page = entry({"admin"}, alias("admin", "index"), _("Expert Mode"), 10)
page.sysauth = "root" page.sysauth = "root"
page.sysauth_authenticator = function() return "root" end page.sysauth_authenticator = function() return "root" end
page.index = true page.index = true
entry({"admin", "index"}, cbi("admin/info"), _("Info"), 1).ignoreindex = true entry({"admin", "index"}, cbi("admin/info"), _("Information"), 1).ignoreindex = true
entry({"admin", "remote"}, cbi("admin/remote"), _("Remotezugriff"), 10) entry({"admin", "remote"}, cbi("admin/remote"), _("Remote access"), 10)
end end

View File

@ -18,7 +18,7 @@ module("luci.controller.admin.upgrade", package.seeall)
function index() function index()
local has_platform = nixio.fs.access("/lib/upgrade/platform.sh") local has_platform = nixio.fs.access("/lib/upgrade/platform.sh")
if has_platform then if has_platform then
entry({"admin", "upgrade"}, call("action_upgrade"), "Firmware aktualisieren", 90) entry({"admin", "upgrade"}, call("action_upgrade"), _("Upgrade firmware"), 90)
entry({"admin", "upgrade", "reboot"}, template("admin/upgrade_reboot"), nil, nil) entry({"admin", "upgrade", "reboot"}, template("admin/upgrade_reboot"), nil, nil)
end end
end end

View File

@ -16,15 +16,13 @@ $Id$
local fs = require "nixio.fs" local fs = require "nixio.fs"
local m = Map("system", "SSH-Keys") local m = Map("system", translate("SSH keys"))
m.submit = "Speichern"
m.reset = "Zurücksetzen"
m.pageaction = false m.pageaction = false
m.template = "admin/expertmode" m.template = "admin/expertmode"
if fs.access("/etc/config/dropbear") then if fs.access("/etc/config/dropbear") then
local s = m:section(TypedSection, "_dummy1", nil, local s = m:section(TypedSection, "_dummy1", nil,
"Hier hast du die Möglichkeit SSH-Keys (einen pro Zeile) zu hinterlegen:") translate("You can provide your SSH keys here (one per line):"))
s.addremove = false s.addremove = false
s.anonymous = true s.anonymous = true
@ -57,23 +55,22 @@ if fs.access("/etc/config/dropbear") then
end end
end end
local m2 = Map("system", "Passwort") local m2 = Map("system", translate("Password"))
m2.submit = "Speichern"
m2.reset = false m2.reset = false
m2.pageaction = false m2.pageaction = false
m2.template = "admin/expertmode" m2.template = "admin/expertmode"
local s = m2:section(TypedSection, "_dummy2", nil, local s = m2:section(TypedSection, "_dummy2", nil, translate(
[[Alternativ kannst du auch ein Passwort setzen. Wähle bitte ein sicheres Passwort, das du nirgendwo anders verwendest.<br /><br /> "Alternatively, you can set a password to access you node. Please choose a secure password you don't use anywhere else.<br /><br />"
Beim Setzen eines leeren Passworts wird der Login per Passwort gesperrt (dies ist die Standard-Einstellung).]]) .. "If you set an empty password, login via password will be disabled. This is the default."))
s.addremove = false s.addremove = false
s.anonymous = true s.anonymous = true
local pw1 = s:option(Value, "pw1", "Passwort") local pw1 = s:option(Value, "pw1", translate("Password"))
pw1.password = true pw1.password = true
local pw2 = s:option(Value, "pw2", "Wiederholung") local pw2 = s:option(Value, "pw2", translate("Confirmation"))
pw2.password = true pw2.password = true
function s.cfgsections() function s.cfgsections()
@ -87,18 +84,18 @@ function m2.on_commit(map)
if v1 and v2 then if v1 and v2 then
if v1 == v2 then if v1 == v2 then
if #v1 > 0 then if #v1 > 0 then
if luci.sys.user.setpasswd(luci.dispatcher.context.authuser, v1) == 0 then if luci.sys.user.setpasswd(luci.dispatcher.context.authuser, v1) == 0 then
m2.message = "Passwort geändert." m2.message = translate("Password changed.")
else else
m2.errmessage = "Das Passwort konnte nicht geändert werden." m2.errmessage = translate("Unable to change the password.")
end end
else else
-- We don't check the return code here as the error 'password for root is already locked' is normal... -- We don't check the return code here as the error 'password for root is already locked' is normal...
os.execute('passwd -l root >/dev/null') os.execute('passwd -l root >/dev/null')
m2.message = "Passwort gelöscht." m2.message = translate("Password removed.")
end end
else else
m2.errmessage = "Die beiden Passwörter stimmen nicht überein." m2.errmessage = translate("The password and the confirmation differ.")
end end
end end
end end

View File

@ -1,7 +1,8 @@
<%- <%-
local fs = require 'luci.fs' local fs = require 'nixio.fs'
local uci = require('luci.model.uci').cursor() local uci = require('luci.model.uci').cursor()
local util = require 'luci.util' local util = require 'luci.util'
local i18n = require 'luci.i18n'
local site = require 'gluon.site_config' local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig' local sysconfig = require 'gluon.sysconfig'
@ -9,13 +10,13 @@
local keys = { local keys = {
hostname = 'Hostname', hostname = i18n.translate('Hostname'),
primary_mac = 'MAC-Adresse', primary_mac = i18n.translate('MAC address'),
model = 'Hardware-Modell', model = i18n.translate('Hardware model'),
version = 'Gluon-Version', version = i18n.translate('Gluon version'),
release = 'Firmware-Release', release = i18n.translate('Firmware release'),
site = 'Site', site = i18n.translate('Site'),
pubkey = 'Öffentlicher VPN-Schlüssel', pubkey = i18n.translate('Public VPN key'),
} }
local values = { local values = {
@ -36,7 +37,7 @@
end end
end end
-%> -%>
<h2>Info</h2> <h2><%:Information%></h2>
<% for _, key in ipairs({'hostname', 'primary_mac', 'model', 'version', 'release', 'site', 'pubkey'}) do %> <% for _, key in ipairs({'hostname', 'primary_mac', 'model', 'version', 'release', 'site', 'pubkey'}) do %>
<div class="cbi-value"> <div class="cbi-value">
<div class="cbi-value-title"><%=keys[key]%></div><div class="cbi-value-field"><%=values[key] or 'n/a'%></div> <div class="cbi-value-title"><%=keys[key]%></div><div class="cbi-value-field"><%=values[key] or 'n/a'%></div>

View File

@ -15,41 +15,41 @@ $Id$
<%+header%> <%+header%>
<h2>Firmware aktualisieren</h2> <h2><%:Upgrade firmware%></h2>
<form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data"> <form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data">
<p> <p>
Hier kannst du ein manuelles Firmwareupdate durchführen. <%:You can manually upgrade your firmware here.%>
</p> </p>
<% if bad_image then %> <% if bad_image then %>
<p class="error">Die übermittelte Firmwaredatei kann nicht verwendet werden.</p> <p class="error"><%:The provided firmware image is not valid for this device.%></p>
<% end %> <% end %>
<div class="cbi-section-node"> <div class="cbi-section-node">
<div class="cbi-value"> <div class="cbi-value">
<label class="cbi-value-title"> <label class="cbi-value-title">
Firmware-Datei <%:Firmware image%>
</label> </label>
<div class="cbi-value-field"> <div class="cbi-value-field">
<input class="cbi-input-file" type="file" name="image" /> <input class="cbi-input-file" type="file" name="image" />
</div>
</div>
<div class="cbi-value cbi-value-last">
<label class="cbi-value-title">
<%:Keep settings%>
</label>
<div class="cbi-value-field">
<input id="keepcfg" class="cbi-input-checkbox" type="checkbox" name="keepcfg" value="1" checked="checked" />
<label for="keepcfg"></label>
</div>
</div> </div>
</div> </div>
<div class="cbi-value cbi-value-last"> <div class="cbi-page-actions right">
<label class="cbi-value-title"> <input type="hidden" name="step" value="2" />
Einstellungen beibehalten <input class="cbi-button cbi-button-apply" type="submit" value="<%:Upload image%>" />
</label>
<div class="cbi-value-field">
<input id="keepcfg" class="cbi-input-checkbox" type="checkbox" name="keepcfg" value="1" checked="checked" />
<label for="keepcfg"></label>
</div>
</div> </div>
</div>
<div class="cbi-page-actions right">
<input type="hidden" name="step" value="2" />
<input class="cbi-button cbi-button-apply" type="submit" value="Upload image" />
</div>
</form> </form>
<%+footer%> <%+footer%>

View File

@ -15,20 +15,20 @@ $Id$
<%+header%> <%+header%>
<h2>Firmware aktualisieren</h2> <h2><%:Upgrade firmware%></h2>
<p> <p>
Die Firmwaredatei wurde übermittelt. Bitte vergleiche MD5-Checksumme <%:The firmware image has been transmitted. Please ensure the MD5 checksum and image size are correct and click "continue".%>
und Dateigröße und klicke anschließend auf "Fortfahren".
</p> </p>
<% if flashsize > 0 and filesize > flashsize then %> <% if flashsize > 0 and filesize > flashsize then %>
<p class="error">Die Firmware passt nicht in den Speicher des Gerätes.</p> <p class="error"><%:The firmware is too big for your device's storage.%></p>
<% end %> <% end %>
<p> <p>
<ul> <ul>
<li>md5sum: <code><%=checksum%></code></li> <li>md5sum: <code><%=checksum%></code></li>
<li>Größe: <% <li><%:Size%>: <%
function byte_format(byte) function byte_format(byte)
local suff = {"B", "KB", "MB", "GB", "TB"} local suff = {"B", "KB", "MB", "GB", "TB"}
for i=1, 5 do for i=1, 5 do
@ -51,16 +51,16 @@ $Id$
%></li> %></li>
</ul> </ul>
</p> </p>
<div class="cbi-page-actions right"> <div class="cbi-page-actions">
<form style="display:inline"> <form style="display:inline">
<input type="hidden" name="step" value="3" /> <input type="hidden" name="step" value="3" />
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" /> <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
<input class="cbi-button cbi-button-apply" type="submit" value="Fortfahren" /> <input class="cbi-button cbi-button-apply" type="submit" value="<%:Continue%>" />
</form> </form>
<form style="display:inline"> <form style="display:inline">
<input type="hidden" name="step" value="1" /> <input type="hidden" name="step" value="1" />
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" /> <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
<input class="cbi-button cbi-button-reset" type="submit" value="Abbrechen" /> <input class="cbi-button cbi-button-reset" type="submit" value="<%:Cancel%>" />
</form> </form>
</div> </div>
<%+footer%> <%+footer%>

View File

@ -3,17 +3,16 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%=luci.i18n.context.lang%>" lang="<%=luci.i18n.context.lang%>"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%=luci.i18n.context.lang%>" lang="<%=luci.i18n.context.lang%>">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Firmware wird aktualisiert</title> <title><%:Upgrading firmware%></title>
<link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" /> <link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" />
</head> </head>
<body> <body>
<div id="maincontainer"> <div id="maincontainer">
<div id="maincontent"> <div id="maincontent">
<p> <p>
Die Firmware wird jetzt aktualisiert. <%:The firmware is currently being upgraded.%>
<strong>UNTERBRICH AUF KEINEN FALL DIE STROMVERSORGUNG!</strong> <strong><%:Don't switch off the device in any circumstance!%></strong>
Dieser Vorgang wird einige Minuten dauern. <%:The upgrade will take a few minutes. When it is finished, your node will reboot automatically.%>
Anschließend startet das Gerät automatisch neu.
</p> </p>
</div> </div>
</div> </div>

View File

@ -0,0 +1,111 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-05-04 00:34+0200\n"
"Last-Translator: <mschiffer@universe-factory.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid ""
"Alternatively, you can set a password to access you node. Please choose a "
"secure password you don't use anywhere else.<br /><br />If you set an empty "
"password, login via password will be disabled. This is the default."
msgstr ""
"Alternativ kannst du auch ein Passwort setzen. Wähle bitte ein sicheres "
"Passwort, das du nirgendwo anders verwendest.<br /><br />Beim Setzen eines "
"leeren Passworts wird der Login per Passwort gesperrt (dies ist die Standard-"
"Einstellung)."
msgid "Continue"
msgstr "Fortfahren"
msgid "Don't switch off the device in any circumstance!"
msgstr "Unterbrich auf keinen Fall die Stromversorgung!"
msgid "Expert Mode"
msgstr "Expert Mode"
msgid "Firmware image"
msgstr "Firmware-Datei"
msgid "Firmware release"
msgstr "Firmware-Release"
msgid "Gluon version"
msgstr "Gluon-Version"
msgid "Hardware model"
msgstr "Hardware-Modell"
msgid "Information"
msgstr "Info"
msgid "MAC address"
msgstr "MAC-Adresse"
msgid "Password changed."
msgstr "Passwort geändert."
msgid "Password removed."
msgstr "Passwort gelöscht."
msgid "Public VPN key"
msgstr "Öffentlicher VPN-Schlüssel"
msgid "Remote access"
msgstr "Remotezugriff"
msgid "SSH keys"
msgstr "SSH-Schlüssel"
msgid "Site"
msgstr "Site"
msgid ""
"The firmware image has been transmitted. Please ensure the MD5 checksum and "
"image size are correct and click \"continue\"."
msgstr ""
"Die Firmwaredatei wurde übermittelt. Bitte vergleiche MD5-Checksumme und "
"Dateigröße und klicke anschließend auf \"fortfahren\"."
msgid "The firmware is currently being upgraded."
msgstr "Die Firmware wird jetzt aktualisiert."
msgid "The firmware is too big for your device's storage."
msgstr "Die Firmware passt nicht in den Speicher des Gerätes."
msgid "The password and the confirmation differ."
msgstr "Die beiden Passwörter stimmen nicht überein."
msgid "The provided firmware image is not valid for this device."
msgstr "Die übermittelte Datei ist keine gültige Firmware für dieses Gerät."
msgid ""
"The upgrade will take a few minutes. When it is finished, your node will "
"reboot automatically."
msgstr ""
"Dieser Vorgang wird einige Minuten dauern. Anschließend startet das Gerät "
"automatisch neu."
msgid "Unable to change the password."
msgstr "Das Passwort konnte nicht geändert werden."
msgid "Upgrade firmware"
msgstr "Firmware aktualisieren"
msgid "Upgrading firmware"
msgstr "Firmware wird aktualisiert"
msgid "Upload image"
msgstr "Datei hochladen"
msgid "You can manually upgrade your firmware here."
msgstr "Hier kannst du ein manuelles Firmwareupdate durchführen."
msgid "You can provide your SSH keys here (one per line):"
msgstr ""
"Hier hast du die Möglichkeit, SSH-Keys zu hinterlegen (einen pro Zeile):"

View File

@ -0,0 +1,93 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid ""
"Alternatively, you can set a password to access you node. Please choose a "
"secure password you don't use anywhere else.<br /><br />If you set an empty "
"password, login via password will be disabled. This is the default."
msgstr ""
msgid "Continue"
msgstr ""
msgid "Don't switch off the device in any circumstance!"
msgstr ""
msgid "Expert Mode"
msgstr ""
msgid "Firmware image"
msgstr ""
msgid "Firmware release"
msgstr ""
msgid "Gluon version"
msgstr ""
msgid "Hardware model"
msgstr ""
msgid "Information"
msgstr ""
msgid "MAC address"
msgstr ""
msgid "Password changed."
msgstr ""
msgid "Password removed."
msgstr ""
msgid "Public VPN key"
msgstr ""
msgid "Remote access"
msgstr ""
msgid "SSH keys"
msgstr ""
msgid "Site"
msgstr ""
msgid ""
"The firmware image has been transmitted. Please ensure the MD5 checksum and "
"image size are correct and click \"continue\"."
msgstr ""
msgid "The firmware is currently being upgraded."
msgstr ""
msgid "The firmware is too big for your device's storage."
msgstr ""
msgid "The password and the confirmation differ."
msgstr ""
msgid "The provided firmware image is not valid for this device."
msgstr ""
msgid ""
"The upgrade will take a few minutes. When it is finished, your node will "
"reboot automatically."
msgstr ""
msgid "Unable to change the password."
msgstr ""
msgid "Upgrade firmware"
msgstr ""
msgid "Upgrading firmware"
msgstr ""
msgid "Upload image"
msgstr ""
msgid "You can manually upgrade your firmware here."
msgstr ""
msgid "You can provide your SSH keys here (one per line):"
msgstr ""

View File

@ -4,12 +4,14 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-luci-autoupdater PKG_NAME:=gluon-luci-autoupdater
PKG_VERSION:=0.1 PKG_VERSION:=1
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-luci-autoupdater define Package/gluon-luci-autoupdater
SECTION:=gluon SECTION:=gluon
@ -18,10 +20,6 @@ define Package/gluon-luci-autoupdater
DEPENDS:=+gluon-luci-admin +gluon-autoupdater DEPENDS:=+gluon-luci-admin +gluon-autoupdater
endef endef
define Package/gluon-luci-autoupdater/description
Luci module for gluon-autoupdater
endef
define Build/Prepare define Build/Prepare
mkdir -p $(PKG_BUILD_DIR) mkdir -p $(PKG_BUILD_DIR)
endef endef
@ -30,10 +28,12 @@ define Build/Configure
endef endef
define Build/Compile define Build/Compile
$(call GluonBuildI18N,gluon-luci-autoupdater,i18n)
endef endef
define Package/gluon-luci-autoupdater/install define Package/gluon-luci-autoupdater/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-luci-autoupdater,$(1))
endef endef
$(eval $(call BuildPackage,gluon-luci-autoupdater)) $(eval $(call BuildPackage,gluon-luci-autoupdater))

View File

@ -15,6 +15,5 @@ $Id$
module("luci.controller.admin.autoupdater", package.seeall) module("luci.controller.admin.autoupdater", package.seeall)
function index() function index()
entry({"admin", "autoupdater"}, cbi("admin/autoupdater"), _("Autoupdater"), 20) entry({"admin", "autoupdater"}, cbi("admin/autoupdater"), _("Automatic updates"), 80)
end end

View File

@ -12,9 +12,7 @@ You may obtain a copy of the License at
$Id$ $Id$
]]-- ]]--
m = Map("autoupdater", "Autoupdater") m = Map("autoupdater", translate("Automatic updates"))
m.submit = "Speichern"
m.reset = "Zurücksetzen"
m.pageaction = false m.pageaction = false
m.template = "admin/expertmode" m.template = "admin/expertmode"
@ -22,8 +20,8 @@ s = m:section(TypedSection, "autoupdater", nil)
s.addremove = false s.addremove = false
s.anonymous = true s.anonymous = true
s:option(Flag, "enabled", "Aktivieren") s:option(Flag, "enabled", translate("Enable"))
f = s:option(ListValue, "branch", "Branch") f = s:option(ListValue, "branch", translate("Branch"))
uci.cursor():foreach("autoupdater", "branch", function (section) f:value(section[".name"]) end) uci.cursor():foreach("autoupdater", "branch", function (section) f:value(section[".name"]) end)

View File

@ -0,0 +1,17 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-05-04 01:55+0200\n"
"Last-Translator: <mschiffer@universe-factory.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "Automatic updates"
msgstr "Automatische Updates"
msgid "Branch"
msgstr "Branch"

View File

@ -0,0 +1,8 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Automatic updates"
msgstr ""
msgid "Branch"
msgstr ""

View File

@ -0,0 +1,41 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-luci-mesh-vpn-fastd
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-luci-mesh-vpn-fastd
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Luci module to enable and disable encryption for the mesh VPN
DEPENDS:=+gluon-luci-admin +gluon-mesh-vpn-fastd
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
$(call GluonBuildI18N,gluon-mesh-vpn-fastd,i18n)
endef
define Package/gluon-luci-mesh-vpn-fastd/install
$(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-mesh-vpn-fastd,$(1))
endef
define Package/gluon-luci-mesh-vpn-fastd/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-luci-mesh-vpn-fastd))

View File

@ -0,0 +1,2 @@
assert(need_boolean('fastd_mesh_vpn.configurable') == true,
"site.conf error: expected `fastd_mesh_vpn.configurable' to be true")

View File

@ -0,0 +1,5 @@
module("luci.controller.admin.mesh_vpn_fastd", package.seeall)
function index()
entry({"admin", "mesh_vpn_fastd"}, cbi("admin/mesh_vpn_fastd"), _("Mesh VPN"), 20)
end

View File

@ -0,0 +1,41 @@
local uci = luci.model.uci.cursor()
local util = luci.util
local f = SimpleForm('mesh_vpn', translate('Mesh VPN'))
f.template = "admin/expertmode"
local s = f:section(SimpleSection)
local o = s:option(Value, 'mode')
o.template = "gluon/cbi/mesh-vpn-fastd-mode"
local methods = uci:get('fastd', 'mesh_vpn', 'method')
if util.contains(methods, 'null') then
o.default = 'performance'
else
o.default = 'security'
end
function f.handle(self, state, data)
if state == FORM_VALID then
local site = require 'gluon.site_config'
local methods = {}
if data.mode == 'performance' then
table.insert(methods, 'null')
end
for _, method in ipairs(site.fastd_mesh_vpn.methods) do
if method ~= 'null' then
table.insert(methods, method)
end
end
uci:set('fastd', 'mesh_vpn', 'method', methods)
uci:save('fastd')
uci:commit('fastd')
end
end
return f

View File

@ -0,0 +1,32 @@
<div class="cbi-value">
<div class="cbi-value-title">
<input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio" value="security"<%= attr("id", cbid..'1') .. attr("name", cbid) .. ifattr((self:cfgvalue(section) or self.default) == "security", "checked", "checked") %> />
</div>
<div class="cbi-value-field-long">
<label<%= attr("for", cbid..'1') %> class="cbi-value-title"><%:Security mode%></label>
<br />
<%= translate(
'In security mode, the mesh VPN uses an encrypted tunnel to connect to the VPN servers. ' ..
'The encryption ensures that it is impossible for your internet access provider to see what ' ..
'data is exchanged over your node.'
) %>
<br />
</div>
<div class="cbi-value-field-long-after"></div>
</div>
<div class="cbi-value cbi-value-last">
<div class="cbi-value-title">
<input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio" value="performance"<%= attr("id", cbid..'2') .. attr("name", cbid) .. ifattr((self:cfgvalue(section) or self.default) == "performance", "checked", "checked") %> />
</div>
<div class="cbi-value-field-long">
<label<%= attr("for", cbid..'2') %> class="cbi-value-title"><%:Performance mode%></label>
<br />
<%= translate(
'In performance mode, no encryption is used. This usually allows for higher throughput, but the data exchanged over your node is not ' ..
'protected against eavesdropping.'
) %>
<br />
</div>
<div class="cbi-value-field-long-after"></div>
</div>

View File

@ -0,0 +1,38 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-05-03 20:39+0200\n"
"Last-Translator: <mschiffer@universe-factory.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid ""
"In performance mode, no encryption is used. This usually allows for higher "
"throughput, but the data exchanged over your node is not protected against "
"eavesdropping."
msgstr ""
"Im Modus &bdquo;Hohe Geschwindigkeit&ldquo; wird auf Verschlüsselung "
"verzichtet. Dies erlaubt häufig eine höhere Bandbreite als mit "
"Verschlüsselung, aber die Verbindung ist nicht gegen Abhören geschützt."
msgid ""
"In security mode, the mesh VPN uses an encrypted tunnel to connect to the "
"VPN servers. The encryption ensures that it is impossible for your internet "
"access provider to see what data is exchanged over your node."
msgstr ""
"Im Modus &bdquo;Hohe Sicherheit&ldquo; wird ein verschlüsselter Tunnel "
"verwendet. Dies schließt aus, dass dein Internetzugangsprovider herausfinden "
"kann, was für Daten über deinen Knoten übertragen werden."
msgid "Mesh VPN"
msgstr "Mesh-VPN"
msgid "Performance mode"
msgstr "Hohe Geschwindigkeit"
msgid "Security mode"
msgstr "Hohe Sicherheit"

View File

@ -0,0 +1,23 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid ""
"In performance mode, no encryption is used. This usually allows for higher "
"throughput, but the data exchanged over your node is not protected against "
"eavesdropping."
msgstr ""
msgid ""
"In security mode, the mesh VPN uses an encrypted tunnel to connect to the "
"VPN servers. The encryption ensures that it is impossible for your internet "
"access provider to see what data is exchanged over your node."
msgstr ""
msgid "Mesh VPN"
msgstr ""
msgid "Performance mode"
msgstr ""
msgid "Security mode"
msgstr ""

View File

@ -8,6 +8,8 @@ PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-luci-node-role define Package/gluon-luci-node-role
SECTION:=gluon SECTION:=gluon
CATEGORY:=Gluon CATEGORY:=Gluon
@ -23,10 +25,12 @@ define Build/Configure
endef endef
define Build/Compile define Build/Compile
$(call GluonBuildI18N,gluon-luci-node-role,i18n)
endef endef
define Package/gluon-luci-node-role/install define Package/gluon-luci-node-role/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-luci-node-role,$(1))
endef endef
define Package/gluon-luci-node-role/postinst define Package/gluon-luci-node-role/postinst

View File

@ -1,8 +1,2 @@
local function check_role(k, _) need_string 'roles.default'
local role = string.format('roles.list[%q]', k) need_string_array 'roles.list'
need_string(role)
end
need_string('roles.default')
need_table('roles.list', check_role)

View File

@ -1,5 +1,5 @@
module("luci.controller.admin.noderole", package.seeall) module("luci.controller.admin.noderole", package.seeall)
function index() function index()
entry({"admin", "noderole"}, cbi("admin/noderole"), "Verwendungszweck", 20) entry({"admin", "noderole"}, cbi("admin/noderole"), "Node role", 20)
end end

View File

@ -1,27 +1,25 @@
local f, s, o local f, s, o
local site = require 'gluon.site_config' local site = require 'gluon.site_config'
local i18n = require "luci.i18n"
local uci = luci.model.uci.cursor() local uci = luci.model.uci.cursor()
local config = 'gluon-node-info' local config = 'gluon-node-info'
-- where to read the configuration from -- where to read the configuration from
local role = uci:get(config, uci:get_first(config, "system"), "role") local role = uci:get(config, uci:get_first(config, "system"), "role")
f = SimpleForm("role", "Verwendungszweck") f = SimpleForm("role", i18n.translate("Node role"))
f.reset = false
f.template = "admin/expertmode" f.template = "admin/expertmode"
f.submit = "Fertig"
s = f:section(SimpleSection, nil, [[ s = f:section(SimpleSection, nil, i18n.translate(
Wenn dein Freifunk-Router eine besondere Rolle im Freifunk Netz einnimmt, kannst du diese hier angeben. "If this node has a special role within the freifunk network you can specify this role here. "
Bringe bitte zuvor in Erfahrung welche Auswirkungen die zur Verfügung stehenden Rollen im Freifunk-Netz haben. .. "Please find out about the available roles and their impact first. "
Setze die Rolle nur, wenn du weißt was du machst. .. "Only change the role if you know what you are doing."))
]])
o = s:option(ListValue, "role", "Rolle") o = s:option(ListValue, "role", i18n.translate("Role"))
o.default = role o.default = role
o.rmempty = false o.rmempty = false
for role, prettyname in pairs(site.roles.list) do for _, role in ipairs(site.roles.list) do
o:value(role, prettyname) o:value(role, i18n.translate('gluon-luci-node-role:role:' .. role))
end end
function f.handle(self, state, data) function f.handle(self, state, data)

View File

@ -0,0 +1,27 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-04-26 17:18+0200\n"
"Last-Translator: Tobias Hachmer <tobias@hachmer.de>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "Node role"
msgstr "Verwendungszweck"
msgid "Role"
msgstr "Rolle"
msgid ""
"If this node has a special role within the freifunk network you can specify "
"this role here. Please find out about the available roles and their impact "
"first. Only change the role if you know what you are doing."
msgstr ""
"Wenn dein Freifunk-Knoten eine besondere Rolle im Freifunk Netz einnimmt, "
"kannst du diese hier angeben. Bringe bitte zuvor in Erfahrung, welche "
"Auswirkungen die zur Verfügung stehenden Rollen im Freifunk-Netz haben. "
"Setze die Rolle nur, wenn du weißt was du machst."

View File

@ -0,0 +1,14 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Node role"
msgstr ""
msgid "Role"
msgstr ""
msgid ""
"If this node has a special role within the freifunk network you can specify this role here. "
"Please find out about the available roles and their impact first. "
"Only change the role if you know what you are doing."
msgstr ""

View File

@ -4,12 +4,14 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-luci-portconfig PKG_NAME:=gluon-luci-portconfig
PKG_VERSION:=0.1 PKG_VERSION:=1
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-luci-portconfig define Package/gluon-luci-portconfig
SECTION:=gluon SECTION:=gluon
@ -18,10 +20,6 @@ define Package/gluon-luci-portconfig
DEPENDS:=+gluon-luci-admin +gluon-mesh-batman-adv DEPENDS:=+gluon-luci-admin +gluon-mesh-batman-adv
endef endef
define Package/gluon-luci-portconfig/description
Luci module for advanced ethernet port configuration
endef
define Build/Prepare define Build/Prepare
mkdir -p $(PKG_BUILD_DIR) mkdir -p $(PKG_BUILD_DIR)
endef endef
@ -30,10 +28,12 @@ define Build/Configure
endef endef
define Build/Compile define Build/Compile
$(call GluonBuildI18N,gluon-luci-portconfig,i18n)
endef endef
define Package/gluon-luci-portconfig/install define Package/gluon-luci-portconfig/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-luci-portconfig,$(1))
endef endef
$(eval $(call BuildPackage,gluon-luci-portconfig)) $(eval $(call BuildPackage,gluon-luci-portconfig))

View File

@ -15,6 +15,5 @@ $Id$
module("luci.controller.admin.portconfig", package.seeall) module("luci.controller.admin.portconfig", package.seeall)
function index() function index()
entry({"admin", "portconfig"}, cbi("admin/portconfig"), _("Schnittstellen"), 20) entry({"admin", "portconfig"}, cbi("admin/portconfig"), _("Network"), 20)
end end

View File

@ -13,40 +13,39 @@ $Id$
]]-- ]]--
local uci = luci.model.uci.cursor() local uci = luci.model.uci.cursor()
local sysconfig = require 'gluon.sysconfig'
local wan = uci:get_all("network", "wan") local wan = uci:get_all("network", "wan")
local wan6 = uci:get_all("network", "wan6") local wan6 = uci:get_all("network", "wan6")
local dns = uci:get_first("gluon-wan-dnsmasq", "static") local dns = uci:get_first("gluon-wan-dnsmasq", "static")
local f = SimpleForm("portconfig", "WAN-Verbindung") local f = SimpleForm("portconfig", translate("WAN connection"))
f.template = "admin/expertmode" f.template = "admin/expertmode"
f.submit = "Speichern"
f.reset = "Zurücksetzen"
local s local s
local o local o
s = f:section(SimpleSection, nil, nil) s = f:section(SimpleSection, nil, nil)
o = s:option(ListValue, "ipv4", "IPv4") o = s:option(ListValue, "ipv4", translate("IPv4"))
o:value("dhcp", "Automatisch (DHCP)") o:value("dhcp", translate("Automatic (DHCP)"))
o:value("static", "Statisch") o:value("static", translate("Static"))
o:value("none", "Deaktiviert") o:value("none", translate("Disabled"))
o.default = wan.proto o.default = wan.proto
o = s:option(Value, "ipv4_addr", "IP-Adresse") o = s:option(Value, "ipv4_addr", translate("IP address"))
o:depends("ipv4", "static") o:depends("ipv4", "static")
o.value = wan.ipaddr o.value = wan.ipaddr
o.datatype = "ip4addr" o.datatype = "ip4addr"
o.rmempty = false o.rmempty = false
o = s:option(Value, "ipv4_netmask", "Netzmaske") o = s:option(Value, "ipv4_netmask", translate("Netmask"))
o:depends("ipv4", "static") o:depends("ipv4", "static")
o.value = wan.netmask or "255.255.255.0" o.value = wan.netmask or "255.255.255.0"
o.datatype = "ip4addr" o.datatype = "ip4addr"
o.rmempty = false o.rmempty = false
o = s:option(Value, "ipv4_gateway", "Gateway") o = s:option(Value, "ipv4_gateway", translate("Gateway"))
o:depends("ipv4", "static") o:depends("ipv4", "static")
o.value = wan.gateway o.value = wan.gateway
o.datatype = "ip4addr" o.datatype = "ip4addr"
@ -55,19 +54,19 @@ o.rmempty = false
s = f:section(SimpleSection, nil, nil) s = f:section(SimpleSection, nil, nil)
o = s:option(ListValue, "ipv6", "IPv6") o = s:option(ListValue, "ipv6", translate("IPv6"))
o:value("dhcpv6", "Automatisch (RA/DHCPv6)") o:value("dhcpv6", translate("Automatic (RA/DHCPv6)"))
o:value("static", "Statisch") o:value("static", translate("Static"))
o:value("none", "Deaktiviert") o:value("none", translate("Disabled"))
o.default = wan6.proto o.default = wan6.proto
o = s:option(Value, "ipv6_addr", "IP-Adresse") o = s:option(Value, "ipv6_addr", translate("IP address"))
o:depends("ipv6", "static") o:depends("ipv6", "static")
o.value = wan6.ip6addr o.value = wan6.ip6addr
o.datatype = "ip6addr" o.datatype = "ip6addr"
o.rmempty = false o.rmempty = false
o = s:option(Value, "ipv6_gateway", "Gateway") o = s:option(Value, "ipv6_gateway", translate("Gateway"))
o:depends("ipv6", "static") o:depends("ipv6", "static")
o.value = wan6.ip6gw o.value = wan6.ip6gw
o.datatype = "ip6addr" o.datatype = "ip6addr"
@ -77,17 +76,24 @@ o.rmempty = false
if dns then if dns then
s = f:section(SimpleSection, nil, nil) s = f:section(SimpleSection, nil, nil)
o = s:option(DynamicList, "dns", "Statische DNS-Server") o = s:option(DynamicList, "dns", translate("Static DNS servers"))
o:write(nil, uci:get("gluon-wan-dnsmasq", dns, "server")) o:write(nil, uci:get("gluon-wan-dnsmasq", dns, "server"))
o.datatype = "ipaddr" o.datatype = "ipaddr"
end end
s = f:section(SimpleSection, nil, nil) s = f:section(SimpleSection, nil, nil)
o = s:option(Flag, "mesh_wan", "Mesh auf dem WAN-Port aktivieren") o = s:option(Flag, "mesh_wan", translate("Enable meshing on the WAN interface"))
o.default = uci:get_bool("network", "mesh_wan", "auto") and o.enabled or o.disabled o.default = uci:get_bool("network", "mesh_wan", "auto") and o.enabled or o.disabled
o.rmempty = false o.rmempty = false
if sysconfig.lan_ifname then
o = s:option(Flag, "mesh_lan", translate("Enable meshing on the LAN interface"))
o.default = uci:get_bool("network", "mesh_lan", "auto") and o.enabled or o.disabled
o.rmempty = false
end
function f.handle(self, state, data) function f.handle(self, state, data)
if state == FORM_VALID then if state == FORM_VALID then
uci:set("network", "wan", "proto", data.ipv4) uci:set("network", "wan", "proto", data.ipv4)
@ -112,6 +118,16 @@ function f.handle(self, state, data)
uci:set("network", "mesh_wan", "auto", data.mesh_wan) uci:set("network", "mesh_wan", "auto", data.mesh_wan)
if sysconfig.lan_ifname then
uci:set("network", "mesh_lan", "auto", data.mesh_lan)
if data.mesh_lan == '1' then
uci:set("network", "client", "ifname", "bat0")
else
uci:set("network", "client", "ifname", sysconfig.lan_ifname .. " bat0")
end
end
uci:save("network") uci:save("network")
uci:commit("network") uci:commit("network")

View File

@ -0,0 +1,32 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-05-04 02:08+0200\n"
"Last-Translator: <mschiffer@universe-factory.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "Automatic (DHCP)"
msgstr "Automatisch (DHCP)"
msgid "Automatic (RA/DHCPv6)"
msgstr "Automatisch (RA/DHCPv6)"
msgid "Enable meshing on the WAN interface"
msgstr "Mesh auf dem WAN-Port aktivieren"
msgid "Enable meshing on the LAN interface"
msgstr "Mesh auf dem LAN-Port aktivieren"
msgid "Static"
msgstr "Statisch"
msgid "Static DNS servers"
msgstr "Statische DNS-Server"
msgid "WAN connection"
msgstr "WAN-Verbindung"

View File

@ -0,0 +1,23 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Automatic (DHCP)"
msgstr ""
msgid "Automatic (RA/DHCPv6)"
msgstr ""
msgid "Enable meshing on the WAN interface"
msgstr ""
msgid "Enable meshing on the LAN interface"
msgstr ""
msgid "Static"
msgstr ""
msgid "Static DNS servers"
msgstr ""
msgid "WAN connection"
msgstr ""

View File

@ -1,12 +1,14 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-luci-private-wifi PKG_NAME:=gluon-luci-private-wifi
PKG_VERSION:=0.1 PKG_VERSION:=1
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-luci-private-wifi define Package/gluon-luci-private-wifi
SECTION:=gluon SECTION:=gluon
@ -23,10 +25,12 @@ define Build/Configure
endef endef
define Build/Compile define Build/Compile
$(call GluonBuildI18N,gluon-luci-private-wifi,i18n)
endef endef
define Package/gluon-luci-private-wifi/install define Package/gluon-luci-private-wifi/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-luci-private-wifi,$(1))
endef endef
$(eval $(call BuildPackage,gluon-luci-private-wifi)) $(eval $(call BuildPackage,gluon-luci-private-wifi))

View File

@ -1,5 +1,5 @@
module("luci.controller.admin.privatewifi", package.seeall) module("luci.controller.admin.privatewifi", package.seeall)
function index() function index()
entry({"admin", "privatewifi"}, cbi("admin/privatewifi"), "Privates WLAN", 10) entry({"admin", "privatewifi"}, cbi("admin/privatewifi"), _("Private WLAN"), 10)
end end

View File

@ -6,26 +6,26 @@ local config = 'wireless'
local primary_iface = 'wan_radio0' local primary_iface = 'wan_radio0'
local ssid = uci:get(config, primary_iface, "ssid") local ssid = uci:get(config, primary_iface, "ssid")
f = SimpleForm("wifi", "Privates WLAN") f = SimpleForm("wifi", translate("Private WLAN"))
f.reset = false
f.template = "admin/expertmode" f.template = "admin/expertmode"
f.submit = "Fertig"
s = f:section(SimpleSection, nil, [[ s = f:section(SimpleSection, nil, translate(
Dein Freifunk-Router kann ebenfalls die Reichweite deines privaten Netzes erweitern. 'Your node can additionally extend your private network by bridging the WAN interface '
Hierfür wird der WAN-Port mit einem seperaten WLAN gebridged. .. 'with a seperate WLAN. This feature is completely independent of the mesh functionality. '
Diese Funktionalität ist völlig unabhängig von Freifunk. .. 'Please note that the private WLAN and meshing on the WAN interface should not be enabled '
Beachte, dass du nicht gleichzeitig das Meshen über den WAN Port aktiviert haben solltest. .. 'at the same time.'
]]) ))
o = s:option(Flag, "enabled", "Aktiviert") o = s:option(Flag, "enabled", translate("Enabled"))
o.default = (ssid and not uci:get_bool(config, primary_iface, "disabled")) and o.enabled or o.disabled o.default = (ssid and not uci:get_bool(config, primary_iface, "disabled")) and o.enabled or o.disabled
o.rmempty = false o.rmempty = false
o = s:option(Value, "ssid", "Name (SSID)") o = s:option(Value, "ssid", translate("Name (SSID)"))
o:depends("enabled", '1')
o.default = ssid o.default = ssid
o = s:option(Value, "key", "Schlüssel", "8-63 Zeichen") o = s:option(Value, "key", translate("Key"), translate("8-63 characters"))
o:depends("enabled", '1')
o.datatype = "wpakey" o.datatype = "wpakey"
o.default = uci:get(config, primary_iface, "key") o.default = uci:get(config, primary_iface, "key")
@ -38,20 +38,20 @@ function f.handle(self, state, data)
if data.enabled == '1' then if data.enabled == '1' then
-- set up WAN wifi-iface -- set up WAN wifi-iface
local t = uci:get_all(config, name) or {} uci:section(config, "wifi-iface", name,
{
t.device = device device = device,
t.network = "wan" network = "wan",
t.mode = 'ap' mode = 'ap',
t.encryption = 'psk2' encryption = 'psk2',
t.ssid = data.ssid ssid = data.ssid,
t.key = data.key key = data.key,
t.disabled = "false" disabled = 0,
}
uci:section(config, "wifi-iface", name, t) )
else else
-- disable WAN wifi-iface -- disable WAN wifi-iface
uci:set(config, name, "disabled", "true") uci:set(config, name, "disabled", 1)
end end
end) end)

View File

@ -0,0 +1,32 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-05-04 02:25+0200\n"
"Last-Translator: <mschiffer@universe-factory.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "8-63 characters"
msgstr "8-63 Zeichen"
msgid "Name (SSID)"
msgstr "Name (SSID)"
msgid "Private WLAN"
msgstr "Privates WLAN"
msgid ""
"Your node can additionally extend your private network by bridging the WAN "
"interface with a seperate WLAN. This feature is completely independent of "
"the mesh functionality. Please note that the private WLAN and meshing on the "
"WAN interface should not be enabled at the same time."
msgstr ""
"Dein Knoten kann zusätzlich die Reichweite deines privaten Netzes erweitern. "
"Hierfür wird der WAN-Port mit einem seperaten WLAN gebridged. Diese "
"Funktionalität ist völlig unabhängig von den Mesh-Funktionen des Knotens. "
"Beachte, dass du nicht gleichzeitig das Meshen über den WAN-Port aktiviert "
"haben solltest."

View File

@ -0,0 +1,18 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "8-63 characters"
msgstr ""
msgid "Name (SSID)"
msgstr ""
msgid "Private WLAN"
msgstr ""
msgid ""
"Your node can additionally extend your private network by bridging the WAN "
"interface with a seperate WLAN. This feature is completely independent of "
"the mesh functionality. Please note that the private WLAN and meshing on the "
"WAN interface should not be enabled at the same time."
msgstr ""

View File

@ -20,7 +20,6 @@ $Id$
local hostname = sys.hostname() local hostname = sys.hostname()
local release = fs.readfile("/lib/gluon/release") local release = fs.readfile("/lib/gluon/release")
local load1, load5, load15 = sys.loadavg()
local request = disp.context.path local request = disp.context.path
local request2 = disp.context.request local request2 = disp.context.request

File diff suppressed because one or more lines are too long

View File

@ -325,7 +325,6 @@ textarea#syslog {
.cbi-section legend { .cbi-section legend {
font-size: 1.4em; font-size: 1.4em;
font-weight: bold; font-weight: bold;
color: $ffmagenta;
position: relative; position: relative;
padding: 0; padding: 0;
margin-bottom: 0.5em; margin-bottom: 0.5em;
@ -438,6 +437,7 @@ img.cbi-image-button {
input.cbi-button { input.cbi-button {
@include button; @include button;
margin-left: 0.5em;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
@ -565,11 +565,6 @@ textarea {
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
form > div > input[type=submit],
form > div > input[type=reset] {
margin-left: 0.5em;
}
table td, table td,
table th { table th {
color: #000000; color: #000000;
@ -653,6 +648,21 @@ div.cbi-value-field {
} }
} }
div.cbi-value-field-long {
flex: 10;
position: relative;
input, select, input + label {
position: relative;
top: -0.39em;
}
}
div.cbi-value-field-long-after {
flex: 2;
}
div.cbi-value-description { div.cbi-value-description {
font-size: 8pt; font-size: 8pt;
} }

View File

@ -0,0 +1,36 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-luci-wifi-config
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-luci-wifi-config
SECTION:=gluon
CATEGORY:=Gluon
DEPENDS:=+gluon-luci-admin +libiwinfo-lua
TITLE:=UI for Wifi Settings
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
$(call GluonBuildI18N,gluon-luci-wifi-config,i18n)
endef
define Package/gluon-luci-wifi-config/install
$(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-luci-wifi-config,$(1))
endef
$(eval $(call BuildPackage,gluon-luci-wifi-config))

View File

@ -0,0 +1,5 @@
module("luci.controller.admin.wifi-config", package.seeall)
function index()
entry({"admin", "wifi-config"}, cbi("admin/wifi-config"), _("WLAN"), 20)
end

View File

@ -0,0 +1,150 @@
local uci = luci.model.uci.cursor()
local fs = require 'nixio.fs'
local iwinfo = require 'iwinfo'
local function find_phy_by_path(path)
for phy in fs.glob("/sys/devices/" .. path .. "/ieee80211/phy*") do
return phy:match("([^/]+)$")
end
end
local function find_phy_by_macaddr(macaddr)
local addr = macaddr:lower()
for file in fs.glob("/sys/class/ieee80211/*/macaddress") do
if luci.util.trim(fs.readfile(file)) == addr then
return file:match("([^/]+)/macaddress$")
end
end
end
local function txpower_list(phy)
local list = iwinfo.nl80211.txpwrlist(phy) or { }
local off = tonumber(iwinfo.nl80211.txpower_offset(phy)) or 0
local new = { }
local prev = -1
local _, val
for _, val in ipairs(list) do
local dbm = val.dbm + off
local mw = math.floor(10 ^ (dbm / 10))
if mw ~= prev then
prev = mw
table.insert(new, {
display_dbm = dbm,
display_mw = mw,
driver_dbm = val.dbm,
})
end
end
return new
end
local f = SimpleForm("wifi", translate("WLAN"))
f.template = "admin/expertmode"
local s = f:section(SimpleSection, nil, translate(
"You can enable or disable your node's client and mesh network "
.. "SSIDs here. Please don't disable the mesh network without "
.. "a good reason, so other nodes can mesh with yours.<br /><br />"
.. "It is also possible to configure the WLAN adapters transmission power "
.. "here. Please note that the transmission power values include the antenna gain "
.. "where available, but there are many devices for which the gain is unavailable or inaccurate."
))
local radios = {}
-- look for wifi interfaces and add them to the array
uci:foreach('wireless', 'wifi-device',
function(s)
table.insert(radios, s['.name'])
end
)
-- add a client and mesh checkbox for each interface
for _, radio in ipairs(radios) do
local config = uci:get_all('wireless', radio)
local p
if config.hwmode == '11g' or config.hwmode == '11ng' then
p = f:section(SimpleSection, translate("2.4GHz WLAN"))
elseif config.hwmode == '11a' or config.hwmode == '11na' then
p = f:section(SimpleSection, translate("5GHz WLAN"))
end
if p then
local o
--box for the client network
o = p:option(Flag, radio .. '_client_enabled', translate("Enable client network"))
o.default = uci:get_bool('wireless', 'client_' .. radio, "disabled") and o.disabled or o.enabled
o.rmempty = false
--box for the mesh network
o = p:option(Flag, radio .. '_mesh_enabled', translate("Enable mesh network"))
o.default = uci:get_bool('wireless', 'mesh_' .. radio, "disabled") and o.disabled or o.enabled
o.rmempty = false
local phy
if config.path then
phy = find_phy_by_path(config.path)
elseif config.macaddr then
phy = find_phy_by_path(config.macaddr)
end
if phy then
local txpowers = txpower_list(phy)
if #txpowers > 1 then
local tp = p:option(ListValue, radio .. '_txpower', translate("Transmission power"))
tp.rmempty = true
tp.default = uci:get('wireless', radio, 'txpower') or 'default'
tp:value('default', translate("(default)"))
table.sort(txpowers, function(a, b) return a.driver_dbm > b.driver_dbm end)
for _, entry in ipairs(txpowers) do
tp:value(entry.driver_dbm, "%i dBm (%i mW)" % {entry.display_dbm, entry.display_mw})
end
end
end
end
end
--when the save-button is pushed
function f.handle(self, state, data)
if state == FORM_VALID then
for _, radio in ipairs(radios) do
local clientdisabled = 0
if data[radio .. '_client_enabled'] == '0' then
clientdisabled = 1
end
uci:set('wireless', 'client_' .. radio, "disabled", clientdisabled)
local meshdisabled = 0
if data[radio .. '_mesh_enabled'] == '0' then
meshdisabled = 1
end
uci:set('wireless', 'mesh_' .. radio, "disabled", meshdisabled)
if data[radio .. '_txpower'] then
if data[radio .. '_txpower'] == 'default' then
uci:delete('wireless', radio, 'txpower')
else
uci:set('wireless', radio, 'txpower', data[radio .. '_txpower'])
end
end
end
uci:save('wireless')
uci:commit('wireless')
end
end
return f

View File

@ -0,0 +1,46 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-05-04 02:54+0200\n"
"Last-Translator: <mschiffer@universe-factory.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "(default)"
msgstr "(Standard)"
msgid "2.4GHz WLAN"
msgstr "2,4GHz-WLAN"
msgid "5GHz WLAN"
msgstr "5GHz-WLAN"
msgid "Enable client network"
msgstr "Client-Netz aktivieren"
msgid "Enable mesh network"
msgstr "Mesh-Netz aktivieren"
msgid "Transmission power"
msgstr "Sendeleistung"
msgid ""
"You can enable or disable your node's client and mesh network SSIDs here. "
"Please don't disable the mesh network without a good reason, so other nodes "
"can mesh with yours.<br /><br />It is also possible to configure the WLAN "
"adapters transmission power here. Please note that the transmission power "
"values include the antenna gain where available, but there are many devices "
"for which the gain is unavailable or inaccurate."
msgstr ""
"In diesem Abschnitt hast du die Möglichkeit, die SSIDs des Client- und "
"des Mesh-Netzes zu aktivieren bzw. deaktivieren. Bitte lass die SSID des "
"Mesh-Netzes aktiviert, damit sich andere Knoten mit deinem verbinden "
"können.<br /><br />"
"Außerdem kann hier die Sendeleistung des WLAN-Adapters konfiguriert werden. "
"Wenn möglich, ist in den Werten der Sendeleistung der Antennengewinn "
"enthalten; diese Werte sind allerdings für viele Geräte nicht verfügbar oder "
"fehlerhaft."

View File

@ -0,0 +1,29 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "(default)"
msgstr ""
msgid "2.4GHz WLAN"
msgstr ""
msgid "5GHz WLAN"
msgstr ""
msgid "Enable client network"
msgstr ""
msgid "Enable mesh network"
msgstr ""
msgid "Transmission power"
msgstr ""
msgid ""
"You can enable or disable your node's client and mesh network SSIDs here. "
"Please don't disable the mesh network without a good reason, so other nodes "
"can mesh with yours.<br /><br />It is also possible to configure the WLAN "
"adapters transmission power here. Please note that the transmission power "
"values include the antenna gain where available, but there are many devices "
"for which the gain is unavailable or inaccurate."
msgstr ""

View File

@ -11,7 +11,7 @@ define Package/gluon-mesh-batman-adv-core
SECTION:=gluon SECTION:=gluon
CATEGORY:=Gluon CATEGORY:=Gluon
TITLE:=Support for batman-adv meshing (core) TITLE:=Support for batman-adv meshing (core)
DEPENDS:=+gluon-core +firewall +kmod-ipt-nathelper +libiwinfo-lua DEPENDS:=+gluon-core +firewall +libiwinfo-lua
endef endef
define Build/Prepare define Build/Prepare

View File

@ -8,8 +8,9 @@ for _, config in ipairs({'wifi24', 'wifi5'}) do
need_string_match(config .. '.mesh_bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$') need_string_match(config .. '.mesh_bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$')
need_number(config .. '.mesh_mcast_rate') need_number(config .. '.mesh_mcast_rate')
need_number(config .. '.mesh_vlan', false) need_number(config .. '.mesh_vlan', false)
need_number(config .. '.client_disabled', false) need_boolean(config .. '.client_disabled', false)
need_number(config .. '.mesh_disabled', false) need_boolean(config .. '.mesh_disabled', false)
end end
need_boolean('mesh_on_wan', false) need_boolean('mesh_on_wan', false)
need_boolean('mesh_on_lan', false)

View File

@ -0,0 +1,52 @@
local list = util.exec('batctl if')
local wireless = {}
local tunnel = {}
local other = {}
local function get_address(t, ifname)
pcall(
function()
table.insert(t, util.trim(fs.readfile('/sys/class/net/' .. ifname .. '/address')))
end
)
end
local function is_wireless(ifname)
local type = fs.stat('/sys/class/net/' .. ifname .. '/wireless', 'type')
return type == 'directory'
end
local function is_tuntap(ifname)
local type = fs.stat('/sys/class/net/' .. ifname .. '/tun_flags', 'type')
return type == 'regular'
end
local function nil_table(t)
if next(t) ~= nil then
return t
else
return nil
end
end
for _, line in ipairs(util.split(list)) do
local ifname = line:match('^(.-):')
if ifname ~= nil then
if is_wireless(ifname) then
get_address(wireless, ifname)
elseif is_tuntap(ifname) then
get_address(tunnel, ifname)
else
get_address(other, ifname)
end
end
end
return {
wireless = nil_table(wireless),
tunnel = nil_table(tunnel),
other = nil_table(other)
}

View File

@ -2,6 +2,7 @@
local sysconfig = require 'gluon.sysconfig' local sysconfig = require 'gluon.sysconfig'
local sysctl = require 'gluon.sysctl' local sysctl = require 'gluon.sysctl'
local site = require 'gluon.site_config'
local uci = require('luci.model.uci').cursor() local uci = require('luci.model.uci').cursor()
@ -10,6 +11,7 @@ uci:section('batman-adv', 'mesh', 'bat0',
{ {
orig_interval = 5000, orig_interval = 5000,
gw_mode = 'client', gw_mode = 'client',
hop_penalty = 15,
multicast_mode = 0, multicast_mode = 0,
} }
) )
@ -20,7 +22,7 @@ uci:commit('batman-adv')
if not uci:get('network', 'client') then if not uci:get('network', 'client') then
local ifname local ifname
if sysconfig.lan_ifname then if sysconfig.lan_ifname and not site.mesh_on_lan then
ifname = sysconfig.lan_ifname .. ' bat0' ifname = sysconfig.lan_ifname .. ' bat0'
else else
ifname = 'bat0' ifname = 'bat0'

View File

@ -0,0 +1,32 @@
#!/usr/bin/lua
local site = require 'gluon.site_config'
local util = require 'gluon.util'
local sysconfig = require 'gluon.sysconfig'
local uci = require('luci.model.uci').cursor()
local lutil = require 'luci.util'
if sysconfig.lan_ifname and not uci:get('network', 'mesh_lan') then
local enable = site.mesh_on_lan
if enable then
local interfaces = uci:get('network', 'client', 'ifname')
if interfaces and lutil.contains(interfaces:split(' '), sysconfig.lan_ifname) then
enable = false
end
end
uci:section('network', 'interface', 'mesh_lan',
{ ifname = sysconfig.lan_ifname
, proto = 'batadv'
, mesh = 'bat0'
, macaddr = util.generate_mac(1, 1)
, auto = enable and 1 or 0
})
uci:save('network')
uci:commit('network')
end

View File

@ -1,14 +1,26 @@
need_string_array 'fastd_mesh_vpn.methods' need_string_array('fastd_mesh_vpn.methods')
need_number 'fastd_mesh_vpn.mtu' need_number('fastd_mesh_vpn.mtu')
need_number 'fastd_mesh_vpn.backbone.limit' need_boolean('fastd_mesh_vpn.enabled', false)
need_boolean('fastd_mesh_vpn.configurable', false)
local function check_peer(k, _) local function check_peer(prefix)
local prefix = string.format('fastd_mesh_vpn.backbone.peers[%q].', k) return function(k, _)
local table = string.format('%s[%q].', prefix, k)
need_string(prefix .. 'key') need_string(table .. 'key')
need_string_array(prefix .. 'remotes') need_string_array(table .. 'remotes')
end
end end
need_table('fastd_mesh_vpn.backbone.peers', check_peer) local function check_group(prefix)
need_boolean('fastd_mesh_vpn.enabled', false) return function(k, _)
local table = string.format('%s[%q].', prefix, k)
need_number(table .. 'limit', false)
need_table(table .. 'peers', check_peer(table .. 'peers'), false)
need_table(table .. 'groups', check_group(table .. 'groups'), false)
end
end
need_table('fastd_mesh_vpn.groups', check_group('fastd_mesh_vpn.groups'))

View File

@ -1,32 +1,71 @@
local nixio = require('nixio') local json = require 'luci.json'
local ltn12 = require('luci.ltn12') local ltn12 = require 'luci.ltn12'
local json = require('luci.json') local nixio = require 'nixio'
local site = require 'gluon.site_config'
local uci = require('luci.model.uci').cursor() local uci = require('luci.model.uci').cursor()
local socket_path = uci:get('fastd', 'mesh_vpn', 'status_socket')
local fastd_sock = nixio.socket('unix', 'stream') local fastd_sock = nixio.socket('unix', 'stream')
local socket_path = uci:get('fastd', 'mesh_vpn', 'status_socket')
if not fastd_sock:connect(socket_path) then if not fastd_sock:connect(socket_path) then
return nil return nil
end end
decoder = json.Decoder() local decoder = json.Decoder()
ltn12.pump.all(ltn12.source.file(fastd_sock), decoder:sink()) ltn12.pump.all(ltn12.source.file(fastd_sock), decoder:sink())
local status = decoder:get() local status = decoder:get()
local output = {}
for key, peer in pairs(status.peers) do local peer_groups
local name, valid = peer.name:gsub('^mesh_vpn_backbone_peer_', '')
if valid == 1 then local function peer_connection(config)
local peer = status.peers[config.key]
if peer then
if peer.connection then if peer.connection then
output[name] = {} return {
output[name].established = peer.connection.established/1000 established = peer.connection.established/1000
}
else else
output[name] = json.null return json.null
end end
end end
end end
return output local function peer_group(config)
local ret = {}
if config.peers then
local peers = {}
for peername, peerconfig in pairs(config.peers) do
peers[peername] = peer_connection(peerconfig)
end
if next(peers) then
ret.peers = peers
end
end
ret.groups = peer_groups(config.groups)
if next(ret) then
return ret
end
end
function peer_groups(groups)
if groups then
local ret = {}
for name, group in pairs(groups) do
ret[name] = peer_group(group)
end
if next(ret) then
return ret
end
end
end
return peer_group(site.fastd_mesh_vpn)

View File

@ -5,6 +5,7 @@ local users = require 'gluon.users'
local util = require 'gluon.util' local util = require 'gluon.util'
local uci = require('luci.model.uci').cursor() local uci = require('luci.model.uci').cursor()
local lutil = require 'luci.util'
-- The previously used user is removed, we need root privileges to use the packet_mark option -- The previously used user is removed, we need root privileges to use the packet_mark option
@ -20,6 +21,33 @@ if not enabled then
end end
local methods
if site.fastd_mesh_vpn.configurable then
local has_null = lutil.contains(site.fastd_mesh_vpn.methods, 'null')
local old_methods = uci:get('fastd', 'mesh_vpn', 'method')
if old_methods then
has_null = lutil.contains(old_methods, 'null')
end
methods = {}
if has_null then
table.insert(methods, 'null')
end
for _, method in ipairs(site.fastd_mesh_vpn.methods) do
if method ~= 'null' then
table.insert(methods, method)
end
end
else
methods = site.fastd_mesh_vpn.methods
end
uci:section('fastd', 'fastd', 'mesh_vpn', uci:section('fastd', 'fastd', 'mesh_vpn',
{ {
enabled = enabled, enabled = enabled,
@ -29,40 +57,67 @@ uci:section('fastd', 'fastd', 'mesh_vpn',
mode = 'tap', mode = 'tap',
mtu = site.fastd_mesh_vpn.mtu, mtu = site.fastd_mesh_vpn.mtu,
secure_handshakes = 1, secure_handshakes = 1,
method = site.fastd_mesh_vpn.methods, method = methods,
packet_mark = 1, packet_mark = 1,
status_socket = '/var/run/fastd.mesh_vpn.socket', status_socket = '/var/run/fastd.mesh_vpn.socket',
} }
) )
uci:delete('fastd', 'mesh_vpn', 'user') uci:delete('fastd', 'mesh_vpn', 'user')
uci:delete('fastd', 'mesh_vpn_backbone')
uci:section('fastd', 'peer_group', 'mesh_vpn_backbone',
{
enabled = 1,
net = 'mesh_vpn',
peer_limit = site.fastd_mesh_vpn.backbone.limit,
}
)
uci:delete_all('fastd', 'peer', local add_groups
function(peer)
return peer.net == 'mesh_vpn' and peer.group == 'mesh_vpn_backbone'
end
)
for name, config in pairs(site.fastd_mesh_vpn.backbone.peers) do local function add_peer(group, name, config)
uci:section('fastd', 'peer', 'mesh_vpn_backbone_peer_' .. name, uci:section('fastd', 'peer', group .. '_peer_' .. name,
{ {
enabled = 1, enabled = 1,
net = 'mesh_vpn', net = 'mesh_vpn',
group = 'mesh_vpn_backbone', group = group,
key = config.key, key = config.key,
remote = config.remotes, remote = config.remotes,
} }
) )
end end
local function add_group(name, config, parent)
uci:delete('fastd', name)
uci:delete_all('fastd', 'peer',
function(peer)
return (peer.net == 'mesh_vpn' and peer.group == name)
end
)
uci:section('fastd', 'peer_group', name,
{
enabled = 1,
net = 'mesh_vpn',
parent = parent,
peer_limit = config.limit,
}
)
if config.peers then
for peername, peerconfig in pairs(config.peers) do
add_peer(name, peername, peerconfig)
end
end
add_groups(name, config.groups, name)
end
-- declared local above
function add_groups(prefix, groups, parent)
if groups then
for name, group in pairs(groups) do
add_group(prefix .. '_' .. name, group, parent)
end
end
end
add_groups('mesh_vpn', site.fastd_mesh_vpn.groups)
uci:save('fastd') uci:save('fastd')
uci:commit('fastd') uci:commit('fastd')

View File

@ -1,8 +1 @@
local function check_role(k, _)
local role = string.format('roles.list[%q]', k)
need_string(role)
end
need_string('roles.default', false) need_string('roles.default', false)
need_table('roles.list', check_role, false)

View File

@ -26,6 +26,7 @@ prepare_config() {
uci_add network interface setup uci_add network interface setup
uci_set network setup ifname "$(lua -e 'print(require("gluon.sysconfig").setup_ifname)')" uci_set network setup ifname "$(lua -e 'print(require("gluon.sysconfig").setup_ifname)')"
uci_set network setup macaddr "$(lua -e 'print(require("gluon.sysconfig").primary_mac)')"
uci_set network setup type 'bridge' uci_set network setup type 'bridge'
uci_set network setup proto 'static' uci_set network setup proto 'static'
uci_set network setup ipaddr "$SETUP_MODE_ADDR" uci_set network setup ipaddr "$SETUP_MODE_ADDR"
@ -45,6 +46,7 @@ init_switch() {
start_service() { start_service() {
prepare_config prepare_config
init_switch init_switch
iw reg set "$(lua -e 'print(require("gluon.site_config").regdom)')"
procd_open_instance procd_open_instance
procd_set_param command /sbin/netifd -c /var/gluon/setup-mode/config procd_set_param command /sbin/netifd -c /var/gluon/setup-mode/config

View File

@ -5,7 +5,7 @@ PKG_VERSION:=$(if $(GLUON_SITE_CODE),$(GLUON_SITE_CODE),1)
PKG_RELEASE:=$(GLUON_RELEASE) PKG_RELEASE:=$(GLUON_RELEASE)
PKG_FILE_DEPENDS := $(GLUON_SITEDIR)/ PKG_FILE_DEPENDS := $(GLUON_SITEDIR)/
PKG_BUILD_DEPENDS := luci PKG_BUILD_DEPENDS := luci-base/host
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

View File

@ -1,7 +1,7 @@
#!/usr/bin/lua #!/usr/bin/lua
local util = require("luci.util") local util = require("luci.util")
local fs = require("luci.fs") local fs = require("nixio.fs")
local ltn12 = require 'luci.ltn12' local ltn12 = require 'luci.ltn12'
local sys = require("luci.sys") local sys = require("luci.sys")
local json = require("luci.json") local json = require("luci.json")
@ -22,9 +22,23 @@ function neighbours(ifname)
for _, line in ipairs(util.split(info)) do for _, line in ipairs(util.split(info)) do
local data = json.decode(line) local data = json.decode(line)
if data then if data then
if data["network"] and data["network"]["mesh_interfaces"] then local function add_macs(list)
for _, mac in ipairs(data["network"]["mesh_interfaces"]) do if list then
macs[mac] = data for _, mac in ipairs(list) do
macs[mac] = data
end
end
end
if data["network"] then
add_macs(data["network"]["mesh_interfaces"])
if data["network"]["mesh"] and data["network"]["mesh"]["bat0"] and
data["network"]["mesh"]["bat0"]["interfaces"] then
local interfaces = data["network"]["mesh"]["bat0"]["interfaces"]
add_macs(interfaces["other"])
add_macs(interfaces["wireless"])
add_macs(interfaces["tunnel"])
end end
end end
end end

View File

@ -3,10 +3,10 @@ Date: Sat, 26 Jul 2014 06:10:23 +0200
Subject: tools/Makefile: fix host tools build dependencies Subject: tools/Makefile: fix host tools build dependencies
diff --git a/tools/Makefile b/tools/Makefile diff --git a/tools/Makefile b/tools/Makefile
index 13bb028..137ad61 100644 index 2f516d2..9416069 100644
--- a/tools/Makefile --- a/tools/Makefile
+++ b/tools/Makefile +++ b/tools/Makefile
@@ -97,10 +97,16 @@ define PrepareStaging @@ -95,10 +95,16 @@ define PrepareStaging
endef endef
# preparatory work # preparatory work
@ -23,32 +23,14 @@ index 13bb028..137ad61 100644
$(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
$(call PrepareStaging,$(STAGING_DIR_HOST)) $(call PrepareStaging,$(STAGING_DIR_HOST))
@@ -112,7 +118,7 @@ $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build @@ -110,8 +116,8 @@ $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
define PrepareCommand
-$(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
+$(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR_HOST)/.prepared
@mkdir -p "$$(dir $$@)"; rm -f "$$@"
@export FILE="$$$$(which $(2) 2>/dev/null | grep -v 'not found' | head -n1)"; [ -n "$$$$FILE" ] || { \
echo "Command $(1) not found."; false; \
@@ -121,7 +127,7 @@ $(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
endef
endif endif
-$(STAGING_DIR_HOST)/bin/stat: $(STAGING_DIR)/.prepared -$(curdir)//prepare = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared
+$(STAGING_DIR_HOST)/bin/stat: $(STAGING_DIR_HOST)/.prepared -$(curdir)//compile = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared
@rm -f $@ +$(curdir)//prepare = $(staging_prepared) $(STAGING_DIR_HOST)/.prepared
@if stat --version > /dev/null 2>&1; then \ +$(curdir)//compile = $(staging_prepared) $(STAGING_DIR_HOST)/.prepared
ln -s `which stat` $@; \
@@ -145,8 +151,8 @@ $(eval $(call PrepareCommand,tar,gtar tar))
$(eval $(call PrepareCommand,diff,gdiff diff))
$(curdir)/cmddeps = $(patsubst %,$(STAGING_DIR_HOST)/bin/%,md5sum cp stat seq python awk getopt grep tar diff)
-$(curdir)//prepare = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
-$(curdir)//compile = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
+$(curdir)//prepare = $(staging_prepared) $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
+$(curdir)//compile = $(staging_prepared) $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
# prerequisites for the individual targets # prerequisites for the individual targets
$(curdir)/ := .config prereq $(curdir)/ := .config prereq

View File

@ -1,31 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sat, 16 Aug 2014 17:52:34 +0200
Subject: ar71xx: correctly detect hardware revision on TP-Link Archer C5 and C7
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 18da356..1709356 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -214,6 +214,13 @@ tplink_board_detect() {
"934100"*)
model="NC-LINK SMART-300"
;;
+ "c50000"*)
+ model="TP-Link Archer C5"
+ ;;
+ "750000"*|\
+ "c70000"*)
+ model="TP-Link Archer C7"
+ ;;
*)
hwver=""
;;
@@ -748,7 +755,7 @@ ar71xx_board_detect() {
esac
case "$machine" in
- *TL-WR* | *TL-WA* | *TL-MR* | *TL-WD*)
+ *TL-WR* | *TL-WA* | *TL-MR* | *TL-WD* | *Archer*)
tplink_board_detect "$machine"
;;
esac

View File

@ -0,0 +1,31 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 13 Nov 2014 01:17:24 +0100
Subject: odhcp6c: always accept RDNSS, independent of the default router lifetime
diff --git a/package/network/ipv6/odhcp6c/patches/001-always_accept_rdnss.patch b/package/network/ipv6/odhcp6c/patches/001-always_accept_rdnss.patch
new file mode 100644
index 0000000..cb694ca
--- /dev/null
+++ b/package/network/ipv6/odhcp6c/patches/001-always_accept_rdnss.patch
@@ -0,0 +1,21 @@
+--- a/src/ra.c
++++ b/src/ra.c
+@@ -438,18 +438,6 @@ bool ra_process(void)
+ }
+ }
+ }
+-
+- int states[2] = {STATE_RA_DNS, STATE_RA_SEARCH};
+- for (size_t i = 0; i < 2; ++i) {
+- size_t ra_dns_len;
+- uint8_t *start = odhcp6c_get_state(states[i], &ra_dns_len);
+- for (struct odhcp6c_entry *c = (struct odhcp6c_entry*)start;
+- (uint8_t*)c < &start[ra_dns_len] && &c->auxtarget[c->auxlen] <= &start[ra_dns_len];
+- c = (struct odhcp6c_entry*)(&c->auxtarget[c->auxlen]))
+- if (IN6_ARE_ADDR_EQUAL(&c->router, &from.sin6_addr) &&
+- c->valid > router_valid)
+- c->valid = router_valid;
+- }
+ }
+
+ if (found)

View File

@ -1,26 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 13 Nov 2014 01:17:24 +0100
Subject: odhcp6c: always accept RDNSS, independent of the default router lifetime
diff --git a/package/network/ipv6/odhcp6c/patches/001-always_accept_rdnss.patch b/package/network/ipv6/odhcp6c/patches/001-always_accept_rdnss.patch
new file mode 100644
index 0000000..ae4e18d
--- /dev/null
+++ b/package/network/ipv6/odhcp6c/patches/001-always_accept_rdnss.patch
@@ -0,0 +1,16 @@
+--- a/src/ra.c
++++ b/src/ra.c
+@@ -409,13 +409,6 @@ bool ra_process(void)
+ }
+ }
+ }
+-
+- size_t ra_dns_len;
+- struct odhcp6c_entry *entry = odhcp6c_get_state(STATE_RA_DNS, &ra_dns_len);
+- for (size_t i = 0; i < ra_dns_len / sizeof(*entry); ++i)
+- if (IN6_ARE_ADDR_EQUAL(&entry[i].router, &from.sin6_addr) &&
+- entry[i].valid > router_valid)
+- entry[i].valid = router_valid;
+ }
+
+ if (found)

View File

@ -3,10 +3,10 @@ Date: Tue, 10 Mar 2015 13:17:14 +0100
Subject: ath10k: add Candelatech community firmware as an additional choice Subject: ath10k: add Candelatech community firmware as an additional choice
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 629692d..d77842a 100644 index 2a40bb1..17dbe03 100644
--- a/package/kernel/mac80211/Makefile --- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile
@@ -605,6 +605,14 @@ This module adds support for wireless adapters based on @@ -604,6 +604,14 @@ This module adds support for wireless adapters based on
Atheros USB AR9271 and AR7010 family of chipsets. Atheros USB AR9271 and AR7010 family of chipsets.
endef endef
@ -21,7 +21,7 @@ index 629692d..d77842a 100644
define KernelPackage/ath10k define KernelPackage/ath10k
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=Atheros 802.11ac wireless cards support TITLE:=Atheros 802.11ac wireless cards support
@@ -625,13 +633,31 @@ endef @@ -624,13 +632,31 @@ endef
define KernelPackage/ath10k/config define KernelPackage/ath10k/config
if PACKAGE_kmod-ath10k if PACKAGE_kmod-ath10k
@ -55,14 +55,14 @@ index 629692d..d77842a 100644
endif endif
endef endef
@@ -1824,14 +1850,20 @@ define KernelPackage/ath10k/install @@ -1858,14 +1884,20 @@ define KernelPackage/ath10k/install
$(INSTALL_DATA) \ $(INSTALL_DATA) \
$(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin \ $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/
+ifeq ($(CONFIG_ATH10K_AP_FW),y) +ifeq ($(CONFIG_ATH10K_AP_FW),y)
+ $(INSTALL_DATA) \ + $(INSTALL_DATA) \
+ $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2/firmware-3.bin_10.2-00082-4-2 \ + $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \
+ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-3.bin + $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin
+endif +endif
ifeq ($(CONFIG_ATH10K_STA_FW),y) ifeq ($(CONFIG_ATH10K_STA_FW),y)
$(INSTALL_DATA) \ $(INSTALL_DATA) \
@ -72,8 +72,8 @@ index 629692d..d77842a 100644
+endif +endif
+ifeq ($(CONFIG_ATH10K_CT_COMMUNITY_FW),y) +ifeq ($(CONFIG_ATH10K_CT_COMMUNITY_FW),y)
$(INSTALL_DATA) \ $(INSTALL_DATA) \
- $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2/firmware-3.bin_10.2-00082-4-2 \ - $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/10.2.4/firmware-4.bin_10.2.4.45 \
- $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-3.bin - $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-4.bin
+ $(DL_DIR)/$(ATH10K_CT_COMMUNITY_FW) \ + $(DL_DIR)/$(ATH10K_CT_COMMUNITY_FW) \
+ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin + $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
endif endif

View File

@ -1,570 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 26 Nov 2014 19:57:39 +0100
Subject: firmware-utils: add new tool tplink-safeloader for the new TP-LINK Pharos devices (CPE210/220/510/520)
The new TP-LINK Pharos series uses a new bootloader, the "TP-LINK Safeloader".
It uses an advanced firmware image format, containing an image partition table
and a flash partition table (and image partitions are mapped to the
corresponding flash partitions). The exact image format is documented in the
source code.
Furthermore, the bootloader expects the kernel image as an ELF executable.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile
index 4bb53cb..3f9eb56 100644
--- a/tools/firmware-utils/Makefile
+++ b/tools/firmware-utils/Makefile
@@ -41,6 +41,7 @@ define Host/Compile
$(call cc,mkplanexfw sha1)
$(call cc,mktplinkfw md5)
$(call cc,mktplinkfw2 md5)
+ $(call cc,tplink-safeloader md5, -Wall)
$(call cc,pc1crypt)
$(call cc,osbridge-crc)
$(call cc,wrt400n cyg_crc32)
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
new file mode 100644
index 0000000..23d703f
--- /dev/null
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -0,0 +1,538 @@
+/*
+ Copyright (c) 2014, Matthias Schiffer <mschiffer@universe-factory.net>
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+/*
+ tplink-safeloader
+
+ Image generation tool for the TP-LINK SafeLoader as seen on
+ TP-LINK Pharos devices (CPE210/220/510/520)
+*/
+
+
+#include <assert.h>
+#include <errno.h>
+#include <error.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <arpa/inet.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "md5.h"
+
+
+#define ALIGN(x,a) ({ typeof(a) __a = (a); (((x) + __a - 1) & ~(__a - 1)); })
+
+
+/** An image partition table entry */
+struct image_partition_entry {
+ const char *name;
+ size_t size;
+ uint8_t *data;
+};
+
+/** A flash partition table entry */
+struct flash_partition_entry {
+ const char *name;
+ uint32_t base;
+ uint32_t size;
+};
+
+
+/** The content of the soft-version structure */
+struct __attribute__((__packed__)) soft_version {
+ uint32_t magic;
+ uint32_t zero;
+ uint8_t pad1;
+ uint8_t version_major;
+ uint8_t version_minor;
+ uint8_t version_patch;
+ uint8_t year_hi;
+ uint8_t year_lo;
+ uint8_t month;
+ uint8_t day;
+ uint32_t rev;
+ uint8_t pad2;
+};
+
+
+static const uint8_t jffs2_eof_mark[4] = {0xde, 0xad, 0xc0, 0xde};
+
+
+/**
+ Salt for the MD5 hash
+
+ Fortunately, TP-LINK seems to use the same salt for most devices which use
+ the new image format.
+*/
+static const uint8_t md5_salt[16] = {
+ 0x7a, 0x2b, 0x15, 0xed,
+ 0x9b, 0x98, 0x59, 0x6d,
+ 0xe5, 0x04, 0xab, 0x44,
+ 0xac, 0x2a, 0x9f, 0x4e,
+};
+
+
+/** Vendor information for CPE210/220/510/520 */
+static const unsigned char cpe510_vendor[] = "\x00\x00\x00\x1f""CPE510(TP-LINK|UN|N300-5):1.0\r\n";
+
+
+/**
+ The flash partition table for CPE210/220/510/520;
+ it is the same as the one used by the stock images.
+*/
+static const struct flash_partition_entry cpe510_partitions[] = {
+ {"fs-uboot", 0x00000, 0x20000},
+ {"partition-table", 0x20000, 0x02000},
+ {"default-mac", 0x30000, 0x00020},
+ {"product-info", 0x31100, 0x00100},
+ {"signature", 0x32000, 0x00400},
+ {"os-image", 0x40000, 0x170000},
+ {"soft-version", 0x1b0000, 0x00100},
+ {"support-list", 0x1b1000, 0x00400},
+ {"file-system", 0x1c0000, 0x600000},
+ {"user-config", 0x7c0000, 0x10000},
+ {"default-config", 0x7d0000, 0x10000},
+ {"log", 0x7e0000, 0x10000},
+ {"radio", 0x7f0000, 0x10000},
+ {NULL, 0, 0}
+};
+
+/**
+ The support list for CPE210/220/510/520
+
+ The stock images also contain strings for two more devices: BS510 and BS210.
+ At the moment, there exists no public information about these devices.
+*/
+static const unsigned char cpe510_support_list[] =
+ "\x00\x00\x00\xc8\x00\x00\x00\x00"
+ "SupportList:\r\n"
+ "CPE510(TP-LINK|UN|N300-5):1.0\r\n"
+ "CPE520(TP-LINK|UN|N300-5):1.0\r\n"
+ "CPE210(TP-LINK|UN|N300-2):1.0\r\n"
+ "CPE220(TP-LINK|UN|N300-2):1.0\r\n"
+ "\r\n\xff";
+
+
+/** Allocates a new image partition */
+struct image_partition_entry alloc_image_partition(const char *name, size_t len) {
+ struct image_partition_entry entry = {name, len, malloc(len)};
+ if (!entry.data)
+ error(1, errno, "malloc");
+
+ return entry;
+}
+
+/** Frees an image partition */
+void free_image_partition(struct image_partition_entry entry) {
+ free(entry.data);
+}
+
+/** Generates the partition-table partition */
+struct image_partition_entry make_partition_table(const struct flash_partition_entry *p) {
+ struct image_partition_entry entry = alloc_image_partition("partition-table", 0x800);
+
+ char *s = (char *)entry.data, *end = (char *)(s+entry.size);
+
+ *(s++) = 0x00;
+ *(s++) = 0x04;
+ *(s++) = 0x00;
+ *(s++) = 0x00;
+
+ size_t i;
+ for (i = 0; p[i].name; i++) {
+ size_t len = end-s;
+ size_t w = snprintf(s, len, "partition %s base 0x%05x size 0x%05x\n", p[i].name, p[i].base, p[i].size);
+
+ if (w > len-1)
+ error(1, 0, "flash partition table overflow?");
+
+ s += w;
+ }
+
+ s++;
+
+ memset(s, 0xff, end-s);
+
+ return entry;
+}
+
+
+/** Generates a binary-coded decimal representation of an integer in the range [0, 99] */
+static inline uint8_t bcd(uint8_t v) {
+ return 0x10 * (v/10) + v%10;
+}
+
+
+/** Generates the soft-version partition */
+struct image_partition_entry make_soft_version(uint32_t rev) {
+ struct image_partition_entry entry = alloc_image_partition("soft-version", sizeof(struct soft_version));
+ struct soft_version *s = (struct soft_version *)entry.data;
+
+ time_t t;
+ if (time(&t) == (time_t)(-1))
+ error(1, errno, "time");
+
+ struct tm *tm = localtime(&t);
+
+ s->magic = htonl(0x0000000c);
+ s->zero = 0;
+ s->pad1 = 0xff;
+
+ s->version_major = 0;
+ s->version_minor = 0;
+ s->version_patch = 0;
+
+ s->year_hi = bcd((1900+tm->tm_year)/100);
+ s->year_lo = bcd(tm->tm_year%100);
+ s->month = bcd(tm->tm_mon+1);
+ s->day = bcd(tm->tm_mday);
+ s->rev = htonl(rev);
+
+ s->pad2 = 0xff;
+
+ return entry;
+}
+
+/** Generates the support-list partition */
+struct image_partition_entry make_support_list(const unsigned char *support_list, size_t len) {
+ struct image_partition_entry entry = alloc_image_partition("support-list", len);
+ memcpy(entry.data, support_list, len);
+ return entry;
+}
+
+/** Creates a new image partition with an arbitrary name from a file */
+struct image_partition_entry read_file(const char *part_name, const char *filename, bool add_jffs2_eof) {
+ struct stat statbuf;
+
+ if (stat(filename, &statbuf) < 0)
+ error(1, errno, "unable to stat file `%s'", filename);
+
+ size_t len = statbuf.st_size;
+
+ if (add_jffs2_eof)
+ len = ALIGN(len, 0x10000) + sizeof(jffs2_eof_mark);
+
+ struct image_partition_entry entry = alloc_image_partition(part_name, len);
+
+ FILE *file = fopen(filename, "rb");
+ if (!file)
+ error(1, errno, "unable to open file `%s'", filename);
+
+ if (fread(entry.data, statbuf.st_size, 1, file) != 1)
+ error(1, errno, "unable to read file `%s'", filename);
+
+ if (add_jffs2_eof) {
+ uint8_t *eof = entry.data + statbuf.st_size, *end = entry.data+entry.size;
+
+ memset(eof, 0xff, end - eof - sizeof(jffs2_eof_mark));
+ memcpy(end - sizeof(jffs2_eof_mark), jffs2_eof_mark, sizeof(jffs2_eof_mark));
+ }
+
+ fclose(file);
+
+ return entry;
+}
+
+
+/**
+ Copies a list of image partitions into an image buffer and generates the image partition table while doing so
+
+ Example image partition table:
+
+ fwup-ptn partition-table base 0x00800 size 0x00800
+ fwup-ptn os-image base 0x01000 size 0x113b45
+ fwup-ptn file-system base 0x114b45 size 0x1d0004
+ fwup-ptn support-list base 0x2e4b49 size 0x000d1
+
+ Each line of the partition table is terminated with the bytes 09 0d 0a ("\t\r\n"),
+ the end of the partition table is marked with a zero byte.
+
+ The firmware image must contain at least the partition-table and support-list partitions
+ to be accepted. There aren't any alignment constraints for the image partitions.
+
+ The partition-table partition contains the actual flash layout; partitions
+ from the image partition table are mapped to the corresponding flash partitions during
+ the firmware upgrade. The support-list partition contains a list of devices supported by
+ the firmware image.
+
+ The base offsets in the firmware partition table are relative to the end
+ of the vendor information block, so the partition-table partition will
+ actually start at offset 0x1814 of the image.
+
+ I think partition-table must be the first partition in the firmware image.
+*/
+void put_partitions(uint8_t *buffer, const struct image_partition_entry *parts) {
+ size_t i;
+ char *image_pt = (char *)buffer, *end = image_pt + 0x800;
+
+ size_t base = 0x800;
+ for (i = 0; parts[i].name; i++) {
+ memcpy(buffer + base, parts[i].data, parts[i].size);
+
+ size_t len = end-image_pt;
+ size_t w = snprintf(image_pt, len, "fwup-ptn %s base 0x%05x size 0x%05x\t\r\n", parts[i].name, (unsigned)base, (unsigned)parts[i].size);
+
+ if (w > len-1)
+ error(1, 0, "image partition table overflow?");
+
+ image_pt += w;
+
+ base += parts[i].size;
+ }
+
+ image_pt++;
+
+ memset(image_pt, 0xff, end-image_pt);
+}
+
+/** Generates and writes the image MD5 checksum */
+void put_md5(uint8_t *md5, uint8_t *buffer, unsigned int len) {
+ MD5_CTX ctx;
+
+ MD5_Init(&ctx);
+ MD5_Update(&ctx, md5_salt, (unsigned int)sizeof(md5_salt));
+ MD5_Update(&ctx, buffer, len);
+ MD5_Final(md5, &ctx);
+}
+
+
+/**
+ Generates the firmware image in factory format
+
+ Image format:
+
+ Bytes (hex) Usage
+ ----------- -----
+ 0000-0003 Image size (4 bytes, big endian)
+ 0004-0013 MD5 hash (hash of a 16 byte salt and the image data starting with byte 0x14)
+ 0014-1013 Vendor information (4096 bytes, padded with 0xff; there seem to be older
+ (VxWorks-based) TP-LINK devices which use a smaller vendor information block)
+ 1014-1813 Image partition table (2048 bytes, padded with 0xff)
+ 1814-xxxx Firmware partitions
+*/
+void * generate_factory_image(const unsigned char *vendor, size_t vendor_len, const struct image_partition_entry *parts, size_t *len) {
+ *len = 0x1814;
+
+ size_t i;
+ for (i = 0; parts[i].name; i++)
+ *len += parts[i].size;
+
+ uint8_t *image = malloc(*len);
+ if (!image)
+ error(1, errno, "malloc");
+
+ image[0] = *len >> 24;
+ image[1] = *len >> 16;
+ image[2] = *len >> 8;
+ image[3] = *len;
+
+ memcpy(image+0x14, vendor, vendor_len);
+ memset(image+0x14+vendor_len, 0xff, 4096-vendor_len);
+
+ put_partitions(image + 0x1014, parts);
+ put_md5(image+0x04, image+0x14, *len-0x14);
+
+ return image;
+}
+
+/**
+ Generates the firmware image in sysupgrade format
+
+ This makes some assumptions about the provided flash and image partition tables and
+ should be generalized when TP-LINK starts building its safeloader into hardware with
+ different flash layouts.
+*/
+void * generate_sysupgrade_image(const struct flash_partition_entry *flash_parts, const struct image_partition_entry *image_parts, size_t *len) {
+ const struct flash_partition_entry *flash_os_image = &flash_parts[5];
+ const struct flash_partition_entry *flash_soft_version = &flash_parts[6];
+ const struct flash_partition_entry *flash_support_list = &flash_parts[7];
+ const struct flash_partition_entry *flash_file_system = &flash_parts[8];
+
+ const struct image_partition_entry *image_os_image = &image_parts[3];
+ const struct image_partition_entry *image_soft_version = &image_parts[1];
+ const struct image_partition_entry *image_support_list = &image_parts[2];
+ const struct image_partition_entry *image_file_system = &image_parts[4];
+
+ assert(strcmp(flash_os_image->name, "os-image") == 0);
+ assert(strcmp(flash_soft_version->name, "soft-version") == 0);
+ assert(strcmp(flash_support_list->name, "support-list") == 0);
+ assert(strcmp(flash_file_system->name, "file-system") == 0);
+
+ assert(strcmp(image_os_image->name, "os-image") == 0);
+ assert(strcmp(image_soft_version->name, "soft-version") == 0);
+ assert(strcmp(image_support_list->name, "support-list") == 0);
+ assert(strcmp(image_file_system->name, "file-system") == 0);
+
+ if (image_os_image->size > flash_os_image->size)
+ error(1, 0, "kernel image too big (more than %u bytes)", (unsigned)flash_os_image->size);
+ if (image_file_system->size > flash_file_system->size)
+ error(1, 0, "rootfs image too big (more than %u bytes)", (unsigned)flash_file_system->size);
+
+ *len = flash_file_system->base - flash_os_image->base + image_file_system->size;
+
+ uint8_t *image = malloc(*len);
+ if (!image)
+ error(1, errno, "malloc");
+
+ memset(image, 0xff, *len);
+
+ memcpy(image, image_os_image->data, image_os_image->size);
+ memcpy(image + flash_soft_version->base - flash_os_image->base, image_soft_version->data, image_soft_version->size);
+ memcpy(image + flash_support_list->base - flash_os_image->base, image_support_list->data, image_support_list->size);
+ memcpy(image + flash_file_system->base - flash_os_image->base, image_file_system->data, image_file_system->size);
+
+ return image;
+}
+
+
+/** Generates an image for CPE210/220/510/520 and writes it to a file */
+static void do_cpe510(const char *output, const char *kernel_image, const char *rootfs_image, uint32_t rev, bool add_jffs2_eof, bool sysupgrade) {
+ struct image_partition_entry parts[6] = {};
+
+ parts[0] = make_partition_table(cpe510_partitions);
+ parts[1] = make_soft_version(rev);
+ parts[2] = make_support_list(cpe510_support_list, sizeof(cpe510_support_list)-1);
+ parts[3] = read_file("os-image", kernel_image, false);
+ parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof);
+
+ size_t len;
+ void *image;
+ if (sysupgrade)
+ image = generate_sysupgrade_image(cpe510_partitions, parts, &len);
+ else
+ image = generate_factory_image(cpe510_vendor, sizeof(cpe510_vendor)-1, parts, &len);
+
+ FILE *file = fopen(output, "wb");
+ if (!file)
+ error(1, errno, "unable to open output file");
+
+ if (fwrite(image, len, 1, file) != 1)
+ error(1, 0, "unable to write output file");
+
+ fclose(file);
+
+ free(image);
+
+ size_t i;
+ for (i = 0; parts[i].name; i++)
+ free_image_partition(parts[i]);
+}
+
+
+/** Usage output */
+void usage(const char *argv0) {
+ fprintf(stderr,
+ "Usage: %s [OPTIONS...]\n"
+ "\n"
+ "Options:\n"
+ " -B <board> create image for the board specified with <board>\n"
+ " -k <file> read kernel image from the file <file>\n"
+ " -r <file> read rootfs image from the file <file>\n"
+ " -o <file> write output to the file <file>\n"
+ " -V <rev> sets the revision number to <rev>\n"
+ " -j add jffs2 end-of-filesystem markers\n"
+ " -S create sysupgrade instead of factory image\n"
+ " -h show this help\n",
+ argv0
+ );
+};
+
+
+int main(int argc, char *argv[]) {
+ const char *board = NULL, *kernel_image = NULL, *rootfs_image = NULL, *output = NULL;
+ bool add_jffs2_eof = false, sysupgrade = false;
+ unsigned rev = 0;
+
+ while (true) {
+ int c;
+
+ c = getopt(argc, argv, "B:k:r:o:V:jSh");
+ if (c == -1)
+ break;
+
+ switch (c) {
+ case 'B':
+ board = optarg;
+ break;
+
+ case 'k':
+ kernel_image = optarg;
+ break;
+
+ case 'r':
+ rootfs_image = optarg;
+ break;
+
+ case 'o':
+ output = optarg;
+ break;
+
+ case 'V':
+ sscanf(optarg, "r%u", &rev);
+ break;
+
+ case 'j':
+ add_jffs2_eof = true;
+ break;
+
+ case 'S':
+ sysupgrade = true;
+ break;
+
+ case 'h':
+ usage(argv[0]);
+ return 0;
+
+ default:
+ usage(argv[0]);
+ return 1;
+ }
+ }
+
+ if (!board)
+ error(1, 0, "no board has been specified");
+ if (!kernel_image)
+ error(1, 0, "no kernel image has been specified");
+ if (!rootfs_image)
+ error(1, 0, "no rootfs image has been specified");
+ if (!output)
+ error(1, 0, "no output filename has been specified");
+
+ if (strcmp(board, "CPE510") == 0)
+ do_cpe510(output, kernel_image, rootfs_image, rev, add_jffs2_eof, sysupgrade);
+ else
+ error(1, 0, "unsupported board %s", board);
+
+ return 0;
+}

View File

@ -1,471 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 26 Nov 2014 19:57:50 +0100
Subject: ar71xx: add support for TP-LINK CPE210/220/510/520
This adds support for the TP-LINK CPE210/220/510/520 (Pharos series). These
devices are very similar to the Ubiquiti NanoStations, but with better specs:
faster CPU, more RAM, 2x2 MIMO.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index eb96338..d9c7328 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -43,6 +43,9 @@ get_status_led() {
cap4200ag)
status_led="senao:green:pwr"
;;
+ cpe510)
+ status_led="tp-link:green:link4"
+ ;;
db120)
status_led="db120:green:status"
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index 0d085be..a6e6721 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -61,6 +61,16 @@ carambola2)
ucidef_set_led_wlan "wlan" "WLAN" "carambola2:green:wlan" "phy0tpt"
;;
+cpe510)
+ ucidef_set_led_switch "lan0" "LAN0" "tp-link:green:lan0" "switch0" "0x20"
+ ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
+ ucidef_set_rssimon "wlan0" "40000" "1"
+ ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100" "0" "13"
+ ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "26" "100" "-25" "13"
+ ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "51" "100" "-50" "13"
+ ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
+ ;;
+
db120)
ucidef_set_led_usbdev "usb" "USB" "db120:green:usb" "1-1"
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index 4be30b8..78f4992 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -62,6 +62,13 @@ tl-wdr4900-v2)
ucidef_add_switch_vlan "switch0" "2" "1 6"
;;
+cpe510)
+ ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ ucidef_add_switch "switch0" "1" "1"
+ ucidef_add_switch_vlan "switch0" "1" "0t 5"
+ ucidef_add_switch_vlan "switch0" "2" "0t 4"
+ ;;
+
db120 |\
rb-2011l | \
rb-2011uas |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 1709356..9fb4102 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -229,6 +229,39 @@ tplink_board_detect() {
AR71XX_MODEL="$model $hwver"
}
+tplink_pharos_get_model_string() {
+ local part
+ part=$(find_mtd_part 'product-info')
+ [ -z "$part" ] && return 1
+
+ # The returned string will end with \r\n, but we don't remove it here
+ # to simplify matching against it in the sysupgrade image check
+ dd if=$part bs=1 skip=4360 2>/dev/null | head -n 1
+}
+
+tplink_pharos_board_detect() {
+ local model_string="$(tplink_pharos_get_model_string | tr -d '\r')"
+ local oIFS="$IFS"; IFS=":"; set -- $model_string; IFS="$oIFS"
+ local model
+
+ case "$1" in
+ 'CPE210(TP-LINK|UN|N300-2)')
+ model='TP-Link CPE210'
+ ;;
+ 'CPE220(TP-LINK|UN|N300-2)')
+ model='TP-Link CPE220'
+ ;;
+ 'CPE510(TP-LINK|UN|N300-5)')
+ model='TP-Link CPE510'
+ ;;
+ 'CPE520(TP-LINK|UN|N300-5)')
+ model='TP-Link CPE520'
+ ;;
+ esac
+
+ [ -n "$model" ] && AR71XX_MODEL="$model v$2"
+}
+
ar71xx_board_detect() {
local machine
local name
@@ -302,6 +335,10 @@ ar71xx_board_detect() {
*CAP4200AG)
name="cap4200ag"
;;
+ *"CPE210/220/510/520")
+ name="cpe510"
+ tplink_pharos_board_detect
+ ;;
*"DB120 reference board")
name="db120"
;;
@@ -754,11 +791,8 @@ ar71xx_board_detect() {
;;
esac
- case "$machine" in
- *TL-WR* | *TL-WA* | *TL-MR* | *TL-WD* | *Archer*)
+ [ -z "$AR71XX_MODEL" ] && [ "${machine:0:8}" = 'TP-LINK ' ] && \
tplink_board_detect "$machine"
- ;;
- esac
[ -z "$name" ] && name="unknown"
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index eeaac6a..c583215 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -70,6 +70,33 @@ tplink_get_image_boot_size() {
get_image "$@" | dd bs=4 count=1 skip=37 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
}
+tplink_pharos_check_image() {
+ local magic_long="$(get_magic_long "$1")"
+ [ "$magic_long" != "7f454c46" ] && {
+ echo "Invalid image magic '$magic_long'"
+ return 1
+ }
+
+ local model_string="$(tplink_pharos_get_model_string)"
+ local line
+
+ # Here $1 is given to dd directly instead of get_image as otherwise the skip
+ # will take almost a second (as dd can't seek then)
+ #
+ # This will fail if the image isn't local, but that's fine: as the
+ # read loop won't be executed at all, it will return true, so the image
+ # is accepted (loading the first 1.5M of a remote image for this check seems
+ # a bit extreme)
+ dd if="$1" bs=1 skip=1511432 count=1024 2>/dev/null | while read line; do
+ [ "$line" == "$model_string" ] && break
+ done || {
+ echo "Unsupported image (model not in support-list)"
+ return 1
+ }
+
+ return 0
+}
+
seama_get_type_magic() {
get_image "$@" | dd bs=1 count=4 skip=53 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
}
@@ -214,6 +241,11 @@ platform_check_image() {
return 0
;;
+ cpe510)
+ tplink_pharos_check_image "$1" && return 0
+ return 1
+ ;;
+
dir-825-b1 | \
tew-673gru)
dir825b_check_image "$1" && return 0
diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10
index 482914a..14b59f7 100644
--- a/target/linux/ar71xx/config-3.10
+++ b/target/linux/ar71xx/config-3.10
@@ -39,6 +39,7 @@ CONFIG_ATH79_MACH_AW_NR580=y
CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y
CONFIG_ATH79_MACH_CAP4200AG=y
CONFIG_ATH79_MACH_CARAMBOLA2=y
+CONFIG_ATH79_MACH_CPE510=y
CONFIG_ATH79_MACH_DB120=y
CONFIG_ATH79_MACH_DIR_505_A1=y
CONFIG_ATH79_MACH_DIR_600_A1=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
new file mode 100644
index 0000000..8bf5c0f
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
@@ -0,0 +1,107 @@
+/*
+ * TP-LINK CPE210/220/510/520 board support
+ *
+ * Copyright (C) 2014 Matthias Schiffer <mschiffer@universe-factory.net>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+
+#define CPE510_GPIO_LED_LAN0 11
+#define CPE510_GPIO_LED_LAN1 12
+#define CPE510_GPIO_LED_L1 13
+#define CPE510_GPIO_LED_L2 14
+#define CPE510_GPIO_LED_L3 15
+#define CPE510_GPIO_LED_L4 16
+
+#define CPE510_GPIO_BTN_RESET 4
+
+#define CPE510_KEYS_POLL_INTERVAL 20 /* msecs */
+#define CPE510_KEYS_DEBOUNCE_INTERVAL (3 * CPE510_KEYS_POLL_INTERVAL)
+
+
+static struct gpio_led cpe510_leds_gpio[] __initdata = {
+ {
+ .name = "tp-link:green:lan0",
+ .gpio = CPE510_GPIO_LED_LAN0,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:lan1",
+ .gpio = CPE510_GPIO_LED_LAN1,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:link1",
+ .gpio = CPE510_GPIO_LED_L1,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:link2",
+ .gpio = CPE510_GPIO_LED_L2,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:link3",
+ .gpio = CPE510_GPIO_LED_L3,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:link4",
+ .gpio = CPE510_GPIO_LED_L4,
+ .active_low = 1,
+ },
+};
+
+static struct gpio_keys_button cpe510_gpio_keys[] __initdata = {
+ {
+ .desc = "Reset button",
+ .type = EV_KEY,
+ .code = KEY_RESTART,
+ .debounce_interval = CPE510_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = CPE510_GPIO_BTN_RESET,
+ .active_low = 1,
+ }
+};
+
+
+static void __init cpe510_setup(void)
+{
+ u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+ /* Disable JTAG, enabling GPIOs 0-3 */
+ /* Configure OBS4 line, for GPIO 4*/
+ ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE,
+ AR934X_GPIO_FUNC_CLK_OBS4_EN);
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(cpe510_leds_gpio),
+ cpe510_leds_gpio);
+
+ ath79_register_gpio_keys_polled(1, CPE510_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(cpe510_gpio_keys),
+ cpe510_gpio_keys);
+
+ ath79_register_m25p80(NULL);
+
+ ath79_register_mdio(1, 0);
+ ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
+ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
+ ath79_register_eth(1);
+
+ ath79_register_wmac(ee, mac);
+}
+
+MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE210/220/510/520",
+ cpe510_setup);
diff --git a/target/linux/ar71xx/generic/profiles/tp-link.mk b/target/linux/ar71xx/generic/profiles/tp-link.mk
index 78333be..a9d170c 100644
--- a/target/linux/ar71xx/generic/profiles/tp-link.mk
+++ b/target/linux/ar71xx/generic/profiles/tp-link.mk
@@ -16,6 +16,17 @@ endef
$(eval $(call Profile,ARCHERC7))
+define Profile/CPE510
+ NAME:=TP-LINK CPE210/220/510/520
+ PACKAGES:=rssileds
+endef
+
+define Profile/CPE510/Description
+ Package set optimized for the TP-LINK CPE210/220/510/520.
+endef
+$(eval $(call Profile,CPE510))
+
+
define Profile/TLMR10U
NAME:=TP-LINK TL-MR10U
PACKAGES:=kmod-usb-core kmod-usb2
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 425fcc5..55f11dc 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -261,6 +261,7 @@ cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k
cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k@0xa0000(firmware)
+cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x40000(firmware)
eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware)
cameo_ap94_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,1600k(unknown)ro,64k@0x7f0000(caldata_copy)
@@ -811,6 +812,32 @@ define Image/Build/TPLINK-LZMA/initramfs
endef
+Image/Build/TPLINK-SAFELOADER/buildkernel=$(call PatchKernelLzma,$(2),$(3) $(4))
+
+define Image/Build/TPLINK-SAFELOADER
+ -rm -rf $(KDIR)/lzma-loader
+ $(LOADER_MAKE) LOADER=loader-$(2).elf\
+ LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
+ LOADER_DATA="$(KDIR_TMP)/vmlinux-$(2).bin.lzma" BOARD="$(2)" \
+ compile loader.elf
+
+ -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
+ -B $(5) \
+ -k $(KDIR)/loader-$(2).elf \
+ -r $(KDIR)/root.$(1) \
+ -V $(REVISION) \
+ -j \
+ -o $(call factoryname,$(1),$(2))
+ -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
+ -B $(5) \
+ -k $(KDIR)/loader-$(2).elf \
+ -r $(KDIR)/root.$(1) \
+ -V $(REVISION) \
+ -j -S \
+ -o $(call sysupname,$(1),$(2))
+endef
+
+
define Image/Build/CyberTAN
echo -n '' > $(KDIR_TMP)/empty.bin
$(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp \
@@ -1227,6 +1254,8 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWDR4310V1,tl-wdr4310-v1,TL-WDR4
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWDR4900V2,tl-wdr4900-v2,TL-WDR4900-v2,ttyS0,115200,0x49000002,1,8Mlzma))
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,MW4530RV1,mw4530r-v1,TL-WDR4300,ttyS0,115200,0x45300001,1,8Mlzma))
+$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510))
+
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,SMART-300,smart-300,SMART-300,ttyS0,115200,0x93410001,1,8Mlzma))
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,OOLITE,oolite,GS-OOLITE,ttyATH0,115200,0x3C000101,1,16Mlzma))
diff --git a/target/linux/ar71xx/patches-3.10/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.10/610-MIPS-ath79-openwrt-machines.patch
index 3669f26..516d52d 100644
--- a/target/linux/ar71xx/patches-3.10/610-MIPS-ath79-openwrt-machines.patch
+++ b/target/linux/ar71xx/patches-3.10/610-MIPS-ath79-openwrt-machines.patch
@@ -1,6 +1,6 @@
--- a/arch/mips/ath79/machtypes.h
+++ b/arch/mips/ath79/machtypes.h
-@@ -16,22 +16,144 @@
+@@ -16,22 +16,145 @@
enum ath79_mach_type {
ATH79_MACH_GENERIC = 0,
@@ -24,6 +24,7 @@
+ ATH79_MACH_BHU_BXU2000N2_A1, /* BHU BXU2000n-2 A1 */
+ ATH79_MACH_CAP4200AG, /* Senao CAP4200AG */
+ ATH79_MACH_CARAMBOLA2, /* 8devices Carambola2 */
++ ATH79_MACH_CPE510, /* TP-LINK CPE510 */
ATH79_MACH_DB120, /* Atheros DB120 reference board */
ATH79_MACH_PB44, /* Atheros PB44 reference board */
+ ATH79_MACH_DIR_505_A1, /* D-Link DIR-505 rev. A1 */
@@ -209,7 +210,7 @@
config ATH79_MACH_AP121
bool "Atheros AP121 reference board"
select SOC_AR933X
-@@ -9,64 +64,736 @@ config ATH79_MACH_AP121
+@@ -9,64 +64,745 @@ config ATH79_MACH_AP121
select ATH79_DEV_GPIO_BUTTONS
select ATH79_DEV_LEDS_GPIO
select ATH79_DEV_M25P80
@@ -709,6 +710,15 @@
-config ATH79_MACH_AP81
- bool "Atheros AP81 reference board"
++config ATH79_MACH_CPE510
++ bool "TP-LINK CPE510 support"
++ select SOC_AR934X
++ select ATH79_DEV_ETH
++ select ATH79_DEV_GPIO_BUTTONS
++ select ATH79_DEV_LEDS_GPIO
++ select ATH79_DEV_M25P80
++ select ATH79_DEV_WMAC
++
+config ATH79_MACH_TL_MR11U
+ bool "TP-LINK TL-MR11U/TL-MR3040 support"
+ select SOC_AR933X
@@ -972,7 +982,7 @@
config ATH79_MACH_UBNT_XM
bool "Ubiquiti Networks XM/UniFi boards"
-@@ -83,6 +810,65 @@ config ATH79_MACH_UBNT_XM
+@@ -83,6 +819,65 @@ config ATH79_MACH_UBNT_XM
Say 'Y' here if you want your kernel to support the
Ubiquiti Networks XM (rev 1.0) board.
@@ -1038,7 +1048,7 @@
endmenu
config SOC_AR71XX
-@@ -132,7 +918,10 @@ config ATH79_DEV_DSA
+@@ -132,7 +927,10 @@ config ATH79_DEV_DSA
config ATH79_DEV_ETH
def_bool n
@@ -1050,7 +1060,7 @@
def_bool n
config ATH79_DEV_GPIO_BUTTONS
-@@ -164,4 +953,7 @@ config ATH79_PCI_ATH9K_FIXUP
+@@ -164,4 +962,7 @@ config ATH79_PCI_ATH9K_FIXUP
config ATH79_ROUTERBOOT
def_bool n
@@ -1060,7 +1070,7 @@
endif
--- a/arch/mips/ath79/Makefile
+++ b/arch/mips/ath79/Makefile
-@@ -38,9 +38,90 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
+@@ -38,9 +38,91 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
#
# Machines
#
@@ -1079,6 +1089,7 @@
+obj-$(CONFIG_ATH79_MACH_AW_NR580) += mach-aw-nr580.o
+obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)+= mach-bhu-bxu2000n2-a.o
+obj-$(CONFIG_ATH79_MACH_CAP4200AG) += mach-cap4200ag.o
++obj-$(CONFIG_ATH79_MACH_CPE510) += mach-cpe510.o
obj-$(CONFIG_ATH79_MACH_DB120) += mach-db120.o
+obj-$(CONFIG_ATH79_MACH_DIR_505_A1) += mach-dir-505-a1.o
+obj-$(CONFIG_ATH79_MACH_DIR_600_A1) += mach-dir-600-a1.o

View File

@ -1,72 +0,0 @@
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Wed, 26 Nov 2014 23:20:33 +0100
Subject: ar71xx: refactor ubnt xw board setup
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
diff --git a/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch b/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch
index ed2fd24..9413bd8 100644
--- a/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch
+++ b/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch
@@ -1,6 +1,8 @@
---- a/arch/mips/ath79/mach-ubnt-xm.c
-+++ b/arch/mips/ath79/mach-ubnt-xm.c
-@@ -332,3 +332,60 @@ static void __init ubnt_uap_pro_setup(vo
+Index: linux-3.10.49/arch/mips/ath79/mach-ubnt-xm.c
+===================================================================
+--- linux-3.10.49.orig/arch/mips/ath79/mach-ubnt-xm.c 2014-08-15 22:55:37.890080659 +0200
++++ linux-3.10.49/arch/mips/ath79/mach-ubnt-xm.c 2014-08-15 22:58:31.061570912 +0200
+@@ -332,3 +332,67 @@
MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti UniFi AP Pro",
ubnt_uap_pro_setup);
@@ -29,7 +31,7 @@
+ },
+};
+
-+static void __init ubnt_nano_m_xw_setup(void)
++static void __init ubnt_xw_init(void)
+{
+ u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
+
@@ -44,26 +46,36 @@
+ ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
+ ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
+
-+ ath79_register_mdio(0, ~(BIT(0) | BIT(1) | BIT(5)));
+
+ ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_MII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0_SLAVE);
+ ath79_init_mac(ath79_eth0_data.mac_addr,
+ eeprom + UAP_PRO_MAC0_OFFSET, 0);
+
-+ /* GMAC0 is connected to an AR8326 switch */
+ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
++}
++
++static void __init ubnt_nano_m_xw_setup(void)
++{
++ ubnt_xw_init();
++
++ /* GMAC0 is connected to an AR8326 switch */
++ ath79_register_mdio(0, ~(BIT(0) | BIT(1) | BIT(5)));
+ ath79_eth0_data.phy_mask = (BIT(0) | BIT(1) | BIT(5));
+ ath79_eth0_data.speed = SPEED_100;
+ ath79_eth0_data.duplex = DUPLEX_FULL;
-+ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
+ ath79_register_eth(0);
+}
+
+MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, "UBNT-NM-XW", "Ubiquiti Nanostation M XW",
+ ubnt_nano_m_xw_setup);
++
--- a/arch/mips/ath79/machtypes.h
+++ b/arch/mips/ath79/machtypes.h
-@@ -124,6 +124,7 @@ enum ath79_mach_type {
+@@ -121,9 +121,10 @@ enum ath79_mach_type {
+ ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */
+ ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */
+ ATH79_MACH_UBNT_BULLET_M, /* Ubiquiti Bullet M */
ATH79_MACH_UBNT_LSSR71, /* Ubiquiti LS-SR71 */
ATH79_MACH_UBNT_LSX, /* Ubiquiti LSX */
ATH79_MACH_UBNT_NANO_M, /* Ubiquiti NanoStation M */

Some files were not shown because too many files have changed in this diff Show More