Annotation of /trunk/magellan-initscripts/rc/mountfs
Parent Directory | Revision Log
Revision 354 -
(hide annotations)
(download)
Sat Mar 25 13:06:53 2006 UTC (18 years, 6 months ago) by niro
Original Path: trunk/magellan-initscripts/etc/rc.d/init.d/mountfs
File size: 2719 byte(s)
Sat Mar 25 13:06:53 2006 UTC (18 years, 6 months ago) by niro
Original Path: trunk/magellan-initscripts/etc/rc.d/init.d/mountfs
File size: 2719 byte(s)
nicer eject message
1 | niro | 2 | #!/bin/bash |
2 | niro | 354 | # $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/mountfs,v 1.6 2006-03-25 13:06:53 niro Exp $ |
3 | niro | 2 | |
4 | #%rlevels: 7:s 0:k 6:k | ||
5 | #%start: 40 | ||
6 | #%stop: 60 | ||
7 | |||
8 | #deps | ||
9 | #%needs: | ||
10 | #%before: | ||
11 | #%after: | ||
12 | |||
13 | source /etc/sysconfig/rc | ||
14 | source $rc_functions | ||
15 | |||
16 | case "$1" in | ||
17 | start) | ||
18 | niro | 342 | # fake mounts rootfs (taken from /.bootdev) |
19 | if [ -e /.bootdev ] | ||
20 | then | ||
21 | source /.bootdev | ||
22 | mount -f ${BOOTDEV} /mnt/cdrom -t ${FSTYPE} -o ro | ||
23 | # we don't delete this for the alx settings import | ||
24 | # wanna check if usbstorage or not | ||
25 | # rm /.bootdev | ||
26 | niro | 2 | |
27 | niro | 342 | # fake mounts cloop, loop or sqsh |
28 | if [ -f /mnt/cdrom/livecdrootfs.loop ] | ||
29 | then | ||
30 | mount -f /mnt/cdrom/livecdrootfs.loop /mnt/cloop -t ext2 -o ro | ||
31 | |||
32 | elif [ -f /mnt/cdrom/livecdrootfs.cloop ] | ||
33 | then | ||
34 | mount -f /mnt/cdrom/livecdrootfs.cloop /mnt/cloop -t ext2 -o ro | ||
35 | |||
36 | elif [ -f /mnt/cdrom/livecdrootfs.sqsh ] | ||
37 | then | ||
38 | mount -f /mnt/cdrom/livecdrootfs.sqsh /mnt/cloop -t ext2 -o ro | ||
39 | fi | ||
40 | else | ||
41 | echo -e ${COLOREDSTAR}"Remounting root file system in read-write mode ..." | ||
42 | mount -n -o remount,rw / | ||
43 | evaluate_retval | ||
44 | fi | ||
45 | |||
46 | niro | 2 | echo -e ${COLOREDSTAR}"Recording existing mounts in /etc/mtab ..." |
47 | > /etc/mtab | ||
48 | niro | 342 | |
49 | niro | 2 | mount -f / && mount -f /proc |
50 | niro | 71 | |
51 | niro | 149 | # records devfs as mounted |
52 | if is_fs_mounted devfs | ||
53 | niro | 2 | then |
54 | niro | 149 | mount -f -t devfs devfs /dev |
55 | niro | 2 | fi |
56 | niro | 71 | |
57 | niro | 149 | # records devpts as mounted |
58 | if is_fs_mounted devpts | ||
59 | niro | 2 | then |
60 | niro | 149 | mount -f -t devpts devpts /dev/pts |
61 | niro | 2 | fi |
62 | |||
63 | niro | 149 | # records sysfs as mounted |
64 | if is_fs_mounted sysfs | ||
65 | niro | 2 | then |
66 | niro | 149 | mount -f -t sysfs sysfs /sys |
67 | niro | 2 | fi |
68 | niro | 71 | |
69 | niro | 149 | # records udev as mounted |
70 | if is_fs_mounted udev | ||
71 | niro | 2 | then |
72 | niro | 149 | mount -f -t ramfs udev /dev |
73 | niro | 2 | fi |
74 | |||
75 | evaluate_retval | ||
76 | |||
77 | # The following mount command will mount all file systems. If you | ||
78 | # have other (network based) file system that should not be or | ||
79 | # cannot be mounted at this time, add them to the NO_FS variable | ||
80 | # below. All file systems that are added to the variable in the | ||
81 | # form of no<filesystem> will be skipped. | ||
82 | |||
83 | NO_FS="nonfs,nosmbfs,noproc,nocoda,noncpfs,noshm" | ||
84 | echo -e ${COLOREDSTAR}"Mounting remaining file systems ..." | ||
85 | mount -a -t $NO_FS | ||
86 | evaluate_retval | ||
87 | |||
88 | update_svcstatus $1 | ||
89 | splash svc_started "$(basename $0)" 0 | ||
90 | ;; | ||
91 | |||
92 | stop) | ||
93 | echo -e ${COLOREDSTAR}"Unmounting all other currently mounted file systems ..." | ||
94 | if [ -e /dev/.udev ] | ||
95 | then | ||
96 | NO_FS="noramfs" | ||
97 | umount -a -r -d -t ${NO_FS} | ||
98 | else | ||
99 | # -d, umount loop devices as well | ||
100 | umount -a -r -d | ||
101 | fi | ||
102 | evaluate_retval | ||
103 | |||
104 | niro | 342 | if [ -e /.bootdev ] && [ -x /usr/bin/eject ] |
105 | then | ||
106 | niro | 354 | echo -e ${COLOREDSTAR}"Trying to eject the live-media ..." |
107 | niro | 342 | eject -m /mnt/cdrom &> /dev/null |
108 | evaluate_retval | ||
109 | fi | ||
110 | |||
111 | niro | 2 | update_svcstatus $1 |
112 | splash svc_stopped "$(basename $0)" 0 | ||
113 | ;; | ||
114 | |||
115 | *) | ||
116 | echo "Usage: $0 {start|stop}" | ||
117 | exit 1 | ||
118 | ;; | ||
119 | esac |
Properties
Name | Value |
---|---|
svn:executable | * |