我正在设置 yocto v1.7.1 “dizzy”,以从签入本地 git 存储库的自定义 Linux 内核修订版构建自定义 Linux 映像。
在完成构建过程时,它会失败do_validate_branches()
并显示以下错误消息。
DEBUG: Executing shell function do_validate_branches
usage: git cat-file (-t|-s|-e|-p|<type>|--textconv) <object>
or: git cat-file (--batch|--batch-check) < <list_of_objects>
<type> can be one of: blob, tree, commit, tag
-t show object type
-s show object size
-e exit with zero when there's no error
-p pretty-print object's content
--textconv for blob objects, run textconv on object's content
--batch[=<format>] show info and content of objects fed from the standard input
--batch-check[=<format>]
show info about objects fed from the standard input
ERROR: is not a valid commit ID.
ERROR: The kernel source tree may be out of sync
WARNING: exit code 1 from a shell command.
ERROR: Function failed: do_validate_branches (log file is located at etc..)
查看为 do_validate_branches 生成的代码,问题似乎是因为它正在调用git cat-file -t ${machine_srcrev}
,但它${machine_srcrev}
是一个空字符串。此外,这似乎是因为我在linux-yocto-custom.bb中使用了以下内容
SRCREV="${AUTOREV}"
因为当我用修订号替换它时,我不再遇到问题,例如...
SRCREV="7035c2a67d964acbb5d917f470bcda42691a3d9c"
问题是我实际上希望这个配方从分支的 HEAD 构建,所以放置一个特定的修订似乎不是我所追求的,而且SRCREV="${AUTOREV}"
似乎是我真正想要的。但如上所述,这使得${SRCREV_machine}
它是一个空字符串,而不是AUTOINC
我认为它应该评估的那样。
谁能给我任何见解,让我知道如何让食谱既能跟随头脑,而不必不断更新食谱以包含正确的SRCREV
并让它通过它do_validate_branches()
?我在这里想念什么?
编辑:更多信息...
如果我按如下方式修改我的kernel-yocto.bbclass ,问题似乎也得到了解决...... @285
- machine_srcrev="${SRCREV_machine}"
+ machine_srcrev="${@ get_machine_branch(d, "${SRCREV}" )}"
我对我的更改的理解是我正在明确地$SRCREV
从我的机器分支中重新获取。原来似乎认为已经存储在${SRCREV_machine}
. 尽管原始结果为空字符串,而我的更改结果为AUTOINC
.
尽管我仍然认为我一定遗漏了一些东西,因为我不需要编辑基类。但我总是更倾向于认为我错过了一些东西,而不是这是一个错误。也许我应该把它发布到 yocto 邮件列表的某个地方。