Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 781 - (hide annotations) (download)
Mon Dec 22 22:01:15 2008 UTC (15 years, 4 months ago) by niro
File size: 3038 byte(s)
-use /etc/conf.d/rc instead of /etc/sysconfig/rc

1 niro 2 #!/bin/bash
2 niro 781 # $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/mountfs,v 1.12 2008-12-22 22:01:15 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 niro 781 source /etc/conf.d/rc
14     source ${rc_functions}
15 niro 2
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 niro 691
36 niro 342 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 niro 691 is_fs_mounted devfs && mount -f -t devfs devfs /dev
53 niro 71
54 niro 149 # records devpts as mounted
55 niro 691 is_fs_mounted devpts && mount -f -t devpts devpts /dev/pts
56 niro 2
57 niro 149 # records sysfs as mounted
58 niro 691 is_fs_mounted sysfs && mount -f -t sysfs sysfs /sys
59 niro 71
60 niro 149 # records udev as mounted
61     if is_fs_mounted udev
62 niro 2 then
63 niro 512 # get the fstype of udev - it may be ramfs or tmpfs
64 niro 520 udev_fstype="$(cat /proc/mounts | grep udev | cut -d ' ' -f3)"
65 niro 518 # get the right mount opts - udev with tmpfs comes nosuid
66 niro 520 udev_mopts="$(cat /proc/mounts | grep udev | cut -d ' ' -f4)"
67 niro 518 mount -f -t ${udev_fstype} -o ${udev_mopts} udev /dev
68 niro 2 fi
69    
70 niro 513 # records usbfs as mounted
71 niro 691 is_fs_mounted usbfs && mount -f -t usbfs usbfs /proc/bus/usb
72 niro 513
73 niro 2 evaluate_retval
74    
75     # The following mount command will mount all file systems. If you
76     # have other (network based) file system that should not be or
77     # cannot be mounted at this time, add them to the NO_FS variable
78     # below. All file systems that are added to the variable in the
79     # form of no<filesystem> will be skipped.
80     NO_FS="nonfs,nosmbfs,noproc,nocoda,noncpfs,noshm"
81     echo -e ${COLOREDSTAR}"Mounting remaining file systems ..."
82     mount -a -t $NO_FS
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     if [ -e /dev/.udev ]
92     then
93     NO_FS="noramfs"
94     umount -a -r -d -t ${NO_FS}
95     else
96     # -d, umount loop devices as well
97     umount -a -r -d
98     fi
99     evaluate_retval
100    
101 niro 342 if [ -e /.bootdev ] && [ -x /usr/bin/eject ]
102     then
103 niro 354 echo -e ${COLOREDSTAR}"Trying to eject the live-media ..."
104 niro 342 eject -m /mnt/cdrom &> /dev/null
105     evaluate_retval
106     fi
107    
108 niro 2 update_svcstatus $1
109     splash svc_stopped "$(basename $0)" 0
110     ;;
111    
112     *)
113     echo "Usage: $0 {start|stop}"
114     exit 1
115     ;;
116     esac

Properties

Name Value
svn:executable *