31. BootCommon

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

31.1. Authors

  • Jiri Srain <jsrain@suse.cz>

  • Joachim Plack <jplack@suse.de>

  • Olaf Dabrunz <od@suse.de>

31.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?

  • all_partitions - bnc #468922 - problem with longtime running the parsing a huge number of disks map<string,map> the map of all partitions with info about it -> necessary for Dev2MountByDev() in routines/misc.ycp

  • 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

  • boot_device_on_logical - boolean value indicate if "/" is on logical and primary /boot doesn't exist

  • 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?

  • saved_last_change_time_from_storage - Saved change time from target map - only for MapAllPartitions()

  • 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

31.3. Global Functions

31.3.1. CreateLinuxSection

Create section for linux kernel

Function parameters

  • string title

Return value

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

31.3.2. Dom0MemorySize

Get the size of memory for XEN's domain 0

Return value

  • integer - the memory size in kB

31.3.3. Export

Export bootloader settings to a map

Return value

  • map - bootloader settings

31.3.4. Import

Import settings from a map

Function parameters

  • map settings

Return value

  • boolean - true on success

31.3.5. Propose

Propose bootloader settings

Return value

  • void

31.3.6. Read

Read settings from disk

Function parameters

  • boolean reread

  • boolean avoid_reading_device_map

Return value

  • boolean - true on success

31.3.7. Reset

Reset bootloader settings

Function parameters

  • boolean init

Return value

  • void

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

31.3.9. Section2Index

Search for section passed

Function parameters

  • string section_name

Return value

  • integer - index number

31.3.10. Summary

Display bootloader summary

Return value

  • list<string> - a list of summary lines

31.3.11. Update

Update read settings to new version of configuration files

Return value

  • void

31.3.12. Write

Write bootloader settings to disk

Return value

  • boolean - true on success

31.3.13. XenPresent

Check whether XEN is selected for installation resp. selected

Return value

  • boolean - true of XEN installed/selected

31.3.14. getBootloaders

List bootloaders available for configured architecture

Return value

  • list<string> - a list of bootloaders

31.3.15. getLoaderType

Get currently used bootloader, detect if not set yet

Function parameters

  • boolean recheck

Return value

  • string - botloader type

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

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

31.3.18. setLoaderType

set type of bootloader

Function parameters

  • string bootloader

Return value

  • void

31.4. Global Variables

31.4.1. BootPartitionDevice

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

31.4.2. ExtendedPartitionDevice

string representing device name of extended partition

31.4.3. RootPartitionDevice

string representing device name of / partition

31.4.4. activate

Activate bootloader partition during installation?

31.4.5. activate_changed

Was the activate flag changed by user?

31.4.6. all_partitions

bnc #468922 - problem with longtime running the parsing a huge number of disks map<string,map> the map of all partitions with info about it -> necessary for Dev2MountByDev() in routines/misc.ycp

31.4.7. backup_mbr

Backup original MBR before installing bootloader

31.4.8. bois_id_missing

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

31.4.9. boot_device_on_logical

boolean value indicate if "/" is on logical and primary /boot doesn't exist

31.4.10. bootloader_attribs

Parameters of all bootloaders

31.4.11. bootloaders

List of all supported bootloaders

31.4.12. cached_settings_base_data_change_time

Saved change time from target map - proposal

31.4.13. changed

were settings changed (== true)

31.4.14. current_bootloader_attribs

Parameters of currently used bootloader

31.4.15. current_section

Curtrently edited section -- tmp store

31.4.16. current_section_index

Index of current section, -1 for new created section

31.4.17. current_section_name

Name of currently edited section

31.4.18. default_changed

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

31.4.19. del_parts

List of partitions deleted in primary proposal

31.4.20. device_mapping

device mapping between Linux and firmware

31.4.21. exports

map of other exported information for new perl-Bootloader interface

31.4.22. files_edited

Were configuration files manually edited and chamged?

31.4.23. files_edited_warned

Has been files edited warning already shown?

31.4.24. floppy_devices

list of installed floppy devices

31.4.25. global_options

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

31.4.26. globals

map of global options and values

31.4.27. kernelCmdLine

Kernel parameters at previous detection

31.4.28. 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().

31.4.29. location_changed

Was bootloader location changed? (== true)

31.4.30. mbrDisk

device holding MBR for bootloader

31.4.31. multipath_mapping

device mapping between real devices and multipath

31.4.32. one_section_changed

was currently edited section changed (== true)

31.4.33. opt_types

Option types for different bootloaders

31.4.34. other_bl

Settings of other bootloaders used when switching bootloader

31.4.35. partitioning_last_change

time of last change of partitioning

31.4.36. prefer_lilo

Last detection proposed to prefer lilo instead of grub

31.4.37. read_default_section_name

The name of the default section as it was read

31.4.38. removed_sections

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

31.4.39. repl_mbr

Replace MBR with generic code after bootloader installation?

31.4.40. save_all

Save everything, not only changed settings

31.4.41. save_on_finish

Shall be settings saved when finishing bootloader configuration?

31.4.42. saved_last_change_time_from_storage

Saved change time from target map - only for MapAllPartitions()

31.4.43. section_options

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

31.4.44. sections

list of section

31.4.45. sections_changed

were sections settings changes (== true)

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

31.4.47. verbose

Show verbose summary output

31.4.48. was_proposed

was the propose function called (== true)

31.4.49. was_read

Were module settings read (== true)

31.4.50. write_settings

map of save mode settings

31.5. Module Requirements

31.5.1. Module Imports

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

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