Add detect active lvm and raid members.

lvmraid
Mike Hiretsky 13 years ago
parent 73647850d1
commit 83b3b17167

@ -27,7 +27,8 @@ from cl_utils import isMount,typeFile,getTupleVersion,pathJoin,isFstabMount,\
getUdevDeviceInfo, getPartitionDevice, getPartitionSize, \
isPkgInstalled, process, checkUtils, readLinesFile, \
FStab, lspci, getInstalledVideo,getDeviceType, \
getPartitionType, getOsProberHash, getProgPath
getPartitionType, getOsProberHash, getProgPath, \
getRaidPartitions, getLvmPartitions
from cl_distr import DistributiveRepository,PartitionDistributive
from cl_fill import clLocale
from operator import itemgetter
@ -299,6 +300,8 @@ class fillVars(object, glob_attr):
fstab = FStab('/etc/fstab')
distrRep = DistributiveRepository()
osProberHash = getOsProberHash(getContentFunc=distrRep._getfromcontent)
raidUsedDisks = []
lvmUsedDisks = []
for disk in new_disks:
props = getUdevDeviceInfo(disk)
if not "DEVNAME" in props:
@ -337,6 +340,18 @@ class fillVars(object, glob_attr):
else:
dev_hash['grub'] = ""
disk_hash[devName] = dev_hash
if "raid" in dev_hash['type']:
raidUsedDisks.extend(getRaidPartitions(disk))
if dev_hash['type'].endswith("lvm"):
prop = getUdevDeviceInfo(path=disk)
lvmUsedDisks.extend(getLvmPartitions(prop.get('DM_VG_NAME',''),
prop.get('DM_LV_NAME','')))
for part in raidUsedDisks:
if part in disk_hash:
disk_hash[part]['type'] = "%s-raidmember"%disk_hash[part]['type']
for part in lvmUsedDisks:
if part in disk_hash:
disk_hash[part]['type'] = "%s-lvmmember"%disk_hash[part]['type']
return disk_hash
def separateDevice(self,device):

@ -1805,6 +1805,10 @@ class cl_install(color_print, SignalInterrupt):
return _("Partition on disk")
elif "raid-partition" == diskScheme:
return _("Partition on RAID")
elif "raidmember" in diskScheme:
return _("RAID member")
elif "lvmmember" in diskScheme:
return _("LVM member")
elif "disk" == diskScheme:
return _("Disk without partitions")
elif "lvm" in diskScheme:

Loading…
Cancel
Save