User Tools

Site Tools

OnePlus One - Automount MTP device with Gentoo

Since the Android folks decided that MTP should be the way to connect Android devices via USB I ran into some trouble while trying to get comfortable access to the OnePlus One. There are a couple of forum threads and blog entries out there how to hack some udev rules and use scripts that try to automount the MTPFS. Some recommend mtpfs others use go-mtpfs or jmtpfs. I've tried them all and the result was still not what I wanted to have. Why can't I just plug it in and have it pop up in thunar, like any other USB/Flash device?

Well, the answer is simple: Because I have forgotten to supply the mtp USE flag for gvfs, which manages all mounting related tasks in Xfce4 for me. I also switched to libmtp-9999, because the stable release doesn't know the OnePlus One yet.

Since it's basically a per machine decision, whether it's probable, that it will ever have to mount an MTP device, just put mtp into your global USE flags in /etc/portage/make.conf

Let's see how that would play out:

$ emerge -upvND --with-bdeps=y @world

And voila:

[ebuild     U *] media-libs/libmtp-1.1.8 [1.1.6-r1] USE="crypt -doc -examples -static-libs" 0 kB
[ebuild   R    ] gnome-base/gvfs-1.20.2  USE="cdda gtk http mtp* udev udisks -afp -archive -avahi -bluray -fuse -gnome-online-accounts -gphoto2 -ios -libsecret -samba -systemd {-test}" 0 kB

After the emerge and logout/login to get gvfs reloaded you're good to go.

Connected to a Thinkpad x230 USB 2.0 port it sustained about 29MB/s read transfer rate (copying OnePlus One 4k videos to the Thinkpad's SSD), which is more or less the maximum one can get out of USB 2.0 anyways.


fe80:f8a6:006d:5000:1b65:3573:e146:497e, 2015/03/25 00:49

Great post, helped me, thank you.

Since then the 1.1.8 version of libmtp is in the tree which supports the OnePlus One:

So it's enough to unmask 1.1.8 instead of 9999:

echo '=media-libs/libmtp-1.1.8' ยป /etc/portage/package.keywords

chrono, 2015/03/25 11:06, 2015/03/25 11:28

Nice, thanks for the update. When I get the chance, I'll test it and update the post to keep the info more in line with the real-time situation.

Since this mission log entry is actually receiving a fair amount of traffic, I'd advise to go with Paul's recommendation before going 9999, which you really should only do if you want to work/develop at the cutting edge or the feature is really needed but hasn't arrived in mainline yet, like it was in this case.

Enter your comment. Wiki syntax is allowed:
   ___    ____  _____ __  __ __  __
  / _ \  / __/ / ___/ \ \/ / \ \/ /
 / ___/ / _/  / /__    \  /   \  / 
/_/    /___/  \___/    /_/    /_/