Can you install any Treble ROM/GSI on any Treble-compliant device? - Android Q&A, Help & Troubleshooting

Project Treble has been quite a while since Android 8.0 and it makes Android more modular and flexible. Project Treble is a project that when you update or modify Android, the "/vendor" partition gets unmodified and that partition contains all OEM-specific applications, drivers and libraries. So it separates the Android kernel and anything Android from that partition. Because of this, can you flash any device with a GSI image? And solve the issue of users that they want MediaTek chipset drivers to be open sourced? And, I think the "/vendor" partition contains all the drivers so when they're developing a custom ROM or an update, they don't have to rework the partition and don't need the driver to be open sourced. Some people say that they installed GSIs successfully on Chinese phones that are running Android 8.1.

Related

Need for vendor blobs

I have a pretty simple question, do we need to get the vendor blobs for treble supported devices? Cause I know we have all vendor-specific drivers stored in the vendor partition so I'm wondering if building an Oreo ROM for a Treble supported device still requires having the vendor blobs.

[CLOSED][PARTITION][TREBLE] Project Treble for Samsung Galaxy S8 [dreamltexx][15.02.2019]

- T R E B L E Y -
Android Partition Treblerizer
A tool able to seamlessly create / remove the vendor partition from within TWRP​
INTRODUCTION
The creation of a tool able to create and remove the supplier partition from TWRP, so a computer was not required. So I created this flaming TWRP ZIP which can create and remove the vendor partition from the userdata system or partitions without a computer and without deleting the files in the mother partition in the recommended configuration.
Trebley, finally, also expands on our much loved Galaxy S8, bringing with it Project Treble on the much loved device.
The tool will try to resize the mother partition without deleting it, either during the creation and removal of the supplier partition. However, this can only be done when the mother partition is ext4, only when the supplier partition is at the end of the mother partition and when the mother partition is not encrypted. The recommended configuration is the one that is obtained by selecting the first option in each option: subdividing 512 MB from the end of the system partition. A reboot is required after applying the patch to the partition table because the kernel needs to reload it before doing anything else.
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 Samsung Galaxy S8 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 AND IF YOU FOLLOW MY STEPS BELOW, YOU WILL LOSE YOUR WARRANTY, KNOX WILL DISPLAY 0x1! I'M NOT RESPONSIBLE FOR ANY DAMAGED DEVICE!.
!!! 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 / 915 MB
REMOVE THE VENDOR PARTITION:
Should a Vendor module already exists, Trebley 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
Trebley_APT_v1.0_ARM_20190215-signed.zip
SOURCES
All rights reserved to the project: Party and its creator(@Oki).
CAUTION
Currently, we recommend the use of Trebley, exclusively to developers, as until now there has been no development of material related to the project treble, this project lays the foundations creating the partition vendor, for the support treble.
CREDITS
@someone755 for the keycheck binary
@Zackptg5 for the V4A install script that inspired my version.
@Oki for the base script.
XDA:DevDB Information
[PARTITION][TREBLE] Project Treble for Samsung Galaxy S8 [dreamltexx][15.02.2019], Tool/Utility for the Samsung Galaxy S8
Contributors
DarioRetr
Source Code: https://forum.xda-developers.com/axon-7/development/tool-party-v0-1-vendor-partition-t3831517
Version Information
Status: Alpha
Current Stable Version: V1.0
Stable Release Date: 2019-02-26
Current Beta Version: V0.5
Beta Release Date: 2019-02-15
Created 2019-02-17
Last Updated 2019-02-17
thx the tools makes me now easyer to create and remove my treble partition since i used for the moment all time parted with console on pc. for the one that thinks that is treble. without right vendor partition is useless. i have a partition that boots gsi but with a nice glitched display
geiti94 said:
thx the tools makes me now easyer to create and remove my treble partition since i used for the moment all time parted with console on pc. for the one that thinks that is treble. without right vendor partition is useless. i have a partition that boots gsi but with a nice glitched display
Click to expand...
Click to collapse
It is certainly not Trebley's fault, as it was specified in red, that Trebley is currently recommended for use only to developers, as Trebley, lays the foundations for Project Treble by creating the Vendor partition, after which it will be up to the developers Compile from source the vendor. IMG, the TWRP custom, and the kernel, to allow the startup of Project Treble.
In addition, in layman's terms, Trebley currently creates the vendor partition, after which it will be you dev compile the sources by adjusting them to the treble standards, to allow you to use project treble on the Samsung S8.
Members are reminded that making changes to device partitions is inherently dangerous. With that in mind, exercise caution and if in doubt, DON'T.
LenAsh said:
Members are reminded that making changes to device partitions is inherently dangerous. With that in mind, exercise caution and if in doubt, DON'T.
Click to expand...
Click to collapse
Dear @LenAsh, Trebley, precisely ensures through the scripts, a greater security, as it is all automated and calculated to the milimeter, and above all reduces the risk. Clearly, currently Trebley for S8, it is in its initial state, where it introduces the vendor partition, now it's up to you have developer, compile and propagate the material needed to start project treble in our Samsung S8 device
Any hope on this zip working on s8 phones? Or porting for others?
Rehvix said:
Any hope on this zip working on s8 phones? Or porting for others?
Click to expand...
Click to collapse
This zip is made for the Samsung Galaxy S8, but also works on other devices, because the script is multi platform and arm, currently, but we recommend the use of the zip file to developers, because currently Trebley creates only the vendor partition, but Without the vendor file, and a modified TWRP for treble support, you still can't use the project treble. We need to wait for some dev, compile from source, the appropriate kernel for project treble, and a vendor appropriate to the project treble along with a custom TWRP, allowing the Samsung S8 to use the vendor partition created by Trebley, and finally use Project Treble.
so can we get aosp room sir..??
onMyConquest said:
so can we get aosp room sir..??
Click to expand...
Click to collapse
In order to run a GSI, you have to wait for the scene, wait for some Dev, compile the kernel and the vendor, and place a custom twrp, to allow the project treble to go. In practice Trebley, prepares the partition making it compatible with Project Treble. Now you have to have developer share software, clearly depends on scene to scene, to give you an example on the Samsung Galaxy S6 Edge, with the same method, now they can use the GSI, with project treble.
Plz someon try this. Im afraid to brick
https://www.xda-developers.com/flash-generic-system-image-project-treble-device/
Can somebody take this down or at least force the guy to rename it ? this is clearly a script that'll only make an empty partition, this is NOT treble as stated in the thread also by reading the messages it's clear the OP doesn't know what he's talking about
If I understand, in the case of Galaxy S8, it splits the /system partition to create a /vendor partition and copy the contents from /system/vendor to the new /vendor partition, right?
However, dont the binaries and/or drivers need to be adapted for project Treble? I mean how does the (lets say) new aosp rom know what drivers use for each feature?
Josevega said:
Can somebody take this down or at least force the guy to rename it ? this is clearly a script that'll only make an empty partition, this is NOT treble as stated in the thread also by reading the messages it's clear the OP doesn't know what he's talking about
Click to expand...
Click to collapse
My dear, create the partition to make it compatible with the Project Treble, now instead of talking about things, why do not you go to work, adapting the kernel and the vendor, and send the vendor.img, and the boot.img and twrp .img, to be able to use project treble?
Also before saying, that Trebley, does not know what he is talking about, he learns to read English, why it is written clearly is round, that this script is recommended to use you have developer to ensure project treble also on S8.
If then you want to talk bad, because evidently put project treble on S8, it requires too much work as you have to move the device tree blob and so on, and for question of laziness you want to deny the possibility of having treble to users.
So we know that the developers of the scene samsung S8, does not paste them to adapt the kernel to project treble.
bamsbamx said:
If I understand, in the case of Galaxy S8, it splits the /system partition to create a /vendor partition and copy the contents from /system/vendor to the new /vendor partition, right?
However, dont the binaries and/or drivers need to be adapted for project Treble? I mean how does the (lets say) new aosp rom know what drivers use for each feature?
Click to expand...
Click to collapse
Then, Trebley, takes part of partition either from system or userdata, and then creates a new partition named vendor, and makes the device compatible with project treble, then it needs a developer, move device tree blobs, and systems the configuration , because it is not enough to move the vendor into vendor, you have to compile the kernel so that you take the drivers from the vendor, you have to do some work first at the software level.
You need someone who has Ubuntu, take the device sources from GitHub, and run the device tree, and compile the vendor.img and boot.img which includes the kernel, and then edit the twrp to make it compatible with Treble, after that you can use treble on the device.
Trebley, did not want to compile the vendor for the Samsung S8 users, for one reason, because Trebley's developers are external to the Samsung S8 scene, and compile a kernel or vendor for an S8, as you might compile for an S7 Edge or an S6, it could cause users of the S8, slowdowns, battery that you download easily, GSI where the camera does not work.
So we prefer to be your developer of the scene, to compile the vendor and boot, to ensure reliability even with the project treble. Because we do not want s8 users to consider project treble as an unstable project.
In addition, this project has also expanded on Note 8, we will see who will be faster to adapt kernels and vendors.
Update 18/02/2019
A developer of the S7 Edge scene, he decided to contribute to the project, starting to work on the sources of the device.
https://github.com/KiubeDev
Hello ,Can you make this for s7 edge?
DarioRetr said:
In addition, this project has also expanded on Note 8, we will see who will be faster to adapt kernels and vendors.
Update 18/02/2019
A developer of the S7 Edge scene, he decided to contribute to the project, starting to work on the sources of the device.
https://github.com/KiubeDev
Click to expand...
Click to collapse
In this github account all the repositories are forked from ivan meler, he is galaxy s7/edge developer i can see a universal exynos 8895 repo but there is no device specific code for dream2ltexx and only a highly experienced developer can make this then there will be no need for treble support.
Why are u not using the preload partition???? Would be much easier as its only used for apps to be installed in stock Rom for a carrier or Region...
Can I install this, and then https://forum.xda-developers.com/pr...vice-development/lineage-phh-treble-t3767690?
Will that brick?
qasim799 said:
In this github account all the repositories are forked from ivan meler, he is galaxy s7/edge developer i can see a universal exynos 8895 repo but there is no device specific code for dream2ltexx and only a highly experienced developer can make this then there will be no need for treble support.
Click to expand...
Click to collapse
Dear, that repository is another, he is just a dev, the repository where they are working and gitlab, and is only accessible to developers.

