Fix runqemu problem when 'rm_work' is enabled
cover Fix runqemu problem when 'rm_work' is enabled
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(-)
Signature · 1 line
1.9.1
PATCH 1/2 qemuboot.bbclass: add two vars for use by runqemu
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]
--- meta/classes/qemuboot.bbclass | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
meta/classes/qemuboot.bbclass +4 -1
@@ -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))}"
Signature · 1 line
1.9.1
PATCH 2/2 runqemu: make use of two new vars
In reply to Chen QiMake 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]
--- scripts/runqemu | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
scripts/runqemu +8 -2
@@ -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.
Signature · 1 line
1.9.1