32. BootCommon

Data to be shared between common and bootloader-specific parts of bootloader configurator/installator, generic versions of bootloader specific functions

32.1. Authors

  • Jiri Srain <jsrain@suse.cz>

  • Joachim Plack <jplack@suse.de>

  • Olaf Dabrunz <od@suse.de>

32.2. Summary of Module Globals

List of Global Functions

  • CreateLinuxSection - Create section for linux kernel

  • Dom0MemorySize - Get the size of memory for XEN's domain 0

  • Export - Export bootloader settings to a map

  • Import - Import settings from a map

  • Propose - Propose bootloader settings

  • Read - Read settings from disk

  • Reset - Reset bootloader settings

  • Save - Save all bootloader configuration files to the cache of the PlugLib PlugLib must be initialized properly !!!

  • Section2Index - Search for section passed

  • Summary - Display bootloader summary

  • Update - Update read settings to new version of configuration files

  • Write - Write bootloader settings to disk

  • XenPresent - Check whether XEN is selected for installation resp. selected

  • getBootloaders - List bootloaders available for configured architecture

  • getLoaderType - Get currently used bootloader, detect if not set yet

  • isTrustedGrub - Function check if trusted grub is selected or installed return true if is selected/installed and add trusted_grub to globals

  • setCurrentLoaderAttribs - Set attributes of specified bootloader to variable containing attributes of currently used bootloader, call its initializer

  • setLoaderType - set type of bootloader

List of Global Variables

  • BootPartitionDevice - string sepresenting device name of /boot partition same as RootPartitionDevice if no separate /boot partition

  • ExtendedPartitionDevice - string representing device name of extended partition

  • RootPartitionDevice - string representing device name of / partition

  • activate - Activate bootloader partition during installation?

  • activate_changed - Was the activate flag changed by user?

  • backup_mbr - Backup original MBR before installing bootloader

  • bois_id_missing - Flag indicates that bios_id_missing in disk true if missing false if at least one disk has bios_id

  • bootloader_attribs - Parameters of all bootloaders

  • bootloaders - List of all supported bootloaders

  • cached_settings_base_data_change_time - Saved change time from target map - proposal

  • changed - were settings changed (== true)

  • current_bootloader_attribs - Parameters of currently used bootloader

  • current_section - Curtrently edited section -- tmp store

  • current_section_index - Index of current section, -1 for new created section

  • current_section_name - Name of currently edited section

  • default_changed - true if default section is edited it is important for remember default name...

  • del_parts - List of partitions deleted in primary proposal

  • device_mapping - device mapping between Linux and firmware

  • exports - map of other exported information for new perl-Bootloader interface

  • files_edited - Were configuration files manually edited and chamged?

  • files_edited_warned - Has been files edited warning already shown?

  • floppy_devices - list of installed floppy devices

  • global_options - map of global options and types for new perl-Bootloader interface

  • globals - map of global options and values

  • kernelCmdLine - Kernel parameters at previous detection

  • loader_device - device to save loader stage 1 to NOTE: this variable is being phased out. The boot_* keys in the globals map are now used to remember the selected boot location. Thus, we now have a list of selected loader devices. It can be generated from the information in the boot_* keys and the global variables (Boot|Root|Extended)PartitionDevice and mbrDisk by calling GetBootloaderDevices().

  • location_changed - Was bootloader location changed? (== true)

  • mbrDisk - device holding MBR for bootloader

  • multipath_mapping - device mapping between real devices and multipath

  • one_section_changed - was currently edited section changed (== true)

  • opt_types - Option types for different bootloaders

  • other_bl - Settings of other bootloaders used when switching bootloader

  • partitioning_last_change - time of last change of partitioning

  • prefer_lilo - Last detection proposed to prefer lilo instead of grub

  • read_default_section_name - The name of the default section as it was read

  • removed_sections - true if memtest was removed by user (manually) during the installation proposal

  • repl_mbr - Replace MBR with generic code after bootloader installation?

  • save_all - Save everything, not only changed settings

  • save_on_finish - Shall be settings saved when finishing bootloader configuration?

  • section_options - map of section options and types for new perl-Bootloader interface

  • sections - list of section

  • sections_changed - were sections settings changes (== true)

  • selected_location - The kind of bootloader location that the user selected last time he went to the dialog. Used as a hint next time a proposal is requested, so the proposal can try to satisfy the user's previous preference. NOTE: this variable is being phased out. The boot_* keys in the globals map will be used to remember the last selected location. Currently, valid values are: mbr, boot, root, floppy, mbr_md, none

  • verbose - Show verbose summary output

  • was_proposed - was the propose function called (== true)

  • was_read - Were module settings read (== true)

  • write_settings - map of save mode settings

32.3. Global Functions

32.3.1. CreateLinuxSection

Create section for linux kernel

Function parameters

  • string title

Return value

  • map<string,any> - a map describing the section

32.3.2. Dom0MemorySize

Get the size of memory for XEN's domain 0

Return value

  • integer - the memory size in kB

32.3.3. Export

Export bootloader settings to a map

Return value

  • map - bootloader settings

32.3.4. Import

Import settings from a map

Function parameters

  • map settings

Return value

  • boolean - true on success

32.3.5. Propose

Propose bootloader settings

Return value

  • void

32.3.6. Read

Read settings from disk

Function parameters

  • boolean reread

  • boolean avoid_reading_device_map

Return value

  • boolean - true on success

32.3.7. Reset

Reset bootloader settings

Function parameters

  • boolean init

Return value

  • void

32.3.8. Save

Save all bootloader configuration files to the cache of the PlugLib PlugLib must be initialized properly !!!

