Yocto bitbake script not displaying echo statement
Asked Answered
G

3

9

I currently have a bitbake .bb script that looks like this

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. Any suggestions on why I dont see that ?

Guidry answered 25/3, 2016 at 19:39 Comment(1)
Let try to use bitbake verbose mode: bitbake -vMagenmagena
P
12

you could use bitbake -e myRecipe > ./myRecipe.log to look deep into what is going on. The do_install will not echo anything out of the build when you are running bitbake.

Instead, they are all stored in the log file at /build/${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}/temp

In log.do_install, you should able to see something like this

DEBUG: Executing shell function do_install
--------HELLO WORLD------------------------
DEBUG: Shell function do_install finished
Perpetual answered 26/3, 2016 at 0:38 Comment(0)
P
5

you can do it like below (full source)

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

Pertinent answered 25/11, 2019 at 7:43 Comment(0)
S
3

For faster (and somewhat noisy) debugging you could also use bbnote/bbwarn in shell tasks. For python tasks there is bb.note/bb.warn.

Look here: 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 $recipe | cat

This gives you a nice sequential stream of tasks with bbnote/bbwarn in between.

Singhal answered 15/4, 2016 at 15:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.