]> code.ossystems Code Review - openembedded-core.git/commitdiff
runqemu: Improve relative path handling in qemuconf files
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Nov 2017 11:37:39 +0000 (11:37 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Nov 2017 13:10:12 +0000 (13:10 +0000)
If a variable starts with "../", its likely its a path and we want to
set it to an absolute path relative to the qemuconf file.

This means we don't have to use bitbake as often to figure out variables.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/runqemu

index ad88da38df9a3ed3c9c15c01cb5e396d5c4fc11f..b09cf1ceb890b3a427c6272d88ec35f16a15bb88 100755 (executable)
@@ -726,6 +726,8 @@ class BaseConfig(object):
         cf.read(self.qemuboot)
         for k, v in cf.items('config_bsp'):
             k_upper = k.upper()
+            if v.startswith("../"):
+                v = os.path.abspath(os.path.dirname(self.qemuboot) + "/" + v)
             self.set(k_upper, v)
 
     def validate_paths(self):