我正试图使用yocto poky warrior和meta tegra warrior-l4t-r32.2层为jetson nano构建一个图像。
我一直在关注这个话题,因为他和我有同样的问题,这个话题的答案解决了这个问题,但后来又出现了一个新问题。使用的建筑
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文件,但它说找不到要修补的文件。
然后我发现这可能通过添加来解决;stripelevel=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"
您拥有的补丁是针对yocto/poky源本身的(而不是更常见的情况,即为yocto构建的实际组件和以某种方式修改其他层中配方的bbappend提供补丁)。
因此,如果你真的想使用这个补丁,不需要将其"集成"到yocto中,只需在poky根目录中运行git am <patchfile>
或直接使用"补丁"命令即可。这不是很容易维护,因为你的poky现在不同于上游,但可能会工作。。。
应该可以使用bbappends进行相同的更改,然后将其存储在自己的层中(这样poky repo就不会受到影响),但您现有的补丁无法做到这一点。这将是你在评论中询问的最"恰当"的弹球方式——但如果你知道你永远不会升级poky,那么这可能不值得做。