YaST2 Developers Documentation: Configuration of lilo



functions
files
intro

Configuration of lilo

routines.ycp
miscellaneous functions.
miscellaneous functions.

Imports

  • Arch
  • Boot
  • Lilo

Functions

global getGrubKernelParamFromLine (string line, string key) -> string

get kernel parameter from GRUB command line

Parameters:
line string original line
key string parameter key
Return value:
value, "false" if not present, "true" if present key without value

global setGrubKernelParamToLine (string line, string key, string value) -> string

set kernel parameter to GRUB command line

Parameters:
line string original line
key string parameter key
value string value, "false" to remove key, "true" to add key without value
Return value:
new kernel command line

global parseGrubConf () -> map

parse /etc/grub file

Return value:
of settings

global parseGrubConfFrom (string filename) -> map

parse /etc/grub file from other file

Parameters:
filename string name of file
Return value:
of settings

global getGrubConf (map settings) -> string

get /etc/grub.conf file from settings as string

Parameters:
settings map of settings
Return value:
file contents

global saveGrubConf (map settings) -> boolean

save /etc/grub.conf

Parameters:
settings map settings
Return value:
true if success

global saveGrubConfTo (map settings, string filename) -> boolean

save /etc/grub.conf to specified file

Parameters:
settings map GRUB main settings
filename string filename to save to
Return value:
true if success

global createMap () -> void

Create the grub devices map

global getGrubPath (string pth) -> string

translate filename path (eg. /boot/kernel) to grub device/path (eg. (hd0,0)/kernel)

Parameters:
pth string fileststem path
Return value:
grub path

global getLinuxPath (string pth) -> string

translate grub device/path (eg. (hd0,0)/kernel) to filename path (eg. /boot/kernel)

Parameters:
pth string grub path
Return value:
filesystem path

global lilo2Grub (string o_dev) -> string

translate UNIX device /dev/hda to grub device (hd0)

Parameters:
o_dev string UNIX device
Return value:
grub device

global grub2Lilo (string o_dev) -> string

translate grub device (hd0) to UNIX device /dev/hda

Parameters:
o_dev string grub device
Return value:
UNIX device

global swapItems (list input, integer index1, integer index2) -> list

returns modified list where items index1 and index2 are swapped. if indices are out of bounds, unmodified list is returned.

Parameters:
input list
index1 index of the first element
index2 index og the second element
Return value:
modified list

global get_default_section () -> string

returns the name of default section. of no default section is specified the first section is considered as default.

Return value:
default section label

global replaceitem (list source, any new_item, integer pos) -> list

replaces pos'th item of source list by new_item, returns modified list. if pos is greater than array size, item is added to the end

Parameters:
source source list
new_item any value
pos integer
Return value:
modified list

global replaceAll (string src, string from, string to) -> string

replaces all occurences of 'from' to 'to' in src

Parameters:
src input string
from string to be replaced
to string to be replaced by
Return value:
modified string

global isBlank (string s) -> boolean

returns true if char is blank (newline, tab or space)

Parameters:
s single char string
Return value:
blank/non blank

global strip (string str) -> string

removes trailing and leading blank chars from string. eg: " as df " -> "as df"

Parameters:
str string source string
Return value:
stripped string

global normalizeValue (string optname, any val) -> any

this is used for normalizing values of special options that comes from ui to agent. when setting 'change-rules' and 'change' these string must come to the beginning of the string. so if they are missing, they are added eg: "change-rules,reset,type=23" -> "change-rules,reset,type=23" eg: "reset,type=23" -> "change-rules,reset,type=23"

Parameters:
optname string option name
val any value
Return value:
proper value

global mod2ui (any val) -> any

convert string values from agent representation to module representation 1) if string is quoted, quotes are removed 2) if string contains escaped quotes, they're unescaped

Parameters:
val value to transform
Return value:
transformed value

global ui2mod (any val) -> any

reverse of mod2ui

Parameters:
val value to transform
Return value:
transformed value

global boot () -> string

reads the global settings and returns booloader for current platform. this is just a helper function, present only because this setting is frequently needed

Return value:
architecture

global difflist (list a, list b) -> list

returns list difference A \ B (items that are in A and are not in B)

Parameters:
a list 1
b list 2
Return value:
see above

global list2path (list strs) -> path

converts array of string to path

Parameters:
strs list of string
Return value:
whose components are taken from strs

global isSpecial (string opt) -> boolean

return true if given option is special

Parameters:
opt option name
Return value:
special/not

global checkSectionExistence (string sectname) -> boolean

returns true if section with given name exists

Parameters:
sectname section label
Return value:
exists/doesn't

global removekey (map m, any key) -> map

deletes key from map

Parameters:
m input map
key key to remove
Return value:
modified map

global map2list (map m) -> list

converts map into a list of pairs eg $["A":"B"] => [["A", "B"]]

Parameters:
m map
Return value:
transformed map

global getImageDescr (string pth) -> string

returns string with file description (uses /usr/bin/file)

Parameters:
pth path to file
Return value:
description string

global toItemList (list l) -> list

converts list into item list

Parameters:
l list
Return value:
of items for combo box. id of each item is it's value

global getPartitionList (symbol type) -> list

returns list of partitions. looks at '/proc/partitions' and creates list of partition for combobox or menu

Parameters:
type symbol `boot - for botloader installation `root - for kernel root `boot_other - for bootable partitions of other systems `all - all partitions
Return value:
of strings

global createSummaryTable () -> list

creates table for summary dialog. list of images and other sections is created, default section is marked

Return value:
of items for 'table' widget

global getSectionType (string label) -> string

for given name returns section type ('image', 'other', '' (for error)) works as a function for checking whether the name already exists (when adding a new section)

Parameters:
label section label
Return value:
section type 'image'/'other'

global opttypes () -> map

returns map of options and their types

Return value:
option types

global imageOptionList () -> list

returns sorted list of known options for image-section

Return value:
option list for 'image' section

global otherOptionList () -> list

returns sorted list of known options for other-section

Return value:
option list fot 'other' section

global globalOptionList () -> list

returns sorted list of known options for global section

Return value:
option list

global getCurrentOpts (string type) -> list

this function returns options list for given section type

Parameters:
type section type (image/global/other)
Return value:
of options

global createOptsTable (map values) -> list

as a param this takes map of type $["option": "value" ....] and converts it to item list used by Table widget

Parameters:
values map options and values
Return value:
of items

global getOptMap (string sectName) -> map

reads all option of given section from agent and creates a map $["option": "value"...]

Parameters:
sectName string section name
Return value:
with options as keys and treir values

global check_values (map vals) -> list

checks for string options and returns list of options that have empty value

Parameters:
vals map options
Return value:
of strings with options that have invalid value

global check_aliases (map liloconf, string omit_section, string new_name, string new_alias) -> string

this function tries to find alias/label duplicities in lilo settings

Parameters:
liloconf settings
omit_section skip section with given name
new_name new section name
new_alias pass "" if no alias was specified for given section
Return value:
error message with duplicity description or empty string on success

global create_sect_summary () -> string

creates a short description of section of given type. used by create_summary_text

Return value:
summary of all sections

global create_summary_text () -> string

creates the summary text for intro dialog

Return value:
textual summary

global remove_ws (string in) -> string

Remove starting and trailing white spaces from string

Parameters:
in
Return value:
Result string (if 'in' is nil return "")

YaST2 Developers Documentation