diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-01-26 13:52:24 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-31 14:38:32 +0000 |
commit | 02dafba6ed8ebc718a4f513455fc034444543301 (patch) | |
tree | 0893fcb932e1a2a4d27d1c2b6bf80f79a3a369d7 /meta/classes/image.bbclass | |
parent | de23b7bb2f53149c9778fde55e5b3c710c51932d (diff) | |
download | poky-02dafba6ed8ebc718a4f513455fc034444543301.tar.gz |
image-wic: move wic code to image-wic.bbclass
There is a lot of wic code in image.bbclass and image_types.bbclass
Having all code separated in one file should make it more readable
and easier to maintain.
(From OE-Core rev: 786368568a9525212e69f5cbf6da236f0a6be013)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r-- | meta/classes/image.bbclass | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index e20e447680..613cd92600 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
@@ -187,6 +187,8 @@ python () { | |||
187 | IMAGE_CLASSES += "image_types" | 187 | IMAGE_CLASSES += "image_types" |
188 | inherit ${IMAGE_CLASSES} | 188 | inherit ${IMAGE_CLASSES} |
189 | 189 | ||
190 | inherit image-wic | ||
191 | |||
190 | IMAGE_POSTPROCESS_COMMAND ?= "" | 192 | IMAGE_POSTPROCESS_COMMAND ?= "" |
191 | 193 | ||
192 | # some default locales | 194 | # some default locales |
@@ -327,29 +329,6 @@ fakeroot python do_image_qa () { | |||
327 | } | 329 | } |
328 | addtask do_image_qa after do_image_complete before do_build | 330 | addtask do_image_qa after do_image_complete before do_build |
329 | 331 | ||
330 | # | ||
331 | # Write environment variables used by wic | ||
332 | # to tmp/sysroots/<machine>/imgdata/<image>.env | ||
333 | # | ||
334 | python do_rootfs_wicenv () { | ||
335 | wicvars = d.getVar('WICVARS') | ||
336 | if not wicvars: | ||
337 | return | ||
338 | |||
339 | stdir = d.getVar('STAGING_DIR') | ||
340 | outdir = os.path.join(stdir, d.getVar('MACHINE'), 'imgdata') | ||
341 | bb.utils.mkdirhier(outdir) | ||
342 | basename = d.getVar('IMAGE_BASENAME') | ||
343 | with open(os.path.join(outdir, basename) + '.env', 'w') as envf: | ||
344 | for var in wicvars.split(): | ||
345 | value = d.getVar(var) | ||
346 | if value: | ||
347 | envf.write('%s="%s"\n' % (var, value.strip())) | ||
348 | } | ||
349 | addtask do_rootfs_wicenv after do_image before do_image_wic | ||
350 | do_rootfs_wicenv[vardeps] += "${WICVARS}" | ||
351 | do_rootfs_wicenv[prefuncs] = 'set_image_size' | ||
352 | |||
353 | def setup_debugfs_variables(d): | 332 | def setup_debugfs_variables(d): |
354 | d.appendVar('IMAGE_ROOTFS', '-dbg') | 333 | d.appendVar('IMAGE_ROOTFS', '-dbg') |
355 | d.appendVar('IMAGE_LINK_NAME', '-dbg') | 334 | d.appendVar('IMAGE_LINK_NAME', '-dbg') |