Ejemplo n.º 1
0
def _filter_default_partitions(requests):
    """Filter default partitions based on the kickstart data.

    :param requests: a list of requests
    :return: a customized list of requests
    """
    auto_part_proxy = STORAGE.get_proxy(AUTO_PARTITIONING)
    skipped_mountpoints = set()
    skipped_fstypes = set()

    # Create sets of mountpoints and fstypes to remove from autorequests.
    if auto_part_proxy.Enabled:
        # Remove /home if --nohome is selected.
        if auto_part_proxy.NoHome:
            skipped_mountpoints.add("/home")

        # Remove /boot if --noboot is selected.
        if auto_part_proxy.NoBoot:
            skipped_mountpoints.add("/boot")

        # Remove swap if --noswap is selected.
        if auto_part_proxy.NoSwap:
            skipped_fstypes.add("swap")

            # Swap will not be recommended by the storage checker.
            # TODO: Remove this code from this function.
            from pyanaconda.storage_utils import storage_checker
            storage_checker.add_constraint(STORAGE_SWAP_IS_RECOMMENDED, False)

    # Skip mountpoints we want to remove.
    return [
        req for req in requests if req.mountpoint not in skipped_mountpoints
        and req.fstype not in skipped_fstypes
    ]
Ejemplo n.º 2
0
    def customizeDefaultPartitioning(self, storage, data):
        # Customize the default partitioning with kickstart data.
        auto_part_proxy = STORAGE.get_proxy(AUTO_PARTITIONING)
        skipped_mountpoints = set()
        skipped_fstypes = set()

        # Create sets of mountpoints and fstypes to remove from autorequests.
        if auto_part_proxy.Enabled:
            # Remove /home if --nohome is selected.
            if auto_part_proxy.NoHome:
                skipped_mountpoints.add("/home")

            # Remove /boot if --noboot is selected.
            if auto_part_proxy.NoBoot:
                skipped_mountpoints.add("/boot")

            # Remove swap if --noswap is selected.
            if auto_part_proxy.NoSwap:
                skipped_fstypes.add("swap")

                # Swap will not be recommended by the storage checker.
                from pyanaconda.storage_utils import storage_checker
                storage_checker.add_constraint(STORAGE_SWAP_IS_RECOMMENDED,
                                               False)

        # Skip mountpoints we want to remove.
        storage.autopart_requests = [
            req for req in storage.autopart_requests
            if req.mountpoint not in skipped_mountpoints
            and req.fstype not in skipped_fstypes
        ]
Ejemplo n.º 3
0
def _filter_default_partitions(requests):
    """Filter default partitions based on the kickstart data.

    :param requests: a list of requests
    :return: a customized list of requests
    """
    auto_part_proxy = STORAGE.get_proxy(AUTO_PARTITIONING)
    skipped_mountpoints = set()
    skipped_fstypes = set()

    # Create sets of mountpoints and fstypes to remove from autorequests.
    if auto_part_proxy.Enabled:
        # Remove /home if --nohome is selected.
        if auto_part_proxy.NoHome:
            skipped_mountpoints.add("/home")

        # Remove /boot if --noboot is selected.
        if auto_part_proxy.NoBoot:
            skipped_mountpoints.add("/boot")

        # Remove swap if --noswap is selected.
        if auto_part_proxy.NoSwap:
            skipped_fstypes.add("swap")

            # Swap will not be recommended by the storage checker.
            # TODO: Remove this code from this function.
            from pyanaconda.storage_utils import storage_checker
            storage_checker.add_constraint(STORAGE_SWAP_IS_RECOMMENDED, False)

    # Skip mountpoints we want to remove.
    return [
        req for req in requests
        if req.mountpoint not in skipped_mountpoints
           and req.fstype not in skipped_fstypes
    ]
