[gnome-continuous-yocto/gnomeostree-3.28-rocko: 5653/8267] runqemu: add bindir_native property
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 5653/8267] runqemu: add bindir_native property
- Date: Sun, 17 Dec 2017 03:44:30 +0000 (UTC)
commit 4d3bececf617dca82b5043781d63229427c734db
Author: Ed Bartosh <ed bartosh linux intel com>
Date: Wed Apr 12 23:40:58 2017 +0300
runqemu: add bindir_native property
Isolated logic of getting path to native bin directory in
new bindir_native property method.
This property is going to be used to obtain location of
qemu-sytem and tunctl.
(From OE-Core rev: 26e97f7ebb7e3302e3d3c6646fb58baf395d62be)
Signed-off-by: Ed Bartosh <ed bartosh linux intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
scripts/runqemu | 37 ++++++++++++++++++++++++-------------
1 files changed, 24 insertions(+), 13 deletions(-)
---
diff --git a/scripts/runqemu b/scripts/runqemu
index a8bb9eb..6cdedd8 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -721,7 +721,7 @@ class BaseConfig(object):
self.load_bitbake_env()
if self.bitbake_e:
- native_vars = ['STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE']
+ native_vars = ['STAGING_DIR_NATIVE']
for nv in native_vars:
s = re.search('^%s="(.*)"' % nv, self.bitbake_e, re.M)
if s and s.group(1) != self.get(nv):
@@ -1056,18 +1056,7 @@ class BaseConfig(object):
if not qemu_system:
raise Exception("Failed to boot, QB_SYSTEM_NAME is NULL!")
- cmd = 'bitbake qemu-helper-native -e'
- logger.info('Running %s...' % cmd)
- out = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
- out = out.stdout.read().decode('utf-8')
-
- match = re.search('^STAGING_BINDIR_NATIVE="(.*)"', out, re.M)
- if match:
- bindir_native = match.group(1)
- else:
- raise Exception("Can't find STAGING_BINDIR_NATIVE in '%s' output" % cmd)
-
- qemu_bin = '%s/%s' % (bindir_native, qemu_system)
+ qemu_bin = '%s/%s' % (self.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.
@@ -1196,6 +1185,28 @@ class BaseConfig(object):
self.bitbake_e = ''
logger.warn("Couldn't run 'bitbake -e' to gather environment information:\n%s" %
err.output.decode('utf-8'))
+ @property
+ def bindir_native(self):
+ result = self.get('STAGING_BINDIR_NATIVE')
+ if result and os.path.exists(result):
+ return result
+
+ cmd = 'bitbake qemu-helper-native -e'
+ logger.info('Running %s...' % cmd)
+ out = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
+ out = out.stdout.read().decode('utf-8')
+
+ match = re.search('^STAGING_BINDIR_NATIVE="(.*)"', out, re.M)
+ if match:
+ result = match.group(1)
+ if os.path.exists(result):
+ self.set('STAGING_BINDIR_NATIVE', result)
+ return result
+ raise Exception("Native sysroot directory %s doesn't exist" % result)
+ else:
+ raise Exception("Can't find STAGING_BINDIR_NATIVE in '%s' output" % cmd)
+
+
def main():
if "help" in sys.argv or '-h' in sys.argv or '--help' in sys.argv:
print_usage()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]