Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 1 | # |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 2 | # Copyright OpenEmbedded Contributors |
| 3 | # |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 4 | # SPDX-License-Identifier: MIT |
| 5 | # |
| 6 | |
| 7 | # The empty wic plugin is used to create unformatted empty partitions for wic |
| 8 | # images. |
| 9 | # To use it you must pass "empty" as argument for the "--source" parameter in |
| 10 | # the wks file. For example: |
| 11 | # part foo --source empty --ondisk sda --size="1024" --align 1024 |
| 12 | |
| 13 | import logging |
| 14 | |
| 15 | from wic.pluginbase import SourcePlugin |
| 16 | |
| 17 | logger = logging.getLogger('wic') |
| 18 | |
| 19 | class EmptyPartitionPlugin(SourcePlugin): |
| 20 | """ |
| 21 | Populate unformatted empty partition. |
| 22 | """ |
| 23 | |
| 24 | name = 'empty' |
| 25 | |
| 26 | @classmethod |
| 27 | def do_prepare_partition(cls, part, source_params, cr, cr_workdir, |
| 28 | oe_builddir, bootimg_dir, kernel_dir, |
| 29 | rootfs_dir, native_sysroot): |
| 30 | """ |
| 31 | Called to do the actual content population for a partition i.e. it |
| 32 | 'prepares' the partition to be incorporated into the image. |
| 33 | """ |
| 34 | return |