ShapeShifter499 / android_device_lge_joan

0 stars 5 forks source link

USB Vendor/Product ID not set #1

Open Blazefrost opened 3 years ago

Blazefrost commented 3 years ago

ROM: LineageOS 17.1-20201014-UNOFFICIAL-joan Device: H930 frankensteined from

When attaching the phone to a host device in ADB mode, it falsely reports USB Vendor/Product ID 0000:0000.

➜  ~ lsusb                   
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0cf3:e300 Qualcomm Atheros Communications QCA61x4 Bluetooth 4.0
Bus 001 Device 011: ID 0000:0000 LGE LG-H930RE
Bus 001 Device 003: ID 1bcf:2b95 Sunplus Innovation Technology Inc. Integrated_Webcam_HD
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

As a consequence, Android udev rules do not apply and it is not possible to do USB debugging without starting the daemon as root.

Property sys.usb.configfs is set to 1, so the device uses FunctionFS/configfs and the rules from file /vendor/etc/init/hw/init.lge.usb.rc do not apply.

Interestingly, it seems like file rootdir/etc/init/hw/init.lge.usb.configfs.rc would already perform relevant steps to configure the USB gadget. It is also present on the device as /vendor/etc/init/hw/init.lge.usb.configfs.rc, but the init process does not add it to its include list (excerpt from dmesg):

