Fix mbr method.

netsetup
Mike Hiretsky 14 years ago
parent 6119eb9f00
commit ec659cb596

Binary file not shown.

@ -1112,8 +1112,7 @@ class fillVars(object, glob_attr):
return res[0][0]
def get_os_install_mbr(self):
if self.Get('os_install_root_type') == "flash" or \
self.Get('os_root_type') == "livecd":
if self.Get('os_install_root_type') == "flash":
rootdev = self.Get('os_install_root_dev')
device = filter(lambda x:x in rootdev,
self.Get('os_device_dev'))
@ -1121,10 +1120,25 @@ class fillVars(object, glob_attr):
return device[0]
else:
return ""
elif self.Get('os_device_dev'):
# if loaded system livecd
if self.Get('os_root_type') == "livecd":
# search /boot device or / device, by priority /boot,/
bootDev=sorted(
filter(lambda x:x[0] in ('/','/boot'),
zip(self.Get('os_install_disk_mount'),
self.Get('os_disk_dev'))),
key=lambda x:x[0],reverse=True)
if bootDev:
bootdev = bootDev[0][1]
# search device for partition
device = filter(lambda x:x in rootdev,
self.Get('os_device_dev'))
# set it by default
if device:
return device[0]
if self.Get('os_device_dev'):
return self.Get('os_device_dev')[0]
else:
return ""
return ""
def get_cl_install_autoupdate_set(self):
if self.Get('cl_install_system_action') == "up":

@ -828,10 +828,25 @@ class cl_install(color_print, SignalInterrupt):
self.clVars.Get('os_install_locale_xkbname'))
self.printSUCCESS(_("Timezone")+": %s"%
self.clVars.Get('os_install_clock_timezone'))
#self.defaultPrint("%s\n"%_("Location"))
self.defaultPrint("%s\n"%_("Location"))
mbrDevice = self.clVars.Get('os_install_mbr')
addonMbrInfo = ""
if not mbrDevice in ("","off"):
pathVendor = "/sys/block/%s/device/vendor"%mbrDevice
pathModel = "/sys/block/%s/device/model"%mbrDevice
if path.exists(pathVendor) and path.exists(pathModel):
addonMbrInfo = " (%s %s)"% \
(open(pathVendor,'r').read().strip(),
open(pathModel,'r').read().strip())
self.printSUCCESS(_("Master boot record")+" (MBR): /dev/%s%s"%
(self.clVars.Get('os_install_mbr'),addonMbrInfo))
else:
self.printSUCCESS(_("Master boot record")+
" (MBR): %s"%_("not changed"))
title, headerList, dataList = self.generateTableData()
tableObj = tableReport(title, headerList, dataList)
tableObj = tableReport("", headerList, dataList)
tableObj.printReport(False)
title, headerList, dataList = self.generateTableBindData()
if dataList:

Loading…
Cancel
Save