Magellan Linux

Contents of /branches/init-0_3_3-r1/magellan-initscripts/etc/rc.d/init.d/mountfs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 18 - (show annotations) (download)
Tue Dec 14 01:17:23 2004 UTC (19 years, 4 months ago) by (unknown author)
File size: 1919 byte(s)
This commit was manufactured by cvs2svn to create branch
'init-0_3_3-r1'.
1 #!/bin/bash
2
3 #%rlevels: 7:s 0:k 6:k
4 #%start: 40
5 #%stop: 60
6
7 #deps
8 #%needs:
9 #%before:
10 #%after:
11
12 source /etc/sysconfig/rc
13 source $rc_functions
14
15 #$1= filesys
16 get_mounted(){
17 local filesys
18 filesys=$1
19
20 cat /proc/mounts | grep ${filesys} | cut -d ' ' -f3
21 }
22
23 case "$1" in
24 start)
25 echo -e ${COLOREDSTAR}"Remounting root file system in read-write mode ..."
26 mount -n -o remount,rw /
27 evaluate_retval
28
29 echo -e ${COLOREDSTAR}"Recording existing mounts in /etc/mtab ..."
30 > /etc/mtab
31 mount -f / && mount -f /proc
32
33 #records devfs if mounted
34 if [ "$(get_mounted devfs)" == devfs ]
35 then
36 mount -f -t devfs none /dev
37 fi
38
39 #records devpts if mounted
40 if [ "$(get_mounted devpts)" == devpts ]
41 then
42 mount -f -t devpts none /dev/pts
43 fi
44
45 #records sysfs if mounted
46 if [ "$(get_mounted sysfs)" == sysfs ]
47 then
48 mount -f -t sysfs none /sys
49 fi
50
51 #records udev's ramfs if mounted
52 if [ "$(get_mounted ramfs)" == ramfs ]
53 then
54 mount -f -t ramfs none /dev
55 fi
56
57 evaluate_retval
58
59 # The following mount command will mount all file systems. If you
60 # have other (network based) file system that should not be or
61 # cannot be mounted at this time, add them to the NO_FS variable
62 # below. All file systems that are added to the variable in the
63 # form of no<filesystem> will be skipped.
64
65 NO_FS="nonfs,nosmbfs,noproc,nocoda,noncpfs,noshm"
66 echo -e ${COLOREDSTAR}"Mounting remaining file systems ..."
67 mount -a -t $NO_FS
68 evaluate_retval
69
70 update_svcstatus $1
71 splash svc_started "$(basename $0)" 0
72 ;;
73
74 stop)
75 echo -e ${COLOREDSTAR}"Unmounting all other currently mounted file systems ..."
76 if [ -e /dev/.udev ]
77 then
78 NO_FS="noramfs"
79 umount -a -r -d -t ${NO_FS}
80 else
81 # -d, umount loop devices as well
82 umount -a -r -d
83 fi
84 evaluate_retval
85
86 update_svcstatus $1
87 splash svc_stopped "$(basename $0)" 0
88 ;;
89
90 *)
91 echo "Usage: $0 {start|stop}"
92 exit 1
93 ;;
94 esac

Properties

Name Value
svn:executable *