b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2012 OpenWrt.org |
| 3 | # |
| 4 | # This is free software, licensed under the GNU General Public License v2. |
| 5 | # See /LICENSE for more information. |
| 6 | # |
| 7 | |
| 8 | include $(TOPDIR)/rules.mk |
| 9 | include $(INCLUDE_DIR)/kernel.mk |
| 10 | |
| 11 | PKG_NAME:=trelay |
| 12 | PKG_RELEASE:=2 |
| 13 | |
| 14 | include $(INCLUDE_DIR)/package.mk |
| 15 | |
| 16 | define KernelPackage/trelay |
| 17 | SUBMENU:=Network Support |
| 18 | TITLE:=Trivial Ethernet Relay |
| 19 | FILES:=$(PKG_BUILD_DIR)/trelay.ko |
| 20 | AUTOLOAD:=$(call AutoLoad,50,trelay) |
| 21 | endef |
| 22 | |
| 23 | define KernelPackage/trelay/description |
| 24 | trelay relays ethernet packets between two devices (similar to a bridge), but |
| 25 | without any MAC address checks. This makes it possible to bridge client mode |
| 26 | or ad-hoc mode wifi devices to ethernet VLANs, assuming the remote end uses |
| 27 | the same source MAC address as the device that packets are supposed to exit |
| 28 | from. |
| 29 | endef |
| 30 | |
| 31 | include $(INCLUDE_DIR)/kernel-defaults.mk |
| 32 | |
| 33 | define Build/Compile |
| 34 | $(KERNEL_MAKE) M="$(PKG_BUILD_DIR)" modules |
| 35 | endef |
| 36 | |
| 37 | define KernelPackage/trelay/conffiles |
| 38 | /etc/config/trelay |
| 39 | endef |
| 40 | |
| 41 | define KernelPackage/trelay/install |
| 42 | $(INSTALL_DIR) $(1)/etc/hotplug.d/net $(1)/etc/init.d $(1)/etc/config |
| 43 | $(INSTALL_CONF) ./files/trelay.hotplug $(1)/etc/hotplug.d/net/50-trelay |
| 44 | $(INSTALL_BIN) ./files/trelay.init $(1)/etc/init.d/trelay |
| 45 | $(INSTALL_CONF) ./files/trelay.config $(1)/etc/config/trelay |
| 46 | endef |
| 47 | |
| 48 | $(eval $(call KernelPackage,trelay)) |