1 Star 0 Fork 23

庞庆/anaconda_2

forked from src-anolis-os/anaconda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0009-anaconda-anolis-support-boot.iso.patch 2.94 KB
一键复制 编辑 原始数据 按行查看 历史
From 091ac4c4b5420227f6cc8171bf086c6791b623fc Mon Sep 17 00:00:00 2001
From: pangqing <pangqing@uniontech.com>
Date: Tue, 10 Aug 2021 09:59:06 +0800
Subject: [PATCH] anaconda anolis support boot.iso
---
pyanaconda/payload/dnf/payload.py | 1 +
pyanaconda/ui/gui/spokes/kernel_selection.py | 19 ++++++++++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/payload/dnf/payload.py b/pyanaconda/payload/dnf/payload.py
index 1f9fd6a..dc00d41 100644
--- a/pyanaconda/payload/dnf/payload.py
+++ b/pyanaconda/payload/dnf/payload.py
@@ -780,6 +780,7 @@ class DNFPayload(Payload):
def detectMultiKernel(self):
kernel_patterns=["kernel", "kernel-tools", "python3-perf", "kernel-headers", "kernel-devel", "bpftool", "perf"]
+ # Get exception, when repo's format is wrong (eg. wrong repo url by inst.addrepo or inst.repo)
ypl = self._base._do_package_lists("available", kernel_patterns, True)
for pkg in ypl.available:
if pkg.version in self._available_kernels:
diff --git a/pyanaconda/ui/gui/spokes/kernel_selection.py b/pyanaconda/ui/gui/spokes/kernel_selection.py
index d8f092c..de9b496 100644
--- a/pyanaconda/ui/gui/spokes/kernel_selection.py
+++ b/pyanaconda/ui/gui/spokes/kernel_selection.py
@@ -119,7 +119,10 @@ class KernelSelectionSpoke(NormalSpoke):
# use first kernel as default, normally it's rhck
if not self.current_kernel:
- self.current_kernel = list(self.available_kernels.keys())[0]
+ # Check if self.available_kernels is empty
+ # When there are no RPMs repo in DVD iso, and net repo is not set, the available_kernels will be empty.
+ if len(self.available_kernels) > 0:
+ self.current_kernel = list(self.available_kernels.keys())[0]
hubQ.send_ready(self.__class__.__name__, False)
self._apply()
@@ -186,6 +189,20 @@ class KernelSelectionSpoke(NormalSpoke):
threadMgr.wait(constants.THREAD_PAYLOAD)
self._clear_listbox(self._kernelListBox)
+ # Obtain available_kernels by payload, after refresh the RPMs repo by 'Installation Source' manually.
+ log.info('To trigger payload.detectMultiKernel')
+ self.payload.detectMultiKernel()
+ # use first kernel as default, normally it's rhck
+ if not self.current_kernel:
+ # Check if self.available_kernels is empty
+ # When there are no RPMs repo in DVD iso, and net repo is not set, the available_kernels will be empty.
+ if len(self.available_kernels) > 0:
+ log.info('len of available_kernels: %d', len(self.available_kernels))
+ self.current_kernel = list(self.available_kernels.keys())[0]
+
+ hubQ.send_ready(self.__class__.__name__, False)
+ self._apply()
+
kernel_keys = self.available_kernels.keys()
for kernel in kernel_keys:
radio = Gtk.RadioButton(group=self._fakeRadio)
--
2.18.4
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pang-qing/anaconda_2.git
git@gitee.com:pang-qing/anaconda_2.git
pang-qing
anaconda_2
anaconda_2
a8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385