From: Ming Liu <[email protected]>

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 <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
Signed-off-by: Armin Kuster <[email protected]>
---
 meta-oe/recipes-support/libusbgx/libusbgx/gadget-start | 4 ++++
 1 file changed, 4 insertions(+)

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
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#103042): 
https://lists.openembedded.org/g/openembedded-devel/message/103042
Mute This Topic: https://lists.openembedded.org/mt/99239752/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to