[oe-commits] [openembedded-core] 08/11: runqemu: Make QB_MEM easier to set

git at git.openembedded.org git at git.openembedded.org
Fri Feb 15 08:21:11 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 52ecae7bfed6071af6be8ef355031ab9b0c02518
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Fri Feb 15 16:14:52 2019 +0800

    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]
    
    Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/runqemu | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/scripts/runqemu b/scripts/runqemu
index 26fefb0..ec6188b 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -669,6 +669,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'

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list