Annotation of /tags/busybox-init-0_1_14/rc/mountfs
Parent Directory | Revision Log
Revision 1238 -
(hide annotations)
(download)
Thu Mar 10 20:27:24 2011 UTC (13 years, 6 months ago) by niro
File size: 1704 byte(s)
Thu Mar 10 20:27:24 2011 UTC (13 years, 6 months ago) by niro
File size: 1704 byte(s)
tagged 'busybox-init-0_1_14'
1 | niro | 724 | #!/bin/sh |
2 | niro | 735 | # $Header: /home/cvsd/magellan-cvs/magellan-src/busybox-initscripts/rc/mountfs,v 1.2 2008-06-10 23:08:56 niro Exp $ |
3 | niro | 724 | |
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 | niro | 1228 | if [ ! -e /.bootdev ] |
19 | niro | 724 | then |
20 | niro | 1168 | rc_print "Remounting root file system in read-write mode ..." |
21 | niro | 724 | mount -n -o remount,rw / |
22 | evaluate_retval | ||
23 | fi | ||
24 | |||
25 | niro | 1228 | if [[ ! -L /etc/mtab ]] || [[ $(readlink /etc/mtab) != /proc/mounts ]] |
26 | niro | 724 | then |
27 | niro | 1228 | rc_print "Recording existing mounts in /etc/mtab ..." |
28 | ln -snf /proc/mounts /etc/mtab | ||
29 | evaluate_retval | ||
30 | niro | 724 | 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 | niro | 735 | NO_FS="noswap,nonfs,nosmbfs,noproc,nocoda,noncpfs,noshm" |
38 | niro | 1168 | rc_print "Mounting remaining file systems ..." |
39 | niro | 724 | 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 | niro | 1168 | rc_print "Unmounting all other currently mounted file systems ..." |
48 | niro | 724 | if [ -e /dev/.udev ] |
49 | then | ||
50 | niro | 1196 | NO_FS="noramfs,notmpfs,nodevtmpfs,nodevpts" |
51 | niro | 724 | 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 | niro | 1168 | rc_print "Trying to eject the live-media ..." |
61 | niro | 724 | 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 | niro | 1196 | rc_echo "Usage: $0 {start|stop}" |
71 | niro | 724 | exit 1 |
72 | ;; | ||
73 | esac |