xref: /OK3568_Linux_fs/yocto/poky/scripts/lib/wic/plugins/source/empty.py (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun#
2*4882a593Smuzhiyun# SPDX-License-Identifier: MIT
3*4882a593Smuzhiyun#
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun# The empty wic plugin is used to create unformatted empty partitions for wic
6*4882a593Smuzhiyun# images.
7*4882a593Smuzhiyun# To use it you must pass "empty" as argument for the "--source" parameter in
8*4882a593Smuzhiyun# the wks file. For example:
9*4882a593Smuzhiyun# part foo --source empty --ondisk sda --size="1024" --align 1024
10*4882a593Smuzhiyun
11*4882a593Smuzhiyunimport logging
12*4882a593Smuzhiyun
13*4882a593Smuzhiyunfrom wic.pluginbase import SourcePlugin
14*4882a593Smuzhiyun
15*4882a593Smuzhiyunlogger = logging.getLogger('wic')
16*4882a593Smuzhiyun
17*4882a593Smuzhiyunclass EmptyPartitionPlugin(SourcePlugin):
18*4882a593Smuzhiyun    """
19*4882a593Smuzhiyun    Populate unformatted empty partition.
20*4882a593Smuzhiyun    """
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun    name = 'empty'
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun    @classmethod
25*4882a593Smuzhiyun    def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
26*4882a593Smuzhiyun                             oe_builddir, bootimg_dir, kernel_dir,
27*4882a593Smuzhiyun                             rootfs_dir, native_sysroot):
28*4882a593Smuzhiyun        """
29*4882a593Smuzhiyun        Called to do the actual content population for a partition i.e. it
30*4882a593Smuzhiyun        'prepares' the partition to be incorporated into the image.
31*4882a593Smuzhiyun        """
32*4882a593Smuzhiyun        return
33