diff options
| author | Ming Liu <liu.ming50@gmail.com> | 2023-05-16 15:32:57 +0200 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2023-05-16 22:31:14 -0700 |
| commit | 2a4532c29cdb68ef260b143bf8ee9b572942a4e8 (patch) | |
| tree | 349afc9253fca781debd86a13bdcb9a7bc12a3d2 | |
| parent | 00cae16967d61e16ea17a4a3de2e42d1fcadf1e3 (diff) | |
| download | meta-openembedded-2a4532c29cdb68ef260b143bf8ee9b572942a4e8.tar.gz | |
libusbgx: check scripts in /etc/usbgx.d
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>
| -rwxr-xr-x | meta-oe/recipes-support/libusbgx/libusbgx/gadget-start | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/libusbgx/libusbgx/gadget-start b/meta-oe/recipes-support/libusbgx/libusbgx/gadget-start index 9e22671a9e..e80cb2c340 100755 --- a/meta-oe/recipes-support/libusbgx/libusbgx/gadget-start +++ b/meta-oe/recipes-support/libusbgx/libusbgx/gadget-start | |||
| @@ -6,6 +6,10 @@ for i in $IMPORT_SCHEMAS; do | |||
| 6 | /usr/bin/gadget-import "$i" /etc/usbgx/"$i".schema | 6 | /usr/bin/gadget-import "$i" /etc/usbgx/"$i".schema |
| 7 | done | 7 | done |
| 8 | 8 | ||
| 9 | for script in $(find -L /etc/usbgx.d -type f -exec test -e {} \; -print 2>/dev/null); do | ||
| 10 | $script | ||
| 11 | done | ||
| 12 | |||
| 9 | for i in $ENABLED_SCHEMAS; do | 13 | for i in $ENABLED_SCHEMAS; do |
| 10 | configured_udc=$(eval 'echo ${UDC_FOR_SCHEMA_'"$i"'}') | 14 | configured_udc=$(eval 'echo ${UDC_FOR_SCHEMA_'"$i"'}') |
| 11 | if [ -n "${configured_udc}" ] && [ -e "/sys/class/udc/${configured_udc}" ]; then | 15 | if [ -n "${configured_udc}" ] && [ -e "/sys/class/udc/${configured_udc}" ]; then |
