This API documentation covers KIWI NG 9.25.12
kiwi.app
Module #kiwi.app.App
Bases: object
Implements creation of task instances
Each task class implements a process method which is called when constructing an instance of App
kiwi.cli
Module #kiwi.cli.Cli
Bases: object
Implements the main command line interface
An instance of the Cli class builds the entry point for the application and implements methods to load further command plugins which itself provides their own command line interface
Extract selected command name
command name
str
Extract argument dict for selected command
Contains dictionary of command arguments
{
'--command-option': 'value'
}
dict
Extract argument dict for global arguments
Contains dictionary of global arguments
{
'--global-option': 'value'
}
dict
Extract service name from argument parse result
service name
str
Execute kiwicompat with provided legacy KIWI command line arguments
Example:
invoke_kiwicompat(
'--build', 'description', '--type', 'vmx',
'-d', 'destination'
)
compat_args
() – legacy kiwi command arguments
Loads task class plugin according to service and command name
loaded task module
object
Execute man to show the selected manual page
kiwi.command
Module #kiwi.command.Command
Bases: object
Implements command invocation
An instance of Command provides methods to invoke external commands in blocking and non blocking mode. Control of stdout and stderr is given to the caller
Execute a program and return an io file handle pair back. stdout and stderr are both on different channels. The caller must read from the output file handles in order to actually run the command. This can be done using the CommandIterator from command_process
Example:
process = Command.call(['ls', '-l'])
command
() – command and arguments
custom_env
() – custom os.environ
Contains process results in command type
command(
output='string', output_available=bool,
error='string', error_available=bool,
process=subprocess
)
namedtuple
Execute a program and block the caller. The return value is a hash containing the stdout, stderr and return code information. Unless raise_on_error is set to false an exception is thrown if the command exits with an error code not equal to zero
Example:
result = Command.run(['ls', '-l'])
command
() – command and arguments
custom_env
() – custom os.environ
raise_on_error
() – control error behaviour
stderr_to_stdout
() – redirects stderr to stdout
Contains call results in command type
command(output='string', error='string', returncode=int)
namedtuple
kiwi.command.command_call_type
Bases: tuple
Alias for field number 2
Alias for field number 3
Alias for field number 0
Alias for field number 1
Alias for field number 4
kiwi.command.command_type
Bases: tuple
Alias for field number 1
Alias for field number 0
Alias for field number 2
kiwi.command_process
Module #kiwi.command_process.CommandIterator
Bases: object
Implements an Iterator for Instances of Command
command
() – instance of subprocess
Provide return value from processed command
errorcode
int
Provide data which was sent to the stderr channel
stderr data
str
Provide process ID of command while running
pid
int
Send kill signal SIGTERM to command process
kiwi.command_process.CommandProcess
Bases: object
Implements processing of non blocking Command calls
Provides methods to iterate over non blocking instances of the Command class with and without progress information
command
() – instance of subprocess
log_topic
() – topic string for logging
create a matcher function pointer which calls the given method as method(item_to_match, data) on dereference
method
() – function reference
function pointer
object
Iterate over process, raise on error and log output
Iterate over process don’t raise on error and log stdout and stderr
Iterate over process and show progress in percent raise on error and log output
items_to_complete
() – all items
match_method
() – method matching item
kiwi.defaults
Module #kiwi.defaults.Defaults
Bases: object
Implements default values
Provides static methods for default values and state information
Implements get method for profile elements
key
() – profile keyname
key value
str
Provides list of supported archive image types
archive names
list
Provides bios core boot binary name
name
str
Provides x86 BIOS directory name which stores the pc binaries
directory name
str
Provides the path to find custom kiwi boot descriptions
directory path
str
Provides the file path to bootloader strip metadata. This file contains information about the files and directories automatically striped out from the kiwi initrd
file path
str
Provides the base name of the environment file in a buildservice worker
file basename
str
Provides the file path to config functions metadata.
This file contains bash functions used for system configuration or in the boot code from the kiwi initrd
file path
str
Provides the tag used to identify base layers during the build of derived images.
tag
str
Provides default container compression
True
bool
Provides list of supported container image types
container names
list
Returns the rpm bootstrap macro file name created in the custom rpm macros path
filename
str
Returns the rpm image macro file name created in the custom rpm macros path
filename
str
Returns the custom macros directory for the rpm database.
path name
str
Provides default boot partition size in mbytes
mbsize value
int
Provides default boot timeout in seconds
seconds
int
Return default bootloader name which is grub2
bootloader name
str
Provides the default ‘created by’ history entry for containers.
the specific kiwi version used for the build
str
Provides the default container name.
name
str
Provides the default container subcommand.
command as a list of arguments
list
Provides the default container tag.
tag
str
Provides the default initial disk sector for the first disk partition.
sector value
int
Provides default EFI partition size in mbytes
mbsize value
int
Provides the default partition table type for efi firmwares.
partition table type name
str
Provides default firmware for specified architecture
arch
() – machine architecture name
firmware name
str
Provides default size of inodes in bytes. This is only relevant for inode based filesystems
bytesize value
int
Provides default size of bios_grub partition in mbytes
mbsize value
int
Provides default live iso root filesystem type
filesystem name
str
Provides default live iso union type
live iso type
str
Returns the default package manager name if none is configured in the image description
package manager name
str
Provides the packager tool according to the package manager
package_manager
() – package manger name
packager tool binary name
str
Provides default size of prep partition in mbytes
mbsize value
int
Provides default URI type
Absolute path specifications used in the context of an URI will apply the specified default mime type
URI mime type
str
Uses auto mode for default video. See get_video_mode_map for details on the value depending which bootloader is used
auto
str
Provides default LVM volume group name
name
str
Provides supported disk format types
disk types
list
Provides supported disk image types
disk image type names
list
Provides file path of dracut config file to be used with KIWI
file path name
str
Provides list of EC2 capable firmware names. These are those for which kiwi supports the creation of disk images bootable within the Amazon EC2 public cloud
firmware names
list
Provides list of EFI capable firmware names. These are those for which kiwi supports the creation of an EFI bootable disk image
firmware names
list
Provides architecture specific EFI boot binary name
arch
() – machine architecture name
name
str
Provides architecture specific EFI directory name which stores the EFI binaries for the desired architecture.
arch
() – machine architecture name
directory name
str
Provides EFI vendor directory if present
Looks up distribution specific EFI vendor directory
root_path
() – path to efi mountpoint
directory path or None
str
Provides the list of folders that are not associated with a physical device. KIWI returns the basename of the folders typically used as mountpoint for those devices.
list of file and directory names
list
Provides list of files/dirs to exclude from the removed files detection in a delta root build
Provides the list of files or folders that are created by KIWI for its own purposes. Those files should be not be included in the resulting image.
list of file and directory names
list
Provides the list of folders that are excluded by the optional metadata file image/exclude_files.yaml
list of file and directory names
root_dir
() – image root directory
list
Provides failsafe boot kernel options
list of kernel options
['option=value', 'option']
list
Provides list of supported filesystem image types
filesystem names
list
Provides supported architecture specific firmware types
firmware types per architecture
dict
Provides list of basic grub modules
multiboot
() – grub multiboot mode
list of module names
list
Provides grub bios image
Searches distribution specific locations to find the core bios image below the given root path
root_path
() – image root path
file path or None
str
Provides list of grub bios modules
multiboot
() – grub multiboot mode
list of module names
list
Provides grub2 data directory name in boot/ directory
Depending on the distribution the grub2 boot path could be either boot/grub2 or boot/grub. The method will decide for the correct base directory name according to the name pattern of the installed grub2 tools
directory basename
str
Provides distribution specific EFI font directory used with grub.
root_path
() – image root path
file path or None
str
Provides list of grub efi modules
multiboot
() – grub multiboot mode
list of module names
list
Provides list of grub ofw modules (ppc)
list of module names
list
Provides grub path to given search file
Depending on the distribution grub could be installed below a grub2 or grub directory. grub could also reside in /usr/lib as well as in /usr/share. Therefore this information needs to be dynamically looked up
root_path
() – root path to start the lookup from
filename
() – filename to search
raise_on_error
() – raise on not found, defaults to True
The method returns the path to the given grub search file. By default it raises a KiwiBootLoaderGrubDataError exception if the file could not be found in any of the search locations. If raise_on_error is set to False and no file could be found the function returns None
filepath
str
Provides list of grub ofw modules (s390)
list of module names
list
Provides the path to an imported root system image
If the image description specified a derived_from attribute the file from this attribute is copied into the root_dir using the name as provided by this method
root_dir
() – image root directory
file path name
str
Provides default value for ISO volume ID for install media
name
str
Provides arch specific relative path to boot files on kiwi iso filesystems
relative path name
str
Provides default iso tool category
name
str
Return name of eltorito grub image used as isolinux loader in BIOS mode if isolinux.bin should not be used
file base name
str
Provides supported kis image types
kis image type names
list
Provides flag_name to dracut modules name map
Depending on the value of the flag attribute in the KIWI image description specific dracut modules need to be selected
dracut module names as list
list
Provides supported live image types
live image type names
list
Provides list of boot options passed to the dracut kiwi-live module to setup persistent writing
list of boot options
list
Provides key length to use for random luks keys
Provides empiric LVM overhead size in mbytes
mbsize value
int
Provides default minimum partition size in mbytes
mbsize value
int
Provides default minimum LVM volume size in mbytes
mbsize value
int
Provides Mok Manager file path
Searches distribution specific locations to find the Mok Manager EFI binary
root_path
() – image root path
file path or None
str
Provides the default API server url to access the public open buildservice API
url path
str
Provides the default download server url hosting the public open buildservice repositories
url path
str
Provides the default OCI archive tool name.
name
str
Provides the default partition mapper tool name.
name
str
Provides the machine architecture name as used by KIWI
This is the architecture name as it is returned by ‘uname -m’ with one exception for the 32bit x86 architecture which is handled as ‘ix86’ in general
architecture name
str
Provides ISO preparer name
name
str
Return name of profile file for given root directory
Provides ISO publisher name
name
str
Provides spare size of recovery partition in mbytes
mbsize value
int
Provides base file name to store removed files in a delta root build
Provides file path to kiwi RelaxNG schema
file path
str
Provides the shared cache location
This is a directory which shares data from the image buildsystem host with the image root system. The location is returned as an absolute path stripped off by the leading ‘/’. This is because the path is transparently used on the host /<cache-dir> and inside of the image imageroot/<cache-dir>
directory path
str
Provides shim loader file path
Searches distribution specific locations to find shim.efi below the given root path
root_path
() – image root path
shim_loader_type | None
NamedTuple
Provides shim vendor directory
Searches distribution specific locations to find shim.efi below the given root path and return the directory name to the file found
root_path
() – image root path
directory path or None
str
Provides shim signed grub loader file path
Searches distribution specific locations to find a grub EFI binary within the given root path
root_path
() – image root path
grub_loader_type | None
NamedTuple
Provides the default configuration template file for snapper. The location in etc/ are preferred over files in usr/
file path
str
Provides the directory to store SAT solvables for repositories. The solvable files are used to perform package dependency and metadata resolution
directory path
str
Provides swapsize in MB
Provides list of default data sync options
list of rsync options
list
Returns list of syslinux modules to include on ISO images that boots via isolinux
base file names
list
syslinux is packaged differently between distributions. This method returns a list of directories to search for syslinux data
directory names
list
Provides the base temp directory location
This is the directory used to store any temporary files and directories created by kiwi during runtime
directory path
str
Provides unsigned grub efi loader file path
Searches distribution specific locations to find a distro grub EFI binary within the given root path
root_path
() – image root path
file path or None
str
Provides the default value for
vagrantconfig.virtualbox_guest_additions_present
whether guest additions are expected to be present in the vagrant box
bool
Provides video mode map
Assign a tuple to each kernel vesa hex id for each of the supported bootloaders
video type map
{'kernel_hex_mode': video_type(grub2='mode', isolinux='mode')}
dict
Provides default value for ISO volume ID
name
str
Provides the file path to the KIWI XSLT style sheets
file path
str
Provides compression options for the xz compressor
Contains list of options
['--option=value']
list
Checks if build host is an open buildservice machine
The presence of /.buildenv on the build host indicates we are building inside of the open buildservice
True if obs worker, else False
bool
Checks if machine architecture is x86 based
Any arch that matches 32bit and 64bit x86 architecture causes the method to return True. Anything else will cause the method to return False
bool
Provides the python module base directory search path
The method uses the resource_filename method to identify files and directories from the application
filename
() – relative project file
absolute file path name
str
Sets the runtime config file once
filename
() – a file path name
Sets the platform architecture once
name
() – an architecture name
Sets the shared cache location once
location
() – a location path
Sets the temp directory location once
location
() – a location path
Implements method to add list of profile keys and their values to the specified instance of a Profile class
profile
() – Profile instance
kiwi.defaults.grub_loader_type
Bases: tuple
Alias for field number 1
Alias for field number 0
kiwi.defaults.shim_loader_type
Bases: tuple
Alias for field number 1
Alias for field number 0
kiwi.defaults.unit_type
Bases: tuple
Alias for field number 0
Alias for field number 3
Alias for field number 1
Alias for field number 2
kiwi.exceptions
Module #kiwi.exceptions.KiwiAnyMarkupPluginError
Bases: KiwiError
Exception raised if the python anymarkup module failed to load.
kiwi.exceptions.KiwiArchiveSetupError
Bases: KiwiError
Exception raised if an unsupported image archive type is used.
kiwi.exceptions.KiwiArchiveTarError
Bases: KiwiError
Exception raised if impossible to determine which tar command version is installed on the underlying system
kiwi.exceptions.KiwiBootImageSetupError
Bases: KiwiError
Exception raised if an unsupported initrd system type is used.
kiwi.exceptions.KiwiBootLoaderConfigSetupError
Bases: KiwiError
Exception raised if a configuration for an unsupported bootloader is requested.
kiwi.exceptions.KiwiBootLoaderGrubDataError
Bases: KiwiError
Exception raised if no grub installation was found.
kiwi.exceptions.KiwiBootLoaderGrubFontError
Bases: KiwiError
Exception raised if no grub unicode font was found.
kiwi.exceptions.KiwiBootLoaderGrubInstallError
Bases: KiwiError
Exception raised if grub install to master boot record has failed.
kiwi.exceptions.KiwiBootLoaderGrubModulesError
Bases: KiwiError
Exception raised if the synchronisation of modules from the grub installation to the boot space has failed.
kiwi.exceptions.KiwiBootLoaderGrubPlatformError
Bases: KiwiError
Exception raised if an attempt was made to use grub on an unsupported platform.
kiwi.exceptions.KiwiBootLoaderGrubSecureBootError
Bases: KiwiError
Exception raised if the Microsoft signed shim loader or grub2 loader could not be found in the image root system
kiwi.exceptions.KiwiBootLoaderInstallSetupError
Bases: KiwiError
Exception raised if an installation for an unsupported bootloader is requested.
kiwi.exceptions.KiwiBootLoaderTargetError
Bases: KiwiError
Exception raised if the target to read the bootloader path from is not a disk or an iso image.
kiwi.exceptions.KiwiBootLoaderZiplInstallError
Bases: KiwiError
Exception raised if the installation of zipl has failed.
kiwi.exceptions.KiwiBootLoaderZiplPlatformError
Bases: KiwiError
Exception raised if a configuration for an unsupported zipl architecture is requested.
kiwi.exceptions.KiwiBootLoaderZiplSetupError
Bases: KiwiError
Exception raised if the data set to configure the zipl bootloader is incomplete.
kiwi.exceptions.KiwiBootStrapPhaseFailed
Bases: KiwiError
Exception raised if the bootstrap phase of the system prepare command has failed.
kiwi.exceptions.KiwiBuildahError
Bases: KiwiError
Exception raised on inconsistent buildah class calls
kiwi.exceptions.KiwiBundleError
Bases: KiwiError
Exception raised if the system bundle command has failed.
kiwi.exceptions.KiwiCommandCapabilitiesError
Bases: KiwiError
Exception is raised when some the CommandCapabilities methods fails, usually meaning there is some issue trying to parse some command output.
kiwi.exceptions.KiwiCommandError
Bases: KiwiError
Exception raised if an external command called via a Command instance has returned with an exit code != 0 or could not be called at all.
kiwi.exceptions.KiwiCommandNotFound
Bases: KiwiError
Exception raised if any executable command cannot be found in the evironment PATH variable.
kiwi.exceptions.KiwiCommandNotLoaded
Bases: KiwiError
Exception raised if a kiwi command task module could not be loaded.
kiwi.exceptions.KiwiCompatError
Bases: KiwiError
Exception raised if the given kiwi compatibility command line could not be understood by the compat option parser.
kiwi.exceptions.KiwiCompressionFormatUnknown
Bases: KiwiError
Exception raised if the compression format of the data could not be detected.
kiwi.exceptions.KiwiConfigFileFormatNotSupported
Bases: KiwiError
Exception raised if kiwi description file format is not supported.
kiwi.exceptions.KiwiConfigFileNotFound
Bases: KiwiError
Exception raised if no kiwi XML description was found.
kiwi.exceptions.KiwiContainerBuilderError
Bases: KiwiError
Exception is raised when something fails during a container image build procedure.
kiwi.exceptions.KiwiContainerImageSetupError
Bases: KiwiError
Exception raised if an attempt to create a container instance for an unsupported container type is performed.
kiwi.exceptions.KiwiContainerSetupError
Bases: KiwiError
Exception raised if an error in the creation of the container archive happened.
kiwi.exceptions.KiwiCredentialsError
Bases: KiwiError
Exception raised if required credentials information is missing
kiwi.exceptions.KiwiCustomPartitionConflictError
Bases: KiwiError
Exception raised if the entry in a custom partition setup conflicts with an existing partition table layout setting
kiwi.exceptions.KiwiDataStructureError
Bases: KiwiError
Exception raised if the XML description failed to parse the data structure.
kiwi.exceptions.KiwiDebootstrapError
Bases: KiwiError
Exception raised if not enough user data to call debootstrap were provided or the debootstrap has failed.
kiwi.exceptions.KiwiDecodingError
Bases: KiwiError
Exception is raised on decoding literals failure
kiwi.exceptions.KiwiDescriptionInvalid
Bases: KiwiError
Exception raised if the XML description failed to validate the XML schema.
kiwi.exceptions.KiwiDeviceProviderError
Bases: KiwiError
Exception raised if a storage provide is asked for its managed device but no such device exists.
kiwi.exceptions.KiwiDiskBootImageError
Bases: KiwiError
Exception raised if a kiwi boot image does not provide the requested data, e.g kernel, or hypervisor files.
kiwi.exceptions.KiwiDiskFormatSetupError
Bases: KiwiError
Exception raised if an attempt was made to create a disk format instance of an unsupported disk format.
kiwi.exceptions.KiwiDiskGeometryError
Bases: KiwiError
Exception raised if the disk geometry (partition table) could not be read or evaluated against their expected geometry and capabilities.
kiwi.exceptions.KiwiDistributionNameError
Bases: KiwiError
Exception raised if the distribution name could not be found. The information is extracted from the boot attribute of the XML description. If no boot attribute is present or does not match the naming conventions the exception is raised.
kiwi.exceptions.KiwiError
Bases: Exception
Base class to handle all known exceptions
Specific exceptions are implemented as sub classes of KiwiError
Attributes
message
() – Exception message text
kiwi.exceptions.KiwiExtensionError
Bases: KiwiError
Exception raised if an extension section of the same namespace is used multiple times as toplevel section within the extension section. Each extension must have a single toplevel entry point qualified by its namespace
kiwi.exceptions.KiwiFileAccessError
Bases: KiwiError
Exception raised if accessing a file or its metadata failed
kiwi.exceptions.KiwiFileNotFound
Bases: KiwiError
Exception raised if the requested file could not be found.
kiwi.exceptions.KiwiFileSystemSetupError
Bases: KiwiError
Exception raised if an attempt was made to build an unsupported or unspecified filesystem.
kiwi.exceptions.KiwiFileSystemSyncError
Bases: KiwiError
Exception raised if the data sync from the system into the loop mounted filesystem image failed.
kiwi.exceptions.KiwiFormatSetupError
Bases: KiwiError
Exception raised if the requested disk format could not be created.
kiwi.exceptions.KiwiHelpNoCommandGiven
Bases: KiwiError
Exception raised if the request for the help page is executed without a command to show the help for.
kiwi.exceptions.KiwiImageResizeError
Bases: KiwiError
Exception raised if the request to resize a disk image failed. Reasons could be a missing raw disk reference or a wrong size specification.
kiwi.exceptions.KiwiImportDescriptionError
Bases: KiwiError
Exception raised if the XML description data and scripts could not be imported into the root of the image.
kiwi.exceptions.KiwiIncludFileNotFoundError
Bases: KiwiError
Exception raised if the file reference in an <include> statement could not be found
kiwi.exceptions.KiwiInstallBootImageError
Bases: KiwiError
Exception raised if the required files to boot an installation image could not be found, e.g kernel or hypervisor.
kiwi.exceptions.KiwiInstallMediaError
Bases: KiwiError
Exception raised if a request for an installation media is made but the system image type is not an oem type.
kiwi.exceptions.KiwiInstallPhaseFailed
Bases: KiwiError
Exception raised if the install phase of a system prepare command has failed.
kiwi.exceptions.KiwiIsoLoaderError
Bases: KiwiError
Exception raised if no isolinux loader file could be found.
kiwi.exceptions.KiwiIsoMetaDataError
Bases: KiwiError
Exception raised if an inconsistency in the ISO header was found such like invalid eltorito specification or a broken path table.
kiwi.exceptions.KiwiIsoToolError
Bases: KiwiError
Exception raised if an iso helper tool such as isoinfo could not be found on the build system.
kiwi.exceptions.KiwiKernelLookupError
Bases: KiwiError
Exception raised if the search for the kernel image file failed
kiwi.exceptions.KiwiKisBootImageError
Bases: KiwiError
Exception raised if a required boot file e.g the kernel could not be found in the process of building a kis image.
kiwi.exceptions.KiwiLiveBootImageError
Bases: KiwiError
Exception raised if an attempt was made to use an unsupported live iso type.
kiwi.exceptions.KiwiLoadCommandUndefined
Bases: KiwiError
Exception raised if no command is specified for a given service on the commandline.
kiwi.exceptions.KiwiLogFileSetupFailed
Bases: KiwiError
Exception raised if the log file could not be created.
kiwi.exceptions.KiwiLogSocketSetupFailed
Bases: KiwiError
Exception raised if the Unix Domain log socket could not be created.
kiwi.exceptions.KiwiLoopSetupError
Bases: KiwiError
Exception raised if not enough user data to create a loop device is specified.
kiwi.exceptions.KiwiLuksSetupError
Bases: KiwiError
Exception raised if not enough user data is provided to setup the luks encryption on the given device.
kiwi.exceptions.KiwiMappedDeviceError
Bases: KiwiError
Exception raised if the device to become mapped does not exist.
kiwi.exceptions.KiwiMarkupConversionError
Bases: KiwiError
Exception raised if the markup format conversion is not possible.
kiwi.exceptions.KiwiMountKernelFileSystemsError
Bases: KiwiError
Exception raised if a kernel filesystem such as proc or sys could not be mounted.
Bases: KiwiError
Exception raised if the host <-> image shared directory could not be mounted.
kiwi.exceptions.KiwiNotImplementedError
Bases: KiwiError
Exception raised if a functionality is not yet implemented.
kiwi.exceptions.KiwiOCIArchiveToolError
Bases: KiwiError
Exception raised if the requested OCI archive tool is not supported
kiwi.exceptions.KiwiOffsetError
Bases: KiwiError
Exception raised if the offset for a seek operation does not match the expected data to write
kiwi.exceptions.KiwiPackageManagerSetupError
Bases: KiwiError
Exception raised if an attempt was made to create a package manager instance for an unsupported package manager.
kiwi.exceptions.KiwiPackagesDeletePhaseFailed
Bases: KiwiError
Exception raised if the packages deletion phase in system prepare fails.
kiwi.exceptions.KiwiPartitionTooSmallError
Bases: KiwiError
Exception raised if the specified partition size is smaller than the required bytes to store the data
kiwi.exceptions.KiwiPartitionerGptFlagError
Bases: KiwiError
Exception raised if an attempt was made to set an unknown partition flag for an entry in the GPT table.
kiwi.exceptions.KiwiPartitionerMsDosFlagError
Bases: KiwiError
Exception raised if an attempt was made to set an unknown partition flag for an entry in the MSDOS table.
kiwi.exceptions.KiwiPartitionerSetupError
Bases: KiwiError
Exception raised if an attempt was made to create an instance of a partitioner for an unsupporte partitioner.
kiwi.exceptions.KiwiPrivilegesError
Bases: KiwiError
Exception raised if root privileges are required but not granted.
kiwi.exceptions.KiwiProfileNotFound
Bases: KiwiError
Exception raised if a specified profile does not exist in the XML configuration.
kiwi.exceptions.KiwiRaidSetupError
Bases: KiwiError
Exception raised if invalid or not enough user data is provided to create a raid array on the specified storage device.
kiwi.exceptions.KiwiRepositorySetupError
Bases: KiwiError
Exception raised if an attempt was made to create an instance of a repository for an unsupported package manager.
kiwi.exceptions.KiwiRequestError
Bases: KiwiError
Exception raised if a package request could not be processed by the corresponding package manager instance.
kiwi.exceptions.KiwiRequestedTypeError
Bases: KiwiError
Exception raised if an attempt was made to build an image for an unsupported image type.
kiwi.exceptions.KiwiResizeRawDiskError
Bases: KiwiError
Exception raised if an attempt was made to resize the image disk to a smaller size than the current one. Simply shrinking a disk image file is not possible without data corruption because the partitions were setup to use the entire disk geometry as it fits into the file. A successful shrinking operation would require the filesystems and the partition table to be reduced which is not done by the provided simple storage resize method. In addition without the user overwriting the disk size in the XML setup, kiwi will calculate the minimum required size in order to store the data. Thus in almost all cases it will not be possible to store the data in a smaller disk.
kiwi.exceptions.KiwiResultError
Bases: KiwiError
Exception raised if the image build result pickle information could not be created or loaded.
kiwi.exceptions.KiwiRootDirExists
Bases: KiwiError
Exception raised if the specified image root directory already exists and should not be re-used.
kiwi.exceptions.KiwiRootImportError
Bases: KiwiError
Exception is raised when something fails during the root import procedure.
kiwi.exceptions.KiwiRootInitCreationError
Bases: KiwiError
Exception raised if the initialization of a new image root directory has failed.
kiwi.exceptions.KiwiRpmDirNotRemoteError
Bases: KiwiError
Exception raised if the provided rpm-dir repository is not local
kiwi.exceptions.KiwiRuntimeConfigFileError
Bases: KiwiError
Exception raised if the provided custom runtime config file could not be found
kiwi.exceptions.KiwiRuntimeConfigFormatError
Bases: KiwiError
Exception raised if the expected format in the yaml KIWI runtime config file does not match
kiwi.exceptions.KiwiRuntimeError
Bases: KiwiError
Exception raised if a runtime check has failed.
kiwi.exceptions.KiwiSatSolverJobError
Bases: KiwiError
Exception raised if a sat solver job can not be done, e.g because the requested package or collection does not exist in the registered repository metadata
kiwi.exceptions.KiwiSatSolverJobProblems
Bases: KiwiError
Exception raised if the sat solver operations returned with solver problems e.g package conflicts
kiwi.exceptions.KiwiSatSolverPluginError
Bases: KiwiError
Exception raised if the python solv module failed to load. The solv module is provided by SUSE’s rpm package python-solv and provides a python binding to the libsolv C library
kiwi.exceptions.KiwiSchemaImportError
Bases: KiwiError
Exception raised if the schema file could not be read by lxml.RelaxNG.
kiwi.exceptions.KiwiScriptFailed
Bases: KiwiError
Exception raised if a user script returned with an exit code != 0.
kiwi.exceptions.KiwiSetupIntermediateConfigError
Bases: KiwiError
Exception raised if the setup of the temporary image system configuration for the duration of the build process has failed.
kiwi.exceptions.KiwiShellVariableValueError
Bases: KiwiError
Exception raised if a given python value cannot be converted into a string representation for use in shell scripts
kiwi.exceptions.KiwiSizeError
Bases: KiwiError
Exception is raised when the convertion from a given size in string format to a number.
kiwi.exceptions.KiwiSolverRepositorySetupError
Bases: KiwiError
Exception raised if the repository type is not supported for the creation of a SAT solvable
kiwi.exceptions.KiwiSystemDeletePackagesFailed
Bases: KiwiError
Exception raised if the deletion of a package has failed in the corresponding package manager instance.
kiwi.exceptions.KiwiSystemInstallPackagesFailed
Bases: KiwiError
Exception raised if the installation of a package has failed in the corresponding package manager instance.
kiwi.exceptions.KiwiSystemUpdateFailed
Bases: KiwiError
Exception raised if the package upgrade has failed in the corresponding package manager instance.
kiwi.exceptions.KiwiTargetDirectoryNotFound
Bases: KiwiError
Exception raised if the specified target directory to store the image results was not found.
kiwi.exceptions.KiwiTemplateError
Bases: KiwiError
Exception raised if the substitution of variables in a configuration file template has failed.
kiwi.exceptions.KiwiTypeNotFound
Bases: KiwiError
Exception raised if no build type was found in the XML description.
kiwi.exceptions.KiwiUmountBusyError
Bases: KiwiError
Exception raised if the attempt to umount a resource has failed
kiwi.exceptions.KiwiUnknownServiceName
Bases: KiwiError
Exception raised if an unknown service name was provided on the commandline.
kiwi.exceptions.KiwiUriOpenError
Bases: KiwiError
Exception raised if the urllib urlopen request has failed
kiwi.exceptions.KiwiUriStyleUnknown
Bases: KiwiError
Exception raised if an unsupported URI style was used in the source definition of a repository.
kiwi.exceptions.KiwiUriTypeUnknown
Bases: KiwiError
Exception raised if the protocol type of an URI is unknown in the source definition of a repository.
kiwi.exceptions.KiwiValidationError
Bases: KiwiError
Exception raised if the XML validation against the schema has failed.
kiwi.exceptions.KiwiVhdTagError
Bases: KiwiError
Exception raised if the GUID tag is not provided in the expected format.
kiwi.exceptions.KiwiVolumeGroupConflict
Bases: KiwiError
Exception raised if the requested LVM volume group already is in use on the build system.
kiwi.exceptions.KiwiVolumeManagerSetupError
Bases: KiwiError
Exception raised if the preconditions for volume mangement support are not met or an attempt was made to create an instance of a volume manager for an unsupported volume management system.
kiwi.exceptions.KiwiVolumeRootIDError
Bases: KiwiError
Exception raised if the root volume can not be found. This concept currently exists only for the btrfs subvolume system.
kiwi.exceptions.KiwiVolumeTooSmallError
Bases: KiwiError
Exception raised if the specified volume size is smaller than the required bytes to store the data
kiwi.firmware
Module #kiwi.firmware.FirmWare
Bases: object
Implements firmware specific methods
According to the selected firmware some parameters in a disk image changes. This class provides methods to provide firmware dependant information
instance of XMLState
Check if BIOS mode is requested
True or False
bool
Check if EC2 mode is requested
True or False
bool
Check if EFI mode is requested
The requested EFI mode or None if no EFI mode requested
str
Size of EFI partition. Returns 0 if no such partition is needed
mbsize value
int
Size of legacy bios_grub partition if legacy BIOS mode is required. Returns 0 if no such partition is needed
mbsize value
int
Provides partition table type according to architecture and firmware
partition table name
str
Size of Prep partition if OFW mode is requested. Returns 0 if no such partition is needed
mbsize value
int
Check if the legacy boot from BIOS systems should be activated
True or False
bool
Check if OFW mode is requested
True or False
bool
Check if Opal mode is requested
True or False
bool
kiwi.help
Module #kiwi.help.Help
Bases: object
Implements man page help for kiwi commands
Each kiwi command implements their own manual page, which is shown if the positional argument ‘help’ is passed to the command.
Call man to show the command specific manual page
All kiwi commands store their manual page in the section ‘8’ of the man system. The calling process is replaced by the man process
command
() – man page name
kiwi.kiwi
Module #kiwi.kiwi.extras
Overwritten method from docopt
Shows our own usage message for -h|–help
help
() – indicate to show help
version
() – version string
options
() –
list of option tuples
[option(name='name', value='value')]
doc
() – docopt doc string
kiwi.kiwi.main
kiwi - main application entry point
Initializes a global log object and handles all errors of the application. Every known error is inherited from KiwiError, everything else is passed down until the generic Exception which is handled as unexpected error including the python backtrace
kiwi.kiwi.usage
Instead of the docopt way to show the usage information we provide a kiwi specific usage information. The usage data now always consists out of:
the generic call kiwi-ng [global options] service <command> [<args>]
the command specific usage defined by the docopt string short form by default, long form with -h | –help
the global options
command_usage
() – usage data
kiwi.logger
Module #kiwi.logger.Logger
Bases: Logger
Extended logging facility based on Python logging
name
() – name of the logger
Return logging flags
Dictionary with flags and their activation status
dict
Return currently used log level
log level number
int
Return file path name of logfile
file path
str
Custom progress log information. progress information is intentionally only logged to stdout and will bypass any handlers. We don’t want this information to show up in the log file
current
() – current item
total
() – total number of items
prefix
() – prefix name
bar_length
() – length of progress bar
Set logging flag for further properties of the logging facility Available flags are:
run-scripts-in-screen
flag
() – name
Set custom log level for all console handlers
level
() – log level number
Set color format for all console handlers
Set log socket handler
filename
() – UDS socket file path. Note if there is no server
listening on the socket the log handler setup
will fail
Set logfile handler
filename
() – logfile file path
kiwi.logger_color_formatter
Module #kiwi.logger_color_formatter.ColorFormatter
Bases: Formatter
Extended standard logging Formatter
Extended format supporting text with color metadata
Example:
ColorFormatter(message_format, '%H:%M:%S')
Creates a logging Formatter with support for color messages
record
() – logging message record
result from format_message
str
kiwi.logger_color_formatter.ColorMessage
Bases: object
Implements color messages for Python logging facility
Has to implement the format_message method to serve as message formatter
Message formatter with support for embedded color sequences
The Message is allowed to contain the following color metadata:
$RESET, reset to no color mode
$BOLD, bold
$COLOR, color the following text
$LIGHTCOLOR, light color the following text
The color of the message depends on the level and is defined in the ColorMessage constructor
level
() – color level name
message
() – text
color message with escape sequences
str
kiwi.logger_filter
Module #kiwi.logger_filter.DebugFilter
Bases: Filter
Extended standard debug logging Filter
Only messages with record level DEBUG can pass for messages with another level an extra handler is used
record
() – logging message record
True|False
bool
kiwi.logger_filter.ErrorFilter
Bases: Filter
Extended standard error logging Filter
Only messages with record level DEBUG can pass for messages with another level an extra handler is used
record
() – logging message record
True|False
bool
kiwi.logger_filter.InfoFilter
Bases: Filter
Extended standard logging Filter
Only messages with record level INFO can pass for messages with another level an extra handler is used
record
() – logging message record
True|False
bool
kiwi.logger_filter.LoggerSchedulerFilter
Bases: Filter
Extended standard logging Filter
Messages from apscheduler scheduler instances are filtered out They conflict with console progress information
record
() – logging message record
True|False
bool
kiwi.logger_filter.WarningFilter
Bases: Filter
Extended standard warning logging Filter
Only messages with record level WARNING can pass for messages with another level an extra handler is used
record
() – logging message record
True|False
bool
kiwi.mount_manager
Module #kiwi.mount_manager.MountManager
Bases: object
Implements methods for mounting, umounting and mount checking
If a MountManager instance is used to mount a device the caller must care for the time when umount needs to be called. The class does not automatically release the mounted device, which is intentional
device node name
mountpoint directory name
optional attributes to store
Bind mount the device to the mountpoint
Return attributes dict for this mount manager
Check if mounted
True or False
bool
Standard mount the device to the mountpoint
options
() – mount options
tmpfs mount the device to the mountpoint
Umount by the mountpoint directory
Wait up to 10sec trying to umount. If the resource stays busy the call will raise an exception unless raise_on_busy is set to False. In case the umount failed and raise_on_busy is set to False, the method returns False to indicate the error condition.
True or False
bool
Umount by the mountpoint directory in lazy mode
Release the mount in any case, however the time when the mounted resource is released by the kernel depends on when the resource enters the non busy state
kiwi.path
Module #kiwi.path.Path
Bases: object
Directory path helpers
Check whether path can be accessed with the given mode.
path
() – The path that should be checked for
access.
mode
() – Which access mode should be checked.
This value must be a bit-wise or of one or more of the following
constants: os.F_OK
(note that this one is zero),
os.X_OK
, os.R_OK
and os.W_OK
kwargs
– further keyword arguments are forwarded to
os.access()
Boolean value whether this access mode is allowed
bool
ValueError
– if the supplied mode is invalid
kiwi.exceptions.KiwiFileNotFound
– if the path does not exist or
is not accessible by the current user
Create path and all sub directories to target
path
() – path name
Change the given path elements to a new root directory
root
() – the root path to trim
elements
() – list of path names
changed elements
list
Include the root prefix for the given paths elements
root
() – the new root path
elements
() – list of path names
changed elements
list
Delete empty path, causes an error if target is not empty
path
() – path name
Recursively remove an empty path and its sub directories starting at a given root directory. Ignore non empty or protected paths and leave them untouched
root
() – start at directory
path
() – path name below root
Move path from cur name to new name
cur
() – current path name
new
() – new path name
Sort given list of path names by their hierachy in the tree
Example:
result = Path.sort_by_hierarchy(['/var/lib', '/var'])
path_list
() – list of path names
hierachy sorted path_list
list
Lookup file name in PATH
filename
() – file base name
alternative_lookup_paths
() – list of additional lookup paths
custom_env
() – a custom os.environ
access_mode
() – one of the os access modes or a combination of
them (os.R_OK, os.W_OK and os.X_OK). If the provided access mode
does not match the file is considered not existing
root_dir
() – the root path to look at
absolute path to file or None
str
Delete path and all contents
path
() – path name
kiwi.privileges
Module #kiwi.privileges.Privileges
Bases: object
Implements check for root privileges
Check if we are effectively root on the system. If not an exception is thrown
True or raise an Exception
bool
kiwi.runtime_checker
Module #kiwi.runtime_checker.RuntimeChecker
Bases: object
Implements build consistency checks at runtime
When building wsl images there are some naming conventions that must be fulfilled to run the container on Microsoft Windows
For creating ISO images a different bootloader setup is performed depending on the configured firmware. If the firmware is set to bios, isolinux is used and that limits the architecture to x86 only. In any other case the appliance configured bootloader is used. This check examines if the host architecture is supported with the configured firmware on request of an ISO image.
If a kiwi initrd is used, a lookup to the specified boot description is done and fails early if it does not exist
If a kiwi initrd is used, the kernel used to build the kiwi initrd and the kernel used in the system image must be the same in order to avoid an inconsistent boot setup
When creating container images the specific tools are used in order to import and export OCI or Docker compatible images. This check searches for those tools to be installed in the build system and fails if it can’t find them
OEM images if configured to use dracut as initrd system requires the KIWI provided dracut-kiwi-oem-repart module to be installed at the time dracut is called. Thus this runtime check examines if the required package is part of the package list in the image description.
Disk images configured to use a root filesystem overlay requires the KIWI provided kiwi-overlay dracut module to be installed at the time dracut is called. Thus this runtime check examines if the required package is part of the package list in the image description.
Live ISO images uses a dracut initrd to boot and requires the KIWI provided kiwi-live dracut module to be installed at the time dracut is called. Thus this runtime check examines if the required package is part of the package list in the image description.
OEM images if configured to use dracut as initrd system and configured with one of the installiso, installstick or installpxe attributes requires the KIWI provided dracut-kiwi-oem-dump module to be installed at the time dracut is called. Thus this runtime check examines if the required package is part of the package list in the image description.
KIWI images which makes use of kiwi dracut modules has to use module versions compatible with the version of this KIWI builder code base. This is important to avoid inconsistencies between the way how kiwi includes its own dracut modules and former version of those dracut modules which could be no longer compatible with the builder. Therefore this runtime check maintains a min_version constraint for which we know this KIWI builder to be compatible with.
Disk images configured to use a root filesystem overlay only supports the standard EFI mode and not secure boot. That’s because the shim setup performs changes to the root filesystem which can not be applied during the bootloader setup at build time because at that point the root filesystem is a read-only squashfs source.
Verify that all repos marked with the imageinclude attribute can be resolved into a http based web URL
Verify that the selected image type is unique within the range of the configured types and profiles.
Kiwi requires a <version> element to be specified as part of at least one <preferences> section.
Raise for still included <include> statements as not resolvable. The KIWI XSLT processing replaces the specified include directive(s) with the given file reference(s). If this action did not happen for example on nested includes, it can happen that they stay in the document as sort of waste.
If the boot attribute is used without selecting kiwi as the initrd_system, the setting of the boot attribute will not have any effect. We assume that configurations which explicitly specify the boot attribute wants to use the custom kiwi initrd system and not dracut.
Options set via the luksformat element are passed along to the cryptsetup tool. Only options that are known to the tool should be allowed. Thus this runtime check looks up the provided option names if they exist in the cryptsetup version used on the build host
If the image description enables the mediacheck attribute the required tools to run this check must be installed on the image build host
The devicepersistency setting by-partuuid can only be used in combination with a partition table type that supports UUIDs. In any other case Linux creates artificial values for PTUUID and PARTUUID from the disk signature which can change without touching the actual partition table. We consider this unsafe and only allow the use of by-partuuid in combination with partition tables that actually supports it properly.
Verify that there are repositories configured
The optional oem-swapname is only effective if used together with the LVM volume manager. A name for the swap space can only be set if it is created as a LVM volume. In any other case the name does not apply to the system
ISO images that are configured to use isolinux requires the host to provide a set of syslinux binaries.
The target directory must be outside of the kiwi shared cache directory in order to avoid busy mounts because kiwi bind mounts the cache directory into the image root tree to access host caching information
target_dir
() – path name
The optional volume label in a systemdisk setup is only effective if the LVM, logical volume manager system is used. In any other case where the filesystem itself offers volume management capabilities there are no extra filesystem labels which can be applied per volume
The volume size specification ‘all’ makes this volume to take the rest space available on the system. It’s only allowed to specify one all size volume
The root volume in a systemdisk setup is handled in a special way. It is not allowed to setup a custom name or mountpoint for the root volume. Therefore the size of the root volume can be setup via the @root volume name. This check looks up the volume setup and searches if there is a configuration for the ‘/’ mountpoint which would cause the image build to fail
If the image is classified to be used as Xen image, it can be either a Xen Server(dom0) or a Xen guest. The image configuration is checked if the information uniquely identifies the image as such
kiwi.runtime_checker.dracut_module_type
Bases: tuple
Alias for field number 1
Alias for field number 0
kiwi.runtime_config
Module #kiwi.runtime_config.RuntimeConfig
Bases: object
Implements reading of runtime configuration file:
Check for –config provided from the CLI
~/.config/kiwi/config.yml
/etc/kiwi.yml
The KIWI runtime configuration file is a yaml formatted file containing information to control the behavior of the tools used by KIWI.
reread
() – reread runtime config
Return boolean value to express if the image bundle should contain XZ compressed image results or not.
compress: true|false
If compression of image build results is activated the size of the bundle is smaller and the download speed increases. However the image must be uncompressed before use
If no compression is explicitly configured, the provided default value applies
default
() – Default value
True or False
bool
Return compression for container images
compress: xz|none|true|false
if no or invalid configuration data is provided, the default compression from the Defaults class is returned
True or False
bool
Return verification metadata signing key file, used for signature creation of rootfs verification metadata:
verification_metadata_signing_key_file: …
There is no default value for this setting available
file path name or ‘’
str
Returns disabled runtime checks. Checks can be disabled with:
disable: check_container_tool_chain_installed
if the provided string does not match any RuntimeChecker method it is just ignored.
Return tool category which should be used to build iso images
tool_category: xorriso
if no or invalid configuration exists the default tool category from the Defaults class is returned
A name
str
Return partition mapper tool
part_mapper: partx
if no configuration exists the default tool from the Defaults class is returned
A name
str
Returns the maximum allowed size of the built image. The value is returned in bytes and it is specified in build_constraints element with the max_size attribute. The value can be specified in bytes or it can be specified with m=MB or g=GB.
max_size: 700m
if no configuration exists None is returned
byte value or None
int
Return OBS API credentials if configured:
user_name: user_credentials
List of Dicts with credentials per user
list
Return URL of buildservice API server in:
api_url: …
if no configuration exists the API server from the Defaults class is returned
URL type data
str
Return URL of buildservice download server in:
download_url: …
if no configuration exists the downloadserver from the Defaults class is returned
URL type data
str
Return OCI archive tool which should be used on creation of container archives for OCI compliant images, e.g docker
archive_tool: umoci
if no configuration exists the default tool from the Defaults class is returned
A name
str
Return boolean value to express if the image build and bundle should contain a .changes file. The .changes file contains the package changelog information from all packages installed into the image.
has_package_changes: true|false
By default the creation is switched on. When building in the Open Build Service the default is switched off because obs provides a .report file containing the same information.
default
() – Default value
True or False
bool
Return list of XZ compression options in:
options: …
if no configuration exists None is returned
Contains list of options
['--option=value']
list
Check if the buildservice configuration is public or private in:
public: true|false
if no configuration exists we assume to be public
True or False
bool
kiwi.version
Module #Global version information used in kiwi and the package
kiwi.xml_description
Module #kiwi.xml_description.XMLDescription
Bases: object
Implements data management for the image description
Supported description markup languages are XML, YAML, JSON and INI. The provided input file is converted into XML, transformed to the current RelaxNG schema via XSLT and validated against this result.
XSLT Style Sheet processing to apply on this version of kiwi
Schema Validation based on RelaxNG schema
Loading XML data into internal data structures
Attributes
description
() – path to description file
derived_from
() – path to base description file
Return the xml etree parse result for the specified extension namespace
namespace_name
() – name of the extension namespace
result of etree.parse
object
Read XML description, validate it against the schema and the schematron rules and pass it to the autogenerated(generateDS) parser.
instance of XML toplevel domain (image)
object
kiwi.xml_state
Module #kiwi.xml_state.XMLState
Bases: object
Implements methods to get stateful information from the XML data
xml_data
() – parse result from XMLDescription.load()
profiles
() – list of used profiles
build_type
() – build <type> section reference
Adds a new label in the containerconfig section, if a label with the same name is already defined in containerconfig it gets overwritten by this method.
label_name
() – the string representing the label name
value
() – the value of the label
Add a new repository section at the end of the list
repo_source
() – repository URI
repo_type
() – type name defined by schema
repo_alias
() – alias name
repo_prio
() – priority number, package manager specific
repo_imageinclude
() – setup repository inside of the image
repo_package_gpgcheck
() – enable/disable package gpg checks
repo_signing_keys
() – list of signing key file names
components
() – component names for debian repos
distribution
() – base distribution name for debian repos
repo_gpgcheck
() – enable/disable repo gpg checks
Copy packages marked as bootdelete to the packages type=delete section in the target xml state
target_state
() – XMLState instance
Copy archives marked as bootinclude to the packages type=bootstrap section in the target xml state
target_state
() – XMLState instance
Copy packages marked as bootinclude to the packages type=bootstrap section in the target xml state. The package will also be removed from the packages type=delete section in the target xml state if present there
target_state
() – XMLState instance
Copy bootloader section from this xml state to the target xml state
target_state
() – XMLState instance
Copy specified attributes from this build type section to the target xml state build type section
attribute_names
() – type section attributes
target_state
() – XMLState instance
Copy image displayname from this xml state to the target xml state
target_state
() – XMLState instance
Copy drivers sections from this xml state to the target xml state
target_state
() – XMLState instance
Copy machine sections from this xml state to the target xml state
target_state
() – XMLState instance
Copy image name from this xml state to the target xml state
target_state
() – XMLState instance
Copy oemconfig sections from this xml state to the target xml state
target_state
() – XMLState instance
Copy subsections of the preferences sections, matching given section names, from this xml state to the target xml state
section_names
() – preferences subsection names
target_state
() – XMLState instance
Copy repository sections from this xml state to the target xml state
target_state
() – XMLState instance
wipe
() – delete all repos in target prior to copy
Copy strip sections from this xml state to the target xml state
target_state
() – XMLState instance
Copy systemdisk sections from this xml state to the target xml state
target_state
() – XMLState instance
Delete all repository sections matching configured profiles
Delete all repository sections used to build the image matching configured profiles
Dict of archive names and target dirs for packages section(s), if any :return: archive names and its target dir :rtype: dict
List of custom options used in the bootloader configuration
List of custom options used in the bootloader installation
List of custom options used in the process to run bootloader setup workloads
List of custom options used in the process to setup secure boot
List of archive names from the type=”bootstrap” packages section(s)
archive names
list
Dict of archive names and target dirs from the type=”bootstrap” packages section(s) :return: archive names and its target dir :rtype: dict
Collection type for packages sections matching type=”bootstrap”
collection type name
str
List of collection names from the packages sections matching type=”bootstrap”
collection names
list
bootstrap_package name from type=”bootstrap” packages section
bootstrap_package name
str
List of package names from the type=”bootstrap” packages section(s)
The list gets the selected package manager appended if there is a request to install packages inside of the image via a chroot operation
plus_packages
() – list of additional packages
package names
list
List of packages sections matching type=”bootstrap”
list of <packages> section reference(s)
list
List of product names from the packages sections matching type=”bootstrap”
product names
list
Return bootloader console setting for selected build type
console string
str
Return bootloader name for selected build type
bootloader name
str
First bootloader section from the build type section
<bootloader> section reference
xml_parse::bootloader
Return bootloader serial line setup parameters for the selected build type
serial line setup
str
First bootloadersettings section from the build type bootloader section
<bootloadersettings> section reference
xml_parse::bootloadersettings
Return bootloader target type setting. Only relevant for the zipl bootloader because zipl is installed differently depending on the storage target it runs later
target type string
str
Return bootloader timeout setting for selected build type
timeout string
str
Return bootloader timeout style setting for selected build type
timeout_style string
str
Indicate whether the bootloader configuration should use the password protecting the encrypted root volume.
True|False
bool
Return bundle_format for build type
The bundle_format string is validated against the available name tags from kiwi.system.result::result_name_tags.
bundle format string
str
First containerconfig section from the build type section
<containerconfig> section reference
xml_parse::containerconfig
Disk format options returned as a dictionary
format options
dict
First machine section from the build type section
<machine> section reference
xml_parse::machine
Default build type name
Content of image attribute from build type
str
First oemconfig section from the build type section
<oemconfig> section reference
xml_parse::oemconfig
First partitions section from the build type section
<partitions> section reference
xml_parse::partitions
Size information from the build type section. If no unit is set the value is treated as mbytes
include_unpartitioned
() – sets if the unpartitioned area
should be included in the computed size or not
mbytes
int
Build type specific list of filesystem attributes applied to the spare partition.
list of strings or empty list
list
Size information for the spare_part size from the build type. If no unit is set the value is treated as mbytes
mbytes
int
First system disk section from the build type section
<systemdisk> section reference
xml_parse::systemdisk
Size of the unpartitioned area for image in megabytes
mbytes
int
First vagrantconfig section from the build type section
<vagrantconfig> section reference
xml_parse::vagrantconfig
List of vmconfig-entry section values from the first machine section in the build type section
<vmconfig_entry> section reference(s)
list
First vmdisk section from the first machine section in the build type section
<vmdisk> section reference
xml_parse::vmdisk
First vmdvd section from the first machine section in the build type section
<vmdvd> section reference
xml_parse::vmdvd
vmnic section(s) from the first machine section in the build type section
list of <vmnic> section reference(s)
list
Dict of collection modules to enable and/or disable
Dict of the form:
{
'enable': [
"module:stream", "module"
],
'disable': [
"module"
]
}
dict
Collection type from packages sections matching given section type.
If no collection type is specified the default collection type is set to: onlyRequired
section_type
() – type name from packages section
collection type name
str
List of collection names from the packages sections matching type=section_type and type=build_type
collection names
list
Dictionary of containerconfig information
Takes attributes and subsection data from the selected <containerconfig> section and stores it in a dictionary
Uri object of derived image if configured
Specific image types can be based on a master image. This method returns the location of this image when configured in the XML description
Instance of Uri
object
The description section
description_type tuple providing the elements author contact and specification
tuple
First disk sector number to be used by the first disk partition.
number
int
Extract the distribution name from the boot attribute of the build type section.
If no boot attribute is configured or the contents does not match the kiwi defined naming schema for boot image descriptions, an exception is thrown
lowercase distribution name
str
List of driver names from all drivers sections matching configured profiles
driver names
list
List of root filesystem creation options
The list contains elements with the information from the fscreateoptions attribute string that got split into its substring components
list with create options
list
List of root filesystem mount options
The list contains one element with the information from the fsmountoptions attribute. The value there is passed along to the -o mount option
max one element list with mount option string
list
List of packages sections matching type=”image”
list of <packages> section reference(s)
list
Image version from preferences section.
Multiple occurences of version in preferences sections are not forbidden, however only the first version found defines the final image version
Content of <version> section
str
List of all <include> section file name references
List[str]
list
Name of initrd system to use
Depending on the image type a specific initrd system is either pre selected or free of choice according to the XML type setup.
‘dracut’, ‘kiwi’ or ‘none’
str
Gets the list of modules to append in installation initrds
a list of dracut module names
list
Gets list of locale names if configured. Takes the first locale setup from the existing preferences sections into account.
List of names or None
list|None
Return key or passphrase credentials to open the luks pool
data
str
Return list of luks format options
list of options
list
State value to activate multipath maps. Returns a boolean value if specified or False
Content of <oem-multipath-scan> section value
bool
State value to activate/deactivate disk resize. Returns a boolean value if specified or True to set resize on by default
Content of <oem-resize> section value
bool
State value to retrieve root partition size
Content of <oem-systemsize> section value
int
Return swapsize in MB if requested or None
Operates on the value of oem-swap and if set to true returns the given size or the default value.
Content of <oem-swapsize> section value or default
int
Return the swap space name
Operates on the value of oem-swapname and if set returns the configured name or the default name: LVSwap
The name of the swap space is used only if the image is configured to use the LVM volume manager. In this case swap is a volume and the volume takes a name. In any other case the given name will have no effect.
Content of <oem-swapname> section value or default
str
Get configured package manager from selected preferences section
Content of the <packagemanager> section
str
List of package sections from the given packages sections. Each list element contains a tuple with the <package> section reference and the <packages> section this package belongs to
If a package entry specfies an architecture, it is only taken if the host architecture matches the configured architecture
packages_sections
() – <packages>
Contains list of package_type tuples
[package_type(packages_section=object, package_section=object)]
list
List of packages sections matching given section type(s)
section_types
() – type name(s) from packages sections
list of <packages> section reference(s)
list
Dictionary of configured partitions.
Each entry in the dict references a ptable_entry_type Each key in the dict references the name of the partition entry as handled by KIWI
Contains dict of ptable_entry_type tuples
{
'NAME': ptable_entry_type(
mbsize=int,
clone=int,
partition_name=str,
partition_type=str,
mountpoint=str,
filesystem=str
)
}
dict
All preferences sections for the selected profiles that match the host architecture
list of <preferences> section reference(s)
list
List of product names from the packages sections matching type=section_type and type=build_type
section_type
() – type name from packages section
product names
list
Get configured release version from selected preferences section
Content of the <release-version> section or ‘’
str
Get list of signing keys specified on the repositories
List of all repository sections matching configured profiles
<repository> section reference(s)
list
List of all repositorys sections used to build the image and matching configured profiles.
<repository> section reference(s)
list
List of all repositorys sections to be configured in the resulting image matching configured profiles.
<repository> section reference(s)
list
Return preserved UUID
Return preserved PARTUUID
Gets the rpm-check-signatures configuration flag. Returns False if not present.
True or False
bool
Gets the rpm-excludedocs configuration flag. Returns False if not present.
True or False
bool
Gets list of locale names to filter out by rpm if rpm-locale-filtering is switched on the the list always contains: [POSIX, C, C.UTF-8] and is extended by the optionaly configured locale
List of names or None
list|None
Gets the rpm-locale-filtering configuration flag. Returns False if not present.
True or False
bool
Items to delete from strip section
item names
list
Libraries to keep from strip section
librarie names
list
List of strip names matching the given section type and profiles
section_type
() – type name from packages section
strip names
list
Tools to keep from strip section
tool names
list
List of archive names from the packages sections matching type=”image” and type=build_type
archive names
list
Dict of archive names and its target dir from the packages sections matching type=”image” and type=build_type :return: archive names and its target dir :rtype: dict
Collection type for packages sections matching type=”image”
collection type name
str
List of collection names from the packages sections matching type=”image”
collection names
list
List of ignore package names from the packages sections matching type=”image” and type=build_type
package names
list
List of package names from the packages sections matching type=”image” and type=build_type
package names
list
List of product names from the packages sections matching type=”image”
product names
list
List of package names from the type=”delete” or type=”uninstall” packages section(s)
force
() – return “delete” type if True, “uninstall” type
otherwise
package names
list
List of group names matching specified user
Each entry in the list is the name of a group and optionally its group ID separated by a colon, that the specified user belongs to. The first item in the list is the login or primary group. The list will be empty if no groups are specified in the description file.
groups data for the given user
list
List of configured users.
Each entry in the list is a single xml_parse::user instance.
list of <user> section reference(s)
list
All users sections for the selected profiles
list of <users> section reference(s)
list
Attribute virtualbox_guest_additions_present from the first vagrantconfig section.
True|False
bool
Volume group name from selected <systemdisk> section
volume group name
str
Provides information which volume management system is used
name of volume manager
str
List of configured systemdisk volumes.
Each entry in the list is a tuple with the following information
name: name of the volume
size: size of the volume
realpath: system path to lookup volume data. If no mountpoint is set the volume name is used as data path.
mountpoint: volume mount point and volume data path
fullsize: takes all space True|False
attributes: list of volume attributes handled via chattr
Contains list of volume_type tuples
[
volume_type(
name=volume_name,
parent=volume_parent,
size=volume_size,
realpath=path,
mountpoint=path,
fullsize=True,
label=volume_label,
attributes=['no-copy-on-write'],
is_root_volume=True|False
)
]
list
Check if build type setup specifies a Xen Guest (domX) The check is based on the architecture, the firmware and xen_loader configuration values:
We only support Xen setup on the x86_64 architecture
Firmware pointing to ec2 means the image is targeted to run in Amazon EC2 which is a Xen guest
Machine setup with a xen_loader attribute also indicates a Xen guest target
True or False
bool
Check if build type domain setup specifies a Xen Server (dom0)
True or False
bool
Tests if the given package section is applicable for the current host architecture. If no architecture is specified within the section it is considered as a match returning True.
Note: The XML section pointer must provide an arch attribute
section
– XML section object
True or False
bool
Tests if the given preferences section is applicable for the current host architecture. If no architecture is specified within the section it is considered as a match returning True.
Note: The XML section pointer must provide an arch attribute
section
– XML section object
True or False
bool
Tests if the given profile section is applicable for the current host architecture. If no architecture is specified within the section it is considered as a match returning True.
Note: The XML section pointer must provide an arch attribute
section
– XML section object
True or False
bool
Resolve any this:// repo source path into the path representing the target inside of the image description directory
Set new tag name in containerconfig section
In order to set a new tag value an existing containerconfig and tag setup is required
tag
() – tag name
Set derived_from attribute to a new value
In order to set a new value the derived_from attribute must be already present in the image configuration
uri
() – URI
Overwrite repository data of the first repository
repo_source
() – repository URI
repo_type
() – type name defined by schema
repo_alias
() – alias name
repo_prio
() – priority number, package manager specific
repo_imageinclude
() – setup repository inside of the image
repo_package_gpgcheck
() – enable/disable package gpg checks
repo_signing_keys
() – list of signing key file names
components
() – component names for debian repos
distribution
() – base distribution name for debian repos
repo_gpgcheck
() – enable/disable repo gpg checks
Store UUID provided in uuid as state information
uuid
() – UUID
Store PARTUUID provided in uuid as state information
uuid
() – PARTUUID
kiwi.xml_state.description_type
Bases: tuple
Alias for field number 0
Alias for field number 1
Alias for field number 2
kiwi.xml_state.package_type
Bases: tuple
Alias for field number 1
Alias for field number 0
kiwi.xml_state.size_type
Bases: tuple
Alias for field number 1
Alias for field number 0
kiwi.xml_state.volume_type
Bases: tuple
Alias for field number 7
Alias for field number 5
Alias for field number 8
Alias for field number 6
Alias for field number 4
Alias for field number 0
Alias for field number 1
Alias for field number 3
Alias for field number 2
kiwi.archive.cpio
Module #kiwi.archive.cpio.ArchiveCpio
Bases: object
Extraction/Creation of cpio archives
filename
() – filename to use for archive extraction or creation
Create cpio archive
source_dir
() – data source directory
exclude
() – list of excluded items
Extract cpio archive contents
dest_dir
() – target data directory
kiwi.archive.tar
Module #kiwi.archive.tar.ArchiveTar
Bases: object
Extraction/Creation of tar archives
The tarfile python module is not used by that class, since it does not provide support for some relevant features in comparison to the GNU tar command (e.g. numeric-owner). Moreover tarfile lacks support for xz compression under Python v2.7.
filename
() – filename to use for archive extraction or creation
create_from_file_list
() – use file list not entire directory to create the archive
file_list
() – list of files and directorie names to archive
Append files to an already existing uncompressed tar archive
source_dir
() – data source directory
files_to_append
() – list of items to append
options
() – custom options
Create uncompressed tar archive
source_dir
() – data source directory
exclude
() – list of excluded items
options
() – custom creation options
Create gzip compressed tar archive
source_dir
() – data source directory
exclude
() – list of excluded items
Create XZ compressed tar archive
source_dir
() – data source directory
exclude
() – list of excluded items
options
() – custom tar creation options
xz_options
() – custom xz compression options
Extract tar archive contents
dest_dir
() – target data directory
kiwi.boot.image.base
Module #kiwi.boot.image.base.BootImageBase
Bases: object
Base class for boot image(initrd) task
Cleanup temporary boot image data if any
Implements creation of the initrd
mbrid
(
kiwi.system.identifier.SystemIdentifier
) – instance of SystemIdentifier
basename
() – base initrd file name
install_initrd
() – installation media initrd
Implementation in specialized boot image class
Provide path to the boot image XML description
path name
str
Provides kernel and initrd names for the boot image
Contains boot_names_type tuple
boot_names_type(
kernel_name='INSTALLED_KERNEL',
initrd_name='DRACUT_OUTPUT_NAME',
kernel_version='KERNEL_VERSION',
kernel_filename='KERNEL_FILE_NAME'
)
Indicates if this instance supports actual creation of an initrd
The method needs to be overwritten by the subclass implementing preparation and creation of an initrd
Copy information from the system image relevant to create the boot image to the boot image state XML description
Include file to boot image
For kiwi boot images this is done by adding package or archive definitions with the bootinclude attribute. Thus for kiwi boot images the method is a noop
filename
() – file path name
install_media
() – include also for installation media initrd
Include module to boot image
For kiwi boot no modules configuration is required. Thus in such a case this method is a noop.
module
() – module to include
install_media
() – include the module for install initrds
Check if initrd system is prepared.
True or False
bool
Load the boot image description referenced by the system image description boot attribute
Omit module to boot image
For kiwi boot no modules configuration is required. Thus in such a case this method is a noop.
module
() – module to omit
install_media
() – omit the module for install initrds
Post initialization method
Implementation in specialized boot image class
Prepare new root system to create initrd from. Implementation is only needed if there is no other root system available
Implementation in specialized boot image class
Set static modules list for boot image
For kiwi boot no modules configuration is required. Thus in such a case this method is a noop.
modules
() – list of modules to include
install_media
() – lists the modules for install initrds
Writes relevant boot image configuration into configuration file that will be part of the system image.
This is used to configure any further boot image rebuilds after deployment. For instance, initrds recreated on kernel update.
For kiwi boot no specific configuration is required for initrds recreation, thus this method is a noop in that case.
config
() – dictonary including configuration parameters
config_file
() – configuration file to write
kiwi.boot.image.base.boot_names_type
Bases: tuple
Alias for field number 1
Alias for field number 3
Alias for field number 0
Alias for field number 2
kiwi.boot.image.dracut
Module #kiwi.boot.image.dracut.BootImageDracut
Bases: BootImageBase
Implements creation of dracut boot(initrd) images.
Create kiwi .profile environment to be included in dracut initrd. Call dracut as chroot operation to create the initrd and move the result into the image build target directory
mbrid
(
kiwi.system.identifier.SystemIdentifier
) – unused
basename
() – base initrd file name
install_initrd
() – unused
This instance supports initrd preparation and creation
Include file to dracut boot image
filename
() – file path name
install_media
() – unused
Include module to dracut boot image
module
() – module to include
install_media
() – unused
Omit module to dracut boot image
module
() – module to omit
install_media
() – unused
Post initialization method
Initialize empty list of dracut caller options
Prepare dracut caller environment
Setup machine_id(s) to be generic and rebuild by dracut on boot
Set static dracut modules list for boot image
modules
() – list of the modules to include
install_media
() – unused
Writes modules configuration into a dracut configuration file.
config
() – a dictionary containing the modules to add and omit
conf_file
() – configuration file to write
kiwi.boot.image.builtin_kiwi
Module #kiwi.boot.image.builtin_kiwi.BootImageKiwi
Bases: BootImageBase
Implements preparation and creation of kiwi boot(initrd) images
The kiwi initrd is a customized first boot initrd which allows to control the first boot an appliance. The kiwi initrd replaces itself after first boot by the result of dracut.
Cleanup temporary boot image data if any
Create initrd from prepared boot system tree and compress the result
mbrid
(
kiwi.system.identifier.SystemIdentifier
) – instance of ImageIdentifier
basename
() – base initrd file name
install_initrd
() – installation media initrd
This instance supports initrd preparation and creation
Post initialization method
Creates custom directory to prepare the boot image root filesystem which is a separate image to create the initrd from
Prepare new root system suitable to create a kiwi initrd from it
kiwi.boot.image.BootImage
Bases: object
BootImge Factory
xml_state
() – Instance of XMLState
target_dir
() – target dir to store the initrd
root_dir
() – system image root directory
signing_keys
() – list of package signing keys
kiwi.bootloader.config.base
Module #kiwi.bootloader.config.base.BootLoaderConfigBase
Bases: object
Base class for bootloader configuration
xml_state
() – instance of XMLState
root_dir
() – root directory path name
custom_args
() – custom bootloader arguments dictionary
Create standard EFI boot directory structure
in_sub_dir
() – toplevel directory
Full qualified EFI boot path
str
Check if a failsafe boot entry is requested
True or False
bool
Boot commandline arguments passed to the kernel
boot_device
() – boot device node. If no extra boot device exists
then boot device equals root device. In case of
an overlay setup the boot device equals the
readonly root device
write_device
() – optional overlay write device node
kernel boot arguments
str
Bootloader lookup path on boot device
If the bootloader reads the data it needs to boot, it does that from the configured boot device. Depending if that device is an extra boot partition or the root partition or or based on a non standard filesystem like a btrfs snapshot, the path name varies
target
() – target name: disk|iso
path name
str
Bootloader Theme name
theme name
str
Bootloader timeout in seconds
If no timeout is specified the default timeout applies
timeout seconds
int
Check if the boot should continue after boot timeout or not
True or False
bool
Graphics mode according to bootloader target
Bootloaders which support a graphics mode can be configured to run graphics in a specific resolution and colors. There is no standard for this setup which causes kiwi to create a mapping from the kernel vesa mode number to the corresponding bootloader graphics mode setup
target
() – bootloader name
boot graphics mode
str
Provide the default boot menu entry identifier for install images
The install image can be configured to provide more than one boot menu entry. Menu entries configured are:
[0] Boot From Hard Disk
[1] Install
[2] Failsafe Install
The installboot attribute controlls which of these are used by default. If not specified the boot from hard disk entry will be the default. Depending on the specified loader type either an entry number or name will be returned.
loader
() – bootloader name
menu name or id
str
Prefixed menu entry title for install images
If no displayname is specified in the image description, the menu title is constructed from the image name
title text
str
Prefixed menu entry title
If no displayname is specified in the image description, the menu title is constructed from the image name and build type
plain
() – indicate to add built type into title text
title text
str
Post initialization method
Store custom arguments by default
custom_args
() – custom bootloader arguments
Quote special characters in the title name
Not all characters can be displayed correctly in the bootloader environment. Therefore a quoting is required
name
() – title name
quoted text
str
Create bootloader images for disk boot
Some bootloaders requires to build a boot image the bootloader can load from a specific offset address or from a standardized path on a filesystem.
boot_uuid
() – boot device UUID
lookup_path
() – custom module lookup path
Implementation in specialized bootloader class required
Create boot config file to boot from disk.
boot_uuid
() – boot device UUID
root_uuid
() – root device UUID
hypervisor
() – hypervisor name
kernel
() – kernel name
initrd
() – initrd name
boot_options
() – custom options dictionary required to setup the bootloader.
The scope of the options covers all information needed
to setup and configure the bootloader and gets effective
in the individual implementation. boot_options should
not be mixed up with commandline options used at boot time.
This information is provided from the get_*_cmdline
methods. The contents of the dictionary can vary between
bootloaders or even not be needed
Implementation in specialized bootloader class required
Create bootloader images for ISO boot an install media
mbrid
() – mbrid file name on boot device
lookup_path
() – custom module lookup path
Implementation in specialized bootloader class required
Create boot config file to boot from install media in EFI mode.
mbrid
() – mbrid file name on boot device
hypervisor
() – hypervisor name
kernel
() – kernel name
initrd
() – initrd name
Implementation in specialized bootloader class required
Create bootloader images for ISO boot a live ISO image
mbrid
() – mbrid file name on boot device
lookup_path
() – custom module lookup path
Implementation in specialized bootloader class required
Create boot config file to boot live ISO image in EFI mode.
mbrid
() – mbrid file name on boot device
hypervisor
() – hypervisor name
kernel
() – kernel name
initrd
() – initrd name
Implementation in specialized bootloader class required
Create or update etc/sysconfig/bootloader by parameters required according to the bootloader setup
Implementation in specialized bootloader class required
Write config data to config file.
Implementation in specialized bootloader class required
Write bootloader setup meta data files
root_device
() – root device node
write_device
() – overlay root write device node
boot_options
() – kernel options as string
Implementation in specialized bootloader class optional
kiwi.bootloader.config.grub2
Module #kiwi.bootloader.config.grub2.BootLoaderConfigGrub2
Bases: BootLoaderConfigBase
grub2 bootloader configuration.
grub2 post initialization method
custom_args
() –
Contains grub config arguments
{'grub_directory_name': 'grub|grub2'}
Create/Provide grub2 boot images and metadata
In order to boot from the disk grub2 modules, images and theme data needs to be created and provided at the correct place in the filesystem
boot_uuid
() – boot device UUID
lookup_path
() – custom module lookup path
Create grub2 config file to boot from disk using grub2-mkconfig
boot_uuid
() – unused
root_uuid
() – unused
hypervisor
() – unused
kernel
() – unused
initrd
() – unused
boot_options
() –
options dictionary that has to contain the root and boot device and optional volume configuration. KIWI has to mount the system prior to run grub2-mkconfig.
{
'root_device': string,
'boot_device': string,
'efi_device': string,
'system_volumes':
volume_manager_instance.get_volumes(),
'system_root_volume':
volume_manager_instance.get_root_volume_name()
}
Create/Provide grub2 boot images and metadata
In order to boot from the ISO grub2 modules, images and theme data needs to be created and provided at the correct place on the iso filesystem
mbrid
() – mbrid file name on boot device
lookup_path
() – custom module lookup path
Create grub2 config file to boot from an ISO install image
mbrid
() – mbrid file name on boot device
hypervisor
() – hypervisor name
kernel
() – kernel name
initrd
() – initrd name
Create/Provide grub2 boot images and metadata
Calls setup_install_boot_images because no different action required
Create grub2 config file to boot a live media ISO image
mbrid
() – mbrid file name on boot device
hypervisor
() – hypervisor name
kernel
() – kernel name
initrd
() – initrd name
Write bootloader configuration
writes grub.cfg template by KIWI if template system is used
creates an embedded fat efi image for EFI ISO boot
Write bootloader setup meta data files
cmdline arguments initialization
etc/default/grub setup file
etc/default/zipl2grub.conf.in (s390 only)
etc/sysconfig/bootloader
root_device
() – root device node
write_device
() – overlay root write device node
boot_options
() – kernel options as string
iso_boot
() – indicate target is an ISO
kiwi.bootloader.config.isolinux
Module #kiwi.bootloader.config.isolinux.BootLoaderConfigIsoLinux
Bases: BootLoaderConfigBase
isolinux bootloader configuration.
isolinux post initialization method
custom_args
() – custom isolinux config arguments
Provide isolinux boot metadata
No extra boot images must be created for isolinux
mbrid
() – unused
lookup_path
() – unused
Create isolinux.cfg in memory from a template suitable to boot from an ISO image in BIOS boot mode
mbrid
() – mbrid file name on boot device
hypervisor
() – hypervisor name
kernel
() – kernel name
initrd
() – initrd name
Provide isolinux boot metadata
No extra boot images must be created for isolinux
mbrid
() – unused
lookup_path
() – unused
Create isolinux.cfg in memory from a template suitable to boot a live system from an ISO image in BIOS boot mode
mbrid
() – mbrid file name on boot device
hypervisor
() – hypervisor name
kernel
() – kernel name
initrd
() – initrd name
Write isolinux.cfg and isolinux.msg file
kiwi.bootloader.config.BootLoaderConfig
Bases: object
BootLoaderConfig factory
name
() – bootloader name
xml_state
() – instance of XMLState
root_dir
() – root directory path name
custom_args
() – custom bootloader config arguments dictionary
kiwi.bootloader.install.base
Module #kiwi.bootloader.install.base.BootLoaderInstallBase
Bases: object
Base class for bootloader installation on device
root_dir
() – root directory path name
device_provider
() – instance of DeviceProvider
custom_args
() – custom arguments dictionary
Install bootloader on self.device
Implementation in specialized bootloader install class required
Check if bootloader needs to be installed
Implementation in specialized bootloader install class required
Post initialization method
Store custom arguments by default
custom_args
() – custom bootloader arguments
Run shim-install in self.device for secure boots
Implementation in specialized bootloader install class required
kiwi.bootloader.install.grub2
Module #kiwi.bootloader.install.grub2.BootLoaderInstallGrub2
Bases: BootLoaderInstallBase
grub2 bootloader installation
Install bootloader on disk device
Check if grub2 has to be installed
Take architecture and firmware setup into account to check if bootloader code in a boot record is required
True or False
bool
grub2 post initialization method
custom_args
() –
Contains custom grub2 bootloader arguments
{
'target_removable': bool,
'system_volumes': list_of_volumes,
'system_root_volume': root volume name if required
'firmware': FirmWare_instance,
'efi_device': string,
'boot_device': string,
'root_device': string
}
Run shim-install in self.device for secure boots
Implementation in specialized bootloader install class required
kiwi.bootloader.install.BootLoaderInstall
Bases: object
BootLoaderInstall Factory
name
() – bootloader name
root_dir
() – root directory path name
device_provider
() – instance of DeviceProvider
custom_args
() – custom arguments dictionary
kiwi.bootloader.template.grub2
Module #kiwi.bootloader.template.grub2.BootLoaderTemplateGrub2
Bases: object
grub2 configuraton file templates
Bootloader configuration template for install media
failsafe
() – with failsafe true|false
hybrid
() – with hybrid true|false
terminal
() – output terminal name
instance of Template
Template
Bootloader configuration template for live ISO media
failsafe
() – with failsafe true|false
hybrid
() – with hybrid true|false
terminal
() – output terminal name
instance of Template
Template
Bootloader configuration template for install media with hypervisor, e.g Xen dom0
failsafe
() – with failsafe true|false
terminal
() – output terminal name
instance of Template
Template
Bootloader configuration template for live ISO media with hypervisor, e.g Xen dom0
failsafe
() – with failsafe true|false
terminal
() – output terminal name
instance of Template
Template
kiwi.bootloader.template.isolinux
Module #kiwi.bootloader.template.isolinux.BootLoaderTemplateIsoLinux
Bases: object
isolinux configuraton file templates
Bootloader template for text message file in install mode. isolinux displays this as menu if no graphics mode can be initialized
instance of Template
Template
Bootloader configuration template for install media
failsafe
() – with failsafe true|false
with_theme
() – with graphics theme true|false
instance of Template
Template
Bootloader template for text message file. isolinux displays this as menu if no graphics mode can be initialized
instance of Template
Template
Bootloader configuration template for install media with hypervisor, e.g Xen dom0
failsafe
() – with failsafe true|false
with_theme
() – with graphics theme true|false
instance of Template
Template
Bootloader configuration template for live media with hypervisor, e.g Xen dom0
failsafe
() – with failsafe true|false
with_theme
() – with graphics theme true|false
instance of Template
Template
Bootloader configuration template for live media
failsafe
() – with failsafe true|false
with_theme
() – with graphics theme true|false
instance of Template
Template
kiwi.builder.archive
Module #kiwi.builder.archive.ArchiveBuilder
Bases: object
Root archive image builder
xml_state
() – Instance of XMLState
target_dir
() – target directory path name
root_dir
() – root directory path name
custom_args
() – Custom processing arguments defined as hash keys:
* xz_options: string of XZ compression parameters
Create a root archive tarball
Build a simple XZ compressed root tarball from the image root tree
Image types which triggers this builder are:
image=”tbz”
image=”cpio”
result
instance of Result
kiwi.builder.container
Module #kiwi.builder.container.ContainerBuilder
Bases: object
Container image builder
xml_state
() – Instance of XMLState
target_dir
() – target directory path name
root_dir
() – root directory path name
custom_args
() – Custom processing arguments defined as hash keys:
* xz_options: string of XZ compression parameters
Builds a container image which is usually a data archive including container specific metadata.
Image types which triggers this builder are:
image=”docker”
image=”oci”
image=”appx”
result
instance of Result
kiwi.builder.disk
Module #kiwi.builder.disk.DiskBuilder
Bases: object
Disk image builder
xml_state
() – Instance of XMLState
target_dir
() – Target directory path name
root_dir
() – Root directory path name
custom_args
() – Custom processing arguments defined as hash keys:
* signing_keys: list of package signing keys
* xz_options: string of XZ compression parameters
Extends the raw disk if an unpartitioned area is specified
Build a bootable disk image and optional installation image The installation image is a bootable hybrid ISO image which embeds the disk image and an image installer
Image types which triggers this builder are:
image=”oem”
result
instance of Result
Build a bootable raw disk image
kiwi.exceptions.KiwiInstallMediaError
– if install media is required and image type is not oem
kiwi.exceptions.KiwiVolumeManagerSetupError
– root overlay at the same time volumes are defined is not supported
result
instance of Result
Create a bootable disk format from a previously created raw disk image
result_instance
() – instance of Result
updated result_instance
instance of Result
Build an installation image. The installation image is a bootable hybrid ISO image which embeds the raw disk image and an image installer
result_instance
() – instance of Result
updated result_instance with installation media
instance of Result
kiwi.builder.filesystem
Module #kiwi.builder.filesystem.FileSystemBuilder
Bases: object
Filesystem image builder
xml_state
() – Instance of XMLState
target_dir
() – target directory path name
root_dir
() – root directory path name
custom_args
() – Custom processing arguments defined as hash keys:
* None
Build a mountable filesystem image
Image types which triggers this builder are:
image=”ext2”
image=”ext3”
image=”ext4”
image=”btrfs”
image=”xfs”
result
instance of Result
kiwi.builder.install
Module #kiwi.builder.install.InstallImageBuilder
Bases: object
Installation image builder
xml_state
() – instance of XMLState
root_dir
() – system image root directory
target_dir
() – target directory path name
boot_image_task
() – instance of BootImage
custom_args
() – Custom processing arguments defined as hash keys:
* xz_options: string of XZ compression parameters
Create an install ISO from the disk_image as hybrid ISO bootable via legacy BIOS, EFI and as disk from Stick
Image types which triggers this builder are:
installiso=”true|false”
installstick=”true|false”
Create an oem install tar archive suitable for installing a disk image via the network using the PXE boot protocol. The archive contains:
The raw system image xz compressed
The raw system image checksum metadata file
The append file template for the boot server
The system image initrd for kexec
The install initrd
The kernel
Image types which triggers this builder are:
installpxe=”true|false”
kiwi.builder.live
Module #kiwi.builder.live.LiveImageBuilder
Bases: object
Live image builder
xml_state
() – instance of XMLState
target_dir
() – target directory path name
root_dir
() – root directory path name
custom_args
() – Custom processing arguments
Build a bootable hybrid live ISO image
Image types which triggers this builder are:
image=”iso”
kiwi.exceptions.KiwiLiveBootImageError
– if no kernel or hipervisor is found
in boot image tree
result
instance of Result
kiwi.builder.kis
Module #kiwi.builder.kis.KisBuilder
Bases: object
Filesystem based image builder.
xml_state
() – instance of XMLState
target_dir
() – target directory path name
root_dir
() – system image root directory
custom_args
() – Custom processing arguments defined as hash keys:
* signing_keys: list of package signing keys
* xz_options: string of XZ compression parameters
Build a component image consisting out of a boot image(initrd) plus its appropriate kernel files and the root filesystem image with a checksum.
Image types which triggers this builder are:
image=”kis”
image=”pxe”
kiwi.exceptions.KiwiKisBootImageError
– if no kernel or hipervisor is found
in boot image tree
result
instance of Result
kiwi.builder.ImageBuilder
Bases: object
Image builder factory
kiwi.container.oci
Module #kiwi.container.oci.ContainerImageOCI
Bases: ContainerImageBase
Create oci container from a root directory
root_dir
() – root directory path name
custom_args
() –
Custom processing arguments defined as hash keys:
Example
{
'container_name': 'name',
'container_tag': '1.0',
'additional_names': ['current', 'foobar'],
'entry_command': ['/bin/bash', '-x'],
'entry_subcommand': ['ls', '-l'],
'maintainer': 'tux',
'user': 'root',
'workingdir': '/root',
'expose_ports': ['80', '42'],
'volumes': ['/var/log', '/tmp'],
'environment': {'PATH': '/bin'},
'labels': {'name': 'value'},
'history': {
'created_by': 'some explanation here',
'comment': 'some comment here',
'author': 'tux'
}
}
Create compressed oci system container tar archive
filename
() – archive file name
base_image
() – archive used as a base image
ensure_empty_tmpdirs
() – exclude system tmp directories
compress_archive
() – compress container archive
kiwi.container.oci.OciConfig
Bases: TypedDict
kiwi.container.ContainerImage
Bases: object
Container Image factory
name
() – container system name
root_dir
() – root directory path name
custom_args
() – custom arguments
kiwi.container.setup.base
Module #kiwi.container.setup.base.ContainerSetupBase
Bases: object
Base class for setting up the root system to create a container image from for e.g docker. The methods here are generic to linux systems following the FHS standard and modern enough e.g based on systemd
Attributes
root_dir
root directory path name
custom_args
dict of custom arguments
Container bootloader setup
Tell the system there is no bootloader configuration it needs to care for. A container does not boot
Container filesystem check setup
The root filesystem of a container could be an overlay or a mapped device. In any case it should not be checked for consistency as this is should be done by the container infrastructure
Container system services setup
Init systems among others also controls services which starts at boot time. A container does not really boot. Thus some services needs to be deactivated
name
() – systemd service name
Container name
name
str
Post initialization method
Implementation in specialized container setup class
custom_args
() – unused
Setup container metadata
Implementation in specialized bootloader class required
Container console setup
/dev/console should be allowed to login by root
kiwi.container.setup.docker
Module #kiwi.container.setup.docker.ContainerSetupDocker
Bases: ContainerSetupOCI
Docker container setup
kiwi.container.setup.ContainerSetup
Bases: object
container setup factory
kiwi.filesystem.base
Module #kiwi.filesystem.base.FileSystemBase
Bases: object
Implements base class for filesystem interface
device_provider
() – 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
() – root directory path name
custom_args
() – custom filesystem arguments
Create filesystem on block device
Implement in specialized filesystem class for filesystems which requires a block device for creation, e.g ext4.
label
() – label name
size
() – size value, can also be counted from the end via -X
The value is interpreted in units of: unit
unit
() – unit name. Default unit is set to: defaults.UNIT.kb
uuid
() – UUID name
Create filesystem from root data tree
Implement in specialized filesystem class for filesystems which requires a data tree for creation, e.g squashfs.
filename
() – result file path name
label
() – label name
exclude
() – list of exclude dirs/files
Write verification block at the end of the device
device_node
() – Target device node, if not specified the root device
from this instance is used
Create veritysetup on device
block
() – Number of blocks to use for veritysetup.
If not specified the entire root device is used
filename
() – Target filename to use for VeritySetup.
If not specified the filename or block special
provided at object construction time is used
Provides mount point directory
Effective use of the directory is guaranteed only after sync_data
directory path name
string
Mount the filesystem
Post initialization method
Store dictionary of custom arguments if not empty. This overrides the default custom argument hash
custom_args
() –
custom arguments
{
'create_options': ['option'],
'mount_options': ['option'],
'meta_data': {
'key': 'value'
}
}
Create new random filesystem UUID
Implement in specialized filesystem class for filesystems which supports the concept of an UUID and allows to change it
Copy root data tree into filesystem
exclude
() – list of exclude dirs/files
Umounts the filesystem in case it is mounted, does nothing otherwise
kiwi.filesystem.btrfs
Module #kiwi.filesystem.btrfs.FileSystemBtrfs
Bases: FileSystemBase
Implements creation of btrfs filesystem
Create btrfs filesystem on block device
label
() – label name
size
() – size value, can also be counted from the end via -X
The value is interpreted in units of: unit
unit
() – unit name. Default unit is set to: defaults.UNIT.kb
uuid
() – UUID name
Create new random filesystem UUID
kiwi.filesystem.clicfs
Module #kiwi.filesystem.clicfs.FileSystemClicFs
Bases: FileSystemBase
Implements creation of clicfs filesystem
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
filename
() – result file path name
label
() – unused
exclude
() – unused
Post initialization method
Initialize temporary container_dir directory to store clicfs embeded filesystem
custom_args
() – unused
kiwi.filesystem.ext2
Module #kiwi.filesystem.ext2.FileSystemExt2
Bases: FileSystemBase
Implements creation of ext2 filesystem
Create ext2 filesystem on block device
label
() – label name
size
() – size value, can also be counted from the end via -X
The value is interpreted in units of: unit
unit
() – unit name. Default unit is set to: defaults.UNIT.kb
uuid
() – UUID name
Create new random filesystem UUID
kiwi.filesystem.ext3
Module #kiwi.filesystem.ext3.FileSystemExt3
Bases: FileSystemBase
Implements creation of ext3 filesystem
Create ext3 filesystem on block device
label
() – label name
size
() – size value, can also be counted from the end via -X
The value is interpreted in units of: unit
unit
() – unit name. Default unit is set to: defaults.UNIT.kb
uuid
() – UUID name
Create new random filesystem UUID
kiwi.filesystem.ext4
Module #kiwi.filesystem.ext4.FileSystemExt4
Bases: FileSystemBase
Implements creation of ext4 filesystem
Create ext4 filesystem on block device
label
() – label name
size
() – size value, can also be counted from the end via -X
The value is interpreted in units of: unit
unit
() – unit name. Default unit is set to: defaults.UNIT.kb
uuid
() – UUID name
Create new random filesystem UUID
kiwi.filesystem.fat16
Module #kiwi.filesystem.fat16.FileSystemFat16
Bases: FileSystemBase
Implements creation of fat16 filesystem
Create fat16 filesystem on block device
label
() – label name
size
() – size value, can also be counted from the end via -X
The value is interpreted in units of: unit
unit
() – unit name. Default unit is set to: defaults.UNIT.kb
uuid
() – Volume Label, there is no real UUID on fat
Create new random filesystem UUID
kiwi.filesystem.fat32
Module #kiwi.filesystem.fat32.FileSystemFat32
Bases: FileSystemBase
Implements creation of fat32 filesystem
Create fat32 filesystem on block device
label
() – label name
size
() – size value, can also be counted from the end via -X
The value is interpreted in units of: unit
unit
() – unit name. Default unit is set to: defaults.UNIT.kb
uuid
() – Volume Label, there is no real UUID on fat
Create new random filesystem UUID
kiwi.filesystem.isofs
Module #kiwi.filesystem.isofs.FileSystemIsoFs
Bases: FileSystemBase
Implements creation of iso filesystem
Create iso filesystem from data tree
There is no label which could be set for iso filesystem thus this parameter is not used
filename
() – result file path name
label
() – unused
exclude
() – unused
kiwi.filesystem.setup
Module #kiwi.filesystem.setup.FileSystemSetup
Bases: object
Implement filesystem setup methods
Methods from this class provides information from the root directory required before building a filesystem image
xml_state
() – Instance of XMLState
root_dir
() – root directory path
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
filesystem
() – name
mbytes
int
kiwi.filesystem.squashfs
Module #kiwi.filesystem.squashfs.FileSystemSquashFs
Bases: FileSystemBase
Implements creation of squashfs filesystem
Create squashfs filesystem from data tree
There is no label which could be set for squashfs thus this parameter is not used
filename
() – result file path name
label
() – unused
exclude
() – list of exclude dirs/files
kiwi.filesystem.xfs
Module #kiwi.filesystem.xfs.FileSystemXfs
Bases: FileSystemBase
Implements creation of xfs filesystem
Create xfs filesystem on block device
label
() – label name
size
() – size value, can also be counted from the end via -X
The value is interpreted in units of: unit
unit
() – unit name. Default unit is set to: defaults.UNIT.kb
uuid
() – UUID name
Create new random filesystem UUID
kiwi.filesystem.FileSystem
Bases: object
FileSystem factory
name
() – filesystem name
device_provider
() – Instance of DeviceProvider
root_dir
() – root directory path name
custom_args
() – dict of custom filesystem arguments
kiwi.iso_tools.base
Module #kiwi.iso_tools.base.IsoToolsBase
Bases: object
Base Class for Parameter API for iso creation tools
Add ISO creation parameters to embed the EFI loader
Implementation in specialized tool class
Create iso file
Implementation in specialized tool class
filename
() – unused
hidden_files
() – unused
Return caller name for iso creation tool
Implementation in specialized tool class
tool name
str
Indicate if the iso tool has the capability to embed a partition table into the iso such that it can be used as both; an iso and a disk
Implementation in specialized tool class
Create a set of standard parameters for the main isolinux loader
Implementation in specialized tool class
custom_args
() – unused
List contents of an ISO image
isofile
() – unused
kiwi.iso_tools.xorriso
Module #kiwi.iso_tools.xorriso.IsoToolsXorrIso
Bases: IsoToolsBase
xorriso wrapper class
Implementation of Parameter API for iso creation tools using the libburnia project. Addressed here is the tool xorriso
Add ISO creation parameters to embed the EFI loader
In order to boot the ISO from EFI, the EFI binary is added as alternative loader to the ISO creation parameter list. The EFI binary must be included into a fat filesystem in order to become recognized by the firmware. For details about this file refer to _create_embedded_fat_efi_image() from bootloader/config/grub2.py
Creates the iso file with the given filename using xorriso
filename
() – output filename
hidden_files
() – list of hidden files
Lookup xorriso in search path
kiwi.exceptions.KiwiIsoToolError
– if xorriso tool is not found
xorriso tool path
str
Indicate if the iso tool has the capability to embed a partition table into the iso such that it can be used as both; an iso and a disk
True or False
bool
Create a set of standard parameters
custom_args
() – custom ISO meta data
kiwi.iso_tools.iso
Module #kiwi.iso_tools.iso.Iso
Bases: object
Implements helper methods around the creation of ISO filesystems
Include checksum tag in the ISO so it can be verified with the mediacheck program.
isofile
() – path to the ISO file
Write the base boot path into the isolinux loader binary
kiwi.exceptions.KiwiIsoLoaderError
– if loader/isolinux.bin is not found
kiwi.iso_tools.IsoTools
Bases: object
IsoTools factory
kiwi.package_manager.base
Module #kiwi.package_manager.base.PackageManagerBase
Bases: object
Implements base class for Package Management
repository
() – instance of Repository
root_dir
() – root directory path name
package_requests
() – list of packages to install or delete
collection_requests
() – list of collections to install
product_requests
() – list of products to install
Cleans package manager related data not needed in the resulting image such as custom macros
Implementation in specialized package manager class
Cleanup request queues
Provide further error details
In case the package manager call failed this method will return package manager specific error information if there is any
further error data as str or empty str
str
Evaluate given result return code
Any returncode != 0 is considered an error unless overwritten in specialized package manager class
returncode
() – return code number
True|False
boolean
Match expression to indicate a package has been deleted
Implementation in specialized package manager class
package_name
() – unused
package_manager_output
() – unused
True|False
bool
Match expression to indicate a package has been installed
Implementation in specialized package manager class
package_name
() – unused
package_manager_output
() – unused
True|False
bool
Post initialization method
Implementation in specialized package manager class
custom_args
() – unused
Process extra code required after deleting packages
Implementation in specialized package manager class
Process extra code required after bootstrapping
Implementation in specialized package manager class
Process package delete requests (chroot)
Implementation in specialized package manager class
force
() – unused
Process package install requests for image phase (chroot)
Implementation in specialized package manager class
Process package install requests for bootstrap phase (no chroot)
Implementation in specialized package manager class
Setup package processing only for required packages
Implementation in specialized package manager class
Setup package processing to also include recommended dependencies
Implementation in specialized package manager class
Queue a package collection
Implementation in specialized package manager class
name
() – unused
Queue a package request
Implementation in specialized package manager class
name
() – unused
Queue a package exclusion(skip) request
Implementation in specialized package manager class
name
() – unused
Queue a product request
Implementation in specialized package manager class
name
() – unused
Setup repository modules and streams
Implementation in specialized package manager class
collection_modules
() – unused
Process package update requests (chroot)
Implementation in specialized package manager class
kiwi.package_manager.dnf4
Module #kiwi.package_manager.dnf4.PackageManagerDnf4
Bases: PackageManagerBase
*Implements base class for installation/deletion of packages and collections using dnf*
dnf_args
() – dnf arguments from repository runtime configuration
command_env
() – dnf command environment from repository runtime
configuration
Cleans package manager related data not needed in the resulting image such as custom macros
Match expression to indicate a package has been deleted
package_name
() – package_name
package_manager_output
() – dnf status line
True|False
bool
Match expression to indicate a package has been installed
This match for the package to be installed in the output of the dnf command is not 100% accurate. There might be false positives due to sub package names starting with the same base package name
package_name
() – package_name
package_manager_output
() – dnf status line
True|False
bool
Post initialization method
custom_args
() – custom dnf arguments
Move the rpm database to the place as it is expected by the rpm package installed during bootstrap phase
root_bind
() – unused
delta_root
() – unused
Process package delete requests (chroot)
force
() – force deletion: true|false
kiwi.exceptions.KiwiRequestError
– if none of the packages to delete is
installed.
process results in command type
namedtuple
Process package install requests for image phase (chroot)
process results in command type
namedtuple
Process package install requests for bootstrap phase (no chroot)
root_bind
() – unused
bootstrap_package
() – unused
process results in command type
namedtuple
Setup package processing only for required packages
Setup package processing to also include recommended dependencies.
Queue a collection request
name
() – dnf group ID name
Queue a package request
name
() – package name
Queue a package exclusion(skip) request
name
() – package name
Queue a product request
There is no product definition in the fedora repo data
name
() – unused
Setup repository modules and streams
collection_modules
() –
Expect dict of the form:
{
'enable': [
"module:stream", "module"
],
'disable': [
"module"
]
}
Process package update requests (chroot)
process results in command type
namedtuple
kiwi.package_manager.zypper
Module #kiwi.package_manager.zypper.PackageManagerZypper
Bases: PackageManagerBase
Implements Installation/Deletion of packages/collections with zypper
zypper_args
() – zypper arguments from repository runtime configuration
command_env
() – zypper command environment from repository
runtime configuration
Cleans package manager related data not needed in the resulting image such as custom macros
Evaluate given result return code
In zypper any return code == 0 or >= 100 is considered success. Any return code different from 0 and < 100 is treated as an error we care for. Return codes >= 100 indicates an issue like ‘new kernel needs reboot of the system’ or similar which we don’t care in the scope of image building
returncode
() – return code number
True|False
boolean
Match expression to indicate a package has been deleted
package_name
() – package_name
package_manager_output
() – zypper status line
True|False
bool
Match expression to indicate a package has been installed
This match for the package to be installed in the output of the zypper command is not 100% accurate. There might be false positives due to sub package names starting with the same base package name
package_name
() – package_name
package_manager_output
() – zypper status line
True|False
bool
Post initialization method
Store custom zypper arguments
custom_args
() – custom zypper arguments
Move the rpm database to the place as it is expected by the rpm package installed during bootstrap phase
root_bind
() – unused
delta_root
() – unused
Process package delete requests (chroot)
force
() – force deletion: true|false
kiwi.exceptions.KiwiRequestError
– if none of the packages to delete is
installed
process results in command type
namedtuple
Process package install requests for image phase (chroot)
process results in command type
namedtuple
Process package install requests for bootstrap phase (no chroot)
root_bind
() – unused
bootstrap_package
() – unused
process results in command type
namedtuple
Setup package processing only for required packages
Setup package processing to also include recommended dependencies.
Queue a collection request
name
() – zypper pattern name
Queue a package request
name
() – package name
Queue a package exclusion(skip) request
name
() – package name
Queue a product request
name
() – zypper product name
Repository modules not supported for zypper. The method does nothing in this scope
collection_modules
() – unused
Process package update requests (chroot)
process results in command type
namedtuple
kiwi.package_manager.PackageManager
Bases: object
Package manager factory
repository
() – instance of Repository
package_manager
() – package manager name
custom_args
() – custom package manager arguments list
kiwi.exceptions.KiwiPackageManagerSetupError
– if the requested package manager
type is not supported
package manager
PackageManagerBase subclass
kiwi.partitioner.base
Module #kiwi.partitioner.base.PartitionerBase
Bases: object
Base class for partitioners
Create partition
Implementation in specialized partitioner class
name
() – unused
mbsize
() – unused
type_name
() – unused
flags
() – unused
Current partition number
Zero indicates no partition has been created so far
partition number
int
Post initialization method
Implementation in specialized partitioner class
Resize partition table
entries
() – unused
Set partition flag
Implementation in specialized partitioner class
partition_id
() – unused
flag_name
() – unused
Turn partition table into hybrid table if supported
Implementation in specialized partitioner class
Turn partition table into MBR (msdos table)
Implementation in specialized partitioner class
Set start sector of first partition as configured
start_sector
() – unused
Does nothing by default
kiwi.partitioner.dasd
Module #kiwi.partitioner.dasd.PartitionerDasd
Bases: PartitionerBase
Implements DASD partition setup
Create DASD partition
name
() – partition name
mbsize
() – partition size
type_name
() – unused
flags
() – unused
Post initialization method
Setup fdasd partition type/flag map
Resize partition table
Nothing to be done here for DASD devices
entries
() – unused
kiwi.partitioner.gpt
Module #kiwi.partitioner.gpt.PartitionerGpt
Bases: PartitionerBase
Implements GPT partition setup
Create GPT partition
name
() – partition name
mbsize
() – partition size
type_name
() – partition type
flags
() – additional flags
Post initialization method
Setup gdisk partition type/flag map
Resize partition table
entries
() – number of default entries
Set GPT partition flag
partition_id
() – partition number
flag_name
() – name from flag map
Turn partition table into hybrid GPT/MBR table
Turn partition table into MBR (msdos table)
kiwi.partitioner.msdos
Module #kiwi.partitioner.msdos.PartitionerMsDos
Bases: PartitionerBase
Implement old style msdos partition setup
Create msdos partition
name
() – partition name
mbsize
() – partition size
type_name
() – partition type
flags
() – additional flags
Post initialization method
Setup sfdisk partition type/flag map
Resize partition table
Nothing to be done here for msdos table
entries
() – unused
Set msdos partition flag
partition_id
() – partition number
flag_name
() – name from flag map
Set start sector of first partition as configured. fdisk and friends are not able to work correctly if the start sector of the first partition is any different from 2048.
start_sector
() – sector size
kiwi.partitioner.Partitioner
Bases: object
Partitioner factory
table_type
() – Table type name
storage_provider
() – Instance of class based on DeviceProvider
start_sector
() – sector number
extended_layout
() – support extended layout for msdos table
kiwi.repository.base
Module #kiwi.repository.base.RepositoryBase
Bases: object
Implements base class for package manager repository handling
Attributes
root_bind
() – instance of RootBind
root_dir
() – root directory path name
shared_location
() – shared directory between image root
and build system root
Add repository
Implementation in specialized repository class
name
() – unused
uri
() – unused
repo_type
() – unused
prio
() – unused
dist
() – unused
components
() – unused
user
() – unused
secret
() – unused
credentials_file
() – unused
repo_gpgcheck
() – unused
pkg_gpgcheck
() – unused
sourcetype
() – unused
use_for_bootstrap
() – unused
customization_script
() – unused
Cleanup/Delete unused repositories
Only configured repositories according to the image configuration are allowed to be active when building
Implementation in specialized repository class
Delete all repositories
Implementation in specialized repository class
Delete repository
Implementation in specialized repository class
name
() – unused
Delete repository cache
Implementation in specialized repository class
name
() – unused
Imports trusted keys into the image
Implementation in specialized repository class
signing_keys
() – list of the key files to import
Post initialization method
Implementation in specialized repository class
custom_args
() – unused
Run an optional customization script
script_path
() – unused
repo_file
() – unused
Repository runtime configuration and environment
Implementation in specialized repository class
Setup package database configuration
Implementation in specialized repository class
Call repository operations with default repository manager setup
Implementation in specialized repository class
kiwi.repository.dnf4
Module #kiwi.repository.dnf4.RepositoryDnf4
Bases: RepositoryBase
Implements repository handling for dnf package manager
shared_dnf_dir
() – shared directory between image root
and build system root
runtime_dnf_config_file
() – dnf runtime config file name
command_env
() – customized os.environ for dnf
runtime_dnf_config
() – instance of ConfigParser
Add dnf repository
name
() – repository base file name
uri
() – repository URI
repo_type
() – repostory type name
prio
() – dnf repostory priority
dist
() – unused
components
() – unused
user
() – unused
secret
() – unused
credentials_file
() – unused
repo_gpgcheck
() – enable repository signature validation
pkg_gpgcheck
() – enable package signature validation
sourcetype
() – source type, one of ‘baseurl’, ‘metalink’ or ‘mirrorlist’
use_for_bootstrap
() – unused
customization_script
() – custom script called after the repo file was created
Delete unused dnf repositories
Repository configurations which are not used for this build must be removed otherwise they are taken into account for the package installations
Delete all dnf repositories
Delete dnf repository
name
() – repository base file name
Delete dnf repository cache
The cache data for each repository is stored in a directory and additional files all starting with the repository name. The method glob deletes all files and directories matching the repository name followed by any characters to cleanup the cache information
name
() – repository name
Imports trusted keys into the image
signing_keys
() – list of the key files to import
Post initialization method
Store custom dnf arguments and create runtime configuration and environment
custom_args
() – dnf arguments
dnf runtime configuration and environment
dnf_args:list, command_env:dict
dict
Setup rpm macros for bootstrapping and image building
Create the rpm image macro which persists during the build
Create the rpm bootstrap macro to make sure for bootstrapping the rpm database location matches the host rpm database setup. This macro only persists during the bootstrap phase. If the image was already bootstrapped a compat link is created instead.
Setup dnf repository operations to store all data in the default places
kiwi.repository.zypper
Module #kiwi.repository.zypper.RepositoryZypper
Bases: RepositoryBase
Implements repo handling for zypper package manager
shared_zypper_dir
() – shared directory between image root
and build system root
runtime_zypper_config_file
() – zypper runtime config file name
runtime_zypp_config_file
() – libzypp runtime config file name
zypper_args
() – zypper caller args plus additional custom args
command_env
() – customized os.environ for zypper
runtime_zypper_config
() – instance of ConfigParser
Add zypper repository
name
() – repository name
uri
() – repository URI
repo_type
() – repostory type name
prio
() – zypper repostory priority
dist
() – unused
components
() – unused
user
() – credentials username
secret
() – credentials password
credentials_file
() – zypper credentials file
repo_gpgcheck
() – enable repository signature validation
pkg_gpgcheck
() – enable package signature validation
sourcetype
() – unused
use_for_bootstrap
() – unused
customization_script
() – custom script called after the repo file was created
Delete unused zypper repositories
zypper creates a system solvable which is unwanted for the purpose of building images. In addition zypper fails with an error message ‘Failed to cache rpm database’ if such a system solvable exists and a new root system is created
All other repository configurations which are not used for this build must be removed too, otherwise they are taken into account for the package installations
Delete all zypper repositories
Delete zypper repository
name
() – repository name
Delete zypper repository cache
The cache data for each repository is stored in a list of directories of the same name as the repository name. The method deletes these directories to cleanup the cache information
name
() – repository name
Imports trusted keys into the image
signing_keys
() – list of the key files to import
Post initialization method
Store custom zypper arguments and create runtime configuration and environment
custom_args
() – zypper arguments
zypper runtime configuration and environment
Setup rpm macros for bootstrapping and image building
Create the rpm image macro which persists during the build
Create the rpm bootstrap macro to make sure for bootstrapping the rpm database location matches the host rpm database setup. This macro only persists during the bootstrap phase. If the image was already bootstrapped a compat link is created instead.
Create zypper compat link
Setup zypper repository operations to store all data in the default places
kiwi.repository.Repository
Bases: object
Repository factory
root_bind
() – instance of RootBind
package_manager
() – package manager name
custom_args
() – list of custom package manager arguments
to setup the repository
kiwi.exceptions.KiwiRepositorySetupError
– if package_manager is not supported
kiwi.repository.template.apt
Module #kiwi.repository.template.apt.PackageManagerTemplateAptGet
Bases: object
apt-get configuration file template
apt-get package manager template for apt-get called outside of the image, not chrooted
Template
apt-get package manager template for apt-get called inside of the image, chrooted
Template
kiwi.solver.repository.base
Module #kiwi.solver.repository.base.SolverRepositoryBase
Bases: object
Base class interface for SAT solvable creation.
uri
() – Instance of Uri
user
() – User name for uri authentication
secret
() – Secret token for uri authentication
Create SAT solvable for this repository from previously created intermediate solvables by merge and store the result solvable in the specified target_dir
target_dir
() – path name
file path to solvable
str
Download given source file from the repository and store it as target file
The repo_source location is used relative to the repository
location and will be part of a mime type source like:
file://repo_path/repo_source
repo_source
() – source file in the repo
target
() – file path
kiwi.exceptions.KiwiUriOpenError
– if the download fails
Check if repository metadata is up to date
True or False
bool
Return repository timestamp
The retrieval of the repository timestamp depends on the type of the repository and is therefore supposed to be implemented in the specialized Solver Repository classes. If no such implementation exists the method returns the value ‘static’ to indicate there is no timestamp information available.
str
kiwi.solver.repository.rpm_md.SolverRepositoryRpmMd
Bases: SolverRepositoryBase
Class for SAT solvable creation for rpm-md type repositories.
Get timestamp from the first primary metadata
time value as text
str
kiwi.solver.repository.rpm_dir.SolverRepositoryRpmDir
Bases: SolverRepositoryBase
Class for SAT solvable creation for rpm_dir type repositories.
kiwi.solver.repository.suse.SolverRepositorySUSE
Bases: SolverRepositoryBase
Class for SAT solvable creation for SUSE type repositories.
kiwi.solver.repository.SolverRepository
Bases: object
Repository factory for creation of SAT solvables
Instance of Uri
kiwi.solver.sat
Module #kiwi.solver.sat.Sat
Bases: object
Sat Solver class to run package solver operations
The class uses SUSE’s libsolv sat plugin
Add a repository solvable to the pool. This basically add the required repository metadata which is needed to run a solver operation later.
solver_repository
() – Instance of SolverRepository
Solve dependencies for the given job list. The list is allowed to contain element names of the following format:
name describes a package name
pattern:name describes a package collection name whose metadata type is called ‘pattern’ and stored as such in the repository metadata. Usually SUSE repos uses that
group:name describes a package collection name whose metadata type is called ‘group’ and stored as such in the repository metadata. Usually RHEL/CentOS/Fedora repos uses that
job_names
() – list of strings
skip_missing
() – skip job if not found
ignore_recommended
() – do not include recommended packages
kiwi.exceptions.KiwiSatSolverJobProblems
– if solver reports solving problems
Transaction result information
dict
kiwi.storage.device_provider
Module #kiwi.storage.device_provider.DeviceProvider
Bases: object
Base class for any class providing storage devices
Size of device in bytes
device
() – node name
byte value from blockdev
int
Representation of device nodes
Could provide one ore more devices representing the storage Implementation in specialized device provider class
UUID of device
device
() – node name
UUID from blkid
str
Check if device provider is loop based
By default this is always False and needs an implementation in the the specialized device provider class
True or False
bool
kiwi.storage.disk
Module #kiwi.storage.disk.Disk
Bases: DeviceProvider
Implements storage disk and partition table setup
Activate boot partition
Note: not all Partitioner instances supports this
Create boot partition
Populates kiwi_BootPart(id) and optional kiwi_BootPartClone(id)
mbsize
() – partition size string
clone
() – create [clone] cop(y/ies) of the boot partition
Create partitions from custom data set
table_entries = {
map_name: ptable_entry_type
}
table
() – partition table spec
Create EFI bios grub partition
Populates kiwi_BiosGrub(id)
mbsize
() – partition size string
Create EFI partition
Populates kiwi_EfiPart(id)
mbsize
() – partition size string
Turn partition table into a hybrid GPT/MBR table
Note: only GPT tables supports this
Turn partition table into MBR (msdos table)
Note: only GPT tables supports this
Create prep partition
Populates kiwi_PrepPart(id)
mbsize
() – partition size string
Create root partition for use with LVM
Populates kiwi_RootPart(id)
mbsize
() – partition size string
clone
() – create [clone] cop(y/ies) of the lvm roo partition
Create root partition
Populates kiwi_RootPart(id) and kiwi_BootPart(id) if no extra boot partition is requested
mbsize
() – partition size string
clone
() – create [clone] cop(y/ies) of the root partition
Create root partition for use with MD Raid
Populates kiwi_RootPart(id) and kiwi_RaidPart(id) as well as the default raid device node at boot time which is configured to be kiwi_RaidDev(/dev/mdX)
mbsize
() – partition size string
clone
() – create [clone] cop(y/ies) of the raid root partition
Create root readonly partition for use with overlayfs
Populates kiwi_ReadOnlyPart(id), the partition is meant to contain a squashfs readonly filesystem. The partition size should be the size of the squashfs filesystem in order to avoid wasting disk space
mbsize
() – partition size string
clone
() – create [clone] cop(y/ies) of the ro root partition
Create spare partition for custom use
Populates kiwi_SparePart(id)
mbsize
() – partition size string
Create swap partition
Populates kiwi_SwapPart(id)
mbsize
() – partition size string
Names of partition devices
Note that the mapping requires an explicit map() call
instances of MappedDevice
dict
Populated partition name to number map
Check if storage provider is loop based
The information is taken from the storage provider. If the storage provider is loop based the disk is it too
True or False
bool
Map/Activate partitions
In order to access the partitions through a device node it is required to map them if the storage provider is loop based
Set start sector
Note: only effective on DOS tables
Zap (destroy) any GPT and MBR data structures if present For DASD disks create a new VTOC table
kiwi.storage.disk.ptable_entry_type
Bases: tuple
Alias for field number 1
Alias for field number 5
Alias for field number 0
Alias for field number 4
Alias for field number 2
Alias for field number 3
kiwi.storage.loop_device
Module #kiwi.storage.loop_device.LoopDevice
Bases: DeviceProvider
Create and manage loop device file for block operations
filename
() – loop file name to create
filesize_mbytes
() – size of the loop file
blocksize_bytes
() – blocksize used in loop driver
Setup a loop device of the blocksize given in the constructor The file to loop is created with the size specified in the constructor unless an existing one should not be overwritten
overwrite
() – overwrite existing file to loop
Device node name
device node name
str
Always True
True
bool
kiwi.storage.luks_device
Module #kiwi.storage.luks_device.LuksDevice
Bases: DeviceProvider
Implements luks setup on a storage device
storage_provider
() – Instance of class based on DeviceProvider
Create luks device. Please note the passphrase is readable at creation time of this image. Make sure your host system is secure while this process runs
passphrase
() – credentials
osname
() – distribution name to match distribution specific
options for cryptsetup
options
() – further cryptsetup options
keyfile
() – file path name
file path name which contains an alternative key
to unlock the luks device
root_dir
() – root dir path
Create crypttab, setting the UUID of the storage device
filename
() – file path name
Create keyfile with random data
filename
() – file path name
Instance of MappedDevice providing the luks device
mapped luks device
Check if storage provider is loop based
Return loop status from base storage provider
True or False
bool
kiwi.storage.mapped_device
Module #kiwi.storage.mapped_device.MappedDevice
Bases: DeviceProvider
Hold a reference on a single device
device_provider
() – Instance of class based on DeviceProvider
device
() – Device node name
Mapped device node name
device node name
str
Check if storage provider is loop based
Return loop status from base storage provider
True or False
bool
kiwi.storage.raid_device
Module #kiwi.storage.raid_device.RaidDevice
Bases: DeviceProvider
Implement raid setup on a storage device
storage_provider
() – Instance of class based on DeviceProvider
Create a raid array in degraded mode with one device missing. This only works in the raid levels 0(striping) and 1(mirroring)
raid_level
() – raid level name
Create mdadm config file from mdadm request
filename
() – config file name
Instance of MappedDevice providing the raid device
mapped raid device
Check if storage provider is loop based
Return loop status from base storage provider
True or False
bool
kiwi.storage.clone_device
Module #kiwi.storage.clone_device.CloneDevice
Bases: DeviceProvider
Implements device cloning
Clone source device to target device(s)
target_devices
() – List of target DeviceProvider instances
kiwi.storage.setup
Module #kiwi.storage.setup.DiskSetup
Bases: object
Implements disk setup methods
Methods from this class provides information required before building a disk image
xml_state
() – Instance of XMLState
root_dir
() – root directory path name
Size of the boot partition in mbytes
boot size mbytes
int
Filesystem Label to use for the boot partition
label name
str
Precalculate disk size requirements in mbytes
root_clone
() – root partition gets cloned, N+1 times the size is needed
boot_clone
() – boot partition gets cloned, N+1 times the size is needed
disk size mbytes
int
Filesystem Label to use for the EFI partition
label name
str
Filesystem Label to use for the root partition
If not specified in the XML configuration the default root label is set to ‘ROOT’
label name
str
Decide if an extra boot partition is needed. This is done with the bootpartition attribute from the type, however if it is not set it depends on some other type configuration parameters if we need a boot partition or not
True or False
bool
kiwi.storage.subformat.base
Module #kiwi.storage.subformat.base.DiskFormatBase
Bases: object
Base class to create disk formats from a raw disk image
xml_state
() – Instance of XMLState
root_dir
() – root directory path name
arch
() – Defaults.get_platform_name
target_dir
() – target directory path name
custom_args
() – custom format options dictionary
Create disk format
Implementation in specialized disk format class required
Create list of qemu options from custom_args dict
custom_args
() – arguments
qemu option list
list
Create target file path name for specified format
format_name
() – disk format name
file path name
str
Check if the base raw disk image exists
True or False
bool
Post initialization method
Implementation in specialized disk format class if required
custom_args
() – unused
Resize raw disk image to specified size. If the request would actually shrink the disk an exception is raised. If the disk got changed the method returns True, if the new size is the same as the current size nothing gets resized and the method returns False
size
() – size in bytes
True or False
bool
Store result file of the format conversion into the provided result instance.
By default only the converted image file will be stored as compressed file. Subformats which creates additional metadata files or want to use other result flags needs to overwrite this method
result
() – Instance of Result
kiwi.storage.subformat.gce
Module #kiwi.storage.subformat.gce.DiskFormatGce
Bases: DiskFormatBase
Create GCE - Google Compute Engine image format
Create GCE disk format and manifest
Google requires the image name to follow their naming convetion. Therefore it’s required to provide a suitable name by overriding the base class method
format_name
() – gce
file path name
str
GCE disk format post initialization method
Store disk tag from custom args
custom_args
() –
custom gce argument dictionary
{'--tag': 'billing_code'}
Store result file of the gce format conversion into the provided result instance. In this case compression is unwanted because the gce tarball is already created as a compressed archive
result
() – Instance of Result
kiwi.storage.subformat.ova
Module #kiwi.storage.subformat.ova.DiskFormatOva
Bases: DiskFormatBase
Create ova disk format, based on vmdk
Create ova disk format using ovftool from https://www.vmware.com/support/developer/ovf
vmdk disk format post initialization method
Store qemu options as list from custom args dict
custom_args
() – custom qemu arguments dictionary
Store the resulting ova file into the provided result instance.
result
() – Instance of Result
kiwi.storage.subformat.qcow2
Module #kiwi.storage.subformat.qcow2.DiskFormatQcow2
Bases: DiskFormatBase
Create qcow2 disk format
Create qcow2 disk format
qcow2 disk format post initialization method
Store qemu options as list from custom args dict
custom_args
() – custom qemu arguments dictionary
Store result file of the format conversion into the provided result instance.
In case of a qcow2 format we store the result uncompressed Since the format conversion only takes the real bytes into account such that the sparseness of the raw disk will not result in the output format and can be taken one by one
result
() – Instance of Result
kiwi.storage.subformat.vagrant_base
Module #kiwi.storage.subformat.vagrant_base.DiskFormatVagrantBase
Bases: DiskFormatBase
Base class for creating vagrant boxes.
The documentation of the vagrant box format can be found here: https://www.vagrantup.com/docs/boxes/format.html In a nutshell, a vagrant box is a tar, tar.gz or zip archive of the following:
metadata.json
:
A json file that contains the name of the provider
and arbitrary additional data (that vagrant doesn’t care about).
Vagrantfile
:
A Vagrantfile which defines the boxes’ MAC address. It
can be also used to define other settings of the box, e.g.
the method via which the /vagrant/
directory is shared.
This file is either automatically generated by KIWI or we use a file
that has been provided by the user (depends on the setting in
vagrantconfig.embebbed_vagrantfile
)
The actual virtual disk image: this is provider specific and vagrant simply forwards it to your virtual machine provider.
Required methods/variables that child classes must implement:
post initializing method that has to specify the vagrant
provider name in provider
and the box name in
image_format
. Note: new providers also needs to
be specified in the schema and the box name needs to be
registered to
kiwi.defaults.Defaults.get_disk_format_types
Optional methods:
Provider specific image creation step: this function creates the actual box image. It must be implemented by a child class.
Create a vagrant box for any provider. This includes:
creation of box metadata.json
creation of box Vagrantfile (either from scratch or by using the user provided Vagrantfile)
creation of result format tarball from the files created above
Provide create_image_format()
with additional metadata
that will be included in metadata.json
.
The default implementation returns an empty dictionary.
A dictionary that is serializable to JSON
dict
Supply additional configuration settings for vagrant to be included in the resulting box.
This function can be used by child classes to customize the behavior
for different providers: the supplied configuration settings get
forwarded to VagrantConfigTemplate.get_template()
as the
parameter custom_settings
and included in the Vagrantfile
.
The default implementation returns nothing.
additional vagrant settings
str
vagrant disk format post initialization method
store vagrantconfig information provided via custom_args
custom_args
() –
Contains instance of xml_parse::vagrantconfig
{'vagrantconfig': object}
Store result file of the vagrant format conversion into the provided result instance. In this case compression is unwanted because the box is already created as a compressed tarball
result
() – Instance of Result
Vagrant provider specific post initialization method
Setup vagrant provider and box name. This information must be set by the specialized provider class implementation to make the this base class methods effective
kiwi.storage.subformat.vagrant_libvirt
Module #kiwi.storage.subformat.vagrant_libvirt.DiskFormatVagrantLibVirt
Bases: DiskFormatVagrantBase
Create a vagrant box for the libvirt provider
Creates the qcow2 disk image box for libvirt vagrant provider
temp_image_dir
() – Path to the temporary directory used to build the box image
A list of files relevant for the libvirt box to be included in the vagrant box
list
Provide box metadata needed to create the box in vagrant
Returns a dictionary containing the virtual image format and the size of the image.
dict
Returns settings for the libvirt provider telling vagrant to use kvm.
ruby code to be evaluated as string
str
Vagrant provider specific post initialization method
Setup vagrant provider and box name. This information must be set by the specialized provider class implementation to make the this base class methods effective
kiwi.storage.subformat.vagrant_virtualbox
Module #kiwi.storage.subformat.vagrant_virtualbox.DiskFormatVagrantVirtualBox
Bases: DiskFormatVagrantBase
Create a vagrant box for the virtualbox provider
Create the vmdk image for the Virtualbox vagrant provider.
This function creates the vmdk disk image and the ovf file.
The latter is created via the class VirtualboxOvfTemplate
.
temp_image_dir
() – Path to the temporary directory used to build the box image
A list of files relevant for the virtualbox box to be included in the vagrant box
list
Configure the default shared folder to use rsync when guest additions are not present inside the box.
ruby code to be evaluated as string
str
Vagrant provider specific post initialization method
Setup vagrant provider and box name. This information must be set by the specialized provider class implementation to make the this base class methods effective
kiwi.storage.subformat.vdi
Module #kiwi.storage.subformat.vdi.DiskFormatVdi
Bases: DiskFormatBase
Create vdi disk format
Create vdi disk format
vdi disk format post initialization method
Store qemu options as list from custom args dict
custom_args
() – custom qemu arguments dictionary
kiwi.storage.subformat.vhd
Module #kiwi.storage.subformat.vhd.DiskFormatVhd
Bases: DiskFormatBase
Create vhd disk format
Create vhd disk format
vhd disk format post initialization method
Store qemu options as list from custom args dict
custom_args
() – custom qemu arguments dictionary
kiwi.storage.subformat.vhdfixed
Module #kiwi.storage.subformat.vhdfixed.DiskFormatVhdFixed
Bases: DiskFormatBase
Create vhd image format in fixed subformat
Create vhd fixed disk format
vhd disk format post initialization method
Store qemu options as list from custom args dict Extract disk tag from custom args
custom_args
() –
custom vhdfixed and qemu argument dictionary
{'--tag': 'billing_code', '--qemu-opt': 'value'}
Store result file of the vhdfixed format conversion into the provided result instance. In this case compressing the result is preferred as vhdfixed is not a compressed or dynamic format.
result
() – Instance of Result
kiwi.storage.subformat.vhdx
Module #kiwi.storage.subformat.vhdx.DiskFormatVhdx
Bases: DiskFormatBase
Create vhdx image format in dynamic subformat
Create vhdx dynamic disk format
vhdx disk format post initialization method
Store qemu options as list from custom args dict
custom_args
() – custom qemu arguments dictionary
kiwi.storage.subformat.vmdk
Module #kiwi.storage.subformat.vmdk.DiskFormatVmdk
Bases: DiskFormatBase
Create vmdk disk format
Create vmdk disk format and machine settings file
vmdk disk format post initialization method
Store qemu options as list from custom args dict
custom_args
() – custom qemu arguments dictionary
Store result files of the vmdk format conversion into the provided result instance. This includes the vmdk image file and the VMware settings file
result
() – Instance of Result
kiwi.storage.subformat.DiskFormat
Bases: object
DiskFormat factory
name
() – Format name
xml_state
() – Instance of XMLState
root_dir
() – root directory path name
target_dir
() – target directory path name
kiwi.storage.subformat.template.vmware_settings
Module #kiwi.storage.subformat.template.vmware_settings.VmwareSettingsTemplate
Bases: object
VMware machine settings template
VMware machine configuration template
memory_setup
() – with main memory setup true|false
cpu_setup
() – with number of CPU’s setup true|false
network_setup
() – with network emulation true|false
iso_setup
() – with CD/DVD drive emulation true|false
disk_controller
() – add disk controller setup to template
iso_controller
() – add CD/DVD controller setup to template
network_mac
() – add static MAC address setup to template
network_driver
() – add network driver setup to template
network_connection_type
() – add connection type to template
Template
kiwi.storage.subformat.template.vagrant_config
Module #kiwi.storage.subformat.template.vagrant_config.VagrantConfigTemplate
Bases: object
Generate a Vagrantfile configuration template
This class creates a simple template for the Vagrantfile that is included inside a vagrant box.
The included Vagrantfile carries additional information for vagrant: by
default that is nothing, but depending on the provider additional
information need to be present. These can be passed via the parameter
custom_settings
to the method get_template()
.
Example usage:
The default without any additional settings will result in this Vagrantfile:
>>> vagrant_config = VagrantConfigTemplate()
>>> print(
... vagrant_config.get_template()
... )
Vagrant.configure("2") do |config|
end
If your provider/box requires additional settings, provide them as follows:
>>> extra_settings = dedent('''
... config.vm.hostname = "no-dead-beef"
... config.vm.provider :special do |special|
... special.secret_settings = "please_work"
... end
... ''').strip()
>>> print(
... vagrant_config.get_template(extra_settings)
... )
Vagrant.configure("2") do |config|
config.vm.hostname = "no-dead-beef"
config.vm.provider :special do |special|
special.secret_settings = "please_work"
end
end
Return a new template with custom_settings
included and
indented appropriately.
custom_settings
() – String of additional settings that get
pasted into the Vagrantfile template. The string is put at the
correct indentation level for you, but the internal indentation has
to be provided by the caller.
A string with custom_settings
inserted at the
appropriate position. The template has one the variable
mac_address
that must be substituted.
str
kiwi.storage.subformat.template.virtualbox_ovf
Module #kiwi.storage.subformat.template.virtualbox_ovf.VirtualboxOvfTemplate
Bases: object
Generate a OVF file template for a vagrant virtualbox box
This class provides a template for virtualbox’ ovf configuration file that is embedded inside the vagrant box. The template itself was extracted from a vagrant box that was build via packer and from a script provided by Neal Gompa.
Return the actual ovf template. The following values must be
substituted:
- vm_name
: the name of this VM
- disk_image_capacity
: Size of the virtual disk image in GB
- vm_description
: a description of this VM
kiwi.system.identifier
Module #kiwi.system.identifier.SystemIdentifier
Bases: object
Create a random ID to identify the system
The information is used to create the mbrid file as an example
image_id
() – hex identifier string
Calculate random hex id
Using 4 tuples of rand in range from 1..0xfe
Current hex identifier
hex id
str
Write current hex identifier to file
filename
() – file path name
Write current hex identifier to MBR at offset 0x1b8 on disk
device_provider
() – Instance based on DeviceProvider
kiwi.system.kernel
Module #kiwi.system.kernel.Kernel
Bases: object
Implementes kernel lookup and extraction from given root tree
root_dir
() – root directory path name
kernel_names
() – list of kernel names to search for
functions.sh::suseStripKernel() provides a normalized
file so that we do not have to search for many different
names in this code
Copy kernel to specified target
If no file_name is given the target filename is set as kernel-<kernel.version>.kernel
target_dir
() – target path name
filename
() – base filename in target
Copy xen hypervisor to specified target
If no file_name is given the target filename is set as hypervisor-<xen.name>
target_dir
() – target path name
filename
() – base filename in target
Lookup kernel files and provide filename and version
raise_on_not_found
() – sets the method to raise an exception
if the kernel is not found
kiwi.exceptions.KiwiKernelLookupError
– if raise_on_not_found flag is active
and kernel is not found
tuple with filename, kernelname and version
tuple|None
Lookup xen hypervisor and provide filename and hypervisor name
tuple with filename and hypervisor name
tuple|None
kiwi.system.kernel.kernel_type
Bases: tuple
Alias for field number 1
Alias for field number 0
Alias for field number 2
kiwi.system.kernel.xen_hypervisor_type
Bases: tuple
Alias for field number 0
Alias for field number 1
kiwi.system.prepare
Module #kiwi.system.prepare.SystemPrepare
Bases: object
Implements preparation and installation of a new root system
xml_state
() – instance of XMLState
root_dir
() – Path to new root directory
allow_existing
() – Allow using an existing root_dir
This methods cleans some package manager artifacts created at run time such as macros
Delete one or more packages using the package manager inside
of the new root directory. If the removal is set with force
flag
only listed packages are deleted and any dependency break or leftover
is ignored.
manager
() – instance of a PackageManager
subclass
packages
() – package list
force
() – force deletion true|false
kiwi.exceptions.KiwiSystemDeletePackagesFailed
– if installation process fails
Install system software using the package manager from the host, also known as bootstrapping
manager
() – instance of a PackageManager
subclass
plus_packages
() – list of additional packages
kiwi.exceptions.KiwiBootStrapPhaseFailed
– if the bootstrapping process fails either installing
packages or including bootstrap archives
Install one or more packages using the package manager inside of the new root directory
manager
() – instance of a PackageManager
subclass
packages
() – package list
kiwi.exceptions.KiwiSystemInstallPackagesFailed
– if installation process fails
Install system software using the package manager inside of the new root directory. This is done via a chroot operation and requires the desired package manager to became installed via the bootstrap phase
manager
() – instance of a PackageManager
subclass
kiwi.exceptions.KiwiInstallPhaseFailed
– if the install process fails either installing
packages or including any archive
Delete packages marked for deletion in the XML description. If force
param is set to False uninstalls packages marked with
type="uninstall"
if any; if force is set to True deletes packages
marked with type="delete"
if any.
manager
() – instance of PackageManager
subclass
force
() – Forced deletion True|False
kiwi.exceptions.KiwiPackagesDeletePhaseFailed
– if the deletion packages process fails
Set up repositories for software installation and return a package manager for performing software installation tasks
clear_cache
() – Flag the clear cache before configure anything
signing_keys
() – Keys imported to the package manager
target_arch
() – Target architecture name
instance of PackageManager
subclass
Install package updates from the used repositories. the process uses the package manager from inside of the new root directory
manager
() – instance of a PackageManager
subclass
kiwi.exceptions.KiwiSystemUpdateFailed
– if packages update fails
kiwi.system.profile
Module #kiwi.system.profile.Profile
Bases: object
Create bash readable .profile environment from the XML description
xml_state
() – instance of :class`XMLState`
Add key/value pair to profile dictionary
key
() – profile key
value
() – profile value
Create bash quoted profile
filename
() – file path name
Return all profile elements that has a value
kiwi.system.result
Module #kiwi.system.result.Result
Bases: object
Collect image building results
result_files
() – dict of result files
class_version
() – Result
class version
xml_state
() – instance of XMLState
Add result tuple to result_files list
key
() – name
filename
() – file path name
use_for_bundle
() – use when bundling results true|false
compress
() – compress when bundling true|false
shasum
() – create shasum when bundling true|false
Picke dump this instance to a file
filename
() – file path name
portable
() – If set to true also create a .json formatted variant
of the dump file which contains the elements of this
instance that could be expressed in a portable json
document. Default is set to: True
kiwi.exceptions.KiwiResultError
– if pickle fails to dump Result
instance
Current list of result tuples
Load pickle dumped filename into a Result instance
filename
() – file path name
kiwi.exceptions.KiwiResultError
– if filename does not exist or pickle fails
to load filename
Print results human readable
Verifies the given image file does not exceed the size limit. Throws an exception if the limit is exceeded. If the size limit is set to None no verification is done.
size_limit
() – The size limit for filename in bytes.
filename
() – File to verify.
kiwi.exceptions.KiwiResultError
– if filename exceeds the size limit
kiwi.system.result.result_file_type
Bases: tuple
Alias for field number 2
Alias for field number 0
Alias for field number 3
Alias for field number 1
Bases: tuple
Alias for field number 2
Alias for field number 3
Alias for field number 5
Alias for field number 0
Alias for field number 1
Alias for field number 4
Alias for field number 6
Alias for field number 7
kiwi.system.root_bind
Module #kiwi.system.root_bind.RootBind
Bases: object
Implements binding/copying of host system paths into the new root directory
root_dir
() – root directory path name
cleanup_files
() – list of files to cleanup, delete
mount_stack
() – list of mounted directories for cleanup
dir_stack
() – list of directories for cleanup
config_files
() – list of initial config files
bind_locations
() – list of kernel filesystems to bind mount
shared_location
() – shared directory between image root and
build system root
Cleanup mounted locations, directories and intermediate config files
Bind mount kernel filesystems
kiwi.exceptions.KiwiMountKernelFileSystemsError
– if some kernel filesystem
fails to mount
Bind mount shared location
The shared location is a directory which shares data from the image buildsystem host with the image root system. It is used for the repository setup and the package manager cache to allow chroot operations without being forced to duplicate this data
host_dir
() – directory to share between image root and build
system root
kiwi.exceptions.KiwiMountSharedDirectoryError
– if mount fails
Create intermediate config files
Some config files e.g etc/hosts needs to be temporarly copied from the buildsystem host to the image root system in order to allow e.g DNS resolution in the way as it is configured on the buildsystem host. These config files only exists during the image build process and are not part of the final image
kiwi.exceptions.KiwiSetupIntermediateConfigError
– if the management of
intermediate configuration files fails
Umount kernel filesystems
kiwi.exceptions.KiwiMountKernelFileSystemsError
– if some kernel filesystem
fails to mount
kiwi.system.root_init
Module #kiwi.system.root_init.RootInit
Bases: object
Implements creation of new root directory for a linux system
Host system independent static default files and device nodes are created to initialize a new base system
root_dir
() – root directory path name
Create new system root directory
The method creates a temporary directory and initializes it for the purpose of building a system image from it. This includes the following setup:
create core system paths
create static core device nodes
On success the contents of the temporary location are synced to the specified root_dir and the temporary location will be deleted. That way we never work on an incomplete initial setup
kiwi.exceptions.KiwiRootInitCreationError
– if the init creation fails
at some point
Force delete root directory and its contents
kiwi.system.setup
Module #kiwi.system.setup.SystemSetup
Bases: object
Implementation of system setup steps supported by kiwi
Kiwi is not responsible for the system configuration, however some setup steps needs to be performed in order to provide a minimal work environment inside of the image according to the desired image type.
xml_state
() – instance of XMLState
root_dir
() – root directory path name
Call config-host-overlay.sh script _NON_ chrooted
Call config-overlay.sh script chrooted
Call config.sh script chrooted
Call disk.sh script chrooted
Call configured editbootconfig script _NON_ chrooted
Pass the boot filesystem name and the partition number of the boot partition as parameters to the call
filesystem
() – boot filesystem name
boot_part_id
() – boot partition number
working_directory
() – directory name
Call configured editbootinstall script _NON_ chrooted
Pass the disk file name and the device node of the boot partition as parameters to the call
diskname
() – file path name
boot_device_node
() – boot device node name
working_directory
() – directory name
Call images.sh script chrooted
Call post_bootstrap.sh script chrooted
Call pre_disk_sync.sh script chrooted
Delete all traces of a kiwi description which are not required in the later image
Create etc/fstab from given Fstab object
Custom fstab modifications are possible and handled in the following order:
Look for an optional fstab.append file which allows to append custom fstab entries to the final fstab. Once embedded the fstab.append file will be deleted
Look for an optional fstab.patch file which allows to patch the current contents of the fstab file with a given patch file. Once patched the fstab.patch file will be deleted
Look for an optional fstab.script file which is called chrooted for the purpose of updating the fstab file as appropriate. Note: There is no validation in place that checks if the script actually handles fstab or any other file in the image rootfs. Once called the fstab.script file will be deleted
fstab
() – instance of Fstab
kiwi boot images provides the linuxrc script, however the kernel also expects an init executable to be present. This method creates a hard link to the linuxrc file
Create a compressed recovery archive from the root tree for use with kiwi’s recvoery system. The method creates additional data into the image root filesystem which is deleted prior to the creation of a new recovery data set
Export etc/modprobe.d to given root_dir
target_root_dir
() – path name
Export image package changelog for comparision of actual changes of the installed packages
target_dir
() – path name
Export image package list as metadata reference used by the open buildservice
target_dir
() – path name
Export package verification result as metadata reference used by the open buildservice
target_dir
() – path name
Copy cdroot files from the image description to the specified target directory. Supported is a tar archive named config-cdroot.tar[.compression-postfix]
target_dir
() – directory to unpack archive to
Import XML descriptions, custom scripts, archives and script helper methods
Create etc/ImageID identifier file
Copy overlay files from the image description to the image root tree. Supported are a root/ directory or a root.tar.gz tarball. The root/ directory takes precedence over the tarball.
In addition the method also supports profile specific overlay files which are searched in a directory of the same name as the profile name.
The overall order for including overlay files is as follows:
root/ dir or root.tar.gz
PROFILE_NAME/ dir(s) in the order of the selected profiles
follow_links
() – follow symlinks true|false
preserve_owner_group
() – preserve permissions true|false
Those <repository> sections which are marked with the imageinclude attribute should be permanently added to the image repository configuration
Check if provided script base name exists in the image description
name
() – script base name
Initialize the security context fields (extended attributes) on the files matching the security_context_file
security_context_file
() – path file name
Add groups for configured users
Setup console keyboard
Setup UTF8 system wide locale
Setup systemd machine id
There are various states of /etc/machine-id:
Does not exist: Triggers ConditionFirstBoot, but does not work if the filesystem is initially read-only (booted without “rw”).
Exists, is empty: Does not trigger ConditionFirstBoot, but works with read-only mounts.
Exists, contains the string “uninitialized”: Same as b), but triggers ConditionFirstBoot. Supported by systemd v247+ only.
Exists, contains a valid ID.
See the machine-id(5) man page for details.
In images, d) is not desirable, so truncate the file. This is the previous behaviour and what existing images expect. If the image has one of the other states, keep it as-is.
Check and Fix permissions using chkstat
Call chkstat in system mode which reads /etc/sysconfig/security to determine the configured security level and applies the appropriate permission definitions from the /etc/permissions* files. It’s possible to provide those files as overlay files in the image description to apply a certain permission setup when needed. Otherwise the default setup as provided on the package level applies.
It’s required that the image root system has chkstat installed. If not present KIWI skips this step and continuous with a warning.
Setup the KIWI configured splash theme as default
The method uses the plymouth-set-default-theme tool to setup the theme for the plymouth splash system. Only in case the tool could be found in the image root, it is assumed plymouth splash is in use and the tool is called in a chroot operation
Set SELinux file security contexts if the default context file is found
Setup timezone symlink
Add/Modify configured users
kiwi.system.shell
Module #kiwi.system.shell.Shell
Bases: object
Special character handling for shell evaluated code
Format given variable value to return a string value representation that can be sourced by shell scripts. If the provided value is not representable as a string (list, dict, tuple etc) an exception is raised
value
() – a python variable
kiwi.exceptions.KiwiShellVariableValueError
– if value is an iterable
string value representation
str
Quote characters which have a special meaning for bash but should be used as normal characters. actually I had planned to use pipes.quote but it does not quote as I had expected it. e.g ‘name_wit_a_$’ does not quote the $ so we do it on our own for the scope of kiwi
message
() – message text
quoted text
str
Quote given input file which has to be of the form key=value to be able to become sourced by the shell
filename
() – file path name
list of quoted text
List[str]
Run a function implemented in config/functions.sh
name
() – function name
parameters
() – function arguments
kiwi.system.size
Module #kiwi.system.size.SystemSize
Bases: object
Provide source tree size information
source_dir
() – source directory path name
Calculate sum of all files in the source tree
number of files
int
Calculate data size of all data in the source tree
exclude
() – list of paths to exclude
mbytes
int
Increase the sum of all file sizes by an empiric factor
Each filesystem has some overhead it needs to manage itself. Thus the plain data size is always smaller as the size of the container which embeds it. This method increases the given size by a filesystem specific empiric factor to ensure the given data size can be stored in a filesystem of the customized size
size
() – mbsize to update
requested_filesystem
() – filesystem name
mbytes
int
kiwi.system.uri
Module #kiwi.system.uri.Uri
Bases: object
Normalize and manage URI types
Create hex representation of uuid4
If the repository definition from the XML description does not provide an alias, kiwi creates one for you. However it’s better to assign a human readable alias in the XML configuration
alias name as hex representation of uuid4
str
Filename to store repository credentials
credentials file name
str
Returns the fragment part of the URI.
fragment part of the URI if any, empty string otherwise
str
Check if URI is considered to be publicly reachable
True|False
bool
Check if URI is a remote or local location
True|False
bool
Translate repository location according to their URI type
Depending on the URI type the provided location needs to be adapted e.g updated by the service URL in case of an open buildservice project name
kiwi.exceptions.KiwiUriStyleUnknown
– if the uri scheme can’t be detected, is
unknown or it is inconsistent with the build environment
check_build_environment
() – specify if the uri translation
should depend on the environment the build is called in. As of
today this only effects the translation result if the image
build happens inside of the Open Build Service
translated repository location
str
kiwi.system.users
Module #kiwi.system.users.Users
Bases: object
Operations on users and groups in a root directory
root_dir
() – root directory path name
Add group with options
group_name
() – group name
options
() – groupadd options
Check if group exists
group_name
() – group name
True|False
bool
Setup user home directory
user_name
() – user name
group_name
() – group name
home_path
() – path name
Add user with options
user_name
() – user name
options
() – useradd options
Check if user exists
user_name
() – user name
True|False
bool
Modify user with options
user_name
() – user name
options
() – usermod options
kiwi.tasks.base
Module #kiwi.tasks.base.CliTask
Bases: object
Base class for all task classes, loads the task and provides the interface to the command options and the XML description
Attributes
should_perform_task_setup
Indicates if the task should perform the setup steps which covers the following task configurations: * setup debug level * setup logfile * setup color output
Load, upgrade, validate XML description
description_directory
() – Path to the image description
kiwi_file
() – Basename of kiwi file which contains the main
image configuration elements. If not specified
kiwi searches for a file named config.xml or
a file matching .kiwi
Helper method for commandline options of the form –option a,b,c,d
Make sure to provide a common result for option values which separates the information in a comma separated list of values
option
() – comma separated option string
common option value representation
list
This method runs the given runtime checks excluding the ones disabled in the runtime configuration file.
checks
() – A dictionary with the runtime method names as keys
and their arguments list as the values.
Helper method for commandline options of the form –option a,b,c,d,e,f,g,h,i,j
Make sure to provide a common result for option values which separates the information in a comma separated list of values
option
() – comma separated option string
common option value representation
list
kiwi.tasks.result_bundle
Module #kiwi.tasks.result_bundle.ResultBundleTask
Bases: CliTask
Implements result bundler
Attributes
manual
Instance of Help
Create result bundle from the image build results in the specified target directory. Each result image will contain the specified bundle identifier as part of its filename. Uncompressed image files will also become xz compressed and a sha sum will be created from every result image
kiwi.tasks.result_list
Module #kiwi.tasks.result_list.ResultListTask
Bases: CliTask
Implements result listing
Attributes
manual
Instance of Help
List result information from a previous system command
kiwi.tasks.system_build
Module #kiwi.tasks.system_build.SystemBuildTask
Bases: CliTask
Implements building of system images
Attributes
manual
Instance of Help
Build a system image from the specified description. The build command combines the prepare and create commands
kiwi.tasks.system_create
Module #kiwi.tasks.system_create.SystemCreateTask
Bases: CliTask
Implements creation of system images
Attributes
manual
Instance of Help
Create a system image from the specified root directory the root directory is the result of a system prepare command
kiwi.tasks.system_prepare
Module #kiwi.tasks.system_prepare.SystemPrepareTask
Bases: CliTask
Implements preparation and installation of a new root system
Attributes
manual
Instance of Help
Prepare and install a new system for chroot access
kiwi.tasks.system_update
Module #kiwi.tasks.system_update.SystemUpdateTask
Bases: CliTask
Implements update and maintenance of root systems
Attributes
manual
Instance of Help
Update root system with latest repository updates and optionally allow to add or delete packages. the options to add or delete packages can be used multiple times
kiwi.utils.checksum
Module #kiwi.utils.block.BlockID
Bases: object
Get information from a block device
device
() – block device node name name. The device can
also be specified as UUID=<uuid>
Retrieve information for specified metadata ID from block device
id_type
() – metadata ID, see man blkid for details
ID of the block device
str
Retrieve filesystem type from block device
filesystem type
str
Retrieve filesystem label from block device
block device label
str
Retrieve number of partitions from block device
A number
int
Retrieve filesystem uuid from block device
uuid for the filesystem of the block device
str
kiwi.utils.block
Module #kiwi.utils.checksum.Checksum
Bases: object
Manage checksum creation for files
source_filename
() – source file name to build checksum for
checksum_filename
() – target file with checksum information
Compare given checksum with reference checksum stored in the provided filename. If the checksum matches the method returns True, or False in case it does not match
checksum
() – checksum string to compare
filename
() – filename containing checksum
True or False
bool
Create md5 checksum
filename
() – filename for checksum
checksum
str
Create sha256 checksum
filename
() – filename for checksum
kiwi.utils.compress
Module #kiwi.utils.compress.Compress
Bases: object
File compression / decompression
keep_source
() – Request to keep the uncompressed source
source_filename
() – Source file name to compress
supported_zipper
() – List of supported compression tools
compressed_filename
() – Compressed file name path with
compression suffix
uncompressed_filename
() – Uncompressed file name path
Detect compression format
compression format name or None if it couldn’t be inferred
Optional[str]
Create gzip(max compression) compressed file
Uncompress with format autodetection
By default the original source file will be changed into the uncompressed variant. If temporary is set to True a temporary file is created instead
temporary
() – uncompress to a temporary file
Create XZ compressed file
options
() – custom xz compression options
kiwi.utils.sync
Module #kiwi.utils.sync.DataSync
Bases: object
Sync data from a source directory to a target directory
Sync data from source to target using the rsync protocol
options
() – rsync options
exclude
() – file patterns to exclude
force_trailing_slash
() – add ‘/’ to source_dir if not present
A speciality of the rsync tool is that it behaves differently if the given source_dir ends with a ‘/’ or not. If it ends with a slash the data structure below will be synced to the target_dir. If it does not end with a slash the source_dir and its contents are synced to the target_dir. For example
source
└── some_data
1. $ rsync -a source target
target
└── source
└── some_data
2. $ rsync -a source/ target
target
└── some_data
The parameter force_trailing_slash can be used to make sure rsync behaves like shown in the second case. If set to true a ‘/’ is appended to the given source_dir if not already present
Check if the target directory supports extended filesystem attributes
True or False
bool
kiwi.utils.sysconfig
Module #kiwi.utils.sysconfig.SysConfig
Bases: object
Read and Write sysconfig style files
source_file
() – source file path
Write back source file with changed content but in same order
kiwi.volume_manager.base
Module #kiwi.volume_manager.base.VolumeManagerBase
Bases:
kiwi.storage.device_provider.DeviceProvider
Implements base class for volume management interface
mountpoint
() – root mountpoint for volumes
device_map
() – dictionary of low level DeviceProvider intances
root_dir
() – root directory path name
volumes
() – list of volumes from XMLState::get_volumes()
volume_group
() – volume group name
volume_map
() – map volume name to device node
mount_list
() – list of volume MountManager’s
device
() – storage device node name
custom_args
() – custom volume manager arguments for all
volume manager and filesystem specific tasks
custom_filesystem_args
() – custom filesystem creation and mount
arguments, subset of the custom_args information suitable to
be passed to a FileSystem instance
kiwi.exceptions.KiwiVolumeManagerSetupError
– if the given root_dir doesn’t exist
Write verification block on LVM devices is not supported
veritysetup on LVM devices is not supported
Implements creation of volume paths in the given root directory
Implements creation of volumes
Implementation in specialized volume manager class required
filesystem_name
() – unused
Implements hierarchical sorting of volumes according to their paths and provides information about the volume configured as the one eating all the rest space
list of canonical_volume_type tuples
list
Return current DeviceProvider dictionary
device_map
dict
Implements setup of the fstab entries. The method should return a list of fstab compatible entries
persistency_type
() – unused
filesystem_name
() – unused
Provides mount point directory
Effective use of the directory is guaranteed only after sync_data
directory path name
string
Provides name of the root volume
This is by default set to ‘/’. Volume Managers that supports the concept of sub-volumes overrides this method
directory path name
string
Implements size lookup for the given path and desired filesystem according to the specified size type
volume
() – volume to check size for
all_volumes
() – list of all volume tuples
filesystem_name
() – filesystem name
resize_on_boot
– specify the time of the resize. If the resize happens at
boot time the volume size is only the minimum size to
just store the data. If the volume size is fixed and
does not change at boot time the returned size is the
requested size which can be greater than the minimum
needed size.
mbsize
int
Implements return of dictionary of volumes and their mount options
Check if storage provider is loop based
The information is taken from the storage provider. If the storage provider is loop based the volume manager is it too
True of False
bool
Implements mounting of all volumes below one master directory
Implementation in specialized volume manager class required
Post initialization method
Implementation in specialized volume manager class if required
custom_args
() – unused
Implements setup of read-only root property
Implements setup required prior to the creation of volumes
Implementation in specialized volume manager class required
name
() – unused
Implements creation of a master directory holding the mounts of all volumes
Implements sync of root directory to mounted volumes
exclude
() – file patterns to exclude
Implements umounting of all volumes
Implementation in specialized volume manager class required
kiwi.volume_manager.btrfs
Module #kiwi.volume_manager.btrfs.VolumeManagerBtrfs
Bases: VolumeManagerBase
Implements btrfs sub-volume management
subvol_mount_list
() – list of mounted btrfs subvolumes
toplevel_mount
() – MountManager
for root mountpoint
Create configured btrfs subvolumes
Any btrfs subvolume is of the same btrfs filesystem. There is no way to have different filesystems per btrfs subvolume. Thus the filesystem_name has no effect for btrfs
filesystem_name
() – unused
Implements creation of the fstab entries. The method returns a list of fstab compatible entries
persistency_type
() – by-label | by-uuid
filesystem_name
() – unused
list of fstab entries
list
Provides btrfs root mount point directory
Effective use of the directory is guaranteed only after sync_data
directory path name
string
Provides name of the root volume
directory path name
string
Return dict of volumes
volumes dictionary
dict
Mount btrfs subvolumes
Post initialization method
Store custom btrfs initialization arguments
custom_args
() – custom btrfs volume manager arguments
Sets the root volume to be a readonly filesystem
Setup btrfs volume management
In case of btrfs an optional toplevel subvolume is created and marked as default volume. If snapshots are activated via the custom_args the setup method also creates the .snapshots/1/snapshot subvolumes. There is no concept of a volume manager name, thus the name argument is not used for btrfs
name
() – unused
Sync data into btrfs filesystem
If snapshots are activated the root filesystem is synced into the first snapshot
exclude
() – files to exclude from sync
Umount btrfs subvolumes
True if all subvolumes are successfully unmounted
bool
kiwi.volume_manager.lvm
Module #kiwi.volume_manager.lvm.VolumeManagerLVM
Bases: VolumeManagerBase
Implements LVM volume management
Create configured lvm volumes and filesystems
All volumes receive the same filesystem
filesystem_name
() – volumes filesystem name
Dictionary of MappedDevice instances per volume
Note: The mapping requires an explicit create_volumes() call
root plus volume device map
dict
Implements creation of the fstab entries. The method returns a list of fstab compatible entries
persistency_type
() – unused
filesystem_name
() – volumes filesystem name
fstab entries
list
Return dict of volumes
volumes dictionary
dict
Mount lvm volumes
Post initialization method
Store custom lvm initialization arguments
custom_args
() – custom lvm volume manager arguments
Setup lvm volume management
In case of LVM a new volume group is created on a PV initialized storage device
name
() – volume group name
Umount lvm volumes
True if all subvolumes are successfully unmounted
bool
kiwi.volume_manager.VolumeManager
Bases: object
VolumeManager factory
name
() – volume management name
device_map
() – dictionary of low level DeviceProvider intances
root_dir
() – root directory path name
volumes
() – list of volumes from XMLState::get_volumes()
custom_args
() – dictionary of custom volume manager arguments