YaST2 Developers Documentation: Bootloader installation and configuration

Bootloader installation and configuration

modules/BootCommon.ycp
Data to be shared between common and bootloader-specific parts of bootloader configurator/installator, generic versions of bootloader specific functions
  • Jiri Srain
  • Joachim Plack
  • Olaf Dabrunz

This module has an unstable interface.

Imports

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

Includes

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

Global Variables

Global Functions

Local Variables

Local Functions

global global_options -> map<string,any>

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

global section_options -> map<string,any>

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

global boot_device_on_logical -> boolean

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

global globals -> map<string,string>

map of global options and values

global sections -> list<map<string,any> >

list of section

global cached_settings_base_data_change_time -> integer

Saved change time from target map - proposal

Info:

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

Info:

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

global current_bootloader_attribs -> map<string, any>

Parameters of currently used bootloader

global bootloader_attribs -> map<string,map<string, any> >

Parameters of all bootloaders

global current_section_name -> string

Name of currently edited section

global current_section_index -> integer

Index of current section, -1 for new created section

global current_section -> map<string,any>

Curtrently edited section -- tmp store

global opt_types -> map<string,map<string,string> >

Option types for different bootloaders

global mbrDisk -> string

device holding MBR for bootloader

global one_section_changed -> boolean

was currently edited section changed (== true)

global backup_mbr -> boolean

Backup original MBR before installing bootloader

global activate -> boolean

Activate bootloader partition during installation?

global repl_mbr -> boolean

Replace MBR with generic code after bootloader installation?

global kernelCmdLine -> string

Kernel parameters at previous detection

global changed -> boolean

were settings changed (== true)

local loader_type -> string

type of bootloader to configure/being configured shall be one of "lilo", "grub", "elilo", "ppc", "zipl"

global del_parts -> list<string>

List of partitions deleted in primary proposal

global write_settings -> map

map of save mode settings

global verbose -> boolean

Show verbose summary output

global other_bl -> map

Settings of other bootloaders used when switching bootloader

global activate_changed -> boolean

Was the activate flag changed by user?

global save_all -> boolean

Save everything, not only changed settings

global was_proposed -> boolean

was the propose function called (== true)

global was_read -> boolean

Were module settings read (== true)

global location_changed -> boolean

Was bootloader location changed? (== true)

global files_edited -> boolean

Were configuration files manually edited and chamged?

global files_edited_warned -> boolean

Has been files edited warning already shown?

global partitioning_last_change -> integer

time of last change of partitioning

Info:

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

global read_default_section_name -> string

The name of the default section as it was read

Info:

Types of sections that should be updated (changed device names)

global bootloaders -> list<string>

List of all supported bootloaders

global XenPresent () -> boolean

Check whether XEN is selected for installation resp. selected

Return value:
true of XEN installed/selected
global isTrustedGrub () -> boolean

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

Return value:
true if trusted grub is selected/installed
global Dom0MemorySize () -> integer

Get the size of memory for XEN's domain 0

Return value:
the memory size in kB
global CreateLinuxSection (string title) -> map<string,any>

Create section for linux kernel

Parameters:
title string the section name to create (untranslated)
Return value:
a map describing the section
global Export () -> map

Export bootloader settings to a map

Return value:
bootloader settings
global Import (map settings) -> boolean

Import settings from a map

Parameters:
settings map of bootloader settings
Return value:
true on success
global Read (boolean reread, boolean avoid_reading_device_map) -> boolean

Read settings from disk

Parameters:
reread boolean true to force reread settings from system
avoid_reading_device_map do not read new device map from file, use internal data
Return value:
true on success
global Reset (boolean init) -> void

Reset bootloader settings

Parameters:
init boolean true to repropose also device map
global Propose () -> void

Propose bootloader settings

global Save (boolean clean, boolean init, boolean flush) -> boolean

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

Parameters:
clean boolean true if settings should be cleaned up (checking their correctness, supposing all files are on the disk)
init boolean true to init the library
flush boolean true to flush settings to the disk
Return value:
true if success
global Summary () -> list<string>

Display bootloader summary

Return value:
a list of summary lines
global Update () -> void

Update read settings to new version of configuration files

global Write () -> boolean

Write bootloader settings to disk

Return value:
true on success
global setCurrentLoaderAttribs (string loader_type) -> void

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

Parameters:
loader_type string loader type to initialize
local SupportedLoader (string loader) -> string

Check whether loader with specified name is supported

Parameters:
loader string name of loader to check
Return value:
the loader name if supported, "none" otherwise
global getLoaderType (boolean recheck) -> string

Get currently used bootloader, detect if not set yet

Parameters:
recheck boolean force checking bootloader
Return value:
botloader type
global setLoaderType (string bootloader) -> void

set type of bootloader

Parameters:
bootloader string type of bootloader
global getBootloaders () -> list<string>

List bootloaders available for configured architecture

Return value:
a list of bootloaders
global Section2Index (string section_name) -> integer

Search for section passed

Parameters:
section_name
Return value:
index number