summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-06-09 01:27:29 +0000
committerJeremy Katz <katzj@redhat.com>2002-06-09 01:27:29 +0000
commit30b06571c537b320ce8efcf3f127869341d22893 (patch)
treec678476d7320a358022faf61077e2b8c0521a4bc
parent6e98490008acd04f8cb2179ba89c4e498fce1c41 (diff)
downloadanaconda-30b06571c537b320ce8efcf3f127869341d22893.tar.gz
anaconda-30b06571c537b320ce8efcf3f127869341d22893.tar.xz
anaconda-30b06571c537b320ce8efcf3f127869341d22893.zip
rescue mode/upgrades don't actually work with lvm, yet, but this is the start. fsset.py's readFstab() still needs work
-rw-r--r--partedUtils.py30
-rw-r--r--upgrade.py7
2 files changed, 35 insertions, 2 deletions
diff --git a/partedUtils.py b/partedUtils.py
index 008a4fc5b..cfb060395 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -24,6 +24,7 @@ from product import *
import fsset
import iutil, isys
import raid
+import lvm
from flags import flags
from partErrors import *
@@ -380,11 +381,9 @@ class DiskSet:
for dev, devices, level, numActive in self.mdList:
(errno, msg) = (None, None)
- found = 0
for fs in fsset.getFStoTry(dev):
try:
isys.mount(dev, mountpoint, fs, readOnly = 1)
- found = 1
break
except SystemError, (errno, msg):
pass
@@ -395,6 +394,33 @@ class DiskSet:
self.stopAllRaid()
+ # now, look for candidate lvm roots
+ lvm.vgscan()
+ lvm.vgactivate()
+
+ vgs = []
+ if os.path.isdir("/proc/lvm/VGs"):
+ vgs = os.listdir("/proc/lvm/VGs")
+ for vg in vgs:
+ if not os.path.isdir("/proc/lvm/VGs/%s/LVs" %(vg,)):
+ log("Unable to find LVs for %s" % (lv,))
+ continue
+ lvs = os.listdir("/proc/lvm/VGs/%s/LVs" % (vg,))
+ for lv in lvs:
+ dev = "/dev/%s/%s" %(vg, lv)
+ for fs in fsset.getFStoTry(dev):
+ try:
+ isys.mount(dev, mountpoint, fs, readOnly = 1)
+ break
+ except SystemError:
+ pass
+
+ if os.access (mountpoint + '/etc/fstab', os.R_OK):
+ rootparts.append ((dev, fs))
+ isys.umount(mountpoint)
+
+ lvm.vgdeactivate()
+
drives = self.disks.keys()
drives.sort()
diff --git a/upgrade.py b/upgrade.py
index 04fee81dd..698f0862d 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -22,6 +22,7 @@ import sys
import os.path
import partedUtils
import string
+import lvm
from flags import flags
from fsset import *
from partitioning import *
@@ -66,7 +67,10 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0,
diskset = partedUtils.DiskSet()
diskset.openDevices()
diskset.startAllRaid()
+ lvm.vgscan()
+ lvm.vgactivate()
+ log("going to mount %s on %s as %s" %(root, instPath, rootFs))
isys.mount(root, instPath, rootFs)
oldfsset.reset()
@@ -74,12 +78,14 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0,
for entry in newfsset.entries:
oldfsset.add(entry)
+ log("now unmounting")
isys.umount(instPath)
dirtyDevs = oldfsset.hasDirtyFilesystems(instPath)
if not allowDirty and dirtyDevs != []:
import sys
diskset.stopAllRaid()
+ lvm.vgdeactivate()
intf.messageWindow(_("Dirty Filesystems"),
_("The following filesystems for your Linux system "
"were not unmounted cleanly. Please boot your "
@@ -98,6 +104,7 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0,
return -1
if flags.setupFilesystems:
+ lvm.vgscan()
oldfsset.mountFilesystems(instPath, readOnly = readOnly)
# XXX we should properly support 'auto' at some point