[TOOL][Linux/Mac] Capire Le Treble | Treble without Vendor Partition

Search This thread

erfanoabdi

Recognized Developer
Jan 3, 2015
1,010
3,156
Tehran
erfanoabdi.github.io
Capire le treble
Terble without Vendor Partition
attachment.php

As you guys all know google recently announced the project treble with releasing android Oreo, which is coming to pixel devices and some other developers ported it to their devices.
In my opinion first rule of porting treble is “move every possible thing to vendor”, so on and so forth.
So we can boot generic system images (GSI) on treble enabled devices IF DEVICE HAVE SEPERATE VENDOR PARTITION.
On some legacy devices, we don’t see vendor partition, so developers are trying to find an unused partition (for example some OEM partitions) and using it as vendor.

When I was trying to port treble on my device found out that it doesn’t have vendor partition also OEM partition was too small and can’t be used to put files on it.
I kept working on treble but my vendor files are in “/system/vendor” (system partition)
Obviously can’t flash GSIs because I’ll lose my vendor files which exist on system partition.

This project is helping developers or users to create device specific system images (DSSI) by “copy and pasting” vendor files into GSI and recreate system image for the device.

Now everyone can enjoy treble.

How to use CLT, and how it works?
Requairments
  1. GSI image
  2. Treblized rom system image
  3. Linux or Mac

Images must be mounted
And if rom is not fully treblized don’t worry, this script has ability to copy any blobs from system of treblized rom.
In CLT script there’s optional entry called “proprietary-files.txt”, here you can enter prop files from device tree to automatically copy every needed files to system
Also, you can add extra lines.
One Extra rule:
In CLT prop-files.txt all non-vendor lines will be forced replaced, except lines starting with “?”, which won’t replace files if GSI image has that file

Actually, CLT script is not simple copy paste, it’s mirroring files from images using “tar” to keep permissions and symlinks of files
Even for correctly enabling selinux in output image it’s reading file_contexts of both images.

Using CLT is very very very simple you don't need to be a developer, all you need to do is download CLT from github (git clone)
and run it
Code:
./CLT-ify.sh

To see CLT in action here is a youtube video for it

CLT : https://github.com/erfanoabdi/Capire-Le-Treble

example of CLT in Motorola Moto Z(griffin): https://forum.xda-developers.com/moto-z/how-to/guide-how-to-make-gsis-examples-du-aosp-t3774869

Special Thanks:
phhusson: for his great work on GSIs
badi: for name
superr: for his great kitchain
 

Attachments

  • CLT.jpg
    CLT.jpg
    102.3 KB · Views: 13,045
Last edited:

phhusson

Recognized Developer
Jul 23, 2009
2,448
4,694
Paris
Thanks for doing this, I know this has been asked several times.

Why do you take a proprietary-files.txt? Why not simply copying vendor folder? (perhaps also product/odm/oem)
Do you plan on targetting users as well? You're losing a bit of user's freedom, and making it require a lot of more maintainance for devs
("doing something targetting users is complicated" is a perfectly valid answer :p)
Did you consider the pro and cons compared to my no-vendor gpt-based solution?
 

erfanoabdi

Recognized Developer
Jan 3, 2015
1,010
3,156
Tehran
erfanoabdi.github.io
Thanks for doing this, I know this has been asked several times.

Why do you take a proprietary-files.txt? Why not simply copying vendor folder? (perhaps also product/odm/oem)
Do you plan on targetting users as well? You're losing a bit of user's freedom, and making it require a lot of more maintainance for devs
("doing something targetting users is complicated" is a perfectly valid answer :p)
Did you consider the pro and cons compared to my no-vendor gpt-based solution?

thanks for your hard work on GSIs :good:
it's "copy and pasting" full vendor, but using proprietary-files.txt is optional as i explained in OP :)
i've put proprietary-files.txt option for copy pasting blobs exist in /system for not fully treblized roms.

your no-vendor gpt-based solution is amazing, it's just another simple solution :p
 

phhusson

Recognized Developer
Jul 23, 2009
2,448
4,694
Paris
thanks for your hard work on GSIs :good:
it's "copy and pasting" full vendor, but using proprietary-files.txt is optional as i explained in OP :)
i've put proprietary-files.txt option for copy pasting blobs exist in /system for not fully treblized roms.

your no-vendor gpt-based solution is amazing, it's just another simple solution :p
Oh oops, sorry :)
FWIW, I'm still hoping to be able to do OTAs in my GSIs (that's quite a challenge though), but with CLT, I'm just going to brick devices :p
 

erfanoabdi

Recognized Developer
Jan 3, 2015
1,010
3,156
Tehran
erfanoabdi.github.io

xtreme97

Senior Member
Apr 16, 2013
83
54
It is amazing, I want to ask if it would work with nougat bloobs, if not i will have to wait to oreo or any oreo custom rom, thanks a lot and keep it upgraded, it is a great news for all treble lovers without a treble compatible device
 

erfanoabdi

Recognized Developer
Jan 3, 2015
1,010
3,156
Tehran
erfanoabdi.github.io
They are same.
GSI - Generic System Image
A system image which can be flashed in all treblized devices. And that is why it is Treblized rom system image.
Nope
If you guys read the title
It's for treble enabled devices without vendor partition
System image of treblized is the system image only for the device and have /vendor folder
Not vendor symlink
 
G

GuestK0010

