[Pkg-iscsi-maintainers] [open-iscsi] 01/01: Add patch to enable fsck, mount and swap for network block devices

Ritesh Raj Sarraf rrs at moszumanska.debian.org
Thu Feb 6 12:05:18 UTC 2014


This is an automated email from the git hooks/post-receive script.

rrs pushed a commit to branch master
in repository open-iscsi.

commit 7e1ae42defdced6869ba2dc2abe49c6072a15ae9
Author: Ritesh Raj Sarraf <rrs at debian.org>
Date:   Thu Feb 6 17:31:48 2014 +0530

    Add patch to enable fsck, mount and swap for network block devices
    
    Thanks: Turbo Fredriksson
    Closes: #736349
---
 debian/open-iscsi.init | 46 ++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 42 insertions(+), 4 deletions(-)

diff --git a/debian/open-iscsi.init b/debian/open-iscsi.init
index 182b1ee..95bf75a 100644
--- a/debian/open-iscsi.init
+++ b/debian/open-iscsi.init
@@ -126,10 +126,48 @@ start() {
 	# Now let's mount
 	log_daemon_msg "Mounting network filesystems"
 	MOUNT_RESULT=1
-	if mount -a -O _netdev >/dev/null 2>&1; then
-		MOUNT_RESULT=0
-		break
-	fi
+	fs=
+	grep -w _netdev /etc/fstab | \
+	    while read DEV MTPT FSTYPE OPTS REST; do
+		case "$DEV" in
+		    ""|\#*)
+			continue
+			;;
+		esac
+		case "$OPTS" in
+		    noauto|*,noauto|noauto,*|*,noauto,*)
+			continue
+			;;
+		esac
+		case "$FSTYPE" in
+		    nfs|nfs4|smbfs|cifs|coda|ncp|ncpfs|ocfs2|gfs|ceph)
+			continue
+			;;
+		    *)
+			echo "$FSTYPE:$DEV"
+			;;
+		esac
+	    done | \
+	    while read fs; do
+		set -- $(eval echo "$fs" | sed 's@:@ @')
+		case "$1" in
+		    swap)
+			swapon $2
+			;;
+		    *)
+			fsck -a "$2"
+
+			if mount "$2" >/dev/null 2>&1; then
+			    MOUNT_RESULT=0
+			    break
+			fi
+			;;
+		esac
+	    done
+
+
+
+
 	log_end_msg $MOUNT_RESULT
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-iscsi/open-iscsi.git



More information about the Pkg-iscsi-maintainers mailing list