Tuesday, September 27, 2016

Porting CM to new device, adb won't start by itself

Hi,

I've started porting CM10 (old) to Galaxy Fame Lite (old and cheap phone). The phone starts but remains stuck at the boot animation. The problem is that I had to modify the configuration to have 1) adb capability exposed and 2) start adbd.

Without modification, the phone is not listed by adb (kill-server/start-server done, drivers updated). One of the problem is that property sys.usb.config=mtp. When I apply the following:
Code:

diff --git a/rootdir/init.bcm2165x.usb.rc b/rootdir/init.bcm2165x.usb.rc
index 02a6295..b729ad9 100644
--- a/rootdir/init.bcm2165x.usb.rc
+++ b/rootdir/init.bcm2165x.usb.rc
@@ -76,9 +76,10 @@ on property:sys.usb.config=mtp
    write /sys/class/android_usb/android0/bDeviceClass EF
    write /sys/class/android_usb/android0/bDeviceSubClass 02
    write /sys/class/android_usb/android0/bDeviceProtocol 01
-    write /sys/class/android_usb/android0/functions mtp,acm
+    write /sys/class/android_usb/android0/functions mtp,acm,adb
    write /sys/class/android_usb/android0/f_acm/instances 2
    write /sys/class/android_usb/android0/enable 1
+    start adbd
    setprop sys.usb.state $sys.usb.config
 
 on property:sys.usb.config=mtp,adb

the phone is listed by adb, which is better, but "offline". I need to remove "disabled" in "service adbd" stanza of init.rc to have working adb.

It works, but it's not very nice... What should I do to have working adbd right from the first seconds?

Thanks!


from xda-developers http://ift.tt/2donSxC
via IFTTT

No comments:

Post a Comment