2 # Copyright (C) 2012 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
15 include $(INCLUDE_DIR)/package.mk
17 define KernelPackage/trelay
18 SUBMENU:=Network Support
19 TITLE:=Trivial Ethernet Relay
20 FILES:=$(PKG_BUILD_DIR)/trelay.ko
21 AUTOLOAD:=$(call AutoLoad,50,trelay)
24 define KernelPackage/trelay/description
25 trelay relays ethernet packets between two devices (similar to a bridge), but
26 without any MAC address checks. This makes it possible to bridge client mode
27 or ad-hoc mode wifi devices to ethernet VLANs, assuming the remote end uses
28 the same source MAC address as the device that packets are supposed to exit
32 include $(INCLUDE_DIR)/kernel-defaults.mk
35 mkdir -p $(PKG_BUILD_DIR)
36 cp src/Makefile src/trelay.c $(PKG_BUILD_DIR)/
40 $(MAKE) $(KERNEL_MAKEOPTS) SUBDIRS="$(PKG_BUILD_DIR)" modules
43 define KernelPackage/trelay/conffiles
47 define KernelPackage/trelay/install
48 $(INSTALL_DIR) $(1)/etc/hotplug.d/net $(1)/etc/init.d $(1)/etc/config
49 $(INSTALL_DATA) ./files/trelay.hotplug $(1)/etc/hotplug.d/net/50-trelay
50 $(INSTALL_BIN) ./files/trelay.init $(1)/etc/init.d/trelay
51 $(INSTALL_DATA) ./files/trelay.config $(1)/etc/config/trelay
54 $(eval $(call KernelPackage,trelay))