-
download kernel source: https://github.com/PixelExperience-Devices/kernel_xiaomi_sdm660/tree/thirteen
-
download cross compile toolchain: https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
- AArch32 GNU/Linux target with hard float (arm-none-linux-gnueabihf)
- arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz
- AArch64 GNU/Linux target (aarch64-none-linux-gnu)
- arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
- AArch32 GNU/Linux target with hard float (arm-none-linux-gnueabihf)
-
install necessary dev library:
sudo apt-get install libssl-dev
-
unzip the kernel source and the tool chain;
-
set the necessary environment variables:
export ARCH=arm64 export CROSS_COMPILE=/home/zhaojr/android/toolchain-gnu/arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu- export CROSS_COMPILE_ARM32=/home/zhaojr/android/toolchain-gnu/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-
-
run build command:
make O=out whyred_defconfig # disable "-Werror" flag which makes all warnings into errors sed -i 's/CONFIG_CC_WERROR=y/CONFIG_CC_WERROR=n/' out/.config # remove "-Werror" flag for "qcacld" driver sed -i '/-Werror/d' drivers/staging/qcacld-3.0/Kbuild make -j4 O=out
-
if you want to debug the wlan driver, set the debug flag:
# set debug flag for "drivers/staging/qcacld-3.0/" and "drivers/staging/qca-wifi-host-cmn/" make -j4 O=out BUILD_DEBUG_VERSION=1
The build takes about 15 minutes, and the generated kernel image is ./out/arch/arm64/boot/Image.gz-dtb
, use "Anykernel" to flash the kernel.
nice