API Documentation 9.10.1

Subpackages

Submodules

kiwi.app Module

class kiwi.app.App[source]

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

class kiwi.cli.Cli[source]

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

Attributes

  • all_args
    docopt parse result, all arguments dict
  • command_args
    subset of docopt argument dict for selected command
  • command_loaded
    result of importlib command load operation
get_command()[source]

Extract selected command name

Returns:command name
Return type:string
get_command_args()[source]

Extract argument dict for selected command

Returns:command arguments
Return type:dict
get_global_args()[source]

Extract argument dict for global arguments

Returns:global arguments
Return type:dict
get_servicename()[source]

Extract service name from argument parse result

Returns:service name
Return type:string
invoke_kiwicompat(compat_args)[source]

Execute kiwicompat with provided command line arguments

Parameters:compat_args (list) – raw arguments
load_command()[source]

Loads task class plugin according to service and command name

show_and_exit_on_help_request()[source]

Execute man to show the selected manual page

kiwi.command Module

class kiwi.command.Command[source]

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

classmethod call(command, custom_env=None)[source]

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

Parameters:
  • command (list) – command and arguments
  • custom_env (list) – custom os.environ
Returns:

(string).output

Returns:

(string).error

Returns:

(subprocess).process

Return type:

tuple

classmethod run(command, custom_env=None, raise_on_error=True)[source]

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

Parameters:
  • command (list) – command and arguments
  • custom_env (list) – custom os.environ
  • raise_on_error (bool) – control error behaviour
Returns:

(string).output

Returns:

(string).error

Returns:

(int).returncode

Return type:

tuple

kiwi.command_process Module

class kiwi.command_process.CommandIterator(command)[source]

Bases: object

Implements Iterator for Instances of Command

get_error_code()[source]

Provide return value from processed command

Returns:errorcode
Return type:int
get_error_output()[source]

Provide data sent to stderr channel

Returns:stderr data
Return type:string
get_pid()[source]

Provide process ID of command while running

Returns:pid
Return type:int
kill()[source]

Send kill signal SIGTERM to command process

class kiwi.command_process.CommandProcess(command, log_topic='system')[source]

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

create_match_method(method)[source]

create a matcher method with the following interface f(item_to_match, data)

Parameters:method (function) – f(item_to_match, data)
poll()[source]

Iterate over process, raise on error and log output

poll_and_watch()[source]

Iterate over process don’t raise on error and log stdout and stderr

poll_show_progress(items_to_complete, match_method)[source]

Iterate over process and show progress in percent raise on error and log output

Parameters:
  • items_to_complete (list) – all items
  • match_method (function) – method matching item

kiwi.defaults Module

class kiwi.defaults.Defaults[source]

Bases: object

Default values and export methods

Attributes

  • defaults
    dict of default profile values
  • profile_key_list
    list of profile keys to import into an instance of Profile
get(key)[source]

Implements get method for profile elements

Parameters:key (string) – profile keyname
Returns:key value
Return type:string
classmethod get_archive_image_types()[source]

Implements list of supported archive image types

Returns:archive names
Return type:list
classmethod get_boot_image_description_path()[source]

Implements bootloader path for ISO images

Returns:directory path
Return type:string
classmethod get_boot_image_strip_file()[source]

Implements file path to bootloader strip metadata. This file contains information about the files and directories automatically striped out from the kiwi initrd

Returns:file path
Return type:string
classmethod get_buildservice_env_name()[source]

The base name of the environment file in a buildservice worker

classmethod get_common_functions_file()[source]

Implements file path to bootloader functions metadata. This file contains bash functions used in the boot code from the kiwi initrd

Returns:file path
Return type:string
classmethod get_container_image_types()[source]

Implements list of supported container image types

Returns:container names
Return type:list
classmethod get_default_boot_mbytes()[source]

Implements default boot partition size in mbytes

Returns:mbsize
Return type:int
classmethod get_default_boot_timeout_seconds()[source]

Implements default boot timeout in seconds

Returns:seconds
Return type:int
classmethod get_default_efi_boot_mbytes()[source]

Implements default EFI partition size in mbytes

Returns:mbsize
Return type:int
classmethod get_default_firmware(arch)[source]

Implements default firmware for specified architecture

Parameters:arch (string) – platform.machine
Returns:firmware
Return type:string
classmethod get_default_inode_size()[source]

Implements default size of inodes in bytes. This is only relevant for inode based filesystems

Returns:bytesize
Return type:int
classmethod get_default_legacy_bios_mbytes()[source]

Implements default size of bios_grub partition in mbytes

Returns:mbsize
Return type:int
classmethod get_default_live_iso_type()[source]

Implements default live iso union type

Returns:live iso type
Return type:string
classmethod get_default_prep_mbytes()[source]

Implements default size of prep partition in mbytes

Returns:mbsize
Return type:int
classmethod get_default_video_mode()[source]

Implements 800x600 default video mode

Returns:video mode name
Return type:string
classmethod get_default_volume_group_name()[source]

Implements default LVM volume group name

Returns:name
Return type:string
classmethod get_disk_format_types()[source]

Implements supported disk format types

Returns:disk types
Return type:list
classmethod get_disk_image_types()[source]

Implements supported disk image types

Returns:disk image type names
Return type:list
classmethod get_ec2_capable_firmware_names()[source]

Implements 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

Returns:firmware names
Return type:list
classmethod get_efi_capable_firmware_names()[source]

Implements list of EFI capable firmware names. These are those for which kiwi supports the creation of an EFI bootable disk image

