android-tools: drop android-gadget-setup call from android-tools-adbd.service
PATCH 1/1 android-tools: drop android-gadget-setup call from android-tools-adbd.service
From: Etienne Cordonnier <[email protected]>
The unit calls "/usr/bin/android-gadget-setup adb" from ExecStartPre, prefixed with "-" so that a failure is ignored. The android-gadget-setup in this layer does not read its arguments, so "adb" has no effect. That adb parameter is historical: it is used in meta-smartphone which is where the meta-oe android-tools recipe was imported from.
The call made sense while there were two android-tools-conf implementations. The sysfs-based one installed only android-gadget-setup, so the unit was what ran it. The configfs-based one ships its own drop-in, 10-adbd-configfs.conf, which runs android-gadget-setup, android-gadget-start and android-gadget-cleanup. Commit 55cc6751e426 ("android-tools-conf:
replace sysfs implementation with configfs") removed the sysfs implementation. Since then android-gadget-setup runs twice on every start, and the second run first tears down the gadget created by the first one. The unit also refers to a file that is not installed when android-tools-conf is not.
Remove the call from the unit and leave the gadget setup to the drop-in.
Layers that replace android-gadget-setup and remove the drop-in, such as
meta-android in meta-smartphone, whose script takes the USB function list as
argument, need to run it from their own drop-in ( see https://github.com/shr-distribution/meta-smartphone/pull/204 ).
AI-Generated: Uses Claude Code
--- .../android-tools/android-tools/android-tools-adbd.service | 1 - 1 file changed, 1 deletion(-)
meta-oe/recipes-devtools/android-tools/android-tools/android-tools-adbd.service +0 -1
@@ -6,7 +6,6 @@ Before=android-system.service [Service] Type=notify Restart=on-failure -ExecStartPre=-/usr/bin/android-gadget-setup adb ExecStart=/usr/bin/adbd [Install]
Signature · 1 line
2.43.0