问题
I have one yocto recipe i.e uboot recipe.
UBOOT_VERSION = "v2020.01"
KUSH_RELEASE_VERSION = "v2020.1"
UBRANCH ?= "warrior"
SRCREV ?= "8f36a9574c7c5b00955de19c7436b469b5892c2f"
include u-boot-kush.inc
#include u-boot-spl-zynq-init.inc
#SRC_URI_append_kc705-microblazeel = " file://microblaze-kc705-Convert-microblaze-generic-to-k.patch"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://README;md5=c3594536cc6d9b0ea2c2e559f6e530b7"
# u-boot-xlnx has support for these
HAS_PLATFORM_INIT ?= " \
zinc_kush_defconfig \
zynq_microzed_config \
zynq_zed_config \
zynq_zc702_config \
zynq_zc706_config \
zynq_zybo_config \
xilinx_zynqmp_zcu102_rev1_0_config \
xilinx_zynqmp_zcu106_revA_config \
xilinx_zynqmp_zcu104_revC_config \
xilinx_zynqmp_zcu100_revC_config \
xilinx_zynqmp_zcu111_revA_config \
xilinx_zynqmp_zc1275_revA_config \
xilinx_zynqmp_zc1275_revB_config \
xilinx_zynqmp_zc1254_revA_config \
"
do_compile_append() {
for i in 1 2 3 4 5
do
echo "My yocto Looping ... number $i"
done
}
I am trying to debug the do_compile_append in yocto, I have a put loop here to print echo "My yocto Looping ... number $i". However, when I build it, I don't see the outputs on my terminal i.e those prints on the terminal while I am building it. Where are they logged?
回答1:
Bitbake provides logging functions for use in Shell Scrit code.
You can have a look to the poky/plain/meta/classes/logging.bbclass
which is inherited by default by many recipes.
Functions are : bbplain
, bbnote
, bbwarn
, bberror
, bbfatal
, bbdebug
So thus, you could use bbdebug "My yocto Looping ... number $i"
to print outputs in your terminal.
回答2:
By default all the logs of executed tasks are stored in ${WORKDIR}/temp/log.do_xxx
. For your recipe you can check your debug outputs in ${WORKDIR}/temp/log.do_compile
.
To see outputs on terminal, you should use special functions from below bbclass poky/plain/meta/classes/logging.bbclass
like this bbdebug "My yocto Looping ... number $i"
来源:https://stackoverflow.com/questions/62337145/debugging-yocto-recipe