> 文档中心 > RK3588编译问题集

RK3588编译问题集

本文档内容主要记录了在编译RK3588工程时所遇到的一些问题,相关的问题可能也会发生在其他的工程编译里面,该文档的解决方法仅供参考
1、编译kernel出现 arch/arm64/boot/Makefile:31: recipe for target ‘arch/arm64/boot/Image.lz4’ failed 报错

 原因:lz4不存在或者版本过低。 解决办法1:系编译环境缺少lz4组件导致,执行如下命令安装   sudo apt-get update   apt-get install liblz4-tool  若update执行失败,可参考如下链接,替换镜像源  http://3ms.huawei.com/km/blogs/details/11561033

但大概率即使把源更新了,编译依然会报错,原因是因为官方的软件源为了稳定不会提供版本很新的代码,所以你通过apt-get install去下载安装的代码不是现在最新的版本。但有些编译又指定要很新的版本,这就产生了矛盾。所以可以通过去github上拉取最新版本的代码安装。如下,安装包见附件。
解决办法2:下载最新lz4源码,安装
$ git clone https://github.com/lz4/lz4.git
$ make
$ sudo make install
<>
本项目,法1不能解决该问题,推荐法2。

2、
开发板上电运行,并自动选择从SD卡进入新系统。
终端登录账号:rock
密码:rock

3、编译debian时报错ERROR: Running build_debian failed!

4、报错./mk-base-debian.sh: line 29: cd: ubuntu-build-service/-desktop-: No such file or directory

原因:没有这个文件夹
解决方法:
sudo apt-get install binfmt-support qemu-user-static live-build
sudo dpkg -i ubuntu-build-service/packages/*
sudo apt-get install -f

5、报错E: Failed getting release file http://mirrors.ustc.edu.cn/debian/dists/bullseye/Release

原因:这是因为需要去外网下载debain的相关包,由于公司网的原因无法下载,导致编译失败
解决方法1:改为国内的源
+++ b/ubuntu-build-service/bullseye-desktop-arm64/configure
@@ -11,6 +11,11 @@ set -e
echo “I: create configuration”
export LB_BOOTSTRAP_INCLUDE=“apt-transport-https gnupg”
lb config \

  • –mirror-bootstrap “https://mirrors.tuna.tsinghua.edu.cn/debian” \
  • –mirror-chroot “https://mirrors.tuna.tsinghua.edu.cn/debian” \
  • –mirror-chroot-security “https://mirrors.tuna.tsinghua.edu.cn/debian-security”
    \
  • –mirror-binary “https://mirrors.tuna.tsinghua.edu.cn/debian” \
  • –mirror-binary-security “https://mirrors.tuna.tsinghua.edu.c
    n/debian-security”
    –apt-indices false
    –apt-recommends false
    –apt-secure false
    解决方法2:直接用已下好的预编译包。见附件。
    <>

6、ERROR: Running build_recovery failed!

7、制作离线安装包并安装

8、sh: 1: genext2fs: not found

解决方法:安装ext2文件系统的生成器

9、/bin/sh: 1: flex: not found

解决办法:sudo apt install flex bison coreutils qemu qemu-user-static python3 qemu-user-binfmt

10、[EDGE ERROR] Build kernel failed, cmd: make CROSS_COMPILE=/usr1/edge/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- LLVM=1 LLVM_IAS=1 -j 16 A

解决方法:sudo apt-get install repo git ssh make gcc libssl-dev liblz4-tool expect g++ patchelf chrpath gawk texinfo chrpath diffstat binfmt-support qemu-user-static live-build bison flex fakeroot cmake gcc-multilib g+±multilib unzip device-tree-compiler ncurses-dev

11、scripts/basic/fixdep.c:92:10: fatal error: ‘sys/types.h’ file not found

解决方法:安装libc6-dev apt-get install libc6-dev

12、E: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).

解决办法:apt --fix-broken install

13、You may also need to install pkg-config to find the ncurses installed in a non-default location.

解决方法:apt install pkg-config

14、dpkg: error: 1 expected program not found in PATH or not executable

解决方法:
sudo apt-get download libc-bin
dpkg -x libc-bin*.deb unpackdir/
sudo cp unpackdir/sbin/ldconfig /sbin/
sudo apt-get install --reinstall libc-bin
sudo apt-get -f install

15、Unable to find the ncurses package. Install ncurses (ncurses-devel or libncurses-dev depending on your distribution).

解决办法:apt install libncurses-dev

16、fatal error: cannot execute ‘cc1’: execvp: No such file or directory

原因:工具链中缺失cc1文件
解决方法:将完备的交叉工具链所需要的库和依赖拷贝到编译机中。

17、 fatal error: string.h: No such file or directory

原因:同问题16
解决方法:同问题16

18、/bin/sh: 1: flex: not found

原因:相关文件未安装
解决方法:sudo apt-get install flex bison

19、:0:12: fatal error: curses.h: No such file or directory

解决方法:安装libncurses5-dev 库
命令:sudo apt-get install libncurses5-dev

20、When using ADD with more than one source file, the destination must be a directory and end with a /

原因:缺失/符号。
解决方法:添加/符号

21、configure: error: *** gperf not found

解决方法:
安装:
sudo apt-get install gperf

22、/bin/bash: pkg-config: command not found

解决方法:
安装:
sudo apt-get install pkg-config

23、error: systemctl preset failed on samba-ad-dc.service: No such file or directory

解决方法:systemctl mask samba-ad-dc.service

24、/usr/lib/sudo/sudoers.so must be only be writable by owner
解决方法:
pkexec chmod go-w /usr/lib/sudo/sudoers.so

25、configure: error: cannot guess build type; you must specify one

解决方法:添加一个平台选项
./configure --build=arm-linux

麦克风网