[Pkg-sysvinit-commits] r453 -
sysvinit/trunk/debian/initscripts/etc/init.d
Thomas Hood
jdthood-guest at costa.debian.org
Tue Dec 27 19:58:11 UTC 2005
Author: jdthood-guest
Date: 2005-12-27 19:58:10 +0000 (Tue, 27 Dec 2005)
New Revision: 453
Modified:
sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh
sysvinit/trunk/debian/initscripts/etc/init.d/mountvirtfs
sysvinit/trunk/debian/initscripts/etc/init.d/umountfs
sysvinit/trunk/debian/initscripts/etc/init.d/umountnfs.sh
Log:
In while loops that read fstab, match options more carefully in mountnfs.sh, harmonize variable names
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh 2005-12-27 14:01:42 UTC (rev 452)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh 2005-12-27 19:58:10 UTC (rev 453)
@@ -61,42 +61,42 @@
rootcheck=no
swap_on_md=no
devfs=
- while read dev mnt type opts dump pass junk
+ while read DEV MTPT FSTYPE OPTS DUMP PASS JUNK
do
- case "$dev" in
+ case "$DEV" in
""|\#*)
continue;
;;
/dev/md*)
# Swap on md device.
- [ "$type" = "swap" ] && swap_on_md=yes
+ [ "$FSTYPE" = "swap" ] && swap_on_md=yes
;;
/dev/*)
;;
LABEL=*|UUID=*)
- if [ "$mnt" = "/" ] && which findfs >/dev/null
+ if [ "$MTPT" = "/" ] && which findfs >/dev/null
then
- dev="$(findfs "$dev")"
+ DEV="$(findfs "$DEV")"
fi
;;
*)
# Devfs definition ?
- if [ "$type" = "devfs" ] && [ "$mnt" = "/dev" ] && mountpoint -q /dev
+ if [ "$FSTYPE" = "devfs" ] && [ "$MTPT" = "/dev" ] && mountpoint -q /dev
then
- devfs="-t $type $dev $mnt"
+ devfs="-t $FSTYPE $DEV $MTPT"
fi
# Might be a swapfile.
- [ "$type" = "swap" ] && swap_on_md=yes
+ [ "$FSTYPE" = "swap" ] && swap_on_md=yes
;;
esac
- [ "$mnt" != "/" ] && continue
- rootdev="$dev"
- fstabroot="$dev"
- rootopts="$opts"
- roottype="$type"
- ( [ "$pass" != 0 ] && [ "$pass" != "" ] ) && rootcheck=yes
- ( [ "$type" = "nfs" ] || [ "$type" = "nfs4" ] ) && rootcheck=no
- case "$opts" in
+ [ "$MTPT" != "/" ] && continue
+ rootdev="$DEV"
+ fstabroot="$DEV"
+ rootopts="$OPTS"
+ roottype="$FSTYPE"
+ ( [ "$PASS" != 0 ] && [ "$PASS" != "" ] ) && rootcheck=yes
+ ( [ "$FSTYPE" = "nfs" ] || [ "$FSTYPE" = "nfs4" ] ) && rootcheck=no
+ case "$OPTS" in
ro|ro,*|*,ro|*,ro,*)
rootmode=ro
;;
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh 2005-12-27 14:01:42 UTC (rev 452)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh 2005-12-27 19:58:10 UTC (rev 453)
@@ -32,22 +32,22 @@
# not mounted with the nolock option, we start the portmapper.
#
portmap=no
- while read device mountpt fstype options
+ while read DEV MTPT FSTYPE OPTS REST
do
- case "$device" in
+ case "$DEV" in
""|\#*)
continue
;;
esac
- case "$options" in
- *noauto*)
+ case "$OPTS" in
+ noauto|*,noauto|noauto,*|*,noauto,*)
continue
;;
esac
- case "$fstype" in
+ case "$FSTYPE" in
nfs|nfs4)
- case "$options" in
- *nolock*)
+ case "$OPTS" in
+ nolock|*,nolock|nolock,*|*,nolock,*)
;;
*)
portmap=yes
@@ -57,16 +57,16 @@
smbfs|cifs|coda|ncp|ncpfs|ocfs2|gfs)
;;
*)
- fstype=
+ FSTYPE=
;;
esac
- if [ "$fstype" ]
+ if [ "$FSTYPE" ]
then
case "$NETFS" in
- $fstype|*,$fstype|$fstype,*|*,$fstype,*)
+ $FSTYPE|*,$FSTYPE|$FSTYPE,*|*,$FSTYPE,*)
;;
*)
- NETFS="$NETFS${NETFS:+,}$fstype"
+ NETFS="$NETFS${NETFS:+,}$FSTYPE"
;;
esac
fi
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/mountvirtfs
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/mountvirtfs 2005-12-27 14:01:42 UTC (rev 452)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/mountvirtfs 2005-12-27 19:58:10 UTC (rev 453)
@@ -64,23 +64,23 @@
domount () {
MTPT="$3"
# Figure out filesystem type
- TYPE=
+ FSTYPE=
if [ "$1" = proc ]
then
case "$KERNEL" in
- Linux|GNU) TYPE=proc ;;
- *FreeBSD) TYPE=linprocfs ;;
- *) TYPE=procfs ;;
+ Linux|GNU) FSTYPE=proc ;;
+ *FreeBSD) FSTYPE=linprocfs ;;
+ *) FSTYPE=procfs ;;
esac
elif grep -E -qs "$1\$" /proc/filesystems
then
- TYPE=$1
+ FSTYPE=$1
elif grep -E -qs "$2\$" /proc/filesystems
then
- TYPE=$2
+ FSTYPE=$2
fi
- if [ ! "$TYPE" ]
+ if [ ! "$FSTYPE" ]
then
if [ "$2" ]
then
@@ -96,18 +96,18 @@
if [ -f /etc/fstab ]
then
exec 9<&0 0</etc/fstab
- while read FDEV FDIR FTYPE FOPTS REST
+ while read TAB_DEV TAB_MTPT TAB_FSTYPE TAB_OPTS TAB_REST
do
- case "$FDEV" in (""|\#*) continue ;; esac
- [ "$MTPT" = "$FDIR" ] || continue
- [ "$TYPE" = "$FTYPE" ] || continue
- case "$FOPTS" in
+ 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$FOPTS"
+ OPTS="-o$TAB_OPTS"
;;
esac
break
@@ -121,16 +121,17 @@
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 $TYPE $OPTS $4 $TYPE $MTPT
+ mount -f -t $FSTYPE $OPTS $4 $FSTYPE $MTPT
fi
else
is_empty_dir "$MTPT" >/dev/null 2>&1 || log_warning_msg "Files under mount point '$MTPT' will be hidden."
- mount $MOUNT_N -t $TYPE $OPTS $4 $TYPE $MTPT
+ mount $MOUNT_N -t $FSTYPE $OPTS $4 $FSTYPE $MTPT
fi
}
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/umountfs
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/umountfs 2005-12-27 14:01:42 UTC (rev 452)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/umountfs 2005-12-27 19:58:10 UTC (rev 453)
@@ -36,18 +36,18 @@
LC_ALL=C sort -r -k 2 /proc/mounts |
(
DIRS=""
- while read DEV DIR TYPE REST ; do
- case "$DIR" in
+ while read DEV MTPT FSTYPE REST ; do
+ case "$MTPT" in
/|/proc|/dev|/.dev|/dev/pts|/proc/*|/sys)
continue # Ignoring virtual file systems needed later
;;
esac
- case "$TYPE" in
+ case "$FSTYPE" in
proc|procfs|linprocfs|devfs|sysfs|usbfs|usbdevfs|devpts)
continue # Ignoring non-tmpfs virtual file systems
;;
esac
- DIRS="$DIRS $DIR"
+ DIRS="$DIRS $MTPT"
done
umount -f -r -d $DIRS
)
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/umountnfs.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/umountnfs.sh 2005-12-27 14:01:42 UTC (rev 452)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/umountnfs.sh 2005-12-27 19:58:10 UTC (rev 453)
@@ -44,19 +44,19 @@
#
(
DIRS=""
- while read DEV DIR TYPE REST
+ while read DEV MTPT FSTYPE REST
do
- case "$DIR" in
+ case "$MTPT" in
/|/proc|/dev|/dev/pts|/proc/*|/sys)
continue
;;
esac
- case "$TYPE" in
+ case "$FSTYPE" in
nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs)
- DIRS="$DIR $DIRS"
+ DIRS="$MTPT $DIRS"
;;
proc|procfs|linprocfs|devfs|devpts|usbfs|usbdevfs|sysfs)
- DIRS="$DIR $DIRS"
+ DIRS="$MTPT $DIRS"
;;
esac
done
More information about the Pkg-sysvinit-commits
mailing list