Description
Compiling the entire system SDK takes a long time. If we only modified some files in the kernel but have to compile the entire SDK to generate an image, the efficiency would be too low.
This document will introduce a method to compile the kernel separately to generate a boot.img image. Then, using the method described in the Android14 Distributed Image Flashing 🚀 chapter, you can flash the boot.img image separately to update the kernel.
⚠️ Special Note
The prerequisite for using this method is that the entire SDK must have been compiled once!!!
Principle Description
Compilation principle: In the kernel directory, the compiled kernel.img and resource.img will replace the ones in the old boot.img.
Compile Kernel
0⃣. Enter the kernel-6.1/ directory:
cd kernel-6.1/1⃣. Configure cross-compilation toolchain path:
export PATH=../prebuilts/clang/host/linux-x86/clang-r487747c/bin:$PATH2⃣. Define alias command:
alias msk='make CROSS_COMPILE=aarch64-linux-gnu- LLVM=1 LLVM_IAS=1'3⃣. Compile:
msk ARCH=arm64 rockchip_defconfig android-14.config rk3576.config && \
msk ARCH=arm64 BOOT_IMG=../rockdev/Image-tspi_3m/boot.img tspi-3m-rk3576.img -j$(nproc)2
4⃣. Compilation successful
We will find the newly generated boot.img image in the kernel-6.1/ directory.
Then, you can use the method described in the Distributed Image Flashing 🚀 chapter to flash the boot.img image separately to update the kernel.