Split node specific network configuration into own package

This commit is contained in:
Fabian Bläse 2021-08-08 15:39:09 +02:00
parent 1b6ec0a6d8
commit f8e3ef38d4
8 changed files with 63 additions and 55 deletions

View File

@ -8,7 +8,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=base
CATEGORY:=Freifunk
TITLE:=Freifunk-Franken network configuration
TITLE:=Freifunk-Franken base network configuration
URL:=https://www.freifunk-franken.de
DEPENDS:= \
+owipcalc \

View File

@ -1,30 +0,0 @@
config globals 'globals'
option packet_steering '1'
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'client'
option type 'bridge'
option auto '1'
config interface 'wan'
option proto 'none'
option ifname 'eth2'
config interface 'wan4'
option proto 'dhcp'
option ifname '@wan'
config interface 'wan6'
option proto 'dhcpv6'
option reqprefix 'no'
option sourcefilter '0'
option ifname '@wan'
config interface 'ethmesh'
option proto 'batadv_hardif'
option master 'bat0'

View File

@ -38,23 +38,6 @@ uci batch <<-__EOF__
set network.wan6.reqprefix='no'
set network.wan6.sourcefilter='0'
set network.wan6.ifname='@wan'
set network.bat0='interface'
set network.bat0.proto='batadv'
set network.bat0.gw_mode='client'
set network.bat0.gw_sel_class='1'
set network.bat0.network_coding='0'
set network.bat0.aggregated_ogms='1'
set network.bat0.ap_isolation='0'
set network.bat0.bonding='0'
set network.bat0.fragmentation='1'
set network.bat0.orig_interval='1000'
set network.bat0.distributed_arp_table='1'
set network.bat0.hop_penalty='30'
set network.ethmesh='interface'
set network.ethmesh.proto='batadv_hardif'
set network.ethmesh.master='bat0'
__EOF__
## Add switch configuration
@ -69,13 +52,6 @@ if [ -n "$SWITCHHW" ]; then
__EOF__
fi
## Fix ethmesh mac-address, if necessary
if [ -n "$ETHMESHMAC" ]; then
uci set network.ethmesh.macaddr=$ETHMESHMAC
uci commit network
/etc/init.d/network restart
fi
## Set router label mac address on client interface
if [ -n "$ROUTERMAC" ]; then
uci set network.client.macaddr=$ROUTERMAC

View File

@ -0,0 +1,30 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-node-config
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=base
CATEGORY:=Freifunk
TITLE:=Freifunk-Franken node network configuration
URL:=https://www.freifunk-franken.de
DEPENDS:= \
+fff-boardname \
+fff-network
endef
define Package/$(PKG_NAME)/description
This package configures the network interfaces
endef
define Build/Compile
# nothing
endef
define Package/$(PKG_NAME)/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -0,0 +1,31 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-or-later
. /lib/functions/fff/interfaces
## Add batman interfaces
uci batch <<-__EOF__
set network.bat0='interface'
set network.bat0.proto='batadv'
set network.bat0.gw_mode='client'
set network.bat0.gw_sel_class='1'
set network.bat0.network_coding='0'
set network.bat0.aggregated_ogms='1'
set network.bat0.ap_isolation='0'
set network.bat0.bonding='0'
set network.bat0.fragmentation='1'
set network.bat0.orig_interval='1000'
set network.bat0.distributed_arp_table='1'
set network.bat0.hop_penalty='30'
set network.ethmesh='interface'
set network.ethmesh.proto='batadv_hardif'
set network.ethmesh.master='bat0'
__EOF__
## Fix ethmesh mac-address, if necessary
if [ -n "$ETHMESHMAC" ]; then
uci set network.ethmesh.macaddr=$ETHMESHMAC
uci commit network
/etc/init.d/network restart
fi

View File

@ -14,6 +14,7 @@ define Package/fff-node
+fff-fastd \
+fff-firewall \
+fff-hoods \
+fff-node-config \
+fff-uradvd
endef