NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ADB and MTP not working for Android phone on NetBSD



Your mail is incorrectly line-wrapped, making it hard to read and quote.
(error or other output should not be wrapped).

unadvised%airmail.cc@localhost writes:

> When I connect an Android 4.2 device on a NetBSD 10.1 install, running
> adb devices doesn't show the device and MTP doesn't work.

I realize you know this, but Android 4.2 is ancient.

In NetBSD, usb devices in /dev tend to be owned by root and mode 0600.
Thus running anything as a regular user will tend not to work.  I tend
(on what is essentially a single-user machine) to chown them to my own
username.

> From notification I tap "USB connected", then tap on "Turn on USB
> storage". Nothing adds to dmesg but I can access files like this:
>
> $ doas mbrlabel /dev/sd1
> Found MSDOS partition; size 7736320 (3777 MB), offset 8192
>   skipping existing MSDOS partition at slot e.
>
> 5 partitions:
> #        size    offset     fstype [fsize bsize cpg/sgs]
>  d:   7744512         0     unused      0     0        # (Cyl.      0
>  -    3781*)
>  e:   7736320      8192      MSDOS                     # (Cyl.      4
>  -    3781*)
>
> Not updating disk label.
> $ doas mkdir -p /media/user/android
> $ doas chown user:users /media/user/android
> $ doas mount_msdos /dev/sd1e /media/user/android/
> $ df /media/user/android/
> Filesystem     512-blocks         Used        Avail %Cap Mounted on
> /dev/sd1e         7728128      6375872      1352256  82%
> /media/user/android

I am unclear on how locking works with the phone's own access to the
filesystem vs via USB, but I would be concerned about integrity issues.

> On phone, tapping notification labeled "Touch for other USB options."
> and selecting "MTP", then reconnecting device shows this on dmesg:
>
> [ 37891.934651] ugen0 at uhub2 port 1
> [ 37891.934651] ugen0: MediaTek (0x0bb4) MT65xx Android Phone (0x0c02), rev 2.00/2.55, addr 3

ok, not super surprising.

> $ LIBMTP_DEBUG=2 mtp-detect   # from devel/libmtp package
> LIBMTP_Set_Debug: Setting debugging level to 2 (0x02) (on) libmtp version: 1.1.21
>
> Listing raw device(s)
>    No raw devices found.

You are operating as a non-root user it seems.

  change ownership of /dev/ugen0

  use ktrace and then kdump, and in that saved output egrep NAMI to see
  what files it tries to open

> ADB doesn't see the device:
>
> $ adb devices -l   # from devel/android-tools-adb
> List of devices attached

same advice as for mtp



Home | Main Index | Thread Index | Old Index