Contents of /trunk/magellan-initscripts/etc/rc.d/init.d/mountfslivecd
Parent Directory | Revision Log
Revision 71 -
(show annotations)
(download)
Tue Mar 15 19:07:56 2005 UTC (19 years, 3 months ago) by niro
File size: 2087 byte(s)
Tue Mar 15 19:07:56 2005 UTC (19 years, 3 months ago) by niro
File size: 2087 byte(s)
updated header and fixed whitespaces
1 | #!/bin/bash |
2 | # $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/mountfslivecd,v 1.3 2005-03-15 19:07:56 niro Exp $ |
3 | |
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 | get_mounted(){ |
17 | local filesys |
18 | filesys=$1 |
19 | |
20 | cat /proc/mounts | grep ${filesys} | cut -d ' ' -f3 |
21 | } |
22 | |
23 | |
24 | case "$1" in |
25 | start) |
26 | echo -e ${COLOREDSTAR}"Recording existing mounts in /etc/mtab ..." |
27 | > /etc/mtab |
28 | |
29 | #fake mount rootfs (taken from /.bootdev) |
30 | if [ -e /.bootdev ] |
31 | then |
32 | source /.bootdev |
33 | mount -f ${BOOTDEV} /mnt/cdrom -t ${FSTYPE} -o ro |
34 | #we don't delete this for the alx settings import |
35 | #wanna check if usbstorage or not |
36 | #rm /.bootdev |
37 | fi |
38 | |
39 | #fake mount cloop, loop or sqsh |
40 | if [ -f /mnt/cdrom/livecdrootfs.loop ] |
41 | then |
42 | mount -f /mnt/cdrom/livecdrootfs.loop /mnt/cloop -t ext2 -o ro |
43 | |
44 | elif [ -f /mnt/cdrom/livecdrootfs.cloop ] |
45 | then |
46 | mount -f /mnt/cdrom/livecdrootfs.cloop /mnt/cloop -t ext2 -o ro |
47 | |
48 | elif [ -f /mnt/cdrom/livecdrootfs.sqsh ] |
49 | then |
50 | mount -f /mnt/cdrom/livecdrootfs.sqsh /mnt/cloop -t ext2 -o ro |
51 | fi |
52 | |
53 | #records devfs if mounted |
54 | if [ "$(get_mounted devfs)" == devfs ] |
55 | then |
56 | mount -f -t devfs none /dev |
57 | fi |
58 | |
59 | #records devpts if mounted |
60 | if [ "$(get_mounted devpts)" == devpts ] |
61 | then |
62 | mount -f -t devpts none /dev/pts |
63 | fi |
64 | |
65 | #records sysfs if mounted |
66 | if [ "$(get_mounted sysfs)" == sysfs ] |
67 | then |
68 | mount -f -t sysfs none /sys |
69 | fi |
70 | |
71 | #records udev's ramfs if mounted |
72 | if [ "$(get_mounted ramfs)" == ramfs ] |
73 | then |
74 | mount -f -t ramfs none /dev |
75 | fi |
76 | |
77 | #fake mount tmpfs |
78 | mount -f tmpfs / -t tmpfs -o rw |
79 | |
80 | #fake mount proc |
81 | mount -f proc /proc -t proc -o rw |
82 | |
83 | evaluate_retval |
84 | |
85 | update_svcstatus $1 |
86 | splash svc_started "$(basename $0)" 0 |
87 | ;; |
88 | |
89 | stop) |
90 | echo -e ${COLOREDSTAR}"Unmounting all other currently mounted file systems ..." |
91 | #umount /dev |
92 | #umount /proc |
93 | #umount / |
94 | #umount -a -r |
95 | evaluate_retval |
96 | |
97 | update_svcstatus $1 |
98 | splash svc_stopped "$(basename $0)" 0 |
99 | ;; |
100 | |
101 | *) |
102 | echo "Usage: $0 {start|stop}" |
103 | exit 1 |
104 | ;; |
105 | esac |
Properties
Name | Value |
---|---|
svn:executable | * |