Unknown YCP Module |
This module has an unstable interface. |
Module: Storage.ycp
Authors: Johannes Buchhold (jbuch@suse.de)
Purpose: These module contains all settings/information which are needed to partitioning the harddisk. Futhermore it contains a interface to * access and modify the partitioning settings.
Todo: Translate Diese Modul enthält alle Informationen die für die Partitionierung der Festplatten erforderlich sind. Diese Informationen bestehen aus der Beschreibung, der vor der Partitionierung vorhandenen Platteneinstellungen, und der Art und Weise wie diese verändert werden soll. Alle nötigen Zugriffsfunktionen auf diese Datenstruktur sind ebenfalls in diesem Modul enthalten. Der Zugriff auf die Speicherung der Partitionseinstellungen läuft also nur über dieses Modul. Der Zugriff und die Rückgabe von Teilen der Partitionsdatenstruktur wurde versucht "intelligent" zu gestallten und ist im einzelen bei den entspechenden Funktionen näher erklärt.
Converts a string into a integer and checks the allowed range for the integer. The range check is a bit sloppy to compensate rounding issues but it's guaranteed that the result lies within the allowed range.
- Parameters:
-
str bytes_k min_k max_k
Returns Device Name
- Parameters:
-
disk partition
- Return value:
-
device name
- Example
-
Storage::GetDeviceName("/dev/md", 1) Storage::GetDeviceName("/dev/system", "root")
Returns map describing the disk partition
- Parameters:
-
device
- Return value:
-
DiskPartition Examples: "/dev/sda" -> $[ "disk" : "/dev/sda", "nr" : "" ] "/dev/sda2" -> $[ "disk" : "/dev/sda", "nr" : 2 ] "/dev/system" -> $[ "disk" : "/dev/system", "nr" : "" ] "/dev/system/abuild" -> $[ "disk" : "/dev/system", "nr" : "abuild" ]
Returns disk identified by 'device' taken from the 'tg' (target) map
- Parameters:
-
tg device
Get List of swap partitions
- Return value:
-
List of swap partitions
Returns map of free space per partition
- Parameters:
-
device used_fs verbose
Updates target map
- See
-
GetTargetMap()
Returns map with disk info
- Parameters:
-
device disk
- Return value:
-
disk info
Returns map describing the disk target
Creates a new partition
- Parameters:
-
disk device ptype id start len mby
- Return value:
-
if successful
Sets a mountpoint for partition
- Parameters:
-
device mp
- Return value:
-
if successful
Sets whether a partition should be formatted
- Parameters:
-
device format fs
- Return value:
-
if successful
Sets partition ID
- Parameters:
-
device id
- Return value:
-
if successful
Restores the original partition ID
- Parameters:
-
device
- Return value:
-
if succesful
- See
-
SetPartitionId()
Sets a new size for volume
- Parameters:
-
device disk new_cyls
- Return value:
-
if successful
Sets a new size for volume
- Parameters:
-
device disk new_size_k
- Return value:
-
if successful
Delete the partition table and disk label of device
- Parameters:
-
disk label
Set the flag if a disk needs to be initialized
- Parameters:
-
disk value
Search in the list partitions for windows partitions and add the key "mount" to the found windows partitions.
- Parameters:
-
partitions primary max_prim foreign_nr
- Return value:
-
new partitions with windows mountpoints
Removes ... maps to ...
- Parameters:
-
device
mark swap-partitions with pseudo Mountpoint swap in targetMap
- Parameters:
-
target Disk map
- Return value:
-
modified target
Returns a system target map.
$[ ... ? ]
- Return value:
-
target map
Rereads the system target map and returns it
- Return value:
-
target map
- See
-
GetTargetMap();
Apply storage changes
Umounts a device
- Parameters:
-
dev unsetup
- Return value:
-
if successful
- See
-
Mount()
Mounts a device
- Parameters:
-
dev mp fstopt mount options
- Return value:
-
if successful
- See
-
Umount()
Mounts a device
- Parameters:
-
dev mp
- Return value:
-
if successful
- See
-
Umount()
Tries to umount given device if mounted
- Parameters:
-
device
- Return value:
-
if successful
Reads and returns fstab from directory
FIXME: please, add description of the list that is returned by this function.
Structure [...unknown...]
- Parameters:
-
dir
- Return value:
-
fstab?
FIXME: please, add description of the list that is returned by this function.
GetMountPoints() collect mountpoint:device as map to get a sorted list
Structure $[ [...], [...], ... ]
- Return value:
-
of lists, the map key is the mount point, usually starting with a "/". Exception is "swap" For directory mount points (key starting with /) the value is a list [partitionName, fsid, targetdevice, raid_type] For swap mount points, the value is a list of lists: [[partitionName, fsid, targetdevice, raid_type], ...] FIXME: please, add more detailed description of the 'map of lists' with examples if possible.
Set
- Parameters:
-
tg device key value
- Return value:
-
changed target map
Check if a disk is a real disk and not RAID or LVM
Structure entry ~ $[
"type":`CT_DISK, "driver" : "?", "readonly" : false / true, ]
- Parameters:
-
entry
- Return value:
-
true if real disk
Checks if a container is partitionable
Structure entry ~ $[ "type" : ... ? ]
- Parameters:
-
entry
- Return value:
-
true if partitionable
Get list of all Linux Partitions on all real disks
- Return value:
-
Partition list
Check if swap paritition is availbe on a disk
- Parameters:
-
disk Disk to be checked
- Return value:
-
true if swap available.
Returns list of primary partitions found
- Parameters:
-
targets foreign_os
- Return value:
-
of primary partitions
Takes care of selecting packages needed by storage in installation (replacement for HandlePackages in *_proposal clients)
Returns whether a partition is resizable
- Parameters:
-
part
- Return value:
-
resizable ?
Adds an entry into the fstab
- Parameters:
-
e
- Return value:
-
(0 and higher == OK, otherwise error)
Writes fstab to the disk
Detects a filesystem on a device
- Parameters:
-
device name
- Return value:
-
filesystem