如何在 yocto 中打补丁?

2024-01-03

我正在尝试使用 yocto poky-warrior 和 meta-tegra Warriors-l4t-r32.2 层为 jetson-nano 构建图像。

我一直在关注这个线程 https://stackoverflow.com/questions/56481980/yocto-for-nvidia-jetson-fails-because-of-gcc-7-cannot-compute-suffix-of-object/56528785#56528785因为他和我有同样的问题,并且该线程上的答案修复了它,但随后出现了一个新问题。

bitbake core-image-minimal

停止并显示错误

ERROR: Task (…/jetson-nano/layers/poky-warrior/meta/recipes-core/libxcrypt/libxcrypt.bb:do_configure) failed with exit code '1'

我被告知应用以下补丁可以解决这个问题:

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-  core/busybox/busybox.inc
index 174ce5a8c0..e8d651a010 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -128,7 +128,7 @@ do_prepare_config () {
                ${S}/.config.oe-tmp > ${S}/.config
        fi
        sed -i 's/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -b"/' ${S}/.config
-       sed -i 's|${DEBUG_PREFIX_MAP}||g' ${S}/.config
+       #sed -i 's|${DEBUG_PREFIX_MAP}||g' ${S}/.config
 }

 # returns all the elements from the src uri that are .cfg files
diff --git a/meta/recipes-core/libxcrypt/libxcrypt.bb b/meta/recipes-core/libxcrypt/libxcrypt.bb
index 3b9af6d739..350f7807a7 100644
--- a/meta/recipes-core/libxcrypt/libxcrypt.bb
+++ b/meta/recipes-core/libxcrypt/libxcrypt.bb
@@ -24,7 +24,7 @@ FILES_${PN} = "${libdir}/libcrypt*.so.* ${libdir}/libcrypt-*.so ${libdir}/libowc
 S = "${WORKDIR}/git"

 BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE} -std=gnu99"
-TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir} -Wno-error=missing-attributes"
-CPPFLAGS_append_class-nativesdk = " -Wno-error=missing-attributes"
+TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir} "
+CPPFLAGS_append_class-nativesdk = " "

 BBCLASSEXTEND = "nativesdk"

所以我制作了一个 libxcrypt.patch 文件并复制粘贴补丁内容并将该文件放入我的狭小的元层中。但我该如何应用补丁呢? 我不知道从这里该怎么做,我需要制作一个 bbappend 文件还是添加到一个文件中?- 如果是的话,是哪一个?或者我需要编辑 .bb 文件吗?- 也许是 libxcrypt.bb?我是否需要添加这些行:

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://path/to/patch/file"

我一直在尝试查看有关此问题的类似 stackoverflow 帖子,但它们似乎不够精确,无法让我解决,因为我对 yocto 等完全陌生。

到目前为止我已经尝试添加行

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://path/to/patch/file"

到 libxcrypt.bb 文件,但它说找不到要修补的文件。

然后我发现这个问题可以通过在 SRC_URI 行中添加 ;striplevel=0 来解决,所以我这样做了:

SRC_URI += "file://path/to/patch/file;striplevel=0"

哪个什么也没做。然后我尝试把

--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc

在补丁文件的最上面,但这也没有任何作用。

这是未尝试应用补丁的完整错误消息:

