Yocto(Hardknott)添加Realsense Layer编译失败问题求助
1. Git拉取超时错误
ERROR: librealsense2-2.44.0-r0 do_fetch: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export PATH="/home/ubuntu/yocto_hardknott_realsense/sources/poky/scripts:/home/ubuntu/yocto_hardknott_realsense/build-xwayland-imx8mpsolidrun/tmp/work/cortexa53-crypto-poky-linux/librealsense2/2.44.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux:/home/ubuntu/yocto_hardknott_realsense/build-xwayland-imx8mpsolidrun/tmp/work/cortexa53-crypto-poky-linux/librealsense2/2.44.0-r0/recipe-sysroot/usr/bin/crossscripts:/home/ubuntu/yocto_hardknott_realsense/build-xwayland-imx8mpsolidrun/tmp/work/cortexa53-crypto-poky-linux/librealsense2/2.44.0-r0/recipe-sysroot-native/usr/sbin:/home/ubuntu/yocto_hardknott_realsense/build-xwayland-imx8mpsolidrun/tmp/work/cortexa53-crypto-poky-linux/librealsense2/2.44.0-r0/recipe-sysroot-native/usr/bin:/home/ubuntu/yocto_hardknott_realsense/build-xwayland-imx8mpsolidrun/tmp/work/cortexa53-crypto-poky-linux/librealsense2/2.44.0-r0/recipe-sysroot-native/sbin:/home/ubuntu/yocto_hardknott_realsense/build-xwayland-imx8mpsolidrun/tmp/work/cortexa53-crypto-poky-linux/librealsense2/2.44.0-r0/recipe-sysroot-native/bin:/home/ubuntu/yocto_hardknott_realsense/sources/poky/bitbake/bin:/home/ubuntu/yocto_hardknott_realsense/build-xwayland-imx8mpsolidrun/tmp/hosttools"; export HOME="/home/ubuntu"; git -c core.fsyncobjectfiles=0 ls-remote git://github.com/IntelRealSense/librealsense.git failed with exit code 128, output:
fatal: unable to connect to github.com:
github.com[0: 140.82.121.3]: errno=Connection timed out
原因与解决
这个错误是git://协议的网络连接超时导致的,换成https://协议是正确的修复方向。需要额外确认SRC_URI[sha256sum]的值与librealsense v2.44.0版本源码的哈希完全匹配,避免拉取到不完整或错误的代码包。
2. 补丁无法应用错误
ERROR: librealsense2-2.44.0-r0 do_patch: Command Error: 'quilt --quiltrc /home/ubuntu/yocto_hardknott_realsense/build-xwayland-imx8mpsolidrun/tmp/work/cortexa53-crypto-poky-linux/librealsense2/2.44.0-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0 Output:
stdout: Applying patch Remove-R200-fix-from-udev-rules.patch
(Stripping trailing CRs from patch; use --binary to disable.)
can't find file to patch at input line 15
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
From e3151a52558c6882003d69602c6ebc86ff47c35a Mon Sep 17 00:00:00 2001 From: Scott Ware scott.r.ware@intel.com Date: Mon, 8 Jun 2020 10:58:12 +0100 Subject: [PATCH 2/3] Remove R200 fix from udev rules Signed-off-by: Scott Ware scott.r.ware@intel.com --- config/99-realsense-libusb.rules 1 file changed, 1 insertion(+), 1 deletion(-) |
|diff --git a/config/99-realsense-libusb.rules b/config/99-realsense-libusb.rules
|index 0144322..e3eb567 100644
|--- a/config/99-realsense-libusb.rules
|+++ b/config/99-realsense-libusb.rulesNo file to patch. Skipping patch.
1 out of 1 hunk ignored
Patch Remove-R200-fix-from-udev-rules.patch does not apply (enforce with -f)stderr:
原因与解决
这个错误的核心是补丁与当前拉取的v2.44.0版本源码不兼容,可能存在以下几种情况:
- 文件路径变更:v2.44.0版本的源码中,
config/99-realsense-libusb.rules文件可能被移动到其他目录,或文件名发生了变化。 - 补丁已合并:该补丁对应的修改已经被官方合并到v2.44.0版本中,源码里已无需要修改的内容。
- 补丁版本不匹配:你使用的Realsense Layer中的补丁是为旧版本librealsense编写的,不适用于v2.44.0。
对应的解决方法:
- 检查源码结构:在
tmp/work/cortexa53-crypto-poky-linux/librealsense2/2.44.0-r0/git/目录下,确认是否存在config/99-realsense-libusb.rules文件。如果路径不同,修改补丁中的路径,或在SRC_URI的补丁项中添加striplevel参数调整路径层级。 - 移除无效补丁:如果该补丁的修改已经包含在v2.44.0源码中,直接在recipe的
SRC_URI里删除对应的补丁引用。 - 匹配Layer版本:查找与Yocto Hardknott和librealsense v2.44.0兼容的Realsense Layer版本,确保补丁与源码版本匹配。
内容的提问来源于stack exchange,提问作者Juanma

