Browse Source

gluon-mesh-batman-adv-*: unify into a single source package

For simplicity, we don't use different MTUs for compat 14 and 15 anymore,
there's no harm in using 1532 for batman-adv-legacy as well.
Matthias Schiffer 7 years ago
parent
commit
4ca67dcca5
29 changed files with 79 additions and 125 deletions
  1. 1 1
      docs/dev/hardware.rst
  2. 0 33
      package/gluon-mesh-batman-adv-14/Makefile
  3. 0 3
      package/gluon-mesh-batman-adv-14/files/lib/gluon/core/mesh/setup.d/30-gluon-mesh-batman-adv-14
  4. 0 3
      package/gluon-mesh-batman-adv-14/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv-14
  5. 0 1
      package/gluon-mesh-batman-adv-14/files/lib/gluon/mesh-batman-adv-core/compat
  6. 0 33
      package/gluon-mesh-batman-adv-15/Makefile
  7. 0 3
      package/gluon-mesh-batman-adv-15/files/lib/gluon/core/mesh/setup.d/30-gluon-mesh-batman-adv-15
  8. 0 3
      package/gluon-mesh-batman-adv-15/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv-15
  9. 0 1
      package/gluon-mesh-batman-adv-15/files/lib/gluon/mesh-batman-adv-core/compat
  10. 0 42
      package/gluon-mesh-batman-adv-core/Makefile
  11. 70 0
      package/gluon-mesh-batman-adv/Makefile
  12. 0 0
      package/gluon-mesh-batman-adv/check_site.lua
  13. 3 0
      package/gluon-mesh-batman-adv/files/lib/gluon/core/mesh/setup.d/30-gluon-mesh-batman-adv
  14. 3 0
      package/gluon-mesh-batman-adv/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv
  15. 0 0
      package/gluon-mesh-batman-adv/files/lib/gluon/ebtables/250-next-node
  16. 0 0
      package/gluon-mesh-batman-adv/files/lib/gluon/ebtables/300-radv-input-output
  17. 0 0
      package/gluon-mesh-batman-adv/files/lib/gluon/respondd/client.dev
  18. 0 0
      package/gluon-mesh-batman-adv/files/usr/lib/autoupdater/abort.d/10start-network
  19. 0 0
      package/gluon-mesh-batman-adv/files/usr/lib/autoupdater/upgrade.d/10stop-network
  20. 1 1
      package/gluon-mesh-batman-adv/luasrc/lib/gluon/mesh-batman-adv/config_mesh_interface
  21. 0 0
      package/gluon-mesh-batman-adv/luasrc/lib/gluon/radvd/arguments
  22. 0 0
      package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/310-gluon-mesh-batman-adv-mesh
  23. 0 0
      package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/320-gluon-mesh-batman-adv-client-bridge
  24. 0 0
      package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/330-gluon-mesh-batman-adv-mac-addresses
  25. 0 0
      package/gluon-mesh-batman-adv/src/Makefile
  26. 0 0
      package/gluon-mesh-batman-adv/src/batadv-netlink.c
  27. 0 0
      package/gluon-mesh-batman-adv/src/batadv-netlink.h
  28. 0 0
      package/gluon-mesh-batman-adv/src/batman_adv.h
  29. 1 1
      package/gluon-mesh-batman-adv/src/respondd.c

+ 1 - 1
docs/dev/hardware.rst

@@ -125,7 +125,7 @@ If the new platform works fine with the definitions found in ``default.c``, noth
 create a definition for the added target or subtarget, either by symlinking one of the files in the ``templates``
 directory, or adding a new source file.
 
-On many targets, Gluon's network setup scripts (mainly in the packages ``gluon-core`` and ``gluon-mesh-batman-adv-core``)
+On many targets, Gluon's network setup scripts (mainly in the package ``gluon-core``)
 won't run correctly without some adjustments, so better double check that everything is fine there (and the files
 ``primary_mac``, ``lan_ifname`` and ``wan_ifname`` in ``/lib/gluon/core/sysconfig/`` contain sensible values).
 

+ 0 - 33
package/gluon-mesh-batman-adv-14/Makefile

