|
|
@ -1492,6 +1492,24 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
('os_install_disk_options',new_options),
|
|
|
|
('os_install_disk_options',new_options),
|
|
|
|
('os_install_bind_path',new_bind_src),
|
|
|
|
('os_install_bind_path',new_bind_src),
|
|
|
|
('os_install_bind_mountpoint',new_bind_dest)))
|
|
|
|
('os_install_bind_mountpoint',new_bind_dest)))
|
|
|
|
|
|
|
|
if not self.clVars.Get('os_grub2_path'):
|
|
|
|
|
|
|
|
if not self.checkForLegacyGrub():
|
|
|
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def checkForLegacyGrub(self):
|
|
|
|
|
|
|
|
"""Check current disk configuration for installation for install
|
|
|
|
|
|
|
|
legacy grub"""
|
|
|
|
|
|
|
|
bootDiskType = varSelect("os_disk_type",where="os_install_disk_mount",
|
|
|
|
|
|
|
|
eq="/boot")
|
|
|
|
|
|
|
|
rootDiskType = varSelect("os_disk_type",where="os_install_disk_mount",
|
|
|
|
|
|
|
|
eq="/")
|
|
|
|
|
|
|
|
bootDiskType = bootDiskType or rootDiskType
|
|
|
|
|
|
|
|
if "lvm" in bootDiskType or "raid" in bootDiskType:
|
|
|
|
|
|
|
|
self.printERROR(
|
|
|
|
|
|
|
|
_("Legacy grub not support boot from raid or lvm without"
|
|
|
|
|
|
|
|
" separate /boot partition"))
|
|
|
|
|
|
|
|
return False
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
def setUsers(self,listUsers):
|
|
|
|
def setUsers(self,listUsers):
|
|
|
@ -1503,11 +1521,12 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
self.clVars.Set('cl_migrate_user', migrateUsers, force=True)
|
|
|
|
self.clVars.Set('cl_migrate_user', migrateUsers, force=True)
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
def setMBR(self, mbrDisk):
|
|
|
|
def setBR(self, mbrDisk):
|
|
|
|
"""Set mbr by param or get from variables"""
|
|
|
|
"""Set boot record on disk by param or get from variables"""
|
|
|
|
bootDiskGrub = ""
|
|
|
|
bootDiskGrub = ""
|
|
|
|
if mbrDisk == "off":
|
|
|
|
if mbrDisk == "off":
|
|
|
|
self.clVars.Set('os_install_mbr',"",force=True)
|
|
|
|
self.clVars.Set('os_install_mbr',"",force=True)
|
|
|
|
|
|
|
|
return True
|
|
|
|
elif mbrDisk:
|
|
|
|
elif mbrDisk:
|
|
|
|
if filter(lambda x: x == mbrDisk,
|
|
|
|
if filter(lambda x: x == mbrDisk,
|
|
|
|
self.clVars.Get('os_device_dev')):
|
|
|
|
self.clVars.Get('os_device_dev')):
|
|
|
@ -1515,6 +1534,13 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self.printERROR(_("Cann't found disk '%s'")%mbrDisk)
|
|
|
|
self.printERROR(_("Cann't found disk '%s'")%mbrDisk)
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
|
|
|
|
mbr = self.clVars.Get('os_install_mbr')
|
|
|
|
|
|
|
|
tableOnBootDisk = self.varSelect('os_device_table',
|
|
|
|
|
|
|
|
where="os_device_dev",eq='mbr')
|
|
|
|
|
|
|
|
if not tableOnBootDisk:
|
|
|
|
|
|
|
|
self.printERROR(_("Disk '%s' without partition table cann't "
|
|
|
|
|
|
|
|
"contains boot record")%mbr)
|
|
|
|
|
|
|
|
return False
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
def createListOptions(self):
|
|
|
|
def createListOptions(self):
|
|
|
@ -1561,12 +1587,12 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
def setInstallOptions(self, listDisks, listBinds, listSwaps, listUsers,
|
|
|
|
def setInstallOptions(self, listDisks, listBinds, listSwaps, listUsers,
|
|
|
|
mbrDisk):
|
|
|
|
brDisk):
|
|
|
|
"""Set install options (set users, disks and mbr"""
|
|
|
|
"""Set install options (set users, disks and boot record"""
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
if self.setUsers(listUsers) and \
|
|
|
|
if self.setUsers(listUsers) and \
|
|
|
|
self.setDisks(listDisks,listBinds,listSwaps) and \
|
|
|
|
self.setDisks(listDisks,listBinds,listSwaps) and \
|
|
|
|
self.setMBR(mbrDisk):
|
|
|
|
self.setBR(brDisk):
|
|
|
|
return self.createListOptions()
|
|
|
|
return self.createListOptions()
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|