Created
January 7, 2012 04:40
-
-
Save hydra35/1573811 to your computer and use it in GitHub Desktop.
archlinux's modules detection through sysfs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto_modules() { | |
# Perform auto detection of modules via sysfs. | |
local mods= | |
IFS=$'\n' read -rd '' -a mods < \ | |
<(find /sys/devices -name modalias -exec sort -u {} + | | |
# delimit each input by a newline, expanded in place | |
xargs -d $'\n' modprobe -d "$BASEDIR" -aRS "$KERNELVERSION" | | |
sort -u) | |
printf "%s\n" "${mods[@]//-/_}" | |
(( ${#mods[*]} )) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment