gpt4 book ai didi

patch - 我如何在 yocto 中打补丁?

转载 作者:行者123 更新时间:2023-12-01 09:42:31 28 4
gpt4 key购买 nike

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

我一直在关注 this thread因为他和我有同样的问题,并且该线程上的答案修复了它,但随后出现了一个新问题。用

构建
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 文件并复制粘贴了补丁内容并将该文件放入我的 poky 元层中。但是我该如何应用补丁呢?我不知道从这里做什么,我需要制作一个 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 文件,但它说找不到要修补的文件。

然后我发现这可以通过将 ;striplevel=0 添加到 SRC_URI 行来解决,所以我这样做了:

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 <tromey@redhat.com>
| and Alexandre Duret-Lutz <adl@gnu.org>.
| 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"

关于patch - 我如何在 yocto 中打补丁?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57903358/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com