All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/usbip: new package
  2016-12-11 18:12 [Buildroot] [PATCH] pkg-generic: run $(PKG)_PRE_RSYNC_HOOKS before checking for the existence of $(SRCDIR) Tal Shorer
@ 2016-12-11 19:44 ` Tal Shorer
  0 siblings, 0 replies; 4+ messages in thread
From: Tal Shorer @ 2016-12-11 19:44 UTC (permalink / raw)
  To: buildroot

usbip is part of the linux tree, so it should be part of the
linux-tools infra. However, it uses autotools, which are rather
difficult to use in the linux-tools infra.

So we make it a proper, separate autotools package. We only rely on
the kernel to be extracted and use that as the source.

Signed-off-by: Tal Shorer <tal.shorer@gmail.com>

---
Note: in order for the user-friendly error to appear when the source
directory is wrong (depends on a config item, was moved in linux-3.17),
it requires that the patch to fix the hook order in the
rsync command (https://patchwork.ozlabs.org/patch/704859/) goes
in first.
---
 package/linux-tools/Config.in |  2 ++
 package/usbip/Config.in       | 14 ++++++++++++++
 package/usbip/usbip.mk        | 29 +++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+)
 create mode 100644 package/usbip/Config.in
 create mode 100644 package/usbip/usbip.mk

diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in
index db9ed9f..7fceca7 100644
--- a/package/linux-tools/Config.in
+++ b/package/linux-tools/Config.in
@@ -83,4 +83,6 @@ comment "selftests needs BR2_PACKAGE_BUSYBOX_SHOW_OTHERS"
 	depends on BR2_USE_MMU
 	depends on !BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 
+source package/usbip/Config.in
+
 endmenu
diff --git a/package/usbip/Config.in b/package/usbip/Config.in
new file mode 100644
index 0000000..7cd6c29
--- /dev/null
+++ b/package/usbip/Config.in
@@ -0,0 +1,14 @@
+# Prompt in the linux-tools package
+# Here only for the menuconfig; it's a real package
+config BR2_PACKAGE_USBIP
+	bool"usbip"
+	help
+	  usbip is a set of tools that allows machines to share their
+	  usb devices over the network, to be driven by a remote client.
+
+if BR2_PACKAGE_USBIP
+
+config BR2_PACKAGE_USBIP_3_16_OR_EARLIER
+	bool "use old directory path for usbip (Linux kernel <= 3.16)"
+
+endif
diff --git a/package/usbip/usbip.mk b/package/usbip/usbip.mk
new file mode 100644
index 0000000..51c0480
--- /dev/null
+++ b/package/usbip/usbip.mk
@@ -0,0 +1,29 @@
+################################################################################
+#
+# usbib
+#
+################################################################################
+
+ifeq ($(BR2_PACKAGE_USBIP_3_16_OR_EARLIER),y)
+USBIP_BASE_DIR = drivers/staging/usbip/userspace
+else
+USBIP_BASE_DIR = tools/usb/usbip
+endif
+USBIP_SITE = $(LINUX_DIR)/$(USBIP_BASE_DIR)
+USBIP_SITE_METHOD = local
+USBIP_LICENSE = GPLv2
+USBIP_LICENSE_FILES = COPYING
+USBIP_INSTALL_STAGING = YES
+USBIP_PATCH_DEPENDENCIES = linux
+
+USBIP_AUTORECONF = yes
+
+define USBIP_CHECK_SRC
+	@if [ ! -d $(USBIP_SITE) ]; then \
+	    echo "Your kernel does not have usbip in $(USBIP_BASE_DIR)" >&2; \
+	    exit 1; \
+	fi
+endef
+USBIP_PRE_RSYNC_HOOKS += USBIP_CHECK_SRC
+
+$(eval $(autotools-package))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] package/usbip: new package
@ 2024-12-20 16:44 yann.morin
  2024-12-27 12:14 ` Julien Olivain
  0 siblings, 1 reply; 4+ messages in thread
From: yann.morin @ 2024-12-20 16:44 UTC (permalink / raw)
  To: buildroot; +Cc: yann.morin, Julien BOIBESSOT, Tal Shorer, Marcin Bis

From: "Yann E. MORIN" <yann.morin@orange.com>

usbip allows configuring a client and a server, to share a USB device
across the network.

As explained in the .mk, usbip has been part from the kernel since
linux-3.17. This would call for making it part of linux-tools, but this
is a bit unwieldy: usbip is an autotools package, so trying to do a
proper integration in linux-tools would basically need a complete
duplication of the autotools infra [0].

Instead, we decided to go with a full-blown package of its own, that
just uses the current-latest kernel version. This makes for a nice,
little autotools package as we like them. Nothing fancy.

To be noted, though: usbip has its own license and license file, so
that's what we use, and we do not reference those for the rest of the
kernel: its GPL-2.0-or-later, not GPL-2.0(-only).

Finally, we only enable the core usbip support in the kernel, and leave
it to the user whether they should enable server and/or client support.

[0] been there, done that; that was ugly and incomplete, what with the
    libtool patches, autoreconf, and what not.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Julien BOIBESSOT <julien.boibessot@armadeus.com>
