-
Notifications
You must be signed in to change notification settings - Fork 10
/
usbip.patch
109 lines (109 loc) · 2.74 KB
/
usbip.patch
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
--- /dev/null
+++ package/network/utils/usbip/Makefile
@@ -0,0 +1,106 @@
+#
+# Copyright (C) 2010-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:=usbip
+PKG_RELEASE:=2
+
+# Since kernel 2.6.39.1 userspace tools are inside the kernel tree
+# Package Automatic match version in kernel
+# MD5SUM is not useful kernel package already check it
+PKG_VERSION:=$(shell sed -n -e '/^AC_INIT/s/.*\[\([[:digit:]\.]*\)\].*/\1/gp' $(LINUX_DIR)/tools/usb/usbip/configure.ac)
+PKG_SOURCE:=
+PKG_SOURCE_URL:=
+PKG_MD5SUM:=unknown
+PATCH_DIR:=./patches-$(PKG_VERSION)
+
+define prepare_source_directory
+ rm -rf $(PKG_BUILD_DIR)
+ $(CP) $(LINUX_DIR)/tools/usb/usbip $(PKG_BUILD_DIR)
+endef
+Hooks/Prepare/Pre += prepare_source_directory
+
+PKG_BUILD_DEPENDS:=glib2 sysfsutils
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/usbip/Common
+ TITLE:=USB-over-IP
+ URL:=http://usbip.sourceforge.net/
+ DEPENDS:=@USB_SUPPORT @LINUX_3_10||@LINUX_3_13||@LINUX_3_14||@LINUX_3_18
+ MAINTAINER:=Nuno Goncalves <[email protected]>
+endef
+
+define Package/usbip/Default
+ $(call Package/usbip/Common)
+ SECTION:=net
+ CATEGORY:=Network
+endef
+
+define Package/usbip
+ $(call Package/usbip/Default)
+ TITLE+= (common)
+ DEPENDS+= +libsysfs +libwrap +udev +kmod-usbip
+endef
+
+define Package/usbip-client
+ $(call Package/usbip/Default)
+ TITLE+= (client)
+ DEPENDS+= usbip +glib2 +kmod-usbip-client
+endef
+
+define Package/usbip-server
+ $(call Package/usbip/Default)
+ TITLE+= (server)
+ DEPENDS+= usbip usbip-client +glib2 +kmod-usbip-server
+endef
+
+CONFIGURE_PATH:=.
+MAKE_PATH:=.
+LIBTOOL_PATHS:=.
+MAKE_FLAGS+=CFLAGS="-Wno-implicit-function-declaration"
+
+define Build/Configure
+ (cd $(PKG_BUILD_DIR); ./autogen.sh );
+ $(call Build/Configure/Default)
+endef
+
+CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
+
+define Download/usb.ids
+ URL:=http://www.linux-usb.org/
+ FILE:=usb.ids
+ MD5SUM:=
+endef
+
+define Package/usbip/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/share/hwdata
+ $(CP) $(DL_DIR)/usb.ids $(1)/usr/share/hwdata/
+endef
+
+define Package/usbip-client/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbip $(1)/usr/sbin/
+endef
+
+define Package/usbip-server/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(CP) $(PKG_INSTALL_DIR)/usr/sbin/usbipd $(1)/usr/sbin/
+endef
+
+$(eval $(call Download,usb.ids))
+$(eval $(call BuildPackage,usbip))
+$(eval $(call BuildPackage,usbip-client))
+$(eval $(call BuildPackage,usbip-server))
+