2010-04-18 03:20:30 +00:00
|
|
|
#
|
2011-10-21 23:00:13 +00:00
|
|
|
# Copyright (C) 2010-2011 OpenWrt.org
|
2010-04-18 03:20:30 +00:00
|
|
|
#
|
|
|
|
# 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_VERSION:=0.1.7
|
2011-10-21 23:00:13 +00:00
|
|
|
PKG_RELEASE:=2
|
2010-04-18 03:20:30 +00:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=@SF/usbip
|
|
|
|
PKG_MD5SUM:=d1094b6d4449787864f8be001639232c
|
|
|
|
|
2011-10-21 23:00:13 +00:00
|
|
|
PKG_BUILD_DEPENDS:=glib2 sysfsutils
|
|
|
|
PKG_FIXUP:=libtool autoreconf
|
2010-04-18 03:20:30 +00:00
|
|
|
PKG_INSTALL:=1
|
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2011-02-02 18:54:24 +00:00
|
|
|
include $(INCLUDE_DIR)/nls.mk
|
2010-04-18 03:20:30 +00:00
|
|
|
|
|
|
|
define Package/usbip/Common
|
|
|
|
TITLE:=USB-over-IP
|
|
|
|
URL:=http://usbip.sourceforge.net/
|
2011-11-11 18:07:06 +00:00
|
|
|
DEPENDS:=@USB_SUPPORT
|
2010-07-14 23:40:58 +00:00
|
|
|
MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
|
2010-04-18 03:20:30 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/usbip/Default
|
|
|
|
$(call Package/usbip/Common)
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/usbip
|
|
|
|
$(call Package/usbip/Default)
|
|
|
|
TITLE+= (common)
|
2011-10-21 23:00:13 +00:00
|
|
|
DEPENDS+= +libsysfs +libwrap +kmod-usbip
|
2010-04-18 03:20:30 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/usbip-client
|
|
|
|
$(call Package/usbip/Default)
|
|
|
|
TITLE+= (client)
|
2011-10-21 23:00:13 +00:00
|
|
|
DEPENDS+= usbip +glib2 +kmod-usbip-client
|
2010-04-18 03:20:30 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/usbip-server
|
|
|
|
$(call Package/usbip/Default)
|
|
|
|
TITLE+= (server)
|
2011-10-21 23:00:13 +00:00
|
|
|
DEPENDS+= usbip +glib2 +kmod-usbip-server
|
2010-04-18 03:20:30 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define KernelPackage/usbip/Default
|
|
|
|
$(call Package/usbip/Common)
|
|
|
|
SUBMENU:=USB Support
|
|
|
|
endef
|
|
|
|
|
|
|
|
define KernelPackage/usbip
|
|
|
|
$(call KernelPackage/usbip/Default)
|
|
|
|
TITLE+= (kernel support)
|
2011-07-24 09:10:01 +00:00
|
|
|
DEPENDS+= +kmod-usb-core
|
2011-07-24 09:09:59 +00:00
|
|
|
KCONFIG:= \
|
|
|
|
CONFIG_USB_IP_COMMON CONFIG_USB_IP_DEBUG_ENABLE=n \
|
|
|
|
CONFIG_USBIP_CORE CONFIG_USBIP_DEBUG=n
|
|
|
|
ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),le,2.6.39)),1)
|
2010-04-18 03:20:30 +00:00
|
|
|
FILES:=$(LINUX_DIR)/drivers/staging/usbip/usbip_common_mod.$(LINUX_KMOD_SUFFIX)
|
|
|
|
AUTOLOAD:=$(call AutoLoad,98,usbip_common_mod)
|
2011-07-24 09:09:59 +00:00
|
|
|
else
|
|
|
|
FILES:=$(LINUX_DIR)/drivers/staging/usbip/usbip-core.ko
|
|
|
|
AUTOLOAD:=$(call AutoLoad,98,usbip-core)
|
|
|
|
endif
|
2010-04-18 03:20:30 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define KernelPackage/usbip-client
|
|
|
|
$(call KernelPackage/usbip/Default)
|
|
|
|
TITLE+= (kernel client driver)
|
2010-10-05 22:48:11 +00:00
|
|
|
DEPENDS+= kmod-usbip
|
2011-07-24 09:09:59 +00:00
|
|
|
KCONFIG:= CONFIG_USB_IP_VHCI_HCD CONFIG_USBIP_VHCI_HCD
|
2010-04-18 03:20:30 +00:00
|
|
|
FILES:=$(LINUX_DIR)/drivers/staging/usbip/vhci-hcd.$(LINUX_KMOD_SUFFIX)
|
|
|
|
AUTOLOAD:=$(call AutoLoad,99,vhci-hcd)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define KernelPackage/usbip-server
|
|
|
|
$(call KernelPackage/usbip/Default)
|
|
|
|
TITLE+= (kernel host driver)
|
2010-10-05 22:48:11 +00:00
|
|
|
DEPENDS+= kmod-usbip
|
2011-07-24 09:09:59 +00:00
|
|
|
KCONFIG:= CONFIG_USB_IP_HOST CONFIG_USBIP_HOST
|
|
|
|
ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),le,2.6.39)),1)
|
2010-04-18 03:20:30 +00:00
|
|
|
FILES:=$(LINUX_DIR)/drivers/staging/usbip/usbip.$(LINUX_KMOD_SUFFIX)
|
|
|
|
AUTOLOAD:=$(call AutoLoad,99,usbip)
|
2011-07-24 09:09:59 +00:00
|
|
|
else
|
|
|
|
FILES:=$(LINUX_DIR)/drivers/staging/usbip/usbip-host.ko
|
|
|
|
AUTOLOAD:=$(call AutoLoad,99,usbip-host)
|
|
|
|
endif
|
2010-04-18 03:20:30 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/kernel-defaults.mk
|
|
|
|
|
|
|
|
CONFIGURE_PATH:=./src
|
|
|
|
MAKE_PATH:=./src
|
|
|
|
LIBTOOL_PATHS:=./src
|
|
|
|
|
2010-10-21 09:57:57 +00:00
|
|
|
CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
|
|
|
|
|
2010-04-18 03:20:30 +00:00
|
|
|
define Build/Compile/kmod
|
|
|
|
$(MAKE) $(KERNEL_MAKEOPTS) \
|
|
|
|
SUBDIRS="$(LINUX_DIR)/drivers/staging/usbip" \
|
|
|
|
CONFIG_USB_IP_COMMON=m \
|
|
|
|
CONFIG_USB_IP_VHCI_HCD=m \
|
|
|
|
CONFIG_USB_IP_HOST=m \
|
2011-07-24 09:09:59 +00:00
|
|
|
CONFIG_USBIP_CORE=m \
|
|
|
|
CONFIG_USBIP_VHCI_HCD=m \
|
|
|
|
CONFIG_USBIP_HOST=m \
|
2010-04-18 03:20:30 +00:00
|
|
|
modules
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Compile
|
|
|
|
$(call Build/Compile/Default)
|
|
|
|
$(call Build/Compile/kmod)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/usbip/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
|
|
|
$(CP) \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/lib/libusbip.so.* \
|
|
|
|
$(1)/usr/lib/
|
2011-10-21 23:00:13 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/share/usbip
|
2010-04-18 03:20:30 +00:00
|
|
|
$(CP) \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/share/usbip/usb.ids \
|
2011-10-21 23:00:13 +00:00
|
|
|
$(1)/usr/share/usbip/
|
2010-04-18 03:20:30 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/usbip-client/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
|
|
$(CP) \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/usbip \
|
|
|
|
$(1)/usr/bin/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/usbip-server/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
|
|
$(CP) \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/usbipd \
|
|
|
|
$(1)/usr/bin/
|
2010-07-14 23:40:58 +00:00
|
|
|
$(CP) \
|
|
|
|
$(PKG_INSTALL_DIR)/usr/bin/bind_driver \
|
|
|
|
$(1)/usr/bin/usbip_bind_driver
|
2010-04-18 03:20:30 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,usbip))
|
|
|
|
$(eval $(call BuildPackage,usbip-client))
|
|
|
|
$(eval $(call BuildPackage,usbip-server))
|
|
|
|
$(eval $(call KernelPackage,usbip))
|
|
|
|
$(eval $(call KernelPackage,usbip-client))
|
|
|
|
$(eval $(call KernelPackage,usbip-server))
|