简体   繁体   English

Yocto bitbake 脚本不显示 echo 语句

[英]Yocto bitbake script not displaying echo statement

I currently have a bitbake .bb script that looks like this我目前有一个看起来像这样的 bitbake .bb 脚本

DESCRIPTION = "Hello World"
SECTION = "TESTING"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
PR = "r0"

SRC_URI = "file://fileA \
           file://fileB"

S = "${WORKDIR}"

inherit allarch


do_install() {
        echo "--------HELLO WORLD------------------------"
}

Now when I goto the build directory and run bitbake on this recipe I do not see output "Hello world" anywhere.现在,当我转到构建目录并在此配方上运行 bitbake 时,我在任何地方都看不到输出“Hello world”。 Any suggestions on why I dont see that ?关于为什么我没有看到的任何建议?

you could use bitbake -e myRecipe > ./myRecipe.log to look deep into what is going on.您可以使用bitbake -e myRecipe > ./myRecipe.log深入了解发生了什么。 The do_install will not echo anything out of the build when you are running bitbake.当您运行 bitbake 时,do_install 不会从构建中echo任何内容。

Instead, they are all stored in the log file at /build/${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}/temp相反,它们都存储在/build/${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}/temp的日志文件中

In log.do_install , you should able to see something like thislog.do_install ,您应该能够看到类似这样的内容

DEBUG: Executing shell function do_install
--------HELLO WORLD------------------------
DEBUG: Shell function do_install finished

For faster (and somewhat noisy) debugging you could also use bbnote/bbwarn in shell tasks.为了更快(并且有些嘈杂)调试,您还可以在 shell 任务中使用 bbnote/bbwarn。 For python tasks there is bb.note/bb.warn.对于 python 任务,有 bb.note/bb.warn。

Look here: http://patchwork.openembedded.org/patch/59021/看这里: http : //patchwork.openembedded.org/patch/59021/

More readability with regard to which tasks have executed comes from piping bitbake through something, so it knows not to use fancy screen updates:关于执行哪些任务的更多可读性来自通过管道 bitbake 通过某些东西,所以它知道不要使用花哨的屏幕更新:

bitbake $recipe | cat

This gives you a nice sequential stream of tasks with bbnote/bbwarn in between.这为您提供了一个很好的连续任务流,中间有 bbnote/bbwarn。

you can do it like below ( full source )你可以像下面那样做( 完整源代码

do_install() {
    bbplain "--------HELLO WORLD------------------------"
    printf "%b\0" "bbplain --------HELLO WORLD------------------------" > ${LOGFIFO}
}

如果确定do_install已被调用,请提供您的输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM