Example #1
0
def initExceptionHandling(anaconda):
    fileList = [
        "/tmp/anaconda.log", "/tmp/packaging.log", "/tmp/program.log",
        "/tmp/storage.log", "/tmp/ifcfg.log", "/tmp/dnf.log",
        "/tmp/dnf.rpm.log", "/tmp/yum.log",
        iutil.getSysroot() + "/root/install.log", "/proc/cmdline"
    ]

    if os.path.exists("/tmp/syslog"):
        fileList.extend(["/tmp/syslog"])

    if anaconda.opts and anaconda.opts.ksfile:
        fileList.extend([anaconda.opts.ksfile])

    conf = Config(
        programName="anaconda",
        programVersion=startup_utils.get_anaconda_version_string(),
        programArch=os.uname()[4],
        attrSkipList=[
            "_intf._actions", "_intf._currentAction._xklwrapper",
            "_intf._currentAction._spokes[\"KeyboardSpoke\"]._xkl_wrapper",
            "_intf._currentAction._storage_playground",
            "_intf._currentAction._spokes[\"CustomPartitioningSpoke\"]._storage_playground",
            "_intf._currentAction.language.translations",
            "_intf._currentAction.language.locales",
            "_intf._currentAction._spokes[\"PasswordSpoke\"]._oldweak",
            "_intf._currentAction._spokes[\"PasswordSpoke\"]._password",
            "_intf._currentAction._spokes[\"UserSpoke\"]._password",
            "_intf._currentAction._spokes[\"UserSpoke\"]._oldweak",
            "_intf.storage.bootloader.password", "_intf.storage.data",
            "_intf.storage.encryptionPassphrase",
            "_bootloader.encrypted_password", "_bootloader.password",
            "payload._groups", "payload._yum"
        ],
        localSkipList=["passphrase", "password", "_oldweak", "_password"],
        fileList=fileList)

    conf.register_callback("lsblk_output", lsblk_callback, attchmnt_only=True)
    conf.register_callback("nmcli_dev_list",
                           nmcli_dev_list_callback,
                           attchmnt_only=True)
    conf.register_callback("type", lambda: "anaconda", attchmnt_only=True)
    conf.register_callback("addons", list_addons_callback, attchmnt_only=False)

    if "/tmp/syslog" not in fileList:
        # no syslog, grab output from journalctl and put it also to the
        # anaconda-tb file
        conf.register_callback("journalctl",
                               journalctl_callback,
                               attchmnt_only=False)

    interactive = not anaconda.displayMode == 'c'
    handler = AnacondaExceptionHandler(conf, anaconda.intf.meh_interface,
                                       ReverseExceptionDump,
                                       anaconda.intf.tty_num,
                                       anaconda.gui_initialized, interactive)
    handler.install(anaconda)

    return conf
Example #2
0
    def _get_new_config_header(self):
        """Generate a header for use when Anaconda generates the user interaction config file.

        :returns: an appropriate user config file header
        :rtype: str
        """

        return "# This file has been generated by the Anaconda Installer %s\n\n" % \
               startup_utils.get_anaconda_version_string()
Example #3
0
    def _get_new_config_header(self):
        """Generate a header for use when Anaconda generates the user interaction config file.

        :returns: an appropriate user config file header
        :rtype: str
        """

        return "# This file has been generated by the Anaconda Installer %s\n\n" % \
               startup_utils.get_anaconda_version_string()
