summaryrefslogtreecommitdiff
path: root/recipes-support/libusbgx
AgeCommit message (Collapse)Author
2023-05-23libusbgx: drop recipeMing Liu
Let's use the libusbgx recipe from meta-openembedded, move Toradex related g1.schema to libusbgx-config recipe. The following fixes have been made to libusbgx-config: - Add 'idProduct' and 'serialnumber' to /etc/usbgx/g1.schema by pkg_postinst_ontarget function, it would runs only once at the first boot, no need to write them to /sys/kernel/config/usb_gadget/g1 everytime in ExecStartPost. With these meta-openembedded MRs: https://patchwork.yoctoproject.org/project/oe/patch/20230516133052.2071705-1-liu.ming50@gmail.com/ https://patchwork.yoctoproject.org/project/oe/patch/20230516133257.2072092-1-liu.ming50@gmail.com/ https://patchwork.yoctoproject.org/project/oe/patch/20230509113620.786170-4-liu.ming50@gmail.com/ https://patchwork.yoctoproject.org/project/oe/patch/20230509113620.786170-3-liu.ming50@gmail.com/ https://patchwork.yoctoproject.org/project/oe/patch/20230509113620.786170-2-liu.ming50@gmail.com/ the following changes have been made: - Drop '/sbin/modprobe libcomposite' and '/bin/mount -t configfs configfs /sys/kernel/config' from ExecStartPre, they are redundant since libcomposite would be automatically loaded during system starting up due to the following setting in linux-toradex recipe: KERNEL_MODULE_AUTOLOAD += "libcomposite", insteadly, now let usbgx.service require and run after sys-kernel-config.mount. - Since we have "WantedBy=usb-gadget.target" in systemd service, that ensures when udev trigger UDC rules, usbgx.service would run as well so the "Before=systemd-networkd.service" condition could be dropped from usbgx.service of meta-oe, since that is a ETH gadget specific condition. - Use "Type=simple" rather than "Type=oneshot", this ensures usbgx.service would not hang on failures, failures could happen in many conditions, like if the end user has manually configured something in configfs, or start usbgx.service twice, or someting wrong in /etc/default/usbgx or /etc/usbgx/*.schema. Signed-off-by: Ming Liu <ming.liu@toradex.com>
2023-01-05libusbgx: use NCM instead of RNDISMing Liu
USB RNDIS support is getting deprecated, move USB Ethernet-over-USB functionality to USB NCM, update libusbgx configuration accordingly. Related-to: ELB-4923 Signed-off-by: Ming Liu <ming.liu@toradex.com> (cherry picked from commit dbc9d3d74c81387cafa292bf06bf7ae91f5c3640)
2023-01-05libusbgx: Add interface name for NCM Feature DescriptorsMing Liu
Add interface name support for NCM Feature Descriptors to libusbgx, patch has been sent to libusbgx upstream: https://github.com/linux-usb-gadgets/libusbgx/pull/73 This is needed to let NCM work on Windows systems, update git revision to the latest master branch to be able to apply the patch. Related-to: ELB-4923 Signed-off-by: Ming Liu <ming.liu@toradex.com> (cherry picked from commit 3987d6249e2549bc036545b038b5c71c41a60336)
2022-06-30libusbgx: avoid hard-coded device/host MAC addressesMing Liu
Hard-coded device/host MAC addresses could conflict with board MAC addresses. Also uprev to the latest master commit. Related-to: ELB-4538 Signed-off-by: Ming Liu <ming.liu@toradex.com>
2022-04-03libusbgx: fix device hot-plug use caseMarcel Ziswiler
Upon hot-plugging device (resp. un-plugging host) dwc3_gadget_init() does nicely get executed. However, for an actual gadget to get started, it also requires the libusbgx dance as well. Instead of only doing this upon boot aka after multi-user.target (which is fine only if the device is already there at boot), execute it after usb-gadget.target. This ensures dwc3_gadget_start() gets executed also during hot-plugging. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 4487e89561252487608e227d7077cb2b2d79f37c)
2022-03-07layer: Update LICENSE variable to use SPDX license identifiersMax Krummenacher
Since OE-Core commit 9379f80f48 ("license/insane: Show warning for obsolete license usage"), LICENSE field not containing SPDX identifiers are treated with WARNING. An automated conversion using scripts/contrib/convert-spdx-licenses.py to convert to use the standard SPDX license identifiers has been done on the entire layer. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2021-12-02libusbgx: use https protocolMax Krummenacher
Github no longer allows a plain git protocol. https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit be4af472843c95236a1dcd4552233ba1aaabc346)
2021-11-22libusbgx: load kernelmodules and mount configfsMax Krummenacher
Rather than assuming the relevant kernel modules are loaded and the configfs is mounted do that here explicitely. Allow both commands to return with a non zero return code as the module might already be loaded and the configfs already be mounted. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2021-11-22libusbgx: prevent warningMax Krummenacher
Prevents a warning in 'systemctl status usbg'. Strings in device tree properties are null terminated. sh[354]: /bin/sh: warning: command substitution: ignored null byte in input Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2021-09-05libusbgx: bump revisionMing Liu
To involve in the following fixes: ``` 1ee53e4 Copy ether_addr structs to avoid union pointer alignment issues 4852080 Delete embedded copies of libtool m4 files ccba65f Tell git which paths to ignore are directories 3a0f66a Tell git to ignore autotools cruft in the src functions subdirectory 37fcf90 Tell git to ignore generated usbg_version.h header 1e7161d Tell git to ignore the generated cmake config file b9a5b9c Tell git to ignore the right generated pkg-config .pc file e972b9e Document that the configfs Linux kernel module needs to be loaded 97b6477 Support printer function ad378b4 Fix --without-libconfig segment fault on gadget-hid attr setting 67605a0 libusbgx: examples: gadget-vid-pid-remove: fix exit code on success e0cdec8 Merge pull request #54 from mgrzeschik/gadget-vid-pid-remove 547a759 Merge pull request #55 from mgrzeschik/uvc 52aa5ed libusbgx: Add UVC support 852087a libusbgx: examples: gadget-vid-pid-remove: add dynamic vid pid support af2292c Fix typo in comment 664b7e6 Added support for CMake projects macros b5ad66e Fix #39 Compilation fails on gcc v8 283879d libusbgx: fix --without-libconfig build against glibc-2.28 45c14ef libusbgx: fix build with glibc-2.28 since <sys/sysmacros.h> is no more included by <sys/types.h> 6ffbb21 libusbgx: Fix doc build with new doxygen version dccb4f1 libusbgx: Fix out of tree compilation ``` especially the fix for: https://github.com/linux-usb-gadgets/libusbgx/issues/57 Related-to: TEI-924 Signed-off-by: Ming Liu <ming.liu@toradex.com> (cherry picked from commit cd152fb6c9a932e0bc2857d5e51a8fdd6bf14319)
2021-08-14layer: convert to new override syntaxMax Krummenacher
This is the result of automated script (0.9.3) conversion: +# meta-toradex-distro +vars = vars + ["preempt-rt","tdx","upstream"] +# meta-toradex-* machines +vars = vars + ["apalis-","colibri-","verdin-","tegra124"] +# meta-freescale +vars = vars + ["imx","mx6","mx7","mx8","use-mainline-bsp","use-nxp-bsp"] ../openembedded-core/scripts/contrib/convert-overrides.py . converting the metadata to use ":" as the override character instead of "_". Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2020-06-17libusbgx: fix a packaging issue and some cleaning upMing Liu
It's ${PN}-examples rather than ${PN} should be set in SYSTEMD_PACKAGES. Also do some cleaning up: - Drop deprecated NATIVE_SYSTEMD_SUPPORT. - Drop ${systemd_unitdir}/system/usbg.service from FILES. Signed-off-by: Ming Liu <ming.liu@toradex.com> (cherry picked from commit 3966043524aa76454c96903af5e9f73f4cf750e3)
2019-06-22libusbgx: rework g1.schema handlingMax Krummenacher
Add the product name at compile time so that we do not need to provide slightly different copies of the file. While at it set package arch to machine arch. The packages created are machine specific due to the g1.schema file. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 3fa96f28bb30643cac3b8a49d3abd7c976acb704)
2018-09-27libusbgx: update to 0.2.0 + gitMax Krummenacher
The update is mostly bugfixing, notably: This fixes a build error with glibc 2.28. <sys/sysmacros.h> is no more included by <sys/types.h> additionally: Add support for UAC2 function Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2018-06-18libusbgx: make conversion of product ID to decimal value portableStefan Agner
Using "10#" to treat the product ID as a decimal value does not work with the BusyBox shell. Use eval productid + 0 which works well with bash and BusyBox to convert to a decimal value. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-12-22libusbgx: update libusbgx configuration to upstream formatStefan Agner
Since the OS Descriptor feature has been reviewed and upstreamed the USB Gadget library configuration format changed slightly. Update the configuration files to make sure they work with the current upstream library version. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-12-22libusbgx: switch to upstream git repositoryStefan Agner
The OS descriptor changes have been merged upstream, hence we can use upstream libusbgx again. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-12-22libusbgx: create separate package for examplesStefan Agner
In the Toradex Easy Installer we do not use the example programs or configuration. Create a separate package for the library and the example programs and configurations. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-10-03libusbgx: fix USB vendor IDStefan Agner
So far a generic USB vendor and product ID has been used in the Toradex specific schema files. However, the startup service wrote a Toradex specific USB product ID. This lead to the awkward combination of a generic USB vendor ID and Toradex specific product ID. Use the Toradex vendor ID by default and do not specify the product ID since it will get filled in by the usbg service. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-10-03libusbgx: use Colibri iMX7 schema for all i.MX 7 SoCsStefan Agner
This allows to use the same schema for Colibri iMX7 with raw NAND and eMMC flash. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-10-03libusbgx: add i.mx 6ullMax Krummenacher
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-06-09libusbgx: fix usb product id calculationStefan Agner
The Toradex product ID from the config block is decimal coded ASCII with leading zeros. In C and bash, leading zeros means octal number... This leads to wrong calculation of the USB product ID and to errors if the product ID contains the number 8 or 9 (since those are not valid under the octal numeric system). Fix both issues by explicitly force decimal system for the Toradex product ID. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-04-07meta-toradex-bsp: clean-up whitespace useMax Krummenacher
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-04-07libusbgx: add empty placeholder g1.schemaMax Krummenacher
Prevents a warning when not building for one of the machines which have a g1.schema | WARNING: ...libusbgx/libusbgx_git.bb: Unable to get checksum for libusbgx SRC_URI entry g1.schema: file could not be found Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-02-08libusbgx: add RNDIS configuration and systemd service for importStefan Agner
Update libusbgx to a version with OS Descriptor support for better interoperability with Windows operating systems. Add configuration using RNDIS with Toradex vendor id. Read serial number and product id from the device tree to configure the USB gadget device. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
2017-02-08libusbgx: Add recipe for libusbg successorStefan Agner
libusbgx (libusbg-neXt) is a fork of libusbg which is more actively maintained. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>