User Tools

Site Tools

Navigation Menu


  • StatusClosed
  • OP-ModePre-Launch
  • LocationN48 - E11
  • Localtime20:21
  • CountdownT-00D 00:00

Hot Projects


SEEDStack - Open 3D printable seed/sprouting systemDIY Food Hacking


UCSSPM - Unified Clear-Sky Solar Prediction ModelOpen Solar Power


picoReflow - DIY PID Reflow Oven Controller based on RaspberryPiDIY Reflow Soldering


PiGI - DIY Geiger Counter based on RaspberryPiRasPi Geiger Counter

DIY ARA-2000

Active Wideband Receiver Antenna for SDR - ARA-2000Wideband Antenna


DSPace - Map everythingMap everything!


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.

Mission-Log entry created by chrono on 2014/10/09 16:58 UTC


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

2015/03/25 11:06

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.

Comment text

Please type the letters you see on the left into the box on the right:

   __    ___   _      __   ____  _____
  / /   / _ \ | | /| / /  / __/ / ___/
 / /__ / // / | |/ |/ /  _\ \  / (_ / 
/____//____/  |__/|__/  /___/  \___/