@@ -1,33 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gluon-mesh-batman-adv-14
-PKG_VERSION:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include ../gluon.mk
-
-
-define Package/gluon-mesh-batman-adv-14
-  SECTION:=gluon
-  CATEGORY:=Gluon
-  TITLE:=Support for batman-adv meshing (compat level 14)
-  DEPENDS:=+gluon-mesh-batman-adv-core +kmod-batman-adv-legacy
-  PROVIDES:=gluon-mesh-batman-adv
-endef
-
-define Build/Prepare
-	mkdir -p $(PKG_BUILD_DIR)
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/gluon-mesh-batman-adv-14/install
-	$(CP) ./files/* $(1)/
-endef
-
-$(eval $(call BuildPackage,gluon-mesh-batman-adv-14))

+ 0 - 3
package/gluon-mesh-batman-adv-14/files/lib/gluon/core/mesh/setup.d/30-gluon-mesh-batman-adv-14

@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec /lib/gluon/mesh-batman-adv-core/config_mesh_interface setup 1528

+ 0 - 3
package/gluon-mesh-batman-adv-14/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv-14

@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec /lib/gluon/mesh-batman-adv-core/config_mesh_interface teardown

+ 0 - 1
package/gluon-mesh-batman-adv-14/files/lib/gluon/mesh-batman-adv-core/compat

@@ -1 +0,0 @@
-14

+ 0 - 33
package/gluon-mesh-batman-adv-15/Makefile

@@ -1,33 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gluon-mesh-batman-adv-15
-PKG_VERSION:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include ../gluon.mk
-
-
-define Package/gluon-mesh-batman-adv-15
-  SECTION:=gluon
-  CATEGORY:=Gluon
-  TITLE:=Support for batman-adv meshing (compat level 15)
-  DEPENDS:=+gluon-mesh-batman-adv-core +kmod-batman-adv +batctl
-  PROVIDES:=gluon-mesh-batman-adv
-endef
-
-define Build/Prepare
-	mkdir -p $(PKG_BUILD_DIR)
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
-endef
-
-define Package/gluon-mesh-batman-adv-15/install
-	$(CP) ./files/* $(1)/
-endef
-
-$(eval $(call BuildPackage,gluon-mesh-batman-adv-15))

+ 0 - 3
package/gluon-mesh-batman-adv-15/files/lib/gluon/core/mesh/setup.d/30-gluon-mesh-batman-adv-15

@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec /lib/gluon/mesh-batman-adv-core/config_mesh_interface setup 1532

+ 0 - 3
package/gluon-mesh-batman-adv-15/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv-15

@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec /lib/gluon/mesh-batman-adv-core/config_mesh_interface teardown

+ 0 - 1
package/gluon-mesh-batman-adv-15/files/lib/gluon/mesh-batman-adv-core/compat

@@ -1 +0,0 @@
-15

+ 0 - 42
package/gluon-mesh-batman-adv-core/Makefile

@@ -1,42 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=gluon-mesh-batman-adv-core
-PKG_VERSION:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-PKG_BUILD_DEPENDS := respondd
-
-include ../gluon.mk
-
-
-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 +libnl-tiny
-endef
-
-define Build/Prepare
-	mkdir -p $(PKG_BUILD_DIR)
-	$(CP) ./src/* $(PKG_BUILD_DIR)/
-endef
-
-define Build/Compile
-	$(call Build/Compile/Default)
-	$(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
-endef
-
-define Package/gluon-mesh-batman-adv-core/install
-	$(CP) ./files/* $(1)/
-	$(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
-	$(INSTALL_DIR) $(1)/lib/gluon/respondd
-	$(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/mesh-batman-adv-core.so
-endef
-
-define Package/gluon-mesh-batman-adv-core/postinst
-#!/bin/sh
-$(call GluonCheckSite,check_site.lua)
-endef
-
-
-$(eval $(call BuildPackage,gluon-mesh-batman-adv-core))

+ 70 - 0
package/gluon-mesh-batman-adv/Makefile

@@ -0,0 +1,70 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gluon-mesh-batman-adv
+PKG_VERSION:=1
+
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
+PKG_BUILD_DEPENDS := respondd
+
+include ../gluon.mk
+
+
+define Package/gluon-mesh-batman-adv/common
+  SECTION:=gluon
+  CATEGORY:=Gluon
+  PROVIDES:=gluon-mesh-batman-adv
+  DEPENDS:=+gluon-core +libgluonutil +gluon-client-bridge +gluon-ebtables +firewall +libiwinfo +kmod-dummy +libnl-tiny
+endef
+
+define Package/gluon-mesh-batman-adv-14
+$(Package/gluon-mesh-batman-adv/common)
+  TITLE:=Support for batman-adv meshing (compat level 14)
+  CONFLICTS:=gluon-mesh-batman-adv-15
+  DEPENDS+=+kmod-batman-adv-legacy
+endef
+
+define Package/gluon-mesh-batman-adv-15
+$(Package/gluon-mesh-batman-adv/common)
+  TITLE:=Support for batman-adv meshing (compat level 15)
+  DEPENDS+=+kmod-batman-adv +batctl
+endef
+
+define Build/Prepare
+	mkdir -p $(PKG_BUILD_DIR)
+	$(CP) ./src/* $(PKG_BUILD_DIR)/
+endef
+
+define Build/Compile
+	$(call Build/Compile/Default)
+	$(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
+endef
+
+define Package/gluon-mesh-batman-adv/common/install
+	$(CP) ./files/* $(1)/
+	$(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
+	$(INSTALL_DIR) $(1)/lib/gluon/respondd
+	$(CP) $(PKG_BUILD_DIR)/respondd.so $(1)/lib/gluon/respondd/mesh-batman-adv.so
+
+	$(INSTALL_DIR) $(1)/lib/gluon/mesh-batman-adv
+endef
+
+define Package/gluon-mesh-batman-adv-14/install
+$(Package/gluon-mesh-batman-adv/common/install)
+	echo 14 > $(1)/lib/gluon/mesh-batman-adv/compat
+endef
+
+define Package/gluon-mesh-batman-adv-15/install
+$(Package/gluon-mesh-batman-adv/common/install)
+	echo 15 > $(1)/lib/gluon/mesh-batman-adv/compat
+endef
+
+define Package/gluon-mesh-batman-adv/common/postinst
+#!/bin/sh
+$(call GluonCheckSite,check_site.lua)
+endef
+Package/gluon-mesh-batman-adv-14/postinst := $(Package/gluon-mesh-batman-adv/common/postinst)
+Package/gluon-mesh-batman-adv-15/postinst := $(Package/gluon-mesh-batman-adv/common/postinst)
+
+
+$(eval $(call BuildPackage,gluon-mesh-batman-adv-14))
+$(eval $(call BuildPackage,gluon-mesh-batman-adv-15))

+ 0 - 0
package/gluon-mesh-batman-adv-core/check_site.lua → package/gluon-mesh-batman-adv/check_site.lua


+ 3 - 0
package/gluon-mesh-batman-adv/files/lib/gluon/core/mesh/setup.d/30-gluon-mesh-batman-adv

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /lib/gluon/mesh-batman-adv/config_mesh_interface setup

+ 3 - 0
package/gluon-mesh-batman-adv/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /lib/gluon/mesh-batman-adv/config_mesh_interface teardown

+ 0 - 0
package/gluon-mesh-batman-adv-core/files/lib/gluon/ebtables/250-next-node → package/gluon-mesh-batman-adv/files/lib/gluon/ebtables/250-next-node


+ 0 - 0
package/gluon-mesh-batman-adv-core/files/lib/gluon/ebtables/300-radv-input-output → package/gluon-mesh-batman-adv/files/lib/gluon/ebtables/300-radv-input-output


+ 0 - 0
package/gluon-mesh-batman-adv-core/files/lib/gluon/respondd/client.dev → package/gluon-mesh-batman-adv/files/lib/gluon/respondd/client.dev


+ 0 - 0
package/gluon-mesh-batman-adv-core/files/usr/lib/autoupdater/abort.d/10start-network → package/gluon-mesh-batman-adv/files/usr/lib/autoupdater/abort.d/10start-network


+ 0 - 0
package/gluon-mesh-batman-adv-core/files/usr/lib/autoupdater/upgrade.d/10stop-network → package/gluon-mesh-batman-adv/files/usr/lib/autoupdater/upgrade.d/10stop-network


+ 1 - 1
package/gluon-mesh-batman-adv-core/luasrc/lib/gluon/mesh-batman-adv-core/config_mesh_interface → package/gluon-mesh-batman-adv/luasrc/lib/gluon/mesh-batman-adv/config_mesh_interface

@@ -13,7 +13,7 @@ if cmd == 'setup' then
 	local fixed_mtu = tonumber(os.getenv('FIXED_MTU')) or 0
 	local transitive = tonumber(os.getenv('TRANSITIVE')) or 0
 
-	local mtu = tonumber(arg[2])
+	local mtu = 1532
 
 	if not fs.access('/sys/class/net/primary0') then
 		os.execute([[

+ 0 - 0
package/gluon-mesh-batman-adv-core/luasrc/lib/gluon/radvd/arguments → package/gluon-mesh-batman-adv/luasrc/lib/gluon/radvd/arguments


+ 0 - 0
package/gluon-mesh-batman-adv-core/luasrc/lib/gluon/upgrade/310-gluon-mesh-batman-adv-core-mesh → package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/310-gluon-mesh-batman-adv-mesh


+ 0 - 0
package/gluon-mesh-batman-adv-core/luasrc/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-client-bridge → package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/320-gluon-mesh-batman-adv-client-bridge


+ 0 - 0
package/gluon-mesh-batman-adv-core/luasrc/lib/gluon/upgrade/340-gluon-mesh-batman-adv-core-mac-addresses → package/gluon-mesh-batman-adv/luasrc/lib/gluon/upgrade/330-gluon-mesh-batman-adv-mac-addresses


+ 0 - 0
package/gluon-mesh-batman-adv-core/src/Makefile → package/gluon-mesh-batman-adv/src/Makefile


+ 0 - 0
package/gluon-mesh-batman-adv-core/src/batadv-netlink.c → package/gluon-mesh-batman-adv/src/batadv-netlink.c


+ 0 - 0
package/gluon-mesh-batman-adv-core/src/batadv-netlink.h → package/gluon-mesh-batman-adv/src/batadv-netlink.h


+ 0 - 0
package/gluon-mesh-batman-adv-core/src/batman_adv.h → package/gluon-mesh-batman-adv/src/batman_adv.h


+ 1 - 1
package/gluon-mesh-batman-adv-core/src/respondd.c → package/gluon-mesh-batman-adv/src/respondd.c

@@ -207,7 +207,7 @@ static struct json_object * get_mesh(void) {
 }
 
 static struct json_object * get_batman_adv_compat(void) {
-	FILE *f = fopen("/lib/gluon/mesh-batman-adv-core/compat", "r");
+	FILE *f = fopen("/lib/gluon/mesh-batman-adv/compat", "r");
 	if (!f)
 		return NULL;