Returns:firmware names
Return type:list
classmethod get_efi_image_name(arch)[source]

Implements architecture specific EFI boot binary name

Parameters:arch (string) – platform.machine
Returns:name
Return type:string
classmethod get_efi_module_directory_name(arch)[source]

Implements architecture specific EFI directory name which stores the EFI binaries for the desired architecture.

Parameters:arch (string) – platform.machine
Returns:directory name
Return type:string
classmethod get_exclude_list_for_root_data_sync()[source]

Returns 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.

classmethod get_failsafe_kernel_options()[source]

Failsafe boot kernel options

Returns:kernel options list
Return type:list
classmethod get_filesystem_image_types()[source]

Implements list of supported filesystem image types

Returns:filesystem names
Return type:list
classmethod get_firmware_types()[source]

Implements supported architecture specific firmware types

Returns:firmware types
Return type:dict
classmethod get_grub_basic_modules(multiboot)[source]

Implements list of basic grub modules

Parameters:multiboot (bool) – grub multiboot mode
Returns:module name
Return type:string
classmethod get_grub_bios_modules(multiboot=False)[source]

Implements list of grub bios modules

Parameters:multiboot (bool) – grub multiboot mode
Returns:module name
Return type:string
classmethod get_grub_boot_directory_name(lookup_path)[source]

Get 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

classmethod get_grub_efi_modules(multiboot=False)[source]

Implements list of grub efi modules

Parameters:multiboot (bool) – grub multiboot mode
Returns:module name
Return type:string
classmethod get_grub_ofw_modules()[source]

Implements list of grub ofw modules (ppc)

Returns:module name
Return type:string
classmethod get_grub_path(lookup_path)[source]

Depending on the distribution grub could be installed below a grub2 or grub directory. Therefore this information needs to be dynamically looked up

Parameters:lookup_path (string) – path name
Returns:grub2 install directory path name
Return type:string
classmethod get_imported_root_image(root_dir)[source]

Returns the path of the image used to import a root during the prepare task. This is the filename expected to be found during the create step if derived_from attribute is present.

Parameters:root_dir (string) – is the root directory of the current build
Returns:file name of the image
Return type:string
classmethod get_live_image_types()[source]

Implements supported live image types

Returns:live image type names
Return type:list
classmethod get_live_iso_client_parameters()[source]

Implements parameters to setup the overlay filesystem used for the live ISO image. Each supported overlay filesystem needs the information about the target block device, the copy on write device and the used kernel union filesystem name

Returns:union client parameters
Return type:dict
classmethod get_live_iso_types()[source]

Implements list of supported live ISO image types

Returns:live iso names
Return type:list
classmethod get_lvm_overhead_mbytes()[source]

Implements empiric LVM overhead size in mbytes

Returns:mbsize
Return type:int
classmethod get_min_volume_mbytes()[source]

Implements default minimum LVM volume size in mbytes

Returns:mbsize
Return type:int
classmethod get_network_image_types()[source]

Implements supported pxe image types

Returns:pxe image type names
Return type:list
classmethod get_obs_download_server_url()[source]

The default download server url hosting the public open buildservice repositories

classmethod get_preparer()[source]

Implements ISO preparer name

Returns:name
Return type:string
classmethod get_publisher()[source]

Implements ISO publisher name

Returns:name
Return type:string
classmethod get_recovery_spare_mbytes()[source]

Implements spare size of recovery partition in mbytes

Returns:mbsize
Return type:int
classmethod get_s390_disk_block_size()[source]

The default block size for s390 storage disks

classmethod get_s390_disk_type()[source]

The default disk type for s390 storage disks

classmethod get_schema_file()[source]

Implements file path to kiwi RNG schema

Returns:file path
Return type:string
classmethod get_shared_cache_location()[source]

The shared location 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>

classmethod get_shim_loader(root_path)[source]

Return shim loader file path or None if not found

Parameters:root_path (string) – image root path
classmethod get_shim_vendor_directory(root_path)[source]

Return shim vendor directory or None

Parameters:root_path (string) – image root path
classmethod get_signed_grub_loader(root_path)[source]

Return shim signed grub loader file path or None

Parameters:root_path (string) – image root path
classmethod get_solvable_location()[source]

The directory to store SAT solvables for repositories. The solvable files are used to perform package dependency and metadata resolution

classmethod get_video_mode_map()[source]

Implements video mode map

Assign a tuple to each kernel vesa hex id for each of the supported bootloaders

Returns:video type map
Return type:dict
classmethod get_xsl_stylesheet_file()[source]

Implements file path to kiwi XSLT style sheets

Returns:file path
Return type:string
classmethod get_xz_compression_options()[source]
classmethod is_buildservice_worker()[source]
classmethod project_file(filename)[source]

Implements python module base directory search path The method uses the resource_filename method to identify files and directories from the application

Parameters:filename (string) – relative project file
Returns:full qualified filename
Return type:string
to_profile(profile)[source]

Implements method to add list of profile keys and their values to the specified instance of a Profile class

Parameters:profile (object) – Profile instance

kiwi.exceptions Module

exception kiwi.exceptions.KiwiArchiveSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an unsupported image archive type is used.

exception kiwi.exceptions.KiwiArchiveTarError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if impossible to determine which tar command version is installed on the underlying system

exception kiwi.exceptions.KiwiBootImageDumpError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an instance of BootImage* can not be serialized on as file via pickle dump

