Skip to content

tilla2/pf8u_sm8850

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OPPO/OnePlus/Realme SM8850/MT6993 Series Universal 6.12 Kernel Automated Build Script

STAR FORK COOLAPK DISCUSSION

Endpoint Badge

A more convenient and fast automated universal 6.12 kernel build script for OPPO/OnePlus/Realme series devices with Snapdragon 8 Elite Gen5 (SM8850)/Dimensity 9500 (MT6993).

The original intention of this project is to solve the following issues:

  • The official manufacturer has been slacking off, open-sourcing only half of the code, which prevents some kernel code from compiling properly via existing configuration XMLs, or even lacks compilation configuration XMLs entirely;
  • Due to the introduction of numerous new mechanisms in the 6.12 kernel, including Rust code, the conventional method of compiling kernels using make commands can no longer complete the build successfully. It forces reliance on the inefficient Bazel build system, while the official Bazel compiler is overly unstable and bloated, prone to various inexplicable errors with almost no effective solutions available online, making it extremely unfriendly for beginners;
  • Existing common compilation workflows for 6.12 kernels (using Bazel/pulling third-party toolchains) are extremely slow. Even with caching, subsequent builds often take 20-30 minutes, and Bazel is incompatible with ccache, failing to save compilation caches properly.

Main Content of This Project (and Plans)

  • Compiles using official AOSP LLVM/Clang 19 + Rust v1.82.0, excludes unnecessary vendor source code from the official sources, significantly optimizes the build process, and introduces a ccache caching mechanism. Compared to the original Bazel compiler, this reduces build time by nearly 2/3 (the original official compiler typically takes over 1 hour per build), improves build stability, and outputs logs that are easier to maintain and debug;
  • Fixes bugs/outdated patches in the official code and introduces numerous third-party updates/feature support;
  • Provides dual versions of scripts: GitHub Actions online build / local shell build.

Implemented:

  • Universal OKI kernel for OPPO/OnePlus/Realme Snapdragon SM8850 (based on OnePlus 15 source 6.12.23 / OnePlus Ace 6T source 6.12.38; other models with the same kernel version but not SM8850 can be tested independently, with some being fully compatible)
  • Universal OKI kernel for OPPO/OnePlus/Realme Dimensity MT6993 (based on OPPO Find X9 source 6.12.23; other models with the same kernel version but not MT6993 can be tested independently, with some being fully compatible)
  • Multiple KSU versions selectable: ReSukiSU/SukiSU Ultra/KernelSU Next/Original KernelSU
  • Introduced exclusively designed ccache-ECS caching and extensive build process optimizations, stabilizing build times at approximately 6 minutes (the first build will pull a public preset ccache; from the second build onwards, assuming no major configuration changes, single build time is ~6 mins; if unused for two weeks since last invocation, the cache is automatically cleared, triggering an automatic cache rebuild on next build)
  • Introduced O2 compilation optimization to improve kernel runtime performance
  • lz4 1.10.0 & zstd 1.5.7 algorithm update & optimization patches (from @ferstar, ported by @Xiaomichael, 6.12 version patch remade by @cctv18)
  • Ported lz4kd support to 6.12 kernel (optional patch)
  • Optional inclusion of BBR/Brutal and a series of TCP congestion control algorithms
  • ADIOS IO Scheduler port
  • Added network connection performance optimization configuration options (to provide support for ipset and programs requiring advanced network features like iptables)
  • Droidspaces containerization support (a complete Linux environment container implementation that is lighter than traditional Docker/LXC and easier to port)
  • Added support for Mountify module
  • Added Re:Kernel support, working with Freezer, NoActive, etc., to reduce power consumption
  • Added Kernel Baseband Wipe Protection (By @showdo), effectively preventing malicious wipe scripts/programs from damaging system partition data

To Be Implemented:

  • Built-in zram, eliminating the need to mount external zram.ko (With the new lz4 & zstd patches, is this really still necessary?)
  • Nethunter wireless card monitor mode support
  • kexec kernel hot-switching support
  • More optimizations and feature ports...
  • More optimizations and feature ports...

Acknowledgments

About

An automatic kernel builder for Oppo/Oneplus/Realme Snapdragon sm8850 series in a completely new way.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

  • Shell 100.0%