|
|
@ -298,8 +298,6 @@ class fillVars(object, glob_attr):
|
|
|
|
disk_hash = {}
|
|
|
|
disk_hash = {}
|
|
|
|
|
|
|
|
|
|
|
|
fstab = FStab('/etc/fstab')
|
|
|
|
fstab = FStab('/etc/fstab')
|
|
|
|
distrRep = DistributiveRepository()
|
|
|
|
|
|
|
|
osProberHash = getOsProberHash(getContentFunc=distrRep._getfromcontent)
|
|
|
|
|
|
|
|
raidUsedDisks = []
|
|
|
|
raidUsedDisks = []
|
|
|
|
lvmUsedDisks = []
|
|
|
|
lvmUsedDisks = []
|
|
|
|
for disk in new_disks:
|
|
|
|
for disk in new_disks:
|
|
|
@ -321,19 +319,6 @@ class fillVars(object, glob_attr):
|
|
|
|
dev_hash['part'] = getPartitionType(props)
|
|
|
|
dev_hash['part'] = getPartitionType(props)
|
|
|
|
dev_hash['options'] = fstab.getBy(what=fstab.OPTS,eq=devName) or ""
|
|
|
|
dev_hash['options'] = fstab.getBy(what=fstab.OPTS,eq=devName) or ""
|
|
|
|
dev_hash['size'] = getPartitionSize(disk)
|
|
|
|
dev_hash['size'] = getPartitionSize(disk)
|
|
|
|
dev_hash['content'] = osProberHash.get(devName,'')
|
|
|
|
|
|
|
|
if not dev_hash['content'] and ((devParent in devicesHash and \
|
|
|
|
|
|
|
|
devicesHash[devParent]['type'] == "flash") or
|
|
|
|
|
|
|
|
"cdrom" in dev_hash['type']):
|
|
|
|
|
|
|
|
dataInfo = distrRep._getfromcontent(devName)
|
|
|
|
|
|
|
|
if "build" in dataInfo and dataInfo['build']:
|
|
|
|
|
|
|
|
if "cdrom" in dev_hash['type']:
|
|
|
|
|
|
|
|
dataInfo['livetype'] = "cd"
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
dataInfo['livetype'] = "usb"
|
|
|
|
|
|
|
|
dev_hash['content'] = \
|
|
|
|
|
|
|
|
"{name}-{march}-{build} live{livetype}".format(
|
|
|
|
|
|
|
|
**dataInfo)
|
|
|
|
|
|
|
|
if devParent in devicesHash and 'ID_PART_ENTRY_NUMBER' in props:
|
|
|
|
if devParent in devicesHash and 'ID_PART_ENTRY_NUMBER' in props:
|
|
|
|
dev_hash['grub'] = "%s,%d"%(devicesHash[devParent]['map'],
|
|
|
|
dev_hash['grub'] = "%s,%d"%(devicesHash[devParent]['map'],
|
|
|
|
int(props['ID_PART_ENTRY_NUMBER'])-1)
|
|
|
|
int(props['ID_PART_ENTRY_NUMBER'])-1)
|
|
|
@ -511,15 +496,36 @@ class fillVars(object, glob_attr):
|
|
|
|
|
|
|
|
|
|
|
|
def get_os_disk_content(self):
|
|
|
|
def get_os_disk_content(self):
|
|
|
|
"""Partition content"""
|
|
|
|
"""Partition content"""
|
|
|
|
return map(lambda x: x[1] if x[0] != '/' else
|
|
|
|
distrRep = DistributiveRepository()
|
|
|
|
"{short}-{march}{build}".format(
|
|
|
|
osProberHash = getOsProberHash(getContentFunc=distrRep._getfromcontent)
|
|
|
|
|
|
|
|
devicesHash = self.Get('os_device_hash')
|
|
|
|
|
|
|
|
def detectContent(devName,devType,devParent,mountPoint):
|
|
|
|
|
|
|
|
if mountPoint == '/':
|
|
|
|
|
|
|
|
return "{short}-{march}{build}".format(
|
|
|
|
short=self.Get('os_linux_shortname'),
|
|
|
|
short=self.Get('os_linux_shortname'),
|
|
|
|
march=self.Get('os_arch_machine'),
|
|
|
|
march=self.Get('os_arch_machine'),
|
|
|
|
build="-%s"%(self.Get('os_linux_build') if
|
|
|
|
build="-%s"%(self.Get('os_linux_build') if
|
|
|
|
self.Get('os_linux_build') else
|
|
|
|
self.Get('os_linux_build') else
|
|
|
|
self.Get('os_linux_ver'))),
|
|
|
|
self.Get('os_linux_ver')))
|
|
|
|
zip(self.Get('os_disk_mount'),
|
|
|
|
content = osProberHash.get(devName,'')
|
|
|
|
self.getAttributeFromHash('os_disk_hash','content')))
|
|
|
|
if not content and ((devParent in devicesHash and \
|
|
|
|
|
|
|
|
devicesHash[devParent]['type'] == "flash") or
|
|
|
|
|
|
|
|
"cdrom" in devType):
|
|
|
|
|
|
|
|
dataInfo = distrRep._getfromcontent(devName)
|
|
|
|
|
|
|
|
if "build" in dataInfo and dataInfo['build']:
|
|
|
|
|
|
|
|
if "cdrom" in devType:
|
|
|
|
|
|
|
|
dataInfo['livetype'] = "cd"
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
dataInfo['livetype'] = "usb"
|
|
|
|
|
|
|
|
content = \
|
|
|
|
|
|
|
|
"{name}-{march}-{build} live{livetype}".format(
|
|
|
|
|
|
|
|
**dataInfo)
|
|
|
|
|
|
|
|
return content
|
|
|
|
|
|
|
|
return map(lambda x:detectContent(x[0],x[1],x[2],x[3]),
|
|
|
|
|
|
|
|
zip(self.Get('os_disk_dev'),
|
|
|
|
|
|
|
|
self.Get('os_disk_type'),
|
|
|
|
|
|
|
|
self.getAttributeFromHash('os_disk_hash','parent'),
|
|
|
|
|
|
|
|
self.Get('os_disk_mount')))
|
|
|
|
|
|
|
|
|
|
|
|
def get_os_disk_name(self):
|
|
|
|
def get_os_disk_name(self):
|
|
|
|
"""Label of partitions"""
|
|
|
|
"""Label of partitions"""
|
|
|
|