exception kiwi.exceptions.KiwiBootImageSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an unsupported initrd system type is used.

exception kiwi.exceptions.KiwiBootLoaderConfigSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if a configuration for an unsupported bootloader is requested.

exception kiwi.exceptions.KiwiBootLoaderGrubDataError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if no grub installation was found.

exception kiwi.exceptions.KiwiBootLoaderGrubFontError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if no grub unicode font was found.

exception kiwi.exceptions.KiwiBootLoaderGrubInstallError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if grub install to master boot record has failed.

exception kiwi.exceptions.KiwiBootLoaderGrubModulesError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the synchronisation of modules from the grub installation to the boot space has failed.

exception kiwi.exceptions.KiwiBootLoaderGrubPlatformError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an attempt was made to use grub on an unsupported platform.

exception kiwi.exceptions.KiwiBootLoaderGrubSecureBootError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the Microsoft signed shim loader or grub2 loader could not be found in the image root system

exception kiwi.exceptions.KiwiBootLoaderInstallSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an installation for an unsupported bootloader is requested.

exception kiwi.exceptions.KiwiBootLoaderIsoLinuxPlatformError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an attempt was made to use isolinux on an unsupported platform.

exception kiwi.exceptions.KiwiBootLoaderTargetError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the target to read the bootloader path from is not a disk or an iso image.

exception kiwi.exceptions.KiwiBootLoaderZiplInstallError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the installation of zipl has failed.

exception kiwi.exceptions.KiwiBootLoaderZiplPlatformError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if a configuration for an unsupported zipl architecture is requested.

exception kiwi.exceptions.KiwiBootLoaderZiplSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the data set to configure the zipl bootloader is incomplete.

