summaryrefslogtreecommitdiffstats
path: root/install/filesystems
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-08 21:57:48 +0200
committerDave Reisner <dreisner@archlinux.org>2011-06-26 00:58:29 +0200
commitfb8efc7425fca4fed457ceb4ca7e474ee2ffe380 (patch)
tree299468d563f6fa8d2fe7ba049e37bb8d30a636dd /install/filesystems
parent18eb47e46e0630638011e05cd549ec5d8e0bf490 (diff)
downloadmkinitcpio-fb8efc7425fca4fed457ceb4ca7e474ee2ffe380.tar.gz
mkinitcpio-fb8efc7425fca4fed457ceb4ca7e474ee2ffe380.tar.xz
install/autodetect: refactor and simplify hook
Bashify and refactor to cut back on unnecessary churn. Since our {all,checked}_modules functions always return clean module names, we can add these directly to the autodetect file instead of aggregating them during the autodetect hook and then cleansing one at a time. There's a small speed increase here for the simplest code path. Signed-off-by: Dave Reisner <d@falconindy.com>
Diffstat (limited to 'install/filesystems')
-rw-r--r--install/filesystems25
1 files changed, 11 insertions, 14 deletions
diff --git a/install/filesystems b/install/filesystems
index 337a6a5..64227bc 100644
--- a/install/filesystems
+++ b/install/filesystems
@@ -1,21 +1,18 @@
-# vim: set ft=sh:
+#!/bin/bash
-build()
-{
- if [ "${autodetect_fs_detection_failed}" = "1" ]; then
- MODULES=" $(all_modules '/kernel/fs' | grep -v "nls")"
+build() {
+ if (( fs_autodetect_failed )); then
+ MODULES=$(all_modules '/kernel/fs' | grep -v "nls")
else
- MODULES=" $(checked_modules '/kernel/fs' | grep -v "nls")"
+ MODULES=$(checked_modules '/kernel/fs' | grep -v "nls")
fi
- BINARIES=""
- FILES=""
- SCRIPT=""
}
-help ()
-{
-cat<<HELPEOF
- This hook adds filesystems modules to the image. If you would like to
- minimize the modules installed in the image, add the autodetect hook too.
+help() {
+ cat<<HELPEOF
+This hook adds filesystems modules to the image. If you would like to minimize
+the modules installed in the image, add the autodetect hook too.
HELPEOF
}
+
+# vim: set ft=sh ts=4 sw=4 et: