Ubuntu: How to install Ubuntu on Meizu Pro 5 that was originally with Android?



Question:

I have bought Meizu Pro 5, the Flyme OS version. I want to install Ubuntu Phone on it. How can I do it and where can I get the needed firmware and tools?

Thank you very much!


Solution:1

  1. XDA Developers: [TUTORIAL] Change region/ID to International in Meizu Pro 5

    If you are using the global version, you needn't do this step.

  2. XDA Developers: [TUTORIAL] Unlock the bootloader of Meizu PRO 5

  3. XDA Developers: [RECOVERY][M86][UNOFFICIAL] TWRP 3.0 for Meizu PRO

  4. Read these 3 articles about Ubuntu Touch

Meizu pro 5 is named turbo.

             Install ubuntu with TWRP(Android edition's kernel):  

Download the ROM you need.

You can show images use

ubuntu-device-flash query --device=turbo --channel=ubuntu-touch/stable/meizu.en --show-image  

Download the kernel-OTA-10.2.zip which I packaged here for OTA 10.2.

CAUTION: If you want to install other version then OTA 10.2. you need to replace 4 files in the above kernel*.zip from the device*.tar.xz file you had downloaded. boot.img, dtb and logo.bin are in partitions folder, ldfw is in blobs. DO NOT FLASH bootloader and recovery! (meaning do not put these files into the above kernel*.zip file)

Enter to recovery mode (TWRP) by pressing the volume up + down + power buttons for 5 seconds.

In TWRP wipe data,cache,system.

In TWRP install kernel-OTA-10.2.zip (with the replaced boot.img, dtb, logo.bin, ldfw)

In TWRP mount the system partition (remove the readonly mode).

In TWRP run commands below in terminal:

cd /  tar -xf /external_sd/ubuntu*.tar.xz  tar -xf /external_sd/device*.tar.xz  tar -xf /external_sd/custom*.tar.xz  tar -xf /external_sd/version*.tar.xz  sync  

Reboot to system.

Notes:

It may not get OTA updates without a recovery provide by Ubuntu edition.

You can do all the steps above without external sd card, the mobile can be seen all the time through usb.


Solution:2

So first thing: There are 4 flavors of meizu pro5 out there. And I am not talking about hardware specs or version of flyme.

The hack works only on the international flavor of pro5. To get to this one use XDA Developers: [TUTORIAL] Change region/ID to International in Meizu Pro 5.

The real problem is that the android phone comes with the bootloader locked so fastboot will not work.

The solution comes with a "development" image of global flyme that allows you to do "fastboot oem unlock". So after having an international flavor use this XDA Developers: [TUTORIAL] Unlock the bootloader of Meizu PRO 5

You now can use fastboot so in theory you could just flash the ubuntu image, but you cannot. The problem is the partitioning, on the android pro5 you have 512M for "custom" partition and 512M for "cache" partition. The "cache" partition is used to store the images before instalation and 512M is just not enough. The ubuntu edition has 700M plus.

The solution:

First load a proper recovery partition: XDA Developers: [RECOVERY][M86][UNOFFICIAL] TWRP 3.0 for Meizu PRO

This is a good thing because you now have an adb enabled recovery image.

The bad thing is that, more will come about this later, the first bad thing is that the fdisk from twrp cannot modify partitions.

So you can now do adb shell and get a root prompt into your phone.

  • Now mount the system parittion, and unmount all the others (you do that from twrp menu) erase everything in /system (the sytem partition).

  • Grab some ubuntu touch system image like :ubuntu touck meizu pro5 ota-15

  • push it into the internal storage (adb push {file_name} /sdcard)

  • extract it into the /system, we are not doing a manual instalation, we are just putting some proper partition modification tools on the phone. Your ubunty system is now in /system/system

  • copy /dev into /system/system/dev (cp -a /dev /system/system)

  • now you can do chroot /system/systen fdisk /dev/block/sda

There are now many ways to do partitioning the idea is to get from this partition table:

  ~ # fdisk /dev/block/sda  Note: sector size is 4096 (not 512)  Found valid GPT with protective MBR; using GPT      Command (m for help): p  Disk /dev/block/sda: 61071360 sectors,  992M  Logical sector size: 4096  Disk identifier (GUID): 00042021-0408-4601-9dcc-a8c51255994f  Partition table holds up to 128 entries  First usable sector is 6, last usable sector is 7633914    Number  Start (sector)    End (sector)  Size       Code  Name     1            1024            1279       1024K   0700  private     2            1280            1343        256K   0700  proinfo     3            1344            1407        256K   0700  misc    21            2048            3071       4096K   0700  param    22            3072            5119       8192K   0700  efs    23            5120            5631       2048K   0700  pnv    24            5632            6655       4096K   0700  ldfw    25            6656            7679       4096K   0700  dtb    26            7680           13823       24.0M   0700  bootimg    27           13824           22015       32.0M   0700  recovery    28           22016           30207       32.0M   0700  bootlogo    29           30208           35327       20.0M   0700  rstinfo    30           35328           40447       20.0M   0700  mnv    31           40448           45567       20.0M   0700  reserved1    32           45568           50687       20.0M   0700  reserved2    33           50688           55807       20.0M   0700  reserved3    41           65536          720895       2560M   0700  system    42          720896          851967        512M   0700  custom    43          851968          983039        512M   0700  cache    44          983040         7633914       25.3G   0700  userdata    

To something like this:

  ~ # fdisk /dev/block/sda  Note: sector size is 4096 (not 512)  Found valid GPT with protective MBR; using GPT      Command (m for help): p  Disk /dev/block/sda: 61071360 sectors,  992M  Logical sector size: 4096  Disk identifier (GUID): 00042021-0408-4601-9dcc-a8c51255994f  Partition table holds up to 128 entries  First usable sector is 6, last usable sector is 7633914    Number  Start (sector)    End (sector)  Size       Code  Name     1            1024            1279       1024K   0700  private     2            1280            1343        256K   0700  proinfo     3            1344            1407        256K   0700  misc    21            2048            3071       4096K   0700  param    22            3072            5119       8192K   0700  efs    23            5120            5631       2048K   0700  pnv    24            5632            6655       4096K   0700  ldfw    25            6656            7679       4096K   0700  dtb    26            7680           13823       24.0M   0700  bootimg    27           13824           22015       32.0M   0700  recovery    28           22016           30207       32.0M   0700  bootlogo    29           30208           35327       20.0M   0700  rstinfo    30           35328           40447       20.0M   0700  mnv    31           40448           45567       20.0M   0700  reserved1    32           45568           50687       20.0M   0700  reserved2    33           50688           55807       20.0M   0700  reserved3    41           65536         2441406       9280M   0700  system    42         2441472         2703615       1024M   0700  custom    43         2703616         2965759       1024M   0700  cache    44         2965760         7633914       17.8G   0700  userdata  

So I have also enlarged the system partition. After this reboot (into recovery) to resync the partitions use twrp to enlarge now the system partition. and use adb shell to reformat the new "custom", "cache" and "userdata" partitions.

YOU ARE READY TO FLASH.

Be very careful now, the last bad thing about TWRP is that it will not run the flashing process of ubuntu touch.

So go grap the dummer, but ubuntu flash friendly, official ubuntu recovery image.

Start the flash process with:

ubuntu-device-flash touch --device=turbo --channel=ubuntu-touch/stable/meizu.en

It will take some time to download and push the files to the device. BE RAEDY. As soon as the device reboots, press power + volume-down to get into bootloader. now fastboot flash recovery recovery-turbo.img. Now you can reboot into recovery and let the automatic flashing process continue.

CONGRATULATION. You now have a ubuntu touch on meizu pro5 with automatic and working OTAs.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »