[RECOVERY][REPARTITION][19.05.09]twrp recovery + gpt binary

dla5244

Retired Recognized Developer
Apr 20, 2011
236
1,299
0
Incheon
If you download or apply this solution before 2019.07.17.16:20(GMT+9)
you NEED to revert stock partition or new partition layout
and download recovery image and flash again


Here is treble-enabled twrp recovery and GPT binary required for repartition

This process is ready to support the android treble, and additional work(modify kernel, create and organize vendor stuff) is required to use the android treble rom

You no need to repartition to use android treble

Chaged partiton layout
SYSTEM 1920MB > 2200MB, 2400MB (for future)
CUST 320MB > 400MB
How to repartition(increase system partition size)
If you resize the partition table, device data will be corrupted.
You MUST backup data partition before repartition!!!
Also COPY to all backup image, media file(photo, music, etc) into other device(PC, USB STICK)


1.Reboot into fastboot mode
2.fastboot flash partition gpt_both0.bin
System 1920mb, cust 320mb
System 2200mb, cust 400mb
System 2400mb, cust 400mb

I recommend resizing the system partition capacity to 2400mb.

3.Reboot into twrp recovery
4.Wipe vendor, cache partition in wipe menu
5.Format data partiton(format data) in wipe menu
6.Copy backup image into device
7.Restore backup image(data)

GPT Binary
TWRP Recovery

For developer
I decided to use cust partition as vendor, because is other xiaomi device is doing the same way.
If we store vendor stuff to vendor(cust) partition, it saves system partitition size

To support treble, add this code in kernel source
arch/arm/boot/dts/qcom/msm8992.dtsi
Code:
firmware: firmware {
    android {
        compatible = "android,firmware";
        fstab {
            compatible = "android,fstab";
            system {
                compatible = "android,system";
                dev = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/system";
                type = "ext4";
                mnt_flags = "ro,barrier=1,discard";
                fsmgr_flags = "wait";
                status = "ok";
                        };
            vendor {
                compatible = "android,vendor";
                dev = "/dev/block/platform/soc.0/f9824900.sdhci/by-name/cust";
                type = "ext4";
                mnt_flags = "ro,barrier=1,discard";
                fsmgr_flags = "wait";
                status = "ok";
                        };
       };
    };
};
Next we need to organize vendor stuff
Since i don't have much time to make it, other developer participation is needed
 
Last edited:
  • Like
Reactions: Baskhara

dla5244

Retired Recognized Developer
Apr 20, 2011
236
1,299
0
Incheon
Will this work on 16Gb variant? And i still need to wait for a treble rom to fill the vendor partition?
Yes it works on both device(16GB, 32GB)
We have to wait for the developer to make blob(boot+vendor image) which is support android treble.

Sadly I don't have much time to make that :(
 

Ga_hap_la_chanh

Senior Member
May 15, 2016
75
19
0
Yes it works on both device(16GB, 32GB)
We have to wait for the developer to make blob(boot+vendor image) which is support android treble.

Sadly I don't have much time to make that :(
Thank you for your help, i think create a treble rom is very complicated, there is only a dev active that still building los 16. Maybe he read this topic and decide to make one...
 

dla5244

Retired Recognized Developer
Apr 20, 2011
236
1,299
0
Incheon
2019.05.09
Recovery image, GPT binary updated

If you download or apply a solution before 2019.05.09.17:40(GMT+9)
you NEED to revert stock partition or new partition layout
because we no need to create vendor partition
cust partition is mounted as vendor partition
 

Ga_hap_la_chanh

Senior Member
May 15, 2016
75
19
0
2019.05.09
Recovery image, GPT binary updated

If you download or apply a solution before 2019.05.09.17:40(GMT+9)
you NEED to revert stock partition or new partition layout
because we no need to create vendor partition
cust partition is mounted as vendor partition
Now i'm just waiting for a miracle =)))))
 

Tianjingbaozi2

Senior Member
Aug 13, 2016
50
24
0
guangzhou
great project

---------- Post added at 11:26 PM ---------- Previous post was at 11:21 PM ----------

i want to try it but i dont know some process with this.
maybe useless.
mokee author say he won't make project treble for 4c..
maybe lineage-os16 anthor noticed
 
Last edited:

dla5244

Retired Recognized Developer
Apr 20, 2011
236
1,299
0
Incheon
great project

---------- Post added at 11:26 PM ---------- Previous post was at 11:21 PM ----------

i want to try it but i dont know some process with this.
maybe useless.
mokee author say he won't make project treble for 4c..
I think I can't make vendor image now
In order to use GSI rom, we need use CUST partitions like a vendor partition
Someday we will be able to use most GSI roms:)

I will update OP to extend system partition size.
 
  • Like
Reactions: OFFSPRINGER3
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone