minix/etc/rc.subr.minix
Thomas Veerman 6659ae1fc3 Fix booting into single user mode
Due to a shift, mountfstab was unable to locate the fstab file and
mount other file systems causing a number of errors to be generated.
2012-04-13 13:52:48 +00:00

33 lines
653 B
Text
Executable file

mountfstab()
{
fstabfile="$1"
if [ ! -f $fstabfile ]
then echo "mountfstab: $fstabfile not found"
return 1
fi
cat $fstabfile | sed 's/#.*//' | while read fsline
do set "" $fsline
shift
if [ $# -eq 0 ]; then continue; fi
if [ $# -lt 3 ]
then echo "$fstabfile: short line"
continue
fi
# This line's parameters
dev="$1"; mp="$2"; fstype="$3"
# Don't mount / as it's already mounted
if [ "$mp" = "/" ]; then continue; fi
# Sanity checks
if [ ! -b $dev ]; then echo "$dev missing"; continue; fi
if [ ! -d $mp ]; then echo "$mp missing"; continue; fi
# Do actual mount command
mount -t $fstype $dev $mp
done
}