mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
runqemu: log parameters correctly within testimage
It is not a good idea to mix logging and calls to print() - if the
output is being captured the result can be that the two types of output
are not recorded contiguously; this could be observed if an error
occurred running runqemu from inside testimage:
---------- snip ----------
ERROR: core-image-minimal-1.0-r0 do_testimage: Output from runqemu:
runqemu - INFO - Continuing with the following parameters:
runqemu - INFO - Setting up tap interface under sudo
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
runqemu - ERROR - Setting up tap device failed:
Command '('sudo', '/home/paul/poky/poky/scripts/runqemu-ifup', '1000', '1000', '/home/paul/poky/poky/build/tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin')' returned non-zero exit status 1.
Run runqemu-gen-tapdevs to manually create one.
runqemu - INFO - Cleaning up
KERNEL: [/home/paul/poky/poky/build/tmp/deploy/images/qemux86-64/bzImage--5.2.20+git0+bd0762cd13_dd25a04fc5-r0-qemux86-64-20191205213021.bin]
MACHINE: [qemux86-64]
FSTYPE: [ext4]
ROOTFS: [/home/paul/poky/poky/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.ext4]
CONFFILE: [/home/paul/poky/poky/build/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.qemuboot.conf]
---------- snip ----------
What we should see here is the KERNEL, MACHINE, etc. lines appearing
immediately after the "Continuing with the following parameters:" line
as they do when you run runqemu directly. If we put all of the lines
through the logger instead then it works properly.
(From OE-Core rev: ca64a3d490fbe1bf87c9f1dd6d87a1ecdeba8325)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
01fa7fdd05
commit
4955fe19ab
+13
-12
@@ -933,29 +933,30 @@ class BaseConfig(object):
|
|||||||
self.set('STAGING_BINDIR_NATIVE', '%s/usr/bin' % self.get('STAGING_DIR_NATIVE'))
|
self.set('STAGING_BINDIR_NATIVE', '%s/usr/bin' % self.get('STAGING_DIR_NATIVE'))
|
||||||
|
|
||||||
def print_config(self):
|
def print_config(self):
|
||||||
logger.info('Continuing with the following parameters:\n')
|
logoutput = ['Continuing with the following parameters:']
|
||||||
if not self.fstype in self.vmtypes:
|
if not self.fstype in self.vmtypes:
|
||||||
print('KERNEL: [%s]' % self.kernel)
|
logoutput.append('KERNEL: [%s]' % self.kernel)
|
||||||
if self.bios:
|
if self.bios:
|
||||||
print('BIOS: [%s]' % self.bios)
|
logoutput.append('BIOS: [%s]' % self.bios)
|
||||||
if self.dtb:
|
if self.dtb:
|
||||||
print('DTB: [%s]' % self.dtb)
|
logoutput.append('DTB: [%s]' % self.dtb)
|
||||||
print('MACHINE: [%s]' % self.get('MACHINE'))
|
logoutput.append('MACHINE: [%s]' % self.get('MACHINE'))
|
||||||
try:
|
try:
|
||||||
fstype_flags = ' (' + ', '.join(self.fsinfo[self.fstype]) + ')'
|
fstype_flags = ' (' + ', '.join(self.fsinfo[self.fstype]) + ')'
|
||||||
except KeyError:
|
except KeyError:
|
||||||
fstype_flags = ''
|
fstype_flags = ''
|
||||||
print('FSTYPE: [%s%s]' % (self.fstype, fstype_flags))
|
logoutput.append('FSTYPE: [%s%s]' % (self.fstype, fstype_flags))
|
||||||
if self.fstype == 'nfs':
|
if self.fstype == 'nfs':
|
||||||
print('NFS_DIR: [%s]' % self.rootfs)
|
logoutput.append('NFS_DIR: [%s]' % self.rootfs)
|
||||||
else:
|
else:
|
||||||
print('ROOTFS: [%s]' % self.rootfs)
|
logoutput.append('ROOTFS: [%s]' % self.rootfs)
|
||||||
if self.ovmf_bios:
|
if self.ovmf_bios:
|
||||||
print('OVMF: %s' % self.ovmf_bios)
|
logoutput.append('OVMF: %s' % self.ovmf_bios)
|
||||||
if (self.ovmf_secboot_pkkek1):
|
if (self.ovmf_secboot_pkkek1):
|
||||||
print('SECBOOT PKKEK1: [%s...]' % self.ovmf_secboot_pkkek1[0:100])
|
logoutput.append('SECBOOT PKKEK1: [%s...]' % self.ovmf_secboot_pkkek1[0:100])
|
||||||
print('CONFFILE: [%s]' % self.qemuboot)
|
logoutput.append('CONFFILE: [%s]' % self.qemuboot)
|
||||||
print('')
|
logoutput.append('')
|
||||||
|
logger.info('\n'.join(logoutput))
|
||||||
|
|
||||||
def setup_nfs(self):
|
def setup_nfs(self):
|
||||||
if not self.nfs_server:
|
if not self.nfs_server:
|
||||||
|
|||||||
Reference in New Issue
Block a user