summaryrefslogtreecommitdiffstats
path: root/install/autodetect
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-01-07 20:22:43 +0100
committerDave Reisner <dreisner@archlinux.org>2012-01-13 00:26:36 +0100
commite46aebfa38a4d521232fd35fc276a74b1ec2d7a5 (patch)
treee5a1f860fab08a7b5af2d25638cf786d0d7d0e0d /install/autodetect
parent47531b5050e82f361a35c670f14f542cdce25d74 (diff)
downloadmkinitcpio-e46aebfa38a4d521232fd35fc276a74b1ec2d7a5.tar.gz
mkinitcpio-e46aebfa38a4d521232fd35fc276a74b1ec2d7a5.tar.xz
autodetect: try to find /usr partition fstype
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'install/autodetect')
-rw-r--r--install/autodetect13
1 files changed, 11 insertions, 2 deletions
diff --git a/install/autodetect b/install/autodetect
index abc0fa0..7f40b9c 100644
--- a/install/autodetect
+++ b/install/autodetect
@@ -3,6 +3,12 @@
build() {
MODULE_FILE=$workdir/autodetect_modules
+ add_if_avail() {
+ if modinfo -k "$KERNELVERSION" "$1" &>/dev/null; then
+ printf '%s\n' "$1" >>"$MODULE_FILE"
+ fi
+ }
+
if [[ ! -d /sys/devices ]]; then
error "/sys does not appear to be mounted. Unable to use autodetection"
return 1
@@ -16,8 +22,11 @@ build() {
fi
# filesystem module might be a builtin
- if modinfo -k "$KERNELVERSION" "$rootfstype" &>/dev/null; then
- printf '%s\n' "$rootfstype" >>"$MODULE_FILE"
+ add_if_avail "$rootfstype"
+
+ # detect separate /usr
+ if usrfstype=$(findmnt -nero fstype -s"$BASEDIR/etc/fstab" /usr); then
+ add_if_avail "$usrfstype"
fi
if (( UID == 0 )) || in_array 'disk' $(groups); then