kiwi.boot.image Package

Submodules

kiwi.boot.image.base Module

class kiwi.boot.image.base.BootImageBase(xml_state, target_dir, root_dir=None, signing_keys=None)[source]

Bases: object

Base class for boot image(initrd) task

Parameters:
  • xml_state (object) – Instance of XMLState
  • target_dir (string) – target dir to store the initrd
  • root_dir (string) – system image root directory
  • signing_keys (list) – list of package signing keys
create_initrd(mbrid=None, basename=None, install_initrd=False)[source]

Implements creation of the initrd

Parameters:
  • mbrid (object) – instance of ImageIdentifier
  • basename (string) – base initrd file name
  • install_initrd (bool) – installation media initrd

Implementation in specialized boot image class

disable_cleanup()[source]

Deactivate cleanup(deletion) of boot root directory

dump(filename)[source]

Pickle dump this instance to a file. If the object dump is requested the destructor code will also be disabled in order to preserve the generated data

Parameters:filename (string) – file path name
enable_cleanup()[source]

Activate cleanup(deletion) of boot root directory

get_boot_description_directory()[source]

Provide path to the boot image XML description

Returns:path name
Return type:str
get_boot_names()[source]

Provides kernel and initrd names for this boot image

Implementation in specialized boot image class

import_system_description_elements()[source]

Copy information from the system image relevant to create the boot image to the boot image state XML description

include_file(filename, install_media=False)[source]

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

Parameters:
  • filename (string) – file path name
  • install_media (bool) – include also for installation media initrd
is_prepared()[source]

Check if initrd system is prepared.

Returns:True or False
Return type:bool
load_boot_xml_description()[source]

Load the boot image description referenced by the system image description boot attribute

post_init()[source]

Post initialization method

Implementation in specialized boot image class

prepare()[source]

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

kiwi.boot.image.dracut Module

class kiwi.boot.image.dracut.BootImageDracut(xml_state, target_dir, root_dir=None, signing_keys=None)[source]

Bases: kiwi.boot.image.base.BootImageBase

Implements creation of dracut boot(initrd) images.

create_initrd(mbrid=None, basename=None, install_initrd=False)[source]

Call dracut as chroot operation to create the initrd and move the result into the image build target directory

Parameters:
  • mbrid (object) – unused
  • basename (string) – base initrd file name
  • install_initrd (bool) – installation media initrd
get_boot_names()[source]

Provides kernel and initrd names for kiwi boot image

Returns:Contains boot_names_type tuple
boot_names_type(
    kernel_name=’INSTALLED_KERNEL’,
    initrd_name=’DRACUT_OUTPUT_NAME’
)
Return type:tuple
include_file(filename, install_media=False)[source]

Include file to dracut boot image

Parameters:filename (string) – file path name
post_init()[source]

Post initialization method

Initialize empty list of dracut caller options

prepare()[source]

Prepare dracut caller environment

  • Create kiwi .profile environment to be included in dracut initrd
  • Setup machine_id(s) to be generic and rebuild by dracut on boot

kiwi.boot.image.builtin_kiwi Module

class kiwi.boot.image.builtin_kiwi.BootImageKiwi(xml_state, target_dir, root_dir=None, signing_keys=None)[source]

Bases: kiwi.boot.image.base.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.

create_initrd(mbrid=None, basename=None, install_initrd=False)[source]

Create initrd from prepared boot system tree and compress the result

Parameters:
  • mbrid (object) – instance of ImageIdentifier
  • basename (string) – base initrd file name
  • install_initrd (bool) – installation media initrd
get_boot_names()[source]

Provides kernel and initrd names for kiwi boot image

Returns:Contains boot_names_type tuple
boot_names_type(
    kernel_name=’linux.vmx’,
    initrd_name=’initrd.vmx’
)
Return type:tuple
post_init()[source]

Post initialization method

Creates custom directory to prepare the boot image root filesystem which is a separate image to create the initrd from

prepare()[source]

Prepare new root system suitable to create a kiwi initrd from it

Module Contents

class kiwi.boot.image.BootImage[source]

Bases: object

BootImge Factory

Parameters:
  • xml_state (object) – Instance of XMLState
  • target_dir (string) – target dir to store the initrd
  • root_dir (string) – system image root directory
  • signing_keys (list) – list of package signing keys