From 11dbf06034f694d1d036f0f7d73027d3e52c422f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Sl=C3=A1vik?= Date: Thu, 3 Aug 2023 17:02:42 +0200 Subject: [PATCH] Remove unused patches for ARM kernel UI These features are now removed in code. --- ...option-for-installing-64k-ARM-kernel.patch | 627 ------------------ ...-for-installing-non-standard-kernels.patch | 176 ----- 2 files changed, 803 deletions(-) delete mode 100644 0001-Revert-Add-GUI-option-for-installing-64k-ARM-kernel.patch delete mode 100644 0002-Revert-Add-TUI-for-installing-non-standard-kernels.patch diff --git a/0001-Revert-Add-GUI-option-for-installing-64k-ARM-kernel.patch b/0001-Revert-Add-GUI-option-for-installing-64k-ARM-kernel.patch deleted file mode 100644 index 890ba7b..0000000 --- a/0001-Revert-Add-GUI-option-for-installing-64k-ARM-kernel.patch +++ /dev/null @@ -1,627 +0,0 @@ -From 3962cd5f7e6fc64306d6c4e173b5542d215d234a Mon Sep 17 00:00:00 2001 -From: Adam Williamson -Date: Wed, 26 Jul 2023 10:19:25 -0700 -Subject: [PATCH] Revert "Add GUI option for installing 64k ARM kernel" - -This reverts commit 0c7c9e9586d962c9babf0d718e38768c8bb34b85. -It's broken - it tries to use the `match_available_packages` -method of a `DNFPayload` instance, but that method is part of -`DNFManager`, not `DNFPayload`. See -https://github.com/rhinstaller/anaconda/pull/4858#issuecomment-1652180161 . - -We are reverting this downstream (in Fedora) to fix composes -while upstream comes up with a proper fix. ---- - data/anaconda.conf | 3 - - data/profile.d/rhel.conf | 1 - - pyanaconda/core/configuration/ui.py | 4 - - .../ui/gui/spokes/software_selection.glade | 224 +++++------------- - .../ui/gui/spokes/software_selection.py | 62 ----- - pyanaconda/ui/lib/software.py | 43 +--- - .../pyanaconda_tests/ui/test_software.py | 34 +-- - 7 files changed, 64 insertions(+), 307 deletions(-) - -diff --git a/data/anaconda.conf b/data/anaconda.conf -index 73e6e21e55..34d2d26802 100644 ---- a/data/anaconda.conf -+++ b/data/anaconda.conf -@@ -302,9 +302,6 @@ password_policies = - user (quality 1, length 6, empty) - luks (quality 1, length 6) - --# Should kernel options be shown in the software selection spoke? --show_kernel_options = True -- - [License] - # A path to EULA (if any) - # -diff --git a/data/profile.d/rhel.conf b/data/profile.d/rhel.conf -index 468a05f78c..0a645fd0ca 100644 ---- a/data/profile.d/rhel.conf -+++ b/data/profile.d/rhel.conf -@@ -39,7 +39,6 @@ swap_is_recommended = True - [User Interface] - help_directory = /usr/share/anaconda/help/rhel - custom_stylesheet = /usr/share/anaconda/pixmaps/redhat.css --show_kernel_options = True - - [License] - eula = /usr/share/redhat-release/EULA -diff --git a/pyanaconda/core/configuration/ui.py b/pyanaconda/core/configuration/ui.py -index 57cb232c7c..e4432f68f8 100644 ---- a/pyanaconda/core/configuration/ui.py -+++ b/pyanaconda/core/configuration/ui.py -@@ -90,10 +90,6 @@ class UserInterfaceSection(Section): - """Convert a policies string into a list of dictionaries.""" - return list(map(self._convert_policy_line, value.strip().split("\n"))) - -- @property -- def show_kernel_options(self): -- return self._get_option("show_kernel_options", bool) -- - @classmethod - def _convert_policy_line(cls, line): - """Convert a policy line into a dictionary.""" -diff --git a/pyanaconda/ui/gui/spokes/software_selection.glade b/pyanaconda/ui/gui/spokes/software_selection.glade -index 4cb67f2769..87804c72ea 100644 ---- a/pyanaconda/ui/gui/spokes/software_selection.glade -+++ b/pyanaconda/ui/gui/spokes/software_selection.glade -@@ -1,28 +1,27 @@ - -- -+ - - - - -- False -+ False - True - True -- SOFTWARE SELECTION -+ SOFTWARE SELECTION - - - - -- False -+ False - True - True - vertical - - -- False -+ False - -- - -- False -+ False - - - -@@ -34,36 +33,55 @@ - - - -- False -+ False - True - True - 0 - 0 -- 12 -- 48 -- 24 -- 24 -+ 12 -+ 48 -+ 24 -+ 24 - - -- False -+ False - True - True - vertical - -- - - True -- False -+ False - True - True -- 24 -- True -+ 24 -+ True -+ -+ -+ True -+ False -+ end -+ 6 -+ True -+ Base Environment -+ True -+ 0 -+ -+ -+ -+ -+ -+ -+ 0 -+ 0 -+ -+ - - - True -- False -+ False - end -- 6 -+ 6 - True - Additional software for Selected Environment - True -@@ -74,27 +92,27 @@ - - - -- 1 -- 0 -+ 1 -+ 0 - - - - - True -- True -+ True - True - True -- never -- in -+ never -+ in - - -- 250 -+ 250 - True -- False -+ False - - - True -- False -+ False - True - - -@@ -103,160 +121,40 @@ - - - -- 1 -- 1 -+ 1 -+ 1 - - - -- -+ - True -- False -- end -- 6 -+ True -+ GDK_STRUCTURE_MASK | GDK_SCROLL_MASK - True -- Base Environment -- True -- 0 -- -- -- -- -- -- -- 0 -- 0 -- -- -- -- -- True -- False -- vertical -- -- -- True -- True -- GDK_STRUCTURE_MASK | GDK_SCROLL_MASK -- True -- True -- never -- in -- -- -- 250 -- True -- False -- -- -- True -- False -- True -- -- -- -- -- -- -- -- False -- True -- 0 -- -- -+ True -+ never -+ in - -- -+ -+ 250 - True -- False -- vertical -- 12 -+ False - -- -+ - True -- False -- end -- 12 -+ False - True -- Kernel Options -- True -- 0 -- -- -- -- -- -- -- False -- True -- 0 -- -- -- -- -- -- True -- False -- 12 -- -- -- True -- False -- start -- 12 -- True -- Page size: -- -- -- 0 -- 0 -- -- -- -- -- True -- False -- True -- 0 -- 0 -- -- -- -- 1 -- 1 -- 1 -- -- -- -- -- 1 -- 0 -- -- -+ - -- -- False -- False -- 3 -- - - -- -- False -- False -- 1 -- - - - -- 0 -- 1 -+ 0 -+ 1 - - -- -- -- -- -- -- - - - True -diff --git a/pyanaconda/ui/gui/spokes/software_selection.py b/pyanaconda/ui/gui/spokes/software_selection.py -index 1736b0b4b0..151e0e0b9f 100644 ---- a/pyanaconda/ui/gui/spokes/software_selection.py -+++ b/pyanaconda/ui/gui/spokes/software_selection.py -@@ -32,13 +32,9 @@ from pyanaconda.ui.gui.spokes import NormalSpoke - from pyanaconda.ui.gui.spokes.lib.detailederror import DetailedErrorDialog - from pyanaconda.ui.gui.spokes.lib.software_selection import GroupListBoxRow, SeparatorRow, \ - EnvironmentListBoxRow --from pyanaconda.ui.gui.utils import escape_markup - from pyanaconda.ui.lib.software import SoftwareSelectionCache, get_software_selection_status, \ - is_software_selection_complete, get_group_data, get_environment_data - from pyanaconda.ui.lib.subscription import is_cdn_registration_required --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.configuration.anaconda import conf - - import gi - gi.require_version("Gtk", "3.0") -@@ -98,23 +94,6 @@ class SoftwareSelectionSpoke(NormalSpoke): - Gtk.Scrollable.get_vadjustment(addon_viewport) - ) - -- # Display a group of options for selecting desired properties of a kernel -- self._kernel_box = self.builder.get_object("kernelBox") -- self._combo_kernel_page_size = self.builder.get_object("kernelPageSizeCombo") -- self._label_kernel_page_size = self.builder.get_object("kernelPageSizeLabel") -- -- # Normally I would create these in the .glade file but due to a bug they weren't -- # created properly -- self._model_kernel_page_size = Gtk.ListStore(str, str) -- -- kernel_labels = get_kernel_titles_and_descriptions() -- for i in ["4k", "64k"]: -- self._model_kernel_page_size.append([i, "%s\n%s" % \ -- (escape_markup(kernel_labels[i][0]), -- escape_markup(kernel_labels[i][1]))]) -- self._combo_kernel_page_size.set_model(self._model_kernel_page_size) -- self._available_kernels = get_available_kernel_features(self.payload) -- - @property - def _selection(self): - """The packages selection.""" -@@ -235,12 +214,10 @@ class SoftwareSelectionSpoke(NormalSpoke): - # Create a new software selection cache. - self._selection_cache = SoftwareSelectionCache(self.payload.proxy) - self._selection_cache.apply_selection_data(self._selection) -- self._available_kernels = get_available_kernel_features(self.payload) - - # Refresh up the UI. - self._refresh_environments() - self._refresh_groups() -- self._refresh_kernel_features() - - # Set up the info bar. - self.clear_info() -@@ -314,35 +291,6 @@ class SoftwareSelectionSpoke(NormalSpoke): - listbox.remove(child) - del child - -- def _refresh_kernel_features(self): -- """Display options for selecting kernel features.""" -- -- # Only showing parts of kernel box relevant for current system. -- self._available_kernels = get_available_kernel_features(self.payload) -- -- if not conf.ui.show_kernel_options: -- show_kernels = False -- else: -- show_kernels = False -- for (_key, val) in self._available_kernels.items(): -- if val: -- show_kernels = True -- break -- -- if show_kernels: -- self._kernel_box.set_visible(True) -- self._kernel_box.set_no_show_all(False) -- -- # Arm 64k page size kernel combo -- self._combo_kernel_page_size.set_visible(self._available_kernels[FEATURE_64K]) -- self._combo_kernel_page_size.set_no_show_all(not self._available_kernels[FEATURE_64K]) -- self._label_kernel_page_size.set_visible(self._available_kernels[FEATURE_64K]) -- self._label_kernel_page_size.set_no_show_all(not self._available_kernels[FEATURE_64K]) -- else: -- # Hide the entire box. -- self._kernel_box.set_visible(False) -- self._kernel_box.set_no_show_all(True) -- - def apply(self): - """Apply the changes.""" - self._kickstarted = False -@@ -350,16 +298,6 @@ class SoftwareSelectionSpoke(NormalSpoke): - selection = self._selection_cache.get_selection_data() - log.debug("Setting new software selection: %s", selection) - -- # Select kernel -- property_64k = self._available_kernels[FEATURE_64K] and \ -- self._combo_kernel_page_size.get_active_id() == FEATURE_64K -- kernel_properties = KernelFeatures(property_64k) -- kernel = get_kernel_from_properties(kernel_properties) -- if kernel is not None and conf.ui.show_kernel_options: -- log.debug("Selected kernel package: %s", kernel) -- selection.packages.append(kernel) -- selection.excluded_packages.append("kernel") -- - self.payload.set_packages_selection(selection) - - hubQ.send_not_ready(self.__class__.__name__) -diff --git a/pyanaconda/ui/lib/software.py b/pyanaconda/ui/lib/software.py -index 3eebc024df..747ac8367b 100644 ---- a/pyanaconda/ui/lib/software.py -+++ b/pyanaconda/ui/lib/software.py -@@ -1,5 +1,5 @@ - # --# Copyright (C) 2023 Red Hat, Inc. -+# Copyright (C) 2021 Red Hat, Inc. - # - # This copyrighted material is made available to anyone wishing to use, - # modify, copy, or redistribute it subject to the terms and conditions of -@@ -15,9 +15,6 @@ - # License and may only be used or replicated with the express permission of - # Red Hat, Inc. - # --from collections import namedtuple --from blivet.arch import is_aarch64 -- - from pyanaconda.anaconda_loggers import get_module_logger - from pyanaconda.core.i18n import _ - from pyanaconda.modules.common.structures.comps import CompsEnvironmentData, CompsGroupData -@@ -25,9 +22,6 @@ from pyanaconda.modules.common.structures.packages import PackagesSelectionData - - log = get_module_logger(__name__) - --FEATURE_64K = "64k" --KernelFeatures = namedtuple("KernelFeatures", ["page_size_64k"]) -- - - def get_environment_data(dnf_proxy, environment_name): - """Get the environment data. -@@ -102,41 +96,6 @@ def get_software_selection_status(dnf_proxy, selection, kickstarted=False): - return environment_data.name - - --def get_available_kernel_features(payload): -- """Returns a dictionary with that shows which kernels should be shown in the UI. -- """ -- features = { -- FEATURE_64K: is_aarch64() and any(payload.match_available_packages("kernel-64k")) -- } -- -- return features -- -- --def get_kernel_titles_and_descriptions(): -- """Returns a dictionary with descriptions and titles for different kernel options. -- """ -- kernel_features = { -- "4k": (_("4k"), _("More efficient memory usage in smaller environments")), -- "64k": (_("64k"), _("System performance gains for memory-intensive workloads")), -- } -- -- return kernel_features -- -- --def get_kernel_from_properties(features): -- """Translates the selection of required properties into a kernel package name and returns it -- or returns None if no properties were selected. -- """ -- kernels = { -- # ARM 64k Package Name -- ( False ): None, -- ( True ): "kernel-64k", -- } -- -- kernel_package = kernels[features[0]] -- return kernel_package -- -- - class SoftwareSelectionCache(object): - """The cache of the user software selection. - -diff --git a/tests/unit_tests/pyanaconda_tests/ui/test_software.py b/tests/unit_tests/pyanaconda_tests/ui/test_software.py -index c9397e15fb..f5ced5d9c1 100644 ---- a/tests/unit_tests/pyanaconda_tests/ui/test_software.py -+++ b/tests/unit_tests/pyanaconda_tests/ui/test_software.py -@@ -16,7 +16,6 @@ - # Red Hat, Inc. - # - import unittest --from unittest.mock import patch - from unittest.mock import Mock - - from dasbus.structure import compare_data -@@ -26,8 +25,8 @@ from pyanaconda.modules.common.structures.packages import PackagesSelectionData - from pyanaconda.modules.payloads.payload.dnf.dnf import DNFModule - from pyanaconda.modules.payloads.payload.dnf.dnf_manager import DNFManager - from pyanaconda.ui.lib.software import is_software_selection_complete, \ -- get_software_selection_status, SoftwareSelectionCache, get_kernel_from_properties, \ -- get_available_kernel_features, KernelFeatures -+ get_software_selection_status, SoftwareSelectionCache -+ - - def get_dnf_proxy(dnf_manager): - """Create a DNF payload proxy using the specified DNF manager.""" -@@ -96,35 +95,6 @@ class SoftwareSelectionUITestCase(unittest.TestCase): - status = get_software_selection_status(self.dnf_proxy, selection, kickstarted=True) - assert status == "Custom software selected" - -- def test_get_kernel_from_properties(self): -- """Test if kernel features are translated to corrent package names.""" -- assert get_kernel_from_properties( -- KernelFeatures(page_size_64k=False)) is None -- assert get_kernel_from_properties( -- KernelFeatures(page_size_64k=True)) == "kernel-64k" -- -- @patch("pyanaconda.ui.lib.software.is_aarch64") -- def test_get_available_kernel_features(self, is_aarch64): -- """test availability of kernel packages""" -- payload = Mock() -- payload.match_available_packages.return_value = ["ntoskrnl"] -- is_aarch64.return_value = False -- -- res = get_available_kernel_features(payload) -- assert isinstance(res, dict) -- assert len(res) > 0 -- assert not res["64k"] -- is_aarch64.assert_called_once() -- -- is_aarch64.return_value = True -- assert is_aarch64() -- res = get_available_kernel_features(payload) -- assert res["64k"] -- -- payload.match_available_packages.return_value = [] -- res = get_available_kernel_features(payload) -- assert not res["64k"] -- - - class SoftwareSelectionCacheTestCase(unittest.TestCase): - """Test the cache for the Software Selection spoke.""" --- -2.41.0 - diff --git a/0002-Revert-Add-TUI-for-installing-non-standard-kernels.patch b/0002-Revert-Add-TUI-for-installing-non-standard-kernels.patch deleted file mode 100644 index 3184aff..0000000 --- a/0002-Revert-Add-TUI-for-installing-non-standard-kernels.patch +++ /dev/null @@ -1,176 +0,0 @@ -From 09fbc13b2b2f4d46ac2e4735576670e40b4605b4 Mon Sep 17 00:00:00 2001 -From: Adam Williamson -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 -