adb during boot

579 views
Skip to first unread message

Droid

unread,
Jun 1, 2020, 1:28:31 PM6/1/20
to android-porting
Iam trying to port android to my embedded board and it restarts surfaceflinger and loops everything after it starts bootnimation. So, to debug this further i am trying to enable adb so that i can look into logcat. But, when i try to list adb devices on my host PC , i am not getting any devices. Below is my Bootlog and init.<hardware>.usb.rc. Any inputs on how to debug further will be really helpful. Thanks in advance.


Bootlog:
[    3.903300]
[    4.012730] selinux: SELinux: Loaded file_contexts
[    4.012730]
[    4.054712] audit: type=1400 audit(133.748:3): avc:  denied  { dac_read_search } for  pid=1 comm="init" capability=2  scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=capability permissive=1
[    4.071669] audit: type=1400 audit(133.748:4): avc:  denied  { create } for  pid=1 comm="init" name="cgroup.procs" scontext=u:r:init:s0 tcontext=u:object_r:cgroup:s0 tclass=file permissive=1
[    4.089240] usb 1-1: New USB device found, idVendor=0424, idProduct=2744
[    4.095960] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    4.103088] usb 1-1: Product: USB2744
[    4.105605] ueventd: Coldboot took 0.202 seconds
[    4.111355] usb 1-1: Manufacturer: Microchip Tech
[    4.116639] audit: type=1400 audit(133.964:5): avc:  denied  { write } for  pid=27 comm="kdevtmpfs" name="001" dev="devtmpfs" ino=5132 scontext=u:r:kernel:s0 tcontext=u:object_r:device:s0 tclass=dir permissive=1
[    4.116963] wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11)
[    4.123077] wlcore: loaded
[    4.123420] hub 1-1:1.0: USB hub found
[    4.123459] hub 1-1:1.0: 4 ports detected
[    4.142654] EXT4-fs (mmcblk0p6): recovery complete
[    4.143864] EXT4-fs (mmcblk0p6): mounted filesystem with ordered data mode. Opts: discard,noauto_da_alloc,data=ordered,user_xattr,discard,barrier=1
[    4.154323] EXT4-fs (mmcblk0p5): mounted filesystem with ordered data mode. Opts: (null)
[    4.156003] EXT4-fs (mmcblk0p4): Ignoring removed nomblk_io_submit option
[    4.184517] audit: type=1400 audit(133.964:6): avc:  denied  { mknod } for  pid=27 comm="kdevtmpfs" capability=27  scontext=u:r:kernel:s0 tcontext=u:r:kernel:s0 tclass=capability permissive=1
[    4.201550] audit: type=1400 audit(133.964:7): avc:  denied  { add_name } for  pid=27 comm="kdevtmpfs" name="002" scontext=u:r:kernel:s0 tcontext=u:object_r:device:s0 tclass=dir permissive=1
[    4.207910] hci-ti serial0-0: Direct firmware load for ti-connectivity/TIInit_11.8.32.bts failed with error -2
[    4.207917] Bluetooth: hci0: request_firmware failed(errno -2) for ti-connectivity/TIInit_11.8.32.bts
[    4.207918] Bluetooth: hci0: download firmware failed, retrying...
[    4.213567] usb 2-1: new SuperSpeed USB device number 2 using xhci-hcd
[    4.233879] usb 2-1: New USB device found, idVendor=0424, idProduct=5744
[    4.233883] usb 2-1: New USB device strings: Mfr=2, Product=3, SerialNumber=0
[    4.233887] usb 2-1: Product: USB5744
[    4.233890] usb 2-1: Manufacturer: Microchip Tech
[    4.235302] hub 2-1:1.0: USB hub found
[    4.235353] hub 2-1:1.0: 3 ports detected
[    4.249777] EXT4-fs (mmcblk0p4): recovery complete
[    4.251000] EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Opts: errors=remount-ro,nomblk_io_submit
[    4.295506] audit: type=1400 audit(133.964:8): avc:  denied  { create } for  pid=27 comm="kdevtmpfs" name="002" scontext=u:r:kernel:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1
[    4.312708] audit: type=1400 audit(133.964:9): avc:  denied  { setattr } for  pid=27 comm="kdevtmpfs" name="002" dev="devtmpfs" ino=5454 scontext=u:r:kernel:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1
[    4.441523] usb 1-1.4: new high-speed USB device number 3 using xhci-hcd
[    4.546239] usb 1-1.4: New USB device found, idVendor=0424, idProduct=2740
[    4.553120] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    4.560430] usb 1-1.4: Product: Hub Controller
[    4.564869] usb 1-1.4: Manufacturer: Microchip Tech
[    4.621249] audit: type=1400 audit(134.468:10): avc:  denied  { read } for  pid=2586 comm="e2fsck" name="mmcblk0p4" dev="tmpfs" ino=2071 scontext=u:r:fsck:s0 tcontext=u:object_r:block_device:s0 tclass=blk_file permissive=1
[    4.736562] hci-ti serial0-0: Direct firmware load for ti-connectivity/TIInit_11.8.32.bts failed with error -2
[    4.746584] Bluetooth: hci0: request_firmware failed(errno -2) for ti-connectivity/TIInit_11.8.32.bts
[    4.755802] Bluetooth: hci0: download firmware failed, retrying...
[    5.189482] e2fsck: e2fsck 1.43.3 (04-Sep-2016)
[    5.189482]
[    5.195548] e2fsck: Pass 1: Checking inodes, blocks, and sizes
[    5.195548]
[    5.202865] e2fsck: Pass 2: Checking directory structure
[    5.202865]
[    5.209696] e2fsck: Pass 3: Checking directory connectivity
[    5.209696]
[    5.216742] e2fsck: Pass 4: Checking reference counts
[    5.216742]
[    5.223291] e2fsck: Pass 5: Checking group summary information
[    5.223291]
[    5.230606] e2fsck: DATA: 935/760368 files (0.2% non-contiguous), 81898/3036416 blocks
[    5.230606]
[    5.248543] EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Opts: discard,noauto_da_alloc,data=ordered,user_xattr,discard,barrier=1
[    5.312482] hci-ti serial0-0: Direct firmware load for ti-connectivity/TIInit_11.8.32.bts failed with error -2
[    5.322587] Bluetooth: hci0: request_firmware failed(errno -2) for ti-connectivity/TIInit_11.8.32.bts
[    5.331806] Bluetooth: hci0: download firmware failed, retrying...
[    5.412020] logd.auditd: start
[    5.415786] logd.klogd: 5414288607
[    5.569404] binder: 2596:2596 ioctl 620a 0 returned -22
[    5.704084] type=1400 audit(135.552:14): avc: denied { dac_read_search } for pid=2600 comm="vold" capability=2 scontext=u:r:vold:s0 tcontext=u:r:vold:s0 tclass=capability permissive=1
[    5.888457] hci-ti serial0-0: Direct firmware load for ti-connectivity/TIInit_11.8.32.bts failed with error -2
[    5.898471] Bluetooth: hci0: request_firmware failed(errno -2) for ti-connectivity/TIInit_11.8.32.bts
[    5.907707] Bluetooth: hci0: download firmware failed, retrying...
[    6.391389] type=1400 audit(135.552:14): avc: denied { dac_read_search } for pid=2600 comm="vold" capability=2 scontext=u:r:vold:s0 tcontext=u:r:vold:s0 tclass=capability permissive=1
[    6.405045] logd.daemon: reinit
[    6.411190] type=1400 audit(136.240:15): avc: denied { dac_read_search } for pid=1 comm="init" capability=2 scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=capability permissive=1
[    6.477305] type=1400 audit(136.240:15): avc: denied { dac_read_search } for pid=1 comm="init" capability=2 scontext=u:r:init:s0 tcontext=u:r:init:s0 tclass=capability permissive=1
[    6.493576] type=1400 audit(136.324:16): avc: denied { module_request } for pid=1 comm="init" kmod="usbfunc:ffs" scontext=u:r:init:s0 tcontext=u:r:kernel:s0 tclass=system permissive=1
[    7.839259] type=1400 audit(136.324:16): avc: denied { module_request } for pid=1 comm="init" kmod="usbfunc:ffs" scontext=u:r:init:s0 tcontext=u:r:kernel:s0 tclass=system permissive=1
[    7.857050] type=1400 audit(137.688:17): avc: denied { create } for pid=1 comm="init" name="cgroup.procs" scontext=u:r:init:s0 tcontext=u:object_r:cgroup:s0 tclass=file permissive=1
[    8.587947] healthd: unable to get HAL interface, using defaults
[    8.642833] healthd: No battery devices found
[    8.648191] healthd: battery l=100 v=0 t=42.4 h=2 st=2 chg=a
custom:/ $ [    9.486179] Mali<2>:
[    9.486191] Session 0x6BF80200 with pid 2702 was granted higher priority.
[    9.509171] init: starting service 'bootanim'...
[   10.176652] init: Untracked pid 2785 exited with status 0
[   10.182336] init: Service 'surfaceflinger' (pid 2702) killed by signal 11
[   10.191348] init: Sending signal 9 to service 'surfaceflinger' (pid 2702) process group...
[   10.200093] init: Successfully killed process cgroup uid 1000 pid 2702 in 0ms
[   10.291412] binder: send failed reply for transaction 319 to 2782:2782
[   11.473152] init: starting service 'surfaceflinger'...
[   11.479393] init: property_set("ro.boottime.surfaceflinger", "11477273236") failed: property already set
[   11.479538] init: Failed to bind socket 'pdx/system/vr/display/client': No such file or directory
[   11.479801] init: Failed to bind socket 'pdx/system/vr/display/manager': No such file or directory
[   11.480008] init: Failed to bind socket 'pdx/system/vr/display/vsync': No such file or directory
[   11.787033] Mali<2>:




