Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix runqemu problem when 'rm_work' is enabled
@ 2017-04-07  8:05 Chen Qi
  2017-04-07  8:05 ` [PATCH 1/2] qemuboot.bbclass: add two vars for use by runqemu Chen Qi
  2017-04-07  8:05 ` [PATCH 2/2] runqemu: make use of two new vars Chen Qi
  0 siblings, 2 replies; 3+ messages in thread
From: Chen Qi @ 2017-04-07  8:05 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 633ad6c9f436f5d2b6ee1a005b697661a054a394:

  oeqa/runtime/utils/targetbuildproject: use parent classes defaults tmpdir (2017-04-06 10:13:39 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib ChenQi/runqemu_rm_work
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/runqemu_rm_work

Chen Qi (2):
  qemuboot.bbclass: add two vars for use by runqemu
  runqemu: make use of two new vars

 meta/classes/qemuboot.bbclass |  5 ++++-
 scripts/runqemu               | 10 ++++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] qemuboot.bbclass: add two vars for use by runqemu
  2017-04-07  8:05 [PATCH 0/2] Fix runqemu problem when 'rm_work' is enabled Chen Qi
@ 2017-04-07  8:05 ` Chen Qi
  2017-04-07  8:05 ` [PATCH 2/2] runqemu: make use of two new vars Chen Qi
  1 sibling, 0 replies; 3+ messages in thread
From: Chen Qi @ 2017-04-07  8:05 UTC (permalink / raw)
  To: openembedded-core

Add STAGING_DIR_TUNCTL_NATIVE and STAGING_DIR_QEMU_BINDIR_NATIVE so that
runqemu could find 'tunctl' and 'qemu-xxx' binaries to run correctly.

[YOCTO #11266]
[YOCTO #11193]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes/qemuboot.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass
index 3ca97ca..bd2102b 100644
--- a/meta/classes/qemuboot.bbclass
+++ b/meta/classes/qemuboot.bbclass
@@ -67,12 +67,15 @@ QB_NETWORK_DEVICE ?= "-device virtio-net-pci,netdev=net0,mac=@MAC@"
 # Create qemuboot.conf
 addtask do_write_qemuboot_conf after do_rootfs before do_image
 IMGDEPLOYDIR ?= "${WORKDIR}/deploy-${PN}-image-complete"
+STAGING_DIR_TUNCTL_NATIVE = "${STAGING_DIR}-components/${BUILD_ARCH}/qemu-helper-native"
+STAGING_DIR_QEMU_BINDIR_NATIVE = "${STAGING_DIR}-components/${BUILD_ARCH}/qemu-native/usr/bin"
 
 def qemuboot_vars(d):
     build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE',
                 'KERNEL_IMAGETYPE', 'IMAGE_NAME', 'IMAGE_LINK_NAME',
                 'STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE',
-                'STAGING_DIR_HOST']
+                'STAGING_DIR_HOST', 'STAGING_DIR_TUNCTL_NATIVE',
+                'STAGING_DIR_QEMU_BINDIR_NATIVE']
     return build_vars + [k for k in d.keys() if k.startswith('QB_')]
 
 do_write_qemuboot_conf[vardeps] += "${@' '.join(qemuboot_vars(d))}"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] runqemu: make use of two new vars
  2017-04-07  8:05 [PATCH 0/2] Fix runqemu problem when 'rm_work' is enabled Chen Qi
  2017-04-07  8:05 ` [PATCH 1/2] qemuboot.bbclass: add two vars for use by runqemu Chen Qi
@ 2017-04-07  8:05 ` Chen Qi
  1 sibling, 0 replies; 3+ messages in thread
From: Chen Qi @ 2017-04-07  8:05 UTC (permalink / raw)
  To: openembedded-core

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@windriver.com>
---
 scripts/runqemu | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index 23c9efb..cde9ae5 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -908,7 +908,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'
@@ -1041,7 +1044,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.
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-07  8:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-07  8:05 [PATCH 0/2] Fix runqemu problem when 'rm_work' is enabled Chen Qi
2017-04-07  8:05 ` [PATCH 1/2] qemuboot.bbclass: add two vars for use by runqemu Chen Qi
2017-04-07  8:05 ` [PATCH 2/2] runqemu: make use of two new vars Chen Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox