1 Star 0 Fork 107

yanan-rock/anaconda

forked from src-openEuler/anaconda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bugfix-network-fix-configuration-of-virtual-devices-by-boot.patch 2.81 KB
一键复制 编辑 原始数据 按行查看 历史
xuxiaolong 提交于 2021-04-02 10:25 . sync 49 fixbug from github
From 787daf49b358fbe2d514012a708c28575fc8122b Mon Sep 17 00:00:00 2001
From: Radek Vykydal <[email protected]>
Date: Wed, 1 Jul 2020 11:25:37 +0200
Subject: [PATCH] network: fix configuration of virtual devices by boot options
The configuration was not passed to installed system via ifcfg files.
Resolves: rhbz#1851218
---
pyanaconda/modules/network/initialization.py | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/modules/network/initialization.py b/pyanaconda/modules/network/initialization.py
index de1ec851b..5e33d0494 100644
--- a/pyanaconda/modules/network/initialization.py
+++ b/pyanaconda/modules/network/initialization.py
@@ -26,7 +26,8 @@ from pyanaconda.modules.network.nm_client import get_device_name_from_network_da
update_connection_values, commit_changes_with_autoconnection_blocked, is_ibft_connection
from pyanaconda.modules.network.ifcfg import get_ifcfg_file_of_device, find_ifcfg_uuid_of_device, \
get_master_slaves_from_ifcfgs
-from pyanaconda.modules.network.device_configuration import supported_wired_device_types
+from pyanaconda.modules.network.device_configuration import supported_wired_device_types, \
+ virtual_device_types
from pyanaconda.modules.network.utils import guard_by_system_configuration
log = get_module_logger(__name__)
@@ -431,8 +432,9 @@ class DumpMissingIfcfgFilesTask(Task):
log.debug("%s: No NetworkManager available.", self.name)
return new_ifcfgs
+ dumped_device_types = supported_wired_device_types + virtual_device_types
for device in self._nm_client.get_devices():
- if device.get_device_type() not in supported_wired_device_types:
+ if device.get_device_type() not in dumped_device_types:
continue
iface = device.get_iface()
@@ -446,9 +448,14 @@ class DumpMissingIfcfgFilesTask(Task):
device_is_slave = any(con.get_setting_connection().get_master() for con in cons)
if device_is_slave:
- log.debug("%s: not creating default connection for slave device %s",
- self.name, iface)
- continue
+ # We have to dump persistent ifcfg files for slaves created in initramfs
+ if n_cons == 1 and self._is_initramfs_connection(cons[0], iface):
+ log.debug("%s: device %s has an initramfs slave connection",
+ self.name, iface)
+ else:
+ log.debug("%s: not creating default connection for slave device %s",
+ self.name, iface)
+ continue
# Devices activated in initramfs should have ONBOOT=yes
has_initramfs_con = any(self._is_initramfs_connection(con, iface) for con in cons)
--
2.23.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yanan-rock/anaconda.git
[email protected]:yanan-rock/anaconda.git
yanan-rock
anaconda
anaconda
master

搜索帮助