
functions
files
intro
|
|
YaST OS Repair. Automatic error detection & repair tool for Linux.
|
OSRFstab.ycp
|
YaST OS Repair. Automatic error detection & repair tool for Linux.
|
|
|
Imports
- AsciiFile
- FileSystems
- Hotplug
- Initrd
- Installation
- Label
- Mode
- OSRExecute
- OSRFsck
- OSRLogFile
- OSRPopup
- OSRSystem
- Partitions
- Popup
- Report
- Storage
- StorageDevices
Includes
- partitioning/write_fstab.ycp
Global Variables
Global Functions
Local Variables
Local Functions
|
|
|
global fstabpath -> string
|
|
The path
local fstab_defaults -> map <string,map>
|
|
The default fstab entries (as maps) -> set in constructor
All digits
Line position to sense
local swapable_partition_list -> list<string>
|
|
Partitions which are swapable
local checked_partitions -> list<string>
|
|
All checked partitions (OSRFsck)
- 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]
] |
local root_mountpoint -> string
|
|
The root mount points e.g.: "/", "/mnt"
local valid_lines -> list<integer>
|
|
All checked valid lines
e.g.: [1,2,3];
local not_valid_lines -> map
|
|
Not valid lines, e.g.:
$[4: ["dev", false, true, true ,true ,true ,true ]],//spec error in line 4
local missing_devs -> list<string>
|
|
Devices without fstab entry
e.g.: ["/dev/hdb7"]
global OSRFstab () -> void
|
|
Constructor: initialize data structures with default values
local fstab_default_exist (string exists, string key) -> list<string>
|
|
- Parameters:
exists |
restrict the returned set only to the types with
nonempty values of key 'exists' |
key |
values of which key should be returned |
local fstabline2map (list<string> line) -> map
|
|
e.g.: transform a fstab list to a fstab map.
list: ["/dev/hda6", "/", "reiserfs", "defaults", "1", "1"]
map : $[ "spec":"/dev/hda6", "file":"/" ... ]
- Parameters:
global LinuxPartitions (list checked_partitions) -> list<string>
|
|
Find the list of all valid linux-partitions in the target-map.
- Parameters:
- Return value:
|
The list of names of valid linux-partitions. |
global MountablePartitions (list<string> linux_partition_list, string m_point) -> list<string>
|
|
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. |
global ValidRootPartitions (list<string> mount_possible_list, string mount_p) -> list<string>
|
|
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. |
global ReadFstab (string mount_p, boolean strict) -> boolean
|
|
Read the fstab file.
- Parameters:
local remove_blanks (string c) -> string
|
|
Removes blanks from a string.
- Parameters:
local uuid_string (list<string> line) -> string
|
|
Cat the uuid from a string.
- Parameters:
local label_string (list<string> line) -> string
|
|
Cat the label from a string.
- Parameters:
local check_fs_spec (list<string> line, map part) -> boolean
|
|
Check the spec (first) entry in a fstab line.
- Parameters:
local check_fs_file (list<string> line) -> boolean
|
|
Check the file (second) entry in a fstab line.
- Parameters:
local check_fs_vfstype (list<string> line, map part) -> boolean
|
|
Check the filesystem type (third) entry in a fstab line.
- Parameters:
local check_fs_mntops (list<string> line) -> boolean
|
|
Check the mount options (fourth) entry in a fstab line.
- Parameters:
local check_fs_freq (list<string> line, list<string> defaults) -> boolean
|
|
Check the freq (fifth) entry in a fstab line.
- Parameters:
local check_fs_passno (list<string> line, list<string> defaults) -> boolean
|
|
Check the passno (sixth) entry in a fstab line.
- Parameters:
local devname2part (string dev_name) -> map
|
|
Returns the partition map for a device.
cdrom, floppy and zip devices are support too.
- Parameters:
local check_dev_entry (string p) -> boolean
|
|
Check if an entry for a device exist in the fstab.
- Parameters:
local uuid2part (string uuidstring) -> map
|
|
Return the partition map for a special uuid.
- Parameters:
local label2part (string labelstring) -> map
|
|
Return the partition map for a special label.
- Parameters:
local line2part (list<string> line) -> map
|
|
Return the partition map for a fstab line.
- Parameters:
local check_fstab_line (integer lnr) -> boolean
|
|
Check one fstab line and return false if
the line contains errors.
- Parameters:
local devices2check () -> list<string>
|
|
All device that should be checked.
global Check (list<string> tswapable_partition_list, list<string> tchecked_partitions) -> boolean
|
|
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 |
|
local missing_devs_items (map new_entries) -> list<term>
|
|
Build items for table in missing devices dialog.
- Parameters:
local suggest_missing_entries () -> map
|
|
Build fstab entries for all existing devices that are not listed
in the fstab.
global check_and_create_mount_points (map cmp) -> map
|
|
@param cmp:
fstab line nr : mount point
cmp : $[ 1 : "/hhh",
2 : "/mnt/uuu" ];
- Parameters:
- Return value:
|
create failed for mount points $[ 1 : "/hhh" ]; |
local SuggestMissingEntriesDialog () -> symbol
|
|
Dialog for existing devices that are not listed in the fstab.
local suggest_create_mp () -> map
|
|
local create_mp_items (map cmp) -> list<term>
|
|
- Parameters:
local SuggestCreateMp () -> symbol
|
|
local suggest_remove_spec () -> list<integer>
|
|
Find all fstab entries (line nr) with not existing devices.
local remove_spec_items (list<integer> rm_entries, string ignore_label) -> list<term>
|
|
Build a item list for all fstab entries with not existing devices.
- Parameters:
local SuggestRemoveSpecDialog () -> symbol
|
|
Dialog for all fstab entries with not existing devices.
local suggest_modify () -> map
|
|
Find all fstab lines with at least one invalid position
local modify_items (map nlines, string ignore_label, boolean existing) -> list<term>
|
|
Build a item list.
- Parameters:
nlines |
|
ignore_label |
|
existing |
|
local SuggestModifyDialog () -> symbol
|
|
Dialog for all fstab entries that have at least one invalid entry.
global Repair () -> symbol
|
|
Repair the fstab. Call sub dialogs.
global CheckRootEntry (string dev_name, list<string> tswapable_partition_list, list<string> tchecked_partitions) -> boolean
|
|
- Parameters:
dev_name |
|
tswapable_partition_list |
|
tchecked_partitions |
|
global BootDev () -> string
|
|
global SelectRoot (list<string> valid_root_partition_list) -> string
|
|
- Parameters:
valid_root_partition_list |
|
global ReadedSuccessfully () -> boolean
|
|
global UmountAll (list<map> umount_list) -> list<map>
|
|
- Parameters:
global UmountAllFrom (string root) -> list<map>
|
|
- Parameters:
global RootDev (string root) -> list<map>
|
|
- Parameters:
global MountAll (string root) -> list<map>
|
|
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:
|