From a382d21c6a217f5a0a735499ba516713677f24f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20L=C3=BCssing?= Date: Sat, 27 Jul 2019 06:32:51 +0200 Subject: [PATCH] batman-adv-legacy: move binaries, scripts and config to avoid conflicts This renames batman-adv.ko to batman-adv-legacy.ko. And also moves scripts to a "-legacy" variant to avoid build errors when both batman-adv and batman-adv-legacy are selected. Finally, moves the batman-adv-legacy config to /etc/config/batman-adv-legacy. This allows to select and install the batman-adv mainline and batman-adv-legacy simultaneously. --- net/batman-adv-legacy/Makefile | 17 +++++++++++------ .../config/{batman-adv => batman-adv-legacy} | 0 .../net/{99-batman-adv => 99-batman-adv-legacy} | 4 ++-- .../{batman-adv => batman-adv-legacy}/config.sh | 4 ++-- .../proto/{batadv.sh => batadv_legacy.sh} | 8 ++++---- 5 files changed, 19 insertions(+), 14 deletions(-) rename net/batman-adv-legacy/files/etc/config/{batman-adv => batman-adv-legacy} (100%) rename net/batman-adv-legacy/files/etc/hotplug.d/net/{99-batman-adv => 99-batman-adv-legacy} (66%) rename net/batman-adv-legacy/files/lib/{batman-adv => batman-adv-legacy}/config.sh (94%) rename net/batman-adv-legacy/files/lib/netifd/proto/{batadv.sh => batadv_legacy.sh} (83%) diff --git a/net/batman-adv-legacy/Makefile b/net/batman-adv-legacy/Makefile index 8386ab5..fe4f71d 100644 --- a/net/batman-adv-legacy/Makefile +++ b/net/batman-adv-legacy/Makefile @@ -26,7 +26,7 @@ define KernelPackage/batman-adv-legacy SUBMENU:=Network Support DEPENDS:=+kmod-lib-crc16 +kmod-crypto-crc32c +kmod-lib-crc32c +libc TITLE:=B.A.T.M.A.N. Adv - FILES:=$(PKG_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX) + FILES:=$(PKG_BUILD_DIR)/batman-adv-legacy.$(LINUX_KMOD_SUFFIX) endef define KernelPackage/batman-adv-legacy/description @@ -58,12 +58,17 @@ define Build/Prepare $(PKG_BUILD_DIR)/main.h 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 - $(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_DATA) ./files/etc/config/batman-adv $(1)/etc/config - $(INSTALL_DATA) ./files/lib/batman-adv/config.sh $(1)/lib/batman-adv - $(INSTALL_BIN) ./files/etc/hotplug.d/net/99-batman-adv $(1)/etc/hotplug.d/net - $(INSTALL_BIN) ./files/lib/netifd/proto/batadv.sh $(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-legacy $(1)/etc/config + $(INSTALL_DATA) ./files/lib/batman-adv-legacy/config.sh $(1)/lib/batman-adv-legacy + $(INSTALL_BIN) ./files/etc/hotplug.d/net/99-batman-adv-legacy $(1)/etc/hotplug.d/net + $(INSTALL_BIN) ./files/lib/netifd/proto/batadv_legacy.sh $(1)/lib/netifd/proto endef $(eval $(call KernelPackage,batman-adv-legacy)) diff --git a/net/batman-adv-legacy/files/etc/config/batman-adv b/net/batman-adv-legacy/files/etc/config/batman-adv-legacy similarity index 100% rename from net/batman-adv-legacy/files/etc/config/batman-adv rename to net/batman-adv-legacy/files/etc/config/batman-adv-legacy diff --git a/net/batman-adv-legacy/files/etc/hotplug.d/net/99-batman-adv b/net/batman-adv-legacy/files/etc/hotplug.d/net/99-batman-adv-legacy similarity index 66% rename from net/batman-adv-legacy/files/etc/hotplug.d/net/99-batman-adv rename to net/batman-adv-legacy/files/etc/hotplug.d/net/99-batman-adv-legacy index f0c391f..644ade7 100644 --- a/net/batman-adv-legacy/files/etc/hotplug.d/net/99-batman-adv +++ b/net/batman-adv-legacy/files/etc/hotplug.d/net/99-batman-adv-legacy @@ -1,9 +1,9 @@ #!/bin/sh -. /lib/batman-adv/config.sh +. /lib/batman-adv-legacy/config.sh bat_load_module -config_load batman-adv +config_load batman-adv-legacy case "$ACTION" in add) diff --git a/net/batman-adv-legacy/files/lib/batman-adv/config.sh b/net/batman-adv-legacy/files/lib/batman-adv-legacy/config.sh similarity index 94% rename from net/batman-adv-legacy/files/lib/batman-adv/config.sh rename to net/batman-adv-legacy/files/lib/batman-adv-legacy/config.sh index 471c1f2..6042a0b 100644 --- a/net/batman-adv-legacy/files/lib/batman-adv/config.sh +++ b/net/batman-adv-legacy/files/lib/batman-adv-legacy/config.sh @@ -5,7 +5,7 @@ bat_load_module() [ -d "/sys/module/batman_adv/" ] && return . /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() @@ -29,7 +29,7 @@ bat_config() config_get orig_interval "$mesh" orig_interval 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 "$ap_isolation" ] && echo $ap_isolation > /sys/class/net/$mesh/mesh/ap_isolation diff --git a/net/batman-adv-legacy/files/lib/netifd/proto/batadv.sh b/net/batman-adv-legacy/files/lib/netifd/proto/batadv_legacy.sh similarity index 83% rename from net/batman-adv-legacy/files/lib/netifd/proto/batadv.sh rename to net/batman-adv-legacy/files/lib/netifd/proto/batadv_legacy.sh index 42acc28..8b9b812 100644 --- a/net/batman-adv-legacy/files/lib/netifd/proto/batadv.sh +++ b/net/batman-adv-legacy/files/lib/netifd/proto/batadv_legacy.sh @@ -4,12 +4,12 @@ . ../netifd-proto.sh init_proto "$@" -proto_batadv_init_config() { +proto_batadv_legacy_init_config() { proto_config_add_string "mesh" proto_config_add_string "mesh_no_rebroadcast" } -proto_batadv_setup() { +proto_batadv_legacy_setup() { local config="$1" local iface="$2" @@ -23,11 +23,11 @@ proto_batadv_setup() { proto_send_update "$config" } -proto_batadv_teardown() { +proto_batadv_legacy_teardown() { local config="$1" local iface="$2" (echo "none" > "/sys/class/net/$iface/batman_adv/mesh_iface") 2>/dev/null } -add_protocol batadv +add_protocol batadv_legacy