Exemple #1
0
    def Request(self, request: Structure):
        """Set the partitioning request.

        :param request: a request
        """
        self.implementation.set_request(
            PartitioningRequest.from_structure(request))
Exemple #2
0
    def __init__(self, *args, **kwargs):
        StorageCheckHandler.__init__(self)
        NormalSpoke.__init__(self, *args, **kwargs)
        self.applyOnSkip = True
        self._ready = False
        self._back_clicked = False
        self._disks_errors = []
        self._last_clicked_overview = None
        self._cur_clicked_overview = None

        self._storage_module = STORAGE.get_proxy()
        self._device_tree = STORAGE.get_proxy(DEVICE_TREE)
        self._bootloader_module = STORAGE.get_proxy(BOOTLOADER)
        self._disk_init_module = STORAGE.get_proxy(DISK_INITIALIZATION)
        self._disk_select_module = STORAGE.get_proxy(DISK_SELECTION)

        # This list contains all possible disks that can be included in the install.
        # All types of advanced disks should be set up for us ahead of time, so
        # there should be no need to modify this list.
        self._available_disks = []
        self._selected_disks = []
        self._last_selected_disks = []

        # Is the partitioning already configured?
        self._is_preconfigured = bool(self._storage_module.CreatedPartitioning)

        # Find a partitioning to use.
        self._partitioning = find_partitioning()
        self._last_partitioning_method = self._partitioning.PartitioningMethod

        # Create a partitioning request for the automatic partitioning.
        self._partitioning_request = PartitioningRequest()

        if self._last_partitioning_method == PARTITIONING_METHOD_AUTOMATIC:
            self._partitioning_request = PartitioningRequest.from_structure(
                self._partitioning.Request)

        # Get the UI elements.
        self._custom_part_radio_button = self.builder.get_object(
            "customRadioButton")
        self._blivet_gui_radio_button = self.builder.get_object(
            "blivetguiRadioButton")
        self._encrypted_checkbox = self.builder.get_object(
            "encryptionCheckbox")
        self._encryption_revealer = self.builder.get_object(
            "encryption_revealer")
        self._reclaim_checkbox = self.builder.get_object("reclaimCheckbox")
        self._reclaim_revealer = self.builder.get_object(
            "reclaim_checkbox_revealer")
        self._local_disks_box = self.builder.get_object("local_disks_box")
        self._specialized_disks_box = self.builder.get_object(
            "specialized_disks_box")
        self._local_viewport = self.builder.get_object("localViewport")
        self._specialized_viewport = self.builder.get_object(
            "specializedViewport")
        self._main_viewport = self.builder.get_object("storageViewport")
        self._main_box = self.builder.get_object("storageMainBox")

        # Configure the partitioning methods.
        self._configure_partitioning_methods()
    def SchedulePartitionsWithTask(self, request: Structure) -> ObjPath:
        """Schedule the partitioning actions.

        Generate the automatic partitioning configuration
        using the given request.

        :param: a partitioning request
        :return: a DBus path to a task
        """
        return TaskContainer.to_object_path(
            self.implementation.schedule_partitions_with_task(
                PartitioningRequest.from_structure(request)))
Exemple #4
0
def set_storage_defaults_from_kickstart(storage):
    """Set the storage default values from a kickstart file.

    FIXME: A temporary workaround for UI.
    """
    # Set the default filesystem types.
    auto_part_proxy = STORAGE.get_proxy(AUTO_PARTITIONING)
    request = PartitioningRequest.from_structure(auto_part_proxy.Request)

    if request.file_system_type:
        storage.set_default_fstype(request.file_system_type)

    if "swap" in request.excluded_mount_points:
        storage_checker.set_constraint(STORAGE_SWAP_IS_RECOMMENDED, False)
def set_storage_defaults_from_kickstart(storage):
    """Set the storage default values from a kickstart file.

    FIXME: A temporary workaround for UI.
    """
    # Set the default filesystem types.
    auto_part_proxy = STORAGE.get_proxy(AUTO_PARTITIONING)
    request = PartitioningRequest.from_structure(auto_part_proxy.Request)

    if request.file_system_type:
        storage.set_default_fstype(request.file_system_type)

    if "swap" in request.excluded_mount_points:
        storage_checker.set_constraint(STORAGE_SWAP_IS_RECOMMENDED, False)

    # Set up the bootloader.
    boot_loader_proxy = STORAGE.get_proxy(BOOTLOADER)
    default_type = boot_loader_proxy.GetDefaultType()
    default_class = BootLoaderFactory.get_class_by_name(default_type)
    BootLoaderFactory.set_default_class(default_class)
Exemple #6
0
def configure_storage(storage, data=None, interactive=False):
    """Setup storage state from the kickstart data.

    :param storage: an instance of the Blivet's storage object
    :param data: an instance of kickstart data or None
    :param interactive: use a task for the interactive partitioning
    """
    auto_part_proxy = STORAGE.get_proxy(AUTO_PARTITIONING)

    if interactive:
        task = InteractivePartitioningTask(storage)
    elif auto_part_proxy.Enabled:
        request = PartitioningRequest.from_structure(auto_part_proxy.Request)
        task = AutomaticPartitioningTask(storage, request)
    elif STORAGE.get_proxy(MANUAL_PARTITIONING).Enabled:
        task = ManualPartitioningTask(storage)
    else:
        task = CustomPartitioningTask(storage, data)

    task.run()
Exemple #7
0
    def __init__(self, data, storage, payload, partitioning):
        super().__init__(data, storage, payload)
        self.title = N_("Partition Scheme Options")
        self._container = None
        self._part_schemes = OrderedDict()
        self._partitioning = partitioning
        self._request = PartitioningRequest.from_structure(
            self._partitioning.Request)

        supported_choices = get_supported_autopart_choices()

        if supported_choices:
            # Fallback value (eg when default is not supported)
            self._selected_scheme_value = supported_choices[0][1]

        selected_choice = self._request.partitioning_scheme

        for item in supported_choices:
            self._part_schemes[item[0]] = item[1]
            if item[1] == selected_choice:
                self._selected_scheme_value = item[1]