Cc: Tal Shorer <tal.shorer@gmail.com>
Cc: Marcin Bis <marcin@bis.org.pl>

---
There have been various attempts in the past:
  - a separate package from legacy sources:
    https://patchwork.ozlabs.org/project/buildroot/patch/CAOPBCFUzO64CXWKr4Z2rJeUb2NXExu=H1Gp2QyymrHcjVNaJuA@mail.gmail.com/
  - a hybrid between a separate package and linux-tools:
    https://patchwork.ozlabs.org/project/buildroot/patch/1481736504-12256-1-git-send-email-tal.shorer@gmail.com/
  - a linux-tools implementatio:
    https://patchwork.ozlabs.org/project/buildroot/patch/1512566955-4712-1-git-send-email-julien.boibessot@free.fr/

All had shortcomings, so I started entirely from scratch. I first tried
a linux-tools implementation (available if needed), but I really found
it to be ugly and kludgy. The separate package is way nicer.
---
 package/Config.in        |  1 +
 package/usbip/Config.in  | 13 +++++++++++++
 package/usbip/usbip.hash |  5 +++++
 package/usbip/usbip.mk   | 39 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 58 insertions(+)
 create mode 100644 package/usbip/Config.in
 create mode 100644 package/usbip/usbip.hash
 create mode 100644 package/usbip/usbip.mk

diff --git a/package/Config.in b/package/Config.in
index f33c4780f8..ee6a5a0e67 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -651,6 +651,7 @@ endmenu
 	source "package/usb_modeswitch/Config.in"
 	source "package/usb_modeswitch_data/Config.in"
 	source "package/usbguard/Config.in"
+	source "package/usbip/Config.in"
 	source "package/usbmount/Config.in"
 	source "package/usbutils/Config.in"
 	source "package/w_scan/Config.in"
diff --git a/package/usbip/Config.in b/package/usbip/Config.in
new file mode 100644
index 0000000000..3038031aa0
--- /dev/null
+++ b/package/usbip/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_USBIP
+	bool "usbip"
+	depends on BR2_PACKAGE_HAS_UDEV
+	help
+	  The USB-over-IP suite of tools.
+
+	  Note: you'll have to enable either (or both) of "VHCI hcd"
+	  (CONFIG_USBIP_VHCI_HCD) if you want to access a remote USB
+	  device, or "Host driver" (CONFIG_USBIP_HOST) if you want
+	  to share a USB device, in your kernel configuration.
+
+comment "usbip needs udev /dev management"
+	depends on !BR2_PACKAGE_HAS_UDEV
diff --git a/package/usbip/usbip.hash b/package/usbip/usbip.hash
new file mode 100644
index 0000000000..dc901617bf
--- /dev/null
+++ b/package/usbip/usbip.hash
@@ -0,0 +1,5 @@
+# From https://cdn.kernel.org/pub/linux/kernel/v6.x/sha256sums.asc
+sha256  d450ab215de4e1f8bb85e0f4216760fa33fd024b4526b144f4ce0d9012b29c9e  linux-6.12.6.tar.xz
+
+# Locally computed
+sha256  cd5c66af63b509ccd75ec85fee41b6e5cbb77cd6bf9392a54900acc0f02be4a6  tools/usb/usbip/COPYING
diff --git a/package/usbip/usbip.mk b/package/usbip/usbip.mk
new file mode 100644
index 0000000000..77dd341f9b
--- /dev/null
+++ b/package/usbip/usbip.mk
@@ -0,0 +1,39 @@
+################################################################################
+#
+# usbip
+#
+################################################################################
+
+# Since linux 3.17, usbip is part of the linux source tree. Usually, we'd add
+# such a tool in the linux-tools package.
+#
+# However, usbip is autotools-based, so we'd have to duplicate the autotools
+# infra in linux-tools; the basic infra is easy to duplicate, but then come
+# the conditional libtool patches, and it's not trivial to do. And of course,
+# there would be the maintenance cost...
+#
+# usbip is not very tied to the kernel, in fact. It is pretty stable, API-wise,
+# so we can just use a recent kernel version.
+USBIP_VERSION = 6.12.6
+USBIP_SOURCE = linux-$(USBIP_VERSION).tar.xz
+USBIP_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/v6.x
+USBIP_DL_SUBDIR = linux
+
+# usbip's licensing diverges from that of the rest of the kernel
+USBIP_LICENSE = GPL-2.0-or-later
+USBIP_LICENSE_FILES = tools/usb/usbip/COPYING
+
+USBIP_DEPENDENCIES = udev
+
+USBIP_SUBDIR = tools/usb/usbip
+USBIP_INSTALL_STAGING = YES
+
+USBIP_AUTORECONF = YES
+USBIP_CONFIGURE_OPTS = --without-tcp-wrappers
+
+define USBIP_LINUX_CONFIG_FIXUPS
+	$(call KCONFIG_ENABLE_OPT,CONFIG_USB_SUPPORT)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_USBIP_CORE)
+endef
+
+$(eval $(autotools-package))
-- 
2.34.1

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH] package/usbip: new package
  2024-12-20 16:44 [Buildroot] [PATCH] package/usbip: new package yann.morin
