Yocto 4.0.15构建出现update-rc.d-native解包错误求助
问题描述
Yocto项目版本为4.0.15,构建时出现以下错误:
ERROR: update-rc.d-native-0.8-r0 do_unpack: Bitbake Fetcher Error: UnpackError('No up to date source found: clone directory not available or not up to date: /build/downloads/git2/git.yoctoproject.org.update-rc.d; shallow clone not enabled', 'git://git.yoctoproject.org/update-rc.d;branch=master') ERROR: Logfile of failure stored in: /build/tmp/work/x86_64-linux/update-rc.d-native/0.8-r0/temp/log.do_unpack.11298
对应的配方文件路径为\src\poky\meta\recipes-core\update-rc.d\update-rc.d_0.8.bb,内容如下:
SUMMARY = "manage symlinks in /etc/rcN.d" HOMEPAGE = "http://github.com/philb/update-rc.d/" DESCRIPTION = "update-rc.d is a utility that allows the management of symlinks to the initscripts in the /etc/rcN.d directory structure." SECTION = "base" LICENSE = "GPL-2.0-or-later" SRC_URI = "git://git.yoctoproject.org/update-rc.d;branch=master" SRCREV = "8636cf478d426b568c1be11dbd9346f67e03adac" UPSTREAM_CHECK_COMMITS = "1" S = "${WORKDIR}/git" inherit allarch do_compile() { } do_install() { install -d ${D}${sbindir} install -m 0755 ${S}/update-rc.d ${D}${sbindir}/update-rc.d } BBCLASSEXTEND = "native nativesdk"
已检查bblayers.conf配置,确认包含相关层:
/aiot-yocto/src/poky/meta \ /aiot-yocto/src/poky/meta-poky \ /aiot-yocto/src/poky/meta-yocto-bsp \
配方文件与bblayers.conf配置均正确,但仍出现上述错误,求原因及解决办法。
可能的原因与解决办法
本地Git缓存损坏或未更新
错误提示明确指向本地克隆目录异常,可直接清理缓存后重新拉取:- 删除本地缓存目录:
rm -rf /build/downloads/git2/git.yoctoproject.org.update-rc.d - 重新执行构建命令,让BitBake重新克隆仓库
- 删除本地缓存目录:
未启用浅克隆导致同步失败
当前配方未开启浅克隆,在网络不稳定或仓库历史较大时易出现同步问题。修改SRC_URI添加浅克隆参数:SRC_URI = "git://git.yoctoproject.org/update-rc.d;branch=master;shallow=1"保存配方后重新构建。
指定的SRCREV提交不存在
验证目标提交是否存在于远程仓库的master分支:git clone git://git.yoctoproject.org/update-rc.d cd update-rc.d git log --oneline | grep 8636cf478d426b568c1be11dbd9346f67e03adac如果无匹配结果,需确认正确的提交哈希值,或临时改用分支最新提交(注意:会影响构建稳定性,仅临时测试用)。
网络访问受限
测试构建环境能否正常访问Git源:git clone git://git.yoctoproject.org/update-rc.d如果无法克隆,可切换为HTTPS协议修改
SRC_URI:SRC_URI = "https://git.yoctoproject.org/git/update-rc.d;branch=master"
内容的提问来源于stack exchange,提问作者jason yu
相关产品推荐
相关产品推荐

