YaST2 Developers Documentation: RootPart.ycp

RootPart.ycp

  • Arvin Schnell
  • Purpose: Responsible for searching of root partitions and
  • mounting of target partitions.

This module has an unstable interface.

Imports

  • Arch
  • Directory
  • FileSystems
  • FileUtils
  • Installation
  • Label
  • Linuxrc
  • Mode
  • ModuleLoading
  • Popup
  • Report
  • Stage
  • Storage
  • String
  • SuSERelease
  • Update
  • Wizard

Includes

  • partitioning/custom_part_dialogs.ycp

Global Functions

Local Variables

Local Functions

local activated -> list <map <symbol, string> >

List of mounted partitions, activated swap partitions and loop devices. Amongst other things used for reversing action if mode is changed from update to new installation or if root partition for update is changed. The order of the list if of paramount importance.

Each item is list [string value, string type [, string device]] where:

Keys/values are:

`type The type, one of "mount", "swap" or "crypt".

`device The device.

global GetActivated () -> list <map <symbol, string> >

Returns currently activated partitions.

Return value:
activated
local sdb -> string

Link to SDB article concerning renaming of devices.

global GetInfoOfSelected (symbol what) -> string

Get the key what of the selected root partition.

Parameters:
what
global SetSelectedToValid () -> void

Set the selected root partition to some valid one. Only make sense if the number of valid root partition is one.

local AddToTargetMap () -> void

local RemoveFromTargetMap () -> void

global UnmountPartitions (boolean keep_in_target) -> void

Unmount all mounted partitions, deactivate swaps, detach loopback devices. Uses list activated to make actions in reverse order.

Parameters:
keep_in_target
local AddMountedPartition (map <symbol, string> partinfo) -> void

Add information about mounted partition to internal list.

Parameters:
partinfo partinfo has to be list with exactly two strings, see description of list "activated"
local FSCKPartition (string partition) -> void

Check the filesystem of a partition.

Parameters:
partition
global AnyQuestionAnyButtonsDetails (string headline, string question, string button_yes, string button_no, string details) -> boolean

Parameters:
headline
question
button_yes
button_no
details
local RunFSCKonJFS (string mount_type, string device, string & error_message) -> boolean

Function checks the device and returns whether it is OK or not. The read-only FS check is performed for jfs only and only one for one device.

Parameters:
mount_type
device
error_message
Return value:
if successfull or if user forces it
local MountPartition (string mount_point, string device, string mount_type) -> string

Mount partition on specified mount point

Parameters:
mount_point string mount point to monut the partition at
device string device to mount
mount_type string filesystem type to be specified while mounting
Return value:
nil on success, error description on fail
local FsckAndMount (string mount_point, string device, string mount_type) -> string

Check filesystem on a partition and mount the partition on specified mount point

Parameters:
mount_point string mount point to monut the partition at
device string device to mount
mount_type string filesystem type to be specified while mounting
Return value:
nil on success, error description on fail
local check_root_device (string partition, list <map> fstab, string& found_partition) -> boolean

Check that the root filesystem in fstab has the correct device.

Parameters:
partition
fstab
found_partition
local FindPartitionInFstab (list <map> & fstab, string mountpoint) -> string

Find a mount point in fstab

Parameters:
fstab a list of fstab entries
mountpoint string a mount point to find
Return value:
the found partition
local TranslateFsOrCryptoTab (list <map> translate, string key_to_translate, string key_preserve_as) -> list <map>

Translates FS or Cryptotab (old devices to new ones). Such as /dev/hda5 to /dev/sda5.

Parameters:
translate
key_to_translate
key_preserve_as
Return value:
of translated definitions
See
https://bugzilla.novell.com/show_bug.cgi?id=258222
local readFsTab (list <map> & fstab) -> void

Register a new fstab agent and read the configuration from Installation::destdir

Parameters:
fstab
local readCryptoTab (list <map> & crtab) -> void

Register a new cryptotab agent and read the configuration from Installation::destdir

Parameters:
crtab
local read_fstab_and_cryptotab (list <map>& fstab, list <map>& crtab, string root_device_current) -> boolean

Reads FSTab and CryptoTab and fills fstab and crtab got as parameters. Uses Installation::destdir as the base mount point.

Parameters:
fstab
crtab
root_device_current
local PrepareCryptoTab (list <map> crtab, list <map>& fstab) -> boolean

Parameters:
crtab
fstab
local IsMounted (string mountpoint) -> boolean

Check if specified mount point is mounted

Parameters:
mountpoint the mount point to be checked
Return value:
true if it is mounted
local MountFSTab (list <map> fstab, string& message) -> boolean

Parameters:
fstab
message
local MountVarPartition (string device) -> string

Mount /var partition

Parameters:
device string device holding the /var subtree
Return value:
nil on success, error description on fail
local MountVarIfRequired (list <map> fstab, string root_device_current, boolean manual_var_mount) -> string

Check if /var partition is needed, mount it if it is

Parameters:
fstab a list of fstab entries
root_device_current string current root device
manual_var_mount whether to ask user to enter /var device if not found
Return value:
nil on success, error description on fail
global MountPartitions (string root_device_current) -> boolean

Mounting root-partition; reading fstab and mounting read partitions

Parameters:
root_device_current
local GetArchOfELF (string filename) -> string

Get architecture of an elf file.

Parameters:
filename
global IncompleteInstallationDetected (string mounted_to) -> boolean

Checks the partition whether it contains an incomplete installation.

Parameters:
mounted_to
Return value:
true if incomplete
See
BNC #441919
local CheckPartition (map partition) -> map

Check a root partition and return map with infomations (see variable rootPartitions).

Parameters:
partition
global FindRootPartitions () -> void

Find all valid root partitions and place the result in rootPartitions. The partitions are mounted and unmounted again (to Installation::destdir). Loads a bunch of kernel modules.