diff --git a/0013-kernel-install-extra-groups-for-kernel.patch b/0013-kernel-install-extra-groups-for-kernel.patch new file mode 100644 index 0000000000000000000000000000000000000000..8b92c7c0d6fef0ab2c5e17f9f39f944a80b2b908 --- /dev/null +++ b/0013-kernel-install-extra-groups-for-kernel.patch @@ -0,0 +1,188 @@ +From 7886a0a1962c3e9db050ac956e7c781c31670b6e Mon Sep 17 00:00:00 2001 +From: Liwei Ge +Date: Wed, 21 Dec 2022 22:49:28 +0800 +Subject: [PATCH] kernel: install extra groups for kernel + +--- + pyanaconda/payload/dnf/payload.py | 21 ++++++++++++++++++- + pyanaconda/ui/gui/spokes/kernel_selection.py | 18 +++++++++++++--- + .../ui/gui/spokes/software_selection.py | 2 +- + pyanaconda/ui/tui/spokes/kernel_selection.py | 16 ++++++++++++-- + .../ui/tui/spokes/software_selection.py | 2 +- + 5 files changed, 51 insertions(+), 8 deletions(-) + +diff --git a/pyanaconda/payload/dnf/payload.py b/pyanaconda/payload/dnf/payload.py +index 4e0f0f2..af6f1e2 100644 +--- a/pyanaconda/payload/dnf/payload.py ++++ b/pyanaconda/payload/dnf/payload.py +@@ -133,6 +133,7 @@ class DNFPayload(Payload): + self._repoMD_list = [] + + self._available_kernels = OrderedDict() ++ self._available_groups = OrderedDict() + self._current_kernel = None + + self._req_groups = set() +@@ -799,7 +800,8 @@ class DNFPayload(Payload): + + def detectMultiKernel(self): + kernel_patterns=["kernel", "kernel-tools", "python3-perf", "kernel-headers", "kernel-devel", "bpftool", "perf"] +- self._available_kernels = {} ++ self._available_kernels.clear() ++ self._available_groups.clear() + + if not self._base.sack: + ret_msg = "Query is not ready yet" +@@ -818,6 +820,19 @@ class DNFPayload(Payload): + continue + kernel_key = "%s" % (pkg.version) + kernel_sub_key = "%s" % (pkg.release) ++ ++ if pkg.name == 'kernel': ++ for kernel_group in self.groups: ++ if re.search("-%s-%s$" % (kernel_key, kernel_sub_key), kernel_group): ++ if kernel_key in self._available_groups: ++ if kernel_sub_key in self._available_groups[kernel_key]: ++ self._available_groups[kernel_key][kernel_sub_key].append(kernel_group) ++ else: ++ self._available_groups[kernel_key][kernel_sub_key] = [ kernel_group ] ++ else: ++ self._available_groups[kernel_key] = OrderedDict() ++ self._available_groups[kernel_key][kernel_sub_key] = [ kernel_group ] ++ + if kernel_key in self._available_kernels: + if kernel_sub_key in self._available_kernels[kernel_key]: + self._available_kernels[kernel_key][kernel_sub_key].append("%s-%s" % (pkg.name, pkg.version)) +@@ -832,6 +847,10 @@ class DNFPayload(Payload): + def available_kernels(self): + return self._available_kernels + ++ @property ++ def available_groups(self): ++ return self._available_groups ++ + @property + def current_kernel(self): + return self._current_kernel +diff --git a/pyanaconda/ui/gui/spokes/kernel_selection.py b/pyanaconda/ui/gui/spokes/kernel_selection.py +index 4756c3b..a2c6806 100644 +--- a/pyanaconda/ui/gui/spokes/kernel_selection.py ++++ b/pyanaconda/ui/gui/spokes/kernel_selection.py +@@ -87,6 +87,10 @@ class KernelSelectionSpoke(NormalSpoke): + def available_kernels(self): + return self.payload.available_kernels + ++ @property ++ def available_groups(self): ++ return self.payload.available_groups ++ + @property + def current_kernel(self): + return self.payload.current_kernel +@@ -117,16 +121,24 @@ class KernelSelectionSpoke(NormalSpoke): + kernel_sub_keys = list(self.available_kernels[kernel].keys()) + if kernel == self.current_kernel: + include_kernel = self.available_kernels[kernel][kernel_sub_keys[-1]] +- self.payload.data.packages.packageList.extend(include_kernel) + for package in include_kernel: ++ if package not in self.payload.data.packages.packageList: ++ self.payload.data.packages.packageList.append(package) + if package in self.payload.data.packages.excludedList: + self.payload.data.packages.excludedList.remove(package) ++ if kernel in self.available_groups.keys(): ++ for group in self.available_groups[kernel][kernel_sub_keys[-1]]: ++ self.payload.select_group(group) + else: + exclude_kernel = self.available_kernels[kernel][kernel_sub_keys[-1]] +- self.payload.data.packages.excludedList.extend(exclude_kernel) + for package in exclude_kernel: ++ if package not in self.payload.data.packages.excludedList: ++ self.payload.data.packages.excludedList.append(package) + if package in self.payload.data.packages.packageList: + self.payload.data.packages.packageList.remove(package) ++ if kernel in self.available_groups.keys(): ++ for group in self.available_groups[kernel][kernel_sub_keys[-1]]: ++ self.payload.deselect_group(group) + + # store kernel selection + self._orig_kernel = self.current_kernel +@@ -225,7 +237,7 @@ class KernelSelectionSpoke(NormalSpoke): + threadMgr.wait(constants.THREAD_PAYLOAD) + + self._error_msgs = self.payload.detectMultiKernel() +- if not self._error_msgs: ++ if not self._error_msgs and not self.current_kernel: + # use latest kernel as default, normally it's anck + self.current_kernel = list(self.available_kernels.keys())[-1] + +diff --git a/pyanaconda/ui/gui/spokes/software_selection.py b/pyanaconda/ui/gui/spokes/software_selection.py +index afcb462..d694641 100644 +--- a/pyanaconda/ui/gui/spokes/software_selection.py ++++ b/pyanaconda/ui/gui/spokes/software_selection.py +@@ -202,7 +202,7 @@ class SoftwareSelectionSpoke(NormalSpoke): + if not self._kickstarted and set(addons) != set(self._orig_addons): + self._select_flag = False + #self.payload.data.packages.packageList = [] +- self.payload.data.packages.groupList = [] ++ #self.payload.data.packages.groupList = [] + self.payload.select_environment(self.environment) + log.debug("Environment selected for installation: %s", self.environment) + log.debug("Groups selected for installation: %s", addons) +diff --git a/pyanaconda/ui/tui/spokes/kernel_selection.py b/pyanaconda/ui/tui/spokes/kernel_selection.py +index 9d024f3..3d850f6 100644 +--- a/pyanaconda/ui/tui/spokes/kernel_selection.py ++++ b/pyanaconda/ui/tui/spokes/kernel_selection.py +@@ -179,6 +179,10 @@ class KernelSpoke(NormalTUISpoke): + def available_kernels(self): + return self.payload.available_kernels + ++ @property ++ def available_groups(self): ++ return self.payload.available_groups ++ + @property + def current_kernel(self): + return self.payload.current_kernel +@@ -207,16 +211,24 @@ class KernelSpoke(NormalTUISpoke): + kernel_sub_keys = list(self.available_kernels[kernel].keys()) + if kernel == self.current_kernel: + include_kernel = self.available_kernels[kernel][kernel_sub_keys[-1]] +- self.payload.data.packages.packageList.extend(include_kernel) + for package in include_kernel: ++ if package not in self.payload.data.packages.packageList: ++ self.payload.data.packages.packageList.append(package) + if package in self.payload.data.packages.excludedList: + self.payload.data.packages.excludedList.remove(package) ++ if kernel in self.available_groups.keys(): ++ for group in self.available_groups[kernel][kernel_sub_keys[-1]]: ++ self.payload.select_group(group) + else: + exclude_kernel = self.available_kernels[kernel][kernel_sub_keys[-1]] +- self.payload.data.packages.excludedList.extend(exclude_kernel) + for package in exclude_kernel: ++ if package not in self.payload.data.packages.excludedList: ++ self.payload.data.packages.excludedList.append(package) + if package in self.payload.data.packages.packageList: + self.payload.data.packages.packageList.remove(package) ++ if kernel in self.available_groups.keys(): ++ for group in self.available_groups[kernel][kernel_sub_keys[-1]]: ++ self.payload.deselect_group(group) + + # store kernel selection + self._orig_kernel = self.current_kernel +diff --git a/pyanaconda/ui/tui/spokes/software_selection.py b/pyanaconda/ui/tui/spokes/software_selection.py +index 19a9513..abf499a 100644 +--- a/pyanaconda/ui/tui/spokes/software_selection.py ++++ b/pyanaconda/ui/tui/spokes/software_selection.py +@@ -313,7 +313,7 @@ class SoftwareSpoke(NormalTUISpoke): + self._orig_env, self.environment, self.addons) + + #self.payload.data.packages.packageList = [] +- self.data.packages.groupList = [] ++ #self.data.packages.groupList = [] + self.payload.select_environment(self.environment) + + environment_id = self._translate_env_name_to_id(self.environment) +-- +2.39.3 + diff --git a/anaconda.spec b/anaconda.spec index 32dbb0320e8413a50ad14dbba45e74fd7e6e488e..8fdcbbac6a6731b3af92b59b949c41cda9f6d263 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 Summary: Graphical system installer Name: anaconda Version: 33.16.9.4 @@ -28,6 +28,7 @@ Patch0011: 0010-update-kernel-description.patch Patch0012: 0011-Set-the-default-timezone-to-Beijing.patch Patch0013: 0012-Fix-SECTION-headers-in-docstrings.patch Patch0014: 0001-anaconda-fix-multi-variants-error.patch +Patch0015: 0013-kernel-install-extra-groups-for-kernel.patch # End of Anolis patches # Versions of required components (done so we make sure the buildrequires @@ -381,6 +382,9 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{buildroot}%{_d %{_prefix}/libexec/anaconda/dd_* %changelog +* Wed Jan 31 2024 - 33.16.9.4-1.0.2 +- Install extra groups for kernel + * Tue Dec 19 2023 Liwei Ge - 33.16.9.4-1.0.1 - Rebrand to Anolis - Remove subscription and CDN