|
|
|
@ -15,7 +15,7 @@
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
from calculate.core.server.func import Action
|
|
|
|
|
from calculate.core.server.func import Action,Tasks
|
|
|
|
|
from calculate.lib.cl_lang import setLocalTranslate,getLazyLocalTranslate
|
|
|
|
|
from calculate.lib.utils.files import FilesError
|
|
|
|
|
from calculate.install.install import (MigrationError, TemplatesError,
|
|
|
|
@ -61,30 +61,28 @@ class ClInstallAction(Action):
|
|
|
|
|
'condition':lambda dv:dv.Get('os_install_root_type') != 'flash' and \
|
|
|
|
|
dv.Get('os_install_pxe') == 'off'},
|
|
|
|
|
# копирование clt шаблонов
|
|
|
|
|
{'name':'copy_clt',
|
|
|
|
|
{'name':'hdd:copy_clt',
|
|
|
|
|
'message':__("Copying clt templates to the new system"),
|
|
|
|
|
'method':'Install.copyClt(cl_source,cl_target,cl_template_clt_path)',
|
|
|
|
|
'depend':(Action.has('hdd'),Action.success())},
|
|
|
|
|
'method':'Install.copyClt(cl_source,cl_target,cl_template_clt_path)'
|
|
|
|
|
},
|
|
|
|
|
# копирование прочих файлов
|
|
|
|
|
{'name':'copy_other',
|
|
|
|
|
{'name':'hdd:copy_other',
|
|
|
|
|
'message':__("Copying other settings to the new system"),
|
|
|
|
|
'method':'Install.copyOther(cl_source,cl_target)',
|
|
|
|
|
'condition':lambda dv:dv.Get('os_root_type') != "livecd",
|
|
|
|
|
'depend':(Action.has('hdd'),Action.success())},
|
|
|
|
|
},
|
|
|
|
|
# перемонтирование ntfs для определения windows
|
|
|
|
|
{'name':'remount_ntfs',
|
|
|
|
|
{'name':'hdd:remount_ntfs',
|
|
|
|
|
'method':'Install.remountNTFS()',
|
|
|
|
|
'essential':False,
|
|
|
|
|
'depend':(Action.has('hdd'),Action.success())
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
# наложение шаблонов при установке на жесткий диск
|
|
|
|
|
{'name':'apply_templates',
|
|
|
|
|
{'name':'hdd:apply_templates',
|
|
|
|
|
'message':__("Updating the configuration"),
|
|
|
|
|
# наложить шаблоны в установленный дистрибутив, включая clt шаблоны
|
|
|
|
|
# без использования фильтров по clt шаблонам
|
|
|
|
|
'method':'Install.applyTemplates(cl_target,True,False,None)',
|
|
|
|
|
'depend':(Action.has('hdd'),Action.success()),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
# наложение шаблонов при PXE установке
|
|
|
|
|
{'name':'apply_templates_pxe',
|
|
|
|
|
'message':__("Configuring PXE install"),
|
|
|
|
@ -102,17 +100,15 @@ class ClInstallAction(Action):
|
|
|
|
|
'condition':lambda dv:dv.Get('os_install_root_type') == "flash"
|
|
|
|
|
},
|
|
|
|
|
# подключить точки монтирования bind
|
|
|
|
|
{'name':'mount_bind',
|
|
|
|
|
{'name':'hdd:mount_bind',
|
|
|
|
|
'message':__("Post-install configuration"),
|
|
|
|
|
'method':"Install.mountBind(cl_target)",
|
|
|
|
|
'depend':(Action.has('hdd'),Action.success())
|
|
|
|
|
},
|
|
|
|
|
# перенос пользователей
|
|
|
|
|
{'name':'user_migrate',
|
|
|
|
|
{'name':'hdd:user_migrate',
|
|
|
|
|
'message':__("Migrating users"),
|
|
|
|
|
'method':'Install.userMigrate(cl_target,cl_migrate_data,'
|
|
|
|
|
'cl_migrate_root_pwd)',
|
|
|
|
|
'depend':(Action.has('hdd'),Action.success())
|
|
|
|
|
},
|
|
|
|
|
# подготовка загрузчика
|
|
|
|
|
{'name':'prepare_boot',
|
|
|
|
@ -126,24 +122,24 @@ class ClInstallAction(Action):
|
|
|
|
|
'message':__("Letting go the source distribution"),
|
|
|
|
|
'method':'Install.umount(cl_image)',
|
|
|
|
|
'condition':lambda dv:dv.Get('cl_image') and dv.Get('cl_image').childs,
|
|
|
|
|
'depend': Action.has("unpack")},
|
|
|
|
|
'depend': Tasks.has("unpack")},
|
|
|
|
|
# отключение установленного дистрибутива
|
|
|
|
|
{'name':'umount_target',
|
|
|
|
|
'message':__("Unmounting the target system volume"),
|
|
|
|
|
'method':'Install.umount(cl_target)',
|
|
|
|
|
'condition':lambda dv:dv.Get('cl_target') and dv.Get('cl_target').childs,
|
|
|
|
|
'depend': Action.has("unpack")},
|
|
|
|
|
'depend': Tasks.has("unpack")},
|
|
|
|
|
# вывести сообщение в случае успеха
|
|
|
|
|
{'name':'success',
|
|
|
|
|
'message':__("System successfully installed!")},
|
|
|
|
|
# вывести сообщение в случае ошибки
|
|
|
|
|
{'name':'failed',
|
|
|
|
|
'message':__("Failed to install the system!"),
|
|
|
|
|
'depend': (Action.failed(),Action.hasnot("interrupt"))},
|
|
|
|
|
'depend': (Tasks.failed() & Tasks.hasnot("interrupt"))},
|
|
|
|
|
# вывести сообщение о том, что установка прервана пользователем
|
|
|
|
|
{'name':'intmessage',
|
|
|
|
|
'message':__("Installation manually interrupted"),
|
|
|
|
|
'depend': (Action.has("interrupt"))},
|
|
|
|
|
'depend': Tasks.has("interrupt")},
|
|
|
|
|
# подтверждение на перезагрузку
|
|
|
|
|
{'name':'ask_reboot',
|
|
|
|
|
'message':__("Would you like to reboot your computer "
|
|
|
|
@ -154,5 +150,6 @@ class ClInstallAction(Action):
|
|
|
|
|
{'name':'reboot',
|
|
|
|
|
'message':__("System reboot"),
|
|
|
|
|
'command':'/sbin/reboot',
|
|
|
|
|
'depend':Action.result("ask_reboot",eq='yes')}
|
|
|
|
|
]
|
|
|
|
|
'depend':Tasks.result("ask_reboot",eq='yes')
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|