def initExceptionHandling(anaconda):
    fileList = ["/tmp/anaconda.log", "/tmp/packaging.log",
                "/tmp/program.log", "/tmp/storage.log", "/tmp/ifcfg.log",
                "/tmp/dnf.librepo.log", "/tmp/hawkey.log",
                "/tmp/lvm.log", iutil.getSysroot() + "/root/install.log",
                "/proc/cmdline"]

    if os.path.exists("/tmp/syslog"):
        fileList.extend(["/tmp/syslog"])

    if anaconda.opts and anaconda.opts.ksfile:
        fileList.extend([anaconda.opts.ksfile])

    conf = Config(programName="anaconda",
                  programVersion=startup_utils.get_anaconda_version_string(),
                  programArch=os.uname()[4],
                  attrSkipList=["_intf._actions",
                                "_intf._currentAction._xklwrapper",
                                "_intf._currentAction._spokes[\"KeyboardSpoke\"]._xkl_wrapper",
                                "_intf._currentAction._storage_playground",
                                "_intf._currentAction._spokes[\"CustomPartitioningSpoke\"]._storage_playground",
                                "_intf._currentAction.language.translations",
                                "_intf._currentAction.language.locales",
                                "_intf._currentAction._spokes[\"PasswordSpoke\"]._oldweak",
                                "_intf._currentAction._spokes[\"PasswordSpoke\"]._password",
                                "_intf._currentAction._spokes[\"UserSpoke\"]._password",
                                "_intf._currentAction._spokes[\"UserSpoke\"]._oldweak",
                                "_intf.storage.bootloader.password",
                                "_intf.storage.data",
                                "_intf.storage.ksdata",
                                "_intf.storage.encryption_passphrase",
                                "_intf.data",
                                "_bootloader.encrypted_password",
                                "_bootloader.password",
                                "payload._groups"],
                  localSkipList=["passphrase", "password", "_oldweak", "_password", "try_passphrase"],
                  fileList=fileList)

    conf.register_callback("lsblk_output", lsblk_callback, attchmnt_only=True)
    conf.register_callback("nmcli_dev_list", nmcli_dev_list_callback,
                           attchmnt_only=True)
    conf.register_callback("type", lambda: "anaconda", attchmnt_only=True)
    conf.register_callback("addons", list_addons_callback, attchmnt_only=False)

    if "/tmp/syslog" not in fileList:
        # no syslog, grab output from journalctl and put it also to the
        # anaconda-tb file
        conf.register_callback("journalctl", journalctl_callback, attchmnt_only=False)

    interactive = not anaconda.displayMode == 'c'
    handler = AnacondaExceptionHandler(conf, anaconda.intf.meh_interface,
                                       AnacondaReverseExceptionDump, anaconda.intf.tty_num,
                                       anaconda.gui_initialized, interactive)
    handler.install(anaconda)

    return conf
Example #5
0
def parse_arguments(argv=None, boot_cmdline=None):
    """Parse command line/boot options and arguments.

    :param argv: command like arguments
    :param boot_cmdline: boot options
    :returns: namespace of parsed options and a list of deprecated
              anaconda options that have been found
    """
    from pyanaconda.argument_parsing import getArgumentParser
    from pyanaconda.startup_utils import get_anaconda_version_string

    ap = getArgumentParser(get_anaconda_version_string(), boot_cmdline)

    namespace = ap.parse_args(argv, boot_cmdline=boot_cmdline)
    return (namespace, ap.deprecated_bootargs)
Example #6
0
def parse_arguments(argv=None, boot_cmdline=None):
    """Parse command line/boot options and arguments.

    :param argv: command like arguments
    :param boot_cmdline: boot options
    :returns: namespace of parsed options and a list of deprecated
              anaconda options that have been found
    """
    from pyanaconda.argument_parsing import getArgumentParser
    from pyanaconda.startup_utils import get_anaconda_version_string

    ap = getArgumentParser(get_anaconda_version_string(), boot_cmdline)

    namespace = ap.parse_args(argv, boot_cmdline=boot_cmdline)
    return (namespace, ap.deprecated_bootargs)
Example #7
0
        log.warning("Input kickstart will not be saved to the installed system due to the nosave option.")
        iutil.touch('/tmp/NOSAVE_INPUT_KS')

    # check if logs should be saved
    if flags.nosave_logs:
        log.warning("Installation logs will not be saved to the installed system due to the nosave option.")
        iutil.touch('/tmp/NOSAVE_LOGS')

    # see if we're on s390x and if we've got an ssh connection
    uname = os.uname()
    if uname[4] == 's390x':
        if 'TMUX' not in os.environ and 'ks' not in flags.cmdline and not flags.imageInstall:
            startup_utils.prompt_for_ssh()
            sys.exit(0)

    log.info("%s %s", sys.argv[0], startup_utils.get_anaconda_version_string())
    if os.path.exists("/tmp/updates"):
        log.info("Using updates in /tmp/updates/ from %s", opts.updateSrc)

    # TODO: uncomment this when we're sure that we're doing the right thing
    # with flags.cmdline *everywhere* it appears...
    #for arg in depr:
    #    stdout_log.warn("Boot argument '%s' is deprecated. "
    #                   "In the future, use 'inst.%s'.", arg, arg)

    from pyanaconda import isys

    iutil.ipmi_report(constants.IPMI_STARTED)

    if (opts.images or opts.dirinstall) and opts.liveinst:
        stdout_log.error("--liveinst cannot be used with --images or --dirinstall")