Approaches and prerequisites of a cutom factory image

I'm from a startup, that is working on a Smartphone with a preinstalled Android without Google Apps and Services to protect the user's privacy by default. The focus of our development is an improved system user experience with a technology background in NLP, ML and AI. Android offers a straight forward approach with a custom launcher.
The potential ODMs for our device offer a Stock Android Pie with all Google Apps and Services. So we a re looking for the most cost efficient approach of customizing the factory image. In principle, I see two possibilities:
1. Modifying the factory image of the ODM
Maybe the most efficient way would be to remove Google Apps and Serivces and install a custom launcher and some replacement apps with a script. I'm not sure if this doesn't lead to errors or if this possibility also exists for a recovery image.
2. Providing a custom factory image
I found some tutorials, one at XDA developers and another at Android Authority. Finally there is guide of the AOSP.
One challenge are the technical requirements, as far as I have understood, the device drivers. The AOSP documentation says:
Download previews, factory images, drivers, over-the-air (OTA) updates, and other blobs below. For details, see Obtaining proprietary binaries.
Preview binaries (blobs) for AOSP master branch development
Factory images for supported devices running tagged AOSP release branches
Binary hardware support files for devices running tagged AOSP release branches
Click to expand...
Click to collapse
The Android Authority article says something similar:
Obtain proprietary binaries – The binary drivers should be unpacked in your working directory.
Click to expand...
Click to collapse
What do we exactly need from the ODM respectively PCBA board designer beyond the factory image? The hardware support files as proprietary binaries? It's unlikely, that we get the source code for the drivers. Can we take the drivers from the factory image? How can we identify them?
We think to take LineageOS, but we learned from the related Reddit forum, that a port of LineageOS for a new device would take some man years. Would you suggest to use the AOSP? How many man month should we calculate for a custom build?
Further more we need to think about how to provide OTA updates. Unfortunately, I don't know what is necessary to set up an OTA Update Service and prepare a Custom ROM for it. Is it essentially a fileserver with an encrypted connection and signed files?
Which approach would you suggest? Thanks for each suggestion and links for further information.

