Skip to content

Commit

Permalink
modified the check for pci network cards in 45drives-system, as there…
Browse files Browse the repository at this point in the history
… were false positives on some supermicro borads
  • Loading branch information
markdhooper committed Sep 14, 2022
1 parent a904fc2 commit 7030fdc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
13 changes: 12 additions & 1 deletion 45drives-system/public/scripts/pci
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ def get_hba_server_info():
else:
return []

def check_pci_network_card_match(slot,card):
if ("ID" in slot.keys() and card["pciSlot"] == slot["ID"]):
return True
if "Designation" in slot.keys():
regex = r"(SLOT|PCIE)(\d+)"
test_str = slot["Designation"]
match = re.match(regex, test_str, re.DOTALL)
if match:
return (match.group(2) == card["pciSlot"])
return False

def main():
pci_slots = dmidecode()
hba_cards = lspci_hba()
Expand All @@ -234,7 +245,7 @@ def main():
if pci_slots and network_cards:
for slot in pci_slots:
for card in network_cards:
if ("ID" in slot.keys() and card["pciSlot"] == slot["ID"]) or ("Designation" in slot.keys() and ("PCIE" in slot["Designation"] or "SLOT" in slot["Designation"]) and card["pciSlot"] in slot["Designation"]):
if check_pci_network_card_match(slot,card):
slot["Card Type"] = "Network Card"
slot["Card Model"] = getNetworkCardModel(str(slot["Bus Address"]))
if "Connections" not in slot.keys():
Expand Down
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## cockpit-45drives-hardware 2.2.1-1
## cockpit-45drives-hardware 2.2.1-2

* updated zfs_info script in 45drives-disks to inform user about the requirement for zfs devices to be using device aliases
* added support for ASRockRack EPC621D8A Motherboards in 45Drives-motherboard
* updated 45drives-tools dependency to 2.1.0
* modified how network cards are detected in 45drives-system's pci helper script
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "cockpit-45drives-hardware",
"prerelease": false,
"version": "2.2.1",
"buildVersion": "1",
"buildVersion": "2",
"author": "Mark Hooper <[email protected]>",
"url": "https://github.com/45Drives/cockpit-hardware",
"category": "utils",
Expand Down Expand Up @@ -59,7 +59,7 @@
"changelog": {
"urgency": "medium",
"version": "2.2.1",
"buildVersion": "1",
"buildVersion": "2",
"ignore": [],
"date": null,
"packager": "Mark Hooper <[email protected]>",
Expand Down
2 changes: 2 additions & 0 deletions packaging/el8/main.spec
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ make DESTDIR=%{buildroot} install
/usr/lib/udev/rules.d/68-cockpit-45drives-disks.rules

%changelog
* Wed Sep 14 2022 Mark Hooper <[email protected]> 2.2.1-2
- modified how network cards are detected in 45drives-system's pci helper script
* Wed Sep 14 2022 Mark Hooper <[email protected]> 2.2.1-1
- updated zfs_info script in 45drives-disks to inform user about the requirement
for zfs devices to be using device aliases
Expand Down
6 changes: 6 additions & 0 deletions packaging/focal/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
cockpit-45drives-hardware (2.2.1-2focal) focal; urgency=medium

* modified how network cards are detected in 45drives-system's pci helper script

-- Mark Hooper <[email protected]> Wed, 14 Sep 2022 10:43:46 -0300

cockpit-45drives-hardware (2.2.1-1focal) focal; urgency=medium

* updated zfs_info script in 45drives-disks to inform user about the requirement
Expand Down

0 comments on commit 7030fdc

Please sign in to comment.