aboutsummaryrefslogtreecommitdiffstats
path: root/install-utils/convfstab
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>1997-04-26 13:34:30 +0000
committerTheodore Ts'o <tytso@mit.edu>1997-04-26 13:34:30 +0000
commitf3db3566b5e1342e49dffc5ec3f418a838584194 (patch)
tree1f6c5daaee7f33beb697143a8891da8a55752dd6 /install-utils/convfstab
parent6f4a109706f51ad11b9fff0983c140ab62549d2f (diff)
downloade2fsprogs-f3db3566b5e1342e49dffc5ec3f418a838584194.tar.gz
e2fsprogs-f3db3566b5e1342e49dffc5ec3f418a838584194.tar.xz
e2fsprogs-f3db3566b5e1342e49dffc5ec3f418a838584194.zip
Many files:
Checkin of e2fsprogs 0.5b
Diffstat (limited to 'install-utils/convfstab')
-rw-r--r--install-utils/convfstab78
1 files changed, 78 insertions, 0 deletions
diff --git a/install-utils/convfstab b/install-utils/convfstab
new file mode 100644
index 00000000..01938d63
--- /dev/null
+++ b/install-utils/convfstab
@@ -0,0 +1,78 @@
+#!/bin/sh
+# Make /etc/fstab standard compliant.
+# M.Weller (eowmob@exp-math.uni-essen.de) 13.11.1994.
+# This script is public domain. Still if only slightly
+# modified a credit to me might be nice.
+
+ROOT_PASS=1 # Pass for root file system
+NON_ROOT_PASS=2 # Pass for non root file systems
+DEF_FLAGS="defaults" # Default filesysflags
+DEF_DUMP=0 # Default dumpfreq.
+
+while read LINE
+do
+ set -- $LINE
+ if [ $# != 0 ]
+ then
+ case $1 in
+ \#* | !* )
+ echo "$LINE"
+ # Actually there are no comments allowed in /etc/fstab
+ echo "Warning: comment in /etc/fstab detected." >&2
+ echo "Please remove it by hand." >&2
+ ;;
+ * )
+ if [ $# -gt 6 -o $# -lt 3 ]
+ then
+ echo "Don't have a clue about \"$LINE\"." >&2
+ echo "$LINE"
+ else
+ case $2 in
+ / )
+ PASS=$ROOT_PASS
+ ;;
+ none )
+ PASS=0
+ ;;
+ * )
+ PASS=$NON_ROOT_PASS
+ ;;
+ esac
+ DUMP=$DEF_DUMP
+ case $3 in
+ ignore | iso9660 | msdos | hpfs | sysv | \
+ xenix | coherent | nfs | proc | sw | swap )
+ DUMP=0;
+ PASS=0;
+ ;;
+ esac
+ case $# in
+ 3 )
+ echo "$LINE $DEF_FLAGS $DUMP $PASS"
+ ;;
+ 4 )
+ echo "$LINE $DUMP $PASS"
+ ;;
+ 5 )
+ echo "$LINE $PASS"
+ ;;
+ 6)
+ echo "$LINE"
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ else
+ echo "Warning: One empty line removed." >&2
+ fi
+done </etc/fstab >/tmp/newfstab.$$
+mv -f /etc/fstab /etc/fstab.bak
+mv -f /tmp/newfstab.$$ /etc/fstab
+if [ $? != 0 ]
+then
+ echo "Installation of patched /etc/fstab failed."
+ echo "It would have been:"
+ cat /tmp/newfstab.$$
+ rm -f /tmp/newfstab.$$
+fi