YaST OS Repair. Automatic error detection & repair tool for Linux. |
OSRFstab.ycp |
| YaST OS Repair. Automatic error detection & repair tool for Linux. | |
|
|
|
This module has an unstable interface. |
The path
The default fstab entries (as maps) -> set in constructor
All digits
Line position to sense
Partitions which are swapable
All checked partitions (OSRFsck)
Encrypted partitions (actually not checked)
- Example
-
of map describing /etc/fstab: $[ "comment" : "^[ \t]*#.*", "delim" : " \t", "l" : $[ 1 : $[ "fields" : ["/dev/hda2", "/", "reiserfs", "defaults", "1", "1"], "line" :"/dev/hda2\t/\treiserfs\tdefaults 1 1" ], 2 : $[ "fields" : [ "/dev/hda3", "/local", "reiserfs", "defaults", "1", "2"], "line" : "/dev/hda3\t/local\treiserfs\tdefaults 1 2" ], 3 : $[ "fields" : [ "/dev/hda1", "swap", "swap", "pri=42", "0", "0"], "line" : "/dev/hda1\tswap\tswap\tpri=42 0 0" ], 4 : $[ "fields" : [ "devpts", "/dev/pts", "devpts", "mode=0620,gid=5","0", "0"], "line" : "devpts\t/dev/pts\tdevpts\tmode=0620,gid=5 0 0" ], ... 14 : $[ "fields" : [ "nfs.suse.cz:/home", "/home", "nfs", "defaults", "0", "0"], "line" : "nfs.suse.cz:/home\t/home\tnfs\tdefaults 0 0" ], 15 : $[ "comment":true, "line":"#blah" ] ], "widths" : [20, 20, 10, 21, 1, 1] ]
The root mount points e.g.: "/", "/mnt"
All checked valid lines e.g.: [1,2,3];
Not valid lines, e.g.: $[4: ["dev", false, true, true ,true ,true ,true ]],//spec error in line 4
Devices without fstab entry e.g.: ["/dev/hdb7"]
Constructor: initialize data structures with default values
- Parameters:
-
exists restrict the returned set only to the types with nonempty values of key 'exists' key values of which key should be returned
Check if given partition is already mounted workaround; this should be done via Storage API (bnc#372238)
- Parameters:
-
part mp
e.g.: transform a fstab list to a fstab map. list: ["/dev/hda6", "/", "reiserfs", "defaults", "1", "1"] map : $[ "spec":"/dev/hda6", "file":"/" ... ]
- Parameters:
-
line
Find the list of all valid linux-partitions in the target-map.
- Parameters:
-
checked_partitions
- Return value:
-
The list of names of valid linux-partitions.
Returns a list of names of all mountable partitions out of the specified list.
- Parameters:
-
linux_partition_list m_point the test mountpoint
- Return value:
-
List of partition names successfully mounted to m_point.
Returns a list of names of all mountable partitions that contain a file /etc/fstab out of the specified list.
- Parameters:
-
mount_possible_list mount_p
- Return value:
-
The list of partition-names that were successfully mounted to /mnt and contain a filesystem table.
Read the fstab file.
- Parameters:
-
mount_p strict
Removes blanks from a string.
- Parameters:
-
c
Cat the uuid from a string.
- Parameters:
-
line
Cat the label from a string.
- Parameters:
-
line
Check the spec (first) entry in a fstab line.
- Parameters:
-
line part
Check the file (second) entry in a fstab line.
- Parameters:
-
line
Check the filesystem type (third) entry in a fstab line.
- Parameters:
-
line part
Check the mount options (fourth) entry in a fstab line.
- Parameters:
-
line
Check the freq (fifth) entry in a fstab line.
- Parameters:
-
line defaults
Check the passno (sixth) entry in a fstab line.
- Parameters:
-
line defaults
Returns the partition map for a device. cdrom, floppy and zip devices are support too.
- Parameters:
-
dev_name
Check if an entry for a device exist in the fstab.
- Parameters:
-
p
Return the partition map for a special uuid.
- Parameters:
-
uuidstring
Return the partition map for a special label.
- Parameters:
-
labelstring
Return the partition map for a fstab line.
- Parameters:
-
line
Check one fstab line and return false if the line contains errors.
- Parameters:
-
lnr
All device that should be checked.
Check if all entries in the fstab are valid and if all found devices have an entry in the fstab.
- Parameters:
-
tswapable_partition_list tchecked_partitions tencrypted_partitions
Build items for table in missing devices dialog.
- Parameters:
-
new_entries
Build fstab entries for all existing devices that are not listed in the fstab.
- Parameters:
-
cmp : fstab line nr : mount point cmp : $[ 1 : "/hhh", 2 : "/mnt/uuu" ];
- Return value:
-
create failed for mount points $[ 1 : "/hhh" ];
Dialog for existing devices that are not listed in the fstab.
- Parameters:
-
cmp
Find all fstab entries (line nr) with not existing devices.
Build a item list for all fstab entries with not existing devices.
- Parameters:
-
rm_entries ignore_label
Dialog for all fstab entries with not existing devices.
Find all fstab lines with at least one invalid position
Build a item list.
- Parameters:
-
nlines ignore_label existing
Dialog for all fstab entries that have at least one invalid entry.
Repair the fstab. Call sub dialogs.
- Parameters:
-
dev_name tswapable_partition_list tchecked_partitions
ask user to select the root partition
- Parameters:
-
valid_root_partition_list
/etc/fstab was read
- Parameters:
-
umount_list
- Parameters:
-
root
- Parameters:
-
root
Mount all partitions specified in the fstab. If no fstab was readed try to find root partition and read fstab. Afterwards mount all partitions.
- Parameters:
-
root