Exemple #1
0
    def run_pre_install():
        """This means to gather what additional packages (if any) are needed & executing payload.pre_install()."""
        # anaconda requires storage packages in order to make sure the target
        # system is bootable and configurable, and some other packages in order
        # to finish setting up the system.
        if kernel_arguments.is_enabled("fips"):
            payload.requirements.add_packages(['/usr/bin/fips-mode-setup'],
                                              reason="compliance")

        payload.requirements.add_groups(payload.language_groups(),
                                        reason="language groups")
        payload.requirements.add_packages(payload.langpacks(),
                                          reason="langpacks",
                                          strong=False)

        # add package requirements from modules
        # - iterate over all modules we know have valid package requirements
        # - add any requirements found to the payload requirement tracking
        modules_with_package_requirements = [
            SECURITY, NETWORK, TIMEZONE, STORAGE
        ]
        for module in modules_with_package_requirements:
            module_proxy = module.get_proxy()
            module_requirements = Requirement.from_structure_list(
                module_proxy.CollectRequirements())
            log.debug("Adding requirements for module %s : %s", module,
                      module_requirements)
            payload.requirements.add_requirements(module_requirements)

        payload.pre_install()
Exemple #2
0
    def _check_if_geolocation_should_be_used(self, options_override):
        """Check if geolocation can be used during this installation run.

        And set the geolocation_enabled module attribute accordingly.

        The result is based on current installation type - fully interactive vs
        fully or partially automated kickstart installation and on the state of the
        "geoloc*" boot/CLI options.

        By default geolocation is not enabled during a kickstart based installation,
        unless the geoloc_use_with_ks boot/CLI option is used.

        Also the geoloc boot/CLI option can be used to make sure geolocation
        will not be used during an installation, like this:

        inst.geoloc=0

        :param bool options_override: use with kickstart due to CLI/boot option override
        """
        geolocation_enabled = True
        # don't use geolocation during image and directory installation
        if not conf.target.is_hardware:
            log.info(
                "Geolocation is disabled for image or directory installation.")
            geolocation_enabled = False
        # don't use geolocation during kickstart installation unless explicitly
        # requested by the user
        elif flags.automatedInstall:
            # check for use-with-kickstart overrides
            if options_override:
                geolocation_enabled = True
            else:
                # otherwise disable geolocation during a kickstart installation
                geolocation_enabled = False

        # and also check if geolocation was not disabled by boot or command like option
        if not kernel_arguments.is_enabled('geoloc'):
            geolocation_enabled = False

        # log the result
        self._log_geolocation_status(geolocation_enabled, options_override)

        return geolocation_enabled
Exemple #3
0
 def _log_geolocation_status(self, geolocation_enabled, options_override):
     """Log geolocation usage status."""
     if geolocation_enabled:
         if flags.automatedInstall:
             if options_override:
                 log.info(
                     "Geolocation is enabled during kickstart installation due to use of the "
                     "geoloc-use-with-ks option.")
         else:
             log.info("Geolocation is enabled.")
     else:
         if not conf.target.is_hardware:
             log.info(
                 "Geolocation is disabled for image or directory installation."
             )
         elif flags.automatedInstall:
             log.info(
                 "Geolocation is disabled due to automated kickstart based installation."
             )
         if not kernel_arguments.is_enabled('geoloc'):
             log.info("Geolocation is disabled by the geoloc option.")
Exemple #4
0
    def fips_enabled(self):
        """Is FIPS enabled?

        :return: True or False
        """
        return kernel_arguments.is_enabled("fips")
Exemple #5
0
def check_initial_conditions():
    """Can the Kdump service run?"""
    if not kernel_arguments.is_enabled("kdump_addon"):
        log.debug("The kdump add-on is disabled. Quit.")
        sys.exit(1)