Skip to content

Commit

Permalink
added support for 9600 series hba cards
Browse files Browse the repository at this point in the history
  • Loading branch information
markdhooper committed Jun 27, 2022
1 parent c91bacb commit 28b9bbe
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 6 deletions.
18 changes: 17 additions & 1 deletion 45drives-motherboard/public/helper_scripts/pci
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ def storcli():

return hba_cards

def lspci_hba():
try:
lspci_hba_result = subprocess.Popen(
["lspci","-d","1000:*","-vv"],stdout=subprocess.PIPE,universal_newlines=True).stdout.read()
except:
return False
hba_cards = []
hba_dict = {}
rx_pci=re.compile(r"^(\w\w:\w\w\.\w).*\n.*(?:(?:(?:^\t).*\n)+^.*)?(9600-16i|9600-24i|SAS9305-16i|SAS9305-24i|HBA 9405W-16i).*\n",re.MULTILINE)
for match in rx_pci.finditer(lspci_hba_result):
hba_dict["Model"] = match.group(2)
hba_dict["Bus Address"] = "0000:" + match.group(1)
hba_cards.append(hba_dict.copy())

return hba_cards

def network():
try:
network_result = subprocess.Popen(
Expand Down Expand Up @@ -183,7 +199,7 @@ def lsblk(device):

def main():
pci_slots = dmidecode()
hba_cards = storcli()
hba_cards = lspci_hba()
network_cards = network()
sata_cards = sata()

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 90 additions & 1 deletion 45drives-motherboard/src/components/P5Motherboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,96 @@ export default {
components[c]["height"]
);
MASK_ARR[c] = newMask;
} else if (
}
else if (
pci_info["PCI Info"][i]["Card Type"] == "HBA" &&
pci_info["PCI Info"][i]["Card Model"] == "9600-16i"
) {
peripherals.push(
new peripheral(
"PCI",
components[c]["x0"] -
components[c]["width"] * WIDTHOFFSET,
components[c]["y0"] -
components[c]["width"] * VERTOFFSET,
components[c]["width"],
components[c]["height"],
"#FF800080",
peripheralImages.length,
components[c]["width"] * pciScale
)
);
peripheralImages.push(
m.loadImage("img/motherboard/9600-16i.png")
);
components[c]["x0"] =
components[c]["x0"] -
components[c]["width"] * WIDTHOFFSET;
components[c]["y0"] =
components[c]["y0"] -
components[c]["width"] * VERTOFFSET;
components[c]["width"] =
108.0 * components[c]["width"] * pciScale;
components[c]["height"] =
components[c]["width"] / (108.0 / 967.0);
components[c].popup.content = components[
c
].popup.content;
let newMask = m.generateMask(
background_img.width,
background_img.height,
components[c]["x0"],
components[c]["y0"],
components[c]["width"],
components[c]["height"]
);
MASK_ARR[c] = newMask;
}
else if (
pci_info["PCI Info"][i]["Card Type"] == "HBA" &&
pci_info["PCI Info"][i]["Card Model"] == "9600-24i"
) {
peripherals.push(
new peripheral(
"PCI",
components[c]["x0"] -
components[c]["width"] * WIDTHOFFSET,
components[c]["y0"] -
components[c]["width"] * VERTOFFSET,
components[c]["width"],
components[c]["height"],
"#FF800080",
peripheralImages.length,
components[c]["width"] * pciScale
)
);
peripheralImages.push(
m.loadImage("img/motherboard/9600-24i.png")
);
components[c]["x0"] =
components[c]["x0"] -
components[c]["width"] * WIDTHOFFSET;
components[c]["y0"] =
components[c]["y0"] -
components[c]["width"] * VERTOFFSET;
components[c]["width"] =
108.0 * components[c]["width"] * pciScale;
components[c]["height"] =
components[c]["width"] / (108.0 / 967.0);
components[c].popup.content = components[
c
].popup.content;
let newMask = m.generateMask(
background_img.width,
background_img.height,
components[c]["x0"],
components[c]["y0"],
components[c]["width"],
components[c]["height"]
);
MASK_ARR[c] = newMask;
}
else if (
pci_info["PCI Info"][i]["Card Type"] == "Network Card" &&
pci_info["PCI Info"][i]["Card Model"] == "82599ES"
) {
Expand Down
17 changes: 16 additions & 1 deletion 45drives-system/public/scripts/pci
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ def dmidecode():

return cards

def lspci_hba():
try:
lspci_hba_result = subprocess.Popen(
["lspci","-d","1000:*","-vv"],stdout=subprocess.PIPE,universal_newlines=True).stdout.read()
except:
return False
hba_cards = []
hba_dict = {}
rx_pci=re.compile(r"^(\w\w:\w\w\.\w).*\n.*(?:(?:(?:^\t).*\n)+^.*)?(9600-16i|9600-24i|SAS9305-16i|SAS9305-24i|HBA 9405W-16i).*\n",re.MULTILINE)
for match in rx_pci.finditer(lspci_hba_result):
hba_dict["Model"] = match.group(2)
hba_dict["Bus Address"] = "0000:" + match.group(1)
hba_cards.append(hba_dict.copy())

return hba_cards

def storcli():
try:
Expand Down Expand Up @@ -185,7 +200,7 @@ def get_hba_server_info():

def main():
pci_slots = dmidecode()
hba_cards = storcli()
hba_cards = lspci_hba()
network_cards = network()
sata_cards = sata()

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
PLUGIN_SRCS=

# For installing to a remote machine for testing with `make install-remote`
REMOTE_TEST_HOST=192.168.35.36
REMOTE_TEST_HOST=rockinator1
REMOTE_TEST_USER=root

# Restarts cockpit after install
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"dmidecode",
"ipmitool",
"lshw",
"45drives-tools (>= 2.0.7)"
"45drives-tools (>= 2.0.8)"
],
"el": [
"cockpit",
Expand All @@ -40,7 +40,7 @@
"dmidecode",
"ipmitool",
"lshw",
"45drives-tools >= 2.0.7"
"45drives-tools >= 2.0.8"
]
},
"releases": [
Expand Down

0 comments on commit 28b9bbe

Please sign in to comment.