Compilation - GalaticStryder/android_kernel_leeco_msm8996 GitHub Wiki

There are basically two ways of compiling an AOSP Kernel, either compiling it from an AOSP build environment which has all variables for cross-compilation already set, ramdisk and init library properly in place – given the device has AOSP support – as well as most of the dependencies like dtbTool available locally; either compiling it out-of-the-tree which is far less intrusive if you just want to modify the Kernel, this way also uses cross-compilation but instead of having them all in place as the AOSP repo utility does, this one needs the developer to properly set them himself.

1st way:

The first way is only available for open-source projects (AOSP, LineageOS...) and is widely common to be used when the developer already has the project locally, otherwise, he would just use the 2nd way which is easier and doesn't need too much work.

When Lambda Kernel is the default Kernel it's also distributed within the ROM itself, obviously. Updates to it can be taken via the 2nd way as well in those cases.

2nd way:

This is the way we do it for distributed Kernel-only releases due to its flexibility for compilation and distribution, smaller in size.

To circumvent the "(...) himself" part of it, we created the compile.sh script for ARM64 cross-compilation and mainly refined it to fit the Lambda Kernel needs in conjunction with the AnyKernel2 utility which will, in the end, create a zip file to be flashed in recovery seamlessly.