使用 bitbake 为 BBB 构建 .dtbo 覆盖

如何解决使用 bitbake 为 BBB 构建 .dtbo 覆盖

我使用内核 linux-ti-staging-4.14 和自定义设备树为我的 BBB 构建了一个 yocto 发行版(rocko)。由于我需要将一个旧项目从 Debian 移植到 Yocto,我还需要在内核中启用 UIO 功能,这也能正常工作。

现在我还需要为 UIO PRUSS 创建一个附加的设备树覆盖。我使用来自 here 的 dts 文件并通过 bbappend 扩展内核配方:

inherit kernel-devicetree

FILESEXTRAPATHS_prepend := "${THISDIR}/files/dts:${THISDIR}/files/beaglebone:"

# Make custom kernel with PRU enabled
SRC_URI += " \
    file://bbb-pru-minimal.dts;subdir=git/arch/${ARCH}/boot/dts \
    file://AM335X-PRU-UIO-00A0-overlay.dts;subdir=git/arch/${ARCH}/boot/dts/overlays \
    file://0001-add-UIO-dtbo.patch \
    file://defconfig \
"

KERNEL_DEVICETREE = " \
   AM335X-PRU-UIO-00A0.dtbo \
   bbb-pru-minimal.dtb \
"

上面列出的补丁文件包含:

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 7949c213a434..fe2513074893 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -610,6 +610,7 @@ dtb-$(CONFIG_SOC_TI81XX) += \
    dm8168-evm.dtb \
    dra62x-j5eco-evm.dtb
 dtb-$(CONFIG_SOC_AM33XX) += \
+   AM335X-PRU-UIO-00A0.dtbo \
    am335x-baltos-ir2110.dtb \
    am335x-baltos-ir3220.dtb \
    am335x-baltos-ir5221.dtb \

但是,内核构建失败,因为似乎没有针对 .dtbo 目标的规则:

|   CC      scripts/mod/empty.o
|   CC      scripts/mod/devicetable-offsets.s
|   MKELF   scripts/mod/elfconfig.h
|   HOSTCC  scripts/mod/modpost.o
|   HOSTCC  scripts/mod/sumversion.o
|   CHK     scripts/mod/devicetable-offsets.h
|   HOSTCC  scripts/mod/file2alias.o
|   HOSTLD  scripts/mod/modpost
| NOTE: make -j 24 HOSTCC=gcc  -isystem[TOPDIR]/build/tmp/work/beaglebone-poky-linux-gnueabi/linux-ti-staging/4.14.79+gitAUTOINC+3438de3474-c/recipe-sysroot-native/usr/include -O2 -pipe -L[TOPDIR]/build/tmp/work/beaglebone-poky-linux-gnueabi/linux-ti-staging/4.14.79+gitAUTOINC+3438de3474-c/recipe-sysroot-native/usr/lib -L[TOPDIR]/build/tmp/work/beaglebone-poky-linux-gnueabi/linux-ti-staging/4.14.79+gitAUTOINC+3438de3474-c/recipe-sysroot-native/lib -Wl,-rpath-link,[TOPDIR]/build/tmp/work/beaglebone-poky-linux-gnueabi/linux-ti-staging/4.14.79+gitAUTOINC+3438de3474-c/recipe-sysroot-native/usr/lib -Wl,[TOPDIR]/build/tmp/work/beaglebone-poky-linux-gnueabi/linux-ti-staging/4.14.79+gitAUTOINC+3438de3474-c/recipe-sysroot-native/lib -Wl,-rpath,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=[TOPDIR]/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 HOSTCPP=gcc  -E AM335X-PRU-UIO-00A0.dtbo
|   CHK     scripts/mod/devicetable-offsets.h
| make[3]: *** No rule to make target 'arch/arm/boot/dts/AM335X-PRU-UIO-00A0.dtbo'.  Stop.
| arch/arm/Makefile:345: recipe for target 'AM335X-PRU-UIO-00A0.dtbo' failed
| make[2]: *** [AM335X-PRU-UIO-00A0.dtbo] Error 2
| Makefile:146: recipe for target 'sub-make' failed
| make[1]: *** [sub-make] Error 2
| Makefile:24: recipe for target '__sub-make' failed
| make: *** [__sub-make] Error 2
| ERROR: oe_runmake failed

请注意,出于隐私原因,我将错误消息中的绝对路径替换为 [TOPDIR]。

由于我对叠加层创作还很陌生,所以我真的不知道我缺少什么或如何修复它。有什么提示吗?

先谢谢你!

更新:在上面的描述中添加了补丁文件。

解决方法

以下是我在分析 Toradex 的 git 项目后发现的可以激发您解决方案的灵感:

他们有一个自定义类来处理他们的设备树文件和设备树覆盖,here

该类继承了 devicetree,它是一个官方的 poky 类 here

devicetree 类测试设备树是覆盖还是正常,然后编译所有这些。

因此,您基本上可以在自定义配方中使用 devicetree 类来编译设备树覆盖并将它们手动部署到您的 rootfs 中。

Toradex 也有类似 here 的简单配方。他们有一个 git 项目来保存他们所有的设备树覆盖。

话虽如此,我认为 Toradex 不使用自定义配方,而是使用继承自 toradex-devicetree 的自定义 devicetree 类,从他们的设备树覆盖 git 项目编译所有设备树覆盖然后将它们全部部署到 rootfs 中。

在该自定义类中,它们附加到 devicetree 类的 do_deploy 以安装 .dtbo 文件并将它们添加到引导分区下的 overlays.txt 文件中。

最后,如果您没有内核配方,您可以为您的内核配方创建一个 bbappend 文件,并尝试执行以下步骤:

  1. devicetree继承
  2. 通过本地文件或 URL 将作为叠加层的 dts 文件添加到 SRC_URI
  3. 将叠加层的路径添加到 DT_FILES_PATH 类的 devicetree
  4. 在内核配方中,附加到 do_deploy 以将它们添加到 rootfs。

现在,我的建议是逐步实现这一目标:

  1. 创建一个使用 devicetree 类和 dts 覆盖示例文件的自定义配方
  2. 检查它是否正确编译
  3. 如果您理解这一点,则可以应用上述 4 个步骤。
,

感谢@BelHadjSalem 的提示,我能够管理 dtbo 构建。 类文件 devicetree.bbclass 是在 Yocto 中引入的,发布版本为“thud”,因此我将整个工作区更新为最新的 Yocto 版本 (dunfell)。之后我创建了一个新配方来构建我的 dtbo 覆盖:

inherit devicetree

FILESEXTRAPATHS_prepend := "${THISDIR}/files/dts:"

SRC_URI = " \
    file://AM335X-PRU-UIO-00A0.dts;subdir=git/overlays \
"

S = "${WORKDIR}/git/overlays"

COMPATIBLE_MACHINE = ".*(ti33x|beaglebone).*"

配方非常简单,可根据需要在我的项目中使用。

然而,一个重要的注意事项:在任何内核配方或内核 bbappend 文件中继承 devicetree.bbclass 都行不通!不确定到底发生了什么,但 devicetree.bbclass 的继承将使内核配方配置无效并以 ERROR: Nothing PROVIDES 'virtual/kernel'

失败

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 <select id="xxx"> SELECT di.id, di.name, di.work_type, di.updated... <where> <if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 <property name="dynamic.classpath" value="tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams['font.sans-serif'] = ['SimHei'] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -> systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping("/hires") public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate<String
使用vite构建项目报错 C:\Users\ychen\work>npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-