Magellan Linux

Annotation of /trunk/magellan-initscripts/etc/rc.d/init.d/mountfslivecd

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9 - (hide annotations) (download)
Mon Dec 13 23:22:23 2004 UTC (19 years, 4 months ago) by niro
File size: 1970 byte(s)
added dynamic mount of udev, devfs, devpts, sys, etc...

1 niro 2 #!/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 niro 9 get_mounted(){
16     local filesys
17     filesys=$1
18    
19     cat /proc/mounts | grep ${filesys} | cut -d ' ' -f3
20     }
21    
22    
23 niro 2 case "$1" in
24     start)
25     echo -e ${COLOREDSTAR}"Recording existing mounts in /etc/mtab ..."
26     > /etc/mtab
27    
28     #fake mount rootfs (taken from /.bootdev)
29     if [ -e /.bootdev ]
30     then
31     source /.bootdev
32     mount -f ${BOOTDEV} /mnt/cdrom -t ${FSTYPE} -o ro
33     #we don't delete this for the alx settings import
34     #wanna check if usbstorage or not
35     #rm /.bootdev
36     fi
37    
38 niro 9 #fake mount cloop, loop or sqsh
39     if [ -f /mnt/cdrom/livecdrootfs.loop ]
40     then
41     mount -f /mnt/cdrom/livecdrootfs.loop /mnt/cloop -t ext2 -o ro
42 niro 2
43 niro 9 elif [ -f /mnt/cdrom/livecdrootfs.cloop ]
44     then
45     mount -f /mnt/cdrom/livecdrootfs.cloop /mnt/cloop -t ext2 -o ro
46    
47     elif [ -f /mnt/cdrom/livecdrootfs.sqsh ]
48     then
49     mount -f /mnt/cdrom/livecdrootfs.sqsh /mnt/cloop -t ext2 -o ro
50     fi
51    
52     #records devfs if mounted
53     if [ "$(get_mounted devfs)" == devfs ]
54     then
55     mount -f -t devfs none /dev
56     fi
57    
58     #records devpts if mounted
59     if [ "$(get_mounted devpts)" == devpts ]
60     then
61     mount -f -t devpts none /dev/pts
62     fi
63    
64     #records sysfs if mounted
65     if [ "$(get_mounted sysfs)" == sysfs ]
66     then
67     mount -f -t sysfs none /sys
68     fi
69    
70     #records udev's ramfs if mounted
71     if [ "$(get_mounted ramfs)" == ramfs ]
72     then
73     mount -f -t ramfs none /dev
74     fi
75    
76 niro 2 #fake mount tmpfs
77     mount -f tmpfs / -t tmpfs -o rw
78    
79     #fake mount proc
80     mount -f proc /proc -t proc -o rw
81    
82     evaluate_retval
83    
84     update_svcstatus $1
85     splash svc_started "$(basename $0)" 0
86     ;;
87    
88     stop)
89     echo -e ${COLOREDSTAR}"Unmounting all other currently mounted file systems ..."
90     #umount /dev
91     #umount /proc
92     #umount /
93     #umount -a -r
94     evaluate_retval
95    
96     update_svcstatus $1
97     splash svc_stopped "$(basename $0)" 0
98     ;;
99    
100     *)
101     echo "Usage: $0 {start|stop}"
102     exit 1
103     ;;
104     esac

Properties

Name Value
svn:executable *