exception kiwi.exceptions.KiwiBootStrapPhaseFailed(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the bootstrap phase of the system prepare command has failed.

exception kiwi.exceptions.KiwiBundleError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the system bundle command has failed.

exception kiwi.exceptions.KiwiCommandError(message)[source]

Bases: kiwi.exceptions.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.

exception kiwi.exceptions.KiwiCommandNotFound(message)[source]

Bases: kiwi.exceptions.KiwiCommandError

Exception raised if any executable command cannot be found in the evironment PATH variable.

exception kiwi.exceptions.KiwiCommandNotLoaded(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if a kiwi command task module could not be loaded.

exception kiwi.exceptions.KiwiCompatError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the given kiwi compatibility command line could not be understood by the compat option parser.

exception kiwi.exceptions.KiwiCompressionFormatUnknown(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the compression format of the data could not be detected.

exception kiwi.exceptions.KiwiConfigFileNotFound(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if no kiwi XML description was found.

exception kiwi.exceptions.KiwiContainerBuilderError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception is raised when something fails during a container image build procedure.

exception kiwi.exceptions.KiwiContainerImageSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an attempt to create a container instance for an unsupported container type is performed.

exception kiwi.exceptions.KiwiContainerSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an error in the creation of the container archive happened.

exception kiwi.exceptions.KiwiDataStructureError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the XML description failed to parse the data structure.

exception kiwi.exceptions.KiwiDebootstrapError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if not enough user data to call debootstrap were provided or the debootstrap has failed.

exception kiwi.exceptions.KiwiDescriptionConflict(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if both, a description file and xml_content is provided

exception kiwi.exceptions.KiwiDescriptionInvalid(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the XML description failed to validate the XML schema.

exception kiwi.exceptions.KiwiDeviceProviderError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if a storage provide is asked for its managed device but no such device exists.

exception kiwi.exceptions.KiwiDiskBootImageError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if a kiwi boot image does not provide the requested data, e.g kernel, or hypervisor files.

exception kiwi.exceptions.KiwiDiskFormatSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an attempt was made to create a disk format instance of an unsupported disk format.

exception kiwi.exceptions.KiwiDiskGeometryError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the disk geometry (partition table) could not be read or evaluated against their expected geometry and capabilities.

exception kiwi.exceptions.KiwiDistributionNameError(message)[source]

Bases: kiwi.exceptions.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.

exception kiwi.exceptions.KiwiError(message)[source]

Bases: Exception

Base class to handle all known exceptions.

Specific exceptions are implemented as sub classes of KiwiError

Attributes

  • message
    Exception message text
exception kiwi.exceptions.KiwiExtensionError(message)[source]

Bases: kiwi.exceptions.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

exception kiwi.exceptions.KiwiFileNotFound(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the requested file could not be found.

exception kiwi.exceptions.KiwiFileSystemSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an attempt was made to build an unsupported or unspecified filesystem.

exception kiwi.exceptions.KiwiFileSystemSyncError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the data sync from the system into the loop mounted filesystem image failed.

exception kiwi.exceptions.KiwiFormatSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the requested disk format could not be created.

exception kiwi.exceptions.KiwiHelpNoCommandGiven(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the request for the help page is executed without a command to show the help for.

exception kiwi.exceptions.KiwiImageResizeError(message)[source]

Bases: kiwi.exceptions.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.

exception kiwi.exceptions.KiwiImportDescriptionError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the XML description data and scripts could not be imported into the root of the image.

exception kiwi.exceptions.KiwiInstallBootImageError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the required files to boot an installation image could not be found, e.g kernel or hypervisor.

exception kiwi.exceptions.KiwiInstallMediaError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if a request for an installation media is made but the system image type is not an oem type.

exception kiwi.exceptions.KiwiInstallPhaseFailed(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the install phase of a system prepare command has failed.

exception kiwi.exceptions.KiwiIsoLoaderError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if no isolinux loader file could be found.

exception kiwi.exceptions.KiwiIsoMetaDataError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an inconsistency in the ISO header was found such like invalid eltorito specification or a broken path table.

exception kiwi.exceptions.KiwiIsoToolError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an iso helper tool such as isoinfo could not be found on the build system.

exception kiwi.exceptions.KiwiKernelLookupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the search for the kernel image file failed

exception kiwi.exceptions.KiwiLiveBootImageError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an attempt was made to use an unsupported live iso type.

exception kiwi.exceptions.KiwiLoadCommandUndefined(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if no command is specified for a given service on the commandline.

exception kiwi.exceptions.KiwiLogFileSetupFailed(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the log file could not be created.

exception kiwi.exceptions.KiwiLoopSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if not enough user data to create a loop device is specified.

exception kiwi.exceptions.KiwiLuksSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if not enough user data is provided to setup the luks encryption on the given device.

exception kiwi.exceptions.KiwiMappedDeviceError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the device to become mapped does not exist.

exception kiwi.exceptions.KiwiMountKernelFileSystemsError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if a kernel filesystem such as proc or sys could not be mounted.

exception kiwi.exceptions.KiwiMountSharedDirectoryError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the host <-> image shared directory could not be mounted.

exception kiwi.exceptions.KiwiNotImplementedError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if a functionality is not yet implemented.

exception kiwi.exceptions.KiwiPackageManagerSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an attempt was made to create a package manager instance for an unsupported package manager.

exception kiwi.exceptions.KiwiPartitionerGptFlagError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an attempt was made to set an unknown partition flag for an entry in the GPT table.

exception kiwi.exceptions.KiwiPartitionerMsDosFlagError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an attempt was made to set an unknown partition flag for an entry in the MSDOS table.

exception kiwi.exceptions.KiwiPartitionerSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an attempt was made to create an instance of a partitioner for an unsupporte partitioner.

exception kiwi.exceptions.KiwiPrivilegesError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if root privileges are required but not granted.

exception kiwi.exceptions.KiwiProfileNotFound(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if a specified profile does not exist in the XML configuration.

exception kiwi.exceptions.KiwiPxeBootImageError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if a required boot file e.g the kernel could not be found in the process of building a pxe image.

exception kiwi.exceptions.KiwiRaidSetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if invalid or not enough user data is provided to create a raid array on the specified storage device.

exception kiwi.exceptions.KiwiRepoTypeUnknown(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an unsupported repository type is specified for the corresponding package manager.

exception kiwi.exceptions.KiwiRepositorySetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an attempt was made to create an instance of a repository for an unsupported package manager.

exception kiwi.exceptions.KiwiRequestError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if a package request could not be processed by the corresponding package manager instance.

exception kiwi.exceptions.KiwiRequestedTypeError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an attempt was made to build an image for an unsupported image type.

exception kiwi.exceptions.KiwiResizeRawDiskError(message)[source]

Bases: kiwi.exceptions.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.

exception kiwi.exceptions.KiwiResultError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the image build result pickle information could not be created or loaded.

exception kiwi.exceptions.KiwiRootDirExists(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the specified image root directory already exists and should not be re-used.

exception kiwi.exceptions.KiwiRootImportError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception is raised when something fails during the root import procedure.

exception kiwi.exceptions.KiwiRootInitCreationError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the initialization of a new image root directory has failed.

exception kiwi.exceptions.KiwiRpmDatabaseReloadError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised on error of an rpm DB dump -> reload process.

exception kiwi.exceptions.KiwiRpmDirNotRemoteError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the provided rpm-dir repository is not local

exception kiwi.exceptions.KiwiRuntimeConfigFormatError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the expected format in the yaml KIWI runtime config file does not match

exception kiwi.exceptions.KiwiRuntimeError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if a runtime check has failed.

exception kiwi.exceptions.KiwiSatSolverJobError(message)[source]

Bases: kiwi.exceptions.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

exception kiwi.exceptions.KiwiSatSolverJobProblems(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the sat solver operations returned with solver problems e.g package conflicts

exception kiwi.exceptions.KiwiSatSolverPluginError(message)[source]

Bases: kiwi.exceptions.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

exception kiwi.exceptions.KiwiSchemaImportError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the schema file could not be read by lxml.RelaxNG.

exception kiwi.exceptions.KiwiScriptFailed(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if a user script returned with an exit code != 0.

exception kiwi.exceptions.KiwiSetupIntermediateConfigError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the setup of the temporary image system configuration for the duration of the build process has failed.

exception kiwi.exceptions.KiwiSolverRepositorySetupError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the repository type is not supported for the creation of a SAT solvable

exception kiwi.exceptions.KiwiSystemDeletePackagesFailed(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the deletion of a package has failed in the corresponding package manager instance.

exception kiwi.exceptions.KiwiSystemInstallPackagesFailed(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the installation of a package has failed in the corresponding package manager instance.

exception kiwi.exceptions.KiwiSystemUpdateFailed(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the package upgrade has failed in the corresponding package manager instance.

exception kiwi.exceptions.KiwiTargetDirectoryNotFound(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the specified target directory to store the image results was not found.

exception kiwi.exceptions.KiwiTemplateError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the substitution of variables in a configuration file template has failed.

exception kiwi.exceptions.KiwiTypeNotFound(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if no build type was found in the XML description.

exception kiwi.exceptions.KiwiUnknownServiceName(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an unknown service name was provided on the commandline.

exception kiwi.exceptions.KiwiUriOpenError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the urllib urlopen request has failed

exception kiwi.exceptions.KiwiUriStyleUnknown(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if an unsupported URI style was used in the source definition of a repository.

exception kiwi.exceptions.KiwiUriTypeUnknown(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the protocol type of an URI is unknown in the source definition of a repository.

exception kiwi.exceptions.KiwiValidationError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the XML validation against the schema has failed.

exception kiwi.exceptions.KiwiVhdTagError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the GUID tag is not provided in the expected format.

exception kiwi.exceptions.KiwiVmdkToolsError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the version information from vmtoolsd does not match the expected output format.

exception kiwi.exceptions.KiwiVolumeGroupConflict(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the requested LVM volume group already is in use on the build system.

exception kiwi.exceptions.KiwiVolumeManagerSetupError(message)[source]

Bases: kiwi.exceptions.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.

exception kiwi.exceptions.KiwiVolumeRootIDError(message)[source]

Bases: kiwi.exceptions.KiwiError

Exception raised if the root volume can not be found. This concept currently exists only for the btrfs subvolume system.

kiwi.firmware Module

class kiwi.firmware.FirmWare(xml_state)[source]

Bases: object

Implements firmware specific image information

According to the selected firmware some parameters in a disk image changes. This class provides methods to provide firmware dependant information

Attributes

  • arch
    machine architecture
  • zipl_target_type
    XML configured zipl target type
  • firmware
    XML configured firmware name
bios_mode()[source]

Check if BIOS mode is requested

Return type:bool
ec2_mode()[source]

Check if EC2 mode is requested

Return type:bool
efi_mode()[source]

Check if EFI mode is requested

Return type:bool
get_efi_partition_size()[source]

Size of EFI partition. Returns 0 if no such partition is needed

Returns:mbsize
Return type:int
get_legacy_bios_partition_size()[source]

Size of legacy bios_grub partition if legacy BIOS mode is required. Returns 0 if no such partition is needed

Returns:mbsize
Return type:int
get_partition_table_type()[source]

Partition table type according to architecture and firmware

Returns:partition table name
Return type:string
get_prep_partition_size()[source]

Size of Prep partition if OFW mode is requested. Returns 0 if no such partition is needed

Returns:mbsize
Return type:int
legacy_bios_mode()[source]

Check if the legacy boot from BIOS systems should be activated

Return type:bool
ofw_mode()[source]

Check if OFW mode is requested

Return type:bool
opal_mode()[source]

Check if Opal mode is requested

Return type:bool

kiwi.help Module

class kiwi.help.Help[source]

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.

show(command=None)[source]

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

kiwi.iso Module

class kiwi.iso.Iso(source_dir)[source]

Bases: object

Implements helper methods around the creation of ISO filesystems

Attributes

  • arch
    system architecture
  • header_id
    static identifier string for self written headers
  • header_end_name
    file name to store the header_id to
  • header_end_name
    file name to store the header_id to
  • header_end_file
    full file path for the header_end_name file
  • boot_path
    architecture specific boot path on the ISO
  • iso_sortfile
    named temporary file used as ISO sortfile
  • iso_parameters
    list of ISO creation parameters
  • iso_loaders
    list of ISO loaders to embed
add_efi_loader_parameters()[source]

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

create_header_end_block(isofile)[source]

Find offset address of file containing the header_id and replace it by a list of 2k blocks in range 0 - offset + 1 This is the required preparation to support hybrid ISO images, meaning to let isohybrid work correctly

Parameters:isofile (string) – path to the ISO file
Returns:512 byte blocks offset address
Return type:int
classmethod create_hybrid(offset, mbrid, isofile)[source]

Create hybrid ISO

A hybrid ISO embeds both, an isolinux signature as well as a disk signature. kiwi always adds an msdos and a GPT table for the disk signatures

Parameters:
  • offset (string) – hex offset
  • mbrid (string) – boot record id
  • isofile (string) – path to the ISO file
classmethod fix_boot_catalog(isofile)[source]

Fixup inconsistencies in boot catalog

Make sure all catalog entries are in correct order and provide complete metadata information e.g catalog name

Parameters:isofile (string) – path to the ISO file
get_iso_creation_parameters()[source]

Return current list of ISO creation parameters

Returns:genisoimage args
Return type:list
init_iso_creation_parameters(custom_args=None)[source]

Create a set of standard parameters for the main isolinux loader

In addition a sort file with the contents of the iso is created. The kiwi iso file is also prepared to become a hybrid iso image. In order to do this the offest address of the end of the first iso block is required. In order to lookup the address a reference file named ‘header_end’ is created and will show up as last file in the block.

Parameters:custom_args (list) – custom ISO creation args
isols(isofile)[source]

List contents of an ISO image

Parameters:isofile (string) – path to the ISO file
Returns:formatted isoinfo result
Return type:dict
classmethod relocate_boot_catalog(isofile)[source]

Move ISO boot catalog to the standardized place

Check location of the boot catalog and move it to the place where all BIOS and firwmare implementations expects it

Parameters:isofile (string) – path to the ISO file

kiwi.kiwi Module

kiwi.kiwi.extras(help_, version, options, doc)[source]

Overwritten method from docopt

We want to show our own usage for -h|–help

kiwi.kiwi.main()[source]

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(command_usage)[source]

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:

  1. the generic call kiwi [global options] service <command> [<args>]
  2. the command specific usage defined by the docopt string short form by default, long form with -h | –help
  3. the global options

kiwi.logger Module

class kiwi.logger.ColorFormatter(*args, **kwargs)[source]

Bases: logging.Formatter

Extended standard logging Formatter supporting text with color metadata

format(record)[source]

Creates a logging Formatter with support for color messages

Parameters:record (tuple) – logging message record
Returns:result from format_message
Return type:string
class kiwi.logger.ColorMessage[source]

Bases: object

Implements color messages for python logging facility

Has to implement the format_message method to serve as message formatter

format_message(level, message)[source]

Message formatter with support for embeded 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

Parameters:
  • level (int) – color level number
  • message (string) – text
Returns:

color message with escape sequences

Return type:

string

class kiwi.logger.DebugFilter(name='')[source]

Bases: logging.Filter

Extended standard logging Filter

filter(record)[source]

Only messages with record level DEBUG can pass for messages with another level an extra handler is used

Parameters:record (tuple) – logging message record
Returns:record.name
Return type:string
class kiwi.logger.ErrorFilter(name='')[source]

Bases: logging.Filter

Extended standard logging Filter

filter(record)[source]

Only messages with record level DEBUG can pass for messages with another level an extra handler is used

Parameters:record (tuple) – logging message record
Returns:record.name
Return type:string
class kiwi.logger.InfoFilter(name='')[source]

Bases: logging.Filter

Extended standard logging Filter

filter(record)[source]

Only messages with record level INFO and WARNING can pass for messages with another level an extra handler is used

Parameters:record (tuple) – logging message record
Returns:record.name
Return type:string
class kiwi.logger.Logger(name)[source]

Bases: logging.Logger

Extended logging facility based on python logging

getLogLevel()[source]

Return currently used log level

Returns:log level number
Return type:int
progress(current, total, prefix, bar_length=40)[source]

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

Parameters:
  • current (int) – current item
  • total (int) – total number of items
  • prefix (string) – prefix name
  • bar_length (int) – length of progress bar
setLogLevel(level)[source]

Set custom log level for all console handlers

Parameters:level (int) – log level number
set_color_format()[source]

Set color format for all console handlers

set_logfile(filename)[source]

Set logfile handler

Parameters:filename (string) – logfile file path
class kiwi.logger.LoggerSchedulerFilter(name='')[source]

Bases: logging.Filter

Extended standard logging Filter

filter(record)[source]

Messages from apscheduler scheduler instances are filtered out They conflict with console progress information

Parameters:record (tuple) – logging message record
Returns:record.name
Return type:string
class kiwi.logger.WarningFilter(name='')[source]

Bases: logging.Filter

Extended standard logging Filter

filter(record)[source]

Only messages with record level WARNING can pass for messages with another level an extra handler is used

Parameters:record (tuple) – logging message record
Returns:record.name
Return type:string

kiwi.mount_manager Module

class kiwi.mount_manager.MountManager(device, mountpoint=None)[source]

Bases: object

Provide 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

Attributes

  • device
    device node name
  • mountpoint
    mountpoint directory name
bind_mount()[source]

Bind mount the device to the mountpoint

is_mounted()[source]

Check if mounted

Return type:bool
mount(options=None)[source]

Standard mount the device to the mountpoint

Parameters:options (list) – mount options
umount()[source]

Umount by the mountpoint directory

If the resource is busy the call will return False

Return type:bool
umount_lazy()[source]

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

class kiwi.path.Path[source]

Bases: object

Directory path helpers

classmethod create(path)[source]

Create path and all sub directories to target

Parameters:path (string) – path name
classmethod remove(path)[source]

Delete empty path, causes an error if target is not empty

Parameters:path (string) – path name
classmethod remove_hierarchy(path)[source]

Recursively remove an empty path and its sub directories ignore non empty paths and leave them untouched

Parameters:path (string) – path name
classmethod sort_by_hierarchy(path_list)[source]

Sort given list of path names by their hierachy in the tree

Parameters:path_list (list) – list of path names
Returns:sorted path_list
Return type:list
classmethod which(filename, alternative_lookup_paths=None, custom_env=None, access_mode=None)[source]

Lookup file name in PATH

Parameters:
  • filename (string) – file base name
  • alternative_lookup_paths (list) – list of additional lookup paths
  • custom_env (list) – a custom os.environ
  • mode (int) – 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
classmethod wipe(path)[source]

Delete path and all contents

Parameters:path (string) – path name

kiwi.privileges Module

class kiwi.privileges.Privileges[source]

Bases: object

Implements check for root privileges

classmethod check_for_root_permissions()[source]

Check if we are effectively root on the system. If not an exception is thrown

Return type:bool

kiwi.version Module

Global version information used in kiwi and the package

kiwi.xml_description Module

class kiwi.xml_description.XMLDescription(description=None, derived_from=None, xml_content=None)[source]

Bases: object

Implements data management for the XML description

  • 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_xslt_processed
    XML data after xsltproc processing
  • description
    path to XML description file
  • derived_from
    path to base XML description file
  • xml_content
    XML description data as content string
get_extension_xml_data(namespace_name)[source]

Return the xml etree parse result for the specified extension namespace

Parameters:namespace_name (string) – name of the extension namespace
Returns:result of etree.parse
Return type:object
load()[source]

Read XML description, pass it along to the XSLT processor, validate it against the schema and finally pass it to the autogenerated(generateDS) parser.

Returns:instance of XML toplevel domain (image)
Return type:object

kiwi.xml_state Module

class kiwi.xml_state.XMLState(xml_data, profiles=None, build_type=None)[source]

Bases: object

Implements methods to get stateful information from the XML data

Attributes

  • host_architecture
    system architecture, result from platform.machine
  • xml_data
    instance of XMLDescription
  • profiles
    list of used profiles
  • build_type
    build type section reference
add_repository(repo_source, repo_type, repo_alias, repo_prio, repo_imageinclude=False)[source]

Add a new repository section at the end of the list

Parameters:
  • repo_source (string) – repository URI
  • repo_type (string) – type name defined by schema
  • repo_alias (string) – alias name
  • repo_prio (string) – priority number, package manager specific
  • imageinclude (boolean) – setup repository inside of the image
copy_bootdelete_packages(target_state)[source]

Copy packages marked as bootdelete to the packages type=delete section in the target xml state

Parameters:target_state (object) – XMLState instance
copy_bootincluded_archives(target_state)[source]

Copy archives marked as bootinclude to the packages type=bootstrap section in the target xml state

Parameters:target_state (object) – XMLState instance
copy_bootincluded_packages(target_state)[source]

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

Parameters:target_state (object) – XMLState instance
copy_build_type_attributes(attribute_names, target_state)[source]

Copy specified attributes from this build type section to the target xml state build type section

Parameters:
  • attribute_names (list) – type section attributes
  • target_state (object) – XMLState instance
copy_displayname(target_state)[source]

Copy image displayname from this xml state to the target xml state

Parameters:target_state (object) – XMLState instance
copy_drivers_sections(target_state)[source]

Copy drivers sections from this xml state to the target xml state

Parameters:target_state (object) – XMLState instance
copy_machine_section(target_state)[source]

Copy machine sections from this xml state to the target xml state

Parameters:target_state (object) – XMLState instance
copy_name(target_state)[source]

Copy image name from this xml state to the target xml state

Parameters:target_state (object) – XMLState instance
copy_oemconfig_section(target_state)[source]

Copy oemconfig sections from this xml state to the target xml state

Parameters:target_state (object) – XMLState instance
copy_preferences_subsections(section_names, target_state)[source]

Copy subsections of the preferences sections, matching given section names, from this xml state to the target xml state

Parameters:
  • section_names (list) – preferences subsection names
  • target_state (object) – XMLState instance
copy_repository_sections(target_state, wipe=False)[source]

Copy repository sections from this xml state to the target xml state

Parameters:
  • target_state (object) – XMLState instance
  • wipe (bool) – delete all repos in target prior to copy
copy_strip_sections(target_state)[source]

Copy strip sections from this xml state to the target xml state

Parameters:target_state (object) – XMLState instance
copy_systemdisk_section(target_state)[source]

Copy systemdisk sections from this xml state to the target xml state

Parameters:target_state (object) – XMLState instance
delete_repository_sections()[source]

Delete all repository sections matching configured profiles

delete_repository_sections_used_for_build()[source]

Delete all repository sections used to build the image matching configured profiles

get_bootstrap_archives()[source]

List of archives from the type=”bootstrap” packages section(s)

Returns:archive names
Return type:list
get_bootstrap_collection_type()[source]

Collection type for packages sections matching type=”bootstrap”

Returns:collection type name
Return type:string
get_bootstrap_collections()[source]

List of collection names from the packages sections matching type=”bootstrap”

Returns:collection names
Return type:list
get_bootstrap_packages()[source]

List of packages from the type=”bootstrap” packages section(s)

Returns:package names
Return type:list
get_bootstrap_packages_sections()[source]

List of packages sections matching type=”bootstrap”

Returns:<packages>
Return type:list
get_bootstrap_products()[source]

List of product names from the packages sections matching type=”bootstrap”

Returns:product names
Return type:list
get_build_type_containerconfig_section()[source]

First containerconfig section from the build type section

Returns:<containerconfig>
Return type:xml_parse::containerconfig instance
get_build_type_machine_section()[source]

First machine section from the build type section

Returns:<machine>
Return type:xml_parse::machine instance
get_build_type_name()[source]

Default build type name

Returns:image attribute from build type
Return type:string
get_build_type_oemconfig_section()[source]

First oemconfig section from the build type section

Returns:<oemconfig>
Return type:xml_parse::oemconfig instance
get_build_type_pxedeploy_section()[source]

First pxedeploy section from the build type section

Returns:<pxedeploy>
Return type:xml_parse::pxedeploy instance
get_build_type_size()[source]

Size information from the build type section. If no unit is set the value is treated as mbytes

Returns:mbytes
Return type:int
get_build_type_spare_part_size()[source]

Size information for the spare_part size from the build type. If no unit is set the value is treated as mbytes

Returns:mbytes
Return type:int
get_build_type_system_disk_section()[source]

First system disk section from the build type section

Returns:<systemdisk>
Return type:xml_parse::systemdisk instance
get_build_type_vagrant_config_section()[source]

First vagrantconfig section from the build type section

Returns:<vagrantconfig>
Return type:xml_parse::vagrantconfig instance
get_build_type_vmconfig_entries()[source]

List of vmconfig-entry section values from the first machine section in the build type section

Returns:vmconfig_entry values
Return type:list
get_build_type_vmdisk_section()[source]

First vmdisk section from the first machine section in the build type section

Returns:<vmdisk>
Return type:xml_parse::vmdisk instance
get_build_type_vmdvd_section()[source]

First vmdvd section from the first machine section in the build type section

Returns:<vmdvd>
Return type:xml_parse::vmdvd instance
get_build_type_vmnic_section()[source]

First vmnic section from the first machine section in the build type section

Returns:<vmnic>
Return type:xml_parse::vmnic instance
get_collection_type(section_type='image')[source]

Collection type from packages sections matching given section type.

If no collection type is specified the default collection type is set to: onlyRequired

Parameters:section_type (string) – type name from packages section
Returns:collection type name
Return type:string
get_collections(section_type='image')[source]

List of collection names from the packages sections matching type=section_type and type=build_type

Returns:collection names
Return type:list
get_container_config()[source]

Dictionary of containerconfig information

get_derived_from_image_uri()[source]

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

Returns:Instance of Uri
Return type:object
get_distribution_name_from_boot_attribute()[source]

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

Returns:lowercase distribution name
Return type:string
get_drivers_list()[source]

List of driver names from all drivers sections matching configured profiles

Returns:driver names
Return type:list
get_fs_mount_option_list()[source]

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

Returns:max one element list with mount option string
Return type:list
get_image_version()[source]

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

Returns:<version>
Return type:string
get_package_manager()[source]

Configured package manager

Returns:<packagemanager>
Return type:string
get_package_sections(packages_sections)[source]

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

Parameters:packages_sections (list) – <packages>
Returns:package_type tuple list
Return type:list
get_packages_sections(section_types)[source]

List of packages sections matching given section type(s)

Parameters:section_types (list) – type name(s) from packages sections
Returns:<packages>
Return type:list
get_preferences_sections()[source]

All preferences sections for the selected profiles

Returns:<preferences>
Return type:list
get_products(section_type='image')[source]

List of product names from the packages sections matching type=section_type and type=build_type

Parameters:section_type (string) – type name from packages section
Returns:product names
Return type:list
get_repository_sections()[source]

List of all repository sections matching configured profiles

Returns:<repository>
Return type:list
get_repository_sections_used_for_build()[source]

List the repositorys sections used to build the image matching configured profiles.

Returns:<repository>
Return type:list
get_repository_sections_used_in_image()[source]

List the repositorys sections to be configured in the resulting image matching configured profiles.

Returns:<repository>
Return type:list
get_rpm_check_signatures()[source]

Gets the rpm-check-signatures configuration flag. Returns False if not present.

Returns:check-signatures flag
Return type:bool
get_rpm_excludedocs()[source]

Gets the rpm-excludedocs configuration flag. Returns False if not present.

Returns:excludedocs flag
Return type:bool
get_strip_files_to_delete()[source]

Items to delete from strip section

Returns:items to delete
Return type:list
get_strip_libraries_to_keep()[source]

Libraries to keep from strip section

Returns:libraries to keep
Return type:list
get_strip_list(section_type)[source]

List of strip names matching the given section type and profiles

Parameters:section_type (string) – type name from packages section
Returns:strip names
Return type:list
get_strip_tools_to_keep()[source]

Tools to keep from strip section

Returns:tools to keep
Return type:list
get_system_archives()[source]

List of archives from the packages sections matching type=”image” and type=build_type

Returns:archive names
Return type:list
get_system_collection_type()[source]

Collection type for packages sections matching type=”image”

Returns:collection type name
Return type:string
get_system_collections()[source]

List of collection names from the packages sections matching type=”image”

Returns:collection names
Return type:list
get_system_ignore_packages()[source]

List of ignore packages from the packages sections matching type=”image” and type=build_type

Returns:package names
Return type:list
get_system_packages()[source]

List of packages from the packages sections matching type=”image” and type=build_type

Returns:package names
Return type:list
get_system_products()[source]

List of product names from the packages sections matching type=”image”

Returns:product names
Return type:list
get_to_become_deleted_packages()[source]

List of packages from the type=”delete” packages section(s)

Returns:package names
Return type:list
get_user_groups(user_name)[source]

List of group names matching specified user

Each entry in the list is the name of a group 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.

Returns:groups data for the given user
Return type:list
get_users()[source]

List of configured users.

Each entry in the list is a single xml_parse::user instance.

Returns:user data
Return type:list
get_users_sections()[source]

All users sections for the selected profiles

Returns:<users>
Return type:list
get_volume_group_name()[source]

Volume group name from systemdisk section

Returns:volume group name
Return type:string
get_volume_management()[source]

Provides information which volume management system is used

Returns:name of volume manager
Return type:string
get_volumes()[source]

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: volume attributes handled via chattr
Returns:volume data
Return type:list
is_xen_guest()[source]
is_xen_server()[source]
package_matches_host_architecture(package)[source]

Tests if the given package is applicable for the current host architecture. If no architecture is specified within the package it is considered as a match.

Parameters:package – <package>
Returns:True if there is a match or if the package has no architecture.
Return type:bool
set_container_config_tag(tag)[source]

Set new tag name in containerconfig section

In order to set a new tag value an existing containerconfig and tag setup is required

Parameters:tag (string) – tag name
set_derived_from_image_uri(uri)[source]

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

Parameters:uri (string) – URI
set_repository(repo_source, repo_type, repo_alias, repo_prio, repo_imageinclude=False)[source]

Overwrite repository data of the first repository

Parameters:
  • repo_source (string) – repository URI
  • repo_type (string) – type name defined by schema
  • repo_alias (string) – alias name
  • repo_prio (string) – priority number, package manager specific
  • imageinclude (boolean) – setup repository inside of the image

Module Contents