include $(INCLUDE_DIR)/package.mk
-init-y := alfred
-
define Package/alfred
URL:=https://www.open-mesh.org/
SECTION:=net
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 \
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/
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 := \
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
#
include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=batmand
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
-
-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 <onelektra@gmx.net>
-endef
-
-define Package/batmand
-$(call Package/batmand/Default)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Routing and Redirection
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)" \
- OFLAGS="$(TARGET_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)" \
- NODEBUG=1 \
UNAME="Linux" \
- INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
- 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)
-endef
+ batmand
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
endef
$(eval $(call BuildPackage,batmand))
-$(eval $(call KernelPackage,batgat))
+++ /dev/null
----
- 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 <linux/smp_lock.h>
-+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];
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
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)" \
+MAKE_FLAGS += \
+ EXTRA_CFLAGS='-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\" -D_GNU_SOURCE' \
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
+ vis
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