mytja / treble_evo

Manifest to build Evolution X GSI.
35 stars 5 forks source link

Building

You'll need to get familiar with Git and Repo, as well as How to build a GSI.

Create Directories

As a first step, you'll have to create and enter a folder with the appropriate name. To do that, run these commands:

mkdir ~/evo
cd ~/evo

Initalize the Treble Evolution X repo

repo init --depth=1 -u https://github.com/Evolution-X/manifest -b udc

Clone the Manifest

This adds necessary dependencies for the Evolution X GSI.

git clone https://github.com/mytja/treble_manifest.git -b evo-udc .repo/local_manifests

Sync the repository

repo sync -c --force-sync --no-clone-bundle --no-tags -j$(nproc --all)

Apply the patches

Run this command in the ROM folder:

./patches/apply-patches.sh .

This command will apply all TrebleDroid and personal patches. If any patch fails to apply correctly, as indicated by ### FAILED APPLYING output, you need to apply the patch manually. Steps to do so are described in short on treble_evo_patches repo.

[!WARNING] Superuser removal patch might not get applied using this script, despite being applyable. While this is being investigated, please apply it manually. cd ~/evo/build/make && git am ~/evo/patches/0002-personal/platform_build/000*-remove-su-from-builds.patch

Adapting for Evolution X

Run the following commands:

cd ~/evo/device/phh/treble
bash generate.sh ~/evo/device/mytja/evo/evo.mk

This will generate all appropriate treble configurations.

Turn On Caching

You can speed up subsequent builds by adding these lines to your ~/.bashrc OR ~/.zshrc file:

export USE_CCACHE=1
export CCACHE_COMPRESS=1
export CCACHE_MAXSIZE=50G # 50 GB

Build Treble app

This GSI uses a modified Treble app in order to achieve more functionality. You need to build the Treble app.

cd ~/evo/treble_app

./build.sh release

Compilation

In the ROM folder (~/evo), run this to start compilation:

source build/envsetup.sh

ccache -M 50G -F 0

lunch treble_arm64_bgN-userdebug 

make systemimage -j$(nproc --all)

Compression

After compiling the GSI, you can run this to reduce the system.img file size:

[!WARNING] You will need to decompress the output file to flash the system.img. In other words, you cannot flash this file directly.

cd out/target/product/tdgsi_arm64_ab
xz -9 -T0 -v -z system.img 

Troubleshooting

If you face any conflicts while applying patches, apply the patch manually. For any other issues, report them via the Issues tab.

Credits

This GSI was mostly inspired by Ahnet's Evolution X GSI repository.

These people have helped this project in some way or another, so they should be the ones who receive all the credit: