[OE-core] [PATCH 8/8] runqemu: make use of two new vars

Robert Yang liezhi.yang at windriver.com
Fri Apr 7 09:47:15 UTC 2017


From: Chen Qi <Qi.Chen at windriver.com>

Make use of STAGING_DIR_TUNCTL_NATIVE and STAGING_DIR_QEMU_BINDIR_NATIVE
to run correctly. In this way, runqemu would still work when 'rm_work'
is enabled.

[YOCTO #11266]
[YOCTO #11193]

Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
---
 scripts/runqemu | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index 5b5d56b9ef..e741dfe05d 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -920,7 +920,10 @@ class BaseConfig(object):
             gid = os.getgid()
             uid = os.getuid()
             logger.info("Setting up tap interface under sudo")
-            cmd = 'sudo %s %s %s %s' % (self.qemuifup, uid, gid, self.get('STAGING_DIR_NATIVE'))
+            if os.path.exists(self.get('STAGING_DIR_TUNCTL_NATIVE')):
+                cmd = 'sudo %s %s %s %s' % (self.qemuifup, uid, gid, self.get('STAGING_DIR_TUNCTL_NATIVE'))
+            else:
+                cmd = 'sudo %s %s %s %s' % (self.qemuifup, uid, gid, self.get('STAGING_DIR_NATIVE'))
             tap = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8').rstrip('\n')
             lockfile = os.path.join(lockdir, tap)
             self.lock = lockfile + '.lock'
@@ -1056,7 +1059,10 @@ class BaseConfig(object):
         if not qemu_system:
             raise Exception("Failed to boot, QB_SYSTEM_NAME is NULL!")
 
-        qemu_bin = '%s/%s' % (self.get('STAGING_BINDIR_NATIVE'), qemu_system)
+        if os.path.exists(self.get('STAGING_DIR_QEMU_BINDIR_NATIVE')):
+            qemu_bin = '%s/%s' % (self.get('STAGING_DIR_QEMU_BINDIR_NATIVE'), qemu_system)
+        else:
+            qemu_bin = '%s/%s' % (self.get('STAGING_BINDIR_NATIVE'), qemu_system)
 
         # It is possible to have qemu-native in ASSUME_PROVIDED, and it won't
         # find QEMU in sysroot, it needs to use host's qemu.
-- 
2.11.0.rc2.dirty




More information about the Openembedded-core mailing list