UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    [HowTo][OPO]Fix MTP driver permissions

    Support
    flo hacks
    9
    22
    5.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • FlohackF
      Flohack
      last edited by Flohack

      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

      My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

      advocatuxA 1 Reply Last reply Reply Quote 4
      • T
        trainailleur
        last edited by trainailleur

        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

        FlohackF 1 Reply Last reply Reply Quote 0
        • FlohackF
          Flohack @trainailleur
          last edited by

          @trainailleur Good I updated my guide!

          My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

          1 Reply Last reply Reply Quote 1
          • A
            andybleaden
            last edited by

            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

            I got my Nexus 5 then FP2 then one plus cooking on #UBUNTU via @ubports and have run it on Op3T Op6t Pine phone and my favourite OnePlus One

            1 Reply Last reply Reply Quote 1
            • R
              rocky58
              last edited by

              After typed adb reboot recovery, I obtain this message:

              error: device offline

              Known OPO error never resolved

              1 Reply Last reply Reply Quote 0
              • G
                GT
                last edited by

                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.

                1 Reply Last reply Reply Quote 1
                • R
                  rocky58
                  last edited by

                  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.

                  1 Reply Last reply Reply Quote 1
                  • advocatuxA
                    advocatux @Flohack
                    last edited by

                    @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!

                    FlohackF 1 Reply Last reply Reply Quote 0
                    • FlohackF
                      Flohack @advocatux
                      last edited by

                      @advocatux OK thanks added a hint πŸ™‚

                      My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                      1 Reply Last reply Reply Quote 0
                      • BlueKennyB
                        BlueKenny
                        last edited by

                        Thank you for this fix πŸ™‚

                        Fairphone 4
                        PinePhone
                        Nexus 7 Flo

                        1 Reply Last reply Reply Quote 0
                        • advocatuxA
                          advocatux
                          last edited by

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

                          FlohackF 1 Reply Last reply Reply Quote 0
                          • FlohackF
                            Flohack @advocatux
                            last edited by

                            @advocatux Done xD

                            My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                            1 Reply Last reply Reply Quote 1
                            • ?
                              A Former User
                              last edited by A Former User

                              THX Flo @Flohack ! that worked like a charme !!
                              I hope to get some more knowledge about that fancy OPO with this keen support !
                              GREATGREATGREAT πŸ˜‰

                              1 Reply Last reply Reply Quote 0
                              • ?
                                A Former User
                                last edited by

                                @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 !!

                                advocatuxA FlohackF 2 Replies Last reply Reply Quote 0
                                • advocatuxA
                                  advocatux @A Former User
                                  last edited by

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

                                  1 Reply Last reply Reply Quote 0
                                  • FlohackF
                                    Flohack @A Former User
                                    last edited by

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

                                    My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                                    1 Reply Last reply Reply Quote 0
                                    • N
                                      nutzernam
                                      last edited by

                                      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?

                                      FlohackF advocatuxA 3 Replies Last reply Reply Quote 0
                                      • FlohackF
                                        Flohack @nutzernam
                                        last edited by

                                        @nutzernam Dont choose any options in recovery. Just let it sit there and type adb shell πŸ˜‰

                                        My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                                        1 Reply Last reply Reply Quote 0
                                        • FlohackF
                                          Flohack @nutzernam
                                          last edited by

                                          @nutzernam And yes there is no phablet user, you are in recovery and are root user. Take care πŸ˜‰

                                          My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                                          1 Reply Last reply Reply Quote 0
                                          • advocatuxA
                                            advocatux @nutzernam
                                            last edited by advocatux

                                            @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 πŸ™‚

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post