Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bond bootoptions with bootif rhel9 #5368

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pyanaconda/modules/network/device_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
from pyanaconda.core.regexes import IBFT_CONFIGURED_DEVICE_NAME
from pyanaconda.core.signal import Signal
from pyanaconda.modules.network.nm_client import get_iface_from_connection, \
get_vlan_interface_name_from_connection, get_config_file_connection_of_device
get_vlan_interface_name_from_connection, get_config_file_connection_of_device, \
is_bootif_connection
from pyanaconda.modules.common.structures.network import NetworkDeviceConfiguration
from pyanaconda.modules.network.constants import NM_CONNECTION_TYPE_WIFI, \
NM_CONNECTION_TYPE_ETHERNET, NM_CONNECTION_TYPE_VLAN, NM_CONNECTION_TYPE_BOND, \
Expand Down Expand Up @@ -232,7 +233,7 @@ def _find_connection_uuid_of_device(self, device):
# For physical device we need to pick the right connection in some
# cases.
else:
cons = device.get_available_connections()
cons = [c for c in device.get_available_connections() if not is_bootif_connection(c)]
config_uuid = None
if not cons:
log.debug("no available connection for physical device %s", iface)
Expand Down Expand Up @@ -338,6 +339,10 @@ def _should_add_connection(self, connection):
elif device_type not in supported_device_types:
decline_reason = "unsupported type"

# BOOTIF connection created in initramfs
elif is_bootif_connection(connection):
decline_reason = "BOOTIF connection from initramfs"

# Ignore slave connections
elif device_type == NM.DeviceType.ETHERNET:
if con_setting and con_setting.get_master():
Expand Down
9 changes: 6 additions & 3 deletions pyanaconda/modules/network/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
from pyanaconda.modules.network.nm_client import get_device_name_from_network_data, \
update_connection_from_ksdata, add_connection_from_ksdata, bound_hwaddr_of_device, \
update_connection_values, commit_changes_with_autoconnection_blocked, \
get_config_file_connection_of_device, clone_connection_sync, nm_client_in_thread
get_config_file_connection_of_device, clone_connection_sync, nm_client_in_thread, \
is_bootif_connection
from pyanaconda.modules.network.device_configuration import supported_wired_device_types, \
virtual_device_types
from pyanaconda.modules.network.utils import guard_by_system_configuration
Expand Down Expand Up @@ -242,11 +243,13 @@ def _run(self, nm_client):
device_is_slave = any(con.get_setting_connection().get_master() for con in cons)
if device_is_slave:
# We have to dump persistent ifcfg files for slaves created in initramfs
if n_cons == 1 and self._is_initramfs_connection(cons[0], iface):
# Filter out potenital connection created for BOOTIF option rhbz#2175664
slave_cons = [c for c in cons if not is_bootif_connection(c)]
if len(slave_cons) == 1 and self._is_initramfs_connection(slave_cons[0], iface):
log.debug("%s: device %s has an initramfs slave connection",
self.name, iface)
con = self._select_persistent_connection_for_device(
device, cons, allow_slaves=True)
device, slave_cons, allow_slaves=True)
else:
log.debug("%s: creating default connection for slave device %s",
self.name, iface)
Expand Down
4 changes: 4 additions & 0 deletions pyanaconda/modules/network/nm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1753,3 +1753,7 @@ def _update_team_kickstart_network_data(nm_client, iface, connection, network_da
teamconfig = s_team.get_config()
if teamconfig:
network_data.teamconfig = teamconfig.replace("\n", "").replace(" ", "")


def is_bootif_connection(con):
return con.get_id().startswith("BOOTIF Connection")
Loading