mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/2] libusbgx: make schemes support selectable
@ 2021-09-23  7:45 Michael Grzeschik
  2021-09-23  7:45 ` [ptxdist] [PATCH 2/2] gt: add gadget-tool Michael Grzeschik
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Grzeschik @ 2021-09-23  7:45 UTC (permalink / raw)
  To: ptxdist

We add an option to select schemes support.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 rules/libusbgx.in   | 7 +++++++
 rules/libusbgx.make | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/rules/libusbgx.in b/rules/libusbgx.in
index 13252a3a7..e576f842e 100644
--- a/rules/libusbgx.in
+++ b/rules/libusbgx.in
@@ -2,6 +2,7 @@
 
 menuconfig LIBUSBGX
 	bool
+	select LIBCONFIG	if LIBUSBGX_SCHEMES
 	prompt "libusbgx                      "
 	help
 	  libusbgx is a C library encapsulating the kernel USB gadget-configfs
@@ -9,6 +10,12 @@ menuconfig LIBUSBGX
 
 if LIBUSBGX
 
+config LIBUSBGX_SCHEMES
+	bool "enable schemes support"
+	help
+	  With schemes support it is possible to export/import
+	  configs layout to/from declerative scheme files
+
 config SHOW_GADGETS
 	bool "install show-gadget tool"
 	help
diff --git a/rules/libusbgx.make b/rules/libusbgx.make
index da2980d95..724d1a3d8 100644
--- a/rules/libusbgx.make
+++ b/rules/libusbgx.make
@@ -42,9 +42,9 @@ LIBUSBGX_CONF_ENV	:= $(CROSS_ENV)
 LIBUSBGX_CONF_TOOL	:= autoconf
 LIBUSBGX_CONF_OPT	:= \
 	$(CROSS_AUTOCONF_USR) \
-	--without-libconfig \
+	--$(call ptx/wow, PTXCONF_LIBUSBGX_SCHEMES)-libconfig \
 	--enable-examples \
-	--disable-gadget-schemes
+	--$(call ptx/endis, PTXCONF_LIBUSBGX_SCHEMES)-gadget-schemes
 
 # ----------------------------------------------------------------------------
 # Target-Install
-- 
2.30.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


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

* [ptxdist] [PATCH 2/2] gt: add gadget-tool
  2021-09-23  7:45 [ptxdist] [PATCH 1/2] libusbgx: make schemes support selectable Michael Grzeschik
@ 2021-09-23  7:45 ` Michael Grzeschik
  2021-09-23 11:40   ` Roland Hieber
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Grzeschik @ 2021-09-23  7:45 UTC (permalink / raw)
  To: ptxdist

Gadget-tool is a tool to setup configfs gadget device descriptions
via a tree based declarative scheme format. This makes poking around
in configfs with several shell commands obsolete. It depends on libusbgx
and libconfig.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 rules/gt.in   | 11 ++++++++++
 rules/gt.make | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)
 create mode 100644 rules/gt.in
 create mode 100644 rules/gt.make

diff --git a/rules/gt.in b/rules/gt.in
new file mode 100644
index 000000000..5084a554b
--- /dev/null
+++ b/rules/gt.in
@@ -0,0 +1,11 @@
+## SECTION=shell_and_console
+
+config GT
+	tristate
+	select HOST_CMAKE
+	select LIBUSBGX
+	select LIBUSBGX_SCHEMES
+	select LIBCONFIG
+	prompt "gadget-tool (gt)"
+	help
+	  Gadget-tool - Linux command line tool for setting USB gadget using configFS
diff --git a/rules/gt.make b/rules/gt.make
new file mode 100644
index 000000000..d94e42ca8
--- /dev/null
+++ b/rules/gt.make
@@ -0,0 +1,56 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Michael Grzeschik <m.grzeschik@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_GT) += gt
+
+#
+# Paths and names
+#
+GT_VERSION	:= 31b13554
+GT_MD5		:= 083a1e9f8c55812c0ef148a8ab0af862
+GT		:= gt-$(GT_VERSION)
+GT_SUFFIX	:= tar.bz2
+GT_URL		:= https://github.com/linux-usb-gadgets/gt.git;tag=$(GT_VERSION)
+GT_SOURCE	:= $(SRCDIR)/$(GT).$(GT_SUFFIX)
+GT_DIR		:= $(BUILDDIR)/$(GT)/source
+GT_LICENSE	:= Apache-2.0
+GT_LICENSE_FILES	:= \
+	file://../LICENSE;md5=785f417ec07d653f268e6eb621218d5d
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+GT_CONF_TOOL	:= cmake
+GT_CONF_OPT	:= \
+	$(CROSS_CMAKE_USR)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/gt.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, gt)
+	@$(call install_fixup, gt, PRIORITY, optional)
+	@$(call install_fixup, gt, SECTION, base)
+	@$(call install_fixup, gt, AUTHOR, "Michael Grzeschik <m.grzeschik@pengutronix.de>")
+	@$(call install_fixup, gt, DESCRIPTION, missing)
+
+	@$(call install_copy, gt, 0, 0, 0755, -, /usr/bin/gt)
+	@$(call install_copy, gt, 0, 0, 0755, $(GT_PKGDIR)/usr/etc/gt/gt.conf, /etc/gt/gt.conf)
+
+	@$(call install_finish, gt)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.30.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


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

* Re: [ptxdist] [PATCH 2/2] gt: add gadget-tool
  2021-09-23  7:45 ` [ptxdist] [PATCH 2/2] gt: add gadget-tool Michael Grzeschik
