aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2023-05-16 15:32:57 +0200
committerArmin Kuster <akuster808@gmail.com>2023-05-28 16:15:03 -0400
commit41e2c464f0d56cdc11957078151a831e499c2045 (patch)
treeca368d925a0d08d4053862b5178f7213845e117f
parente2d28cb3efdb62d179d239dadb56445c5aa8f4b1 (diff)
downloadmeta-openembedded-41e2c464f0d56cdc11957078151a831e499c2045.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> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rwxr-xr-xmeta-oe/recipes-support/libusbgx/libusbgx/gadget-start4
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
/usr/bin/gadget-import "$i" /etc/usbgx/"$i".schema
done
+for script in $(find -L /etc/usbgx.d -type f -exec test -e {} \; -print 2>/dev/null); do
+ $script
+done
+
for i in $ENABLED_SCHEMAS; do
configured_udc=$(eval 'echo ${UDC_FOR_SCHEMA_'"$i"'}')
if [ -n "${configured_udc}" ] && [ -e "/sys/class/udc/${configured_udc}" ]; then