From 7030fdc70afa1380063a282a3ae46710e774109b Mon Sep 17 00:00:00 2001 From: markdhooper Date: Wed, 14 Sep 2022 13:44:56 -0300 Subject: [PATCH] modified the check for pci network cards in 45drives-system, as there were false positives on some supermicro borads --- 45drives-system/public/scripts/pci | 13 ++++++++++++- CHANGELOG.md | 6 ++---- manifest.json | 4 ++-- packaging/el8/main.spec | 2 ++ packaging/focal/changelog | 6 ++++++ 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/45drives-system/public/scripts/pci b/45drives-system/public/scripts/pci index 25be6af..c170087 100755 --- a/45drives-system/public/scripts/pci +++ b/45drives-system/public/scripts/pci @@ -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() @@ -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(): diff --git a/CHANGELOG.md b/CHANGELOG.md index a7e34d1..770ae0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 \ No newline at end of file +* modified how network cards are detected in 45drives-system's pci helper script \ No newline at end of file diff --git a/manifest.json b/manifest.json index 4c4625e..3c2d9a6 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "title": "cockpit-45drives-hardware", "prerelease": false, "version": "2.2.1", - "buildVersion": "1", + "buildVersion": "2", "author": "Mark Hooper ", "url": "https://github.com/45Drives/cockpit-hardware", "category": "utils", @@ -59,7 +59,7 @@ "changelog": { "urgency": "medium", "version": "2.2.1", - "buildVersion": "1", + "buildVersion": "2", "ignore": [], "date": null, "packager": "Mark Hooper ", diff --git a/packaging/el8/main.spec b/packaging/el8/main.spec index 6e3d77e..503bc13 100644 --- a/packaging/el8/main.spec +++ b/packaging/el8/main.spec @@ -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 2.2.1-2 +- modified how network cards are detected in 45drives-system's pci helper script * Wed Sep 14 2022 Mark Hooper 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 diff --git a/packaging/focal/changelog b/packaging/focal/changelog index 0bf67fc..0efb5d9 100644 --- a/packaging/focal/changelog +++ b/packaging/focal/changelog @@ -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 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