From: Mikko Rapeli Date: Wed, 10 May 2023 12:59:35 +0000 (+0300) Subject: qemurunner: add boot logs to do_testimage task logs in real time X-Git-Tag: uninative-3.10~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb62fae6ea3e411643395b12e56c363ce4d73e5d;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git qemurunner: add boot logs to do_testimage task logs in real time Complex boot sequences take a lot of time to reach serial console login. In our case boot involves multiple bootloaders like u-boot and grub, then hypervisors like xen, then initramfs images which do things like validating secure boot and encrypting the main rootfs. All these happen before main rootfs serial console login prompt is reached and thus many things can go wrong, including race conditions, hangs and deadlocks, and thus logging the details is important for development. This change adds the qemu serial console logs to do_testimage task logs while they are being read out. The logs are not added to bitbake output. This enables debugging and tracing the do_testimage via task log file while the boot and tests are running. Signed-off-by: Mikko Rapeli Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index c06268f5bc2..7f520d47c35 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -480,6 +480,7 @@ class QemuRunner: self.logger.error('Invalid file type: %s\n%s' % (file)) read = b'' + self.logger.debug2('Partial boot log:\n%s' % (read.decode('utf-8', errors='ignore'))) data = data + read if data: bootlog += data