]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: Add post operation hook for SourcePlugin
authorParthiban Nallathambi <pn@denx.de>
Tue, 20 Feb 2018 15:49:27 +0000 (16:49 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 3 Mar 2018 17:08:29 +0000 (17:08 +0000)
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@denx.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/wic/help.py
scripts/lib/wic/partition.py
scripts/lib/wic/pluginbase.py

index bf658b94e34fd9136820387c90a8402a6a2d9d66..842b868a575ab74f126293870377fe526a027cc0 100644 (file)
@@ -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
index 72f2e2708f5e7db5eb995c20c8eda45cabed8152..d4558621a958881f287279af20427293a3846553 100644 (file)
@@ -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
index c009820adccd665a5d63edb7f94a33aa4762ea08..686d2fee3b3acf65aeb2f2aec720d63a14a42e43 100644 (file)
@@ -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)