Skip to contentSkip to conversation

android-tools-conf-configfs: handle multiple UDC controllers

PATCH Superseded Shoudi Li 5 participants 8 messages Jan 23 – Jan 25

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Shoudi Li

author
#0 lore raw

PATCH 1/1 android-tools-conf-configfs: handle multiple UDC controllers

From: Shoudi Li <[email protected]>

For the boards with multiple UDC ports, adb funtion will be impacted due to below error.

ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
ls: write error: Device or resource busy

---
 .../android-tools-conf-configfs/android-gadget-start        | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start +4 -2
index ca6c3df275..76b5e29624 100644
@@ -2,6 +2,8 @@
 
 set -e
 
-sleep 3
+sleep 10
 
-ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
+ls /sys/class/udc/ | head -n 1 | xargs echo -n > /sys/kernel/config/usb_gadget/adb/UDC
+
+echo "Setting UDC $(ls /sys/class/udc/ | head -n 1) for USB ADB Gadget usage"
Signature · 1 line
2.52.0
#1 lore raw

Hi,

On Fri, Jan 23, 2026 at 09:46:04AM +0000, Shoudi Li wrote:
In the headers: From: Shoudi Li <[email protected]>

What is going on?

Quoted 9 lines

From: Shoudi Li <[email protected]>

For the boards with multiple UDC ports, adb funtion will be impacted due to below error.

ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
ls: write error: Device or resource busy

Missing SoB or '[email protected]'.

Signature · 2 lines
With best wishes
Dmitry
#2 lore raw

Dmitry Baryshkov <[email protected]> escreveu (sexta, 23/01/2026 à(s) 17:24):

Quoted 7 lines

Hi,

On Fri, Jan 23, 2026 at 09:46:04AM +0000, Shoudi Li wrote:
In the headers: From: Shoudi Li <[email protected]>

What is going on?

The same issue as before. I will send a v2

Quoted 19 lines
Quoted 11 lines

From: Shoudi Li <[email protected]>

For the boards with multiple UDC ports, adb funtion will be impacted due to below error.

ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
ls: write error: Device or resource busy

Missing SoB or '[email protected]'.

--
With best wishes
Dmitry

Signature · 3 lines
Best regards,

José Quaresma
#3 lore raw
In reply to Shoudi Li

meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start

Quoted 18 lines · Jose Quaresma via lists.openembedded.org

From: Shoudi Li <[email protected]>

For the boards with multiple UDC ports, adb funtion will be impacted due to below error.

ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
ls: write error: Device or resource busy

---
 .../android-tools-conf-configfs/android-gadget-start        | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start +0 -0
index ca6c3df275..76b5e29624 100644

For some reason, there are two *android-tools-conf-configfs* recipes which seem identical except for this and a few other minor changes. I think this one in dynamic-layers/selinux should be removed instead of aligning it with the other recipe.

Quoted 23 lines
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start +4 -3
@@ -2,6 +2,8 @@
 
 set -e
 
-sleep 3
+sleep 10
 
-ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
+ls /sys/class/udc/ | head -n 1 | xargs echo -n > /sys/kernel/config/usb_gadget/adb/UDC
+
+echo "Setting UDC $(ls /sys/class/udc/ | head -n 1) for USB ADB Gadget usage"
--

2.52.0

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

#4 lore raw
Quoted 17 lines · Anuj Mittal
Quoted 14 lines · Jose Quaresma via lists.openembedded.org

From: Shoudi Li <[email protected]>

For the boards with multiple UDC ports, adb funtion will be impacted due to below error.

ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
ls: write error: Device or resource busy

---
 .../android-tools-conf-configfs/android-gadget-start        | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 9 lines

meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start

Quoted 4 lines
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start +0 -0
index ca6c3df275..76b5e29624 100644

For some reason, there are two *android-tools-conf-configfs* recipes which seem identical except for this and a few other minor changes. I think this one in dynamic-layers/selinux should be removed instead of aligning it with the other recipe.

Looks like it. Commit d3f4e6851243 ("android-tools 10: import version from meta-clang"), which added the second copy, isn't clear, why the second copy was necessary.

Signature · 2 lines
With best wishes
Dmitry
#5 lore raw

Hi Dmitry,
the reason I added a second version of android-tools is explained in the pull-request which added android-tools version 10:
https://github.com/openembedded/meta-openembedded/pull/664#issuecomment-1468861667
(one version depends on meta-selinux and the other does not).

However I was not the one adding a second version of android-tools-conf. I don't see a good reason to have two copies of the recipe android-tools-conf, since this recipe doesn't depend on meta-selinux. This was probably just a mistake.

