anaconda/0002-Revert-Add-TUI-for-installing-non-standard-kernels.patch

177 lines
7.3 KiB
Diff
Raw Normal View History

From 09fbc13b2b2f4d46ac2e4735576670e40b4605b4 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Wed, 26 Jul 2023 12:35:33 -0700
Subject: [PATCH 2/2] Revert "Add TUI for installing non-standard kernels"
This reverts commit 4e18d26509976ce62e7922e8fb32201900166b14.
This needs reverting for the same reason as the other one.
---
.../ui/tui/spokes/software_selection.py | 99 +------------------
1 file changed, 4 insertions(+), 95 deletions(-)
diff --git a/pyanaconda/ui/tui/spokes/software_selection.py b/pyanaconda/ui/tui/spokes/software_selection.py
index a2baf47823..42fb77aaa6 100644
--- a/pyanaconda/ui/tui/spokes/software_selection.py
+++ b/pyanaconda/ui/tui/spokes/software_selection.py
@@ -23,12 +23,9 @@ from pyanaconda.ui.lib.software import get_software_selection_status, \
is_software_selection_complete, SoftwareSelectionCache, get_group_data, get_environment_data
from pyanaconda.ui.tui.spokes import NormalTUISpoke
from pyanaconda.core.threads import thread_manager
-from pyanaconda.ui.lib.software import FEATURE_64K, KernelFeatures, \
- get_kernel_from_properties, get_available_kernel_features, get_kernel_titles_and_descriptions
from pyanaconda.core.i18n import N_, _
from pyanaconda.core.constants import THREAD_PAYLOAD, THREAD_CHECK_SOFTWARE, \
THREAD_SOFTWARE_WATCHER, PAYLOAD_TYPE_DNF
-from pyanaconda.core.configuration.anaconda import conf
from simpleline.render.containers import ListColumnContainer
from simpleline.render.prompt import Prompt
@@ -72,8 +69,6 @@ class SoftwareSpoke(NormalTUISpoke):
# Get the packages configuration.
self._selection_cache = SoftwareSelectionCache(self.payload.proxy)
- self._kernel_selection = None
- self._available_kernels = None
# Are we taking values (package list) from a kickstart file?
self._kickstarted = flags.automatedInstall and self.payload.proxy.PackagesKickstarted
@@ -97,9 +92,6 @@ class SoftwareSpoke(NormalTUISpoke):
"""Initialize the spoke in a separate thread."""
thread_manager.wait(THREAD_PAYLOAD)
- self._available_kernels = get_available_kernel_features(self.payload)
- self._kernel_selection = dict.fromkeys(self._available_kernels, False)
-
# Initialize and check the software selection.
self._initialize_selection()
@@ -260,8 +252,7 @@ class SoftwareSpoke(NormalTUISpoke):
self.data,
self.storage,
self.payload,
- self._selection_cache,
- self._kernel_selection
+ self._selection_cache
)
ScreenHandler.push_screen_modal(spoke)
self.apply()
@@ -278,19 +269,6 @@ class SoftwareSpoke(NormalTUISpoke):
selection = self._selection_cache.get_selection_data()
log.debug("Setting new software selection: %s", selection)
- # Processing chosen kernel
- if conf.ui.show_kernel_options:
- self._available_kernels = get_available_kernel_features(self.payload)
- feature_64k = self._available_kernels[FEATURE_64K] and \
- self._kernel_selection[FEATURE_64K]
- features = KernelFeatures(feature_64k)
- kernel = get_kernel_from_properties(features)
- if kernel:
- log.debug("Selected kernel package: %s", kernel)
- selection.packages.append(kernel)
- selection.excluded_packages.append("kernel")
-
- log.debug("Setting new software selection: %s", self._selection)
self.payload.set_packages_selection(selection)
def execute(self):
@@ -319,12 +297,11 @@ class AdditionalSoftwareSpoke(NormalTUISpoke):
"""The spoke for choosing the additional software."""
category = SoftwareCategory
- def __init__(self, data, storage, payload, selection_cache, kernel_selection):
+ def __init__(self, data, storage, payload, selection_cache):
super().__init__(data, storage, payload)
self.title = N_("Software selection")
self._container = None
self._selection_cache = selection_cache
- self._kernel_selection = kernel_selection
def refresh(self, args=None):
"""Refresh the screen."""
@@ -365,79 +342,11 @@ class AdditionalSoftwareSpoke(NormalTUISpoke):
else:
self._selection_cache.deselect_group(group)
- def _show_kernel_features_screen(self, kernels):
- """Returns True if at least one non-standard kernel is available.
- """
- if not conf.ui.show_kernel_options:
- return False
- for val in kernels.values():
- if val:
- return True
- return False
-
- def input(self, args, key):
- if self._container.process_user_input(key):
- return InputState.PROCESSED_AND_REDRAW
- if key.lower() == Prompt.CONTINUE:
- available_kernels = get_available_kernel_features(self.payload)
- if self._show_kernel_features_screen(available_kernels):
- spoke = KernelSelectionSpoke(self.data, self.storage, self.payload,
- self._selection_cache, self._kernel_selection,
- available_kernels)
- ScreenHandler.push_screen_modal(spoke)
- self.execute()
- self.close()
- return InputState.PROCESSED
-
- return super().input(args, key)
-
- def apply(self):
- pass
-
-class KernelSelectionSpoke(NormalTUISpoke):
- """A subspoke for selecting kernel features.
- """
- def __init__(self, data, storage, payload, selection_cache, _kernel_selection, available_kernels):
- super().__init__(data, storage, payload)
- self.title = N_("Kernel Options")
- self._container = None
- self._selection_cache = selection_cache
- self._kernel_selection = _kernel_selection
- self._available_kernels = available_kernels
-
- def refresh(self, args=None):
- NormalTUISpoke.refresh(self)
-
- # Retrieving translated UI strings
- labels = get_kernel_titles_and_descriptions()
-
- # Updating kernel availability
- self._available_kernels = get_available_kernel_features(self.payload)
- self._container = ListColumnContainer(2, columns_width=38, spacing=2)
-
- # Rendering kernel checkboxes
- for (name, val) in self._kernel_selection.items():
- if not self._available_kernels[name]:
- continue
- (title, text) = labels[name]
- widget = CheckboxWidget(title="%s" % title, text="%s" % text, completed=val)
- self._container.add(widget, callback=self._set_kernel_callback, data=name)
-
- self.window.add_with_separator(TextWidget(_("Kernel options")))
- self.window.add_with_separator(self._container)
-
- def _set_kernel_callback(self, data):
- self._kernel_selection[data] = not self._kernel_selection[data]
-
def input(self, args, key):
if self._container.process_user_input(key):
return InputState.PROCESSED_AND_REDRAW
-
- if key.lower() == Prompt.CONTINUE:
- self.close()
- return InputState.PROCESSED
-
- return super().input(args, key)
+ else:
+ return super().input(args, key)
def apply(self):
pass
--
2.41.0