summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2018-07-25 17:07:16 +0800
committerRobert Yang <liezhi.yang@windriver.com>2019-02-15 16:00:16 +0800
commit2b9d87d41667d287d9775ee45eb1d9a9a07c4328 (patch)
treedc4adc6678310dc274bcaaae796738590629b1f1
parenta88bcbae850a2e6d182291d3f8e167aabdbe4842 (diff)
downloadopenembedded-core-contrib-2b9d87d41667d287d9775ee45eb1d9a9a07c4328.tar.gz
openembedded-core-contrib-2b9d87d41667d287d9775ee45eb1d9a9a07c4328.tar.bz2
openembedded-core-contrib-2b9d87d41667d287d9775ee45eb1d9a9a07c4328.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] Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-rwxr-xr-xscripts/runqemu13
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):
self.qemu_opt = ''
self.qemu_opt_script = ''
+ self.qemuparams = ''
self.clean_nfs_dir = False
self.nfs_server = ''
self.rootfs = ''
@@ -460,7 +461,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)):
@@ -667,7 +668,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'):
@@ -1169,6 +1174,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"