summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
Diffstat (limited to 'install')
-rw-r--r--install/autodetect17
1 files changed, 9 insertions, 8 deletions
diff --git a/install/autodetect b/install/autodetect
index c0c7563..4f1e4bb 100644
--- a/install/autodetect
+++ b/install/autodetect
@@ -3,17 +3,17 @@
build() {
local -a md_devs
- MODULE_FILE=$workdir/autodetect_modules
+ _f_autodetect_cache=$_d_workdir/autodetect_modules
add_if_avail() {
local resolved
# treat this as an alias, since ext3 might be aliased to ext4.
IFS=$'\n' read -rd '' -a resolved < \
- <(modprobe -d "$MODULEROOT" -S "$KERNELVERSION" -R "$1" 2>/dev/null)
+ <(modprobe -d "$_optmoduleroot" -S "$KERNELVERSION" -R "$1" 2>/dev/null)
if (( ${#resolved[*]} )); then
- printf '%s\n' "${resolved[@]}" >>"$MODULE_FILE"
+ printf '%s\n' "${resolved[@]}" >>"$_f_autodetect_cache"
fi
}
@@ -22,7 +22,7 @@ build() {
return 1
fi
- auto_modules >"$MODULE_FILE"
+ auto_modules >"$_f_autodetect_cache"
# detect filesystem for root
if rootfstype=$(findmnt -uno fstype '/'); then
@@ -40,12 +40,13 @@ build() {
# scan for md raid devices
md_devs=(/sys/class/block/md*/md/level)
if [[ -e $md_devs ]]; then
- (( !QUIET )) && plain "found %d mdadm arrays to scan" "${#md_devs[*]}"
- awk '{ gsub(/raid[456]/, "raid456"); print; }' "${md_devs[@]}" | sort -u >>"$MODULE_FILE"
+ quiet "found %d mdadm arrays to scan" "${#md_devs[*]}"
+ awk '{ gsub(/raid[456]/, "raid456"); print; }' "${md_devs[@]}" |
+ sort -u >>"$_f_autodetect_cache"
fi
- if (( !QUIET )) && [[ -s $MODULE_FILE ]]; then
- plain "caching %d modules" $(wc -l < "$MODULE_FILE")
+ if [[ -s $_f_autodetect_cache ]]; then
+ quiet "caching %d modules" $(wc -l < "$_f_autodetect_cache")
fi
}