Example #8
0
    if flags.nosave_logs:
        log.warning(
            "Installation logs will not be saved to the installed system due to the nosave option."
        )
        util.touch('/tmp/NOSAVE_LOGS')

    # see if we're on s390x and if we've got an ssh connection
    uname = os.uname()
    if uname[4] == 's390x':
        if 'TMUX' not in os.environ and 'ks' not in flags.cmdline and conf.target.is_hardware:
            startup_utils.prompt_for_ssh()
            sys.exit(0)

    log.info(
        "%s %s", sys.argv[0],
        startup_utils.get_anaconda_version_string(build_time_version=True))
    if os.path.exists("/tmp/updates"):
        log.info("Using updates in /tmp/updates/ from %s", opts.updateSrc)

    # TODO: uncomment this when we're sure that we're doing the right thing
    # with flags.cmdline *everywhere* it appears...
    #for arg in depr:
    #    stdout_log.warn("Boot argument '%s' is deprecated. "
    #                   "In the future, use 'inst.%s'.", arg, arg)

    from pyanaconda import isys

    util.ipmi_report(constants.IPMI_STARTED)

    if (opts.images or opts.dirinstall) and opts.liveinst:
        stdout_log.error(
Example #9
0
def getAnacondaVersionString():
    # we are importing the startup module directly so that it can be replaced
    # by updates image, if it was replaced before the updates image can be
    # loaded, it could not be easily replaced
    from pyanaconda import startup_utils
    return startup_utils.get_anaconda_version_string()
Example #10
0
        log.warning("Input kickstart will not be saved to the installed system due to the nosave option.")
        util.touch('/tmp/NOSAVE_INPUT_KS')

    # check if logs should be saved
    if flags.nosave_logs:
        log.warning("Installation logs will not be saved to the installed system due to the nosave option.")
        util.touch('/tmp/NOSAVE_LOGS')

    # see if we're on s390x and if we've got an ssh connection
    uname = os.uname()
    if uname[4] == 's390x':
        if 'TMUX' not in os.environ and 'ks' not in flags.cmdline and not flags.imageInstall:
            startup_utils.prompt_for_ssh()
            sys.exit(0)

    log.info("%s %s", sys.argv[0], startup_utils.get_anaconda_version_string(build_time_version=True))
    if os.path.exists("/tmp/updates"):
        log.info("Using updates in /tmp/updates/ from %s", opts.updateSrc)

    # TODO: uncomment this when we're sure that we're doing the right thing
    # with flags.cmdline *everywhere* it appears...
    #for arg in depr:
    #    stdout_log.warn("Boot argument '%s' is deprecated. "
    #                   "In the future, use 'inst.%s'.", arg, arg)

    from pyanaconda import isys

    util.ipmi_report(constants.IPMI_STARTED)

    if (opts.images or opts.dirinstall) and opts.liveinst:
        stdout_log.error("--liveinst cannot be used with --images or --dirinstall")
Example #11
0
def getAnacondaVersionString():
    # we are importing the startup module directly so that it can be replaced
    # by updates image, if it was replaced before the updates image can be
    # loaded, it could not be easily replaced
    from pyanaconda import startup_utils
    return startup_utils.get_anaconda_version_string()
Example #12
0
def initExceptionHandling(anaconda):
    file_list = [
        "/tmp/anaconda.log", "/tmp/packaging.log", "/tmp/program.log",
        "/tmp/storage.log", "/tmp/dnf.librepo.log", "/tmp/hawkey.log",
        "/tmp/lvm.log",
        util.getSysroot() + "/root/install.log", "/proc/cmdline",
        "/root/lorax-packages.log", "/tmp/blivet-gui-utils.log",
        "/tmp/dbus.log"
    ]

    if os.path.exists("/tmp/syslog"):
        file_list.extend(["/tmp/syslog"])

    if anaconda.opts and anaconda.opts.ksfile:
        file_list.extend([anaconda.opts.ksfile])

    config = Config(
        programName="anaconda",
        programVersion=startup_utils.get_anaconda_version_string(),
        programArch=os.uname()[4],
        attrSkipList=[
            "_intf._actions", "_intf._currentAction._xklwrapper",
            "_intf._currentAction._spokes[\"KeyboardSpoke\"]._xkl_wrapper",
            "_intf._currentAction._storage_playground",
            "_intf._currentAction._spokes[\"CustomPartitioningSpoke\"]._storage_playground",
            "_intf._currentAction.language.translations",
            "_intf._currentAction.language.locales",
            "_intf._currentAction._spokes[\"PasswordSpoke\"]._oldweak",
            "_intf._currentAction._spokes[\"PasswordSpoke\"]._password",
            "_intf._currentAction._spokes[\"UserSpoke\"]._password",
            "_intf._currentAction._spokes[\"UserSpoke\"]._oldweak",
            "_intf.storage.bootloader.password", "_intf.storage.data",
            "_intf.storage.ksdata", "_intf.storage.encryption_passphrase",
            "_intf.data", "_bootloader.encrypted_password",
            "_bootloader.password", "payload._groups"
        ],
        localSkipList=[
            "passphrase", "password", "_oldweak", "_password", "try_passphrase"
        ],
        fileList=file_list)

    config.register_callback("lsblk_output",
                             lsblk_callback,
                             attchmnt_only=False)
    config.register_callback("nmcli_dev_list",
                             nmcli_dev_list_callback,
                             attchmnt_only=True)

    # provide extra information for libreport
    config.register_callback("type", lambda: "anaconda", attchmnt_only=True)
    config.register_callback("addons",
                             list_addons_callback,
                             attchmnt_only=False)

    if "/tmp/syslog" not in file_list:
        # no syslog, grab output from journalctl and put it also to the
        # anaconda-tb file
        config.register_callback("journalctl",
                                 journalctl_callback,
                                 attchmnt_only=False)

    if not product.isFinal:
        config.register_callback("release_type",
                                 lambda: "pre-release",
                                 attchmnt_only=True)

    handler = AnacondaExceptionHandler(config, anaconda.intf.meh_interface,
                                       AnacondaReverseExceptionDump,
                                       anaconda.intf.tty_num,
                                       anaconda.gui_initialized,
                                       anaconda.interactive_mode)
    handler.install(anaconda)

    return config
Example #13
0
        log.warning("Input kickstart will not be saved to the installed system due to the nosave option.")
        util.touch('/tmp/NOSAVE_INPUT_KS')

    # check if logs should be saved
    if flags.nosave_logs:
        log.warning("Installation logs will not be saved to the installed system due to the nosave option.")
        util.touch('/tmp/NOSAVE_LOGS')

    # see if we're on s390x and if we've got an ssh connection
    uname = os.uname()
    if uname[4] == 's390x':
        if 'TMUX' not in os.environ and 'ks' not in flags.cmdline and not conf.target.is_image:
            startup_utils.prompt_for_ssh()
            sys.exit(0)

    log.info("%s %s", sys.argv[0], startup_utils.get_anaconda_version_string(build_time_version=True))
    if os.path.exists("/tmp/updates"):
        log.info("Using updates in /tmp/updates/ from %s", opts.updateSrc)

    # TODO: uncomment this when we're sure that we're doing the right thing
    # with flags.cmdline *everywhere* it appears...
    #for arg in depr:
    #    stdout_log.warn("Boot argument '%s' is deprecated. "
    #                   "In the future, use 'inst.%s'.", arg, arg)

    from pyanaconda import isys

    util.ipmi_report(constants.IPMI_STARTED)

    if (opts.images or opts.dirinstall) and opts.liveinst:
        stdout_log.error("--liveinst cannot be used with --images or --dirinstall")