summaryrefslogtreecommitdiff
path: root/package/trelay/Makefile
blob: cbe0f045cf3a375c19e8aaf5af0b457b979bab1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# Copyright (C) 2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=trelay
PKG_VERSION:=0.1
PKG_RELEASE:=1

include $(INCLUDE_DIR)/package.mk

define KernelPackage/trelay
  SUBMENU:=Network Support
  TITLE:=Trivial Ethernet Relay
  DEPENDS:=@!LINUX_2_6_30 @!LINUX_2_6_31 @!LINUX_2_6_32
  FILES:=$(PKG_BUILD_DIR)/trelay.ko
  AUTOLOAD:=$(call AutoLoad,50,trelay)
endef

define KernelPackage/trelay/description
trelay relays ethernet packets between two devices (similar to a bridge), but
without any MAC address checks. This makes it possible to bridge client mode
or ad-hoc mode wifi devices to ethernet VLANs, assuming the remote end uses
the same source MAC address as the device that packets are supposed to exit
from.
endef

include $(INCLUDE_DIR)/kernel-defaults.mk

define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	cp src/Makefile src/trelay.c $(PKG_BUILD_DIR)/
endef

define Build/Compile
	$(MAKE) $(KERNEL_MAKEOPTS) SUBDIRS="$(PKG_BUILD_DIR)" modules
endef

define KernelPackage/trelay/install
	$(INSTALL_DIR) $(1)/etc/hotplug.d/net $(1)/etc/init.d $(1)/etc/config
	$(INSTALL_DATA) ./files/trelay.hotplug $(1)/etc/hotplug.d/net/50-trelay
	$(INSTALL_BIN) ./files/trelay.init $(1)/etc/init.d/trelay
	$(INSTALL_DATA) ./files/trelay.config $(1)/etc/config/trelay
endef

$(eval $(call KernelPackage,trelay))