12 |
source /etc/sysconfig/rc |
source /etc/sysconfig/rc |
13 |
source $rc_functions |
source $rc_functions |
14 |
|
|
15 |
|
get_mounted(){ |
16 |
|
local filesys |
17 |
|
filesys=$1 |
18 |
|
|
19 |
|
cat /proc/mounts | grep ${filesys} | cut -d ' ' -f3 |
20 |
|
} |
21 |
|
|
22 |
|
|
23 |
case "$1" in |
case "$1" in |
24 |
start) |
start) |
25 |
echo -e ${COLOREDSTAR}"Recording existing mounts in /etc/mtab ..." |
echo -e ${COLOREDSTAR}"Recording existing mounts in /etc/mtab ..." |
35 |
#rm /.bootdev |
#rm /.bootdev |
36 |
fi |
fi |
37 |
|
|
38 |
#fake mount cloop |
#fake mount cloop, loop or sqsh |
39 |
mount -f /mnt/cdrom/livecdrootfs.cloop /mnt/cloop -t ext2 -o ro |
if [ -f /mnt/cdrom/livecdrootfs.loop ] |
40 |
|
then |
41 |
|
mount -f /mnt/cdrom/livecdrootfs.loop /mnt/cloop -t ext2 -o ro |
42 |
|
|
43 |
#fake mount dev |
elif [ -f /mnt/cdrom/livecdrootfs.cloop ] |
44 |
mount -f devfs /dev -t devfs -o rw |
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 |
#fake mount tmpfs |
#fake mount tmpfs |
77 |
mount -f tmpfs / -t tmpfs -o rw |
mount -f tmpfs / -t tmpfs -o rw |
78 |
|
|