problems flashing UBports on Meizu PRO 5 (Android international edition)



  • Hey there

    I've just got my hands on a Meizu PRO 5 having had an Aquaris E4.5 running UBports. It's an Android international edition and I'm having difficulties getting UBports Ubuntu Touch installed on it and I would really welcome some guidance.

    What I've done so far is as follows.

    unlock bootloader

    I downloaded a Flyme update update.zip and installed it using the Flyme recovery image. In the updated Flyme I engaged developer options and enabled USB debugging. Next I booted the phone into fastboot and ran the following command to unlock the bootloader:

    sudo fastboot oem unlock
    

    flash TWRP recovery image and wipe Flyme

    I downloaded TWRP_3.0_m86.img, rebooted the phone into fastboot and ran the following command to flash the TWRP recovery image (over the Flyme recovery image):

    sudo fastboot flash recovery TWRP_3.0_m86.img
    

    I used TWRP to wipe Flyme from the phone.

    flash Ubuntu Touch recovery image

    I downloaded recovery-turbo.img, rebooted the phone into fastboot and ran the following command to flash the Ubuntu Touch recovery (over the TWRP recovery image):

    sudo fastboot flash recovery recovery-turbo.img
    

    flash UBports

    I booted the phone into the Ubuntu Touch recovery (such that the Ubuntu logo is displayed), then I installed UBports Installer and launched it:

    snap install ubports-installer
    ubports-installer
    

    The UBports installer detected the Meizu PRO 5 and I set it to install using the 16.04/devel channel and to wipe the existing system (again). The installer rebooted the phone but not to fastboot (which it appears is intended) and then it simply hung. With the installer still running, I rebooted the phone into fastboot. The installer picked up from there but then hung apparently after flashing the Ubuntu Touch recovery image. The last terminal output from it before it hangs indefinitely is as follows:

    debug: reboot to bootloader
    debug: 
    debug: reboot to bootloader [DONE] err:null
    debug: checking password
    debug: correct password
    debug: fastboot: wait for device
    info: Download startCheck
    info: checked: recovery-turbo.img
    info: /home/user/snap/ubports-installer/122/.cache/ubportsimages/turbo/recovery-turbo.img already exists with the expected checksum, so download will be skipped
    info: Download complete
    info: done downloading(once listener)
    debug: fastboot: flash; [{"type":"recovery","url":"http://cdimage.ubports.com/devices/recovery-turbo.img","checksum":"632dae343d026d755867c43ba8634c42edcc5d2b81856e790ebc8d71eaf18c03","path":"/home/user/snap/ubports-installer/122/.cache/ubportsimages/turbo"}]
    

    I have tried using different install channels without success. I've also tried installing UBports using ubuntu-device-flash with the phone in fastboot. When I do this, it looks like things have gone to 100 %, but then ubuntu-device-flash hangs with terminal output like the following:

    2018/05/19 19:43:46 Device is |turbo|
    2018/05/19 19:43:52 Flashing version 81 from ubports-touch/16.04/devel channel and server http://system-image.ubports.com to device turbo
    349.33 MB / 349.33 MB [==================================] 100.00 % 297.48 KB/s 
    

    I've no idea what to try next and would welcome some guidance. I can't wait to get up and running! :)



  • @blandcorporation Please go to
    https://t.me/WelcomePlus
    Thats is the welcome and install group on Telegram. They have full experience with these issues, and is the quickest way to get an answer.
    If your are averse to using telegram and no one else has answered here I will get someone to pop over for you.



  • @blandcorporation as you can see in https://devices.ubuntu-touch.io/device/turbo

    Note: Meizu Pro 5 devices that are sold with Android have a locked bootloader, so installing UBports' version of Ubuntu Touch is only possible on devices that come with Ubuntu in the first place.

    So from that point on is adventure time. You can read the following an see if any of the workarounds works for you:

    https://forums.ubports.com/topic/708/meizu-pro5-fastboot-mode-locked (see the last comment, specially).

    https://forums.ubports.com/topic/665/meizu-pro-5-without-any-os



  • @blandcorporation Have you tried 15.04?
    16.04 needs a more room on your cache partition than 15.04, that is the reason it won't install.
    Try 15.04 and report back.



  • @blandcorporation have you changed the Chinese Flyme ID to Global, before wiping it?



  • @stefano just in case you don't know it, you can click on those 3 dots on the right hand side (near the upvote&downvote arrows) to edit your posts :)



  • @stefano flyme.os.calls G , international on their downloads page, happened to notice yesterday,i thought i was getting the wrong firmware ( i thought you needed to flash old ubuntu touch first,to get partitions sized ).



  • @advocatux dont you need to flash old version of Flyme to get an easier ,one to unlock ~



  • @marathon2422 sorry, I don't know. I don't have any experience with Meizu PRO 5.



  • @advocatux Thanks for that. As I mentioned in the first section, I've unlocked the bootloader, so I don't think this is the issue.

    @Stefano Thanks for the suggestions. Yes, I've tried 15.04/stable and 16.04/devel with the UBports installer and with ubuntu-device-flash without success. As I mentioned in the title, I think I have an international edition, so I don't think I need to go through the procedures for the Chinese models (nor do I think I would have got this far if I had a Chinese model). What I have not done is altered the cache partition and this is because I've not found a guide on how to do this. My guess at this point is that such a modification might involve connecting to the shell offered by TWRP and then using GNU Parted, but I don't know. I have read ideas about flashing a Canonical image of Ubuntu Touch to resize partitions but, again, I just don't know how to do this.

    @Lakota Ah thanks. I'll give that a try.



  • @advocatux there is youtube stuff ,i will look later



  • @marathon2422 perfect.

    @BlandCorporation yes, I should read slower :)



  • @blandcorporation use the search option on this forum for something like pro 5 cache partion resize iron similar. There is a thread somewhere that will help I remember reading it. Out today so don't have time to look properly.





  • @advocatux Thanks again advocate. Not sure what my instruction to “iron similar” was about but never mind : ) Your PR fees have been reduced accordingly ; )



  • @lakota I found that post perfectly ironed and without any wrinkle :)



  • @blandcorporation that's strange, 15.04 should install without issue.





  • @Stefano Oh excellent! I followed your directions from here and now there's a working UBports 15.04 on my Meizu PRO 5. Thanks so much! :D

    I hope you don't mind, but I'd love to get a little more guidance from you, if you are willing. I want to get this machine up to 16.04/devel.

    After using TWRP to restore your image, I flashed the Ubuntu recovery image and then, just to test it out, tried to see if the Ubuntu update facility in the settings would be able to update the system. Unfortunately something isn't quite working here and I'm getting the "Update failed, contact support." message from the Ubuntu recovery. Perhaps this is partition-related.

    Anyway, now I'm thinking about changing the partitions to prepare the machine for 16.04/devel. I can see that you had some success on this here. Would you be able to tell me the commands you used?



  • yeah, that's an advanced procedure, don't know if you're familiar with fdisk and gparted , but if you read that post carefully first, it will shed some light on you.
    You need to reboot to TWRP recovery and adb shell from your PC.
    You need to decrease the size of partition 42 ( sda 42 )(custom)

    /dev/block/sda42 720896 797700 76805 300M Linux filesystem
    /dev/block/sda43 851968 983039 131072 512M Microsoft basic data
    /dev/block/sda44 983040 7633914 6650875 25.4G Microsoft basic data

    and increase the size of partition 43(sda43) (cache)

    I decreased the 42 to 300M and increased 43 to 700 (-ish) and 16.04 installed without any issue then

    In your case the partitions start and end block will be different as you have 64Gb version of PRO5, but that's not an issue.

    Just follow the instrucions ;

    reboot to TWRP,
    In terminal on your PC write;

    mount /dev/block/sda41 /system
    mount -t proc proc /system/proc
    mount -t sysfs sys /system/sys
    mount -o bind /dev /system/dev
    chroot /system /bin/bash

    type: fdisk
    type: fdisk /dev/block/sda

    type: m
    Now you should be in the menu of FDISK utility,

    have a look at the commands.

    type: p

    the output should be your phone partition table, copy it and save it to Libre Office writer or whatever you want( gedit...etc)

    Now you can see your partitions 42 and 43 which are of your interest.
    You need to decrease the size of 42 and increase 43.
    About 725M for partition of 43 would suffice, but you can give it more if you'd like.
    Remember what you add to 43 you need to take from 42.

    Here is my table for comparison only:

    Device Start End Sectors Size Type
    /dev/block/sda1 1024 1279 256 1M Microsoft basic data
    /dev/block/sda2 1280 1343 64 256K Microsoft basic data
    /dev/block/sda3 1344 1407 64 256K Microsoft basic data
    /dev/block/sda21 2048 3071 1024 4M Microsoft basic data
    /dev/block/sda22 3072 5119 2048 8M Microsoft basic data
    /dev/block/sda23 5120 5631 512 2M Microsoft basic data
    /dev/block/sda24 5632 6655 1024 4M Microsoft basic data
    /dev/block/sda25 6656 7679 1024 4M Microsoft basic data
    /dev/block/sda26 7680 13823 6144 24M Microsoft basic data
    /dev/block/sda27 13824 22015 8192 32M Microsoft basic data
    /dev/block/sda28 22016 30207 8192 32M Microsoft basic data
    /dev/block/sda29 30208 35327 5120 20M Microsoft basic data
    /dev/block/sda30 35328 40447 5120 20M Microsoft basic data
    /dev/block/sda31 40448 45567 5120 20M Microsoft basic data
    /dev/block/sda32 45568 50687 5120 20M Microsoft basic data
    /dev/block/sda33 50688 55807 5120 20M Microsoft basic data
    /dev/block/sda41 65536 720895 655360 2.5G Microsoft basic data
    /dev/block/sda42 720896 797700 76805 300M Microsoft basic data
    /dev/block/sda43 797952 983039 185088 723M Microsoft basic data
    /dev/block/sda44 983040 7633914 6650875 25.4G Microsoft basic data

    NOW, delete the 42 partition by typing: d
    it should ask you the number of partition
    Command (m for help): d
    Partition number (1-3,21-33,41-44, default 44): 42

    Partition 42 has been deleted.

    Now you need to create a new 42 partition with smaller size
    type: n
    it will ask you for a partition number and you'll type 42
    now it's asking for a first sector and you'll need to calculate the size as your 64Gb phone has a different partition table as mine 32Gb.

    the first sector should stay the same, just press enter on keyboard,
    the end sector you'll need to try to guess it. I've used end sector of 790000 instead of 810000, thus gaining some space for partition 43, but you'll need to try it on you own.
    NO WORRIES, unless you save it, it won't be set, you can try it again and again, just by pressing q and enter
    Then again typing: fdisk /dev/block/sda
    and you'll be in the fdisk menu again, without any changes to the partition table, you can verify this by typing: p
    I know it's a good game to try to guess the partition size, I've gone through that as well.

    Anyway, when you finally manage to set the right end sector of partition 42, you'll need to change the partition type as at the moment is LINUX FILE SYSTEM and we nee a MICROSOFT BASIC DATA ( or type 6 )
    In order to do that, type command : t
    It will ask you for a partition No, you type: 42
    Now it will ask for a type of the partition 42
    type in: l
    It will list all known file types, as you can see we need the No. 6 or MICROSOFT basic data
    type: 6
    Changed type of partition 'Linux filesystem' to 'Microsoft basic data'.

    Now go back and verify that by typing: p

    it should list again the partition table with changed 42 partition size and file type.

    You'll need to verify this by typing: v

    See something like this?
    Command (m for help): v
    No errors detected.
    Header version: 1.0
    Using 20 out of 128 partitions.
    A total of 11386 free sectors is available in 3 segments (the largest is 38 MiB).
    So it's verified.

    Now type: x
    It will take you to expert menu/mode.
    You'll need to change the name of the partition 42 to ''custom''
    To do that, type: m

    This should appear on you Terminal:

    Expert command (m for help): m

    Help (expert commands):

    GPT
    i change disk GUID
    n change partition name
    u change partition UUID
    M enter protective/hybrid MBR

    A toggle the legacy BIOS bootable flag
    B toggle the no block IO protocol flag
    R toggle the required partition flag
    S toggle the GUID specific bits

    Generic
    p print the partition table
    v verify the partition table
    d print the raw data of the first sector from the device
    D print the raw data of the disklabel from the device
    f fix partitions order
    m print this menu

    Save & Exit
    q quit without saving changes
    r return to main menu

    O.K ,type: n
    type:42

    Give it a new name as prompted.
    Type: custom

    Now type: r
    it takes you back to main menu of FDISK utility.

    Type: w
    it writes the changes and saves them.
    Now you should be back in adb shell as root@localhost #
    Good,
    you'll need to format the newly created partition of 42, by typing:
    mke2fs -t ext4 -m 0 /dev/block/sda42

    This should look the output like:

    root@localhost:/# mke2fs -t ext4 -m 0 /dev/block/sda42
    mke2fs 1.42.12 (29-Aug-2014)
    /dev/block/sda42 contains a ext4 file system
    created on Fri Jan 26 19:09:44 2018
    Proceed anyway? (y,n) y
    Discarding device blocks: done
    Creating filesystem with 76805 4k blocks and 76896 inodes
    Filesystem UUID: f7f0db2f-b0e9-4bf7-bf94-ae843a409094
    Superblock backups stored on blocks:
    32768

    Allocating group tables: done
    Writing inode tables: done
    Creating journal (4096 blocks): done
    Writing superblocks and filesystem accounting information: done

    Now to verify if the partition 42 has been decreased in size, reboot the phone to TWRP recovery and again do this steps:

    adb shell

    mount /dev/block/sda41 /system
    mount -t proc proc /system/proc
    mount -t sysfs sys /system/sys
    mount -o bind /dev /system/dev
    chroot /system /bin/bash

    Now go back to fdisk utility by typing: fdisk /dev/block/sda

    and verify the changes in partition 42 by typing: p

    You should see the partition 42( sda42) decreased in size
    If true, congratulation, now to increase the partition 43 (sda43) which is our main interest off course.

    Go back and do the same steps for partition 43 ,delete it, create it, increase the size, change the name to ''cache'', save it, then format it, verify , just like with the partition 42.

    I guess you'll be busy today :-) Have fun.


Log in to reply
 

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