Change transfer mp if installing to usb-hdd. Fix grub install.

master3.3
Mike Hiretsky 13 years ago
parent 655ad491b0
commit b7f2e00e96

@ -17,5 +17,10 @@ start() {
}
stop() {
rc-update del calculate boot
local roottype=$(cl-install -v --filter os_root_type |
awk '{ if ($1 == "os_root_type") print $3 }')
if [[ $roottype == "hdd" ]]
then
rc-update del calculate boot
fi
}

@ -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'))

@ -1111,7 +1111,19 @@ class cl_install(color_print, SignalInterrupt):
self.printERROR(_("Mount point '%s' is used twice")%dupMP[0])
return False
rootdevs = map(lambda x:x['dev'],
filter(lambda x:"mountPoint" in x and \
"dev" in x and \
x['mountPoint']=='/',
listDisks))
if rootdevs:
self.clVars.Set('os_install_root_dev',rootdevs[0],True)
rootType = self.clVars.Get('os_install_root_type')
curRootType = self.clVars.Get('os_root_type')
def clearParam(data,isswap):
if rootType == 'usb-hdd' and curRootType != "usb-hdd":
return ""
if builderMode:
if len(listSwaps) == 0 and isswap == "swap":
return data
@ -1806,8 +1818,9 @@ class cl_install(color_print, SignalInterrupt):
self.printByResult(True)
# optimize initrd
self.printMessageForTest(_("Creating new initrd file"))
self.printByResult(self.cleanInitrd())
if self.clVars.Get('os_install_root_type') != "usb-hdd":
self.printMessageForTest(_("Creating new initrd file"))
self.printByResult(self.cleanInitrd())
self.printMessageForTest(_("Post-install configuration"))
targetDistr.postinstallMountBind()

Loading…
Cancel
Save