diff options
| -rw-r--r-- | meta/lib/oe/image.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py index 9580562580..f0843de928 100644 --- a/meta/lib/oe/image.py +++ b/meta/lib/oe/image.py | |||
| @@ -335,13 +335,17 @@ class Image(ImageDepGraph): | |||
| 335 | Write environment variables used by wic | 335 | Write environment variables used by wic |
| 336 | to tmp/sysroots/<machine>/imgdata/<image>.env | 336 | to tmp/sysroots/<machine>/imgdata/<image>.env |
| 337 | """ | 337 | """ |
| 338 | wicvars = self.d.getVar('WICVARS', True) | ||
| 339 | if not wicvars: | ||
| 340 | return | ||
| 341 | |||
| 338 | stdir = self.d.getVar('STAGING_DIR_TARGET', True) | 342 | stdir = self.d.getVar('STAGING_DIR_TARGET', True) |
| 339 | outdir = os.path.join(stdir, 'imgdata') | 343 | outdir = os.path.join(stdir, 'imgdata') |
| 340 | if not os.path.exists(outdir): | 344 | if not os.path.exists(outdir): |
| 341 | os.makedirs(outdir) | 345 | os.makedirs(outdir) |
| 342 | basename = self.d.getVar('IMAGE_BASENAME', True) | 346 | basename = self.d.getVar('IMAGE_BASENAME', True) |
| 343 | with open(os.path.join(outdir, basename) + '.env', 'w') as envf: | 347 | with open(os.path.join(outdir, basename) + '.env', 'w') as envf: |
| 344 | for var in self.d.getVar('WICVARS', True).split(): | 348 | for var in wicvars.split(): |
| 345 | value = self.d.getVar(var, True) | 349 | value = self.d.getVar(var, True) |
| 346 | if value: | 350 | if value: |
| 347 | envf.write('%s="%s"\n' % (var, value.strip())) | 351 | envf.write('%s="%s"\n' % (var, value.strip())) |
