From a31039825c066d91feffc927913381020ecb84b7 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 18 Jan 2017 02:45:18 +0100 Subject: [PATCH 1/5] batmand: switch to tarball download, fix build with musl libc Since the upstream SVN repository is not available anymore, update the Makefile to fetch tarballs cached by the LEDE or OpenWrt projects instead. Also add a missing -D_GNU_SOURCE to the target flags to fix compilation with musl libc. Signed-off-by: Jo-Philipp Wich --- batmand/Makefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/batmand/Makefile b/batmand/Makefile index a807650..2372ce3 100644 --- a/batmand/Makefile +++ b/batmand/Makefile @@ -11,15 +11,13 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=batmand PKG_REV:=1439 PKG_VERSION:=r$(PKG_REV) -PKG_RELEASE:=2 -PKG_EXTRA_CFLAGS=-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" +PKG_RELEASE:=3 +PKG_EXTRA_CFLAGS=-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" -D_GNU_SOURCE -PKG_SOURCE_PROTO:=svn +PKG_HASH:=3c72ce2aae889944acfc898434c6e9573b20815862db1938f3132cc50b669667 PKG_SOURCE_VERSION:=$(PKG_REV) -PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),$(PKG_NAME))-$(PKG_VERSION) -PKG_SOURCE_URL:=http://downloads.open-mesh.org/svn/batman/trunk/ -PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_SOURCE_SUBDIR) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://sources.lede-project.org https://downloads.openwrt.org/sources PKG_LICENSE:=GPL-2.0 PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman/linux/modules From fd0439743a9b7f4b4f89de632ca921795db18a5a Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Wed, 18 Jan 2017 13:01:20 +0100 Subject: [PATCH 2/5] batmand: Replace maintainer with Elektra The mail address for Marek Lindner was not up to date. Marek was also not maintaining this package and was forwarding requests to Elektra: "Elektra is the maintainer for batmand. I'd rather not interfere." https://github.com/openwrt-routing/packages/pull/134#issuecomment-236346560 Signed-off-by: Sven Eckelmann --- batmand/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/batmand/Makefile b/batmand/Makefile index 2372ce3..4c8bf30 100644 --- a/batmand/Makefile +++ b/batmand/Makefile @@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk define Package/batmand/Default URL:=http://www.open-mesh.org/ - MAINTAINER:=Marek Lindner + MAINTAINER:=Corinna "Elektra" Aichele endef define Package/batmand From c48460940db21d4d12cc8f766c8fa2369646bc6c Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Wed, 18 Jan 2017 12:59:53 +0100 Subject: [PATCH 3/5] batmand: Switch upstream URL to HTTPS The open-mesh.org server is not serving plain HTTP pages since a while. Updating the default URL to https is therefore prefered. Signed-off-by: Sven Eckelmann --- batmand/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/batmand/Makefile b/batmand/Makefile index 4c8bf30..12bbd2e 100644 --- a/batmand/Makefile +++ b/batmand/Makefile @@ -25,7 +25,7 @@ PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman/linux/modules include $(INCLUDE_DIR)/package.mk define Package/batmand/Default - URL:=http://www.open-mesh.org/ + URL:=https://www.open-mesh.org/ MAINTAINER:=Corinna "Elektra" Aichele endef From 4eb57b4298919e1e29eeff7dd76f0915ac1a374e Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Wed, 18 Jan 2017 13:05:51 +0100 Subject: [PATCH 4/5] vis: Extract vis package from batmand The batmand and vis sources are actually stored in two different repositories. It therefore makes more sense to have these two packages also split in two different OpenWrt packages. This also allows to get the vis sources directly from the git repository. The SVN version of vis r1439 was actually r1346. The git export of revision r1346 is referenced by this commit. Signed-off-by: Sven Eckelmann --- batmand/Makefile | 44 +--------------- vis/Makefile | 73 +++++++++++++++++++++++++++ {batmand => vis}/files/etc/config/vis | 0 {batmand => vis}/files/etc/init.d/vis | 0 4 files changed, 74 insertions(+), 43 deletions(-) create mode 100644 vis/Makefile rename {batmand => vis}/files/etc/config/vis (100%) rename {batmand => vis}/files/etc/init.d/vis (100%) diff --git a/batmand/Makefile b/batmand/Makefile index 12bbd2e..3822dde 100644 --- a/batmand/Makefile +++ b/batmand/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=batmand PKG_REV:=1439 PKG_VERSION:=r$(PKG_REV) -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_EXTRA_CFLAGS=-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" -D_GNU_SOURCE PKG_HASH:=3c72ce2aae889944acfc898434c6e9573b20815862db1938f3132cc50b669667 @@ -42,19 +42,6 @@ define Package/batmand/description B.A.T.M.A.N. layer 3 routing daemon endef -define Package/vis -$(call Package/batmand/Default) - SECTION:=net - CATEGORY:=Network - SUBMENU:=Routing and Redirection - DEPENDS:=+libpthread - TITLE:=visualization server for B.A.T.M.A.N. layer 3 -endef - -define Package/vis/description -visualization server for B.A.T.M.A.N. layer 3 -endef - define KernelPackage/batgat $(call Package/batmand/Default) SUBMENU:=Network Support @@ -80,18 +67,6 @@ MAKE_BATMAND_ARGS += \ INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ STRIP="/bin/true" \ batmand install - -MAKE_VIS_ARGS += \ - EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_CFLAGS)' \ - CCFLAGS="$(TARGET_CFLAGS)" \ - OFLAGS="$(TARGET_CFLAGS)" \ - REVISION="$(PKG_REV)" \ - CC="$(TARGET_CC)" \ - NODEBUG=1 \ - UNAME="Linux" \ - INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ - STRIP="/bin/true" \ - vis install MAKE_BATGAT_ARGS += \ CROSS_COMPILE="$(TARGET_CROSS)" \ @@ -108,10 +83,6 @@ endef ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_batmand),) BUILD_BATMAND := $(MAKE) -C $(PKG_BUILD_DIR)/batman $(MAKE_BATMAND_ARGS) endif - -ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_vis),) - BUILD_VIS := $(MAKE) -C $(PKG_BUILD_DIR)/vis $(MAKE_VIS_ARGS) -endif ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batgat),) BUILD_BATGAT := $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATGAT_ARGS) @@ -119,7 +90,6 @@ endif define Build/Compile $(BUILD_BATMAND) - $(BUILD_VIS) cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile $(BUILD_BATGAT) endef @@ -135,17 +105,5 @@ define Package/batmand/conffiles /etc/config/batmand endef -define Package/vis/install - $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/vis $(1)/usr/sbin/ - $(INSTALL_BIN) ./files/etc/init.d/vis $(1)/etc/init.d - $(INSTALL_DATA) ./files/etc/config/vis $(1)/etc/config -endef - -define Package/vis/conffiles -/etc/config/vis -endef - $(eval $(call BuildPackage,batmand)) -$(eval $(call BuildPackage,vis)) $(eval $(call KernelPackage,batgat)) diff --git a/vis/Makefile b/vis/Makefile new file mode 100644 index 0000000..889b410 --- /dev/null +++ b/vis/Makefile @@ -0,0 +1,73 @@ +# +# Copyright (C) 2008-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=vis + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://git.open-mesh.org/vis.git +PKG_REV:=e141311c6a4fc824efbad536c137ed279905d825 +PKG_VERSION:=1440 +PKG_RELEASE:=0 +PKG_LICENSE:=GPL-2.0 + +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) + +PKG_EXTRA_CFLAGS=-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" -D_GNU_SOURCE + +include $(INCLUDE_DIR)/package.mk + +define Package/vis + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + DEPENDS:=+libpthread + TITLE:=visualization server for B.A.T.M.A.N. layer 3 + URL:=https://www.open-mesh.org/ + MAINTAINER:=Corinna "Elektra" Aichele +endef + +define Package/vis/description +visualization server for B.A.T.M.A.N. layer 3 +endef + +MAKE_VIS_ARGS += \ + EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_CFLAGS)' \ + CCFLAGS="$(TARGET_CFLAGS)" \ + OFLAGS="$(TARGET_CFLAGS)" \ + REVISION="$(PKG_REV)" \ + CC="$(TARGET_CC)" \ + NODEBUG=1 \ + UNAME="Linux" \ + INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ + STRIP="/bin/true" \ + vis install + + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_VIS_ARGS) +endef + +define Package/vis/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/vis $(1)/usr/sbin/ + $(INSTALL_BIN) ./files/etc/init.d/vis $(1)/etc/init.d + $(INSTALL_DATA) ./files/etc/config/vis $(1)/etc/config +endef + +define Package/vis/conffiles +/etc/config/vis +endef + +$(eval $(call BuildPackage,vis)) diff --git a/batmand/files/etc/config/vis b/vis/files/etc/config/vis similarity index 100% rename from batmand/files/etc/config/vis rename to vis/files/etc/config/vis diff --git a/batmand/files/etc/init.d/vis b/vis/files/etc/init.d/vis similarity index 100% rename from batmand/files/etc/init.d/vis rename to vis/files/etc/init.d/vis From 6684bff25360be563e26d6c762c761f581a27581 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Wed, 18 Jan 2017 13:34:16 +0100 Subject: [PATCH 5/5] batmand: Use git repository to retrieve sources The current package is build around the subversion repository which does not exist anymore. The package can therefore be moved to the git repository to have an official source for the revision used in OpenWrt. The SVN version of batman r1439 was actually r1435. The git export of revision r1435 is referenced by this commit. The version number was only increased to 1440 to create a new source tarball. SVN revision r1440 is not a commit for batman and therefore no code changes in batman was done in r1440. Signed-off-by: Sven Eckelmann --- batmand/Makefile | 24 ++++++++++++++---------- batmand/patches/100-2.6.36.patch | 4 ++-- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/batmand/Makefile b/batmand/Makefile index 3822dde..c4284ca 100644 --- a/batmand/Makefile +++ b/batmand/Makefile @@ -9,18 +9,22 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=batmand -PKG_REV:=1439 -PKG_VERSION:=r$(PKG_REV) -PKG_RELEASE:=4 -PKG_EXTRA_CFLAGS=-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" -D_GNU_SOURCE -PKG_HASH:=3c72ce2aae889944acfc898434c6e9573b20815862db1938f3132cc50b669667 -PKG_SOURCE_VERSION:=$(PKG_REV) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://sources.lede-project.org https://downloads.openwrt.org/sources +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://git.open-mesh.org/batmand.git +PKG_REV:=b67a7087b51d7a5e90d27ac39116d1f57257c86e +PKG_VERSION:=1440 +PKG_RELEASE:=0 PKG_LICENSE:=GPL-2.0 -PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman/linux/modules +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) + +PKG_EXTRA_CFLAGS=-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" -D_GNU_SOURCE + +PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/linux/modules include $(INCLUDE_DIR)/package.mk @@ -81,7 +85,7 @@ define Build/Configure endef ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_batmand),) - BUILD_BATMAND := $(MAKE) -C $(PKG_BUILD_DIR)/batman $(MAKE_BATMAND_ARGS) + BUILD_BATMAND := $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_BATMAND_ARGS) endif ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batgat),) diff --git a/batmand/patches/100-2.6.36.patch b/batmand/patches/100-2.6.36.patch index 566c23b..13318e0 100644 --- a/batmand/patches/100-2.6.36.patch +++ b/batmand/patches/100-2.6.36.patch @@ -2,8 +2,8 @@ batman/linux/modules/gateway.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) ---- batmand-r1439.orig/batman/linux/modules/gateway.c -+++ batmand-r1439/batman/linux/modules/gateway.c +--- batmand-r1439.orig/linux/modules/gateway.c ++++ batmand-r1439/linux/modules/gateway.c @@ -29,6 +29,7 @@ static struct class *batman_class; static int batgat_open(struct inode *inode, struct file *filp); static int batgat_release(struct inode *inode, struct file *file);