All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] image: Fix wic environment issues
Date: Sat, 16 Jan 2016 10:32:44 +0000	[thread overview]
Message-ID: <1452940364.27999.8.camel@linuxfoundation.org> (raw)

The wic environment function needs to run after the rootfs size is
setup. This fixes:

======================================================================
FAIL: test_image_env (oeqa.selftest.wic.Wic)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/decorators.py", line 106, in wrapped_f
    return func(*args, **kwargs)
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/wic.py", line 218, in test_image_env
    self.assertTrue(var in content, "%s is not in .env file" % var)
AssertionError: False is not true : ROOTFS_SIZE is not in .env file

Ultimately this code can move to the main wic image task but this 
fixes things for now.

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

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index cc8a23c..8ff157a 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -242,8 +242,6 @@ fakeroot python do_image () {
     pre_process_cmds = d.getVar("IMAGE_PREPROCESS_COMMAND", True)
 
     execute_pre_post_process(d, pre_process_cmds)
-
-    write_wic_env(d)
 }
 do_image[dirs] = "${TOPDIR}"
 do_image[umask] = "022"
@@ -264,7 +262,7 @@ addtask do_image_complete after do_image before do_build
 # Write environment variables used by wic
 # to tmp/sysroots/<machine>/imgdata/<image>.env
 #
-def write_wic_env(d):
+python write_wic_env () {
     wicvars = d.getVar('WICVARS', True)
     if not wicvars:
         return
@@ -278,6 +276,7 @@ def write_wic_env(d):
             value = d.getVar(var, True)
             if value:
                 envf.write('%s="%s"\n' % (var, value.strip()))
+}
 
 def setup_debugfs_variables(d):
     d.appendVar('IMAGE_ROOTFS', '-dbg')
@@ -393,6 +392,9 @@ python () {
         d.setVarFlag('do_image_%s' % t, 'subimages', subimages)
         d.appendVarFlag('do_image_%s' % t, 'vardeps', ' '.join(vardeps))
 
+        if realt == "wic":
+            d.appendVarFlag('do_image_%s' % t, 'prefuncs', ' write_wic_env')
+
         after = 'do_image'
         for dep in typedeps[t]:
             after += ' do_image_%s' % dep




             reply	other threads:[~2016-01-16 10:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-16 10:32 Richard Purdie [this message]
2016-01-17 11:30 ` [PATCH v2] image: Fix wic environment issues Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452940364.27999.8.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.