summaryrefslogtreecommitdiffstats
path: root/fstab.py
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2000-07-25 22:14:08 +0000
committerErik Troan <ewt@redhat.com>2000-07-25 22:14:08 +0000
commitc470c5479231f8f4c9df40cc8a27467e8e68c07e (patch)
tree637dd87754ae1d026e0af6f6446f5c08a977d9b1 /fstab.py
parent98c51262125140ffeca26faaa012c46018421570 (diff)
downloadanaconda-c470c5479231f8f4c9df40cc8a27467e8e68c07e.tar.gz
anaconda-c470c5479231f8f4c9df40cc8a27467e8e68c07e.tar.xz
anaconda-c470c5479231f8f4c9df40cc8a27467e8e68c07e.zip
parse label's out of fstab'sanaconda-6-9-4-tag
Diffstat (limited to 'fstab.py')
-rw-r--r--fstab.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/fstab.py b/fstab.py
index cf5a60072..27eaccf81 100644
--- a/fstab.py
+++ b/fstab.py
@@ -973,7 +973,7 @@ def readFstab (path, fstab):
fstab.clearExistingRaid()
fstab.clearMounts()
- labelByMount = {}
+ labelsByMount = {}
labels = fstab.readLabels()
for device in labels.keys():
labelsByMount[labels[device]] = device
@@ -1009,32 +1009,32 @@ def readFstab (path, fstab):
continue
if string.find(fields[3], "noauto") != -1: continue
- # this skips swap files! todo has to put them back for upgrades
- if (fields[0][0:7] != "/dev/hd" and
- fields[0][0:7] != "/dev/sd" and
- fields[0][0:7] != "/dev/md" and
- fields[0][0:9] != "/dev/loop" and
- fields[0][0:8] != "/dev/rd/" and
- fields[0][0:9] != "/dev/ida/"): continue
+ if len(fields) >= 6 and fields[0][0:6] == "LABEL=":
+ label = fields[0][6:]
+ device = labelsByMount[label]
- if fields[0][0:7] == "/dev/md":
+ fsystem = fields[2]
+
+ fstab.addMount(device, fields[1], fsystem)
+ elif fields[0][0:7] == "/dev/md":
fstab.addExistingRaidDevice(fields[0][5:], fields[1],
fields[2], raidByDev[int(fields[0][7:])])
- else:
- if fields[0][0:6] == "LABEL=":
- label = fields[0][6:]
- device = labelsByDev[label]
- else:
- device = fields[0][5:]
- if loopIndex.has_key(device):
- (device, fsystem) = loopIndex[device]
+ elif (fields[0][0:7] == "/dev/hd" or
+ fields[0][0:7] == "/dev/sd" or
+ fields[0][0:9] == "/dev/loop" or
+ fields[0][0:8] == "/dev/rd/" or
+ fields[0][0:9] == "/dev/ida/"):
+
+ # this skips swap files! todo has to put them back for upgrades
+
+ device = fields[0][5:]
+ if loopIndex.has_key(device):
+ (device, fsystem) = loopIndex[device]
fsystem = fields[2]
fstab.addMount(device, fields[1], fsystem)
-# log("got mount list %s", fstab.mountList())
-
def createLabel(labels, newLabel):
if len(newLabel) > 16:
newLabel = newLabel[0:16]