kiwi.filesystem Package¶
Submodules¶
kiwi.filesystem.base
Module¶
- class kiwi.filesystem.base.FileSystemBase(device_provider: DeviceProvider, root_dir: str = '', custom_args: Dict = {})[source]¶
Bases:
object
Implements base class for filesystem interface
- Parameters:
device_provider (object) – Instance of a class based on DeviceProvider required for filesystems which needs a block device for creation. In most cases the DeviceProvider is a LoopDevice
root_dir (string) – root directory path name
custom_args (dict) – custom filesystem arguments
- create_on_device(label: str | None = None, size: int = 0, unit: str = 'k', uuid: str | None = None)[source]¶
Create filesystem on block device
Implement in specialized filesystem class for filesystems which requires a block device for creation, e.g ext4.
- Parameters:
label (str) – label name
size (int) – size value, can also be counted from the end via -X The value is interpreted in units of: unit
unit (str) – unit name. Default unit is set to: defaults.UNIT.kb
uuid (str) – UUID name
- create_on_file(filename: str, label: str | None = None, exclude: List[str] | None = None)[source]¶
Create filesystem from root data tree
Implement in specialized filesystem class for filesystems which requires a data tree for creation, e.g squashfs.
- Parameters:
filename (string) – result file path name
label (string) – label name
exclude (list) – list of exclude dirs/files
- create_verification_metadata(device_node: str = '') None [source]¶
Write verification block at the end of the device
- Parameters:
device_node (str) – Target device node, if not specified the root device from this instance is used
- create_verity_layer(blocks: int | None = None, filename: str | None = None)[source]¶
Create veritysetup on device
- Parameters:
block (int) – Number of blocks to use for veritysetup. If not specified the entire root device is used
filename (str) – Target filename to use for VeritySetup. If not specified the filename or block special provided at object construction time is used
- get_mountpoint() str | None [source]¶
Provides mount point directory
Effective use of the directory is guaranteed only after sync_data
- Returns:
directory path name
- Return type:
string
- post_init(custom_args: Dict)[source]¶
Post initialization method
Store dictionary of custom arguments if not empty. This overrides the default custom argument hash
- Parameters:
custom_args (dict) –
custom arguments
{ 'create_options': ['option'], 'mount_options': ['option'], 'meta_data': { 'key': 'value' } }
- set_uuid()[source]¶
Create new random filesystem UUID
Implement in specialized filesystem class for filesystems which supports the concept of an UUID and allows to change it
kiwi.filesystem.btrfs
Module¶
- class kiwi.filesystem.btrfs.FileSystemBtrfs(device_provider: DeviceProvider, root_dir: str = '', custom_args: Dict = {})[source]¶
Bases:
FileSystemBase
Implements creation of btrfs filesystem
- create_on_device(label: str | None = None, size: int = 0, unit: str = 'k', uuid: str | None = None)[source]¶
Create btrfs filesystem on block device
- Parameters:
label (str) – label name
size (int) – size value, can also be counted from the end via -X The value is interpreted in units of: unit
unit (str) – unit name. Default unit is set to: defaults.UNIT.kb
uuid (str) – UUID name
kiwi.filesystem.clicfs
Module¶
- class kiwi.filesystem.clicfs.FileSystemClicFs(device_provider: DeviceProvider, root_dir: str = '', custom_args: Dict = {})[source]¶
Bases:
FileSystemBase
Implements creation of clicfs filesystem
- create_on_file(filename: str, label: str | None = None, exclude: List[str] | None = None)[source]¶
Create clicfs filesystem from data tree
There is no label which could be set for clicfs thus this parameter is not used
There is no option to exclude data from clicfs thus this parameter is not used
- Parameters:
filename (string) – result file path name
label (string) – unused
exclude (list) – unused
kiwi.filesystem.ext2
Module¶
- class kiwi.filesystem.ext2.FileSystemExt2(device_provider: DeviceProvider, root_dir: str = '', custom_args: Dict = {})[source]¶
Bases:
FileSystemBase
Implements creation of ext2 filesystem
- create_on_device(label: str | None = None, size: int = 0, unit: str = 'k', uuid: str | None = None)[source]¶
Create ext2 filesystem on block device
- Parameters:
label (str) – label name
size (int) – size value, can also be counted from the end via -X The value is interpreted in units of: unit
unit (str) – unit name. Default unit is set to: defaults.UNIT.kb
uuid (str) – UUID name
kiwi.filesystem.ext3
Module¶
- class kiwi.filesystem.ext3.FileSystemExt3(device_provider: DeviceProvider, root_dir: str = '', custom_args: Dict = {})[source]¶
Bases:
FileSystemBase
Implements creation of ext3 filesystem
- create_on_device(label: str | None = None, size: int = 0, unit: str = 'k', uuid: str | None = None)[source]¶
Create ext3 filesystem on block device
- Parameters:
label (str) – label name
size (int) – size value, can also be counted from the end via -X The value is interpreted in units of: unit
unit (str) – unit name. Default unit is set to: defaults.UNIT.kb
uuid (str) – UUID name
kiwi.filesystem.ext4
Module¶
- class kiwi.filesystem.ext4.FileSystemExt4(device_provider: DeviceProvider, root_dir: str = '', custom_args: Dict = {})[source]¶
Bases:
FileSystemBase
Implements creation of ext4 filesystem
- create_on_device(label: str | None = None, size: int = 0, unit: str = 'k', uuid: str | None = None)[source]¶
Create ext4 filesystem on block device
- Parameters:
label (str) – label name
size (int) – size value, can also be counted from the end via -X The value is interpreted in units of: unit
unit (str) – unit name. Default unit is set to: defaults.UNIT.kb
uuid (str) – UUID name
kiwi.filesystem.fat16
Module¶
- class kiwi.filesystem.fat16.FileSystemFat16(device_provider: DeviceProvider, root_dir: str = '', custom_args: Dict = {})[source]¶
Bases:
FileSystemBase
Implements creation of fat16 filesystem
- create_on_device(label: str | None = None, size: int = 0, unit: str = 'k', uuid: str | None = None)[source]¶
Create fat16 filesystem on block device
- Parameters:
label (str) – label name
size (int) – size value, can also be counted from the end via -X The value is interpreted in units of: unit
unit (str) – unit name. Default unit is set to: defaults.UNIT.kb
uuid (str) – Volume Label, there is no real UUID on fat
kiwi.filesystem.fat32
Module¶
- class kiwi.filesystem.fat32.FileSystemFat32(device_provider: DeviceProvider, root_dir: str = '', custom_args: Dict = {})[source]¶
Bases:
FileSystemBase
Implements creation of fat32 filesystem
- create_on_device(label: str | None = None, size: int = 0, unit: str = 'k', uuid: str | None = None)[source]¶
Create fat32 filesystem on block device
- Parameters:
label (str) – label name
size (int) – size value, can also be counted from the end via -X The value is interpreted in units of: unit
unit (str) – unit name. Default unit is set to: defaults.UNIT.kb
uuid (str) – Volume Label, there is no real UUID on fat
kiwi.filesystem.isofs
Module¶
- class kiwi.filesystem.isofs.FileSystemIsoFs(device_provider: DeviceProvider, root_dir: str = '', custom_args: Dict = {})[source]¶
Bases:
FileSystemBase
Implements creation of iso filesystem
- create_on_file(filename: str, label: str | None = None, exclude: List[str] | None = None)[source]¶
Create iso filesystem from data tree
There is no label which could be set for iso filesystem thus this parameter is not used
- Parameters:
filename (string) – result file path name
label (string) – unused
exclude (list) – unused
kiwi.filesystem.setup
Module¶
- class kiwi.filesystem.setup.FileSystemSetup(xml_state: XMLState, root_dir: str)[source]¶
Bases:
object
Implement filesystem setup methods
Methods from this class provides information from the root directory required before building a filesystem image
- Parameters:
xml_state (object) – Instance of XMLState
root_dir (string) – root directory path
- get_size_mbytes(filesystem: str | None = None) int [source]¶
Precalculate the requires size in mbytes to store all data from the root directory in the requested filesystem. Return the configured value if present, if not return the calculated result
- Parameters:
filesystem (string) – name
- Returns:
mbytes
- Return type:
int
kiwi.filesystem.squashfs
Module¶
- class kiwi.filesystem.squashfs.FileSystemSquashFs(device_provider: DeviceProvider, root_dir: str = '', custom_args: Dict = {})[source]¶
Bases:
FileSystemBase
Implements creation of squashfs filesystem
- create_on_file(filename, label: str | None = None, exclude: List[str] | None = None)[source]¶
Create squashfs filesystem from data tree
There is no label which could be set for squashfs thus this parameter is not used
- Parameters:
filename (string) – result file path name
label (string) – unused
exclude (list) – list of exclude dirs/files
kiwi.filesystem.xfs
Module¶
- class kiwi.filesystem.xfs.FileSystemXfs(device_provider: DeviceProvider, root_dir: str = '', custom_args: Dict = {})[source]¶
Bases:
FileSystemBase
Implements creation of xfs filesystem
- create_on_device(label: str | None = None, size: int = 0, unit: str = 'k', uuid: str | None = None)[source]¶
Create xfs filesystem on block device
- Parameters:
label (str) – label name
size (int) – size value, can also be counted from the end via -X The value is interpreted in units of: unit
unit (str) – unit name. Default unit is set to: defaults.UNIT.kb
uuid (str) – UUID name
Module Contents¶
- class kiwi.filesystem.FileSystem[source]¶
Bases:
object
FileSystem factory
- Parameters:
name (string) – filesystem name
device_provider (object) – Instance of DeviceProvider
root_dir (string) – root directory path name
custom_args (dict) – dict of custom filesystem arguments
- static new(name: str, device_provider: DeviceProvider, root_dir: str | None = None, custom_args: Dict | None = None)[source]¶