<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 5 September 2016 at 15:47, Robert Yang <span dir="ltr"><<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Hi Josh,<br>
<br>
Thanks for fixing this, I got errors when test this patch:<br>
<br>
$ runqemu tmp/deploy/images/qemux86/<br>
runqemu - INFO - Running bitbake -e...<br>
Traceback (most recent call last):<br>
File "/buildarea/lyang1/poky/script<wbr>s/runqemu", line 864, in <module><br>
ret = main()<br>
File "/buildarea/lyang1/poky/script<wbr>s/runqemu", line 851, in main<br>
config.read_qemuboot()<br>
File "/buildarea/lyang1/poky/script<wbr>s/runqemu", line 536, in read_qemuboot<br>
self.qemuboot = qbs.split[0]<br>
AttributeError: 'list' object has no attribute 'split'<br></blockquote><div><br></div><div>Thanks for reviewing and catching this.<br></div><div> </div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
And after your patches, it always need run "bitbake -e", this makes<br>
us can't use runqemu when another build is running:<br>
ERROR: Only one copy of bitbake should be run against a build directory<br>
<br>
Maybe we check STAGING_DIR_NATIVE, STAGING_BINDIR_NATIVE<br>
and STAGING_DIR_HOST, if they are existed, then we don't need run bitbake -e.<br></blockquote><div><br></div><div>That's a nice idea, I'll implement that for v2 of the series.<br></div><div> </div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
And please see my comments below.<div><div><br>
<br>
On 09/05/2016 09:59 PM, Joshua Lock wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
When we're running from a sourced OE build directory parse the<br>
STAGING_* directories from the bitbake environment, rather than<br>
using those hard-coded in the conf file.<br>
<br>
Signed-off-by: Joshua Lock <<a href="mailto:joshua.g.lock@intel.com" target="_blank">joshua.g.lock@intel.com</a>><br>
---<br>
scripts/runqemu | 22 ++++++++++++++++++++++<br>
1 file changed, 22 insertions(+)<br>
<br>
diff --git a/scripts/runqemu b/scripts/runqemu<br>
index cfe7bff..5a97802 100755<br>
--- a/scripts/runqemu<br>
+++ b/scripts/runqemu<br>
@@ -555,6 +555,16 @@ class BaseConfig(object):<br>
<a rel="noreferrer" href="http://logger.info" target="_blank">logger.info</a>('Setting DEPLOY_DIR_IMAGE to folder containing %s (%s)' % (self.qemuboot, imgdir))<br>
self.set('DEPLOY_DIR_IMAGE', imgdir)<br>
<br>
+ # When we're running from a sourced OE environment use the STAGING_*<br>
+ # directories from the environment.<br>
+ if self.bitbake_e:<br>
+ native_vars = ['STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE']<br>
+ for nv in native_vars:<br>
+ s = re.search('^%s="(.*)"' % nv, self.bitbake_e, re.M)<br>
+ if s and s.group(1) != self.get(nv):<br>
+ <a rel="noreferrer" href="http://logger.info" target="_blank">logger.info</a>('Overriding conf file setting of %s to %s from Bitbake environment' % (nv, s.group(1)))<br>
+ self.set(nv, s.group(1))<br>
+<br>
def print_config(self):<br>
<a rel="noreferrer" href="http://logger.info" target="_blank">logger.info</a>('Continuing with the following parameters:\n')<br>
if not self.fstype in self.vmtypes:<br>
@@ -815,6 +825,17 @@ class BaseConfig(object):<br>
shutil.rmtree(self.nfs_dir)<br>
shutil.rmtree('%s.pseudo_stat<wbr>e' % self.nfs_dir)<br>
<br>
+ def check_sourced_env(self):<br>
+ bitbake = shutil.which('bitbake')<br>
+ if bitbake and not self.bitbake_e:<br>
+ mach = self.get('MACHINE')<br>
+ if mach:<br>
+ cmd = 'MACHINE=%s bitbake -e' % mach<br>
+ else:<br>
+ cmd = 'bitbake -e'<br>
+ <a rel="noreferrer" href="http://logger.info" target="_blank">logger.info</a>('Running %s...' % cmd)<br>
+ self.bitbake_e = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout<wbr>.read().decode('utf-8')<br>
</blockquote>
<br></div></div>
I think that we need check whether the command is successed<br>
or not, and print errors if it is failed to run.<span><font color="#888888"><br></font></span></blockquote><div><br></div><div>Sure, I'll implement that.<br><br></div><div>Joshua <<a href="mailto:joshua.g.lock@intel.com">joshua.g.lock@intel.com</a>><br></div></div><br></div></div>