下面总结一下我构建yocto环境中遇到的一些问题及疑惑,分享一下
1.Ctrl+Z
构建过程中可按Ctrl+Z退出,再此构建时会继续运行
2.删了重新弄
ERROR: Task (/home/robot/poky/meta/recipes-devtools/cmake/cmake-native_3.16.1.bb:do_configure) failed with exit code '1'
robot@robot-virtual-machine:~/poky$ ls bitbake LICENSE.GPL-2.0-only meta-selftest README.qemu build LICENSE.MIT README.poky scripts robot@robot-virtual-machine:~/poky$ source oe-init-build-env bash: oe-init-build-env: 没有那个文件或目录
ERROR: oe_runmake failed | WARNING: exit code 1 from a shell command. | ERROR: Execution of '/home/robot/poky/build/tmp/work/core2-64-poky-linux/binutils/2.34-r0/temp/run.do_compile.2131387' failed with exit code 1 ERROR: Task (/home/robot/poky/meta/recipes-devtools/binutils/binutils_2.34.bb:do_compile) failed with exit code '1'
这一类都属于文件下载不完全以及网络不好
如果你觉得错误太多,可能是你下载的yocto版本不对,可以考虑删除poky目录重新下载
参考这篇博客
输入以下命令并按回车执行,确保你要删除的目录路径替换为实际的目录路径:
rm -rf /poky
请注意:
这两个选项结合使用能够确保删除目录及其所有内容,包括文件和子目录,而不会提示确认。
-r
选项表示递归地删除目录及其内容。-f
选项表示强制删除,即不会提示确认。- 系统会直接执行删除操作,无需进一步确认。
3.使用一个好网络
我就是一直构建不成功,各种错,最后借了个校园网,一次就成功了
4.重新编译被锁定
删除bitbake.lock文件
5.不能创建分支
fatal: 'tags/yocto-3.1.33' 不是一个提交,不能基于它创建分支 'my-yocto-3.1.33' robot@robot-virtual-machine:~/poky$
下载的yocto不完全,删除后按照此博客重新下载
6.部分错误内容重新构建
ERROR: openssl-1.1.1w-r0 do_package_write_rpm: Error executing a python function in exec_func_python() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_func_python() autogenerated', lineno: 2, function: <module> 0001: *** 0002:do_package_rpm(d) 0003: File: '/home/robot/poky/meta/classes/package_rpm.bbclass', lineno: 712, function: do_package_rpm 0708: 0709: # Build the rpm package! 0710: d.setVar('BUILDSPEC', cmd + "\n" + cleanupcmd + "\n") 0711: d.setVarFlag('BUILDSPEC', 'func', '1') *** 0712: bb.build.exec_func('BUILDSPEC', d) 0713: 0714: if d.getVar('RPM_SIGN_PACKAGES') == '1': 0715: bb.build.exec_func("sign_rpm", d) 0716:} File: '/home/robot/poky/bitbake/lib/bb/build.py', lineno: 254, function: exec_func 0250: with bb.utils.fileslocked(lockfiles): 0251: if ispython: 0252: exec_func_python(func, d, runfile, cwd=adir) 0253: else: *** 0254: exec_func_shell(func, d, runfile, cwd=adir) 0255: 0256: try: 0257: curcwd = os.getcwd() 0258: except: File: '/home/robot/poky/bitbake/lib/bb/build.py', lineno: 455, function: exec_func_shell 0451: with open(fifopath, 'r+b', buffering=0) as fifo: 0452: try: 0453: bb.debug(2, "Executing shell function %s" % func) 0454: with open(os.devnull, 'r+') as stdin, logfile: *** 0455: bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)]) 0456: finally: 0457: os.unlink(fifopath) 0458: 0459: bb.debug(2, "Shell function %s finished" % func) File: '/home/robot/poky/bitbake/lib/bb/process.py', lineno: 184, function: run 0180: 0181: if pipe.returncode != 0: 0182: if log: 0183: # Don't duplicate the output in the exception if logging it *** 0184: raise ExecutionError(cmd, pipe.returncode, None, None) 0185: raise ExecutionError(cmd, pipe.returncode, stdout, stderr) 0186: return stdout, stderr Exception: bb.process.ExecutionError: Execution of '/home/robot/poky/build/tmp/work/core2-64-poky-linux/openssl/1.1.1w-r0/temp/run.BUILDSPEC.25896' failed with exit code 137 ERROR: Logfile of failure stored in: /home/robot/poky/build/tmp/work/core2-64-poky-linux/openssl/1.1.1w-r0/temp/log.do_package_write_rpm.25896 ERROR: Task (/home/robot/poky/meta/recipes-connectivity/openssl/openssl_1.1.1w.bb:do_package_write_rpm) failed with exit code '1' 这是什么错
在BitBake构建系统中重新构建特定任务通常涉及使用特定的BitBake命令。重新构建 openssl-1.1.1w-r0
软件包的 do_package_write_rpm
任务。
根据错误日志,最后显示的错误信息是:
ERROR: Task (/home/robot/poky/meta/recipes-connectivity/openssl/openssl_1.1.1w.bb:do_package_write_rpm) failed with exit code '1'
要重新运行此任务,使用以下BitBake命令:
bitbake -c do_package_write_rpm openssl
这条命令告诉BitBake重新运行 openssl
软件包的 do_package_write_rpm
功能。BitBake将尝试重新执行此任务,如果之前的失败是由于临时问题或环境因素引起的,重新构建可能会成功。
在运行命令之前,请确保你已经在正确的构建环境中,并且有足够的系统资源(如内存和磁盘空间)来完成构建过程。
7.
ERROR: Task (/home/robot/poky/meta/recipes-devtools/qemu/qemu-native_4.2.0.bb:do_compile) failed with exit code '1'
解决:
将1.build文件夹里的bitbake.lock文件删除
2.将 qemu-native_4.2.0.bb这个文件单独编译
8.ERROR: Logfile of failure stored in: /home/robot/poky/build/tmp/work/core2-64-poky-linux/openssl/1.1.1t-r0/temp/log.do_package_write_rpm.703999 ERROR: Task (/home/robot/poky/meta/recipes-connectivity/openssl/openssl_1.1.1t.bb:do_package_write_rpm) failed with exit code '1' NOTE: Tasks Summary: Attempted 5182 tasks of which 5115 didn't need to be rerun and 1 failed. Summary: 1 task failed: /home/robot/poky/meta/recipes-connectivity/openssl/openssl_1.1.1t.bb:do_package_write_rpm
清理和重新构建:
有时候构建系统可能会出现状态不一致的问题。尝试清理缓存和重新构建可以解决这类问题:
bitbake -c cleansstate openssl
bitbake openssl