kiwi.bootloader.config Package¶
Submodules¶
kiwi.bootloader.config.base
Module¶
-
class
kiwi.bootloader.config.base.
BootLoaderConfigBase
(xml_state, root_dir, boot_dir=None, custom_args=None)[source]¶ Bases:
object
Base class for bootloader configuration
- Parameters
-
create_efi_path
(in_sub_dir='boot/efi')[source]¶ Create standard EFI boot directory structure
- Parameters
in_sub_dir (string) – toplevel directory
- Returns
Full qualified EFI boot path
- Return type
-
failsafe_boot_entry_requested
()[source]¶ Check if a failsafe boot entry is requested
- Returns
True or False
- Return type
-
get_boot_cmdline
(uuid=None)[source]¶ Boot commandline arguments passed to the kernel
- Parameters
uuid (string) – boot device UUID
- Returns
kernel boot arguments
- Return type
-
get_boot_path
(target='disk')[source]¶ 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
- Parameters
target (string) – target name: disk|iso
- Returns
path name
- Return type
-
get_boot_timeout_seconds
()[source]¶ Bootloader timeout in seconds
If no timeout is specified the default timeout applies
- Returns
timeout seconds
- Return type
-
get_continue_on_timeout
()[source]¶ Check if the boot should continue after boot timeout or not
- Returns
True or False
- Return type
-
get_gfxmode
(target)[source]¶ 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
- Parameters
target (string) – bootloader name
- Returns
boot graphics mode
- Return type
-
get_install_image_boot_default
(loader=None)[source]¶ 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.
- Parameters
loader (string) – bootloader name
- Returns
menu name or id
- Return type
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
- Returns
title text
- Return type
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
-
post_init
(custom_args)[source]¶ Post initialization method
Store custom arguments by default
- Parameters
custom_args (dict) – custom bootloader arguments
-
quote_title
(name)[source]¶ Quote special characters in the title name
Not all characters can be displayed correctly in the bootloader environment. Therefore a quoting is required
- Parameters
name (string) – title name
- Returns
quoted text
- Return type
-
setup_disk_boot_images
(boot_uuid, lookup_path=None)[source]¶ 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.
- Parameters
boot_uuid (string) – boot device UUID
lookup_path (string) – custom module lookup path
Implementation in specialized bootloader class required
-
setup_disk_image_config
(boot_uuid, root_uuid, hypervisor, kernel, initrd, boot_options={})[source]¶ Create boot config file to boot from disk.
- Parameters
boot_uuid (string) – boot device UUID
root_uuid (string) – root device UUID
hypervisor (string) – hypervisor name
kernel (string) – kernel name
initrd (string) – initrd name
boot_options (dict) – 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
-
setup_install_boot_images
(mbrid, lookup_path=None)[source]¶ Create bootloader images for ISO boot an install media
- Parameters
mbrid (string) – mbrid file name on boot device
lookup_path (string) – custom module lookup path
Implementation in specialized bootloader class required
-
setup_install_image_config
(mbrid, hypervisor, kernel, initrd)[source]¶ Create boot config file to boot from install media in EFI mode.
- Parameters
mbrid (string) – mbrid file name on boot device
hypervisor (string) – hypervisor name
kernel (string) – kernel name
initrd (string) – initrd name
Implementation in specialized bootloader class required
-
setup_live_boot_images
(mbrid, lookup_path=None)[source]¶ Create bootloader images for ISO boot a live ISO image
- Parameters
mbrid (string) – mbrid file name on boot device
lookup_path (string) – custom module lookup path
Implementation in specialized bootloader class required
-
setup_live_image_config
(mbrid, hypervisor, kernel, initrd)[source]¶ Create boot config file to boot live ISO image in EFI mode.
- Parameters
mbrid (string) – mbrid file name on boot device
hypervisor (string) – hypervisor name
kernel (string) – kernel name
initrd (string) – initrd name
Implementation in specialized bootloader class required
-
setup_sysconfig_bootloader
()[source]¶ Create or update etc/sysconfig/bootloader by parameters required according to the bootloader setup
Implementation in specialized bootloader class required
kiwi.bootloader.config.grub2
Module¶
-
class
kiwi.bootloader.config.grub2.
BootLoaderConfigGrub2
(xml_state, root_dir, boot_dir=None, custom_args=None)[source]¶ Bases:
kiwi.bootloader.config.base.BootLoaderConfigBase
grub2 bootloader configuration.
-
post_init
(custom_args)[source]¶ grub2 post initialization method
- Parameters
custom_args (dict) –
Contains grub config arguments
{'grub_directory_name': 'grub|grub2'}
-
setup_disk_boot_images
(boot_uuid, lookup_path=None)[source]¶ 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
- Parameters
boot_uuid (string) – boot device UUID
lookup_path (string) – custom module lookup path
-
setup_disk_image_config
(boot_uuid=None, root_uuid=None, hypervisor=None, kernel=None, initrd=None, boot_options={})[source]¶ Create grub2 config file to boot from disk using grub2-mkconfig
- Parameters
boot_uuid (string) – unused
root_uuid (string) – unused
hypervisor (string) – unused
kernel (string) – unused
initrd (string) – unused
boot_options (dict) –
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() }
-
setup_install_boot_images
(mbrid, lookup_path=None)[source]¶ 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
- Parameters
mbrid (string) – mbrid file name on boot device
lookup_path (string) – custom module lookup path
-
setup_install_image_config
(mbrid, hypervisor='xen.gz', kernel='linux', initrd='initrd')[source]¶ Create grub2 config file to boot from an ISO install image
- Parameters
mbrid (string) – mbrid file name on boot device
hypervisor (string) – hypervisor name
kernel (string) – kernel name
initrd (string) – initrd name
-
setup_live_boot_images
(mbrid, lookup_path=None)[source]¶ Create/Provide grub2 boot images and metadata
Calls setup_install_boot_images because no different action required
-
setup_live_image_config
(mbrid, hypervisor='xen.gz', kernel='linux', initrd='initrd')[source]¶ Create grub2 config file to boot a live media ISO image
- Parameters
mbrid (string) – mbrid file name on boot device
hypervisor (string) – hypervisor name
kernel (string) – kernel name
initrd (string) – initrd name
-
write
()[source]¶ 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_meta_data
(root_uuid=None, boot_options='')[source]¶ Write bootloader setup meta data files
cmdline arguments initialization
etc/default/grub setup file
etc/default/zipl2grub.conf.in (s390 only)
etc/sysconfig/bootloader
- Parameters
root_uuid (string) – root device UUID
boot_options (string) – kernel options as string
iso_boot (bool) – indicate target is an ISO
-
kiwi.bootloader.config.isolinux
Module¶
-
class
kiwi.bootloader.config.isolinux.
BootLoaderConfigIsoLinux
(xml_state, root_dir, boot_dir=None, custom_args=None)[source]¶ Bases:
kiwi.bootloader.config.base.BootLoaderConfigBase
isolinux bootloader configuration.
-
post_init
(custom_args)[source]¶ isolinux post initialization method
- Parameters
custom_args (dict) – custom isolinux config arguments
-
setup_install_boot_images
(mbrid, lookup_path=None)[source]¶ Provide isolinux boot metadata
No extra boot images must be created for isolinux
- Parameters
mbrid (string) – unused
lookup_path (string) – unused
-
setup_install_image_config
(mbrid, hypervisor='xen.gz', kernel='linux', initrd='initrd')[source]¶ Create isolinux.cfg in memory from a template suitable to boot from an ISO image in BIOS boot mode
- Parameters
mbrid (string) – mbrid file name on boot device
hypervisor (string) – hypervisor name
kernel (string) – kernel name
initrd (string) – initrd name
-
setup_live_boot_images
(mbrid, lookup_path=None)[source]¶ Provide isolinux boot metadata
No extra boot images must be created for isolinux
- Parameters
mbrid (string) – unused
lookup_path (string) – unused
-
setup_live_image_config
(mbrid, hypervisor='xen.gz', kernel='linux', initrd='initrd')[source]¶ Create isolinux.cfg in memory from a template suitable to boot a live system from an ISO image in BIOS boot mode
- Parameters
mbrid (string) – mbrid file name on boot device
hypervisor (string) – hypervisor name
kernel (string) – kernel name
initrd (string) – initrd name
-