Skip to content

Commit

Permalink
Merge pull request #5365 from rvykydal/bond-bootoptions-with-bootif
Browse files Browse the repository at this point in the history
Bond bootoptions with bootif
  • Loading branch information
rvykydal committed Dec 12, 2023
2 parents de1cb8a + 1fdb5c6 commit 0f76193
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
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 port 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_port = any(con.get_setting_connection().get_master() for con in cons)
if device_is_port:
# We have to dump persistent ifcfg files for ports 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
port_cons = [c for c in cons if not is_bootif_connection(c)]
if len(port_cons) == 1 and self._is_initramfs_connection(port_cons[0], iface):
log.debug("%s: device %s has an initramfs port connection",
self.name, iface)
con = self._select_persistent_connection_for_device(
device, cons, allow_ports=True)
device, port_cons, allow_ports=True)
else:
log.debug("%s: creating default connection for port 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 @@ -1745,3 +1745,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")

0 comments on commit 0f76193

Please sign in to comment.