5 |
source ${rc_functions} |
source ${rc_functions} |
6 |
|
|
7 |
# get mage version |
# get mage version |
8 |
MAGEVER="$(< /etc/mageversion)" |
if [[ -f /etc/os-release ]] |
9 |
|
then |
10 |
|
MAGEVER="$(read_os_release version_id)" |
11 |
|
elif [ -f /etc/mageversion ] |
12 |
|
then |
13 |
|
MAGEVER="$(< /etc/mageversion)" |
14 |
|
else |
15 |
|
MAGEVER="unkown" |
16 |
|
fi |
17 |
|
|
18 |
# source kernel config if exists |
# source kernel config if exists |
19 |
[ -f /etc/conf.d/kernel ] && source /etc/conf.d/kernel |
[ -f /etc/conf.d/kernel ] && source /etc/conf.d/kernel |
20 |
|
|
21 |
# override devicemanager helper functions |
# override devicemanager helper functions |
22 |
if [[ ${RC_DEVICEMANAGER} = udev ]] |
if [[ ${RC_DEVICEMANAGER} = udev ]] && [[ -f ${rc_base}/init.d/udev ]] |
23 |
then |
then |
24 |
source ${rc_base}/init.d/udev |
source ${rc_base}/init.d/udev |
25 |
|
|
26 |
elif [[ ${RC_DEVICEMANAGER} = mdev ]] |
elif [[ ${RC_DEVICEMANAGER} = mdev ]] && [[ -f ${rc_base}/init.d/mdev ]] |
27 |
then |
then |
28 |
source ${rc_base}/init.d/mdev |
source ${rc_base}/init.d/mdev |
29 |
fi |
fi |
34 |
|
|
35 |
if [[ $runlevel = sysinit ]] |
if [[ $runlevel = sysinit ]] |
36 |
then |
then |
37 |
echo |
rc_echo |
38 |
echo -e "${COLGREEN}Starting ${COLBLUE}MAGELLAN (v${MAGEVER}) ${COLGREEN}Linux${COLDEFAULT}" |
rc_echo -e "${COLGREEN}Starting ${COLBLUE}MAGELLAN (v${MAGEVER}) ${COLGREEN}Linux${COLDEFAULT}" |
39 |
echo -e "Copyright 2001-2010 Niels Rogalla; http://magellan-linux.net" |
rc_echo "Copyright 2001-2012 Niels Rogalla; http://magellan-linux.net" |
40 |
echo |
rc_echo |
41 |
|
|
42 |
# mount proc filesystem, needed for bootsplash; |
# mount proc filesystem, needed for bootsplash; |
43 |
# no use of '/etc/rc.d/init.d/mountproc' anymore |
# no use of '/etc/rc.d/init.d/mountproc' anymore |
44 |
if [ ! -e /proc/mounts ] |
if [ ! -e /proc/mounts ] |
45 |
then |
then |
46 |
echo -e ${COLOREDSTAR}"Mounting proc file system ..." |
rc_print "Mounting proc file system ..." |
47 |
mount -n /proc |
mount -n /proc |
48 |
evaluate_retval |
evaluate_retval |
49 |
fi |
fi |
55 |
# mount sys file system before udev |
# mount sys file system before udev |
56 |
if [ -d /sys ] |
if [ -d /sys ] |
57 |
then |
then |
58 |
echo -e ${COLOREDSTAR}"Mounting sysfs file system ..." |
if [ ! -e /sys/kernel/notes ] |
59 |
mount -n -t sysfs sysfs /sys |
then |
60 |
evaluate_retval |
rc_print "Mounting sysfs file system ..." |
61 |
|
mount -n -t sysfs sysfs /sys |
62 |
|
evaluate_retval |
63 |
|
fi |
64 |
else |
else |
65 |
echo -e ${COLORED}"Fatal: mountpoint /sys missing ..." |
rc_echo -e ${COLRED}"Fatal: mountpoint /sys missing ..." |
66 |
echo -e ${COLYELLOW}"Please create the directory /sys (mkdir -p /sys)." |
rc_echo -e ${COLYELLOW}"Please create the directory /sys (mkdir -p /sys)." |
67 |
echo -e ${COLYELLOW}"It's essential for a 2.6 kernel." |
rc_echo -e ${COLYELLOW}"It's essential for a 2.6 kernel." |
68 |
fi |
fi |
69 |
|
|
70 |
|
# start device management |
|
#### load udev|mdev| #### |
|
71 |
start_devicemanager |
start_devicemanager |
|
## end udev|mdev ## |
|
|
|
|
72 |
|
|
73 |
## load devpts ## |
## load devpts ## |
74 |
# devfs/udev with 2.6 has no ptys, so devpts is also needed |
# devfs/udev with 2.6 has no ptys, so devpts is also needed |
82 |
if [ ! -d "/dev/pts" -a -e "/dev/.devfsd" ] && is_fs_mounted devfs |
if [ ! -d "/dev/pts" -a -e "/dev/.devfsd" ] && is_fs_mounted devfs |
83 |
then |
then |
84 |
mkdir -p /dev/pts &> /dev/null || \ |
mkdir -p /dev/pts &> /dev/null || \ |
85 |
echo "Could not create /dev/pts !" |
rc_echo "Could not create /dev/pts !" |
86 |
fi |
fi |
87 |
|
|
88 |
# now mount devpts |
# now mount devpts |
89 |
if [ -d /dev/pts ] |
if [ -d /dev/pts ] |
90 |
then |
then |
91 |
echo -e ${COLOREDSTAR}"Mounting devpts at /dev/pts ..." |
rc_print "Mounting devpts at /dev/pts ..." |
92 |
mount -n -t devpts -o gid=4,mode=0620 devpts /dev/pts |
mount -n -t devpts -o gid=4,mode=0620 devpts /dev/pts |
93 |
evaluate_retval |
evaluate_retval |
94 |
fi |
fi |
95 |
else |
else |
96 |
# devpts is not supported, give a warning |
# devpts is not supported, give a warning |
97 |
echo -e ${COLRED}"No devpts filesystem found ..." |
rc_echo -e ${COLRED}"No devpts filesystem found ..." |
98 |
echo -e ${COLYELLOW}"Your Kernel doesn't support the devpts filesystem." |
rc_echo -e ${COLYELLOW}"Your Kernel doesn't support the devpts filesystem." |
99 |
echo -e ${COLYELLOW}"Devfs/Udev with a kernel-2.6.x needs devpts," |
rc_echo -e ${COLYELLOW}"Devfs/Udev with a kernel-2.6.x needs devpts," |
100 |
echo -e ${COLYELLOW}"or no pty's are available." |
rc_echo -e ${COLYELLOW}"or no pty's are available." |
101 |
echo -e ${COLYELLOW}"Please make sure that this is enabled in your kernel." |
rc_echo -e ${COLYELLOW}"Please make sure that this is enabled in your kernel." |
102 |
echo |
rc_echo |
103 |
echo -e ${COLYELLOW}"Press any key to continue ..." |
rc_echo -e ${COLYELLOW}"Press any key to continue ..." |
104 |
read |
read |
105 |
fi |
fi |
106 |
## end devpts ## |
## end devpts ## |
109 |
## load usbfs ## |
## load usbfs ## |
110 |
if kernel_supports_fs usbfs |
if kernel_supports_fs usbfs |
111 |
then |
then |
112 |
echo -e ${COLOREDSTAR}"Mounting usbfs at /proc/bus/usb ..." |
rc_print "Mounting usbfs at /proc/bus/usb ..." |
113 |
mount -n -t usbfs usbfs /proc/bus/usb |
mount -n -t usbfs usbfs /proc/bus/usb |
114 |
evaluate_retval |
evaluate_retval |
115 |
fi |
fi |
116 |
## end usbfs ## |
## end usbfs ## |
117 |
|
|
118 |
## services state dir ## |
## services state dir ## |
119 |
echo -e ${COLOREDSTAR}"Mounting tmpfs at ${svcdir} ..." |
rc_print "Mounting tmpfs at ${svcdir} ..." |
120 |
mount -n -t tmpfs tmpfs "${svcdir}" -o rw,mode=0644,size="${svcsize}"k |
mount -n -t tmpfs tmpfs "${svcdir}" -o rw,mode=0644,size="${svcsize}"k |
121 |
evaluate_retval |
evaluate_retval |
122 |
|
|
136 |
if [[ ${RC_DEVICE_TARBALL} = yes ]] && \ |
if [[ ${RC_DEVICE_TARBALL} = yes ]] && \ |
137 |
[ -e /dev/.udev -a ! -e /dev/.devfsd -a ! -e /.bootdev ] |
[ -e /dev/.udev -a ! -e /dev/.devfsd -a ! -e /.bootdev ] |
138 |
then |
then |
139 |
echo -e ${COLOREDSTAR}"Saving /dev device nodes ..." |
rc_print "Saving /dev device nodes ..." |
140 |
( cd /dev; tar -jclpf "/tmp/devices-$$.tar.bz2" * &> /dev/null ) |
( cd /dev; tar -jclpf "/tmp/devices-$$.tar.bz2" * &> /dev/null ) |
141 |
mv -f "/tmp/devices-$$.tar.bz2" /lib/udev/state/devices.tar.bz2 |
mv -f "/tmp/devices-$$.tar.bz2" /lib/udev/state/devices.tar.bz2 |
142 |
evaluate_retval |
evaluate_retval |
143 |
fi |
fi |
144 |
|
|
145 |
# stop udev|mdev now |
# stop device management |
146 |
stop_devicemanager |
stop_devicemanager |
147 |
fi |
fi |
148 |
|
|
149 |
|
|
150 |
if [ "$runlevel" = "" ] |
if [ "$runlevel" = "" ] |
151 |
then |
then |
152 |
echo "Usage: $0 <runlevel>" >&2 |
rc_echo "Usage: $0 <runlevel>" >&2 |
153 |
exit 1 |
exit 1 |
154 |
fi |
fi |
155 |
|
|
159 |
|
|
160 |
if [ ! -d $rc_base/rc$runlevel.d ] |
if [ ! -d $rc_base/rc$runlevel.d ] |
161 |
then |
then |
162 |
echo "$rc_base/rc$runlevel.d does not exist" |
rc_echo "$rc_base/rc$runlevel.d does not exist" |
163 |
exit 1 |
exit 1 |
164 |
fi |
fi |
165 |
|
|
179 |
if [ ! -f $prev_start ] && [ ! -f $sysinit_start ] |
if [ ! -f $prev_start ] && [ ! -f $sysinit_start ] |
180 |
then |
then |
181 |
$WARNING |
$WARNING |
182 |
echo "$i can't be executed because it was" |
rc_echo "$i can't be executed because it was" |
183 |
echo "not started in the previous runlevel ($previous)" |
rc_echo "not started in the previous runlevel ($previous)" |
184 |
$NORMAL |
$NORMAL |
185 |
continue |
continue |
186 |
fi |
fi |