@ 2024-12-27 12:14 ` Julien Olivain
  2025-01-02  9:01   ` yann.morin
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Olivain @ 2024-12-27 12:14 UTC (permalink / raw)
  To: yann.morin; +Cc: buildroot, Julien BOIBESSOT, Tal Shorer, Marcin Bis

Hi Yann,

On 20/12/2024 17:44, yann.morin@orange.com wrote:
> From: "Yann E. MORIN" <yann.morin@orange.com>
> 
> usbip allows configuring a client and a server, to share a USB device
> across the network.
> 
> As explained in the .mk, usbip has been part from the kernel since
> linux-3.17. This would call for making it part of linux-tools, but this
> is a bit unwieldy: usbip is an autotools package, so trying to do a
> proper integration in linux-tools would basically need a complete
> duplication of the autotools infra [0].
> 
> Instead, we decided to go with a full-blown package of its own, that
> just uses the current-latest kernel version. This makes for a nice,
> little autotools package as we like them. Nothing fancy.
> 
> To be noted, though: usbip has its own license and license file, so
> that's what we use, and we do not reference those for the rest of the
> kernel: its GPL-2.0-or-later, not GPL-2.0(-only).
> 
> Finally, we only enable the core usbip support in the kernel, and leave
> it to the user whether they should enable server and/or client support.
> 
> [0] been there, done that; that was ugly and incomplete, what with the
>     libtool patches, autoreconf, and what not.
> 
> Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
> Cc: Julien BOIBESSOT <julien.boibessot@armadeus.com>
> Cc: Tal Shorer <tal.shorer@gmail.com>
> Cc: Marcin Bis <marcin@bis.org.pl>

Applied to master, thanks.

I added a comment in the Config.in about the hwdata/usb.ids package
that is useful (but not mandatory) to this package.

Without it, usbip can show non-fatal error messages such as:

     usbip: error: failed to open /usr/share/hwdata//usb.ids

See:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/tools/usb/usbip/src/usbip_list.c?h=v6.12.6#n341

I also added in Config.in the kernel source directory as the
package homepage:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/tools/usb/usbip

I did that because searching "usbip" in search engines usually gives
the old (pre 3.17 kernel era) homepage:
https://usbip.sourceforge.net/

Best regards,

Julien.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH] package/usbip: new package
  2024-12-27 12:14 ` Julien Olivain
@ 2025-01-02  9:01   ` yann.morin
  0 siblings, 0 replies; 4+ messages in thread
From: yann.morin @ 2025-01-02  9:01 UTC (permalink / raw)
  To: Julien Olivain; +Cc: buildroot, Julien BOIBESSOT, Tal Shorer, Marcin Bis

Julien, All,

On 2024-12-27 13:14 +0100, Julien Olivain spake thusly:
> On 20/12/2024 17:44, yann.morin@orange.com wrote:
> > From: "Yann E. MORIN" <yann.morin@orange.com>
> > usbip allows configuring a client and a server, to share a USB device
> > across the network.
[--SNIP--]
> Applied to master, thanks.

Thanks!

> I added a comment in the Config.in about the hwdata/usb.ids package
> that is useful (but not mandatory) to this package.

Indeed. I did not add it for that reason, nor did I even add a comment
about it either: the reasoning was that other packages that can
optionally use it (e.g. usbutils for lsusb, pciutils for lspci) do not
mention it either.

I should have mentionned that in the commit log, sorry.

> Without it, usbip can show non-fatal error messages such as:
>     usbip: error: failed to open /usr/share/hwdata//usb.ids

Agreed, this is annoying...

> I also added in Config.in the kernel source directory as the
> package homepage:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/tools/usb/usbip
> 
> I did that because searching "usbip" in search engines usually gives
> the old (pre 3.17 kernel era) homepage:
> https://usbip.sourceforge.net/

Thanks!

Regards,
Yann E. MORIN.

-- 
                                        ____________
.-----------------.--------------------:       _    :------------------.
|  Yann E. MORIN  | Real-Time Embedded |    __/ )   | /"\ ASCII RIBBON |
|                 | Software  Designer |  _/ - /'   | \ / CAMPAIGN     |
| +33 638.411.245 '--------------------: (_    `--, |  X  AGAINST      |
| yann.morin (at) orange.com           |_="    ,--' | / \ HTML MAIL    |
'--------------------------------------:______/_____:------------------'

____________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-02  9:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-20 16:44 [Buildroot] [PATCH] package/usbip: new package yann.morin
2024-12-27 12:14 ` Julien Olivain
2025-01-02  9:01   ` yann.morin
  -- strict thread matches above, loose matches on Subject: below --
2016-12-11 18:12 [Buildroot] [PATCH] pkg-generic: run $(PKG)_PRE_RSYNC_HOOKS before checking for the existence of $(SRCDIR) Tal Shorer
2016-12-11 19:44 ` [Buildroot] [PATCH] package/usbip: new package Tal Shorer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.