summaryrefslogtreecommitdiffstats
path: root/scripts/collect-sysfs.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 19:22:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 19:22:29 +0000
commit068a45420f2c98887e220b45e946cc7074da550e (patch)
treec5b54e8b4b235232b057a9c534d9a16d2208463d /scripts/collect-sysfs.sh
parentInitial commit. (diff)
downloadlibnvme-068a45420f2c98887e220b45e946cc7074da550e.tar.xz
libnvme-068a45420f2c98887e220b45e946cc7074da550e.zip
Adding upstream version 1.8.upstream/1.8
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xscripts/collect-sysfs.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/collect-sysfs.sh b/scripts/collect-sysfs.sh
new file mode 100755
index 0000000..b7ce017
--- /dev/null
+++ b/scripts/collect-sysfs.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+filename=nvme-sysfs-$(hostname)-$(uname -r).tar.xz
+
+declare -a dirs=(
+ "/sys/class/nvme"
+ "/sys/class/nvme-fabrics"
+ "/sys/class/nvme-generic"
+ "/sys/class/nvme-subsystem"
+ "/sys/bus/pci/slots"
+)
+
+files=""
+for d in "${dirs[@]}"; do
+ files+="${d} "
+ for l in "${d}"/*; do
+ files+="$(readlink -f $l) "
+ done
+done
+
+tar -c -J -p -f "${filename}" ${files} 2> /dev/null