kiwi.iso_tools Package

Submodules

kiwi.iso_tools.base Module

class kiwi.iso_tools.base.IsoToolsBase(source_dir)[source]

Bases: object

Base Class for Parameter API for iso creation tools

Parameters:
  • source_dir (string) – data source dir, usually root_dir
  • boot_path (str) – architecture specific boot path on the ISO
  • iso_parameters (str) – list of ISO creation parameters
  • iso_loaders (str) – list of ISO loaders to embed
add_efi_loader_parameters()[source]

Add ISO creation parameters to embed the EFI loader

Implementation in specialized tool class

create_iso(filename, hidden_files=None)[source]

Create iso file

Implementation in specialized tool class

Parameters:
  • filename (str) – unused
  • hidden_files (list) – unused
get_tool_name()[source]

Return caller name for iso creation tool

Implementation in specialized tool class

Returns:tool name
Return type:str
has_iso_hybrid_capability()[source]

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

init_iso_creation_parameters(custom_args=None)[source]

Create a set of standard parameters for the main isolinux loader

Implementation in specialized tool class

Parameters:custom_args (list) – unused
list_iso(isofile)[source]

List contents of an ISO image

Parameters:isofile (str) – unused

kiwi.iso_tools.cdrtools Module

class kiwi.iso_tools.cdrtools.IsoToolsCdrTools(source_dir)[source]

Bases: kiwi.iso_tools.base.IsoToolsBase

cdrkit/cdrtools wrapper class

Implementation of Parameter API for iso creation tools using the cdrkit/cdrtools projects. Addressed here are the option compatible tools mkisofs and genisoimage

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_iso(filename, hidden_files=None)[source]

Creates the iso file with the given filename using cdrtools

Parameters:
  • filename (str) – output filename
  • hidden_files (list) – list of hidden files
get_tool_name()[source]

There are tools by J.Schilling and tools from the community Depending on what is installed a decision needs to be made. mkisofs is preferred over genisoimage

Raises:KiwiIsoToolError – if no iso creation tool is found
Returns:tool name
Return type:str
has_iso_hybrid_capability()[source]

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

Returns:True or False
Return type:bool
init_iso_creation_parameters(custom_args=None)[source]

Create a set of standard parameters

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

List contents of an ISO image

Parameters:isofile (str) – path to the ISO file
Returns:formatted isoinfo result
Return type:dict

kiwi.iso_tools.iso Module

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

Bases: object

Implements helper methods around the creation of ISO filesystems

Parameters:
  • header_id (str) – static identifier string for self written headers
  • header_end_name (str) – file name to store the header_id to
  • header_end_file (str) – full file path for the header_end_name file
  • boot_path (str) – architecture specific boot path on the ISO
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
Raises:KiwiIsoLoaderError – if the header_id file is not found
Returns:512 byte blocks offset address
Return type:int
create_header_end_marker()[source]

Prepare iso file to become a hybrid iso image.

To do this the offest address of the end of the first iso block is required. To lookup this address a reference(marker) file named ‘header_end’ is created and will show up as last file in the block.

classmethod create_hybrid(offset, mbrid, isofile, efi_mode=False)[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 (str) – hex offset
  • mbrid (str) – boot record id
  • isofile (str) – path to the ISO file
  • efi_mode (bool) – sets the iso to support efi firmware or not
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 (str) – path to the ISO file
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 (str) – path to the ISO file
classmethod set_media_tag(isofile)[source]

Include checksum tag in the ISO so it can be verified with the mediacheck program.

Parameters:isofile (str) – path to the ISO file
setup_isolinux_boot_path()[source]

Write the base boot path into the isolinux loader binary

Raises:KiwiIsoLoaderError – if loader/isolinux.bin is not found

Module Contents

class kiwi.iso_tools.IsoTools[source]

Bases: object

IsoTools factory