summaryrefslogtreecommitdiffstats
path: root/scripts
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:27:40 +0000
commit18f000c708187a18945b18352d735243a392fb0c (patch)
treeb9e60af2ee5f8012070c61d602c0381837cdab56 /scripts
parent11ec3b28b4226e0f6cd7c3b46197262b3b3e52a4 (diff)
downloadpoky-18f000c708187a18945b18352d735243a392fb0c.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) (From OE-Core rev: 81ab6332bee0426201626cc8a0339ce3e6b81d6f) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-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):
188 188
189 self.qemu_opt = '' 189 self.qemu_opt = ''
190 self.qemu_opt_script = '' 190 self.qemu_opt_script = ''
191 self.qemuparams = ''
191 self.clean_nfs_dir = False 192 self.clean_nfs_dir = False
192 self.nfs_server = '' 193 self.nfs_server = ''
193 self.rootfs = '' 194 self.rootfs = ''
@@ -455,7 +456,7 @@ class BaseConfig(object):
455 elif arg.startswith('biosfilename='): 456 elif arg.startswith('biosfilename='):
456 self.qemu_opt_script += ' -bios %s' % arg[len('biosfilename='):] 457 self.qemu_opt_script += ' -bios %s' % arg[len('biosfilename='):]
457 elif arg.startswith('qemuparams='): 458 elif arg.startswith('qemuparams='):
458 self.qemu_opt_script += ' %s' % arg[len('qemuparams='):] 459 self.qemuparams = ' %s' % arg[len('qemuparams='):]
459 elif arg.startswith('bootparams='): 460 elif arg.startswith('bootparams='):
460 self.bootparams = arg[len('bootparams='):] 461 self.bootparams = arg[len('bootparams='):]
461 elif os.path.exists(arg) or (re.search(':', arg) and re.search('/', arg)): 462 elif os.path.exists(arg) or (re.search(':', arg) and re.search('/', arg)):
@@ -662,7 +663,11 @@ class BaseConfig(object):
662 raise RunQemuError("Invalid custombiosdir: %s" % self.custombiosdir) 663 raise RunQemuError("Invalid custombiosdir: %s" % self.custombiosdir)
663 664
664 def check_mem(self): 665 def check_mem(self):
665 s = re.search('-m +([0-9]+)', self.qemu_opt_script) 666 """
667 Both qemu and kernel needs memory settings, so check QB_MEM and set it
668 for both.
669 """
670 s = re.search('-m +([0-9]+)', self.qemuparams)
666 if s: 671 if s:
667 self.set('QB_MEM', '-m %s' % s.group(1)) 672 self.set('QB_MEM', '-m %s' % s.group(1))
668 elif not self.get('QB_MEM'): 673 elif not self.get('QB_MEM'):
@@ -1164,6 +1169,10 @@ class BaseConfig(object):
1164 1169
1165 self.qemu_opt += ' ' + self.qemu_opt_script 1170 self.qemu_opt += ' ' + self.qemu_opt_script
1166 1171
1172 # Append qemuparams to override previous settings
1173 if self.qemuparams:
1174 self.qemu_opt += ' ' + self.qemuparams
1175
1167 if self.snapshot: 1176 if self.snapshot:
1168 self.qemu_opt += " -snapshot" 1177 self.qemu_opt += " -snapshot"
1169 1178