1. Configs is not compiling

Q: I have modified the kernel to add new drivers but the configs is not compiling (Android12)

❶ Execute the commands to reconfig the kernel.

cd kernel-5.10
make ARCH=arm64 menuconfig

❷ After reconfig, rename the file kernel-5.10\.config to rockchip_defconfig.

❸ Copy the file kernel-5.10\rockchip_defconfig to replace \RK3588_ANDROID12.0_SDK_RELEASE\kernel-5.10\arch\arm64\configs\rockchip_defconfig

It is recommended to back up the original rockchip_defconfig before replacing.

2. ERROR: Running build_kernel failed!

Q: I downloaded the source code,when I try to compile, I got this error:

@ubuntu:/home/idea3588/buildroot$  ./build.sh kernel

processing option: kernel

============Start building kernel============

TARGET_ARCH     =arm64
TARGET_KERNEL_CONFIG =rockchip_linux_defconfig
TARGET_KERNEL_DTS  =rk3588-evb2-lp4-v10-edp-linux
TARGET_KERNEL_CONFIG_FRAGMENT =

==========================================

#
# No change to .config
#
  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK    include/generated/compile.h
  LZ4C    arch/arm64/boot/Image.lz4
fatal: youe current branch 'master' does not have any commits yet
Incorrect parameters
Usage :
     lz4 [arg] [input] [output]
input   : a filename
     with no FILE, or when  FILE is - or stdin, read standard input
Arguments :
 -1   : Fast compression (default)
 -9    : High compression
 -d   : decompression (default for .lz4 extension)
 -z   : force compression
 -f   : overwrite output without prompting
 -h/-H  : display help/long help and exit

arch/arm64/boot/Makefile:31: recipe for target 'arch/arm64/boot/Image.lz4'  failed

make[2]: *** [arch/arm64/boot/Image.lz4] Error 1
make[2]: *** Deleting file 'arch/arm64/boot/Image.lz4'
arch/arm64/Makefile:170: recipe for target 'Image.lz4' failed
make[1]: *** [Image.lz4] Error 2
make[1]: *** Waiting for unfinished jobs....
arch/arm64/Makefile:214: recipe for target 'rk3588-evb2-lp4-v10-edp-linux.img'  failed
make: *** [rk3588-evb2-lp4-v10-edp-linux.img] Error 2
ERROR: Running build_kernel failed!
ERROR: exit code 2 from line 656:
   make ARCH=$RK_ARCH $RK_KERNEL_DTS.img -j$RK_JOBS

Cause: The version of lz4 delivered with the compilation system is too early.

Solution: update to V1.8.3 or later.

lz4 -v            //check the compiler lz4 version
sudo cp /out/host/linux-x86/bin/lz4 /usr/bin/lz4   //copy lz4 from the Android source directory to override the compiler's

or remove the built-in lz4, download and install a new lz4

sudo apt-get remove  liblz4-tool
sudo git clone https://github.com/lz4/lz4.git
cd /lz4
sudo make
sudo make install