@ 2021-09-23 11:40   ` Roland Hieber
  0 siblings, 0 replies; 3+ messages in thread
From: Roland Hieber @ 2021-09-23 11:40 UTC (permalink / raw)
  To: Michael Grzeschik; +Cc: ptxdist

On Thu, Sep 23, 2021 at 09:45:40AM +0200, Michael Grzeschik wrote:
> Gadget-tool is a tool to setup configfs gadget device descriptions
> via a tree based declarative scheme format. This makes poking around
> in configfs with several shell commands obsolete. It depends on libusbgx
> and libconfig.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
>  rules/gt.in   | 11 ++++++++++
>  rules/gt.make | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 67 insertions(+)
>  create mode 100644 rules/gt.in
>  create mode 100644 rules/gt.make
> 
> diff --git a/rules/gt.in b/rules/gt.in
> new file mode 100644
> index 000000000..5084a554b
> --- /dev/null
> +++ b/rules/gt.in
> @@ -0,0 +1,11 @@
> +## SECTION=shell_and_console
> +
> +config GT
> +	tristate
> +	select HOST_CMAKE
> +	select LIBUSBGX
> +	select LIBUSBGX_SCHEMES
> +	select LIBCONFIG
> +	prompt "gadget-tool (gt)"
> +	help
> +	  Gadget-tool - Linux command line tool for setting USB gadget using configFS
> diff --git a/rules/gt.make b/rules/gt.make
> new file mode 100644
> index 000000000..d94e42ca8
> --- /dev/null
> +++ b/rules/gt.make
> @@ -0,0 +1,56 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2021 by Michael Grzeschik <m.grzeschik@pengutronix.de>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_GT) += gt
> +
> +#
> +# Paths and names
> +#
> +GT_VERSION	:= 31b13554
> +GT_MD5		:= 083a1e9f8c55812c0ef148a8ab0af862
> +GT		:= gt-$(GT_VERSION)
> +GT_SUFFIX	:= tar.bz2
> +GT_URL		:= https://github.com/linux-usb-gadgets/gt.git;tag=$(GT_VERSION)

You should be able to use GitHub's archive URLs, e.g.

    https://github.com/linux-usb-gadgets/gt/archive/$(GT_VERSION).$(GT_SUFFIX)

This way PTXdist doesn't need to clone the whole git repo first. But
both ways are fine I think.

> +GT_SOURCE	:= $(SRCDIR)/$(GT).$(GT_SUFFIX)
> +GT_DIR		:= $(BUILDDIR)/$(GT)/source
> +GT_LICENSE	:= Apache-2.0
> +GT_LICENSE_FILES	:= \
> +	file://../LICENSE;md5=785f417ec07d653f268e6eb621218d5do

Please also include at least one license statement [1], e.g. from main.c:

        file://main.c;startline=2;endline=14;md5=239ab3ef885c745f3896a83f17482d6d

[1]: see https://www.ptxdist.org/doc/dev_licenses.html#finding-licensing-information

> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +GT_CONF_TOOL	:= cmake
> +GT_CONF_OPT	:= \
> +	$(CROSS_CMAKE_USR)
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/gt.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, gt)
> +	@$(call install_fixup, gt, PRIORITY, optional)
> +	@$(call install_fixup, gt, SECTION, base)
> +	@$(call install_fixup, gt, AUTHOR, "Michael Grzeschik <m.grzeschik@pengutronix.de>")
> +	@$(call install_fixup, gt, DESCRIPTION, missing)
> +
> +	@$(call install_copy, gt, 0, 0, 0755, -, /usr/bin/gt)
> +	@$(call install_copy, gt, 0, 0, 0755, $(GT_PKGDIR)/usr/etc/gt/gt.conf, /etc/gt/gt.conf)

The conf file doesn't need the execute bit, does it?

 - Roland

> +
> +	@$(call install_finish, gt)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.30.2
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> 

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


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

end of thread, other threads:[~2021-09-23 11:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23  7:45 [ptxdist] [PATCH 1/2] libusbgx: make schemes support selectable Michael Grzeschik
2021-09-23  7:45 ` [ptxdist] [PATCH 2/2] gt: add gadget-tool Michael Grzeschik
2021-09-23 11:40   ` Roland Hieber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox