From ec9d4a6c42311b3f1ef4edfda9d00765b285c420 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 27 Jul 2019 21:52:58 +0200 Subject: [PATCH 1/8] batmand: Drop batgat kernel module This kernel module is broken since 2013 and doesn't build. It can therefore be removed. Signed-off-by: Sven Eckelmann --- batmand/Makefile | 48 ++------------------------------ batmand/patches/100-2.6.36.patch | 47 ------------------------------- 2 files changed, 2 insertions(+), 93 deletions(-) delete mode 100644 batmand/patches/100-2.6.36.patch diff --git a/batmand/Makefile b/batmand/Makefile index 77497ab..b8520b9 100644 --- a/batmand/Makefile +++ b/batmand/Makefile @@ -6,7 +6,6 @@ # include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=batmand @@ -25,17 +24,11 @@ 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 -define Package/batmand/Default +define Package/batmand URL:=https://www.open-mesh.org/ MAINTAINER:=Corinna "Elektra" Aichele -endef - -define Package/batmand -$(call Package/batmand/Default) SECTION:=net CATEGORY:=Network SUBMENU:=Routing and Redirection @@ -47,20 +40,6 @@ define Package/batmand/description B.A.T.M.A.N. layer 3 routing daemon endef -define KernelPackage/batgat -$(call Package/batmand/Default) - SUBMENU:=Network Support - DEPENDS:=+batmand @BROKEN - TITLE:=B.A.T.M.A.N. gateway module - FILES:=$(PKG_KMOD_BUILD_DIR)/batgat.$(LINUX_KMOD_SUFFIX) - AUTOLOAD:=$(call AutoLoad,50,batgat) -endef - - -define KernelPackage/batgat/description -Kernel gateway module for B.A.T.M.A.N. for better tunnel performance -endef - MAKE_BATMAND_ARGS += \ EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_CFLAGS)' \ CCFLAGS="$(TARGET_CFLAGS)" \ @@ -73,30 +52,8 @@ MAKE_BATMAND_ARGS += \ STRIP="/bin/true" \ batmand install -MAKE_BATGAT_ARGS += \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH="$(LINUX_KARCH)" \ - PATH="$(TARGET_PATH)" \ - SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \ - LINUX_VERSION="$(LINUX_VERSION)" \ - REVISION="$(PKG_REV)" modules - - -define Build/Configure -endef - -ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_batmand),) - BUILD_BATMAND := $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_BATMAND_ARGS) -endif - -ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batgat),) - BUILD_BATGAT := $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATGAT_ARGS) -endif - define Build/Compile - $(BUILD_BATMAND) - cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile - $(BUILD_BATGAT) + $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_BATMAND_ARGS) endef define Package/batmand/install @@ -111,4 +68,3 @@ define Package/batmand/conffiles endef $(eval $(call BuildPackage,batmand)) -$(eval $(call KernelPackage,batgat)) diff --git a/batmand/patches/100-2.6.36.patch b/batmand/patches/100-2.6.36.patch deleted file mode 100644 index 13318e0..0000000 --- a/batmand/patches/100-2.6.36.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- - batman/linux/modules/gateway.c | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - ---- 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); - static int batgat_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg ); -+static long batgat_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg ); - - - static void udp_data_ready(struct sock *sk, int len); -@@ -53,7 +54,11 @@ static int proc_clients_read(char *buf, - static struct file_operations fops = { - .open = batgat_open, - .release = batgat_release, -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) -+ .unlocked_ioctl = batgat_ioctl_unlocked, -+#else - .ioctl = batgat_ioctl, -+#endif - }; - - -@@ -166,6 +171,20 @@ static int batgat_release(struct inode * - } - - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) -+#include -+static long batgat_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg ) -+{ -+ int ret; -+ -+ lock_kernel(); -+ ret = batgat_ioctl(file->f_path.dentry->d_inode, file, cmd, arg); -+ unlock_kernel(); -+ -+ return ret; -+} -+#endif -+ - static int batgat_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg ) - { - uint8_t tmp_ip[4]; From ebc6f4d5b3c63517456212278a99e03cdf87ced1 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 27 Jul 2019 22:02:50 +0200 Subject: [PATCH 2/8] batmand: Drop unused make parameters Signed-off-by: Sven Eckelmann --- batmand/Makefile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/batmand/Makefile b/batmand/Makefile index b8520b9..7f044bd 100644 --- a/batmand/Makefile +++ b/batmand/Makefile @@ -42,15 +42,10 @@ endef MAKE_BATMAND_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" \ - batmand install + batmand define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_BATMAND_ARGS) @@ -58,7 +53,7 @@ endef define Package/batmand/install $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batmand $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/batmand $(1)/usr/sbin/ $(INSTALL_BIN) ./files/etc/init.d/batmand $(1)/etc/init.d $(INSTALL_DATA) ./files/etc/config/batmand $(1)/etc/config endef From a3b791078264daab750033456693892df7911669 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 27 Jul 2019 22:10:04 +0200 Subject: [PATCH 3/8] batmand: Use standard Build/Compile rule batmand isn't using any special rules in Build/Compile. It is cleaner to directly use the global Build/Compile/Default instead of having a functional similar copy in the package Makefile Signed-off-by: Sven Eckelmann --- batmand/Makefile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/batmand/Makefile b/batmand/Makefile index 7f044bd..47d8741 100644 --- a/batmand/Makefile +++ b/batmand/Makefile @@ -22,8 +22,6 @@ PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz PKG_MIRROR_HASH:=ceb8e0e399f79b1b663594fcf9642e1efc40e696a7604daf709c77da9b6ec52f 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/batmand @@ -40,17 +38,13 @@ define Package/batmand/description B.A.T.M.A.N. layer 3 routing daemon endef -MAKE_BATMAND_ARGS += \ - EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_CFLAGS)' \ +MAKE_FLAGS += \ + EXTRA_CFLAGS='-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" -D_GNU_SOURCE' \ REVISION="$(PKG_REV)" \ CC="$(TARGET_CC)" \ UNAME="Linux" \ batmand -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_BATMAND_ARGS) -endef - define Package/batmand/install $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d $(INSTALL_BIN) $(PKG_BUILD_DIR)/batmand $(1)/usr/sbin/ From 8b9a7bba78e7f905098f076610c70b6aaa218428 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 27 Jul 2019 22:02:50 +0200 Subject: [PATCH 4/8] vis: Drop unused make parameters Signed-off-by: Sven Eckelmann --- vis/Makefile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/vis/Makefile b/vis/Makefile index af58f5e..ae44200 100644 --- a/vis/Makefile +++ b/vis/Makefile @@ -42,15 +42,9 @@ 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 + vis define Build/Configure @@ -62,7 +56,7 @@ 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) $(PKG_BUILD_DIR)/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 From eb8a4e8e872795b626cadf1c342c62941014f3a0 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 27 Jul 2019 22:10:04 +0200 Subject: [PATCH 5/8] vis: Use standard Build/Compile rule vis isn't using any special rules in Build/Compile. It is cleaner to directly use the global Build/Compile/Default instead of having a functional similar copy in the package Makefile Signed-off-by: Sven Eckelmann --- vis/Makefile | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/vis/Makefile b/vis/Makefile index ae44200..5da78b8 100644 --- a/vis/Makefile +++ b/vis/Makefile @@ -22,8 +22,6 @@ PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz PKG_MIRROR_HASH:=fd4b337a56993eec9a03ad8e7918bccc7691aa8b2e5ab6dd7863350f07503285 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 @@ -40,20 +38,12 @@ 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)' \ +MAKE_FLAGS += \ + EXTRA_CFLAGS='-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" -D_GNU_SOURCE' \ REVISION="$(PKG_REV)" \ CC="$(TARGET_CC)" \ vis - -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_BUILD_DIR)/vis $(1)/usr/sbin/ From 4c4b836d892e8f7ff64820b772119d820340df6b Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 27 Jul 2019 22:10:04 +0200 Subject: [PATCH 6/8] alfred: Use standard Build/Compile rule alfred isn't using any special rules in Build/Compile. It is cleaner to directly use the global Build/Compile/Default instead of having a functional similar copy in the package Makefile Signed-off-by: Sven Eckelmann --- alfred/Makefile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/alfred/Makefile b/alfred/Makefile index 535e712..9372307 100644 --- a/alfred/Makefile +++ b/alfred/Makefile @@ -54,7 +54,7 @@ define Package/alfred/config source "$(SOURCE)/Config.in" endef -MAKE_ALFRED_FLAGS=\ +MAKE_FLAGS += \ CONFIG_ALFRED_VIS=$(if $(CONFIG_PACKAGE_ALFRED_VIS),y,n) \ CONFIG_ALFRED_GPSD=$(if $(CONFIG_PACKAGE_ALFRED_GPSD),y,n) \ CONFIG_ALFRED_CAPABILITIES=n \ @@ -65,12 +65,6 @@ MAKE_ALFRED_FLAGS=\ TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto TARGET_LDFLAGS += -Wl,--gc-sections -fuse-linker-plugin -define Build/Compile - CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ - $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) $(MAKE_ALFRED_FLAGS) all -endef - define Package/alfred/install $(INSTALL_DIR) $(1)/usr/sbin cp -fpR $(PKG_BUILD_DIR)/alfred $(1)/usr/sbin/ From 44e375c0a30134ee96bb52db1b2400a168f16503 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 27 Jul 2019 22:29:04 +0200 Subject: [PATCH 7/8] alfred: Drop unused init-y variable The Makefile defines the init-y variable but neither this Makefile nor OpenWrt's common files use this variable. Signed-off-by: Sven Eckelmann --- alfred/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/alfred/Makefile b/alfred/Makefile index 9372307..2982265 100644 --- a/alfred/Makefile +++ b/alfred/Makefile @@ -18,8 +18,6 @@ PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk -init-y := alfred - define Package/alfred URL:=https://www.open-mesh.org/ SECTION:=net From f921555cf79866d04b8baac92915f33bafef0717 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 27 Jul 2019 22:10:04 +0200 Subject: [PATCH 8/8] batctl: Use standard Build/Compile rule batctl isn't using any special rules in Build/Compile. It is cleaner to directly use the global Build/Compile/Default instead of having a functional similar copy in the package Makefile Signed-off-by: Sven Eckelmann --- batctl/Makefile | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/batctl/Makefile b/batctl/Makefile index 7cbb9bd..25eff7d 100644 --- a/batctl/Makefile +++ b/batctl/Makefile @@ -88,18 +88,11 @@ TARGET_LDFLAGS += -Wl,--gc-sections TARGET_CFLAGS += -flto TARGET_LDFLAGS += -fuse-linker-plugin -MAKE_BATCTL_ENV += \ - CPPFLAGS="$(TARGET_CPPFLAGS)" \ - CFLAGS="$(TARGET_CFLAGS)" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ +MAKE_VARS += \ LIBNL_NAME="libnl-tiny" \ LIBNL_GENL_NAME="libnl-tiny" -MAKE_BATCTL_ARGS += \ - REVISION="$(PKG_BATCTL_SHORTREV)" \ - CC="$(TARGET_CC)" \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - batctl install \ +MAKE_FLAGS += \ REVISION="openwrt-$(PKG_VERSION)-$(PKG_RELEASE)" config-n := \ @@ -222,10 +215,7 @@ $(call ConfigVars,n)$(call ConfigVars,y) endef $(eval $(call shexport,batctl_config)) -define Build/Compile - $(MAKE_BATCTL_ENV) $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS) \ - $$$$$(call shvar,batctl_config) -endef +MAKE_FLAGS += $$$$$(call shvar,batctl_config) define Package/batctl-tiny/install $(INSTALL_DIR) $(1)/usr/libexec