init.hardware.usbrc:

on boot
    mkdir /dev/usb-ffs 0770 shell shell
    mkdir /dev/usb-ffs/adb 0770 shell shell
    mount configfs none /config
    mkdir /config/usb_gadget/g1 0770 shell shell
    write /config/usb_gadget/g1/idVendor 0x18d1
    write /config/usb_gadget/g1/bcdDevice 0x0223
    write /config/usb_gadget/g1/bcdUSB 0x0200
    mkdir /config/usb_gadget/g1/strings/0x409 0770
    write /config/usb_gadget/g1/strings/0x409/serialnumber 12345678
    write /config/usb_gadget/g1/strings/0x409/manufacturer "pls"
    write /config/usb_gadget/g1/strings/0x409/product "ADB Gadget"
    mkdir /config/usb_gadget/g1/functions/ffs.adb
    mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell
    mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
    write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
    write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100"
    write /config/usb_gadget/g1/configs/b.1/MaxPower 500
    symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
    mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
    setprop sys.usb.configfs 1
    setprop sys.usb.config adb
    setprop sys.usb.controller "fed00000.dwc3"

on property:sys.usb.config=none && property:sys.usb.configfs=1
    write /config/usb_gadget/g1/os_desc/use 0
    setprop sys.usb.ffs.ready 0

