FORUMS

[TOOL][TREBLE] PARTY v0.5 - Vendor Partition Manager 2018.08.31

1,009 posts
Thanks Meter: 1,864
 
By Oki, Senior Member on 20th August 2018, 12:22 AM
Post Reply Email Thread
- P A R T Y -
Android Partition Treblerizer

A tool able to seamlessly create / remove the vendor partition from within TWRP


INTRODUCTION

This was my weekend project. The creation of a tool able to create and remove the vendor partition from TWRP, so a computer was not required. The idea came to me las weekend when I was travelling and I couldn't test some roms since I didn't had the right partition configuration and no computer on hand. So I created this TWRP flashable ZIP that can create and remove the Vendor partition from the system or userdata partitions without a computer and without wiping the files in the mother partition in the recommended configuration.

The tool will try to resize the mother partition without wiping it, both when creating and removing the vendor partition. Nonetheless it can be done only when the mother partition is ext4, only when the vendor partition is at the end of the mother partition, and when the mother partition is not encrypted. The recommended configuration is what you get when selecting the first choice in every option: splitting 512 MB from the end of the system partition. A reboot is required after patching the partition table since the kernel has to reload it before doing any other thing.

REQUIREMENTS

Due to the use of a key detection binary, it is compatible only with ARM and ARM64 devices running TWRP. So far I have tested it in the Axon 7 but It should work in any compatible device. I made it this way so other legacy devices could transition to Treble ROMs + GSI, and Android Pie. Please let me know about other devices using this tool!!!!!

INSTALLATION

WARNING, THIS SOFTWARE COULD WIPE ALL THE DATA IN YOUR DEVICE, INCLUDING THE INTERNAL STORAGE.
IT REQUIRES TWRP CUSTOM RECOVERY IN AN UNLOCKED DEVICE, OTHERWISE YOUR DEVICE COULD BE BRICKED.
!!! Whatever you do, it is at your own risk !!!


Either for creating or removing a vendor partition,, follow these steps:

1. Download the TWRP ZIP tool to your External SD card.
2. Boot to TWRP recovery, under Install, flash the ZIP file as any other ROM or MOD file to execute the tool.
3. Reboot to recovery again to ensure the changes are applied properly.
4. In some cases you will need to format the mother partition after adding or removing the vendor partition next to it.

CREATE A VENDOR PARTITION:

So far these are the available options:
  • Mother partition selection: system / userdata
  • Split position: Splitting from the end / start of the mother partition.
  • Vendor partition size: 512 / 800 MB

REMOVE THE VENDOR PARTITION:

Should a Vendor module already exists, Party offers to remove it, returning to a Non-Treble partition table. It will return the space to the mother partition, system or userdata. So, older non Treble ROMs could be flashed after the mandatory reboot.


DOWNLOAD

Party_v0.5_ARM_20180831.zip


SOURCES
C'mon, it is a script!!! the sources are inside the zip. Use them in your projects but don't forget to give credit to the source !!!

CREDITS
@someone755 for the keycheck binary
@Zackptg5 for the V4A install script that inspired my version.
The Following 75 Users Say Thank You to Oki For This Useful Post: [ View ] Gift Oki Ad-Free
20th August 2018, 01:56 AM |#2  
Oki's Avatar
OP Senior Member
Flag East Coast
Thanks Meter: 1,864
 
Donate to Me
More
Just in case you want to use this tool for preparing the partition table for flashing some common sets of ROMs:

The The first Treble ROMs made by NFound splits 800MB of Vendor partition from the beginning of the data partition. You can do it using a Computer and flashing the EDL package or you can use this tool from TWRP.

The Unofficial LOS 15.1 20180810 splits 512MB of vendor partition from the end of the system partition. The new Unofficial LOS 16.0 ROMs requires a vendor partition using this scheme. The benefit of this configuration is that the user data is not formatted or modified and system partition is resized without losing any data.

In case you want to return to a previous non-treble rom, you just need to run this tool from TWRP and seamlessly remove the vendor partition.
The Following 20 Users Say Thank You to Oki For This Useful Post: [ View ] Gift Oki Ad-Free
20th August 2018, 02:32 AM |#3  
christoophat's Avatar
Senior Member
Flag SoCal
Thanks Meter: 383
 
More
Thanks yet again oki, for all the great tools you bring us for our phones.
Question: If you were to choose, which vendor part version would you recommend people create to prepare for upcoming Treble releases, the 800 MB or the 512 version?
Also , since I & others already have the NFound method installed, is there a need/benefit to convert over to the other one?
The Following User Says Thank You to christoophat For This Useful Post: [ View ] Gift christoophat Ad-Free
20th August 2018, 02:55 AM |#4  
amphi66's Avatar
Senior Member
Flag PacNW
Thanks Meter: 323
 
