Skip to content
cyberknight777 edited this page Apr 22, 2024 · 12 revisions

Welcome to the NetErnels Sunny wiki!

I will be covering three things -

    - Standalone Building
    - Standalone Building (Kmanifest)
    - Inline Building

Standalone Building


This section describes how to build only the kernel.

Pre-requisites

  1. Proper and fast internet connection
  2. A PC/Cloud Computer running Linux OS (Ubuntu/ArchLinux/*) ( IDC/IDK anything about WSL2 )
  3. A better processor ( better the processor, lower the compile times )
  4. Around 15 GB free space
  5. Brains and patience. Always remember, Google is your best friend. You should have some experience with Linux environment and you are aware of how to run a command and can differentiate commands.

Preparing the Build Environment

If you have not built a kernel on your system before, there are some packages needed before you can successfully build. You can get these installed with:

Ubuntu/Linux Mint

curl https://raw.githubusercontent.com/akhilnarang/scripts/master/setup/android_build_env.sh | bash

ArchLinux

curl https://raw.githubusercontent.com/akhilnarang/scripts/master/setup/arch-manjaro.sh | bash

Fedora

curl https://raw.githubusercontent.com/akhilnarang/scripts/master/setup/fedora.sh | bash

You have successfully finished setting up your build environment.

Obtaining sources

This subsections aims at downloading and building the kernel from source. Not applicable if you are trying to develop/work on the source since you have no authority to push changes. You will have no commit history hereby and it is not advisable to work on a source with no commit history.

Run the following command to clone the source locally.

git clone --depth 1 https://github.com/NetErnels/android_kernel_xiaomi_sunny.git sunny -b staging

Building

The building part is the easiest part here, since you are going to use my script to accomplish the task smoothly.

  1. Change directory to sunny folder. This is what you call root folder.

  2. Run sed -i 's/TGI=1/TGI=0/' kramel.sh.

  3. Run the script. CI=0 OTA=0 RELEASE=0 bash kernel.sh img mod mkzip will start building the kernel. Sit back and enjoy because this will download toolchains, flasher and few scripts. Everything in this point depends on your internet speed.

  4. If the build is successful, obtain the kernel zip from anykernel3-sunny folder inside root directory. At this point, I guess you know how the kernel zip looks like.

  5. Flash the zip and enjoy your newly built kernel.


Standalone Building (Kmanifest)


This section describes how to build the kernel with kernel_manifest.

  1. Run mkdir kernel and cd kernel.
  2. Run repo init --depth=1 -u https://github.com/aosp-sunny/android_kernel_manifest.git -b master.
  3. Run repo sync -j8 -c --force-sync --no-clone-bundle --no-tags.
  4. Run ./build/build.sh 2>&1 | tee log.txt.
  5. Get your kernel prebuilts from out/dist/.

Inline Building


This section describes how to inline the kernel with the ROM you're building.

  1. Make sure this commit for enabling inline kernel compilation with newer versions of GCC exists in vendor/<rom> of the source as we will be a using GCC 12 unlike deprecated GCC 4.9 synced from AOSP git, else cherry-pick it.
  2. In your device tree, navigate to BoardConfig makefile and set the following flags
- TARGET_KERNEL_CLANG_COMPILE := false
- TARGET_KERNEL_NEW_GCC_COMPILE := true
  1. Now Clone EvaGCC from Statix Org
  • Trace through dependencies by adding the following to rom.dependencies
  {
    "remote": "github",
    "repository": "StatiXOS/android_prebuilts_gcc_linux-x86_aarch64_aarch64-elf",
    "target_path": "prebuilts/gcc/linux-x86/aarch64/aarch64-elf",
    "branch": "12.0.0"
  },
  {
    "remote": "github",
    "repository": "StatiXOS/android_prebuilts_gcc_linux-x86_arm_arm-eabi",
    "target_path": "prebuilts/gcc/linux-x86/arm/arm-eabi",
    "branch": "12.0.0"
  }
  • Else, just add the following to vendorsetup.sh
# Eva GCC
git clone --depth=1 https://github.com/StatiXOS/android_prebuilts_gcc_linux-x86_aarch64_aarch64-elf -b 12.0.0 prebuilts/gcc/linux-x86/aarch64/aarch64-elf
git clone --depth=1 https://github.com/StatiXOS/android_prebuilts_gcc_linux-x86_arm_arm-eabi -b 12.0.0 prebuilts/gcc/linux-x86/arm/arm-eabi
  1. Use neternels_defconfig as the defconfig instead of sunny_defconfig
  2. Use kernel from here, not the staging branch in NetErnels org as the fork in YAAP is made for inline builds.
  3. Use an updated distro with newer GLIBC.
  4. If you get spams regarding libtinfo6, do install libtinfo6 in your distro to solve it.
  5. Incase you run into the following error during the build:-
[  2% 1811/62106] Building Kernel Image (Image.gz-dtb)
/bin/bash -c "(PATH=/home/workspace/citric/out/host/linux-x86/bin:\$PATH PATH=/home/workspace/citric/prebuilts/gcc/linux-x86/aarch64/aarch64-elf/bin/aarch64-elf-/bin:\$PATH PATH=/home/workspace/citric/prebuilts/tools-citric/linux-x86/bin:\$PATH LD_LIBRARY_PATH=/home/workspace/citric/prebuilts/tools-citric/linux-x86/lib:\$LD_LIBRARY_PATH PERL5LIB=/home/workspace/citric/prebuilts/tools-citric/common/perl-base BISON_PKGDATADIR=/home/workspace/citric/prebuilts/build-tools/common/bison /home/workspace/citric/prebuilts/build-tools/linux-x86/bin/make  -j8 CFLAGS_MODULE=\"-fno-pic\" CPATH=\"/usr/include:/usr/include/x86_64-linux-gnu\" HOSTCFLAGS=\"-fuse-ld=lld\" HOSTLDFLAGS=\"-L/usr/lib/x86_64-linux-gnu -L/usr/lib64 -fuse-ld=lld\" HOSTCC=/home/workspace/citric/prebuilts/clang/host/linux-x86/clang-r383902b/bin/clang HOSTCXX=/home/workspace/citric/prebuilts/clang/host/linux-x86/clang-r383902b/bin/clang++ LEX=/home/workspace/citric/prebuilts/build-tools/linux-x86/bin/flex YACC=/home/workspace/citric/prebuilts/build-tools/linux-x86/bin/bison M4=/home/workspace/citric/prebuilts/build-tools/linux-x86/bin/m4 -C kernel/xiaomi/sm6150 O=/home/workspace/citric/out/target/product/mojito/obj/KERNEL_OBJ ARCH=arm64 CROSS_COMPILE=\"/usr/bin/ccache /home/workspace/citric/prebuilts/gcc/linux-x86/aarch64/aarch64-elf/bin/aarch64-elf-\" CROSS_COMPILE_ARM32=\"/home/workspace/citric/prebuilts/gcc/linux-x86/arm/arm-eabi/bin/arm-eabi-\"    Image.gz-dtb ) && (if grep -q '^CONFIG_OF=y' /home/workspace/citric/out/target/product/mojito/obj/KERNEL_OBJ/.config; then                   echo \"Building DTBs\";                         PATH=/home/workspace/citric/out/host/linux-x86/bin:\$PATH PATH=/home/workspace/citric/prebuilts/gcc/linux-x86/aarch64/aarch64-elf/bin/aarch64-elf-/bin:\$PATH PATH=/home/workspace/citric/prebuilts/tools-citric/linux-x86/bin:\$PATH LD_LIBRARY_PATH=/home/workspace/citric/prebuilts/tools-citric/linux-x86/lib:\$LD_LIBRARY_PATH PERL5LIB=/home/workspace/citric/prebuilts/tools-citric/common/perl-base BISON_PKGDATADIR=/home/workspace/citric/prebuilts/build-tools/common/bison /home/workspace/citric/prebuilts/build-tools/linux-x86/bin/make  -j8 CFLAGS_MODULE=\"-fno-pic\" CPATH=\"/usr/include:/usr/include/x86_64-linux-gnu\" HOSTCFLAGS=\"-fuse-ld=lld\" HOSTLDFLAGS=\"-L/usr/lib/x86_64-linux-gnu -L/usr/lib64 -fuse-ld=lld\" HOSTCC=/home/workspace/citric/prebuilts/clang/host/linux-x86/clang-r383902b/bin/clang HOSTCXX=/home/workspace/citric/prebuilts/clang/host/linux-x86/clang-r383902b/bin/clang++ LEX=/home/workspace/citric/prebuilts/build-tools/linux-x86/bin/flex YACC=/home/workspace/citric/prebuilts/build-tools/linux-x86/bin/bison M4=/home/workspace/citric/prebuilts/build-tools/linux-x86/bin/m4 -C kernel/asus/sdm660 O=/home/workspace/citric/out/target/product/X01BD/obj/KERNEL_OBJ ARCH=arm64 CROSS_COMPILE=\"/usr/bin/ccache /home/workspace/citric/prebuilts/gcc/linux-x86/aarch64/aarch64-elf/bin/aarch64-elf-\" CROSS_COMPILE_ARM32=\"/home/workspace/citric/prebuilts/gcc/linux-x86/arm/arm-eabi/bin/arm-eabi-\"    dtbs;             fi ) && (if grep -q '=m' /home/workspace/citric/out/target/product/mojito/obj/KERNEL_OBJ/.config; then                         echo \"Building Kernel Modules\";                       PATH=/home/workspace/citric/out/host/linux-x86/bin:\$PATH PATH=/home/workspace/citric/prebuilts/gcc/linux-x86/aarch64/aarch64-elf/bin/aarch64-elf-/bin:\$PATH PATH=/home/workspace/citric/prebuilts/tools-citric/linux-x86/bin:\$PATH LD_LIBRARY_PATH=/home/workspace/citric/prebuilts/tools-citric/linux-x86/lib:\$LD_LIBRARY_PATH PERL5LIB=/home/workspace/citric/prebuilts/tools-citric/common/perl-base BISON_PKGDATADIR=/home/workspace/citric/prebuilts/build-tools/common/bison /home/workspace/citric/prebuilts/build-tools/linux-x86/bin/make  -j8 CFLAGS_MODULE=\"-fno-pic\" CPATH=\"/usr/include:/usr/include/x86_64-linux-gnu\" HOSTCFLAGS=\"-fuse-ld=lld\" HOSTLDFLAGS=\"-L/usr/lib/x86_64-linux-gnu -L/usr/lib64 -fuse-ld=lld\" HOSTCC=/home/workspace/citric/prebuilts/clang/host/linux-x86/clang-r383902b/bin/clang HOSTCXX=/home/workspace/citric/prebuilts/clang/host/linux-x86/clang-r383902b/bin/clang++ LEX=/home/workspace/citric/prebuilts/build-tools/linux-x86/bin/flex YACC=/home/workspace/citric/prebuilts/build-tools/linux-x86/bin/bison M4=/home/workspace/citric/prebuilts/build-tools/linux-x86/bin/m4 -C kernel/asus/sdm660 O=/home/workspace/citric/out/target/product/mojito/obj/KERNEL_OBJ ARCH=arm64 CROSS_COMPILE=\"/usr/bin/ccache /home/workspace/citric/prebuilts/gcc/linux-x86/aarch64/aarch64-elf/bin/aarch64-elf-\" CROSS_COMPILE_ARM32=\"/home/workspace/citric/prebuilts/gcc/linux-x86/arm/arm-eabi/bin/arm-eabi-\"    modules || exit \"\$?\";                  echo \"Installing Kernel Modules\";                     PATH=/home/workspace/citric/out/host/linux-x86/bin:\$PATH PATH=/home/workspace/citric/prebuilts/gcc/linux-x86/aarch64/aarch64-elf/bin/aarch64-elf-/bin:\$PATH PATH=/home/workspace/citric/prebuilts/tools-citric/linux-x86/bin:\$PATH LD_LIBRARY_PATH=/home/workspace/citric/prebuilts/tools-citric/linux-x86/lib:\$LD_LIBRARY_PATH PERL5LIB=/home/workspace/citric/prebuilts/tools-citric/common/perl-base BISON_PKGDATADIR=/home/workspace/citric/prebuilts/build-tools/common/bison /home/workspace/citric/prebuilts/build-tools/linux-x86/bin/make  -j8 CFLAGS_MODULE=\"-fno-pic\" CPATH=\"/usr/include:/usr/include/x86_64-linux-gnu\" HOSTCFLAGS=\"-fuse-ld=lld\" HOSTLDFLAGS=\"-L/usr/lib/x86_64-linux-gnu -L/usr/lib64 -fuse-ld=lld\" HOSTCC=/home/workspace/citric/prebuilts/clang/host/linux-x86/clang-r383902b/bin/clang HOSTCXX=/home/workspace/citric/prebuilts/clang/host/linux-x86/clang-r383902b/bin/clang++ LEX=/home/workspace/citric/prebuilts/build-tools/linux-x86/bin/flex YACC=/home/workspace/citric/prebuilts/build-tools/linux-x86/bin/bison M4=/home/workspace/citric/prebuilts/build-tools/linux-x86/bin/m4 -C kernel/asus/sdm660 O=/home/workspace/citric/out/target/product/mojito/obj/KERNEL_OBJ ARCH=arm64 CROSS_COMPILE=\"/usr/bin/ccache /home/workspace/citric/prebuilts/gcc/linux-x86/aarch64/aarch64-elf/bin/aarch64-elf-\" CROSS_COMPILE_ARM32=\"/home/workspace/citric/prebuilts/gcc/linux-x86/arm/arm-eabi/bin/arm-eabi-\"    INSTALL_MOD_PATH=/home/workspace/citric/out/target/product/X01BD/obj/PACKAGING/kernel_modules_intermediates INSTALL_MOD_STRIP=1 modules_install;                        kernel_release=\$(cat /home/workspace/citric/out/target/product/mojito/obj/KERNEL_OBJ/include/config/kernel.release)                   kernel_modules_dir=/home/workspace/citric/out/target/product/mojito/obj/PACKAGING/kernel_modules_intermediates/lib/modules/\$kernel_release                       ;   modules=\$(find \$kernel_modules_dir -type f -name '*.ko');                      (    mkdir -p /home/workspace/citric/out/target/product/mojito/vendor/lib/modules ) && (cp \$modules /home/workspace/citric/out/target/product/mojito/vendor/lib/modules/ ) && (rm -rf /home/workspace/citric/out/target/product/mojito/obj/PACKAGING/depmod_vendor_intermediates ) && (mkdir -p /home/workspace/citric/out/target/product/mojito/obj/PACKAGING/depmod_vendor_intermediates/lib/modules/0.0/vendor/lib/modules ) && (cp \$modules /home/workspace/citric/out/target/product/mojito/obj/PACKAGING/depmod_vendor_intermediates/lib/modules/0.0/vendor/lib/modules ) && (/home/workspace/citric/out/host/linux-x86/bin/depmod -b /home/workspace/citric/out/target/product/mojito/obj/PACKAGING/depmod_vendor_intermediates 0.0 ) && (sed -e 's/\\(.*modules.*\\):/\\/\\1:/g' -e 's/ \\([^ ]*modules[^ ]*\\)/ \\/\\1/g' /home/workspace/citric/out/target/product/mojito/obj/PACKAGING/depmod_vendor_intermediates/lib/modules/0.0/modules.dep > /home/workspace/citric/out/target/product/X01BD/vendor/lib/modules/modules.dep ) && (cp /home/workspace/citric/out/target/product/mojito/obj/PACKAGING/depmod_vendor_intermediates/lib/modules/0.0/modules.softdep /home/workspace/citric/out/target/product/mojito/vendor/lib/modules ) && (cp /home/workspace/citric/out/target/product/mojito/obj/PACKAGING/depmod_vendor_intermediates/lib/modules/0.0/modules.alias /home/workspace/citric/out/target/product/mojito/vendor/lib/modules ) && (rm -f /home/workspace/citric/out/target/product/mojito/vendor/lib/modules/modules.load ) && (for MODULE in ; do basename \$MODULE >> /home/workspace/citric/out/target/product/mojito/vendor/lib/modules/modules.load; done);                                      fi )"
make: Entering directory '/home/workspace/citric/kernel/xiaomi/mojito'
make[1]: Entering directory '/home/workspace/citric/out/target/product/mojito/obj/KERNEL_OBJ'
  SLNTOLD include/config/auto.conf
  GEN     ./Makefile
  CHK     include/config/kernel.release
  GEN     ./Makefile
  CHK     include/generated/uapi/linux/version.h
  Using /home/workspace/citric/kernel/xiaomi/mojito as source for kernel
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    /home/workspace/citric/kernel/xiaomi/mojito/scripts/checksyscalls.sh
  LD      arch/arm64/kernel/vdso/vdso.so.dbg
/home/workspace/citric/prebuilts/gcc/linux-x86/aarch64/aarch64-elf/bin/../lib/gcc/aarch64-elf/12.0.0/../../../../aarch64-elf/bin/ld: unrecognised emulation mode: aarch64linux
Supported emulations: aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb
collect2: error: ld returned 1 exit status
make[2]: *** [/home/workspace/citric/kernel/xiaomi/mojito/arch/arm64/kernel/vdso/Makefile:47: arch/arm64/kernel/vdso/vdso.so.dbg] Error 1
make[1]: *** [arch/arm64/Makefile:200: vdso_prepare] Error 2
make[1]: Leaving directory '/home/workspace/citric/out/target/product/mojito/obj/KERNEL_OBJ'
make: *** [Makefile:152: sub-make] Error 2
make: Leaving directory '/home/workspace/citric/kernel/xiaomi/mojito'
13:05:45 ninja failed with: exit status
  • Then your vendor/<rom/> is missing this commit which intentionally points out the 32-bit GCC Path for vdso32 compilation. Cherry-pick it and the build should run without any hassle now.
  1. Incase you run into this error during the build:-
[  2% 1811/62106] Building Kernel Image (Image.gz-dtb)
Outputs: /home/vishusingapuriya_gmail_com/ssos/out/target/product/mojito/obj/DTBO_OBJ/arch/arm64/boot/dtbo.img
Error: exited with code: 1
Command: /bin/bash -c "(PATH=/home/vishusingapuriya_gmail_com/ssos/out/host/linux-x86/bin:\$PATH PATH=/home/vishusingapuriya_gmail_com/ssos/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-/bin:\$PATH PATH=/home/vishusingapuriya_gmail_com/ssos/prebuilts/tools-sssos/linux-x86/bin:\$PATH LD_LIBRARY_PATH=/home/vishusingapuriya_gmail_com/ssos/prebuilts/tools-ssos/linux-x86/lib:\$LD_LIBRARY_PATH PERL5LIB=/home/vishusingapuriya_gmail_com/ssos/prebuilts/tools-ssos/common/perl-base BISON_PKGDATADIR=/home/vishusingapuriya_gmail_com/ssos/prebuilts/build-tools/common/bison /home/vishusingapuriya_gmail_com/ssos/prebuilts/build-tools/linux-x86/bin/make  -j8 CFLAGS_MODULE=\"-fno-pic\" CPATH=\"/usr/include:/usr/include/x86_64-linux-gnu\" HOSTCFLAGS=\"-fuse-ld=lld\" HOSTLDFLAGS=\"-L/usr/lib/x86_64-linux-gnu -L/usr/lib64 -fuse-ld=lld\" HOSTCC=/home/vishusingapuriya_gmail_com/ssos/prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang HOSTCXX=/home/vishusingapuriya_gmail_com/ssos/prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++ LEX=/home/vishusingapuriya_gmail_com/ssos/prebuilts/build-tools/linux-x86/bin/flex YACC=/home/vishusingapuriya_gmail_com/ssos/prebuilts/build-tools/linux-x86/bin/bison M4=/home/vishusingapuriya_gmail_com/ssos/prebuilts/build-tools/linux-x86/bin/m4 -C kernel/xiaomi/sm6150 O=/home/vishusingapuriya_gmail_com/ssos/out/target/product/mojito/obj/DTBO_OBJ ARCH=arm64 CROSS_COMPILE=\" /home/vishusingapuriya_gmail_com/ssos/prebuilts/gcc/linux-x86/aarch64/arm64-gcc/bin/aarch64-elf-\" CROSS_COMPILE_ARM32=\"/home/vishusingapuriya_gmail_com/ssos/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-\" CROSS_COMPILE_COMPAT=\"/home/vishusingapuriya_gmail_com/ssos/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-\"    mojito_defconfig ) && (PATH=/home/vishusingapuriya_gmail_com/ssos/out/host/linux-x86/bin:\$PATH PATH=/home/vishusingapuriya_gmail_com/ssos/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-/bin:\$PATH PATH=/home/vishusingapuriya_gmail_com/ssos/prebuilts/tools-sssos/linux-x86/bin:\$PATH LD_LIBRARY_PATH=/home/vishusingapuriya_gmail_com/ssos/prebuilts/tools-ssos/linux-x86/lib:\$LD_LIBRARY_PATH PERL5LIB=/home/vishusingapuriya_gmail_com/ssos/prebuilts/tools-ssos/common/perl-base BISON_PKGDATADIR=/home/vishusingapuriya_gmail_com/ssos/prebuilts/build-tools/common/bison /home/vishusingapuriya_gmail_com/ssos/prebuilts/build-tools/linux-x86/bin/make  -j8 CFLAGS_MODULE=\"-fno-pic\" CPATH=\"/usr/include:/usr/include/x86_64-linux-gnu\" HOSTCFLAGS=\"-fuse-ld=lld\" HOSTLDFLAGS=\"-L/usr/lib/x86_64-linux-gnu -L/usr/lib64 -fuse-ld=lld\" HOSTCC=/home/vishusingapuriya_gmail_com/ssos/prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang HOSTCXX=/home/vishusingapuriya_gmail_com/ssos/prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++ LEX=/home/vishusingapuriya_gmail_com/ssos/prebuilts/build-tools/linux-x86/bin/flex YACC=/home/vishusingapuriya_gmail_com/ssos/prebuilts/build-tools/linux-x86/bin/bison M4=/home/vishusingapuriya_gmail_com/ssos/prebuilts/build-tools/linux-x86/bin/m4 -C kernel/xiaomi/sm6150 O=/home/vishusingapuriya_gmail_com/ssos/out/target/product/mojito/obj/DTBO_OBJ ARCH=arm64 CROSS_COMPILE=\" /home/vishusingapuriya_gmail_com/ssos/prebuilts/gcc/linux-x86/aarch64/arm64-gcc/bin/aarch64-elf-\" CROSS_COMPILE_ARM32=\"/home/vishusingapuriya_gmail_com/ssos/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-\" CROSS_COMPILE_COMPAT=\"/home/vishusingapuriya_gmail_com/ssos/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androidkernel-\"    dtbs ) && (/home/vishusingapuriya_gmail_com/ssos/out/host/linux-x86/bin/mkdtboimg.py create /home/vishusingapuriya_gmail_com/ssos/out/target/product/mojito/obj/DTBO_OBJ/arch/arm64/boot/dtbo.img --page_size=4096 \$(find /home/vishusingapuriya_gmail_com/ssos/out/target/product/mojito/obj/DTBO_OBJ/arch/arm64/boot/dts -type f -name \"*.dtbo\" | sort) )"
Output:
make: Entering directory '/home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150'
make[1]: Entering directory '/home/vishusingapuriya_gmail_com/ssos/out/target/product/mojito/obj/DTBO_OBJ'
  GEN     ./Makefile
#
# configuration written to .config
#
make[1]: Leaving directory '/home/vishusingapuriya_gmail_com/ssos/out/target/product/mojito/obj/DTBO_OBJ'
make: Leaving directory '/home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150'
make: Entering directory '/home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150'
make[1]: Entering directory '/home/vishusingapuriya_gmail_com/ssos/out/target/product/mojito/obj/DTBO_OBJ'
  GEN     ./Makefile
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  GEN     ./Makefile
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  Using /home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150 as source for kernel
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CC      arch/arm64/kernel/asm-offsets.s
In file included from /home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150/arch/arm64/include/asm/atomic.h:41,
                 from /home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150/include/linux/atomic.h:5,
                 from /home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150/include/linux/rcupdate.h:38,
                 from /home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150/include/linux/rculist.h:11,
                 from /home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150/include/linux/pid.h:5,
                 from /home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150/include/linux/sched.h:14,
                 from /home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150/arch/arm64/kernel/asm-offsets.c:21:
/home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150/arch/arm64/include/asm/cmpxchg.h: In function '__xchg_case_1':
/home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150/arch/arm64/include/asm/cmpxchg.h:38:22: error: expected string literal before 'ARM64_LSE_ATOMIC_INSN'
   38 |         asm volatile(ARM64_LSE_ATOMIC_INSN(                             \
      |                      ^~~~~~~~~~~~~~~~~~~~~
/home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150/arch/arm64/include/asm/cmpxchg.h:50:1: note: in expansion of macro '__XCHG_CASE'
   50 | __XCHG_CASE(w, b,     1,        ,  ,  ,  ,         )
      | ^~~~~~~~~~~
/home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150/arch/arm64/include/asm/cmpxchg.h:36:28: warning: unused variable 'tmp' [-Wunused-variable]
   36 |         unsigned long ret, tmp;                                         \
      |                            ^~~
/home/vishusingapuriya_gmail_com/ssos/kernel/xiaomi/sm6150/arch/arm64/include/asm/cmpxchg.h:50:1: note: in expansion of macro '__XCHG_CASE'
   50 | __XCHG_CASE(w, b,     1,        ,  ,  ,  ,         )
      | ^~~~~~~~~~~
  • Then run this in the kernel dir curl -s https://bin.cyberknight777.dev/2TOf/raw | patch -p1
  1. If you get the following spams in your build:-
"llvm-objdump" is not allowed to be used. See https://android.googlesource.com/platform/build/+/master/Changes.md#PATH_Tools for more information.
  • Then you need this commit in your build/soong and your build won't have any spams.

That's all, hope you have a fun time compiling my kernel for personal usage or inlining my kernel, I know the steps are sorta complex, but trust me it's worth it :).


Additional Notes


- If you face any errors or bugs, feel free to create a github issue in the repository tab with proper logs, or you can join [@neternels_chat](https://t.me/neternels_chat) and let me know abouut the error / bug you're facing.
- There wont be any OC, UC, UV variant or messed up display refresh rate variant.
- Android R, S, T, and U is supported. MIUI is not supported yet it may boot in MIUI. Usage of my kernel in MIUI is fully on your own responsibility.
- I don't do retarded power tweaks so don't expect "super fast" charging or "super slow" charging in my kernel as power drivers are left as per stock but with logging reduced.
- I use an efficient frequency setup hence the big cluster will only have 2 frequency steps.
- I put in alot of work for this kernel, the difference between using my kernel and other kernels are highly noticeable :).
- There are hardly any logspams in my kernel and the kernel is fully debloated from OEM crap plus unnecessary drivers are not built.
- Tune KProfiles for better performance / battery backup / balanced usage.

Credits


  • @ElectroPerf for his cool readme of his kernel.
  • @Panchajanya1999 for his cool wiki of his kernel.
  • Those I cherry-pick from.
  • My testers, as without them this kernel would not be what it is today :).