summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Schönartz2021-04-13 14:47:06 +0200
committerJannik Schönartz2021-04-13 14:47:06 +0200
commitb7eda9920ed591f208128bbf2771a2697ee8f3fc (patch)
tree8439c08785dc882aa33bad377fae2ad12516ca21
parent[bas-registration-hook] Export UUID for usage in reg. hooks and the script wa... (diff)
downloadsystemd-init-b7eda9920ed591f208128bbf2771a2697ee8f3fc.tar.gz
systemd-init-b7eda9920ed591f208128bbf2771a2697ee8f3fc.tar.xz
systemd-init-b7eda9920ed591f208128bbf2771a2697ee8f3fc.zip
[bas-python] Add newer lspci version to the minilinux, handle busybox lspci version when parsing
-rwxr-xr-xmodules.d/bas-python/module-setup.sh4
-rwxr-xr-xmodules.d/bas-python/scripts/collect_hw_info_json.py5
2 files changed, 6 insertions, 3 deletions
diff --git a/modules.d/bas-python/module-setup.sh b/modules.d/bas-python/module-setup.sh
index 2b5c6958..83f32df9 100755
--- a/modules.d/bas-python/module-setup.sh
+++ b/modules.d/bas-python/module-setup.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
check() {
- for bin in python3 pip3 lshw ip dmidecode; do
+ for bin in python3 pip3 lshw lspci ip dmidecode; do
if ! hash "$bin" 2>&1 /dev/null; then
echo "Missing '$bin' please install it..."
return 1
@@ -36,7 +36,7 @@ install() {
mkdir -p "$initdir/etc/ssl/certs/"
cp "/etc/ssl/certs/ca-certificates.crt" "$initdir/etc/ssl/certs/"
- inst_multiple python3 pip3 lshw smartctl ip dmidecode
+ inst_multiple python3 pip3 lshw lspci smartctl ip dmidecode
# Exec the python hook and reboot instead of Switch Root
# inst_hook pre-mount 00 "$moddir/scripts/python_hook.sh"
diff --git a/modules.d/bas-python/scripts/collect_hw_info_json.py b/modules.d/bas-python/scripts/collect_hw_info_json.py
index 1c2185f8..5341279a 100755
--- a/modules.d/bas-python/scripts/collect_hw_info_json.py
+++ b/modules.d/bas-python/scripts/collect_hw_info_json.py
@@ -95,7 +95,10 @@ def get_lspci():
# Prepare values positions are in order
if len(values) >= 6:
lspci_parsed['slot'] = values[0]
- lspci_parsed['class'] = values[1]
+
+ # The busybox version of lspci has "Class <class>" instead of "<class>"
+ lspci_parsed['class'] = values[1].replace("Class ", "")
+
lspci_parsed['vendor'] = values[2]
lspci_parsed['device'] = values[3]
lspci_parsed['subsystem_vendor'] = values[4]