Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

moxi-u7/PixelOS_gsi

Repository files navigation

To get started with building PixelOS GSI,

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

Step 1: Install Dependencies

To get started, first make sure your system has all the necessary dependencies installed:

Run this command to install the essential tools:

sudo pacman -S --needed base-devel gcc sdl2 wxgtk3 lz4 libxml2 git gnupg gperf libxslt imagemagick zip python perl xmlstarlet xz ncurses jdk11-openjdk ccache unzip repo
yay -S android-platform-tools jdk8-openjdk rr virtualenv

Next, install 7-zip from the AUR:

yay -S 7-zip

Step 2: Set up Your Working Directory

Now, create and navigate to a new directory for the build:

mkdir PixelOS
cd PixelOS

Step 3: Initialize the Repo

You’ll need to initialize the repository with the PixelOS AOSP manifest.

repo init -u https://github.com/PixelOS-AOSP/manifest.git -b fourteen --git-lfs

Step 4: Clone Additional Manifests for GSI Dependencies

Now clone the necessary dependencies for the GSI:

git clone https://github.com/moxi-u7/treble_manifest.git .repo/local_manifests -b 14

Step 5: Sync the Source Code

Sync the repository to fetch the necessary source files for PixelOS:

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

Step 6: Generate Keys for Signing

Generate private keys to sign your build. These keys must be generated without a password:

subject='/C=US/ST=State/L=City/O=Android/OU=Android/CN=Android/[email protected]'
for x in releasekey platform shared media networkstack verity otakey testkey sdk_sandbox bluetooth nfc; do \
    ./development/tools/make_key vendor/aosp/signing/keys/$x "$subject"; \
done

Explanation:

  • C: Country code (e.g., US)
  • ST: State
  • L: City
  • O: Organization
  • OU: Organizational Unit
  • CN: Common Name
  • emailAddress: Your email address

Step 7: Apply Patches

Copy the patches folder into the rom folder and apply the patches:

bash patches/apply-patches.sh .

Step 8: Generate the ROM Makefile

Clone the necessary repository, then copy the pixel.mk file to the device/phh/treble directory inside your ROM folder. Then, generate the makefile by running the following commands:

cd device/phh/treble
bash generate.sh pixel

Step 9: Enable Caching for Faster Builds

You can speed up future builds by enabling ccache. Add the following lines to your ~/.bashrc or ~/.zshrc file:

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

Step 10: Build the System Image

Now, set up the build environment and compile the systemimage:

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

Step 11: Compress the Build (Optional)

Once the compilation is complete, you can compress the system.img file using 7-zip for faster transfer or backup. In the out/target/product/tdgsi_arm64_ab directory, run:

cd out/target/product/tdgsi_arm64_ab
7zz a system.img.xz "system.img"

Step 12: Create the VNDK Lite Variant

Finally, if you want to create a VNDK Lite variant, copy the resulting system.img to the treble_adapter folder and run:

sudo bash lite-adapter.sh 64 system.img

Troubleshooting:

  • If you run into any issues while applying patches, apply them manually by reviewing the patches folder and resolving conflicts.

Credits:

The following contributors have helped make this project possible:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published