if ksdata.lang.seen: locale_option = ksdata.lang.lang else: locale_option = None localization.setup_locale_environment(locale_option, text_mode=anaconda.tui_mode) # Now that LANG is set, do something with it localization.setup_locale(os.environ["LANG"], ksdata.lang, text_mode=anaconda.tui_mode) from pyanaconda.storage.osinstall import storage_initialize, enable_installer_mode enable_installer_mode() # Initialize the network now, in case the display needs it from pyanaconda.network import networkInitialize, wait_for_connecting_NM_thread, wait_for_connected_NM networkInitialize(ksdata) # If required by user, wait for connection before starting the installation. if opts.waitfornet: log.info("network: waiting for connectivity requested by inst.waitfornet=%d", opts.waitfornet) wait_for_connected_NM(timeout=opts.waitfornet) # In any case do some actions only after NM finishes its connecting. threadMgr.add(AnacondaThread(name=constants.THREAD_WAIT_FOR_CONNECTING_NM, target=wait_for_connecting_NM_thread, args=(ksdata,))) # initialize the screen access manager before launching the UI from pyanaconda import screen_access screen_access.initSAM() # try to open any existing config file # (might be created by pre-anaconda helper tools, injected during image # generation, etc.) screen_access.sam.open_config_file()
if ksdata.lang.seen: locale_option = ksdata.lang.lang else: locale_option = None localization.setup_locale_environment(locale_option, opts.display_mode != "g") # Now that LANG is set, do something with it localization.setup_locale(os.environ["LANG"], ksdata.lang, opts.display_mode != "g") import blivet blivet.enable_installer_mode() # Initialize the network now, in case the display needs it from pyanaconda.network import networkInitialize, wait_for_connecting_NM_thread networkInitialize(ksdata) threadMgr.add(AnacondaThread(name=constants.THREAD_WAIT_FOR_CONNECTING_NM, target=wait_for_connecting_NM_thread, args=(ksdata,))) # now start the interface setupDisplay(anaconda, opts, addon_paths) if anaconda.gui_startup_failed: # we need to reinitialize the locale if GUI startup failed, # as we might now be in text mode, which might not be able to display # the characters from our current locale log.warning("reinitializing locale due to failed attempt to start the GUI") localization.setup_locale(os.environ["LANG"], ksdata.lang, anaconda.displayMode != "g") # we now know in which mode we are going to run so store the information from pykickstart.constants import DISPLAY_MODE_GRAPHICAL, DISPLAY_MODE_CMDLINE, DISPLAY_MODE_TEXT mode_char_to_const = {'g': DISPLAY_MODE_GRAPHICAL, 't': DISPLAY_MODE_TEXT, 'c': DISPLAY_MODE_CMDLINE} ksdata.displaymode.displayMode = mode_char_to_const[anaconda.displayMode]