[HowTo][OPO]Fix MTP driver permissions


  • Infrastructure

    Motivation
    Currently MTP access is broken on the OPO and users cannot access their files easily. While a fix has been pushed for 16.04 (OTA-4) already, current vivid needs to be fixed manually.

    How
    Warning: This fix needs to be applied carefully, it can damage your system files! You need to type those commands on your PC in a shell window, not on the phone itself:

    1. Reboot your phone into recovery: adb reboot recovery
    2. Open an adb shell into your phone: adb shell
    3. Create a temporary directory /a, and loop-mount the system image into it: mkdir /a && mount /data/system.img /a
    4. Create a temporary directory /b, and loop-mount the android image into it: mkdir /b && mount /a/var/lib/lxc/android/system.img /b
    5. exit adb shell by pressing CTRL-D
    6. Transfer the rules file to your PC: adb pull /b/ubuntu/usr/lib/lxc-android-config/70-bacon.rules
    7. edit the file with your favourite text editor and change the following: from ACTION=="add", KERNEL=="mtp_usb", OWNER="root", GROUP="mtp", MODE="0660" to ACTION=="add", KERNEL=="mtp_usb", OWNER="root", GROUP="plugdev", MODE="0660" (Note the changed group)
    8. Push back the changed file: adb push 70-bacon.rules /b/ubuntu/usr/lib/lxc-android-config
    9. To be safe, re-enter the adb shell: adb shell
    10. Force changes to disk: sync && umount /b && umount -l /a && sync
    11. exit adb shell by pressing CTRL-D
    12. reboot device and hope its working: adb reboot

    Hope that works for you!

    BR Florian



  • Florian, this works well. Thank you for the fix.

    /a would not umount, giving me the error umount: can't umount /a: Device or resource busy I couldn't see easily what was keeping it busy, so I just tossed umount the -l (lazy) flag, and it worked fine.

    I also had to issue a CTRL-D between steps 10 and 11.

    After reboot, MTP worked fine.

    Thanks again!

    Stephen


  • Infrastructure

    @trainailleur Good I updated my guide!


  • Community

    Well this was really really easy to do.

    I take my hat off to you Florian for taking the time to sort this guide out and write it up.

    I followed it and ...yes it is idiot proof!

    It worked.

    The only change I would make is to insert the word "text" in 7 between favourite and editor

    Now my OPO rebooted and mounted automatically

    Yippeeeee



  • After typed adb reboot recovery, I obtain this message:

    error: device offline

    Known OPO error never resolved



  • Thanks @Flohack, your HowTo worked perfectly.

    Step 1 did not work on my OPO, so I had to put it manually into recovery mode (Powerbutton + volume down for a few seconds (while it is switched of)). Then steps 2 - 12 went smoothly. Thanks for the HowTo!!!

    @rocky58: If adb reports "device offline", then it sometimes helps to simply wait for a few seconds or to unplug and plug in again the USB cable. This worked for me.



  • Okkkkkkkkey... all worked fine. At last I can mount my OPO using my Ubuntu PC.
    Thanks @Flohack for the job and also @GT for the suggest.



  • @flohack helping a user in the UB Welcome & Install Group he thought he have to type all the commands on the phone screen. So maybe is a good idea to add the step Connect the PC or laptop to the phone using a USB cable or something like that.

    Thank you for your guide!


  • Infrastructure

    @advocatux OK thanks added a hint :)



  • Thank you for this fix :)



  • @Flohack this thread needs the "FLO HACKS" tag to find it easier.


  • Infrastructure

    @advocatux Done xD



  • THX Flo @Flohack ! that worked like a charme !!
    I hope to get some more knowledge about that fancy OPO with this keen support !
    GREATGREATGREAT ;-)



  • @Flohack please take the Note, I just learned, that you have to install the

    [[HowTo] [OPO] Fix MTP driver permissions](link url)

    before attemptig to update/upgrade with the ubports-installer , because this is mandatory.
    the installer will not be successfull whatsoever before taking care for that solution at the
    affected Devices !!



  • @pet_hh don't leave us hanging! What do we need to install? ^_^


  • Infrastructure

    @pet_hh Hmm this is strange, adb should work, only MTP would be broken. We shall test!



  • I have a problem with this HowTo:
    When i start "abd reboot recovery" i come to the Recovery Screen.
    But what next?
    Choose one of the options? Which one? When i try to access the phone by "adb shell" the terminal shows "~ # " and not "...@phablet..."
    Since there is a warning ( it can damage your system files! ) i want to be sure what to do next:
    Choose an option or continue in the terminal?


  • Infrastructure

    @nutzernam Dont choose any options in recovery. Just let it sit there and type adb shell ;)


  • Infrastructure

    @nutzernam And yes there is no phablet user, you are in recovery and are root user. Take care ;)



  • @nutzernam when your phone is on that recovery screen you don't have to select anything there, just use your terminal.

    When i try to access the phone by "adb shell" the terminal shows "~ # " and not "...@phablet..."

    With your phone connected, type first adb devices in your PC to see if adb recognizes your OPO. That command also starts the needed server if it isn't running already. If it does, follow the instructions carefully. If it doesn't maybe there's a problem with the usb cable, or the usb port you're using, etc

    Edit: @Flohack was quicker :)


Log in to reply
 

Looks like your connection to UBports Forum was lost, please wait while we try to reconnect.