diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2019-12-09 23:59:08 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-12-15 09:10:46 +0000 |
commit | 4955fe19abfde0fd9b4fe5e1f82fd2a148e5db01 (patch) | |
tree | 2c45d8b25ff6ed37443e7a278b3e75cd5add9bc3 /scripts | |
parent | 01fa7fdd057e430e7bb55bb57d0df6d226f56e3b (diff) | |
download | poky-4955fe19abfde0fd9b4fe5e1f82fd2a148e5db01.tar.gz |
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>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 5c56c3fe6c..f061917c4b 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -933,29 +933,30 @@ class BaseConfig(object): | |||
933 | self.set('STAGING_BINDIR_NATIVE', '%s/usr/bin' % self.get('STAGING_DIR_NATIVE')) | 933 | self.set('STAGING_BINDIR_NATIVE', '%s/usr/bin' % self.get('STAGING_DIR_NATIVE')) |
934 | 934 | ||
935 | def print_config(self): | 935 | def print_config(self): |
936 | logger.info('Continuing with the following parameters:\n') | 936 | logoutput = ['Continuing with the following parameters:'] |
937 | if not self.fstype in self.vmtypes: | 937 | if not self.fstype in self.vmtypes: |
938 | print('KERNEL: [%s]' % self.kernel) | 938 | logoutput.append('KERNEL: [%s]' % self.kernel) |
939 | if self.bios: | 939 | if self.bios: |
940 | print('BIOS: [%s]' % self.bios) | 940 | logoutput.append('BIOS: [%s]' % self.bios) |
941 | if self.dtb: | 941 | if self.dtb: |
942 | print('DTB: [%s]' % self.dtb) | 942 | logoutput.append('DTB: [%s]' % self.dtb) |
943 | print('MACHINE: [%s]' % self.get('MACHINE')) | 943 | logoutput.append('MACHINE: [%s]' % self.get('MACHINE')) |
944 | try: | 944 | try: |
945 | fstype_flags = ' (' + ', '.join(self.fsinfo[self.fstype]) + ')' | 945 | fstype_flags = ' (' + ', '.join(self.fsinfo[self.fstype]) + ')' |
946 | except KeyError: | 946 | except KeyError: |
947 | fstype_flags = '' | 947 | fstype_flags = '' |
948 | print('FSTYPE: [%s%s]' % (self.fstype, fstype_flags)) | 948 | logoutput.append('FSTYPE: [%s%s]' % (self.fstype, fstype_flags)) |
949 | if self.fstype == 'nfs': | 949 | if self.fstype == 'nfs': |
950 | print('NFS_DIR: [%s]' % self.rootfs) | 950 | logoutput.append('NFS_DIR: [%s]' % self.rootfs) |
951 | else: | 951 | else: |
952 | print('ROOTFS: [%s]' % self.rootfs) | 952 | logoutput.append('ROOTFS: [%s]' % self.rootfs) |
953 | if self.ovmf_bios: | 953 | if self.ovmf_bios: |
954 | print('OVMF: %s' % self.ovmf_bios) | 954 | logoutput.append('OVMF: %s' % self.ovmf_bios) |
955 | if (self.ovmf_secboot_pkkek1): | 955 | if (self.ovmf_secboot_pkkek1): |
956 | print('SECBOOT PKKEK1: [%s...]' % self.ovmf_secboot_pkkek1[0:100]) | 956 | logoutput.append('SECBOOT PKKEK1: [%s...]' % self.ovmf_secboot_pkkek1[0:100]) |
957 | print('CONFFILE: [%s]' % self.qemuboot) | 957 | logoutput.append('CONFFILE: [%s]' % self.qemuboot) |
958 | print('') | 958 | logoutput.append('') |
959 | logger.info('\n'.join(logoutput)) | ||
959 | 960 | ||
960 | def setup_nfs(self): | 961 | def setup_nfs(self): |
961 | if not self.nfs_server: | 962 | if not self.nfs_server: |