public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH 2/4] image: Move pre/post process commands to bbclass
Date: Wed, 06 Jan 2016 22:57:40 +0000	[thread overview]
Message-ID: <1452121060.7598.96.camel@linuxfoundation.org> (raw)

As the next step in splitting up do_image, move the pre and post processing
commands to separate tasks. This also creates the do_image_complete task
which acts as the end marker task for image generation.

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

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 77a8548..60c2c60 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -252,14 +252,35 @@ addtask rootfs before do_build
 
 fakeroot python do_image () {
     from oe.image import create_image
+    from oe.image import Image
+    from oe.utils import execute_pre_post_process
 
-    # generate final images
-    create_image(d)
+    i = Image(d)
+
+    pre_process_cmds = d.getVar("IMAGE_PREPROCESS_COMMAND", True)
+
+    execute_pre_post_process(d, pre_process_cmds)
+
+    i._remove_old_symlinks()
+
+    i.create()
 }
 do_image[dirs] = "${TOPDIR}"
 do_image[umask] = "022"
 addtask do_image after do_rootfs before do_build
 
+fakeroot python do_image_complete () {
+    from oe.utils import execute_pre_post_process
+
+    post_process_cmds = d.getVar("IMAGE_POSTPROCESS_COMMAND", True)
+
+    execute_pre_post_process(d, post_process_cmds)
+}
+do_image_complete[dirs] = "${TOPDIR}"
+do_image_complete[umask] = "022"
+addtask do_image_complete after do_image before do_build
+
+
 MULTILIBRE_ALLOW_REP =. "${base_bindir}|${base_sbindir}|${bindir}|${sbindir}|${libexecdir}|${sysconfdir}|${nonarch_base_libdir}/udev|/lib/modules/[^/]*/modules.*|"
 MULTILIB_CHECK_FILE = "${WORKDIR}/multilib_check.py"
 MULTILIB_TEMP_ROOTFS = "${WORKDIR}/multilib"
diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py
index 52ac1e75..b2b002b 100644
--- a/meta/lib/oe/image.py
+++ b/meta/lib/oe/image.py
@@ -351,12 +351,6 @@ class Image(ImageDepGraph):
 
     def create(self):
         bb.note("###### Generate images #######")
-        pre_process_cmds = self.d.getVar("IMAGE_PREPROCESS_COMMAND", True)
-        post_process_cmds = self.d.getVar("IMAGE_POSTPROCESS_COMMAND", True)
-
-        execute_pre_post_process(self.d, pre_process_cmds)
-
-        self._remove_old_symlinks()
 
         image_cmd_groups = self._get_imagecmds()
 
@@ -406,9 +400,6 @@ class Image(ImageDepGraph):
                     bb.note("Creating symlinks for %s image ..." % image_type)
                     self._create_symlinks(subimages)
 
-        execute_pre_post_process(self.d, post_process_cmds)
-
-
 def create_image(d):
     Image(d).create()
 




                 reply	other threads:[~2016-01-06 22:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1452121060.7598.96.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox