summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorParthiban Nallathambi <pn@denx.de>2018-02-20 16:49:27 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-04 11:35:40 +0000
commit8eb7e66246cf7c72dc68862f1c287029080a2e8a (patch)
treea3ee613773e6401274372ebf2dc0e39fcd64e85c /scripts
parent088b3b8c4c041caa73bdcfc2e897bd1d0f4f679b (diff)
downloadpoky-8eb7e66246cf7c72dc68862f1c287029080a2e8a.tar.gz
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. (From OE-Core rev: 5055489b9ab3fda32a285d0d165d080d11a4d432) Signed-off-by: Parthiban Nallathambi <pn@denx.de> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/help.py4
-rw-r--r--scripts/lib/wic/partition.py3
-rw-r--r--scripts/lib/wic/pluginbase.py10
3 files changed, 17 insertions, 0 deletions
diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
index bf658b94e3..842b868a57 100644
--- a/scripts/lib/wic/help.py
+++ b/scripts/lib/wic/help.py
@@ -576,6 +576,10 @@ DESCRIPTION
576 partition. In other words, it 'prepares' the final partition 576 partition. In other words, it 'prepares' the final partition
577 image which will be incorporated into the disk image. 577 image which will be incorporated into the disk image.
578 578
579 do_post_partition()
580 Called after the partition is created. It is useful to add post
581 operations e.g. signing the partition.
582
579 do_configure_partition() 583 do_configure_partition()
580 Called before do_prepare_partition(), typically used to 584 Called before do_prepare_partition(), typically used to
581 create custom configuration files for a partition, for 585 create custom configuration files for a partition, for
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 72f2e2708f..d4558621a9 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -185,6 +185,9 @@ class Partition():
185 plugin.do_prepare_partition(self, srcparams_dict, creator, 185 plugin.do_prepare_partition(self, srcparams_dict, creator,
186 cr_workdir, oe_builddir, bootimg_dir, 186 cr_workdir, oe_builddir, bootimg_dir,
187 kernel_dir, rootfs_dir, native_sysroot) 187 kernel_dir, rootfs_dir, native_sysroot)
188 plugin.do_post_partition(self, srcparams_dict, creator,
189 cr_workdir, oe_builddir, bootimg_dir,
190 kernel_dir, rootfs_dir, native_sysroot)
188 191
189 # further processing required Partition.size to be an integer, make 192 # further processing required Partition.size to be an integer, make
190 # sure that it is one 193 # sure that it is one
diff --git a/scripts/lib/wic/pluginbase.py b/scripts/lib/wic/pluginbase.py
index c009820adc..686d2fee3b 100644
--- a/scripts/lib/wic/pluginbase.py
+++ b/scripts/lib/wic/pluginbase.py
@@ -137,3 +137,13 @@ class SourcePlugin(metaclass=PluginMeta):
137 'prepares' the partition to be incorporated into the image. 137 'prepares' the partition to be incorporated into the image.
138 """ 138 """
139 logger.debug("SourcePlugin: do_prepare_partition: part: %s", part) 139 logger.debug("SourcePlugin: do_prepare_partition: part: %s", part)
140
141 @classmethod
142 def do_post_partition(cls, part, source_params, creator, cr_workdir,
143 oe_builddir, bootimg_dir, kernel_dir, rootfs_dir,
144 native_sysroot):
145 """
146 Called after the partition is created. It is useful to add post
147 operations e.g. security signing the partition.
148 """
149 logger.debug("SourcePlugin: do_post_partition: part: %s", part)