0

我正在设置 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 邮件列表的某个地方。

4

1 回答 1

0

在对 yocto 邮件列表进行了一些小讨论之后...... http://thread.gmane.org/gmane.linux.embedded.yocto.general/24316

概括:

看来,目前的逻辑do_validate_branches()并不能完全证明。

特别是在到达时似乎SRCREV_machine没有正确设置do_validate_branches(),至少在我使用linux-yocto-custom.bb并尝试使用SRCREV="${AUTOREV}". 目前正在对其进行研究和重新设计,希望能用于 v1.8 版本。

一个好的解决方法是SRCREV_machine在你的linux-yocto-custom.bb中设置。特别是,您可以在设置变量SRCREV后直接将其设置为与您的变量相同的内容SRCREV。以至于看起来...

SRCREV="${AUTOREV}"
SRCREV_machine="${AUTOREV}"    # or SRCREV_machine="${SRCREV}"

请记住,最终当您锁定要构建的源版本并替换"${AUTOREV}"为特定版本时,此问题就会消失。

因此,只有当您正在构建的源代码仍在进行中时,才需要进行开发构建,因此您希望使用"${AUTOREV}".

于 2015-04-22T10:05:28.607 回答