[oe-commits] [openembedded-core] 18/56: wic: Add post operation hook for SourcePlugin

git at git.openembedded.org git at git.openembedded.org
Sat Mar 3 09:13:43 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 3b59948b115f85519424b0081cdbd53996e42741
Author: Parthiban Nallathambi <pn at denx.de>
AuthorDate: Tue Feb 20 16:49:27 2018 +0100

    wic: Add post operation hook for SourcePlugin
    
    do_post_partition hook is needed if some operations like security signing
    the parition needs to be done. source plugins can make use of this to implement
    post operatiosn in do_post_partition. do_post_partition is called after
    do_prepare_partition if present.
    
    Signed-off-by: Parthiban Nallathambi <pn at denx.de>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 scripts/lib/wic/help.py       |  4 ++++
 scripts/lib/wic/partition.py  |  3 +++
 scripts/lib/wic/pluginbase.py | 10 ++++++++++
 3 files changed, 17 insertions(+)

diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
index bf658b9..842b868 100644
--- a/scripts/lib/wic/help.py
+++ b/scripts/lib/wic/help.py
@@ -576,6 +576,10 @@ DESCRIPTION
           partition. In other words, it 'prepares' the final partition
           image which will be incorporated into the disk image.
 
+      do_post_partition()
+          Called after the partition is created. It is useful to add post
+          operations e.g. signing the partition.
+
       do_configure_partition()
           Called before do_prepare_partition(), typically used to
           create custom configuration files for a partition, for
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 72f2e27..d455862 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -185,6 +185,9 @@ class Partition():
         plugin.do_prepare_partition(self, srcparams_dict, creator,
                                     cr_workdir, oe_builddir, bootimg_dir,
                                     kernel_dir, rootfs_dir, native_sysroot)
+        plugin.do_post_partition(self, srcparams_dict, creator,
+                                    cr_workdir, oe_builddir, bootimg_dir,
+                                    kernel_dir, rootfs_dir, native_sysroot)
 
         # further processing required Partition.size to be an integer, make
         # sure that it is one
diff --git a/scripts/lib/wic/pluginbase.py b/scripts/lib/wic/pluginbase.py
index c009820..686d2fe 100644
--- a/scripts/lib/wic/pluginbase.py
+++ b/scripts/lib/wic/pluginbase.py
@@ -137,3 +137,13 @@ class SourcePlugin(metaclass=PluginMeta):
         'prepares' the partition to be incorporated into the image.
         """
         logger.debug("SourcePlugin: do_prepare_partition: part: %s", part)
+
+    @classmethod
+    def do_post_partition(cls, part, source_params, creator, cr_workdir,
+                             oe_builddir, bootimg_dir, kernel_dir, rootfs_dir,
+                             native_sysroot):
+        """
+        Called after the partition is created. It is useful to add post
+        operations e.g. security signing the partition.
+        """
+        logger.debug("SourcePlugin: do_post_partition: part: %s", part)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list