summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2019-02-15 16:14:52 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-15 16:05:37 +0000
commitcc283a9028f69dc29f3e28a21be96107be52827b (patch)
tree4c4ba2d29465885fcfc4bd59f67d64dd7aeb3214
parentad522ea6a64ebc17f723a7580e3ac23e02575e77 (diff)
downloadpoky-cc283a9028f69dc29f3e28a21be96107be52827b.tar.gz
runqemu: Make QB_MEM easier to set
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] (From OE-Core rev: ad246f5ce0652bd917d85884176baa746e1379ff) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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):
679 logger.info('QB_MEM is not set, use 512M by default') 679 logger.info('QB_MEM is not set, use 512M by default')
680 self.set('QB_MEM', '-m 512') 680 self.set('QB_MEM', '-m 512')
681 681
682 # Check and remove M or m suffix
683 qb_mem = self.get('QB_MEM')
684 if qb_mem.endswith('M') or qb_mem.endswith('m'):
685 qb_mem = qb_mem[:-1]
686
687 # Add -m prefix it not present
688 if not qb_mem.startswith('-m'):
689 qb_mem = '-m %s' % qb_mem
690
691 self.set('QB_MEM', qb_mem)
692
682 mach = self.get('MACHINE') 693 mach = self.get('MACHINE')
683 if not mach.startswith('qemumips'): 694 if not mach.startswith('qemumips'):
684 self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M' 695 self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'