我已经下载了源码,当编译时出现了这样的错误:
@ubuntu:~/rk356x_linux5.10$ ./build.sh kernel
processing option: kernel
============Start building kernel============
TARGET_ARCH =arm64 TARGET_KERNEL_CONFIG =rockchip_linux_defconfig TARGET_KERNEL_DTS =rk3566-evb2-lp4x-v10-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
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 'rk3566-evb2-lp4x-v10-linux.img' failed make: *** [rk3566-evb2-lp4x-v10-linux.img] Error 2 ERROR: Running build_kernel failed! ERROR: exit code 2 from line 663: make ARCH=$RK_ARCH $RK_KERNEL_DTS.img -j$RK_JOBS
原因: 编译器lz4版本太低.
解决方案: 升级到V1.8.3以上版本.
lz4 -v //查看编译器 lz4 版本
sudo cp out/host/linux-x86/bin/lz4 /usr/bin/lz //从Android源码目录复制并覆盖编译器的lz4