summaryrefslogtreecommitdiffstats
path: root/scripts
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-25 22:27:40 +0000
commita0f99f3bcfb317b687389b4d39c49ad6ccd4e723 (patch)
treedb6cb29747d56281a0187194ddc6e57f31c7d0fc /scripts
parent18f000c708187a18945b18352d735243a392fb0c (diff)
downloadpoky-a0f99f3bcfb317b687389b4d39c49ad6ccd4e723.tar.gz
poky-a0f99f3bcfb317b687389b4d39c49ad6ccd4e723.tar.bz2
poky-a0f99f3bcfb317b687389b4d39c49ad6ccd4e723.zip
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) (From OE-Core rev: ed10ef4f8deaec739ce3713b6ce3b63e134a8c4a) 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/runqemu11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 52505719c9..1c96b29a40 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -674,6 +674,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'