Canting is an android kernel based on Google kernel-common merged over CAF-kernel. Built to provide security and stability improvement. “Canting” it self is a pen-like instrument used in the process of batik making.
- Upstream with latest linux-stable releases
- Upstream with latest CAF-kernel releases
- Build with Google clang-r383902
- CPU Governors: schedutil, powersave, performance
- I/O Schedulers: noop, cfq
- Compat vDSO from Pixel kernel
- TCP Congestion Algorithm: bbr, westwood, reno, cubic
- WireGuard VPN support
- Boeffla wakelock blocker
- Simple Low Memory Killer
- Sound Control: Speaker, Microphone, Headphone (Per-channel control)
- KCAL & KLapse Interface
- Vibration Intensity Control
- backlight min option
- Removed safetynet flags (no need of magisk to bypass safteynet)
- F2FS & NTFS Support
- and many more
How to Build
This section describes how to set up your local work environment to build the Canting Kernel. You must use Ubuntu/Debian.
- Instal required packaged for Ubuntu based distro, according to the source.android.com and xda-developers.com. Install the following packaged:
sudo apt-get install git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng
- Clone the kernel trees
For an example, we are going to build canting-4.9.q for sdm845 into canting as directiories:
git clone https://github.com/khusika/canting_kernel_xiaomi_sdm845 -b canting-4.9-q canting
3. Clone required toolchain, at this point only Clang with prebuilt binutils(arm and arm64) in it to build canting-kernel.
git clone https://github.com/khusika/prebuilt_google_clang -b master clang-toolchain
- Make sure to clean the kernel trees
make clean && make mrproper
2. Export required crosscompile, previously we use prebuilt google-clang.
export KBUILD_COMPILER_STRING="$('/clang-toolchain/bin/clang' --version | head -n 1 | perl -pe 's/\((?:http|git).*?\)//gs' | sed -e 's/ */ /g')"
3. Make the device config and build the kernel, at this point we will build dipper kernel.
make O=out ARCH=arm64 canting-dipper_defconfig
make -j$(nproc --all) O=out
Repack Kernel Image
At this point, we are going to repack the kernel image into flashable kernel.zip. There is a powerfull flashable.zip made by Chris Renshaw called AnyKernel. All of supported kernel are able to use those flashable.zip, just follow this guides:
- Clone Canting-AnyKernel repository, for an example we use dipper branch
git clone https://github.com/khusika/AnyKernel3 -b dipper canting-kernel-dipper
2. Copy or move the kernel images into the AnyKernel directories
cp '/canting/out/arch/arm64/boot/Image.gz-dtb' '/canting-kernel-dipper'
3. Compress the kernel using zip
zip -r9 kernel.zip * -x README.md kernel.zip