Contents of /tags/busybox-init-0_1_12/rc/mountfs
Parent Directory | Revision Log
Revision 1230 -
(show annotations)
(download)
Thu Mar 3 18:41:34 2011 UTC (13 years, 6 months ago) by niro
File size: 1704 byte(s)
Thu Mar 3 18:41:34 2011 UTC (13 years, 6 months ago) by niro
File size: 1704 byte(s)
tagged 'busybox-init-0_1_12'
1 | #!/bin/sh |
2 | # $Header: /home/cvsd/magellan-cvs/magellan-src/busybox-initscripts/rc/mountfs,v 1.2 2008-06-10 23:08:56 niro Exp $ |
3 | |
4 | #%rlevels: 7:s 0:k |
5 | #%start: 40 |
6 | #%stop: 60 |
7 | |
8 | #deps |
9 | #%needs: |
10 | #%before: |
11 | #%after: |
12 | |
13 | source /etc/conf.d/rc |
14 | source ${rc_functions} |
15 | |
16 | case "$1" in |
17 | start) |
18 | if [ ! -e /.bootdev ] |
19 | then |
20 | rc_print "Remounting root file system in read-write mode ..." |
21 | mount -n -o remount,rw / |
22 | evaluate_retval |
23 | fi |
24 | |
25 | if [[ ! -L /etc/mtab ]] || [[ $(readlink /etc/mtab) != /proc/mounts ]] |
26 | then |
27 | rc_print "Recording existing mounts in /etc/mtab ..." |
28 | ln -snf /proc/mounts /etc/mtab |
29 | evaluate_retval |
30 | fi |
31 | |
32 | # The following mount command will mount all file systems. If you |
33 | # have other (network based) file system that should not be or |
34 | # cannot be mounted at this time, add them to the NO_FS variable |
35 | # below. All file systems that are added to the variable in the |
36 | # form of no<filesystem> will be skipped. |
37 | NO_FS="noswap,nonfs,nosmbfs,noproc,nocoda,noncpfs,noshm" |
38 | rc_print "Mounting remaining file systems ..." |
39 | mount -a -t $NO_FS |
40 | evaluate_retval |
41 | |
42 | update_svcstatus $1 |
43 | splash svc_started "$(basename $0)" 0 |
44 | ;; |
45 | |
46 | stop) |
47 | rc_print "Unmounting all other currently mounted file systems ..." |
48 | if [ -e /dev/.udev ] |
49 | then |
50 | NO_FS="noramfs,notmpfs,nodevtmpfs,nodevpts" |
51 | umount -a -r -d -t ${NO_FS} |
52 | else |
53 | # -d, umount loop devices as well |
54 | umount -a -r -d |
55 | fi |
56 | evaluate_retval |
57 | |
58 | if [ -e /.bootdev ] && [ -x /usr/bin/eject ] |
59 | then |
60 | rc_print "Trying to eject the live-media ..." |
61 | eject -m /mnt/cdrom &> /dev/null |
62 | evaluate_retval |
63 | fi |
64 | |
65 | update_svcstatus $1 |
66 | splash svc_stopped "$(basename $0)" 0 |
67 | ;; |
68 | |
69 | *) |
70 | rc_echo "Usage: $0 {start|stop}" |
71 | exit 1 |
72 | ;; |
73 | esac |