Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   autodetect: try to find /usr partition fstype (http://www.linux-archive.org/archlinux-pacman-development/620377-autodetect-try-find-usr-partition-fstype.html)

Dave Reisner 01-12-2012 10:12 PM

autodetect: try to find /usr partition fstype
 
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
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
' "$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
' "$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
--
1.7.8.3


All times are GMT. The time now is 10:00 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.