FORUMS

[GUIDE][Project Treble] Manual - Create Vendor Partition for PT GSI ROM MI3/MI4

1,559 posts
Thanks Meter: 4,287
 
Post Reply Email Thread
PHP Code:
#include  
/* 
 * Your warranty is now void. 
 * 
 * I am not responsible for bricked devices
 * Do With Your Own Risk
 * If you put blamed on me?
 * I will laugh at you. 
 * YOU HAVE BEEN WARNED!
 */ 


Hello Guys, in order to make our Cancro successfully flash GSI Treble Rom, we need to do some of the modification to the internal memory and system space and also create a new partition for vendor image. As we all know there is bunch of guide and tutorial for system partition for MI3 and the very famous and easy is just using script to flash via recovery, and you done. So today im going to lead you to extend your system partition to 2GB, and creating new vendor partition. I tested it on MI3W 16GB and 64GB.


REQUIREMENTS


LET'S BEGIN
  1. Reboot to recovery and connect your phone to Window
  2. Open a cmd window (or terminal, if you're using linux), and connect through adb by typing;
    adb devices enter
    adb shell enter

    Code:
    adb devices
    
    adb shell
  3. If everything is fine and you get a shell input (#), start parted by typing;
    parted /dev/block/mmcblk0 enter
    print enter

    Code:
    parted /dev/block/mmcblk0
    
    print



  4. Output of "print" should be something like this




  5. Remove partition 23 24 25
    rm 23 enter
    rm 24 enter
    rm 25 enter

    Code:
    rm 23
    
    rm 24
    
    rm 25



  6. If you get an error message when rm 25 like this




    • name 25 cache
    • type quit enter
    • reboot recovery on phone
    • connect to adb again
    • repeat #2 , #3 command
    • type print enter
    • type rm 25

  7. And now we are going to create 2GB system partition and vendor partition and rename it
    mkpartfs primary ext2 403 2403 enter
    mkpartfs primary ext2 2403 2453 enter
    mkpartfs primary ext2 2453 2653 enter
    mkpartfs primary ext2 2653 62.5G enter * for 64GB if * 16GB mkpartfs primary ext2 2653 15.8GB

    name 23 system enter
    name 24 cache enter
    name 25 vendor enter
    name 26 userdata enter

    Code:
    mkpartfs primary ext2 403 2403
    
    mkpartfs primary ext2 2403 2453
    
    mkpartfs primary ext2 2453 2653
    
    mkpartfs primary ext2 2653 62.5G
    Code:
     
    name 23 system
    
    name 24 cache
    
    name 25 vendor
    
    name 26 userdata
    
    quit



  8. After renaming and type quit and dont close the cmd and still on shell ~#




  9. Now we are going to convert all newly partition 23 24 25 26 from ext2 to ext4
    tune2fs -j /dev/block/mmcblk0p23 enter
    e2fsck -fDp /dev/block/mmcblk0p23 enter
    tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p23 enter
    e2fsck -fDp /dev/block/mmcblk0p23 enter

    tune2fs -j /dev/block/mmcblk0p24 enter
    e2fsck -fDp /dev/block/mmcblk0p24 enter
    tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p24 enter
    e2fsck -fDp /dev/block/mmcblk0p24 enter

    tune2fs -j /dev/block/mmcblk0p25 enter
    e2fsck -fDp /dev/block/mmcblk0p25 enter
    tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p25 enter
    e2fsck -fDp /dev/block/mmcblk0p25 enter

    tune2fs -j /dev/block/mmcblk0p26 enter
    e2fsck -fDp /dev/block/mmcblk0p26 enter
    tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p26 enter
    e2fsck -fDp /dev/block/mmcblk0p26 enter


    Code:
    tune2fs -j /dev/block/mmcblk0p23
    
    e2fsck -fDp /dev/block/mmcblk0p23
    
    tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p23
    
    e2fsck -fDp /dev/block/mmcblk0p23
    
    
    tune2fs -j /dev/block/mmcblk0p24
    
    e2fsck -fDp /dev/block/mmcblk0p24
    
    tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p24
    
    e2fsck -fDp /dev/block/mmcblk0p24
    
    
    tune2fs -j /dev/block/mmcblk0p25
    
    e2fsck -fDp /dev/block/mmcblk0p25
    
    tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p25
    
    e2fsck -fDp /dev/block/mmcblk0p25
    
    
    tune2fs -j /dev/block/mmcblk0p26
    
    e2fsck -fDp /dev/block/mmcblk0p26
    
    tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p26
    
    e2fsck -fDp /dev/block/mmcblk0p26
    
    exit



  10. Go back to parted to check whether it's applied;
    parted /dev/block/mmcblk0 enter
    print enter

    Code:
    parted /dev/block/mmcblk0
    
    print
  11. Your partition should be like this, if you follow my calculation.




  12. Also can follow this calculation for 1.5 GB system partition.




  13. CONGRATS!! You have success parted your system partition, now you can disable your MI3/MI4 connection from WINDOWS.
  14. Make sure that you still on that CWM Recovery, copy MIUI 10 EU ROM to internal memory, flash it via CWM, wait till your MI3 load till startup wizard. Install MIUI 10 via CWM and reboot around 10 to 20 minutes, pls make sure that your battery is up to 50% above.
  15. Reboot to fastboot and flash TWRP Treble 3.2.3.0 and now you can easily flash GSI ROM type Arm A Only.


Now you already have a system partition 2GB and vendor partition, that enough for flashing GSI Image, Thanks for following my guide.


Reference link


Cancro ROM Group

Group rules:
  1. English only.(You can use the translator to communicate.
  2. Respect developers and administrators.
  3. Please do not send spam.
  4. Do not send stickers continuously.

Channel: @cancro ROM
CN Group: @cancro Group
https://t.me/micancro



Contributor
Attached Thumbnails
Click image for larger version

Name:	photo_2018-12-14_01-03-16 (2).jpg
Views:	302
Size:	63.0 KB
ID:	4665616   Click image for larger version

Name:	photo_2018-12-14_01-02-47.jpg
Views:	300
Size:	25.2 KB
ID:	4665617   Click image for larger version

Name:	photo_2018-12-14_08-49-13.jpg
Views:	306
Size:	32.9 KB
ID:	4665618   Click image for larger version

Name:	photo_2018-12-14_08-49-16.jpg
Views:	262
Size:	116.5 KB
ID:	4665620   Click image for larger version

Name:	photo_2018-12-14_08-49-15.jpg
Views:	248
Size:	105.3 KB
ID:	4665621  
The Following 3 Users Say Thank You to Dzol Cp For This Useful Post: [ View ] Gift Dzol Cp Ad-Free
14th December 2018, 12:33 PM |#2  
Dzol Cp's Avatar
OP Senior Member
Flag TB/BF Penang
Thanks Meter: 4,287
 
Donate to Me
More
RESERVED FOR SCREENSHOT


2GB PARTITION



1.5GB PARTITION


The Following 2 Users Say Thank You to Dzol Cp For This Useful Post: [ View ] Gift Dzol Cp Ad-Free
14th December 2018, 06:06 PM |#3  
Member
Thanks Meter: 1
 
More
These 800 MB free space is left after installation? Or...

Sent from my MI 4W using Tapatalk
15th December 2018, 06:49 AM |#4  
Dzol Cp's Avatar
OP Senior Member
Flag TB/BF Penang
Thanks Meter: 4,287
 
Donate to Me
More
Quote:
Originally Posted by nikolce.markovski

These 800 MB free space is left after installation? Or...

Sent from my MI 4W using Tapatalk

Yes, im using treble rom, and it supposed to be like what you seeing. If no partition done. So there is no taste of trebel gsi rom.
17th December 2018, 07:31 PM |#5  
Junior Member
Thanks Meter: 2
 
More
Great Guide, but how to copy the vendor files in the new Vendor partition, how to extract them from MIUI?
The Following User Says Thank You to dace.manutd For This Useful Post: [ View ] Gift dace.manutd Ad-Free
26th December 2018, 07:24 PM |#6  
kaiz16's Avatar
Member
Thanks Meter: 21
 
More
May i know what's the most stable treble rom ur using rn?
The Following User Says Thank You to kaiz16 For This Useful Post: [ View ] Gift kaiz16 Ad-Free
27th December 2018, 05:32 PM |#7  
Dzol Cp's Avatar
OP Senior Member
Flag TB/BF Penang
Thanks Meter: 4,287
 
Donate to Me
More
Quote:
Originally Posted by dace.manutd

Great Guide, but how to copy the vendor files in the new Vendor partition, how to extract them from MIUI?

First post Reference link

Quote:
Originally Posted by kaiz16

May i know what's the most stable treble rom ur using rn?

HAVOC OS 2.0 OFFICIAL GSI ARM A

The Following User Says Thank You to Dzol Cp For This Useful Post: [ View ] Gift Dzol Cp Ad-Free
25th January 2019, 10:17 PM |#8  
Stickman89's Avatar
Inactive Recognized Developer
Flag Milton Keynes
Thanks Meter: 2,441
 
Donate to Me
More
@Dzol Cp - Can you issue the following commands whilst you're in 'TWRP recovery' on your 16GB Xiaomi Mi3 that has a 2GB vendor partition....

Or anyone else for that matter...

Code:
adb shell
busybox fdisk -l /dev/block/mmcblk0
I would like to see your partition layout in blocks, the above command will output that information. Paste the partition table printed out in shell here, as I need this information to create a script that will benefit us all in the future.

Thanks.

stickman89

---------- Post added at 09:17 PM ---------- Previous post was at 08:57 PM ----------

Anyone with a 64GB cancro device, if you could post your partition table resulting from the above command before and after ammending vendor to 2GB; then I can also create a script for you too. Thanks.
The Following 2 Users Say Thank You to Stickman89 For This Useful Post: [ View ] Gift Stickman89 Ad-Free
27th January 2019, 11:56 AM |#9  
Dzol Cp's Avatar
OP Senior Member
Flag TB/BF Penang
Thanks Meter: 4,287
 
Donate to Me
More
Quote:
Originally Posted by Stickman89

@Dzol Cp - Can you issue the following commands whilst you're in 'TWRP recovery' on your 16GB Xiaomi Mi3 that has a 2GB vendor partition....

Or anyone else for that matter...

Code:
adb shell
busybox fdisk -l /dev/block/mmcblk0
I would like to see your partition layout in blocks, the above command will output that information. Paste the partition table printed out in shell here, as I need this information to create a script that will benefit us all in the future.

Thanks.

stickman89

---------- Post added at 09:17 PM ---------- Previous post was at 08:57 PM ----------

Anyone with a 64GB cancro device, if you could post your partition table resulting from the above command before and after ammending vendor to 2GB; then I can also create a script for you too. Thanks.

Alright bro, will post for you asap. Now my current system is 1.5GB and only 200MB of vendor partition, are you sure that you need all info for 2GB vendor partition,
? in that case, so i need to repartition for 2GB vendor, bc vendor image just around 170MB (lot of space wasted), just give me sometime.
27th January 2019, 03:07 PM |#10  
Stickman89's Avatar
Inactive Recognized Developer
Flag Milton Keynes
Thanks Meter: 2,441
 
Donate to Me
More
Quote:
Originally Posted by Dzol Cp

Alright bro, will post for you asap. Now my current system is 1.5GB and only 200MB of vendor partition, are you sure that you need all info for 2GB vendor partition,
? in that case, so i need to repartition for 2GB vendor, bc vendor image just around 170MB (lot of space wasted), just give me sometime.

That's fine. The 1.5GB partition table will do. Just use the commands I mentioned above... No point modifying your partitions further, especially if you're happy with your current table. Someone else can always provide their partition table for a 2GB allocation later.

If you've done it for both your 16GB and 64GB, then if you could provide the output for both that'd be useful.

Thanks.
15th March 2019, 07:50 AM |#11  
Junior Member
Thanks Meter: 0
 
More
Please can you upload vendor image only
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes