fix(network): detect every wired card, including PCIe fibre adapters

The installer's network screen only listed Ethernet devices NetworkManager
reported as connected or disconnected. A card without carrier (fibre or
cable unplugged, SFP module refused) was hidden, and a card whose driver
never produced an interface was invisible to NetworkManager altogether,
so a PCIe fibre adapter looked "not detected". Every Ethernet device is
now listed with its interface name, and PCI Ethernet controllers without
an interface are shown as cards without a driver.

fws-setup-hardware only knew about Wi-Fi. A wired group now covers every
class-0200 controller and the check phase names each card: link up, no
link, or no interface at all.

Intel ixgbe (82599/X520/X540) refuses non-Intel SFP modules by default,
the most common reason a fibre port stays dead on Linux. The live and the
installed system now allow them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
nocodeandClaude Fable 5.1 committed 2026-11-11 19:09:17 +01:00
1 parent caa0b17262
commit 1458c504d9
3 files changed
+83 -11

No files matched your search

@@ -38,6 +38,7 @@
# hérite directement de StandaloneSpoke (aucune classe parente dans le
# namespace → collect() ne découvre que la nôtre).
import os
import subprocess
import threading
@@ -73,6 +74,25 @@ def _nm(args, timeout=30):
return -1, ""
def _orphan_nics():
"""Cartes Ethernet PCI (classe 0200) que le noyau voit mais pour lesquelles
aucun pilote n'a produit d'interface : NetworkManager ne peut pas les
lister, donc sans ceci la carte paraît « non détectée ». Cas typique : une
carte fibre PCIe dont le module SFP ou le micrologiciel n'est pas reconnu.
Retourne [(slot PCI, description)]."""
try:
out = subprocess.run(["lspci", "-D", "-d", "::0200"], capture_output=True,
text=True, timeout=10).stdout
except (OSError, subprocess.SubprocessError):
return []
found = []
for line in out.splitlines():
slot, _sep, desc = line.partition(" ")
if slot and not os.path.isdir(f"/sys/bus/pci/devices/{slot}/net"):
found.append((slot, desc.partition(": ")[2] or desc))
return found
def _split_escaped(line):
"""Découpe une ligne `nmcli -t` (séparateur ':', '\\:' et '\\\\' échappés)."""
fields, cur, i = [], "", 0
@@ -183,8 +203,9 @@ class FWSNetworkStandaloneSpoke(StandaloneSpoke):
# ------------------------------------------------------------ données --
def _scan(self, rescan):
"""(wifi, ethernet) : wifi = liste de dicts, ethernet = liste de
(interface, état). Sans jamais bloquer l'UI plus d'un instant."""
"""(wifi, ethernet, orphelines) : wifi = liste de dicts, ethernet =
liste de (interface, état), orphelines = cartes PCI sans pilote.
Sans jamais bloquer l'UI plus d'un instant."""
wifi = []
if rescan:
_nm(["-w", "12", "dev", "wifi", "rescan"])
@@ -217,7 +238,7 @@ class FWSNetworkStandaloneSpoke(StandaloneSpoke):
f = _split_escaped(line)
if len(f) >= 3 and f[1] == "ethernet":
eth.append((f[0], f[2].strip()))
return wifi, eth
return wifi, eth, _orphan_nics()
def _active_wifi_ssid(self):
rc, out = _nm(["-t", "-f", "NAME,TYPE", "connection", "show",
@@ -230,7 +251,7 @@ class FWSNetworkStandaloneSpoke(StandaloneSpoke):
return ""
def _build_list(self, rescan):
wifi, eth = self._scan(rescan)
wifi, eth, orphans = self._scan(rescan)
for row in self._list.get_children():
self._list.remove(row)
self._networks = []
@@ -259,15 +280,25 @@ class FWSNetworkStandaloneSpoke(StandaloneSpoke):
self._networks.append(row)
for iface, state in eth:
# Le nom de l'interface distingue plusieurs cartes (intégrée +
# PCIe fibre, par exemple).
label = f"Ethernet — {iface}"
meta = {"kind": "eth", "iface": iface, "state": state}
if state == "connected":
had_conn = True
add_row("eth", "Ethernet (câble)", "Connecté ✓",
{"kind": "eth", "iface": iface, "state": state},
inuse=True)
add_row("eth", label, "Connecté ✓", meta, inuse=True)
elif state == "disconnected":
add_row("eth", "Ethernet (câble)", "Cliquer pour se connecter",
{"kind": "eth", "iface": iface, "state": state})
# "unavailable" = pas de câble : inutile de l'afficher.
add_row("eth", label, "Cliquer pour se connecter", meta)
else:
# « unavailable » = pas de porteuse (câble ou fibre débranché,
# module SFP non reconnu…). On montre quand même la carte :
# cachée, l'utilisateur la croit non détectée.
detail = ("Pas de liaison (câble / fibre ?)"
if state == "unavailable" else state)
add_row("eth", label, detail, meta)
for slot, desc in orphans:
add_row("orphan", f"Carte réseau sans pilote — {slot}", desc[:60],
{"kind": "orphan", "desc": desc})
for n in wifi:
if n["inuse"]:
had_conn = True
@@ -311,6 +342,12 @@ class FWSNetworkStandaloneSpoke(StandaloneSpoke):
return
meta = row._meta
self._hide_password_panel()
if meta["kind"] == "orphan":
self._show_feedback(
f"Carte détectée mais sans pilote chargé : {meta['desc']}. "
"Continuez avec le Wi-Fi ou une autre carte ; « Pilotes et "
"matériel » la signalera sur le système installé.", _RED)
return
if meta["kind"] == "eth":
if meta["state"] == "connected":
self._show_feedback(
@@ -433,7 +470,8 @@ class FWSNetworkStandaloneSpoke(StandaloneSpoke):
self._entry.grab_focus()
else:
self._show_feedback(
"Connexion Ethernet impossible (câble débranché ?).",
"Connexion Ethernet impossible (câble ou fibre "
"débranché, module SFP non reconnu ?).",
_RED)
return False