Porting AOSP to custom-built device

Hi everyone,
as title suggests, I'd like to "port" clean AOSP to be able to install and run it on the custom device.
Basically, the situation is following: I got a custom device, based on rockchip rk3288 SoC. The device currently runs Android 5.1 successfully. I'd like to update Android to version 6 (got AOSP sources and AWS builder image up and running), but the company that created Android v5 for us no longer exists.
Thus I am here to ask for advice(s) on how to proceed (or whether it even is a good idea to do that myself, given the fact that I have zero experience with Android ROMs development), possibly a step-by-step guide on what to do.
The question is, do I just find drivers for hardware components present in the device (usb hub, ethernet, etc.) and just somehow "link" those to existing sources (of AOSP) and just run the build with different parameters? Or do I need to build a whole new kernel for the given device-OS combination?
Thank you for any advice or opinion!
Well this is an interesting one. There are several routes you can take here.
If you have the kernel source code, and the source code for the drivers, you could probably build the kernel from source and use it to boot Android, however, as that's unlikely, you're looking at a more regular porting process, which usually consists of pulling the vendor blobs from the existing Android system, building AOSP/Lineage with those blobs involved, and hacking together a new ramdisk that HOPEFULLY will be compatible. It's a very long and very tedious process, but it's certainly possible.
From that you'll then get in to the debugging stage of finding out what works out of the box, you'll very well need to make changes to AOSP for it to work on that SoC.
abtekk said:
Well this is an interesting one. There are several routes you can take here.
If you have the kernel source code, and the source code for the drivers, you could probably build the kernel from source and use it to boot Android, however, as that's unlikely, you're looking at a more regular porting process, which usually consists of pulling the vendor blobs from the existing Android system, building AOSP/Lineage with those blobs involved, and hacking together a new ramdisk that HOPEFULLY will be compatible. It's a very long and very tedious process, but it's certainly possible.
From that you'll then get in to the debugging stage of finding out what works out of the box, you'll very well need to make changes to AOSP for it to work on that SoC.
Click to expand...
Click to collapse
Thanks for pointing in the right (or at least some) direction! I found some guide on porting ROMs which I followed, basically like you said. So I just replaced some files in System image. Will flash later today, so maybe I will get some results!
abtekk said:
From that you'll then get in to the debugging stage of finding out what works out of the box, you'll very well need to make changes to AOSP for it to work on that SoC.
Click to expand...
Click to collapse
So I was following this tutorial, although found some irregularities, let's say: For example, none of those 2 folders contained init.d/ directory, thus I didn't update it. Also, I haven't found META-INF folder therefore haven't updated updater-script.
Basically, when I did (or at least what I think I was doing was that I took /system partition from our current ROM, that is working on that custom device and replaced stuff in there by stuff from the new system I wanted to port. My idea from what I've read was that i took kernel (and boot/recovery) from the original, working ROM and "injected" the new system onto it. Is that correct? Is that what I needed to do? Because the problem is, I cannot boot into the system (might as well be because of Kernel version, because I am trying to port Android 6 on Kernel 3.10. which was used in the current ROM running Android 5). It looks like the device is stuck in bootloader, or "somehow doesn't know what to start" (sorry, I can't put it better), displaying only my device's logo.
When I connect it to the computer via USB cable, running adb devices shows me that device, but when I try to access shell using adb shell I got error saying that /system/bin/sh wasn't found, which made me thinking that somehow the /system partition isn't "linked" properly, like I stated in the beginning.
Was I doing everything correctly? Do I need to do something above that? (maybe do you know about some tutorial). I am trying to port AOSP 6 Android.
Thank you!

Difference between GSI and "normal" ROMs?

Hi guys, could any of you explain to me what is the difference between GSI based and "normal" build ROMs?
I thought most custom ROMs are based on AOSP/GSI, but right now many Android 10 ROMs for one of my devices (Lenovo P2/kuntao) are popping up and most of them are getting a lot of hate for apparently being based on GSI and are not "proper" ROMs. People are not giving any specific criticism, just generally whining, like those ROMs are useless or something.
The only difference I see is for some reason the GSI ROMs need F2FS format instead of EXT4 that is standard for other ROMs for the device.
Thanks.
To my knowledge, GSIs when properly implemented for a device are as good as a Device Specific ROM or what you call a "normal" ROM.
Usually GSIs are made for a wide-audience of devices. So the usual reason is that when a bug only available in a specific device is found. It usually isn't fixed by GSI devs.
However, Device Specific GSIs are actually made for the device it's running on. So small bugs will be fixed.
Usually though problems come from a bad vendor implementation. So if your device has a bad vendor implementation. I guess that would be a cost for concern. You can create your own but you'd have to wait for developers to create it.
They may be mad about limited Magisk Support. Since Magisk currently does not support GSI ROMs. But other than that, I don't see why GSIs get so much hate.
In a Treble world, don't all ROMs technically include a GSI? Because anything living in /system and distributed by a system.img file can actually be run as a GSI on any device that is Treble compatible.
However, right now it's probably like you say, vendors (and enthusiast ROM makers) may not completely adhere to the rules set by Android/AOSP, such as putting the correct things in the system, product, vendor and odm partitions. They include nasty hacks to solve some idiosyncratic bugs for their specific device. Nothing wrong with some nasty hacks, but they should put them in the right place (in product or odm partitions). As such, in theory there should be no need for separate system images any more.
In such a world, I suspect that indeed in the near future we will only load the GSI of our choice for all devices. We will rely only on whole ROM packages when drivers (vendor partition and optionally odm) need to be updated. This is needed for example for increasing the necessary HAL version for future Android releases, possibly shipped with an updated product partition, if the device requires some specific apps or functionality. So instead of full ROMs we can then just have "device support packages" for phones that aren't already fully fit for GSIs, or need updates for future GSI architectures.
In that case we can even have OTA updates for only the GSI, published by the specific OS maker (e.g. AOSP, LineageOS, /e/, GrapheneOS, CalyxOS and many more). Specific ROM developers then need only make sure that their device support package is up to snuff. When releasing a new OS update or version, the same OTA update can then be immmediately pushed to any device that runs it. Wouldn't that be great?

Categories

Resources