Function parameters

  • boolean clean

  • boolean init

  • boolean flush

Return value

  • boolean - true if success

32.3.9. Section2Index

Search for section passed

Function parameters

  • string section_name

Return value

  • integer - index number

32.3.10. Summary

Display bootloader summary

Return value

  • list<string> - a list of summary lines

32.3.11. Update

Update read settings to new version of configuration files

Return value

  • void

32.3.12. Write

Write bootloader settings to disk

Return value

  • boolean - true on success

32.3.13. XenPresent

Check whether XEN is selected for installation resp. selected

Return value

  • boolean - true of XEN installed/selected

32.3.14. getBootloaders

List bootloaders available for configured architecture

Return value

  • list<string> - a list of bootloaders

32.3.15. getLoaderType

Get currently used bootloader, detect if not set yet

Function parameters

  • boolean recheck

Return value

  • string - botloader type

32.3.16. isTrustedGrub

Function check if trusted grub is selected or installed return true if is selected/installed and add trusted_grub to globals

Return value

  • boolean - true if trusted grub is selected/installed

32.3.17. setCurrentLoaderAttribs

Set attributes of specified bootloader to variable containing attributes of currently used bootloader, call its initializer

Function parameters

  • string loader_type

Return value

  • void

32.3.18. setLoaderType

set type of bootloader

Function parameters

  • string bootloader

Return value

  • void

32.4. Global Variables

32.4.1. BootPartitionDevice

string sepresenting device name of /boot partition same as RootPartitionDevice if no separate /boot partition

32.4.2. ExtendedPartitionDevice

string representing device name of extended partition

32.4.3. RootPartitionDevice

string representing device name of / partition

32.4.4. activate

Activate bootloader partition during installation?

32.4.5. activate_changed

Was the activate flag changed by user?

32.4.6. backup_mbr

Backup original MBR before installing bootloader

32.4.7. bois_id_missing

Flag indicates that bios_id_missing in disk true if missing false if at least one disk has bios_id

32.4.8. bootloader_attribs

Parameters of all bootloaders

32.4.9. bootloaders

List of all supported bootloaders

32.4.10. cached_settings_base_data_change_time

Saved change time from target map - proposal

32.4.11. changed

were settings changed (== true)

32.4.12. current_bootloader_attribs

Parameters of currently used bootloader

32.4.13. current_section

Curtrently edited section -- tmp store

32.4.14. current_section_index

Index of current section, -1 for new created section

32.4.15. current_section_name

Name of currently edited section

32.4.16. default_changed

true if default section is edited it is important for remember default name...

32.4.17. del_parts

List of partitions deleted in primary proposal

32.4.18. device_mapping

device mapping between Linux and firmware

32.4.19. exports

map of other exported information for new perl-Bootloader interface

32.4.20. files_edited

Were configuration files manually edited and chamged?

32.4.21. files_edited_warned

Has been files edited warning already shown?

32.4.22. floppy_devices

list of installed floppy devices

32.4.23. global_options

map of global options and types for new perl-Bootloader interface

32.4.24. globals

map of global options and values

32.4.25. kernelCmdLine

Kernel parameters at previous detection

32.4.26. loader_device

device to save loader stage 1 to NOTE: this variable is being phased out. The boot_* keys in the globals map are now used to remember the selected boot location. Thus, we now have a list of selected loader devices. It can be generated from the information in the boot_* keys and the global variables (Boot|Root|Extended)PartitionDevice and mbrDisk by calling GetBootloaderDevices().

32.4.27. location_changed

Was bootloader location changed? (== true)

32.4.28. mbrDisk

device holding MBR for bootloader

32.4.29. multipath_mapping

device mapping between real devices and multipath

32.4.30. one_section_changed

was currently edited section changed (== true)

32.4.31. opt_types

Option types for different bootloaders

32.4.32. other_bl

Settings of other bootloaders used when switching bootloader

32.4.33. partitioning_last_change

time of last change of partitioning

32.4.34. prefer_lilo

Last detection proposed to prefer lilo instead of grub

32.4.35. read_default_section_name

The name of the default section as it was read

32.4.36. removed_sections

true if memtest was removed by user (manually) during the installation proposal

32.4.37. repl_mbr

Replace MBR with generic code after bootloader installation?

32.4.38. save_all

Save everything, not only changed settings

32.4.39. save_on_finish

Shall be settings saved when finishing bootloader configuration?

32.4.40. section_options

map of section options and types for new perl-Bootloader interface

32.4.41. sections

list of section

32.4.42. sections_changed

were sections settings changes (== true)

32.4.43. selected_location

The kind of bootloader location that the user selected last time he went to the dialog. Used as a hint next time a proposal is requested, so the proposal can try to satisfy the user's previous preference. NOTE: this variable is being phased out. The boot_* keys in the globals map will be used to remember the last selected location. Currently, valid values are: mbr, boot, root, floppy, mbr_md, none

32.4.44. verbose

Show verbose summary output

32.4.45. was_proposed

was the propose function called (== true)

32.4.46. was_read

Were module settings read (== true)

32.4.47. write_settings

map of save mode settings

32.5. Module Requirements

32.5.1. Module Imports

  • Arch
  • GfxMenu
  • HTML
  • Linuxrc
  • Mode
  • Package
  • PackageSystem
  • PackagesProposal
  • Pkg
  • Popup
  • Storage
  • String

32.5.2. Module Includes

  • bootloader/generic/helps.ycp
  • bootloader/routines/lib_iface.ycp
  • bootloader/routines/lilolike.ycp
  • bootloader/routines/misc.ycp
  • bootloader/routines/popups.ycp