More
Thanks, this is great!
Not mentioned in your Procedure: are there any prerequistes, such as having a specific ROM, TWRP, bootloader, or ??? already installed?

Can this be run from B35 Stock to then be 'Treble Ready'?
20th August 2018, 05:07 AM |#5  
Oki's Avatar
OP Senior Member
Flag East Coast
Thanks Meter: 1,864
 
Donate to Me
More
Quote:
Originally Posted by christoophat

Thanks yet again oki, for all the great tools you bring us for our phones.
Question: If you were to choose, which vendor part version would you recommend people create to prepare for upcoming Treble releases, the 800 MB or the 512 version?
Also , since I & others already have the NFound method installed, is there a need/benefit to convert over to the other one?

The best configuration is splitting 512MB (more than enough) from the end of the system partition. That leaves 5.5GB for system, when usually it doesn't even reach 2GB. a 3GB system partition is considered large nowadays. 5.5GB is still overkill. I have even thought in creating a Treble A/B partitioning for seamless update. But let's first stabilize Treble A before thinking in more advanced configurations.
Quote:
Originally Posted by amphi66

Thanks, this is great!
Not mentioned in your Procedure: are there any prerequistes, such as having a specific ROM, TWRP, bootloader, or ??? already installed?

Can this be run from B35 Stock to then be 'Treble Ready'?

The only prerequisite for this tool is having TWRP. It actually can be used in any legacy ARM device, not only the Axon 7, to create the vendor partition from system or data.

You can run it with any bootstack, even the old Nougat or MM bootstacks. The tool is bootstack agnostic. However, there is no point on having a vendor partition with a ROM requiring an old Nougat or MM bootstack, since they don't use it. Treble ROMs are all compiled using the Oreo B12 bootstack, and they won't boot with any other bootstack. This tool only prepares the partition table, the bootstack is another thing you must prepare before flashing any ROM.
The Following 9 Users Say Thank You to Oki For This Useful Post: [ View ] Gift Oki Ad-Free
20th August 2018, 06:11 AM |#6  
Senior Member
Thanks Meter: 114
 
More
Hi @Oki
Thanks for your handful tool!

It states that it has found vendor partition before data partition (I had it installed with NFounds method)...

My question: Will deleting this vendor partition using your tool leave data as is or will it wipe the whole internal storage also?
20th August 2018, 06:18 AM |#7  
Oki's Avatar
OP Senior Member
Flag East Coast
Thanks Meter: 1,864
 
Donate to Me
More
Quote:
Originally Posted by Gachmuret

Hi @Oki
Thanks for your handful tool!

It states that it has found vendor partition before data partition (I had it installed with NFounds method)...

My question: Will deleting this vendor partition using your tool leave data as is or will it wipe the whole internal storage also?

It will wipe data and internal storage since the split was done at the beginning of the userdata partition so it was easier to flash using the EDL method both in the 64 and 128GB Axon 7. Now with this tool there is no reason at all for splitting from the data partition. Those with the initial 800MB split will have to backup data and storage to recover those 800MB and transition to the 512MB vendor partition at the end of the system partition. I already did it so now I can go back and forth seamlessly without losing the internal storage.
The Following 2 Users Say Thank You to Oki For This Useful Post: [ View ] Gift Oki Ad-Free
20th August 2018, 06:23 AM |#8  
Member
Thanks Meter: 20
 
More
Hello Oki, I'm planning on following the steps below to install the treblerized August build of los 15.1 and was wondering if your tool would make the process any easier or would it even be necessary? I'm currently on the non treble 7/23 build of 15.1. Also thanks for all your contributions to the Axon 7 community!

Quote:
Originally Posted by blu3wh0

Coming from the July LOS builds, install of the 8/10 build was simple and no impact to my data:

