summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/libusbgx
Commit message (Collapse)AuthorAgeFilesLines
* libusbgx: exit with failure code when no UDC is detectedErnest Van Hoecke2025-07-021-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The systemd target `usb-gadget.target` is triggered by udev when a UDC first comes up. It can happen that by the time gadget-start runs, this UDC has been removed from the system again. Have the gadget-start script exit with status 1 when `ls /sys/class/udc` returns nothing. Causing a service failure when no UDC is detected and no default was given, allows the service to be restarted by a udev rule calling the service (and not the target since those are not reentrant) directly. On its own this patch will not do much. For example, we saw such a situation using the DWC3 USB controller and usb-conn-gpio kernel modules as loadables. By the time of the DWC3 init, udev was active, and during init DWC3 started the USB OTG port in device mode. If a pen drive was plugged in at boot, it would quickly switch to host mode right after initialisation, emitting another udev event for the removal of the UDC. The systemd target as thus reached, but by the time gadget-start ran, the UDC was gone. dwc3 init usb-conn-gpio role switch │ │ ▼ ▼ udev: add UDC─┐ udev: del UDC─────►/sys/class/udc empty │ │ │ x │ │ │ ▼ └────────────►usb-gadget.target─────►gadget-start Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* meta-openembedded/all: adapt to UNPACKDIR changesAlexander Kanavin2025-06-252-3/+1
| | | | | | | | | | | | | Please see https://git.yoctoproject.org/poky/commit/?id=4dd321f8b83afecd962393101b2a6861275b5265 for what changes are needed, and sed commands that can be used to make them en masse. I've verified that bitbake -c patch world works with these, but did not run a world build; the majority of recipes shouldn't need further fixups, but if there are some that still fall out, they can be fixed in followups. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libusbgx: fix example gadget startDenis OSTERLAND-HEIM2025-06-051-1/+1
| | | | | | | | | | | | From variables docu: > Setting it to "0" does not disable inhibition. > Only the empty string will disable inhibition. That means in case of examples enabled we need "" and if not "1" to disable update-rc.d. Signed-off-by: Denis OSTERLAND-HEIM <denis.osterland@diehl.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libusbgx: fix gadget-stop installGrygorii Tertychnyi2024-11-191-1/+1
| | | | | | | It was by mistake installed gadget-start instead. Signed-off-by: Grygorii Tertychnyi <grembeter@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* recipes: set S to fix the QA warningalperak2024-06-211-0/+3
| | | | | | | Fix the warning by pointing S to ${WORKDIR}/sources and UNPACKDIR to ${S}. Since recent UNPACKDIR work, default S directory is not created anymore. By setting UNPACKDIR to S, S in indirectly created in do_unpack. Signed-off-by: alperak <alperyasinak1@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* recipes: Start WORKDIR -> UNPACKDIR transitionKhem Raj2024-05-232-5/+5
| | | | | | | Replace references of WORKDIR with UNPACKDIR where it makes sense to do so in preparation for changing the default value of UNPACKDIR. Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libusbgx: uprev to the latest commitMax Krummenacher2024-02-152-18/+18
| | | | | | | | | | | | | | | | | | Uprev libusbgx to ec0b01c to get following fixes: ``` ec0b01c Merge pull request #83 from mgrzeschik/uac2-controls cbf1750 uac2: add additional configuration controls 81d7c05 load libcomposite kernel module caad244 Fix: Memory leak config label 51abbfd Automake: fix distclean of tests 3cc5af7 Added printer function header to installed headers adc45af Added missing extern C closing brace ``` Refresh 0001-fix-stack-buffer-overflow-in-usbg_f_foo_attr_val-pro.patch. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libusbgx: fix usbgx.service stop / restartMax Krummenacher2024-02-153-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On start the usbgx service configures the usb gadget. However if one stops the service nothing is done, a subsequent start then tries to configure the gadget again and fails. `systemctl restart` is implemented by doing a stop followed by a start and thus is also affected. Doing a start/stop/start results with the following reported in status: | systemd[1]: Starting Load USB gadget schemas... | gadget-start[801]: usbg_create_gadget() duplicate gadget name | gadget-start[801]: | gadget-start[801]: Error on import gadget | gadget-start[801]: Error: USBG_ERROR_EXIST : Already exist | gadget-start[812]: ls: write error: Device or resource busy The run-postinsts service does execute a restart for each package which uses the systemd class which creates a race condition that the usbgx service is already started when run-postinsts restarts usbgx and creates the above error output. Fix that by unconfiguring the usb gadget on stop. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* recipes: drop ${SRCPV} usageMartin Jansa2024-02-091-1/+1
| | | | | | | | | | * Drop SRCPV similarly like oe-core did in: https://git.openembedded.org/openembedded-core/commit/?h=nanbield&id=843f82a246a535c353e08072f252d1dc78217872 * SRCPV is deferred now from PV to PKGV since: https://git.openembedded.org/openembedded-core/commit/?h=nanbield&id=a8e7b0f932b9ea69b3a218fca18041676c65aba0 Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
* libusbgx: usbgx.service: use Type=oneshotMing Liu2023-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A regression was introduced by commit: ``` commit 48bc4b2d5e4688bac10bcca26657a5fe660b93ab Author: Ming Liu <liu.ming50@gmail.com> Date: Tue May 9 13:36:20 2023 +0200 libusbgx: fix some systemd service conditions Let usbgx.service require and run after sys-kernel-config.mount. 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 <liu.ming50@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> ``` In the case when 'Type=simple' is set, 'ExecStartPost=' will execute right after the process in 'ExecStart=' is started, but we need it execute after the last 'ExecStart=' process exited successfully, so change back to "Type=oneshot". Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libusbgx: check scripts in /etc/usbgx.dMing Liu2023-05-161-0/+4
| | | | | | | | | | | | Sometimes an end user might want to change some values in /sys/kernel/config/usb_gadget/ at runtime, for instance, a product id or serial number must be read from /proc/device-tree, and so on. Support that by letting gadget-start run all scripts in /etc/usbgx.d after importing the schemas. Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libusbgx: drop hard-coded /usr/bin,/etcMing Liu2023-05-161-1/+3
| | | | | | | Drop hard-coded /usr/bin,/etc from gadget-start. Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libusbgx: fix some systemd service conditionsMing Liu2023-05-091-1/+3
| | | | | | | | | | | | | Let usbgx.service require and run after sys-kernel-config.mount. 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 <liu.ming50@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libusbgx: fix device hot-plug use caseMarcel Ziswiler2023-05-091-1/+1
| | | | | | | | | | | | | 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> Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libusbgx: uprev to the latest commitMing Liu2023-05-093-1/+851
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uprev libusbgx to 721e3a1 to get following fixes: ``` 721e3a1 correct attribute import / export bbdaad2 Document the license of the library and examples 36e71e1 Rename the net class variables to class_ efdd7a6 tests: update test code with new net attributes 4ca4a76 net: adds class, subclass and protocol attributes b1c8586 Merge pull request #64 from mgrzeschik/master 8b91dbb uvc: add isoc parameter settings 50fe6a7 uvc: fix init_formats function afec0d6 uvc: fix exporting attrs with layouts missing a format 0607844 Merge pull request #63 from mgrzeschik/uvc-fix 20d7fe2 uvc: fix unsigned nmb to int ed1fb6d Merge pull request #62 from linux-usb-gadgets/uvc-fix 157cbd8 uvc: fix return check on scandir 741230b Merge pull request #61 from linux-usb-gadgets/uvc-libconfig-import-export-support 53231c7 uvc: add import/export support 61a4186 uvc: consistently use defines for common strings 57dc1d5 uvc: check attr pointer in set_attrs 4061ffd uvc: remove unnedded USBG_UVC_MAX_PATH_LENGTH define 1c94fb8 uvc: remove unused variable b28dd77 uvc: fix compile warnings 6bd989c gadget-uvc: fix 4k format resolution d0f2f4f Revert "Use an unnamed variable instead of a named one" 92deb97 pkgconfig: make Requires for libconfig optional 38dd92f gadget-vid-pid-remove: re-split default vendor/product defines from variables fa4e7e9 Use an unnamed variable instead of a named one 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 ``` Also add two pending MRs from github: ``` https://github.com/linux-usb-gadgets/libusbgx/pull/72 https://github.com/linux-usb-gadgets/libusbgx/pull/73 ``` Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* Add condition for libusbgx-exampleshomalozoa2022-10-181-2/+2
| | | | | | | * Add @bb.utils.contains for PACKAGE_BEFORE_PN and INITSCRIPT_PACKAGES to make configs in PACKAGECONFIG work. Signed-off-by: homalozoa <nx.tardis@gmail.com>
* libusbgx: add PACKAGECONFIG to make build predicableMing Liu2022-09-231-10/+19
| | | | | | | | | | | | | | Also introduce a ${PN}-examples subpackage since all binaries get built only when --enable-examples is set to true, move them into ${PN}-examples package. Another advantage of this change is that now libusbgx only contains a .so library so the recipes DEPENDs on it wont involve in unnecessary binaries or systemd/sysvinit scripts. Also uprev to the latest git hash in master and fix some inconsistent coding style and an invalid EXTRA_OECONF. Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* recipes: Update LICENSE variable to use SPDX license identifiersKhem Raj2022-03-041-1/+1
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* recipes: Update SRC_URI branch and protocolsRichard Purdie2021-11-031-1/+1
| | | | | | | | | This patch updates SRC_URIs using git to include branch=master if no branch is set and also to use protocol=https for github urls as generated by the conversion script in OE-Core. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libusbgx: Configure the Devices UsedMaksym Sloyko2021-08-071-1/+6
| | | | | | | | | | | | | | | | | | | | Add ability to configure the UDC used for specific schema. The feature is backwards compatible, so existing users don't need to change anything. If one wants to specify which UDC is used for specific schema, for example, `eth0`, they can add this variable to the configuration file: UDC_FOR_SCHEMA_eth0=f8000000.udc If the device file exists in /sys/class/udc when the gadget is started, it will be used for this schema. If this configuration is not present, first available device is picked. Signed-off-by: Maksym Sloyko <maxims@google.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* Convert to new override syntaxMartin Jansa2021-08-031-4/+4
| | | | | | | | | | This is the result of automated script (0.9.1) conversion: oe-core/scripts/contrib/convert-overrides.py . converting the metadata to use ":" as the override character instead of "_". Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
* libusbgx: Use update-alternativesKhem Raj2020-08-311-1/+6
| | | | | | gadget-acm-ecm show-gadgets are also provided by older libusbg recipe Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libusbgx: Add recipeOtavio Salvador2018-11-306-0/+217
The libusbgx allow easier use and setup of USB gadgets. To easy integration on different systems a libusbgx-config package is provided so it can be used to start and enable respective USB gadget schema. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Khem Raj <raj.khem@gmail.com>