3 |
|
|
4 |
#%rlevels: 7:s 0:k |
#%rlevels: 7:s 0:k |
5 |
#%start: 40 |
#%start: 40 |
6 |
#%stop: 60 |
#%stop: 90 |
7 |
|
|
8 |
#deps |
#deps |
9 |
#%needs: |
#%needs: |
15 |
|
|
16 |
case "$1" in |
case "$1" in |
17 |
start) |
start) |
18 |
# fake mounts rootfs (taken from /.bootdev) |
if [ ! -e /.bootdev ] |
|
if [ -e /.bootdev ] |
|
19 |
then |
then |
20 |
source /.bootdev |
rc_print "Remounting root file system in read-write mode ..." |
|
mount -f ${BOOTDEV} /mnt/cdrom -t ${FSTYPE} -o ro |
|
|
# we don't delete this for the alx settings import |
|
|
# wanna check if usbstorage or not |
|
|
# rm /.bootdev |
|
|
|
|
|
# fake mounts cloop, loop or sqsh |
|
|
if [ -f /mnt/cdrom/livecdrootfs.loop ] |
|
|
then |
|
|
mount -f /mnt/cdrom/livecdrootfs.loop /mnt/cloop -t ext2 -o ro |
|
|
|
|
|
elif [ -f /mnt/cdrom/livecdrootfs.cloop ] |
|
|
then |
|
|
mount -f /mnt/cdrom/livecdrootfs.cloop /mnt/cloop -t ext2 -o ro |
|
|
|
|
|
elif [ -f /mnt/cdrom/livecdrootfs.sqsh ] |
|
|
then |
|
|
mount -f /mnt/cdrom/livecdrootfs.sqsh /mnt/cloop -t ext2 -o ro |
|
|
fi |
|
|
else |
|
|
echo -e ${COLOREDSTAR}"Remounting root file system in read-write mode ..." |
|
21 |
mount -n -o remount,rw / |
mount -n -o remount,rw / |
22 |
evaluate_retval |
evaluate_retval |
23 |
fi |
fi |
24 |
|
|
25 |
echo -e ${COLOREDSTAR}"Recording existing mounts in /etc/mtab ..." |
if [[ ! -L /etc/mtab ]] || [[ $(readlink /etc/mtab) != /proc/mounts ]] |
|
> /etc/mtab |
|
|
|
|
|
mount -f / && mount -f /proc |
|
|
|
|
|
# records devfs as mounted |
|
|
is_fs_mounted devfs && mount -f -t devfs devfs /dev |
|
|
|
|
|
# records devpts as mounted |
|
|
is_fs_mounted devpts && mount -f -t devpts devpts /dev/pts |
|
|
|
|
|
# records sysfs as mounted |
|
|
is_fs_mounted sysfs && mount -f -t sysfs sysfs /sys |
|
|
|
|
|
# records udev as mounted |
|
|
if is_fs_mounted udev |
|
26 |
then |
then |
27 |
# get the fstype of udev - it may be ramfs or tmpfs |
rc_print "Recording existing mounts in /etc/mtab ..." |
28 |
udev_fstype="$(cat /proc/mounts | grep udev | cut -d ' ' -f3)" |
ln -snf /proc/mounts /etc/mtab |
29 |
# get the right mount opts - udev with tmpfs comes nosuid |
evaluate_retval |
|
udev_mopts="$(cat /proc/mounts | grep udev | cut -d ' ' -f4)" |
|
|
mount -f -t ${udev_fstype} -o ${udev_mopts} udev /dev |
|
30 |
fi |
fi |
31 |
|
|
|
# records usbfs as mounted |
|
|
is_fs_mounted usbfs && mount -f -t usbfs usbfs /proc/bus/usb |
|
|
|
|
|
evaluate_retval |
|
|
|
|
32 |
# The following mount command will mount all file systems. If you |
# The following mount command will mount all file systems. If you |
33 |
# have other (network based) file system that should not be or |
# 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 |
# 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 |
# below. All file systems that are added to the variable in the |
36 |
# form of no<filesystem> will be skipped. |
# form of no<filesystem> will be skipped. |
37 |
NO_FS="noswap,nonfs,nosmbfs,noproc,nocoda,noncpfs,noshm" |
NO_FS="noswap,nonfs,nosmbfs,noproc,nocoda,noncpfs,noshm" |
38 |
echo -e ${COLOREDSTAR}"Mounting remaining file systems ..." |
rc_print "Mounting remaining file systems ..." |
39 |
mount -a -t $NO_FS |
mount -a -t $NO_FS |
40 |
evaluate_retval |
evaluate_retval |
41 |
|
|
44 |
;; |
;; |
45 |
|
|
46 |
stop) |
stop) |
47 |
echo -e ${COLOREDSTAR}"Unmounting all other currently mounted file systems ..." |
rc_print "Unmounting all other currently mounted file systems ..." |
48 |
if [ -e /dev/.udev ] |
if [ -e /dev/.udev ] |
49 |
then |
then |
50 |
NO_FS="noramfs,notmpfs" |
NO_FS="noramfs,notmpfs,nodevtmpfs,nodevpts,noproc" |
51 |
umount -a -r -d -t ${NO_FS} |
umount -a -r -d -t ${NO_FS} |
52 |
else |
else |
53 |
# -d, umount loop devices as well |
# -d, umount loop devices as well |
57 |
|
|
58 |
if [ -e /.bootdev ] && [ -x /usr/bin/eject ] |
if [ -e /.bootdev ] && [ -x /usr/bin/eject ] |
59 |
then |
then |
60 |
echo -e ${COLOREDSTAR}"Trying to eject the live-media ..." |
rc_print "Trying to eject the live-media ..." |
61 |
eject -m /mnt/cdrom &> /dev/null |
eject -m /mnt/cdrom &> /dev/null |
62 |
evaluate_retval |
evaluate_retval |
63 |
fi |
fi |
67 |
;; |
;; |
68 |
|
|
69 |
*) |
*) |
70 |
echo "Usage: $0 {start|stop}" |
rc_echo "Usage: $0 {start|stop}" |
71 |
exit 1 |
exit 1 |
72 |
;; |
;; |
73 |
esac |
esac |