summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2019-02-15 15:54:50 +0800
committerRobert Yang <liezhi.yang@windriver.com>2019-02-15 16:00:17 +0800
commit2a17f8cd911f6eb9da079bcb17e2a2c789844782 (patch)
tree555f903caaf77e4fead50b987da4f1209a396b90
parent2b9d87d41667d287d9775ee45eb1d9a9a07c4328 (diff)
downloadopenembedded-core-contrib-rbt/qemu.tar.gz
openembedded-core-contrib-rbt/qemu.tar.bz2
openembedded-core-contrib-rbt/qemu.zip
runqemu: Make QB_MEM easier to setrbt/qemu
It only could be set as the following in the past: QB_MEM = "-m 256" Now it also can be set as: QB_MEM = "-m 256M (or m)" QB_MEM = "256M (or m)" [YOCTO #11522] Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-rwxr-xr-xscripts/runqemu11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 10f61e4c7f..d171c4f894 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -679,6 +679,17 @@ class BaseConfig(object):
logger.info('QB_MEM is not set, use 512M by default')
self.set('QB_MEM', '-m 512')
+ # Check and remove M or m suffix
+ qb_mem = self.get('QB_MEM')
+ if qb_mem.endswith('M') or qb_mem.endswith('m'):
+ qb_mem = qb_mem[:-1]
+
+ # Add -m prefix it not present
+ if not qb_mem.startswith('-m'):
+ qb_mem = '-m %s' % qb_mem
+
+ self.set('QB_MEM', qb_mem)
+
mach = self.get('MACHINE')
if not mach.startswith('qemumips'):
self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'