summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2023-10-11 10:50:59 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2023-10-14 12:38:08 +0100
commitbdf60d0d33eaccf5a9a5eb08e60f17c649b8ce94 (patch)
tree245b9b9eb3b16ada17dad57d5713762d935846ac
parent9c288f944459f4ce28f053b9018c0d8c1564d16a (diff)
install/autodetect: deduplicate the detected modules list
Multiple MODALIAS entries can be backed by a single driver. On my machine, we get from 89 total entries, to a 54 unique ones. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
-rw-r--r--install/autodetect2
1 files changed, 1 insertions, 1 deletions
diff --git a/install/autodetect b/install/autodetect
index f143330..5832953 100644
--- a/install/autodetect
+++ b/install/autodetect
@@ -14,7 +14,7 @@ build() {
mapfile -t mods < <(find /sys/devices -name uevent \
-exec sort -u {} + | sed -n 's/MODALIAS=\(.*\)/\1/p')
- mapfile -t mods < <(modprobe -S "$KERNELVERSION" -qaR "${mods[@]}")
+ mapfile -t mods < <(modprobe -S "$KERNELVERSION" -qaR "${mods[@]}" | sort -u)
(( ${#mods[*]} )) && printf "%s\n" "${mods[@]//-/_}"
}