summaryrefslogtreecommitdiff
path: root/scripts/runqemu
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2019-02-15 16:14:51 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-25 22:25:07 +0000
commit81ab6332bee0426201626cc8a0339ce3e6b81d6f (patch)
tree54e39be9792b3f96ffd7368910557705ae50569b /scripts/runqemu
parent6e2bf8691ffd6004cb40e71a2d1d002b5ed5808f (diff)
downloadopenembedded-core-81ab6332bee0426201626cc8a0339ce3e6b81d6f.tar.gz
openembedded-core-81ab6332bee0426201626cc8a0339ce3e6b81d6f.tar.bz2
openembedded-core-81ab6332bee0426201626cc8a0339ce3e6b81d6f.zip
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> Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 55cdd414ec..52505719c9 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -188,6 +188,7 @@ class BaseConfig(object):
self.qemu_opt = ''
self.qemu_opt_script = ''
+ self.qemuparams = ''
self.clean_nfs_dir = False
self.nfs_server = ''
self.rootfs = ''
@@ -455,7 +456,7 @@ class BaseConfig(object):
elif arg.startswith('biosfilename='):
self.qemu_opt_script += ' -bios %s' % arg[len('biosfilename='):]
elif arg.startswith('qemuparams='):
- self.qemu_opt_script += ' %s' % arg[len('qemuparams='):]
+ self.qemuparams = ' %s' % arg[len('qemuparams='):]
elif arg.startswith('bootparams='):
self.bootparams = arg[len('bootparams='):]
elif os.path.exists(arg) or (re.search(':', arg) and re.search('/', arg)):
@@ -662,7 +663,11 @@ class BaseConfig(object):
raise RunQemuError("Invalid custombiosdir: %s" % self.custombiosdir)
def check_mem(self):
- s = re.search('-m +([0-9]+)', self.qemu_opt_script)
+ """
+ Both qemu and kernel needs memory settings, so check QB_MEM and set it
+ for both.
+ """
+ s = re.search('-m +([0-9]+)', self.qemuparams)
if s:
self.set('QB_MEM', '-m %s' % s.group(1))
elif not self.get('QB_MEM'):
@@ -1164,6 +1169,10 @@ class BaseConfig(object):
self.qemu_opt += ' ' + self.qemu_opt_script
+ # Append qemuparams to override previous settings
+ if self.qemuparams:
+ self.qemu_opt += ' ' + self.qemuparams
+
if self.snapshot:
self.qemu_opt += " -snapshot"