PetaLinux环境下,也可以使用Yocto/openembedded的bitbake。Xilinx ug1144有详细说明。 为了方便,我编写了以下脚本,导入bitbake需要的环境。 将下列脚本保存为sh文件,使用source导入,之后就能使用bitbake。脚本的第一个输入参数是PetaLinux版本号,比如2019.2。 这时可以执行各种bitbake命令,比如执行"bitbake strace"。 为了以后编译PetaLinux编译方便,或者为了创建离线编译环境,可以通过bitbake命令提前下载编译所需要的所有软件包。 Yocto 2.5使用命令“bitbake --runall=fetch”, 之前的版本使用命令“bitbake -c fetchall”。
/bin/bitbake", line 31, in <module> import bb File "/home/mike/Work/nxp-imx8/imx-yocto-bsp/sources /poky/bitbake/lib/bb/__init__.py", line 79, in <module> from bb import fetch2 as fetch File "/home /mike/Work/nxp-imx8/imx-yocto-bsp/sources/poky/bitbake/lib/bb/fetch2/__init__.py", line 1843, in <module > from . import clearcase File "/home/mike/Work/nxp-imx8/imx-yocto-bsp/sources/poky/bitbake/lib , self.featureset) File "/home/mike/Work/nxp-imx8/imx-yocto-bsp/sources/poky/bitbake/lib/bb/cooker.py
检查build/build.log,得到更详细的错误信息: You can now run 'bitbake <target>' Common targets are: core-image-minimal Other commonly useful commands are: - 'devtool' and 'recipetool' handle common recipe tasks - 'bitbake-layers oe-pkgdata-util' handles common target package tasks [INFO] Generating workspace directory NOTE: Starting bitbake Please convert this layer/metadata before attempting to use with a newer bitbake. Please convert this layer/metadata before attempting to use with a newer bitbake.
bitbake.lock bitbake.sock cache conf downloads hashserve.sock sstate-cache tmp运行编译完成后如下所示:runqemu Bitbake:是OpenEmbedded构建系统的核心工具,负责解析元数据(Metadata)。 bitbake是metedate元数据解释器和执行器,读取metedate并执行定义的task,执行失败通常来自metedate元数据,而不是来自bitbake本身。 执行bitbake命令(包含bitbake-*)时,其实执行的就是bitbake/bin/下面的文件。 meta-pokypoky发行版本的配置数据,包含了bitbake工具、编译工具链、BSP、诸多程序包或层,是yocto的核心目录,上面描述的bitbake目录其实就是软链接到poky目录下的bitbake
选择工具devtool 缺省情况下,PetaLinux使用bitbake。 NOTE: Reconnecting to bitbake server... NOTE: Previous bitbake instance shutting down? NOTE: Reconnecting to bitbake server... NOTE: Previous bitbake instance shutting down? NOTE: Reconnecting to bitbake server... NOTE: Previous bitbake instance shutting down? NOTE: Reconnecting to bitbake server... NOTE: Previous bitbake instance shutting down?
. ### You can now run 'bitbake <target>' Common targets are: core-image-minimal core-image-sato Other commonly useful commands are: - 'devtool' and 'recipetool' handle common recipe tasks - 'bitbake-layers ERROR: Unable to start bitbake server (None) ERROR: Server log for this session (/proj/hankf/zcu106/v202 /zcu106-v202-bsp-proj/build/bitbake-cookerdaemon.log): --- Starting bitbake server pid 43963 at 2020- ): --- Starting bitbake server pid 43963 at 2020-12-01 07:17:48.614021 --- ERROR: ParseError at /proj
说明 本文接在【Yocto】BitBake入门之镜像中的HelloWorld之后完成。 修改源代码 如果想要修改Poky项目中的源代码,可以依赖于devtool工具,这里以修改busybox为例。 首先创建workspace: jw@X1C:~/code/poky/build$ devtool create-workspace NOTE: Starting bitbake server... jw 查看: jw@X1C:~/code/poky/build$ bitbake-layers show-layers NOTE: Starting bitbake server... layer NOTE: Reconnecting to bitbake server... NOTE: Retrying server connection (#1)... 但是如果再次编译,又能够编译成功了: jw@X1C:~/code/poky/build$ bitbake core-image-minimal Loading cache: 100% |########
它包含Bitbake、 OpenEmbedded-Core, 板级支持包,各种软件包的配置文件。 继续执行编译命令: book@100ask:~/100ask_stm32mp157_pro-sdk/Yocto_Dunfell/build-openstlinuxeglfs-100ask$ bitbake book@100ask:~/100ask_stm32mp157_pro-sdk/Yocto_Dunfell/build-openstlinuxeglfs-100ask$ bitbake virtual/ -c cleansstate book@100ask:~/100ask_stm32mp157_pro-sdk/Yocto_Dunfell/build-openstlinuxeglfs-100ask$ bitbake book@100ask:~/100ask_stm32mp157_pro-sdk/Yocto_Dunfell/build-openstlinuxeglfs-100ask$ bitbake <pkg> -v
st-example-image-qt $ bitbake st-example-image-qt -c populate_sdk QT image and SDK with weston/wayland st-example-image-qtwayland $ bitbake st-example-image-qtwayland -c populate_sdk 本篇使用第2种方式,即: DISTRO bitbake st-example-image-qtwayland -c populate_sdk 1.2.1 参数的含义 上述指令中, DISTRO、MACHINE以及bitbake后的镜像,可选的参数及含义如下 1.3 bitbake构建系统 执行第二句 bitbake st-example-image-qtwayland 可能会报以下错误: 注:截图中使用的bitbake st-image-weston指令 m4projects-stm32mp1 -c compile 然后再次执行bitbake st-example-image-qtwayland进行构建。
ERROR: Unable to start bitbake server (None) ERROR: Server log for this session (/proj/hankf/vck190/vck190 -0316-peta/build/bitbake-cookerdaemon.log): 3577 03:25:27.646174 --- Starting bitbake server pid 3577 /bin/bitbake-server", line 53, in <module> bb.server.process.execServer(lockfd, readypipeinfd, lockname timeout, xmlrpcinterface) File "/proj/hankf/vck190/vck190-0316-peta/components/yocto/layers/core/bitbake NOTE: Starting bitbake server...
除此之外,Yocto Project使用基于OpenEmbedded(OE)项目的构建主机,该项目使用BitBake工具构建完整的Linux映像。 BitBake和OE组件组合在一起形成一个参考构建主机,历史上称为Poky。 Yocto和Buildroot有异曲同工之妙。两者同为构建嵌入式的编译系统。 BitBake: OpenEmbedded构建系统的核心工具,负责解析元数据,从中生成任务列表,然后执行这些任务。 各种材料准备好了,BitBake代表厨师(看如何做出一道菜的)。 3.Yocto 实战 为了适应不同的环境,这里在Docker 构建Yocto 。 core-image-minimal 余留问题 ubuntu 18.4 系统bitbake core-image-minimal执行之后,编译报错,并没有耗费时间去解决,直接使用docker 容器搭建
命令一起使用的常见开发流程: devtool upgrade devtool build devtool deploy-target devtool finish 4 使用示例 4.1 提取源码 查找软件包 bitbake -s | grep <softname> bitbake -s 命令可以查看全部软件包名。 每次修改后执行bitbake命令都会从新编译u-boot。
[INFO] Generating workspace directory [INFO] Configuring: psmisc [INFO] bitbake psmisc -c menuconfig ERROR: bitbake failed to configure psmisc ERROR: Failed to config psmisc. [INFO] bitbake busybox -c diffconfig ...... generate_bbappend /proj/hankf/kv260/v221/k26-cms-peta-0118 work/cortexa72-cortexa53-xilinx-linux/busybox/1.34.1-r0/user_2023-08-07-04-25-00.cfg NOTE: Starting bitbake
全志平台Tina系统yocto编译环境gstreamer编译不过问题 MACHINE=tulip-mozart source setup-environment bitbake image-tulip-mozart-chromium = " 2.重新获取环境变量 MACHINE=tulip-mozart source setup-environment 3.可能还是会编不过,把出错的东西的缓存清一下 bitbake playready -c cleansstate bitbake gstreamer -c cleansstate 4.重新编译 bitbake image-tulip-mozart-chromium 5.编译成功 Initialising
PWR services PWR 监管机构对非安全 IP 的访问 唤醒源管理 RCC services 访问受限 OPP 请求管理 校准触发 4 使用分发包构建 分发包提供了从相关 bitbake 目标构建以下 OP-TEE 组件的方法: bitbake optee-os-stm32mp # OP-TEE core firmware bitbake optee-os-sdk-stm32mp # OP-TEE development kit for Trusted Applications bitbake optee-client # OP-TEE client bitbake optee-test # OP-TEE test suite (optional) bitbake optee-examples
source/aarch64/layers/core/oe-init-build-env #export PATH=/home/work/petalinux/tools/hsm/bin:$PATH #bitbake fsbl -c cleansstate #bitbake fsbl ZYNQMP_CONSOLE=cadence1 $cat QSPI_R5_0.bif the_ROM_image: { [fsbl_config
1.1 编译SDK 执行如下执指令编译带有Qt功能的SDK: bitbake st-example-image-qtwayland -c populate_sdk 中途如果报do_fetch失败的错误 /myTest/STM32MP157/STM32MPU-Ecosystem-v5.0.0/Distribution-Package/build-openstlinuxweston-stm32mp1$ bitbake myTest/STM32MP157/STM32MPU-Ecosystem-v5.0.0/Distribution-Package/build-openstlinuxweston-stm32mp1$ ls bitbake-cookerdaemon.log
INFO] Building kernel [INFO] Sourcing build environment [INFO] Generating workspace directory INFO: bitbake INFO] Building u-boot [INFO] Sourcing build environment [INFO] Generating workspace directory INFO: bitbake
[INFO] sourcing bitbake [INFO] generating plnxtool conf [INFO] generating meta-plnx-generated layer [ number of parallel make -j (PARALLEL_MAKE) 编译 $ petalinux-build [INFO] building project [INFO] sourcing bitbake INFO: bitbake petalinux-user-image Loading cache: 100% |############################################
它包含 OpenEmbedded 构建系统(BitBake 和 OpenEmbedded Core)以及一组meta,可帮助您开始构建自己的发行版。 配置镜像 开始编译 配置好前面的步骤以后,就可以选择 我们需要编译的BeagleV-Ahead 开发板 配置项以及选择配套的 系统镜像了,我这里使用 MACHINE=light-beagle bitbake thead-image-linux 也就是表示 编译后的主板是 BeagleV-Ahead编译出来的系统是 thead-image-linux 如下,在刚才配置好 编译环境变量的下面 执行 MACHINE=light-beagle bitbake 如下所示,我需要给我最新编译出来的 beagleV-Ahead 单板 thead-image-linux 系统镜像 生成配套的SDK,那么只需要执行 MACHINE=light-beagle bitbake 如下图所示,编辑完成后,继续执行 MACHINE=light-beagle bitbake thead-image-linux -c populate_sdk 编译生成SDK,等待编译完成。