Move creation of local-node device from gluon-mesh-batman-adv-core to gluon-client-bridge

Prepare reverting the roles of br-client and local-node to their state
before 8c4403ba11.
This commit is contained in:
Matthias Schiffer 2017-02-10 08:54:48 +01:00
parent eb350aba34
commit b92dfcb966
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
4 changed files with 38 additions and 21 deletions

View File

@ -12,7 +12,7 @@ define Package/gluon-client-bridge
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Provides a bridge and a wireless interface for clients to connect to
DEPENDS:=+gluon-core
DEPENDS:=+gluon-core +kmod-macvlan
endef
define Build/Prepare

View File

@ -0,0 +1,32 @@
#!/usr/bin/lua
local sysconfig = require 'gluon.sysconfig'
local uci = require('simple-uci').cursor()
uci:delete('network', 'local_node_dev')
uci:section('network', 'device', 'local_node_dev', {
name = 'local-node',
ifname = 'br-client',
type = 'macvlan',
macaddr = sysconfig.primary_mac,
})
uci:delete('network', 'local_node')
uci:section('network', 'interface', 'local_node', {
ifname = 'local-node',
proto = 'none',
auto = true,
})
uci:save('network')
uci:delete('dhcp', 'local_node')
uci:section('dhcp', 'dhcp', 'local_node', {
interface = 'local_node',
ignore = true,
})
uci:save('dhcp')

View File

@ -13,7 +13,7 @@ define Package/gluon-mesh-batman-adv-core
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Support for batman-adv meshing (core)
DEPENDS:=+gluon-core +libgluonutil +gluon-client-bridge +gluon-ebtables +firewall +libiwinfo +kmod-dummy +kmod-macvlan +libnl-tiny
DEPENDS:=+gluon-core +libgluonutil +gluon-client-bridge +gluon-ebtables +firewall +libiwinfo +kmod-dummy +libnl-tiny
endef
define Build/Prepare

View File

@ -1,5 +1,9 @@
#!/usr/bin/lua
-- This script must be ordered after 310-gluon-client-bridge-local-node, as
-- it overrides parts of network.local_node
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
local sysctl = require 'gluon.sysctl'
@ -7,17 +11,7 @@ local sysctl = require 'gluon.sysctl'
local uci = require('simple-uci').cursor()
uci:delete('network', 'local_node_dev')
uci:section('network', 'device', 'local_node_dev', {
name = 'local-node',
ifname = 'br-client',
type = 'macvlan',
macaddr = sysconfig.primary_mac,
})
uci:delete('network', 'local_node')
uci:section('network', 'interface', 'local_node', {
ifname = 'local-node',
proto = 'dhcpv6',
reqprefix = 'no',
peerdns = not (site.dns and site.dns.servers),
@ -54,13 +48,4 @@ uci:section('firewall', 'rule', 'local_node_dns', {
uci:save('firewall')
uci:delete('dhcp', 'local_node')
uci:section('dhcp', 'dhcp', 'local_node', {
interface = 'local_node',
ignore = true,
})
uci:save('dhcp')
sysctl.set('net.ipv6.conf.local_node.forwarding', 0)