summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDiego Sueiro <diego.sueiro@arm.com>2020-12-08 11:42:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-15 22:51:56 +0000
commit75b74f6b8d8eb69dd5e15e71243dea5c34ab36c9 (patch)
tree22ec7a400e672f9c598e4021d730a4f13c63c5e3 /scripts
parent3cc6465464574ccf6308d0ba6b8b90cb64de1937 (diff)
downloadpoky-75b74f6b8d8eb69dd5e15e71243dea5c34ab36c9.tar.gz
wic: Introduce empty plugin to create unformatted empty partitions
The empty wic plugin is used to create unformatted empty partitions for wic images. To use it you must pass "empty" as argument for the "--source" parameter in the wks file. For example: part foo --source empty --ondisk sda --size="1024" --align 1024 Also adds a selftest for this plugin where the 'Fstype' column from 'wic ls' should be empty for the second partition as listed in test_empty_plugin.wks. (From OE-Core rev: 77d174fc80663403ef76c5b808aafc1117d3545c) Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/plugins/source/empty.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/lib/wic/plugins/source/empty.py b/scripts/lib/wic/plugins/source/empty.py
new file mode 100644
index 0000000000..041617d648
--- /dev/null
+++ b/scripts/lib/wic/plugins/source/empty.py
@@ -0,0 +1,32 @@
1#
2# SPDX-License-Identifier: MIT
3#
4
5# The empty wic plugin is used to create unformatted empty partitions for wic
6# images.
7# To use it you must pass "empty" as argument for the "--source" parameter in
8# the wks file. For example:
9# part foo --source empty --ondisk sda --size="1024" --align 1024
10
11import logging
12
13from wic.pluginbase import SourcePlugin
14
15logger = logging.getLogger('wic')
16
17class EmptyPartitionPlugin(SourcePlugin):
18 """
19 Populate unformatted empty partition.
20 """
21
22 name = 'empty'
23
24 @classmethod
25 def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
26 oe_builddir, bootimg_dir, kernel_dir,
27 rootfs_dir, native_sysroot):
28 """
29 Called to do the actual content population for a partition i.e. it
30 'prepares' the partition to be incorporated into the image.
31 """
32 return