[arch-projects] [initscripts] [PATCH 16/20] functions/netfs: Refactor filesystem type lists and $NETFS

Kurt J. Bosch kjb-temp-2009 at alpenjodel.de
Sun Jul 10 12:57:04 EDT 2011


Currently $NETFS is used only for fsck and mount in rc.sysinit.
Since we moved it into functions, we can use it in netfs too to get rid of redundancy.

functions:
* Move 'nosysfs' from $NETFS into the mount -a type list because thats obviously the only meaningfull place.
* Add 'nofuse.glusterfs' to $NETFS to match the lists in netfs.
* Remove all 'no'-prefixes from $NETFS to make it more useful and readable.
* Add 'no'-prefixes to fsck and mount -a commands by parameter substitution.

netfs:
* Instead of the literals use $NETFS from functions which contains the same types now
---
 functions |    6 +++---
 netfs     |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/functions b/functions
index 09655ab..ae60771 100644
--- a/functions
+++ b/functions
@@ -375,11 +375,11 @@ read_crypttab() {
 
 # Filesystem functions
 # These can be overridden/reused for customizations like shutdown/loop-fsck.
-NETFS="nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,noshfs,nofuse,nofuseblk,noglusterfs,nodavfs"
+NETFS="nfs,nfs4,smbfs,cifs,codafs,ncpfs,shfs,fuse,fuseblk,glusterfs,davfs,fuse.glusterfs"
 
 # Check local filesystems
 fsck_all() {
-	fsck -A -T -C$FSCK_FD -a -t "$NETFS,noopts=_netdev" $FORCEFSCK
+	fsck -A -T -C$FSCK_FD -a -t "no${NETFS//,/,no},noopts=_netdev" $FORCEFSCK
 	return $?
 }
 
@@ -419,7 +419,7 @@ fsck_reboot() {
 }
 
 mount_all() {
-	mount -a -t "$NETFS" -O no_netdev
+	mount -a -t "nosysfs,no${NETFS//,/,no}" -O no_netdev
 }
 
 bootlogd_stop() {
diff --git a/netfs b/netfs
index ffda681..ea7e4eb 100755
--- a/netfs
+++ b/netfs
@@ -7,7 +7,7 @@
 case "$1" in
 	start)
 		stat_busy "Mounting Network Filesystems"
-		mount -a -t nfs,nfs4,smbfs,codafs,ncpfs,cifs,shfs,glusterfs,fuse,fuseblk,fuse.glusterfs,davfs
+		mount -a -t "$NETFS"
 		rc=$?
 		mount -a -O _netdev
 		(( rc || $? )) && stat_die
@@ -18,7 +18,7 @@ case "$1" in
 		stat_busy "Unmounting Network Filesystems"
 		umount -a -O _netdev
 		rc=$?
-		umount -a -t nfs,nfs4,smbfs,codafs,ncpfs,cifs,shfs,glusterfs,fuse,fuseblk,fuse.glusterfs,davfs
+		umount -a -t "$NETFS"
 		(( rc || $? )) && stat_die
 		rm_daemon netfs
 		stat_done
-- 
1.7.1



More information about the arch-projects mailing list