kiwi.filesystem Package

Submodules

kiwi.filesystem.base Module

class kiwi.filesystem.base.FileSystemBase(device_provider, root_dir=None, custom_args=None)[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=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 (string) – label name
create_on_file(filename, label=None, exclude=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
post_init(custom_args)[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’
    }
}
sync_data(exclude=None)[source]

Copy root data tree into filesystem

Parameters:exclude (list) – list of exclude dirs/files

kiwi.filesystem.btrfs Module

class kiwi.filesystem.btrfs.FileSystemBtrfs(device_provider, root_dir=None, custom_args=None)[source]

Bases: kiwi.filesystem.base.FileSystemBase

Implements creation of btrfs filesystem

create_on_device(label=None)[source]

Create btrfs filesystem on block device

Parameters:label (string) – label name

kiwi.filesystem.clicfs Module

class kiwi.filesystem.clicfs.FileSystemClicFs(device_provider, root_dir=None, custom_args=None)[source]

Bases: kiwi.filesystem.base.FileSystemBase

Implements creation of clicfs filesystem

create_on_file(filename, label=None, exclude=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
post_init(custom_args=None)[source]

Post initialization method

Initialize temporary container_dir directory to store clicfs embeded filesystem

Parameters:custom_args (dict) – unused

kiwi.filesystem.ext2 Module

class kiwi.filesystem.ext2.FileSystemExt2(device_provider, root_dir=None, custom_args=None)[source]

Bases: kiwi.filesystem.base.FileSystemBase

Implements creation of ext2 filesystem

create_on_device(label=None)[source]

Create ext2 filesystem on block device

Parameters:label (string) – label name

kiwi.filesystem.ext3 Module

class kiwi.filesystem.ext3.FileSystemExt3(device_provider, root_dir=None, custom_args=None)[source]

Bases: kiwi.filesystem.base.FileSystemBase

Implements creation of ext3 filesystem

create_on_device(label=None)[source]

Create ext3 filesystem on block device

Parameters:label (string) – label name

kiwi.filesystem.ext4 Module

class kiwi.filesystem.ext4.FileSystemExt4(device_provider, root_dir=None, custom_args=None)[source]

Bases: kiwi.filesystem.base.FileSystemBase

Implements creation of ext4 filesystem

create_on_device(label=None)[source]

Create ext4 filesystem on block device

Parameters:label (string) – label name

kiwi.filesystem.fat16 Module

class kiwi.filesystem.fat16.FileSystemFat16(device_provider, root_dir=None, custom_args=None)[source]

Bases: kiwi.filesystem.base.FileSystemBase

Implements creation of fat16 filesystem

create_on_device(label=None)[source]

Create fat16 filesystem on block device

Parameters:label (string) – label name

kiwi.filesystem.fat32 Module

class kiwi.filesystem.fat32.FileSystemFat32(device_provider, root_dir=None, custom_args=None)[source]

Bases: kiwi.filesystem.base.FileSystemBase

Implements creation of fat16 filesystem

create_on_device(label=None)[source]

Create fat32 filesystem on block device

Parameters:label (string) – label name

kiwi.filesystem.isofs Module

class kiwi.filesystem.isofs.FileSystemIsoFs(device_provider, root_dir=None, custom_args=None)[source]

Bases: kiwi.filesystem.base.FileSystemBase

Implements creation of iso filesystem

create_on_file(filename, label=None, exclude=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 (string) – unused

kiwi.filesystem.setup Module

class kiwi.filesystem.setup.FileSystemSetup(xml_state, root_dir)[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=None)[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, root_dir=None, custom_args=None)[source]

Bases: kiwi.filesystem.base.FileSystemBase

Implements creation of squashfs filesystem

create_on_file(filename, label=None, exclude=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, root_dir=None, custom_args=None)[source]

Bases: kiwi.filesystem.base.FileSystemBase

Implements creation of xfs filesystem

create_on_device(label=None)[source]

Create xfs filesystem on block device

Parameters:label (string) – label 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