➜  ~ adb shell dmesg | sed -ne 's/\(init: Parsing file\)/\1/p'
[    2.715247] init: Parsing file /init.rc...
[    2.716285] init: Parsing file /init.environ.rc...
[    2.717177] init: Parsing file /init.usb.rc...
[    2.717508] init: Parsing file /init.joan.rc...
[    2.717985] init: Parsing file /vendor/etc/init/hw/init.joan.rc...
[    2.718391] init: Parsing file /vendor/etc/init/hw/init.qcom.rc...
[    2.720736] init: Parsing file /vendor/etc/init/hw/init.target.rc...
[    2.721952] init: Parsing file /vendor/etc/init/hw/init.qcom.test.rc...
[    2.721997] init: Parsing file /vendor/etc/init/hw/init.lge.usb.rc...
[    2.722973] init: Parsing file /vendor/etc/init/hw/init.lge.usb.dev.rc...
[    2.723002] init: Parsing file /vendor/etc/init/hw/init.lge.usb.comp.rc...
[    2.723034] init: Parsing file /vendor/etc/init/hw/init.lge.power.rc...
[    2.723257] init: Parsing file /vendor/etc/init/hw/init.lge.sensors.rc...
[    2.723440] init: Parsing file /vendor/etc/init/hw/init.lge.fingerprints.rc...
[    2.723618] init: Parsing file /vendor/etc/init/hw/init.lge.audio.rc...
[    2.723653] init: Parsing file /vendor/etc/init/hw/init.msm8998.rc...
[    2.724163] init: Parsing file /init.lge.log.rc...
[    2.724198] init: Parsing file /vendor/etc/init/hw/init.joan_vendor.rc...
[    2.724367] init: Parsing file /init.usb.configfs.rc...
[    2.724849] init: Parsing file /init.zygote64_32.rc...
[    2.725456] init: Parsing file /system/etc/init/adb_root.rc...
[    2.725648] init: Parsing file /system/etc/init/android.hidl.allocator@1.0-service.rc...
[    2.725838] init: Parsing file /system/etc/init/android.system.suspend@1.0-service.rc...
[    2.726028] init: Parsing file /system/etc/init/apexd.rc...
[    2.726227] init: Parsing file /system/etc/init/art_apex_boot_integrity.rc...
[    2.726408] init: Parsing file /system/etc/init/ashmemd.rc...
[    2.726597] init: Parsing file /system/etc/init/atrace.rc...
[    2.727061] init: Parsing file /system/etc/init/atrace_userdebug.rc...
[    2.727259] init: Parsing file /system/etc/init/audioserver.rc...
[    2.727470] init: Parsing file /system/etc/init/blank_screen.rc...
[    2.727658] init: Parsing file /system/etc/init/bootanim.rc...
[    2.727843] init: Parsing file /system/etc/init/bootstat-debug.rc...
[    2.728007] init: Parsing file /system/etc/init/bootstat.rc...
[    2.728244] init: Parsing file /system/etc/init/bpfloader.rc...
[    2.728435] init: Parsing file /system/etc/init/cameraserver.rc...
[    2.728623] init: Parsing file /system/etc/init/drmserver.rc...
[    2.728808] init: Parsing file /system/etc/init/dumpstate.rc...
[    2.729012] init: Parsing file /system/etc/init/flags_health_check.rc...
[    2.729210] init: Parsing file /system/etc/init/gatekeeperd.rc...
[    2.729386] init: Parsing file /system/etc/init/gpuservice.rc...
[    2.729559] init: Parsing file /system/etc/init/gsid.rc...
[    2.729740] init: Parsing file /system/etc/init/heapprofd.rc...
[    2.729936] init: Parsing file /system/etc/init/hwservicemanager.rc...
[    2.730131] init: Parsing file /system/etc/init/idmap2d.rc...
[    2.730312] init: Parsing file /system/etc/init/incidentd.rc...
[    2.730499] init: Parsing file /system/etc/init/init-debug.rc...
[    2.730673] init: Parsing file /system/etc/init/installd.rc...
[    2.730935] init: Parsing file /system/etc/init/iorapd.rc...
[    2.731123] init: Parsing file /system/etc/init/keystore.rc...
[    2.731306] init: Parsing file /system/etc/init/lineage-adb.rc...
[    2.731477] init: Parsing file /system/etc/init/lineage-iosched.rc...
[    2.731707] init: Parsing file /system/etc/init/lineage-livedisplay.rc...
[    2.731890] init: Parsing file /system/etc/init/lineage-radio.rc...
[    2.732063] init: Parsing file /system/etc/init/lineage-ssh.rc...
[    2.732230] init: Parsing file /system/etc/init/lineage-system.rc...
[    2.732429] init: Parsing file /system/etc/init/lineage-updates.rc...
[    2.732591] init: Parsing file /system/etc/init/lmkd.rc...
[    2.732773] init: Parsing file /system/etc/init/logcatd.rc...
[    2.733008] init: Parsing file /system/etc/init/logd.rc...
[    2.733233] init: Parsing file /system/etc/init/logtagd.rc...
[    2.733402] init: Parsing file /system/etc/init/lpdumpd.rc...
[    2.733613] init: Parsing file /system/etc/init/mdnsd.rc...
[    2.733802] init: Parsing file /system/etc/init/mediadrmserver.rc...
[    2.733992] init: Parsing file /system/etc/init/mediaextractor.rc...
[    2.734180] init: Parsing file /system/etc/init/mediametrics.rc...
[    2.734372] init: Parsing file /system/etc/init/mediaserver.rc...
[    2.734568] init: Parsing file /system/etc/init/mtpd.rc...
[    2.734757] init: Parsing file /system/etc/init/netd.rc...
[    2.734959] init: Parsing file /system/etc/init/perfetto.rc...
[    2.735218] init: Parsing file /system/etc/init/racoon.rc...
[    2.735416] init: Parsing file /system/etc/init/recovery-persist.rc...
[    2.735598] init: Parsing file /system/etc/init/rss_hwm_reset.rc...
[    2.735794] init: Parsing file /system/etc/init/servicemanager.rc...
[    2.735995] init: Parsing file /system/etc/init/statsd.rc...
[    2.736196] init: Parsing file /system/etc/init/storaged.rc...
[    2.736386] init: Parsing file /system/etc/init/surfaceflinger.rc...
[    2.736614] init: Parsing file /system/etc/init/tombstoned.rc...
[    2.736810] init: Parsing file /system/etc/init/traceur.rc...
[    2.736993] init: Parsing file /system/etc/init/uncrypt.rc...
[    2.737216] init: Parsing file /system/etc/init/usbd.rc...
[    2.737408] init: Parsing file /system/etc/init/vdc.rc...
[    2.737589] init: Parsing file /system/etc/init/vold.rc...
[    2.737780] init: Parsing file /system/etc/init/wait_for_keymaster.rc...
[    2.738023] init: Parsing file /system/etc/init/wfdservice.rc...
[    2.738247] init: Parsing file /system/etc/init/wifi-events.rc...
[    2.738499] init: Parsing file /system/etc/init/wificond.rc...
[    2.738737] init: Parsing file /product/etc/init...
[    2.738771] init: Parsing file /product_services/etc/init...
[    2.738805] init: Parsing file /odm/etc/init...
[    2.739145] init: Parsing file /vendor/etc/init/android.hardware.audio@2.0-service.rc...
[    2.739467] init: Parsing file /vendor/etc/init/android.hardware.bluetooth@1.0-service-qti.rc...
[    2.739675] init: Parsing file /vendor/etc/init/android.hardware.camera.provider@2.4-service.rc...
[    2.739939] init: Parsing file /vendor/etc/init/android.hardware.cas@1.1-service.rc...
[    2.740128] init: Parsing file /vendor/etc/init/android.hardware.configstore@1.1-service.rc...
[    2.740316] init: Parsing file /vendor/etc/init/android.hardware.drm@1.0-service.rc...
[    2.740586] init: Parsing file /vendor/etc/init/android.hardware.drm@1.1-service.widevine.rc...
[    2.740819] init: Parsing file /vendor/etc/init/android.hardware.drm@1.2-service.clearkey.rc...
[    2.741261] init: Parsing file /vendor/etc/init/android.hardware.gatekeeper@1.0-service.rc...
[    2.741477] init: Parsing file /vendor/etc/init/android.hardware.gnss@1.0-service-qti.rc...
[    2.741678] init: Parsing file /vendor/etc/init/android.hardware.graphics.allocator@2.0-service.rc...
[    2.741946] init: Parsing file /vendor/etc/init/android.hardware.graphics.composer@2.1-service.rc...
[    2.742153] init: Parsing file /vendor/etc/init/android.hardware.health@2.0-service.rc...
[    2.742352] init: Parsing file /vendor/etc/init/android.hardware.keymaster@3.0-service.rc...
[    2.742563] init: Parsing file /vendor/etc/init/android.hardware.light@2.0-service.joan.rc...
[    2.742755] init: Parsing file /vendor/etc/init/android.hardware.media.omx@1.0-service.rc...
[    2.742950] init: Parsing file /vendor/etc/init/android.hardware.memtrack@1.0-service.rc...
[    2.743148] init: Parsing file /vendor/etc/init/android.hardware.nfc@1.1-service.rc...
[    2.743339] init: Parsing file /vendor/etc/init/android.hardware.power@1.2-service.rc...
[    2.743520] init: Parsing file /vendor/etc/init/android.hardware.sensors@1.0-service.rc...
[    2.743711] init: Parsing file /vendor/etc/init/android.hardware.thermal@1.1-service.joan.rc...
[    2.743892] init: Parsing file /vendor/etc/init/android.hardware.usb@1.0-service.rc...
[    2.744071] init: Parsing file /vendor/etc/init/android.hardware.vibrator@1.2-service.lge.rc...
[    2.744248] init: Parsing file /vendor/etc/init/android.hardware.vr@1.0-service.rc...
[    2.744428] init: Parsing file /vendor/etc/init/android.hardware.wifi@1.0-service.rc...
[    2.744612] init: Parsing file /vendor/etc/init/com.qualcomm.qti.wifidisplayhal@1.0-service.rc...
[    2.744800] init: Parsing file /vendor/etc/init/hostapd.android.rc...
[    2.745113] init: Parsing file /vendor/etc/init/hw_vari.rc...
[    2.745305] init: Parsing file /vendor/etc/init/init.lge.audio.rc...
[    2.745494] init: Parsing file /vendor/etc/init/init.lge.bootproperty_trigger.rc...
[    2.745678] init: Parsing file /vendor/etc/init/init.lge.vendor.on_boot.rc...
[    2.745963] init: Parsing file /vendor/etc/init/init.lge.vendor.on_post_fs.rc...
[    2.746159] init: Parsing file /vendor/etc/init/init.lge.vendor.on_post_fs_data.rc...
[    2.746423] init: Parsing file /vendor/etc/init/init.lge.vendor.on_property.rc...
[    2.746635] init: Parsing file /vendor/etc/init/init.lge.vendor.services.rc...
[    2.746857] init: Parsing file /vendor/etc/init/ipacm.rc...
[    2.747070] init: Parsing file /vendor/etc/init/qcrild.rc...
[    2.747319] init: Parsing file /vendor/etc/init/rild.rc...
[    2.747512] init: Parsing file /vendor/etc/init/vendor.display.color@1.0-service.rc...
[    2.747691] init: Parsing file /vendor/etc/init/vendor.lge.hardware.audio.dac.control@1.0-service.rc...
[    2.747932] init: Parsing file /vendor/etc/init/vendor.lge.hardware.biometrics.fingerprint@2.1-service.rc...
[    2.748121] init: Parsing file /vendor/etc/init/vendor.lge.hardware.bootproperty@1.0-service.rc...
[    2.748303] init: Parsing file /vendor/etc/init/vendor.lge.hardware.configstore@1.0-service.rc...
[    2.748486] init: Parsing file /vendor/etc/init/vendor.lge.hardware.platform@1.1-service.rc...
[    2.748668] init: Parsing file /vendor/etc/init/vendor.lge.hardware.property@1.1-service.rc...
[    2.748869] init: Parsing file /vendor/etc/init/vendor.lge.hardware.vss_ims@1.0-service.rc...
[    2.749050] init: Parsing file /vendor/etc/init/vendor.lge.power.rc...
[    2.749687] init: Parsing file /vendor/etc/init/vendor.lineage.livedisplay@2.0-service.joan.rc...
[    2.749891] init: Parsing file /vendor/etc/init/vendor.lineage.touch@1.0-service.joan.rc...
[    2.750080] init: Parsing file /vendor/etc/init/vendor.lineage.trust@1.0-service.rc...
[    2.750263] init: Parsing file /vendor/etc/init/vendor.qti.esepowermanager@1.0-service.rc...
[    2.750447] init: Parsing file /vendor/etc/init/vendor.qti.gnss@1.0-service.rc...
[    2.750634] init: Parsing file /vendor/etc/init/vendor.qti.hardware.alarm@1.0-service.rc...
[    2.750816] init: Parsing file /vendor/etc/init/vendor.qti.hardware.perf@1.0-service.rc...
[    2.750999] init: Parsing file /vendor/etc/init/vendor.qti.hardware.qdutils_disp@1.0-service-qti.rc...
[    2.751180] init: Parsing file /vendor/etc/init/vendor.qti.hardware.qteeconnector@1.0-service.rc...
[    2.751359] init: Parsing file /vendor/etc/init/vendor.qti.hardware.tui_comm@1.0-service-qti.rc...
[    2.751543] init: Parsing file /vendor/etc/init/vndservicemanager.rc...
[    4.929363] init: Parsing file /product/etc/init...
[    4.929399] init: Parsing file /product_services/etc/init...
[    4.929438] init: Parsing file /odm/etc/init...
[    5.637765] init: Parsing file /apex/com.android.media.swcodec@290000000/etc/init.rc...
dofrancis commented 3 years ago

A bit late but this might be fixed with a simple import for /vendor/etc/init/hw/init.lge.usb.configfs.rc in rootdir/etc/init/hw/init.joan.rc. I'll try to see if that does anything.