ERROR: libxcrypt-4.4.2-r0 do_configure: configure failed
ERROR: libxcrypt-4.4.2-r0 do_configure: Function failed: do_configure (log file is located at /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/temp/log.do_configure.42560)
ERROR: Logfile of failure stored in: /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/temp/log.do_configure.42560
Log data follows:
| DEBUG: SITE files ['endian-little', 'bit-64', 'arm-common', 'arm-64', 'common-linux', 'common-glibc', 'aarch64-linux', 'common']
| DEBUG: Executing shell function autotools_preconfigure
| DEBUG: Shell function autotools_preconfigure finished
| DEBUG: Executing python function autotools_aclocals
| DEBUG: SITE files ['endian-little', 'bit-64', 'arm-common', 'arm-64', 'common-linux', 'common-glibc', 'aarch64-linux', 'common']
| DEBUG: Python function autotools_aclocals finished
| DEBUG: Executing shell function do_configure
| automake (GNU automake) 1.16.1
| Copyright (C) 2018 Free Software Foundation, Inc.
| License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl-2.0.html>
| This is free software: you are free to change and redistribute it.
| There is NO WARRANTY, to the extent permitted by law.
| 
| Written by Tom Tromey <[email protected] /cdn-cgi/l/email-protection>
|        and Alexandre Duret-Lutz <[email protected] /cdn-cgi/l/email-protection>.
| AUTOV is 1.16
| NOTE: Executing ACLOCAL="aclocal --system-acdir=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot/usr/share/aclocal/ --automake-acdir=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/share/aclocal-1.16" autoreconf -Wcross --verbose --install --force --exclude=autopoint -I /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/git/m4/ -I /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/share/aclocal/
| autoreconf: Entering directory `.'
| autoreconf: configure.ac: not using Gettext
| autoreconf: running: aclocal --system-acdir=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot/usr/share/aclocal/ --automake-acdir=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/share/aclocal-1.16 -I /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/git/m4/ -I /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/share/aclocal/ --force -I m4
| autoreconf: configure.ac: tracing
| autoreconf: running: libtoolize --copy --force
| libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'm4'.
| libtoolize: copying file 'm4/ltmain.sh'
| libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
| libtoolize: copying file 'm4/libtool.m4'
| libtoolize: copying file 'm4/ltoptions.m4'
| libtoolize: copying file 'm4/ltsugar.m4'
| libtoolize: copying file 'm4/ltversion.m4'
| libtoolize: copying file 'm4/lt~obsolete.m4'
| autoreconf: running: /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/bin/autoconf --include=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/git/m4/ --include=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/share/aclocal/ --force
| autoreconf: running: /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/bin/autoheader --include=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/git/m4/ --include=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/share/aclocal/ --force
| autoreconf: running: automake --add-missing --copy --force-missing
| configure.ac:31: installing 'm4/compile'
| configure.ac:30: installing 'm4/config.guess'
| configure.ac:30: installing 'm4/config.sub'
| configure.ac:17: installing 'm4/install-sh'
| configure.ac:17: installing 'm4/missing'
| Makefile.am: installing './INSTALL'
| Makefile.am: installing 'm4/depcomp'
| parallel-tests: installing 'm4/test-driver'
| autoreconf: running: gnu-configize
| autoreconf: Leaving directory `.'
| NOTE: Running ../git/configure  --build=x86_64-linux        --host=aarch64-poky-linux           --target=aarch64-poky-linux         --prefix=/usr           --exec_prefix=/usr          --bindir=/usr/bin           --sbindir=/usr/sbin         --libexecdir=/usr/libexec           --datadir=/usr/share        --sysconfdir=/etc       --sharedstatedir=/com           --localstatedir=/var        --libdir=/usr/lib           --includedir=/usr/include       --oldincludedir=/usr/include        --infodir=/usr/share/info           --mandir=/usr/share/man         --disable-silent-rules          --disable-dependency-tracking           --with-libtool-sysroot=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot  --disable-static
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/site/endian-little
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/site/arm-common
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/site/arm-64
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/site/common-linux
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/site/common-glibc
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/site/common
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/meta-openembedded/meta-networking/site/endian-little
| checking for a BSD-compatible install... /home/mci/yocto/dev-jetson-nano/build/tmp/hosttools/install -c
| checking whether build environment is sane... yes
| checking for aarch64-poky-linux-strip... aarch64-poky-linux-strip
| checking for a thread-safe mkdir -p... /home/mci/yocto/dev-jetson-nano/build/tmp/hosttools/mkdir -p
| checking for gawk... gawk
| checking whether make sets $(MAKE)... yes
| checking whether make supports nested variables... yes
| checking build system type... x86_64-pc-linux-gnu
| checking host system type... aarch64-poky-linux-gnu
| checking for aarch64-poky-linux-gcc... aarch64-poky-linux-gcc  -march=armv8-a+crc -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot
| checking whether the C compiler works... no
| configure: error: in `/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/build':
| configure: error: C compiler cannot create executables
| See `config.log' for more details
| NOTE: The following config.log files may provide further information.
| NOTE: /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/build/config.log
| ERROR: configure failed
| WARNING: /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/temp/run.do_configure.42560:1 exit 1 from 'exit 1'
| ERROR: Function failed: do_configure (log file is located at /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/temp/log.do_configure.42560)
ERROR: Task (/home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/recipes-core/libxcrypt/libxcrypt.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 883 tasks of which 848 didn't need to be rerun and 1 failed.

这是当我尝试将行添加到 libxcrypt.bb 文件以应用补丁时的完整错误日志:

ERROR: libxcrypt-4.4.2-r0 do_patch: Command Error: 'quilt --quiltrc /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
Applying patch libxcrypt.patch
can't find file to patch at input line 7
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- a/meta/recipes-core/busybox/busybox.inc
|+++ b/meta/recipes-core/busybox/busybox.inc
|diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
|index 174ce5a8c0..e8d651a010 100644
|--- a/meta/recipes-core/busybox/busybox.inc
|+++ b/meta/recipes-core/busybox/busybox.inc
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 20
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/meta/recipes-core/libxcrypt/libxcrypt.bb b/meta/recipes-core/libxcrypt/libxcrypt.bb
|index 3b9af6d739..350f7807a7 100644
|--- a/meta/recipes-core/libxcrypt/libxcrypt.bb
|+++ b/meta/recipes-core/libxcrypt/libxcrypt.bb
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
Patch libxcrypt.patch does not apply (enforce with -f)
ERROR: libxcrypt-4.4.2-r0 do_patch: 
ERROR: libxcrypt-4.4.2-r0 do_patch: Function failed: patch_do_patch
ERROR: Logfile of failure stored in: /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/temp/log.do_patch.34179
ERROR: Task (/home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/recipes-core/libxcrypt/libxcrypt.bb:do_patch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 811 tasks of which 793 didn't need to be rerun and 1 failed.

我知道这对很多人来说可能是一个微不足道的问题,但作为一名新开发人员,我自己很难弄清楚。


通过将补丁文件添加到元层并在 SRC_URI 中引用它们来进行修补的概念仅适用于修补包的源代码。您不能像您尝试的那样使用它来修补元数据(食谱)本身。

相反,您可以手动更改本地食谱,或将 bbappends 添加到图层以更改 poky 中的现有食谱。永久修复它的最佳方法是寻找上游修复,如果有修复则更新你的poky层,或者如果没有则向上游发送补丁来修复它。

对于 libxcrypt 的 bbappend 解决方案,您可以创建一个 libxcrypt.bbappend,内容如下:

TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir} "
CPPFLAGS_reomve_class-nativesdk = "-Wno-error=missing-attributes"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在 yocto 中打补丁? 的相关文章

随机推荐

  • 当声音在 AVAudioPlayer 中播放完毕时执行操作吗?

    我正在使用 AVAudioPlayer 框架 并且我有几种声音一次播放一种 当声音播放完毕后 我希望应用程序执行一些操作 我尝试使用audioPlayerDidFinishPlaying 在第一个声音结束时执行操作 但我无法将其用于第二个声
  • 如何在 Flutter 中将数据从 showmodalbottomsheet 传递到上一页

    我如何传递数据showmodalbottomsheet到上一页 下面是示例代码 我尝试过的是 当我单击它时 有一个按钮显示 modalbottomsheet 当我单击 完成 按钮时 它应该通过1值到上一页 我还添加了setState on
  • Twitter Bootstrap:减少编译时间

    我正在使用 Twitter Bootstrap 编写一个简单的应用程序 在我的主 HTML 文件中 有以下几行 所以每次刷新页面时 都会生成整个 css 每次大约需要 15 秒 所以等待页面加载是一件痛苦的事情 我尝试使用 SimpLESS
  • Omniauth-facebook 登录不起作用

    我克隆了Facebook 集成示例 https github com AnnieLee blog facebook 这个 repo 可以了解omniauth facebook 是如何工作的 我从我的 Facebook 应用程序设置了自己的
  • ios 模拟器在 xcode 6 中出现并带有 UDID

    当我从 xcode 6 选择模拟器时 我会得到多个选择模拟器的选项 但模拟器带有 UDID 请看下面的图片并请帮帮我 提前致谢 killall Xcode Kills all running Xcode processes sudo kil
  • 如何用Python编写下载进度指示器?

    我正在编写一个小应用程序来通过 http 下载文件 例如 所描述的here https stackoverflow com questions 22676 how do i download a file over http using p
  • Cucumber-jvm @after 与 Appium 驱动程序

    我在用着cucumber jvm 并努力在全球范围内实施 After应该执行的方法只有一次所有场景执行完成后 这 After方法应该退出appium驱动程序 现在 After钩子在之后执行each运行场景 这意味着每次都应该从头开始创建驱动
  • jQuery 上的 trigger('click') 和 click() 有什么区别

    我正在寻找这两者之间的性能差异 我在 SSE 中找不到关于这个主题的好的答案 一些例子会有很大帮助 如果你查看 jQuery 代码 你会发现所有click does 是执行trigger click jQuery each blur foc
  • 使用 scala 和 GAE 玩框架

    有谁知道如何让 Play 框架的 scala 版本在 Google App Engine 中运行 此时我只是尝试让默认应用程序运行 我正在使用带有 gae 1 4 和 scala 0 9 1 模块的 Play 1 2 2 我创建了一个默认应
  • 如何在特征值中转置张量

    我试图获得两个张量的矩阵乘积 其中一个张量应该在相乘之前转置 At B 到目前为止我发现的是没有任何转置和两个矩阵转置的矩阵乘积 我正在寻找一种方法 可以直接收缩两个张量并转置其中一个张量 或者在收缩一个张量之前转置一个张量 我发现 转置效
  • 使用 C# 通过数据库中存储的文件路径在 Crystal Reports 10 中显示图像

    我有一个 C Windows 应用程序 它将员工数据存储到 MYSQL 数据库中 包括他们的图片文件路径 192 168 13 6 IDPictures Unknown jpg 有人可以帮助我如何通过从数据库读取文件路径来显示 Crysta
  • php preg_replace 匹配字符串但仅替换其中的一部分

    我有这样的文字 Retailer ul Amazon foloseste metode severe pentru a si descuraja etc angajatii din depozite sa nu mai fure din p
  • 使用 SELECT 结果作为其他 SELECT 中的 COLUMN 名称

    是否可以使用选择的结果作为字符串与其他选择中列名中的另一个字符串连接 Example SELECT brand FROM articles a WHERE a id 12345678 结果 BRAND A 我现在想要连接 PRICE to
  • 如何使用 LoadImage 和 StretchDIBits 绘制 PNG 图像?

    这与问题有关如何使用 Win32 GDI 加载 PNG 图像 如果可能 不要使用 GDI https stackoverflow com questions 4567875 how would i load a png image usin
  • 从 PyQt GUI 类外部访问 GUI 元素 text( )

    Ui MainWindow 是由设计器和 pyuic 生成的 py 文件 我想将 PyQt GUI 元素文本值传递到另一个文件并执行一些基本操作并返回结果 父文件 from PyQt4 import QtCore QtGui try fro
  • 将 SQL 查询替换为 LINQ 查询

    我有SQL检查今天的查询 根据表中存储 3 个字母字符的字段进行检查 如下所示 如果今天是星期二我需要归还记录 我有这样的 SQL 查询 SELECT TOP 1 EndTime StartTime OrderDay FROM dbo Se
  • .NET 4.6 之前的 Buffer.MemoryCopy 的替代方案

    我正在尝试将一些 NET 4 6 代码降级到 NET 4 5 这是我目前正在使用的代码块 fixed byte destination dataBytes Buffer MemoryCopy data destination dataLen
  • 为什么 JavaMail Transport.send() 是静态方法?

    我正在修改我没有编写的使用 JavaMail 的代码 并且在理解为什么 JavaMail API 是这样设计的方面遇到了一些困难 我有一种感觉 如果我理解的话 我可以做得更好 We call transport session getTra
  • Java使用String.format进行十进制格式化?

    我需要将十进制值格式化为字符串 其中我始终显示至少 2 位小数 最多 4 位小数 例如 34 49596 would be 34 4959 49 3 would be 49 30 可以使用 String format 命令来完成此操作吗 或
  • 如何在 yocto 中打补丁?

    我正在尝试使用 yocto poky warrior 和 meta tegra Warriors l4t r32 2 层为 jetson nano 构建图像 我一直在关注这个线程 https stackoverflow com questi