def setup_checkpoints(): '''Sets up the checkpoints for the installation within the install engine ''' logger = logging.getLogger(INSTALL_LOGGER_NAME) engine = InstallEngine.get_instance() logger.debug("**** Establishing checkpoints ****") logger.debug("Establishing the " + TARGET_DISCOVERY + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[TARGET_DISCOVERY])) logger.debug("Establishing the " + TRANSFER_PREP + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[TRANSFER_PREP])) logger.debug("Establishing the " + VARSHARE_DATASET + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[VARSHARE_DATASET])) logger.debug("Establishing the " + TARGET_INIT + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[TARGET_INIT])) logger.debug("Establishing the " + TRANSFER_ROOT + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[TRANSFER_ROOT])) logger.debug("Establishing the " + TRANSFER_MISC + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[TRANSFER_MISC])) logger.debug("Establishing the " + TRANSFER_MEDIA + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[TRANSFER_MEDIA])) logger.debug("Establishing the " + GENERATE_SC_PROFILE_CHKPOINT + \ " checkpoint") sysconfig.register_checkpoint() logger.debug("Establishing the " + CLEANUP_CPIO_INSTALL + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[CLEANUP_CPIO_INSTALL])) logger.debug("Establishing the " + INIT_SMF + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[INIT_SMF])) logger.debug("Establishing the " + BOOT_CONFIG + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[BOOT_CONFIG])) logger.debug("Establishing the " + DUMP_ADMIN + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[DUMP_ADMIN])) logger.debug("Establishing the " + DEVICE_CONFIG + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[DEVICE_CONFIG])) logger.debug("Establishing the " + APPLY_SYSCONFIG + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[APPLY_SYSCONFIG])) logger.debug("Establishing the " + BOOT_ARCHIVE + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[BOOT_ARCHIVE])) logger.debug("Establishing the " + TRANSFER_FILES + " checkpoint") # Build up list of files to be added to DataObjectCache for transfer # to new boot environment. tf_dict = dict() tf_dict['/var/adm/messages'] = post_install_logs_path('messages') add_transfer_files_to_doc(TRANSFER_FILES, tf_dict) engine.register_checkpoint(*(TI_CHKPS[TRANSFER_FILES])) logger.debug("Establishing the " + CREATE_SNAPSHOT + " checkpoint") engine.register_checkpoint(*(TI_CHKPS[CREATE_SNAPSHOT])) logger.debug("**** Checkpoints Established ****")
# Dir which this executable is run from EXE_DIR = os.path.abspath(os.path.dirname(sys.argv[0])) # usr/share dir (relative to EXE_DIR) SHARE_DIR = os.path.abspath(EXE_DIR + "/../share") # Location of Glade/GtkBuilder .xml files GLADE_DIR = SHARE_DIR + "/gui-install" GLADE_ERROR_MSG = _("Unable to retrieve a widget from Glade XML files.") # Location of .png/.gif files for icons, etc IMAGE_DIR = SHARE_DIR + "/gui-install" # default install log file DEFAULT_LOG_LOCATION = "/system/volatile/install_log" # final log location after installation LOG_LOCATION_FINAL = post_install_logs_path("install_log").lstrip("/") # PID file for checking for multiple instances of program PIDFILE = "/system/volatile/gui-install.pid" # current log file LOGNAME = None # default logging level DEFAULT_LOG_LEVEL = "info" # debug logging level DEBUG_LOG_LEVEL = "debug" # default log format LOG_FORMAT = ("%(asctime)s - %(levelname)-8s: %(message)s")
def prepare_engine(options): ''' Instantiate the engine, setup logging, and register all the checkpoints to be used for doing the install. ''' eng = InstallEngine(debug=options.debug) # setup_logging() must be called after the engine is initialized. setup_logging(options.logname, options.log_level) terminalui.init_logging(INSTALL_LOGGER_NAME) # Information regarding checkpoints used for the Text Installer. # The values specified are used as arguments for registering the # checkpoint. If function signature for any of the checkpoints are # is modified, these values need to be modified as well. eng.register_checkpoint(TARGET_DISCOVERY, "solaris_install/target/discovery", "TargetDiscovery") eng.register_checkpoint(TRANSFER_PREP, "solaris_install/transfer/media_transfer", "init_prepare_media_transfer") eng.register_checkpoint(VARSHARE_DATASET, "solaris_install/target/varshare", "VarShareDataset") eng.register_checkpoint(TARGET_INIT, "solaris_install/target/instantiation", "TargetInstantiation") # The following 3 are transfer checkpoints eng.register_checkpoint(TRANSFER_ROOT, "solaris_install/transfer/cpio", "TransferCPIO") eng.register_checkpoint(TRANSFER_MISC, "solaris_install/transfer/cpio", "TransferCPIO") eng.register_checkpoint(TRANSFER_MEDIA, "solaris_install/transfer/cpio", "TransferCPIO") # sys config checkpoint must be registered after transfer checkpoints sysconfig.register_checkpoint() # rest of the checkpoints are for finishing up the install process eng.register_checkpoint(CLEANUP_CPIO_INSTALL, "solaris_install/ict/cleanup_cpio_install", "CleanupCPIOInstall") eng.register_checkpoint(INIT_SMF, "solaris_install/ict/initialize_smf", "InitializeSMF") eng.register_checkpoint(BOOT_CONFIG, "solaris_install/boot/boot", "SystemBootMenu") eng.register_checkpoint(DUMP_ADMIN, "solaris_install/ict/update_dumpadm", "UpdateDumpAdm") eng.register_checkpoint(DEVICE_CONFIG, "solaris_install/ict/device_config", "DeviceConfig") eng.register_checkpoint(APPLY_SYSCONFIG, "solaris_install/ict/apply_sysconfig", "ApplySysConfig") eng.register_checkpoint(BOOT_ARCHIVE, "solaris_install/ict/boot_archive", "BootArchive") # Build up list of files to be added to DataObjectCache for transfer # to new boot environment. tf_dict = dict() tf_dict['/var/adm/messages'] = post_install_logs_path('messages') add_transfer_files_to_doc(TRANSFER_FILES, tf_dict) eng.register_checkpoint(TRANSFER_FILES, "solaris_install/ict/transfer_files", "TransferFiles") eng.register_checkpoint(CREATE_SNAPSHOT, "solaris_install/ict/create_snapshot", "CreateSnapshot")
GPTPartEditScreen, PartEditScreen from solaris_install.text_install.summary import SummaryScreen from solaris_install.text_install.ti_install_utils import InstallData from solaris_install.text_install.welcome import WelcomeScreen from solaris_install.transfer.media_transfer import TRANSFER_ROOT, \ TRANSFER_MISC, TRANSFER_MEDIA import terminalui from terminalui import LOG_LEVEL_INPUT, LOG_NAME_INPUT from terminalui.action import Action from terminalui.base_screen import BaseScreen, QuitException from terminalui.help_screen import HelpScreen from terminalui.i18n import get_encoding, set_wrap_on_whitespace from terminalui.main_window import MainWindow from terminalui.screen_list import ScreenList LOG_LOCATION_FINAL = post_install_logs_path('install_log') DEFAULT_LOG_LOCATION = "/system/volatile/install_log" DEFAULT_LOG_LEVEL = "info" DEBUG_LOG_LEVEL = "debug" REBOOT = "/usr/sbin/reboot" LOGGER = None def exit_text_installer(logname=None, errcode=0): '''Teardown any existing iSCSI objects, Close out the logger and exit with errcode''' # get the Iscsi object from the DOC, if present. doc = InstallEngine.get_instance().doc iscsi = doc.volatile.get_first_child(name=ISCSI_LABEL, class_type=Iscsi)
def prepare_engine(options): ''' Instantiate the engine, setup logging, and register all the checkpoints to be used for doing the install. ''' eng = InstallEngine(debug=options.debug) # setup_logging() must be called after the engine is initialized. setup_logging(options.logname, options.log_level) terminalui.init_logging(INSTALL_LOGGER_NAME) # Information regarding checkpoints used for the Text Installer. # The values specified are used as arguments for registering the # checkpoint. If function signature for any of the checkpoints are # is modified, these values need to be modified as well. eng.register_checkpoint(TARGET_DISCOVERY, "solaris_install/target/discovery", "TargetDiscovery") eng.register_checkpoint(TRANSFER_PREP, "solaris_install/transfer/media_transfer", "init_prepare_media_transfer") eng.register_checkpoint(VAR_SHARED_DATASET, "solaris_install/target/varshared", "VarSharedDataset") eng.register_checkpoint(TARGET_INIT, "solaris_install/target/instantiation", "TargetInstantiation") # The following 3 are transfer checkpoints eng.register_checkpoint(TRANSFER_ROOT, "solaris_install/transfer/cpio", "TransferCPIO") eng.register_checkpoint(TRANSFER_MISC, "solaris_install/transfer/cpio", "TransferCPIO") eng.register_checkpoint(TRANSFER_MEDIA, "solaris_install/transfer/cpio", "TransferCPIO") # sys config checkpoint must be registered after transfer checkpoints sysconfig.register_checkpoint() # rest of the checkpoints are for finishing up the install process eng.register_checkpoint(CLEANUP_CPIO_INSTALL, "solaris_install/ict/cleanup_cpio_install", "CleanupCPIOInstall") eng.register_checkpoint(INIT_SMF, "solaris_install/ict/initialize_smf", "InitializeSMF") eng.register_checkpoint(BOOT_CONFIG, "solaris_install/boot/boot", "SystemBootMenu") eng.register_checkpoint(DUMP_ADMIN, "solaris_install/ict/update_dumpadm", "UpdateDumpAdm") eng.register_checkpoint(DEVICE_CONFIG, "solaris_install/ict/device_config", "DeviceConfig") eng.register_checkpoint(APPLY_SYSCONFIG, "solaris_install/ict/apply_sysconfig", "ApplySysConfig") eng.register_checkpoint(BOOT_ARCHIVE, "solaris_install/ict/boot_archive", "BootArchive") # Build up list of files to be added to DataObjectCache for transfer # to new boot environment. tf_dict = dict() tf_dict['/var/adm/messages'] = post_install_logs_path('messages') add_transfer_files_to_doc(TRANSFER_FILES, tf_dict) eng.register_checkpoint(TRANSFER_FILES, "solaris_install/ict/transfer_files", "TransferFiles") eng.register_checkpoint(CREATE_SNAPSHOT, "solaris_install/ict/create_snapshot", "CreateSnapshot")
from solaris_install.text_install.summary import SummaryScreen from solaris_install.text_install.ti_install_utils import InstallData from solaris_install.text_install.welcome import WelcomeScreen from solaris_install.transfer.media_transfer import TRANSFER_ROOT, \ TRANSFER_MISC, TRANSFER_MEDIA import terminalui from terminalui import LOG_LEVEL_INPUT, LOG_NAME_INPUT from terminalui.action import Action from terminalui.base_screen import BaseScreen, QuitException from terminalui.help_screen import HelpScreen from terminalui.i18n import get_encoding, set_wrap_on_whitespace from terminalui.main_window import MainWindow from terminalui.screen_list import ScreenList LOG_LOCATION_FINAL = post_install_logs_path('install_log') DEFAULT_LOG_LOCATION = "/system/volatile/install_log" DEFAULT_LOG_LEVEL = "info" DEBUG_LOG_LEVEL = "debug" REBOOT = "/usr/sbin/reboot" LOGGER = None def exit_text_installer(logname=None, errcode=0): '''Close out the logger and exit with errcode''' LOGGER.info("**** END ****") LOGGER.close() if logname is not None: print _("Exiting Text Installer. Log is available at:\n%s") % logname if isinstance(errcode, unicode):