Browse Source

usbip: adapt package to new kernel/libudev

The sources for usbip are within the kernel.  A patch that was included
with the package, which changed the old signal name SIGCLD to the new
one, SIGCHLD, was merged upstream.  However, different targets use
different kernel versions.  Current version 4.14 and 4.9 are fine, but
older versions do not have the patch applied.  So, I used
-DSIGCLD=SIGCHLD to please both worlds.

libudev-fbsd currently used by openwrt does not implement the
udev_device_get_devpath function.  eudev's implementation of libudev
sets it as (src/libudev/libudev-device.c):
udev_device->devpath = udev_device->syspath + strlen("/sys");
I used a command-line define to use the same logic, as it works with
new and old versions of the kernel--the use of ..devpath is quite
recent.

I also linked with libbsd, when using glibc.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
lilik-openwrt-22.03
Eneas U de Queiroz 7 years ago
parent
commit
633fe0dbdf
2 changed files with 6 additions and 14 deletions
  1. +6
    -3
      net/usbip/Makefile
  2. +0
    -11
      net/usbip/patches-2.0/100-musl-compat.patch

+ 6
- 3
net/usbip/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=usbip PKG_NAME:=usbip
PKG_RELEASE:=9
PKG_RELEASE:=10
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
# Since kernel 2.6.39.1 userspace tools are inside the kernel tree # Since kernel 2.6.39.1 userspace tools are inside the kernel tree
@ -52,7 +52,7 @@ endef
define Package/usbip define Package/usbip
$(call Package/usbip/Default) $(call Package/usbip/Default)
TITLE+= (common) TITLE+= (common)
DEPENDS+= +libwrap +kmod-usbip +libudev-fbsd
DEPENDS+= +libwrap +kmod-usbip +libudev-fbsd +USE_GLIBC:libbsd
endef endef
define Package/usbip-client define Package/usbip-client
@ -70,13 +70,16 @@ endef
CONFIGURE_PATH:=. CONFIGURE_PATH:=.
MAKE_PATH:=. MAKE_PATH:=.
LIBTOOL_PATHS:=. LIBTOOL_PATHS:=.
MAKE_FLAGS+=CFLAGS="-Wno-implicit-function-declaration"
MAKE_FLAGS+=CFLAGS='-Dudev_device_get_devpath\(x\)=udev_device_get_syspath\(x\)+strlen\(\"/sys\"\) \
-DSIGCLD=SIGCHLD'
CONFIGURE_ARGS+= --disable-silent-rules
define Build/Configure define Build/Configure
(cd $(PKG_BUILD_DIR); ./autogen.sh ); (cd $(PKG_BUILD_DIR); ./autogen.sh );
$(call Build/Configure/Default) $(call Build/Configure/Default)
endef endef
CONFIGURE_VARS+= $(if $(CONFIG_USE_GLIBC),LIBS='-lbsd -lpthread')
CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" CFLAGS+="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
USB_IDS_REV:=0a6be488b4c1485d30c9efee1cc895af5d4a1383 USB_IDS_REV:=0a6be488b4c1485d30c9efee1cc895af5d4a1383


+ 0
- 11
net/usbip/patches-2.0/100-musl-compat.patch View File

@ -1,11 +0,0 @@
--- a/src/usbipd.c
+++ b/src/usbipd.c
@@ -453,7 +453,7 @@ static void set_signal(void)
sigaction(SIGTERM, &act, NULL);
sigaction(SIGINT, &act, NULL);
act.sa_handler = SIG_IGN;
- sigaction(SIGCLD, &act, NULL);
+ sigaction(SIGCHLD, &act, NULL);
}
static const char *pid_file;

Loading…
Cancel
Save