|
|
|
@ -187,7 +187,7 @@ class fillVars(object, glob_attr):
|
|
|
|
|
|
|
|
|
|
def get_os_disk_hash(self):
|
|
|
|
|
reSdaPart = \
|
|
|
|
|
re.compile("^/dev/sd([a-z])(\d+)|/dev/cciss/c\dd(\d+)p(\d+)$")
|
|
|
|
|
re.compile("^/dev/(sd[a-z])(\d+)|/dev/(cciss/c\dd\d+)p(\d+)$")
|
|
|
|
|
devicesHash = self.Get('os_device_hash')
|
|
|
|
|
devices = devicesHash.keys()
|
|
|
|
|
disksDevs = reduce( lambda x,y: x +
|
|
|
|
@ -200,17 +200,17 @@ class fillVars(object, glob_attr):
|
|
|
|
|
disksDevs = dict(disksDevs)
|
|
|
|
|
disk_hash = {}
|
|
|
|
|
# fill grub info
|
|
|
|
|
for dev in disks:
|
|
|
|
|
for dev in sorted(disks):
|
|
|
|
|
disk_hash[dev] = {}
|
|
|
|
|
match = reSdaPart.match(dev)
|
|
|
|
|
if match:
|
|
|
|
|
if match.groups()[0]:
|
|
|
|
|
if match.groups()[0] and match.groups()[0] in devicesHash:
|
|
|
|
|
disk_hash[dev]['grub'] = "%d,%d" % \
|
|
|
|
|
(ord(match.groups()[0])-ord('a'),
|
|
|
|
|
(int(devicesHash[match.groups()[0]]['map']),
|
|
|
|
|
int(match.groups()[1])-1)
|
|
|
|
|
else:
|
|
|
|
|
elif metch.groups()[2] in devicesHash:
|
|
|
|
|
disk_hash[dev]['grub'] = "%d,%d" % \
|
|
|
|
|
(int(match.groups()[2]),
|
|
|
|
|
(int(devicesHash[match.groups()[2]]['map']),
|
|
|
|
|
int(match.groups()[3])-1)
|
|
|
|
|
curDevice = None
|
|
|
|
|
|
|
|
|
@ -531,8 +531,9 @@ class fillVars(object, glob_attr):
|
|
|
|
|
|
|
|
|
|
def get_os_install_grub_devicemap_conf(self):
|
|
|
|
|
"""Content of device.map file for grub"""
|
|
|
|
|
rootType = self.Get('os_install_root_type')
|
|
|
|
|
return "\n".join(map(lambda x: "(hd%s) /dev/%s" % (x[0],x[1]),
|
|
|
|
|
filter(lambda x:x[2] != "flash",
|
|
|
|
|
filter(lambda x:x[2] == rootType,
|
|
|
|
|
zip(self.Get('os_device_map'),
|
|
|
|
|
self.Get('os_device_dev'),
|
|
|
|
|
self.Get('os_device_type')))))
|
|
|
|
@ -1196,7 +1197,7 @@ class fillVars(object, glob_attr):
|
|
|
|
|
return res[0][0]
|
|
|
|
|
|
|
|
|
|
def get_os_install_mbr(self):
|
|
|
|
|
if self.Get('os_install_root_type') == "flash":
|
|
|
|
|
if self.Get('os_install_root_type') in ("flash","usb-hdd"):
|
|
|
|
|
rootdev = self.Get('os_install_root_dev')
|
|
|
|
|
device = filter(lambda x:x in rootdev,
|
|
|
|
|
self.Get('os_device_dev'))
|
|
|
|
|