on property:init.svc.adbd=stopped
    setprop sys.usb.ffs.ready 0

on property:sys.usb.config=adb && property:sys.usb.configfs=1
    write /config/usb_gadget/g1/idProduct 0x4ee7

Nam Nguyễn

unread,
Jun 3, 2020, 6:27:56 PM6/3/20
to android-porting
adbd on the board might not started yet.

Trần Kha

unread,
Jun 3, 2020, 6:27:56 PM6/3/20
to android-porting
Hello Droid,

You are getting some issues and display is not completed. So some services are not run correctly. Abd need to wait for some state to trigger. So if you have console, please run command "logcat" and find out debug messages of your current issue.

Regards,
Kha Tran

Droid

unread,
Jun 4, 2020, 11:09:32 AM6/4/20
to android-porting

Hi Kha,

To my bad, the serial console is printing logs but it stopped taking inputs as and when it starts booting android. Also, the surfaceflinger restart is happening in loop continuously. 
BTW, do you know when does adbd service triggers during boot? I checked the .rc files and i see i set all required props for trigger to happen except ffs.ready.

Is there anyway that i can get adbd starts before bootanimation service starts.?

Thanks
Droid

Trần Kha

unread,
Jun 4, 2020, 4:31:59 PM6/4/20
to android-porting
Hi Droid,

Are you using user build? Is it right?

Please try to build userdebug or eng to get console. With userdebug or eng build, you can easily type your command in console. Please try to lunch your combo as userdebug instead.

Regarding adbd start, I may check and share you my investigation soon if any luck..
Regards,
Kha

Droid

unread,
Jun 5, 2020, 10:47:19 AM6/5/20
to android-porting
Hi Kha,

Really appreciate your response on this.

I am already using eng build but can give a try with userdebug as well. Will try and let you know.

On adbstart yeah, let me know once you have something.


Thanks,
Droid.

Trần Kha

unread,
Jun 10, 2020, 7:16:28 PM6/10/20
to android-porting
Hi Droid,

I have not checked adb trigger yet.
But I want to confirm 1 Point:
You said that you couldn’t control your terminal with eng build.. Which tools did you use to get kernel log?

If you use Minicom, please try to disable hardware control flow. Hope it can help you....

To disable “Hardware control flow”, you can refer instruction here: https://www.acmesystems.it/minicom

Regards,
Kha

Droid

unread,
Jun 14, 2020, 12:55:45 AM6/14/20
to android-porting
Hi Kha,

I use minicom and hardware flow control was disabled but still same behavior, I am getting uart prints but its not taking my inputs from keyboard.
Do i have to do anything in init scripts for the uart to work?

Thanks,
Droid

Droid

unread,
Jun 27, 2020, 4:31:41 PM6/27/20
to android-porting
Hi,

I am still not able to get serial inputs working, I am getting all the output logs on my terminal but its not taking any inputs. 
Any suggestions on how to debug this further?

Thanks.
Reply all
Reply to author
Forward
0 new messages