26 |
|
|
27 |
if [[ $runlevel = sysinit ]] |
if [[ $runlevel = sysinit ]] |
28 |
then |
then |
29 |
echo |
rc_echo |
30 |
echo -e "${COLGREEN}Starting ${COLBLUE}MAGELLAN (v${MAGEVER}) ${COLGREEN}Linux${COLDEFAULT}" |
rc_echo -e "${COLGREEN}Starting ${COLBLUE}MAGELLAN (v${MAGEVER}) ${COLGREEN}Linux${COLDEFAULT}" |
31 |
echo -e "Copyright 2001-2010 Niels Rogalla; http://magellan-linux.net" |
rc_echo -e "Copyright 2001-2010 Niels Rogalla; http://magellan-linux.net" |
32 |
echo |
rc_echo |
33 |
|
|
34 |
# mount proc filesystem, needed for bootsplash; |
# mount proc filesystem, needed for bootsplash; |
35 |
# no use of '/etc/rc.d/init.d/mountproc' anymore |
# no use of '/etc/rc.d/init.d/mountproc' anymore |
36 |
if [ ! -e /proc/mounts ] |
if [ ! -e /proc/mounts ] |
37 |
then |
then |
38 |
echo -e ${COLOREDSTAR}"Mounting proc file system ..." |
rc_print "Mounting proc file system ..." |
39 |
mount -n /proc |
mount -n /proc |
40 |
evaluate_retval |
evaluate_retval |
41 |
fi |
fi |
42 |
|
|
43 |
|
# load bootsplash |
44 |
|
splash "rc_init" "${runlevel}" |
45 |
|
|
46 |
# set default verbose level for kernel messages |
# set default verbose level for kernel messages |
47 |
[ -z "${RC_VERBOSE_LEVEL}" ] && RC_VERBOSE_LEVEL=3 |
[ -z "${RC_VERBOSE_LEVEL}" ] && RC_VERBOSE_LEVEL=3 |
48 |
echo "${RC_VERBOSE_LEVEL}" > /proc/sys/kernel/printk |
echo "${RC_VERBOSE_LEVEL}" > /proc/sys/kernel/printk |
50 |
# mount sys file system before udev |
# mount sys file system before udev |
51 |
if [ -d /sys ] |
if [ -d /sys ] |
52 |
then |
then |
53 |
echo -e ${COLOREDSTAR}"Mounting sysfs file system ..." |
rc_print "Mounting sysfs file system ..." |
54 |
mount -n -t sysfs sysfs /sys |
mount -n -t sysfs sysfs /sys |
55 |
evaluate_retval |
evaluate_retval |
56 |
else |
else |
57 |
echo -e ${COLORED}"Fatal: mountpoint /sys missing ..." |
rc_echo -e ${COLORED}"Fatal: mountpoint /sys missing ..." |
58 |
echo -e ${COLYELLOW}"Please create the directory /sys (mkdir -p /sys)." |
rc_echo -e ${COLYELLOW}"Please create the directory /sys (mkdir -p /sys)." |
59 |
echo -e ${COLYELLOW}"It's essential for a 2.6 kernel." |
rc_echo -e ${COLYELLOW}"It's essential for a 2.6 kernel." |
60 |
fi |
fi |
61 |
|
|
62 |
#### load udev #### |
#### load udev #### |
75 |
if [ ! -d "/dev/pts" -a -e "/dev/.devfsd" ] && is_fs_mounted devfs |
if [ ! -d "/dev/pts" -a -e "/dev/.devfsd" ] && is_fs_mounted devfs |
76 |
then |
then |
77 |
mkdir -p /dev/pts &> /dev/null || \ |
mkdir -p /dev/pts &> /dev/null || \ |
78 |
echo "Could not create /dev/pts !" |
rc_echo "Could not create /dev/pts !" |
79 |
fi |
fi |
80 |
|
|
81 |
# now mount devpts |
# now mount devpts |
82 |
if [ -d /dev/pts ] |
if [ -d /dev/pts ] |
83 |
then |
then |
84 |
echo -e ${COLOREDSTAR}"Mounting devpts at /dev/pts ..." |
rc_print "Mounting devpts at /dev/pts ..." |
85 |
mount -n -t devpts -o gid=4,mode=0620 devpts /dev/pts |
mount -n -t devpts -o gid=4,mode=0620 devpts /dev/pts |
86 |
evaluate_retval |
evaluate_retval |
87 |
fi |
fi |
88 |
else |
else |
89 |
# devpts is not supported, give a warning |
# devpts is not supported, give a warning |
90 |
echo -e ${COLRED}"No devpts filesystem found ..." |
rc_echo -e ${COLRED}"No devpts filesystem found ..." |
91 |
echo -e ${COLYELLOW}"Your Kernel doesn't support the devpts filesystem." |
rc_echo -e ${COLYELLOW}"Your Kernel doesn't support the devpts filesystem." |
92 |
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," |
93 |
echo -e ${COLYELLOW}"or no pty's are available." |
rc_echo -e ${COLYELLOW}"or no pty's are available." |
94 |
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." |
95 |
echo |
rc_echo |
96 |
echo -e ${COLYELLOW}"Press any key to continue ..." |
rc_echo -e ${COLYELLOW}"Press any key to continue ..." |
97 |
read |
read |
98 |
fi |
fi |
99 |
## end devpts ## |
## end devpts ## |
102 |
## load usbfs ## |
## load usbfs ## |
103 |
if kernel_supports_fs usbfs |
if kernel_supports_fs usbfs |
104 |
then |
then |
105 |
echo -e ${COLOREDSTAR}"Mounting usbfs at /proc/bus/usb ..." |
rc_print "Mounting usbfs at /proc/bus/usb ..." |
106 |
mount -n -t usbfs usbfs /proc/bus/usb |
mount -n -t usbfs usbfs /proc/bus/usb |
107 |
evaluate_retval |
evaluate_retval |
108 |
fi |
fi |
109 |
## end usbfs ## |
## end usbfs ## |
110 |
|
|
111 |
## services state dir ## |
## services state dir ## |
112 |
echo -e ${COLOREDSTAR}"Mounting tmpfs at ${svcdir} ..." |
rc_print "Mounting tmpfs at ${svcdir} ..." |
113 |
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 |
114 |
evaluate_retval |
evaluate_retval |
|
|
|
|
# load bootsplash |
|
|
splash "rc_init" "${runlevel}" |
|
115 |
fi |
fi |
116 |
|
|
117 |
if [[ ${runlevel} = shutdown ]] || [[ ${runlevel} = reboot ]] |
if [[ ${runlevel} = shutdown ]] || [[ ${runlevel} = reboot ]] |
125 |
if [[ ${RC_DEVICE_TARBALL} = yes ]] && \ |
if [[ ${RC_DEVICE_TARBALL} = yes ]] && \ |
126 |
[ -e /dev/.udev -a ! -e /dev/.devfsd -a ! -e /.bootdev ] |
[ -e /dev/.udev -a ! -e /dev/.devfsd -a ! -e /.bootdev ] |
127 |
then |
then |
128 |
echo -e ${COLOREDSTAR}"Saving /dev device nodes ..." |
rc_print "Saving /dev device nodes ..." |
129 |
( cd /dev; tar -jclpf "/tmp/devices-$$.tar.bz2" * &> /dev/null ) |
( cd /dev; tar -jclpf "/tmp/devices-$$.tar.bz2" * &> /dev/null ) |
130 |
mv -f "/tmp/devices-$$.tar.bz2" /lib/udev/state/devices.tar.bz2 |
mv -f "/tmp/devices-$$.tar.bz2" /lib/udev/state/devices.tar.bz2 |
131 |
evaluate_retval |
evaluate_retval |
166 |
fi |
fi |
167 |
done |
done |
168 |
fi |
fi |
169 |
|
|
170 |
|
if [[ ${runlevel} = boot ]] |
171 |
|
then |
172 |
|
# exit bootsplash |
173 |
|
splash "rc_exit" "${runlevel}" |
174 |
|
fi |