Quoted 41 lines · Dmitry Baryshkov
Quoted 7 lines · Anuj Mittal
Quoted 4 lines · Jose Quaresma via lists.openembedded.org

From: Shoudi Li <[email protected]>

For the boards with multiple UDC ports, adb funtion will be impacted

due

Quoted 11 lines
Quoted 11 lines

to below error.

ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
ls: write error: Device or resource busy

---
 .../android-tools-conf-configfs/android-gadget-start        | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git

a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start

Quoted 2 lines
Quoted 2 lines

index ca6c3df275..76b5e29624 100644
---

a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start

Quoted 1 line
Quoted 1 line

+++

b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start

Quoted 5 lines

For some reason, there are two *android-tools-conf-configfs* recipes which seem identical except for this and a few other minor changes. I think this one in dynamic-layers/selinux should be removed instead of aligning it with the other recipe.

Looks like it. Commit d3f4e6851243 ("android-tools 10: import version from meta-clang"), which added the second copy, isn't clear, why the second copy was necessary.

--
With best wishes
Dmitry

#6 lore raw

Sorry, I misread the order of the git history: I was the one adding a second version of android-tools-conf. However since this recipe doesn't need meta-selinux, it should simply be removed. Only android-tools which has DEPENDS = "... libselinux" needs to be duplicated.

Quoted 57 lines · Etienne Cordonnier

Hi Dmitry,
the reason I added a second version of android-tools is explained in the pull-request which added android-tools version 10:
https://github.com/openembedded/meta-openembedded/pull/664#issuecomment-1468861667
(one version depends on meta-selinux and the other does not).

However I was not the one adding a second version of android-tools-conf. I don't see a good reason to have two copies of the recipe android-tools-conf, since this recipe doesn't depend on meta-selinux. This was probably just a mistake.

Quoted 42 lines · Dmitry Baryshkov
Quoted 7 lines · Anuj Mittal
Quoted 4 lines · Jose Quaresma via lists.openembedded.org

From: Shoudi Li <[email protected]>

For the boards with multiple UDC ports, adb funtion will be impacted

due

Quoted 8 lines
Quoted 8 lines

to below error.

ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
ls: write error: Device or resource busy

---
 .../android-tools-conf-configfs/android-gadget-start        | 6

++++--

Quoted 3 lines
Quoted 3 lines
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git

a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start

Quoted 2 lines
Quoted 2 lines

index ca6c3df275..76b5e29624 100644
---

a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start

Quoted 1 line
Quoted 1 line

+++

b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start

Quoted 5 lines

For some reason, there are two *android-tools-conf-configfs* recipes which seem identical except for this and a few other minor changes. I think this one in dynamic-layers/selinux should be removed instead of aligning it with the other recipe.

Looks like it. Commit d3f4e6851243 ("android-tools 10: import version from meta-clang"), which added the second copy, isn't clear, why the second copy was necessary.

--
With best wishes
Dmitry

#7 lore raw
In reply to Anuj Mittal
Quoted 22 lines · Anuj Mittal via lists.openembedded.org
Quoted 9 lines · Jose Quaresma via lists.openembedded.org

From: Shoudi Li <[email protected]>

For the boards with multiple UDC ports, adb funtion will be impacted due to below error.

ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
ls: write error: Device or resource busy

Quoted 6 lines
---
 .../android-tools-conf-configfs/android-gadget-start        | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git

a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start

Quoted 2 lines

index ca6c3df275..76b5e29624 100644
---

Quoted 9 lines

a/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start

Quoted 1 line

+++

b/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start

For some reason, there are two *android-tools-conf-configfs* recipes which seem identical except for this and a few other minor changes. I think this one in dynamic-layers/selinux should be removed instead of aligning it with the other recipe.

Right, I think its because there was selinux dependency. Things might have changed so I would prefer that we delete
the one in meta-openembedded/meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools

and if we need something from meta-selinux, that could be added as a bbappend in dynamic layer e.g. dependency on selinux or somesuch

Quoted 32 lines

meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start line 7

Quoted 10 lines
meta-oe/dynamic-layers/selinux/recipes-devtool/android-tools/android-tools-conf-configfs/android-gadget-start +2 -2
@@ -2,6 +2,8 @@
 
 set -e
 
-sleep 3
+sleep 10
 
-ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC
+ls /sys/class/udc/ | head -n 1 | xargs echo -n >

/sys/kernel/config/usb_gadget/adb/UDC

Review line 9

Quoted 2 lines
(quoted diff) +2 -0
+
+echo "Setting UDC $(ls /sys/class/udc/ | head -n 1) for USB ADB Gadget

usage"

Quoted 6 lines

--
2.52.0

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