Guest
This is amazing, I'm going to be trying to utilize this on Motorola Nexus 6, shamu. Thank u for your great work. Seriously.amazing.
 

Curi0

Senior Member
Jan 9, 2018
84
33
not in india
Do you know how to get Android P on Treble devices ? I flashed Pixel2XL system.img on Redmi Note 4 after installing treble support and it doesn't boot. If I look in /system in TWRP theres only a bin folder so something is wrong with the img format or something
 

b50corei5

Senior Member
Nov 25, 2017
487
291
Xiaomi Mi 8
Do you know how to get Android P on Treble devices ? I flashed Pixel2XL system.img on Redmi Note 4 after installing treble support and it doesn't boot. If I look in /system in TWRP theres only a bin folder so something is wrong with the img format or something
Oh god ?????
That's a device specific image. You need a gsi
 

WaseemAlkurdi

Senior Member
Apr 3, 2014
711
528
Amman
Nope
If you guys read the title
It's for treble enabled devices without vendor partition
System image of treblized is the system image only for the device and have /vendor folder
Not vendor symlink
@erfanoabdi
Is it for Treble devices without a dedicated /vendor partition OR devices without Treble support?
This story from the XDA Portal (https://www.xda-developers.com/motorola-moto-z-android-p/) says that the Moto Z in question does not support Treble, yet he used your script.
Can you please clarify?
Edit: And what if I repartition my device to make a /vendor partition? What's left to be done for Treble?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 65
    Capire le treble
    Terble without Vendor Partition
    attachment.php

    As you guys all know google recently announced the project treble with releasing android Oreo, which is coming to pixel devices and some other developers ported it to their devices.
    In my opinion first rule of porting treble is “move every possible thing to vendor”, so on and so forth.
    So we can boot generic system images (GSI) on treble enabled devices IF DEVICE HAVE SEPERATE VENDOR PARTITION.
    On some legacy devices, we don’t see vendor partition, so developers are trying to find an unused partition (for example some OEM partitions) and using it as vendor.

    When I was trying to port treble on my device found out that it doesn’t have vendor partition also OEM partition was too small and can’t be used to put files on it.
    I kept working on treble but my vendor files are in “/system/vendor” (system partition)
    Obviously can’t flash GSIs because I’ll lose my vendor files which exist on system partition.

    This project is helping developers or users to create device specific system images (DSSI) by “copy and pasting” vendor files into GSI and recreate system image for the device.

    Now everyone can enjoy treble.

    How to use CLT, and how it works?
    Requairments
    1. GSI image
    2. Treblized rom system image
    3. Linux or Mac

    Images must be mounted
    And if rom is not fully treblized don’t worry, this script has ability to copy any blobs from system of treblized rom.
    In CLT script there’s optional entry called “proprietary-files.txt”, here you can enter prop files from device tree to automatically copy every needed files to system
    Also, you can add extra lines.
    One Extra rule:
    In CLT prop-files.txt all non-vendor lines will be forced replaced, except lines starting with “?”, which won’t replace files if GSI image has that file

    Actually, CLT script is not simple copy paste, it’s mirroring files from images using “tar” to keep permissions and symlinks of files
    Even for correctly enabling selinux in output image it’s reading file_contexts of both images.

    Using CLT is very very very simple you don't need to be a developer, all you need to do is download CLT from github (git clone)
    and run it
    Code:
    ./CLT-ify.sh

    To see CLT in action here is a youtube video for it

    CLT : https://github.com/erfanoabdi/Capire-Le-Treble

    example of CLT in Motorola Moto Z(griffin): https://forum.xda-developers.com/moto-z/how-to/guide-how-to-make-gsis-examples-du-aosp-t3774869

    Special Thanks:
    phhusson: for his great work on GSIs
    badi: for name
    superr: for his great kitchain
    7
    Thanks for doing this, I know this has been asked several times.

    Why do you take a proprietary-files.txt? Why not simply copying vendor folder? (perhaps also product/odm/oem)
    Do you plan on targetting users as well? You're losing a bit of user's freedom, and making it require a lot of more maintainance for devs
    ("doing something targetting users is complicated" is a perfectly valid answer :p)
    Did you consider the pro and cons compared to my no-vendor gpt-based solution?
    5
    Thanks for doing this, I know this has been asked several times.

    Why do you take a proprietary-files.txt? Why not simply copying vendor folder? (perhaps also product/odm/oem)
    Do you plan on targetting users as well? You're losing a bit of user's freedom, and making it require a lot of more maintainance for devs
    ("doing something targetting users is complicated" is a perfectly valid answer :p)
    Did you consider the pro and cons compared to my no-vendor gpt-based solution?

    thanks for your hard work on GSIs :good:
    it's "copy and pasting" full vendor, but using proprietary-files.txt is optional as i explained in OP :)
    i've put proprietary-files.txt option for copy pasting blobs exist in /system for not fully treblized roms.

    your no-vendor gpt-based solution is amazing, it's just another simple solution :p
    5
    They are same.
    GSI - Generic System Image
    A system image which can be flashed in all treblized devices. And that is why it is Treblized rom system image.
    Nope
    If you guys read the title
    It's for treble enabled devices without vendor partition
    System image of treblized is the system image only for the device and have /vendor folder
    Not vendor symlink
    5
    FWIW, a dm-linear support has been merged in AOSP master
    https://android-review.googlesource.com/c/platform/system/core/+/676739
    It's probably a better long-term solution than CLT imo