Ejemplo n.º 4
0
    def customizeDefaultPartitioning(self, storage, data):
        # Customize the default partitioning with kickstart data.
        skipped_mountpoints = set()
        skipped_fstypes = set()

        # Create sets of mountpoints and fstypes to remove from autorequests.
        if data.autopart.autopart:
            # Remove /home if --nohome is selected.
            if data.autopart.nohome:
                skipped_mountpoints.add("/home")

            # Remove /boot if --noboot is selected.
            if data.autopart.noboot:
                skipped_mountpoints.add("/boot")

            # Remove swap if --noswap is selected.
            if data.autopart.noswap:
                skipped_fstypes.add("swap")

                # Swap will not be recommended by the storage checker.
                from pyanaconda.storage_utils import storage_checker
                storage_checker.add_constraint(STORAGE_SWAP_IS_RECOMMENDED, False)

        # Skip mountpoints we want to remove.
        storage.autopart_requests = [req for req in storage.autopart_requests
                                     if req.mountpoint not in skipped_mountpoints
                                     and req.fstype not in skipped_fstypes]
Ejemplo n.º 5
0
    # ...unless the kickstart specified otherwise
    if anaconda.tui_mode and not anaconda.ksdata.xconfig.startX:
        anaconda.ksdata.skipx.skipx = True

    # Set flag to prompt for missing ks data
    if not anaconda.interactive_mode:
        flags.ksprompt = False

    # Set minimal ram size to the storage checker.
    if anaconda.display_mode == constants.DisplayModes.GUI:
        min_ram = isys.MIN_GUI_RAM
    else:
        min_ram = isys.MIN_RAM

    from pyanaconda.storage_utils import storage_checker
    storage_checker.add_constraint(constants.STORAGE_MIN_RAM, min_ram)
    anaconda.instClass.setStorageChecker(storage_checker)

    from pyanaconda.argument_parsing import name_path_pairs

    image_count = 0
    try:
        for (name, path) in name_path_pairs(opts.images):
            log.info("naming disk image '%s' '%s'", path, name)
            anaconda.storage.disk_images[name] = path
            image_count += 1
            flags.imageInstall = True
    except ValueError as e:
        stdout_log.error("error specifying image file: %s", e)
        iutil.ipmi_abort(scripts=ksdata.scripts)
        sys.exit(1)
Ejemplo n.º 6
0
    if not services_proxy.DefaultTarget and anaconda.tui_mode:
        services_proxy.SetDefaultTarget(TEXT_ONLY_TARGET)

    # Set flag to prompt for missing ks data
    if not anaconda.interactive_mode:
        flags.ksprompt = False

    # Set minimal ram size to the storage checker.
    if anaconda.display_mode == constants.DisplayModes.GUI:
        min_ram = isys.MIN_GUI_RAM
    else:
        min_ram = isys.MIN_RAM

    from pyanaconda.storage_utils import storage_checker
    storage_checker.add_constraint(constants.STORAGE_MIN_RAM, min_ram)

    from pyanaconda.argument_parsing import name_path_pairs

    image_count = 0
    try:
        for (name, path) in name_path_pairs(opts.images):
            log.info("naming disk image '%s' '%s'", path, name)
            anaconda.storage.disk_images[name] = path
            image_count += 1
    except ValueError as e:
        stdout_log.error("error specifying image file: %s", e)
        util.ipmi_abort(scripts=ksdata.scripts)
        sys.exit(1)

    if image_count:
Ejemplo n.º 7
0
    # ...unless the kickstart specified otherwise
    if anaconda.tui_mode and not anaconda.ksdata.xconfig.startX:
        anaconda.ksdata.skipx.skipx = True

    # Set flag to prompt for missing ks data
    if not anaconda.interactive_mode:
        flags.ksprompt = False

    # Set minimal ram size to the storage checker.
    if anaconda.display_mode == constants.DisplayModes.GUI:
        min_ram = isys.MIN_GUI_RAM
    else:
        min_ram = isys.MIN_RAM

    from pyanaconda.storage_utils import storage_checker
    storage_checker.add_constraint("min_ram", min_ram)
    anaconda.instClass.setStorageChecker(storage_checker)

    from pyanaconda.anaconda_argparse import name_path_pairs

    image_count = 0
    try:
        for (name, path) in name_path_pairs(opts.images):
            log.info("naming disk image '%s' '%s'", path, name)
            anaconda.storage.config.disk_images[name] = path
            image_count += 1
            flags.imageInstall = True
    except ValueError as e:
        stdout_log.error("error specifying image file: %s", e)
        iutil.ipmi_abort(scripts=ksdata.scripts)
        sys.exit(1)