Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0dbbf96ad | ||
|
|
76484b123c | ||
|
|
8901596152 | ||
|
|
7c504e5056 | ||
|
|
333c44f3ba |
@@ -4,7 +4,9 @@ import (
|
|||||||
"bee/audit/internal/schema"
|
"bee/audit/internal/schema"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@@ -140,6 +142,9 @@ func parseLspciDevice(fields map[string]string) schema.HardwarePCIeDevice {
|
|||||||
} else if numaNode, ok := parsePCINumaNode(fields["NUMANode"]); ok {
|
} else if numaNode, ok := parsePCINumaNode(fields["NUMANode"]); ok {
|
||||||
dev.NUMANode = &numaNode
|
dev.NUMANode = &numaNode
|
||||||
}
|
}
|
||||||
|
if group, ok := readPCIIOMMUGroup(bdf); ok {
|
||||||
|
dev.IOMMUGroup = &group
|
||||||
|
}
|
||||||
if width, ok := readPCIIntAttribute(bdf, "current_link_width"); ok {
|
if width, ok := readPCIIntAttribute(bdf, "current_link_width"); ok {
|
||||||
dev.LinkWidth = &width
|
dev.LinkWidth = &width
|
||||||
}
|
}
|
||||||
@@ -179,6 +184,21 @@ func parseLspciDevice(fields map[string]string) schema.HardwarePCIeDevice {
|
|||||||
return dev
|
return dev
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// readPCIIOMMUGroup resolves the IOMMU group number for a BDF via the
|
||||||
|
// iommu_group symlink in sysfs: .../devices/<bdf>/iommu_group -> .../kernel/iommu_groups/<N>
|
||||||
|
func readPCIIOMMUGroup(bdf string) (int, bool) {
|
||||||
|
link := "/sys/bus/pci/devices/" + bdf + "/iommu_group"
|
||||||
|
target, err := os.Readlink(link)
|
||||||
|
if err != nil {
|
||||||
|
return 0, false
|
||||||
|
}
|
||||||
|
n, err := strconv.Atoi(filepath.Base(target))
|
||||||
|
if err != nil {
|
||||||
|
return 0, false
|
||||||
|
}
|
||||||
|
return n, true
|
||||||
|
}
|
||||||
|
|
||||||
// readPCIIDs reads vendor and device IDs from sysfs for a given BDF.
|
// readPCIIDs reads vendor and device IDs from sysfs for a given BDF.
|
||||||
func readPCIIDs(bdf string) (vendorID, deviceID int) {
|
func readPCIIDs(bdf string) (vendorID, deviceID int) {
|
||||||
base := "/sys/bus/pci/devices/" + bdf
|
base := "/sys/bus/pci/devices/" + bdf
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ type HardwarePCIeDevice struct {
|
|||||||
Firmware *string `json:"firmware,omitempty"`
|
Firmware *string `json:"firmware,omitempty"`
|
||||||
MacAddresses []string `json:"mac_addresses,omitempty"`
|
MacAddresses []string `json:"mac_addresses,omitempty"`
|
||||||
Present *bool `json:"present,omitempty"`
|
Present *bool `json:"present,omitempty"`
|
||||||
|
IOMMUGroup *int `json:"iommu_group,omitempty"`
|
||||||
Telemetry map[string]any `json:"-"`
|
Telemetry map[string]any `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -867,6 +867,7 @@ needs_full_build() {
|
|||||||
"${BUILDER_DIR}/config/package-lists" \
|
"${BUILDER_DIR}/config/package-lists" \
|
||||||
"${BUILDER_DIR}/config/hooks" \
|
"${BUILDER_DIR}/config/hooks" \
|
||||||
"${BUILDER_DIR}/config/archives" \
|
"${BUILDER_DIR}/config/archives" \
|
||||||
|
"${BUILDER_DIR}/config/bootloaders" \
|
||||||
-newer "${FULL_BUILD_MARKER}" 2>/dev/null | head -1)
|
-newer "${FULL_BUILD_MARKER}" 2>/dev/null | head -1)
|
||||||
|
|
||||||
if [ -n "$_heavy" ]; then
|
if [ -n "$_heavy" ]; then
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 77 KiB |
@@ -47,18 +47,30 @@ vim-tiny
|
|||||||
mc
|
mc
|
||||||
htop
|
htop
|
||||||
nvtop
|
nvtop
|
||||||
btop
|
|
||||||
sudo
|
sudo
|
||||||
zstd
|
zstd
|
||||||
mstflint
|
mstflint
|
||||||
memtester
|
memtester
|
||||||
stress-ng
|
stress-ng
|
||||||
stressapptest
|
stressapptest
|
||||||
|
fio
|
||||||
|
iperf3
|
||||||
|
iotop
|
||||||
|
nload
|
||||||
|
tcpdump
|
||||||
|
hdparm
|
||||||
|
sysstat
|
||||||
|
lsscsi
|
||||||
|
sg3-utils
|
||||||
|
jq
|
||||||
|
curl
|
||||||
|
net-tools
|
||||||
|
|
||||||
# QR codes (for displaying audit results)
|
# QR codes (for displaying audit results)
|
||||||
qrencode
|
qrencode
|
||||||
|
|
||||||
# Local desktop (openbox + chromium kiosk)
|
# Local desktop (openbox + chromium kiosk)
|
||||||
|
gparted
|
||||||
openbox
|
openbox
|
||||||
tint2
|
tint2
|
||||||
feh
|
feh
|
||||||
|
|||||||
BIN
iso/vendor/arcconf
vendored
Executable file
BIN
iso/vendor/arcconf
vendored
Executable file
Binary file not shown.
BIN
iso/vendor/sas2ircu
vendored
Executable file
BIN
iso/vendor/sas2ircu
vendored
Executable file
Binary file not shown.
BIN
iso/vendor/sas3ircu
vendored
Executable file
BIN
iso/vendor/sas3ircu
vendored
Executable file
Binary file not shown.
BIN
iso/vendor/ssacli
vendored
Executable file
BIN
iso/vendor/ssacli
vendored
Executable file
Binary file not shown.
BIN
iso/vendor/storcli64
vendored
Executable file
BIN
iso/vendor/storcli64
vendored
Executable file
Binary file not shown.
@@ -1,74 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# fetch-vendor.sh — download proprietary vendor utilities into iso/vendor.
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# STORCLI_URL=... STORCLI_SHA256=... \
|
|
||||||
# SAS2IRCU_URL=... SAS2IRCU_SHA256=... \
|
|
||||||
# SAS3IRCU_URL=... SAS3IRCU_SHA256=... \
|
|
||||||
# MSTFLINT_URL=... MSTFLINT_SHA256=... \
|
|
||||||
# sh scripts/fetch-vendor.sh
|
|
||||||
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
||||||
OUT_DIR="$ROOT_DIR/iso/vendor"
|
|
||||||
mkdir -p "$OUT_DIR"
|
|
||||||
|
|
||||||
need_cmd() {
|
|
||||||
command -v "$1" >/dev/null 2>&1 || { echo "ERROR: required command not found: $1" >&2; exit 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
need_cmd sha256sum
|
|
||||||
|
|
||||||
download_to() {
|
|
||||||
url="$1"
|
|
||||||
out="$2"
|
|
||||||
if command -v wget >/dev/null 2>&1; then
|
|
||||||
wget -O "$out" "$url"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
if command -v curl >/dev/null 2>&1; then
|
|
||||||
curl -fsSL "$url" -o "$out"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
echo "ERROR: required command not found: wget or curl" >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
fetch_one() {
|
|
||||||
name="$1"
|
|
||||||
url="$2"
|
|
||||||
sha="$3"
|
|
||||||
|
|
||||||
if [ -z "$url" ] || [ -z "$sha" ]; then
|
|
||||||
echo "[vendor] skip $name (URL/SHA not provided)"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
dst="$OUT_DIR/$name"
|
|
||||||
tmp="$dst.tmp"
|
|
||||||
|
|
||||||
echo "[vendor] downloading $name"
|
|
||||||
download_to "$url" "$tmp"
|
|
||||||
|
|
||||||
got=$(sha256sum "$tmp" | awk '{print $1}')
|
|
||||||
want=$(echo "$sha" | tr '[:upper:]' '[:lower:]')
|
|
||||||
if [ "$got" != "$want" ]; then
|
|
||||||
rm -f "$tmp"
|
|
||||||
echo "ERROR: checksum mismatch for $name" >&2
|
|
||||||
echo " got: $got" >&2
|
|
||||||
echo " want: $want" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mv "$tmp" "$dst"
|
|
||||||
chmod +x "$dst" || true
|
|
||||||
echo "[vendor] ok: $name"
|
|
||||||
}
|
|
||||||
|
|
||||||
fetch_one "storcli64" "${STORCLI_URL:-}" "${STORCLI_SHA256:-}"
|
|
||||||
fetch_one "sas2ircu" "${SAS2IRCU_URL:-}" "${SAS2IRCU_SHA256:-}"
|
|
||||||
fetch_one "sas3ircu" "${SAS3IRCU_URL:-}" "${SAS3IRCU_SHA256:-}"
|
|
||||||
fetch_one "mstflint" "${MSTFLINT_URL:-}" "${MSTFLINT_SHA256:-}"
|
|
||||||
|
|
||||||
echo "[vendor] done. output dir: $OUT_DIR"
|
|
||||||
Reference in New Issue
Block a user