diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2019-02-15 16:14:51 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-15 16:05:37 +0000 |
commit | ad522ea6a64ebc17f723a7580e3ac23e02575e77 (patch) | |
tree | 9c1c87085af8e1db00a0b556ae3785881484983b /scripts/runqemu | |
parent | bd5c9ca7c8b3e158ffed2f2bfc5d46780a5c047f (diff) | |
download | poky-ad522ea6a64ebc17f723a7580e3ac23e02575e77.tar.gz |
runqemu: Let qemuparams override default settings
Fixed:
In meta/conf/machine/include/qemuboot-x86.inc:
QB_CPU_x86-64 = "-cpu core2duo"
$ runqemu qemux86-64 qemuparams="-cpu coreduo"
Check /proc/cpuinfo, it should use coreduo rather than core2duo since user
specifies it, but it doesn't, append qemuparams to the last can fix the
problem.
[YOCTO #11773]
(From OE-Core rev: a847dd7202a2c493788c45d11eb86866264af7a4)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-x | scripts/runqemu | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index c4a0ca811d..10f61e4c7f 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -189,6 +189,7 @@ class BaseConfig(object): | |||
189 | 189 | ||
190 | self.qemu_opt = '' | 190 | self.qemu_opt = '' |
191 | self.qemu_opt_script = '' | 191 | self.qemu_opt_script = '' |
192 | self.qemuparams = '' | ||
192 | self.clean_nfs_dir = False | 193 | self.clean_nfs_dir = False |
193 | self.nfs_server = '' | 194 | self.nfs_server = '' |
194 | self.rootfs = '' | 195 | self.rootfs = '' |
@@ -460,7 +461,7 @@ class BaseConfig(object): | |||
460 | elif arg.startswith('biosfilename='): | 461 | elif arg.startswith('biosfilename='): |
461 | self.qemu_opt_script += ' -bios %s' % arg[len('biosfilename='):] | 462 | self.qemu_opt_script += ' -bios %s' % arg[len('biosfilename='):] |
462 | elif arg.startswith('qemuparams='): | 463 | elif arg.startswith('qemuparams='): |
463 | self.qemu_opt_script += ' %s' % arg[len('qemuparams='):] | 464 | self.qemuparams = ' %s' % arg[len('qemuparams='):] |
464 | elif arg.startswith('bootparams='): | 465 | elif arg.startswith('bootparams='): |
465 | self.bootparams = arg[len('bootparams='):] | 466 | self.bootparams = arg[len('bootparams='):] |
466 | elif os.path.exists(arg) or (re.search(':', arg) and re.search('/', arg)): | 467 | elif os.path.exists(arg) or (re.search(':', arg) and re.search('/', arg)): |
@@ -667,7 +668,11 @@ class BaseConfig(object): | |||
667 | raise RunQemuError("Invalid custombiosdir: %s" % self.custombiosdir) | 668 | raise RunQemuError("Invalid custombiosdir: %s" % self.custombiosdir) |
668 | 669 | ||
669 | def check_mem(self): | 670 | def check_mem(self): |
670 | s = re.search('-m +([0-9]+)', self.qemu_opt_script) | 671 | """ |
672 | Both qemu and kernel needs memory settings, so check QB_MEM and set it | ||
673 | for both. | ||
674 | """ | ||
675 | s = re.search('-m +([0-9]+)', self.qemuparams) | ||
671 | if s: | 676 | if s: |
672 | self.set('QB_MEM', '-m %s' % s.group(1)) | 677 | self.set('QB_MEM', '-m %s' % s.group(1)) |
673 | elif not self.get('QB_MEM'): | 678 | elif not self.get('QB_MEM'): |
@@ -1169,6 +1174,10 @@ class BaseConfig(object): | |||
1169 | 1174 | ||
1170 | self.qemu_opt += ' ' + self.qemu_opt_script | 1175 | self.qemu_opt += ' ' + self.qemu_opt_script |
1171 | 1176 | ||
1177 | # Append qemuparams to override previous settings | ||
1178 | if self.qemuparams: | ||
1179 | self.qemu_opt += ' ' + self.qemuparams | ||
1180 | |||
1172 | if self.snapshot: | 1181 | if self.snapshot: |
1173 | self.qemu_opt += " -snapshot" | 1182 | self.qemu_opt += " -snapshot" |
1174 | 1183 | ||