Merge pull request #211 from T-X/batman-adv-legacy-coexist
batman-adv-legacy: batman-adv co-existence
This commit is contained in:
commit
dccead7083
|
@ -22,12 +22,11 @@ include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
define KernelPackage/batman-adv-legacy
|
define KernelPackage/batman-adv-legacy
|
||||||
URL:=http://www.open-mesh.org/
|
URL:=http://www.open-mesh.org/
|
||||||
MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
|
MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>, Linus Lüssing <linus.luessing@c0d3.blue>
|
||||||
SUBMENU:=Network Support
|
SUBMENU:=Network Support
|
||||||
DEPENDS:=+kmod-lib-crc16 +kmod-crypto-crc32c +kmod-lib-crc32c +libc
|
DEPENDS:=+kmod-lib-crc16 +kmod-crypto-crc32c +kmod-lib-crc32c +libc
|
||||||
TITLE:=B.A.T.M.A.N. Adv
|
TITLE:=B.A.T.M.A.N. Adv Legacy
|
||||||
FILES:=$(PKG_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX)
|
FILES:=$(PKG_BUILD_DIR)/batman-adv-legacy.$(LINUX_KMOD_SUFFIX)
|
||||||
AUTOLOAD:=$(call AutoLoad,50,batman-adv)
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define KernelPackage/batman-adv-legacy/description
|
define KernelPackage/batman-adv-legacy/description
|
||||||
|
@ -59,12 +58,17 @@ define Build/Prepare
|
||||||
$(PKG_BUILD_DIR)/main.h
|
$(PKG_BUILD_DIR)/main.h
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
$(call Build/Compile/Default,)
|
||||||
|
mv $(PKG_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX) $(PKG_BUILD_DIR)/batman-adv-legacy.$(LINUX_KMOD_SUFFIX)
|
||||||
|
endef
|
||||||
|
|
||||||
define KernelPackage/batman-adv-legacy/install
|
define KernelPackage/batman-adv-legacy/install
|
||||||
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/hotplug.d/net $(1)/etc/hotplug.d/iface $(1)/lib/batman-adv $(1)/usr/sbin $(1)/lib/netifd/proto
|
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/hotplug.d/net $(1)/etc/hotplug.d/iface $(1)/lib/batman-adv-legacy $(1)/usr/sbin $(1)/lib/netifd/proto
|
||||||
$(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config
|
$(INSTALL_DATA) ./files/etc/config/batman-adv-legacy $(1)/etc/config
|
||||||
$(INSTALL_DATA) ./files/lib/batman-adv/config.sh $(1)/lib/batman-adv
|
$(INSTALL_DATA) ./files/lib/batman-adv-legacy/config.sh $(1)/lib/batman-adv-legacy
|
||||||
$(INSTALL_BIN) ./files/etc/hotplug.d/net/99-batman-adv $(1)/etc/hotplug.d/net
|
$(INSTALL_BIN) ./files/etc/hotplug.d/net/99-batman-adv-legacy $(1)/etc/hotplug.d/net
|
||||||
$(INSTALL_BIN) ./files/lib/netifd/proto/batadv.sh $(1)/lib/netifd/proto
|
$(INSTALL_BIN) ./files/lib/netifd/proto/batadv_legacy.sh $(1)/lib/netifd/proto
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call KernelPackage,batman-adv-legacy))
|
$(eval $(call KernelPackage,batman-adv-legacy))
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
. /lib/batman-adv/config.sh
|
. /lib/batman-adv-legacy/config.sh
|
||||||
|
|
||||||
bat_load_module
|
bat_load_module
|
||||||
config_load batman-adv
|
config_load batman-adv-legacy
|
||||||
|
|
||||||
case "$ACTION" in
|
case "$ACTION" in
|
||||||
add)
|
add)
|
|
@ -5,7 +5,7 @@ bat_load_module()
|
||||||
[ -d "/sys/module/batman_adv/" ] && return
|
[ -d "/sys/module/batman_adv/" ] && return
|
||||||
|
|
||||||
. /lib/functions.sh
|
. /lib/functions.sh
|
||||||
load_modules /etc/modules.d/*-crc16 /etc/modules.d/*-crypto* /etc/modules.d/*-lib-crc* /etc/modules.d/*-batman-adv*
|
load_modules /etc/modules.d/*-crc16 /etc/modules.d/*-crypto* /etc/modules.d/*-lib-crc* /etc/modules.d/*-batman-adv-legacy*
|
||||||
}
|
}
|
||||||
|
|
||||||
bat_config()
|
bat_config()
|
||||||
|
@ -29,7 +29,7 @@ bat_config()
|
||||||
config_get orig_interval "$mesh" orig_interval
|
config_get orig_interval "$mesh" orig_interval
|
||||||
config_get vis_mode "$mesh" vis_mode
|
config_get vis_mode "$mesh" vis_mode
|
||||||
|
|
||||||
[ ! -f "/sys/class/net/$mesh/mesh/orig_interval" ] && echo "batman-adv mesh $mesh does not exist - check your interface configuration" && return 1
|
[ ! -f "/sys/class/net/$mesh/mesh/orig_interval" ] && echo "batman-adv-legacy mesh $mesh does not exist - check your interface configuration" && return 1
|
||||||
|
|
||||||
[ -n "$aggregate_ogms" ] && echo $aggregate_ogms > /sys/class/net/$mesh/mesh/aggregate_ogms
|
[ -n "$aggregate_ogms" ] && echo $aggregate_ogms > /sys/class/net/$mesh/mesh/aggregate_ogms
|
||||||
[ -n "$ap_isolation" ] && echo $ap_isolation > /sys/class/net/$mesh/mesh/ap_isolation
|
[ -n "$ap_isolation" ] && echo $ap_isolation > /sys/class/net/$mesh/mesh/ap_isolation
|
|
@ -4,12 +4,12 @@
|
||||||
. ../netifd-proto.sh
|
. ../netifd-proto.sh
|
||||||
init_proto "$@"
|
init_proto "$@"
|
||||||
|
|
||||||
proto_batadv_init_config() {
|
proto_batadv_legacy_init_config() {
|
||||||
proto_config_add_string "mesh"
|
proto_config_add_string "mesh"
|
||||||
proto_config_add_string "mesh_no_rebroadcast"
|
proto_config_add_string "mesh_no_rebroadcast"
|
||||||
}
|
}
|
||||||
|
|
||||||
proto_batadv_setup() {
|
proto_batadv_legacy_setup() {
|
||||||
local config="$1"
|
local config="$1"
|
||||||
local iface="$2"
|
local iface="$2"
|
||||||
|
|
||||||
|
@ -23,11 +23,11 @@ proto_batadv_setup() {
|
||||||
proto_send_update "$config"
|
proto_send_update "$config"
|
||||||
}
|
}
|
||||||
|
|
||||||
proto_batadv_teardown() {
|
proto_batadv_legacy_teardown() {
|
||||||
local config="$1"
|
local config="$1"
|
||||||
local iface="$2"
|
local iface="$2"
|
||||||
|
|
||||||
(echo "none" > "/sys/class/net/$iface/batman_adv/mesh_iface") 2>/dev/null
|
(echo "none" > "/sys/class/net/$iface/batman_adv/mesh_iface") 2>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
add_protocol batadv
|
add_protocol batadv_legacy
|
Loading…
Reference in New Issue