Bootloader installation and configuration |
include/bootloader/routines/misc-common.ycp |
Miscelaneous functions for bootloader configuration and installation | |
|
Get packages needed by specified bootloader maybe should be moved to bootloader specific modules
- Parameters:
-
bootloader string name of bootloader
- Return value:
-
a list of required packages names
return printable name of bootloader
- Parameters:
-
bootloader string bootloader type internal string mode symbol `combo or `summary (because of capitalization)
- Return value:
-
printable bootloader name
Get value of specified boolean bootloader attribute
- Parameters:
-
attrib string attribute name
- Return value:
-
value of attribute
Get value of specified bootloader attribute
- Parameters:
-
attrib string attribute name defaultv any default value of the attribute (if not found)
- Return value:
-
value of attribute
Get index of a section specified by name
- Parameters:
-
name string section name
- Return value:
-
index of the section or nil if not found
Get map where to store kernel parameters
- Return value:
-
describing where to store which kernel parameter
Generates unused section label for new section
- Return value:
-
label for new section
Get the list of installed floppy drives
- Return value:
-
a list of floppy devices
Update the text of countdown widget
- Parameters:
-
bootloader string printable name of used bootloader
List of all supported bootloaders
converts array of string to path
- Parameters:
-
strs list of string
- Return value:
-
whose components are taken from strs
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 `parts_old - all partitions, except those what will be created during isntallation `deleted - all partitions deleted in current proposal `kept - all partitions that won't be deleted, new created or formatted `destroyed - all partition which are new, deleted or formatted
- Return value:
-
a list of strings
returns true if char is blank (newline, tab or space)
- Parameters:
-
s single char string
- Return value:
-
blank/non blank
removes trailing and leading blank chars from string. eg: " as df " -> "as df"
- Parameters:
-
str string source string
- Return value:
-
stripped 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
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
returns list difference A \ B (items that are in A and are not in B)
- Parameters:
-
a list A b list B
- Return value:
-
see above
reverse of mod2ui
- Parameters:
-
val value to transform
- Return value:
-
transformed value
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
translate filename path (eg. /boot/kernel) to list of device and relative path
- Parameters:
-
fullpth string fileststem path (eg. /boot/vmlinuz)
- Return value:
-
a list containing device and relative path, eg. ["/dev/hda1", "/vmlinuz"]
translate list of device and relative path to filename path (eg. /boot/kernel)
- Parameters:
-
devpth list of two strings, first for device name, second for relative path (eg. ["/dev/hda1", "/vmlinuz"])
- Return value:
-
fileststem path (eg. /boot/vmlinuz)
If device is part of RAID (md), then return first of its members otherwise return the same as argument
- Parameters:
-
device string device of the RAID
- Return value:
-
first member of the RAID
Get bootloader device for specified location
- Return value:
-
device name
Check if installation to floppy is performed
- Return value:
-
true if installing bootloader to floppy
- Return value:
-
true if installing bootloader to floppy
Get the list of particular kernel parameters
- Parameters:
-
line string the whole kernel command line
- Return value:
-
a list of the kernel parameters split each separaterlly
get kernel parameter from kernel command line
- Parameters:
-
line string original line key string parameter key
- Return value:
-
value, "false" if not present, "true" if present key without value
set kernel parameter to GRUB command line
- Parameters:
-
key string parameter key line string original line value string value, "false" to remove key, "true" to add key without value
- Return value:
-
new kernel command line
remove blanks from section name and replace them with _ when not using GRUB
- Parameters:
-
original string
- Return value:
-
fixed string
Filter list to only entries which are present as keys in map
- Parameters:
-
order list (ordered) of settings widgets map of present widgets index of selected option
- Return value:
-
containing new index of selected option and list of options where options that aren't ordered precede ordered options
Get partition which should be activated if doing it during bl inst.
- Parameters:
-
boot_partition string the partition holding /boot subtree loader_device string the device to install bootloader to
- Return value:
-
a map $[ "dev" : string, "mbr": string, "num": any] containing device (eg. "/dev/hda4"), disk (eg. "/dev/hda") and partition number (eg. 4)
Get a list of partitions to activate if user wants to activate boot partition
- Return value:
-
a list of partitions to activate
Get the list of MBR disks that should be rewritten by generic code if user wants to do so
- Return value:
-
a list of device names to be rewritten
Get last change time of file
- Parameters:
-
filename string name of file
- Return value:
-
last change date as YYYY-MM-DD-HH-MM-SS
Save current MBR to /boot/backup_mbr Also save to /var/lib/YaST2/backup_boot_sectors/%device, if some existing, rename it
- Parameters:
-
device string name of device
Update contents of MBR (active partition and booting code) FIXME move tis function to lilolike.ycp
- Return value:
-
true on success
Rewrite current MBR with /var/lib/YaST2/backup_boot_sectors/%device Warning!!! don't use for bootsectors, 446 bytes of sector are written
- Parameters:
-
device string device to rewrite MBR to
- Return value:
-
true on success
Translate device name to major/minor number
- Parameters:
-
device string
- Return value:
-
major*256+minor hexadecimal without leading 0x, in case of any fail return unchanged device node
Translate device name to major/minor number if the device is not "usual"
- Parameters:
-
device string
- Return value:
-
the original device parameter if it is "usual", same as dev2majmin otherwise
Convert any to boolean
- Parameters:
-
v any value
- Return value:
-
retyped value
Update kernel parameters if some were added in Kernel module
- Parameters:
-
orig original kernel parameters or kernel command line
- Return value:
-
kernel command line or parameters with added new parameters
Check whether settings were changed and if yes, ask for exit without saving
- Return value:
-
true if shall exit
Get map of swap partitions
- Return value:
-
a map where key is partition name and value its size
Get the name of the largest available swap partition
- Return value:
-
name of the largest partition
Create translated name of a section
- Parameters:
-
orig string original section name
- Return value:
-
translated section name
Get translated section names, including diacritics
- Return value:
-
a map section names translations
Check if device is MBR of a disk
- Parameters:
-
device string device to check
- Return value:
-
true if is MBR
Add '(MBR)' to the disk description if it is a MBR of some partition
- Parameters:
-
descr string disk description device string disk device
- Return value:
-
updated description
Update the Kernel::vgaType value to the saved one if not defined
Get additional kernel parameters
- Return value:
-
additional kernel parameters
Get additional kernel parameters from control file
- Return value:
-
additional kernel parameters
Get additional kernel parameters splitted to a list
- Return value:
-
a list of additional kernel parameters
Update graphical bootloader to contain help text of current language And make the selected installation language default
- Return value:
-
true on success
Transform the selected linux section to section for previous kernel
- Parameters:
-
section a list representing the bootloader section
- Return value:
-
a list representing the updated section
Update device name according to changes in kernel (eg. SATA)
- Parameters:
-
device string the original device name
- Return value:
-
updated device
Check if memtest86 is present
- Return value:
-
true if memtest86 section is to be proposed
Check for additional kernels which could go to the proposed settings
- Return value:
-
a list of kernels to propose
Check if the bootloader can be installed at all with current configuration
- Return value:
-
true if it can