[Pkg-sysvinit-commits] r501 - in sysvinit/trunk/debian: . initscripts/etc/init.d initscripts/lib/init

Thomas Hood jdthood-guest at costa.debian.org
Mon Jan 2 13:19:58 UTC 2006


Author: jdthood-guest
Date: 2006-01-02 13:19:56 +0000 (Mon, 02 Jan 2006)
New Revision: 501

Added:
   sysvinit/trunk/debian/initscripts/lib/init/mount-functions.sh
Removed:
   sysvinit/trunk/debian/initscripts/lib/init/functions.sh
Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/initscripts/etc/init.d/mountdevsubfs
   sysvinit/trunk/debian/initscripts/etc/init.d/mountvirtfs
Log:
Replace /lib/init/functions.sh with /lib/init/mount-functions.sh

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2006-01-01 22:56:51 UTC (rev 500)
+++ sysvinit/trunk/debian/changelog	2006-01-02 13:19:56 UTC (rev 501)
@@ -4,6 +4,8 @@
   * Split mountdevsubfs out of mountvirtfs and run it at S04 and S37.
     This should behave the same way as before, but the split allows
     packages that futz with /dev to do this at S03.
+  * Replace /lib/init/functions.sh with /lib/init/mount-functions.sh
+    for use by the latter
   * various initscripts: Clean up code that reads fstab
   * umountfs: Only run umount if there is something to unmount
     (Closes: #345272)

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/mountdevsubfs
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/mountdevsubfs	2006-01-01 22:56:51 UTC (rev 500)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/mountdevsubfs	2006-01-02 13:19:56 UTC (rev 501)
@@ -31,7 +31,7 @@
 KERNEL="$(uname -s)"
 
 . /lib/lsb/init-functions
-. /lib/init/functions.sh
+. /lib/init/mount-functions.sh
 
 umask 022
 

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/mountvirtfs
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/mountvirtfs	2006-01-01 22:56:51 UTC (rev 500)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/mountvirtfs	2006-01-02 13:19:56 UTC (rev 501)
@@ -23,7 +23,7 @@
 PATH=/lib/init:/bin:/sbin
 
 . /lib/lsb/init-functions
-. /lib/init/functions.sh
+. /lib/init/mount-functions.sh
 
 umask 022
 

Deleted: sysvinit/trunk/debian/initscripts/lib/init/functions.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/lib/init/functions.sh	2006-01-01 22:56:51 UTC (rev 500)
+++ sysvinit/trunk/debian/initscripts/lib/init/functions.sh	2006-01-02 13:19:56 UTC (rev 501)
@@ -1,103 +0,0 @@
-#
-# Functions used by several scripts in initscripts package
-#
-# The API provided here is not stable and should only be used
-# by the scripts in the initscripts package.
-#
-
-# Sourcer must also source /lib/lsb/init-functions.sh
-
-# $1: directory
-initfunc_is_empty_dir() {
-	for FILE in $1/* $1/.*
-	do
-		case "$FILE" in
-		  "$1/.*") return 0 ;;
-		  "$1/*"|"$1/."|"$1/..") continue ;;
-		  *) return 1 ;;
-		esac
-	done
-	return 0
-}
-
-
-# $1: file system type
-# $2: alternative file system type (or empty string if none)
-# $3: mount point
-# $4 and up: extra mount program options
-initfunc_domount () {
-	MTPT="$3"
-	KERNEL="$(uname -s)"
-	# Figure out filesystem type
-	FSTYPE=
-	if [ "$1" = proc ]
-	then
-		case "$KERNEL" in
-			Linux|GNU) FSTYPE=proc ;;
-			*FreeBSD)  FSTYPE=linprocfs ;;
-			*)         FSTYPE=procfs ;;
-		esac
-	elif grep -E -qs "$1\$" /proc/filesystems
-	then
-		FSTYPE=$1
-	elif grep -E -qs "$2\$" /proc/filesystems
-	then
-		FSTYPE=$2
-	fi
-
-	if [ ! "$FSTYPE" ]
-	then
-		if [ "$2" ]
-		then
-			log_warning_msg "Filesystem types '$1' and '$2' are not supported. Skipping mount."
-		else
-			log_warning_msg "Filesystem type '$1' is not supported. Skipping mount."
-		fi
-		return
-	fi
-
-	# Get the options from /etc/fstab.
-	OPTS=
-	if [ -f /etc/fstab ]
-	then
-		exec 9<&0 </etc/fstab
-
-		while read TAB_DEV TAB_MTPT TAB_FSTYPE TAB_OPTS TAB_REST
-		do
-			case "$TAB_DEV" in (""|\#*) continue ;; esac
-			[ "$MTPT" = "$TAB_MTPT" ] || continue
-			[ "$FSTYPE" = "$TAB_FSTYPE" ] || continue
-			case "$TAB_OPTS" in
-			  noauto|*,noauto|noauto,*|*,noauto,*)
-				exec 0<&9 9<&-
-				return
-				;;
-			  ?*)
-				OPTS="-o$TAB_OPTS"
-				;;
-			esac
-			break
-		done
-
-		exec 0<&9 9<&-
-	fi
-
-	if [ ! -d "$MTPT" ]
-	then
-		log_warning_msg "Mount point '$MTPT' does not exist. Skipping mount."
-		return
-	fi
-
-	# We give file system type as device name
-	if mountpoint -q "$MTPT"
-	then
-		# Only need to update mtab?
-		if [ "$DO_MTAB" ] && ! grep -E -sq "^([^ ]+) +$MTPT +" /etc/mtab
-		then
-			mount -f -t $FSTYPE $OPTS $4 $FSTYPE $MTPT
-		fi
-	else
-		initfunc_is_empty_dir "$MTPT" >/dev/null 2>&1 || log_warning_msg "Files under mount point '$MTPT' will be hidden."
-		mount $MOUNT_N -t $FSTYPE $OPTS $4 $FSTYPE $MTPT
-	fi
-}

Added: sysvinit/trunk/debian/initscripts/lib/init/mount-functions.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/lib/init/mount-functions.sh	2006-01-01 22:56:51 UTC (rev 500)
+++ sysvinit/trunk/debian/initscripts/lib/init/mount-functions.sh	2006-01-02 13:19:56 UTC (rev 501)
@@ -0,0 +1,101 @@
+#
+# Functions used by several mount* scripts in initscripts package
+#
+
+# Sourcer must also source /lib/lsb/init-functions.sh
+
+# $1: directory
+initfunc_is_empty_dir() {
+	for FILE in $1/* $1/.*
+	do
+		case "$FILE" in
+		  "$1/.*") return 0 ;;
+		  "$1/*"|"$1/."|"$1/..") continue ;;
+		  *) return 1 ;;
+		esac
+	done
+	return 0
+}
+
+
+# $1: file system type
+# $2: alternative file system type (or empty string if none)
+# $3: mount point
+# $4 and up: extra mount program options
+initfunc_domount () {
+	MTPT="$3"
+	KERNEL="$(uname -s)"
+	# Figure out filesystem type
+	FSTYPE=
+	if [ "$1" = proc ]
+	then
+		case "$KERNEL" in
+			Linux|GNU) FSTYPE=proc ;;
+			*FreeBSD)  FSTYPE=linprocfs ;;
+			*)         FSTYPE=procfs ;;
+		esac
+	elif grep -E -qs "$1\$" /proc/filesystems
+	then
+		FSTYPE=$1
+	elif grep -E -qs "$2\$" /proc/filesystems
+	then
+		FSTYPE=$2
+	fi
+
+	if [ ! "$FSTYPE" ]
+	then
+		if [ "$2" ]
+		then
+			log_warning_msg "Filesystem types '$1' and '$2' are not supported. Skipping mount."
+		else
+			log_warning_msg "Filesystem type '$1' is not supported. Skipping mount."
+		fi
+		return
+	fi
+
+	# Get the options from /etc/fstab.
+	OPTS=
+	if [ -f /etc/fstab ]
+	then
+		exec 9<&0 </etc/fstab
+
+		while read TAB_DEV TAB_MTPT TAB_FSTYPE TAB_OPTS TAB_REST
+		do
+			case "$TAB_DEV" in (""|\#*) continue ;; esac
+			[ "$MTPT" = "$TAB_MTPT" ] || continue
+			[ "$FSTYPE" = "$TAB_FSTYPE" ] || continue
+			case "$TAB_OPTS" in
+			  noauto|*,noauto|noauto,*|*,noauto,*)
+				exec 0<&9 9<&-
+				return
+				;;
+			  ?*)
+				OPTS="-o$TAB_OPTS"
+				;;
+			esac
+			break
+		done
+
+		exec 0<&9 9<&-
+	fi
+
+	if [ ! -d "$MTPT" ]
+	then
+		log_warning_msg "Mount point '$MTPT' does not exist. Skipping mount."
+		return
+	fi
+
+	# We give file system type as device name
+	if mountpoint -q "$MTPT"
+	then
+		# Only need to update mtab?
+		if [ "$DO_MTAB" ] && ! grep -E -sq "^([^ ]+) +$MTPT +" /etc/mtab
+		then
+			mount -f -t $FSTYPE $OPTS $4 $FSTYPE $MTPT
+		fi
+	else
+		initfunc_is_empty_dir "$MTPT" >/dev/null 2>&1 || log_warning_msg "Files under mount point '$MTPT' will be hidden."
+		mount $MOUNT_N -t $FSTYPE $OPTS $4 $FSTYPE $MTPT
+	fi
+}
+




More information about the Pkg-sysvinit-commits mailing list