diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-01-07 20:22:43 +0100 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-01-13 00:26:36 +0100 |
commit | e46aebfa38a4d521232fd35fc276a74b1ec2d7a5 (patch) | |
tree | e5a1f860fab08a7b5af2d25638cf786d0d7d0e0d | |
parent | 47531b5050e82f361a35c670f14f542cdce25d74 (diff) | |
download | mkinitcpio-e46aebfa38a4d521232fd35fc276a74b1ec2d7a5.tar.gz mkinitcpio-e46aebfa38a4d521232fd35fc276a74b1ec2d7a5.tar.xz |
autodetect: try to find /usr partition fstype
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r-- | install/autodetect | 13 |
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 |