#!/bin/sh # $Header: /home/cvsd/magellan-cvs/magellan-src/busybox-initscripts/rc/mountfs,v 1.2 2008-06-10 23:08:56 niro Exp $ #%rlevels: 7:s 0:k #%start: 40 #%stop: 60 #deps #%needs: #%before: #%after: source /etc/conf.d/rc source ${rc_functions} case "$1" in start) if [ ! -e /.bootdev ] then rc_print "Remounting root file system in read-write mode ..." mount -n -o remount,rw / evaluate_retval fi if [[ ! -L /etc/mtab ]] || [[ $(readlink /etc/mtab) != /proc/mounts ]] then rc_print "Recording existing mounts in /etc/mtab ..." ln -snf /proc/mounts /etc/mtab evaluate_retval fi # The following mount command will mount all file systems. If you # have other (network based) file system that should not be or # cannot be mounted at this time, add them to the NO_FS variable # below. All file systems that are added to the variable in the # form of no will be skipped. NO_FS="noswap,nonfs,nosmbfs,noproc,nocoda,noncpfs,noshm" rc_print "Mounting remaining file systems ..." mount -a -t $NO_FS evaluate_retval update_svcstatus $1 splash svc_started "$(basename $0)" 0 ;; stop) rc_print "Unmounting all other currently mounted file systems ..." if [ -e /dev/.udev ] then NO_FS="noramfs,notmpfs,nodevtmpfs,nodevpts" umount -a -r -d -t ${NO_FS} else # -d, umount loop devices as well umount -a -r -d fi evaluate_retval if [ -e /.bootdev ] && [ -x /usr/bin/eject ] then rc_print "Trying to eject the live-media ..." eject -m /mnt/cdrom &> /dev/null evaluate_retval fi update_svcstatus $1 splash svc_stopped "$(basename $0)" 0 ;; *) rc_echo "Usage: $0 {start|stop}" exit 1 ;; esac