Configuration of lilo
|
routines.ycp
|
|
miscellaneous functions.
|
|
|
|
miscellaneous functions.
Imports
Functions
- boot ()
- checkSectionExistence (string sectname)
- check_aliases (map liloconf, string omit_section, string new_name, string new_alias)
- check_values (map vals)
- createMap ()
- createOptsTable (map values)
- createSummaryTable ()
- create_sect_summary ()
- create_summary_text ()
- difflist (list a, list b)
- getCurrentOpts (string type)
- getGrubConf (map settings)
- getGrubKernelParamFromLine (string line, string key)
- getGrubPath (string pth)
- getImageDescr (string pth)
- getLinuxPath (string pth)
- getOptMap (string sectName)
- getPartitionList (symbol type)
- getSectionType (string label)
- get_default_section ()
- globalOptionList ()
- grub2Lilo (string o_dev)
- imageOptionList ()
- isBlank (string s)
- isSpecial (string opt)
- lilo2Grub (string o_dev)
- list2path (list strs)
- map2list (map m)
- mod2ui (any val)
- normalizeValue (string optname, any val)
- opttypes ()
- otherOptionList ()
- parseGrubConf ()
- parseGrubConfFrom (string filename)
- remove_ws (string in)
- removekey (map m, any key)
- replaceAll (string src, string from, string to)
- replaceitem (list source, any new_item, integer pos)
- saveGrubConf (map settings)
- saveGrubConfTo (map settings, string filename)
- setGrubKernelParamToLine (string line, string key, string value)
- strip (string str)
- swapItems (list input, integer index1, integer index2)
- toItemList (list l)
- ui2mod (any val)
|
|
|
|
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:
|
global parseGrubConf () -> map
|
|
parse /etc/grub file
- Return value:
|
global parseGrubConfFrom (string filename) -> map
|
|
parse /etc/grub file from other file
- Parameters:
|
filename |
string name of file |
- Return value:
|
global getGrubConf (map settings) -> string
|
|
get /etc/grub.conf file from settings as string
- Parameters:
- Return value:
|
global saveGrubConf (map settings) -> boolean
|
|
save /etc/grub.conf
- Parameters:
- Return value:
|
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:
|
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:
|
global getLinuxPath (string pth) -> string
|
|
translate grub device/path (eg. (hd0,0)/kernel) to filename path (eg. /boot/kernel)
- Parameters:
- Return value:
|
global lilo2Grub (string o_dev) -> string
|
|
translate UNIX device /dev/hda to grub device (hd0)
- Parameters:
- Return value:
|
global grub2Lilo (string o_dev) -> string
|
|
translate grub device (hd0) to UNIX device /dev/hda
- Parameters:
- Return value:
|
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:
|
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:
|
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:
|
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:
|
global isBlank (string s) -> boolean
|
|
returns true if char is blank (newline, tab or space)
- Parameters:
- Return value:
|
global strip (string str) -> string
|
|
removes trailing and leading blank chars from string. eg: " as df " -> "as df"
- Parameters:
- Return value:
|
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:
|
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:
- Return value:
|
global ui2mod (any val) -> any
|
|
reverse of mod2ui
- Parameters:
- Return value:
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:
|
global difflist (list a, list b) -> list
|
|
returns list difference A \ B (items that are in A and are not in B)
- Parameters:
- Return value:
|
global list2path (list strs) -> path
|
|
converts array of string to path
- Parameters:
- Return value:
|
|
whose components are taken from strs |
|
global isSpecial (string opt) -> boolean
|
|
return true if given option is special
- Parameters:
- Return value:
|
global checkSectionExistence (string sectname) -> boolean
|
|
returns true if section with given name exists
- Parameters:
- Return value:
|
global removekey (map m, any key) -> map
|
|
deletes key from map
- Parameters:
|
m |
input map |
|
key |
key to remove |
- Return value:
|
global map2list (map m) -> list
|
|
converts map into a list of pairs eg $["A":"B"] => [["A", "B"]]
- Parameters:
- Return value:
|
global getImageDescr (string pth) -> string
|
|
returns string with file description (uses /usr/bin/file)
- Parameters:
- Return value:
|
global toItemList (list l) -> list
|
|
converts list into item list
- Parameters:
- 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:
|
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:
- Return value:
|
|
section type 'image'/'other' |
|
global opttypes () -> map
|
|
returns map of options and their types
- Return value:
|
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:
|
global getCurrentOpts (string type) -> list
|
|
this function returns options list for given section type
- Parameters:
|
type |
section type (image/global/other) |
- Return value:
|
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:
|
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:
- 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:
|
global create_summary_text () -> string
|
|
creates the summary text for intro dialog
- Return value:
|
global remove_ws (string in) -> string
|
|
Remove starting and trailing white spaces from string
- Parameters:
- Return value:
|
|
Result string (if 'in' is nil return "") |
|