Skip to content

用于构建RisingOS的GSI补丁

Notifications You must be signed in to change notification settings

KoysX/treble_RisingOS_gsi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 

Repository files navigation

treble_RisingOS_gsi

To get started with building RisingOS GSI,

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

Install dependencies

sudo apt-get install bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev xattr openjdk-11-jdk jq android-sdk-libsparse-utils python3

Set git identity

git config --global user.email "[email protected]"
git config --global user.name "xxxx"

Create repo

mkdir ~/bin
PATH=~/bin:$PATH
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo
chmod a+x ~/bin/repo

If you want to use it often, you can add export PATH=~/.bin:$PATH to the PATH environment variable in the shell startup file (for example, the Bash startup file is ~/.bashrc)

Create the 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 rising
cd rising

To initialize your local repository, run this command:

repo init -u https://github.com/RisingTechOSS/android -b thirteen

Want to save some space ? Then use this:

repo init --depth=1 --no-repo-verify -u https://github.com/RisingTechOSS/android -b thirteen -g default,-mips,-darwin,-notdefault

Clone this repo:

git clone https://github.com/KoysX/treble_RisingOS_gsi.git -b 13

Preparing local manifest:

mkdir -p .repo/local_manifests
cp treble_RisingOS_gsi/manifest.xml .repo/local_manifests/ring.xml

Afterwards, sync the source by running this command:

repo sync -c --no-clone-bundle --optimized-fetch --prune --force-sync -j$(nproc --all)

After syncing, apply the patches:

Copy the patches folder to rom folder and in rom folder

bash patches/apply-patches.sh .

Generating Rom Makefile

In rom folder,

cd device/phh/treble
bash generate.sh lineage

Turn on caching to speed up build

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

Compilation

In rom folder,

. build/envsetup.sh
ccache -M 50G -F 0
lunch treble_arm64_bvN-userdebug 
make systemimage -j$(nproc --all)

Compress

After compilation, If you want to compress the build. In rom folder,

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

Troubleshoot

If you face any conflicts while applying patches, apply the patch manually.

Notes

  • If bluetooth calls or bluetooth media do not work well for you, make sure you have the "Use System Wide BT HAL" checkbox enabled on the Misc page of Treble App. If not, enable and reboot.
  • If you have a non-Samsung device with a Qualcomm chipset and VoLTE isn't working with the default IMS package provided by Treble App, try installing this alternative IMS package.

Credits

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