1. Install TWRP 3.2.1-8-TREBLE (for decrypting data) or 3.2.3-0-axon7. Reboot.
2. Wipe system/cache/dalvik cache (and data if not using LOS).
3. Install 8/10 LOS build. This will partition Treble if it does not exist, otherwise I think it'll update it.
4. Install GApps.
5. (optional) Install Magisk 16.7 (SafetyNet fails, but I don't seem to have any issues otherwise).
6. Boot into ROM.

My most frustrating issue is the one I mentioned above, but I have yet to try anything other these LOS builds so far.

20th August 2018, 06:27 AM |#9  
Masterjuggler's Avatar
Senior Member
Flag New Jersey
Thanks Meter: 231
 
More
First, thanks Oki! This is a great addition to our tool set, and will make life much easier going back to stock.

I've been following the LOS threads and have been trying to keep up, so if these questions have been answered already please just point me in the right direction. There's a lot of information all over the place, and it's difficult to search for without already having a working understanding of it.

Now that we have a simple method of adding a vendor partition (acknowledging LOS having an already integrated treblerizer, but no return), are we now able to reliably flash standard GSIs? If not, what exactly is needed to make our phone compatible with standard GSIs?

The kernel still goes into the /boot, which would still be device-specific, so the way I understand it is that we still need the other device-specific stuff like DAC configs, which would then go into the /vendor? I take it this means the HALs (if that's what I'm talking about) are at a level above bootstack but below kernel?

If we were to go flashing GSIs now, would a lot of crap just be broken, or would it pretty much work save for the DAC? If broken, could we get it to just default to the SD820 integrated DAC? Are we (the xda community, developers, users, etc) able to make HALs that would accomplish getting audio to work properly in either case, or is this something that must be included in the ROM or kernel rather than /vendor?

If there is any interest, an FAQ on this might be a good idea, if one doesn't currently exist. We'd just need someone to maintain it. I'd be happy to do so, but obviously I'm currently terribly confused LOL, and definitely need to do a lot of required reading on this.
20th August 2018, 06:28 AM |#10  
Oki's Avatar
OP Senior Member
Flag East Coast
Thanks Meter: 1,864
 
Donate to Me
More
Quote:
Originally Posted by roisuke

Hello Oki, I'm planning on following the steps below to install the treblerized August build of los 15.1 and was wondering if your tool would make the process any easier or would it even be necessary? I'm currently on the non treble 7/23 build of 15.1. Also thanks for all your contributions to the Axon 7 community!

LOS15.1 20180810 already creates the vendor partition, so no need for my tool for creating it. It is already an easy process when coming from a non-treble LOS15.1. In case you prefer to go back to the previous non-treble rom, then you will need PARTY. PARTY is also required to transition from the old 800MB vendor to the new location at the end of the system partition.
Quote:
Originally Posted by Masterjuggler

Now that we have a simple method of adding a vendor partition (acknowledging LOS having an already integrated treblerizer, but no return), are we now able to reliably flash standard GSIs? If not, what exactly is needed to make our phone compatible with standard GSIs?

The kernel still goes into the /boot, which would still be device-specific, so the way I understand it is that we still need the other device-specific stuff like DAC configs, which would then go into the /vendor? I take it this means the HALs (if that's what I'm talking about) are at a level above bootstack but below kernel?

All the hardware specific drivers are in the Kernel, but the configuration files and libraries are in the vendor partition in a treble rom. GSI use the available libraries, but they must ask for those entry points. So if a Vendor partition doesn't provide the GSI with the standard entry points along with the configs, then the specific hardware won't work. In our case the DAC is critical since most of us purchased the Axon 7 instead of the OP3 just because of the amazing sound of this device. The Vendor partition is the key, but it all depends on the device tree and ported vendor blobs.
Quote:
Originally Posted by Masterjuggler

If we were to go flashing GSIs now, would a lot of crap just be broken, or would it pretty much work save for the DAC? If broken, could we get it to just default to the SD820 integrated DAC? Are we (the xda community, developers, users, etc) able to make HALs that would accomplish getting audio to work properly in either case, or is this something that must be included in the ROM or kernel rather than /vendor?

Probably the future will be a Treble ROM for the Axon supporting the standard Qualcomm devices and some kind of patches for the GSI so we could enjoy the excellent DAC. The best would be if ZTE release an Android Pie update for us the same way it is going to happen for the OP3.
Quote:
Originally Posted by Masterjuggler

If there is any interest, an FAQ on this might be a good idea, if one doesn't currently exist. We'd just need someone to maintain it. I'd be happy to do so, but obviously I'm currently terribly confused LOL, and definitely need to do a lot of required reading on this.

You are very welcome to create answers or gather the answers in a central FAQ.

I have created this tool so the Treblerization of legacy devices could be easier and the Axon 7 could benefit of it too. This device has an amazing hardware configuration, the only problem is the software. It all depends on ZTE and the user base.
The Following 6 Users Say Thank You to Oki For This Useful Post: [ View ] Gift Oki Ad-Free
20th August 2018, 07:37 AM |#11  
Masterjuggler's Avatar
Senior Member
Flag New Jersey
Thanks Meter: 231
 
More
So other than the DAC config, is there anything else broken or preventing us from flashing GSIs? Put another way, what else would we need to port/create for /vendor in order to properly run a GSI? I'm sure if we create a vendor partition and just flash a GSI, /vendor will still be empty and useless until we do something with it.

Also, for anyone who cares about semantics, I am saying "we" because I would at some point like to learn more and also contribute to these projects. I don't have much time for the foreseeable future due to college starting again, but we have to remember it's not like developers are a certain breed that do nothing but unpaid work for us. It's everyone's responsibility to keep development alive.
The Following 2 Users Say Thank You to Masterjuggler For This Useful Post: [ View ] Gift Masterjuggler Ad-Free
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