8 |
[ -f /etc/conf.d/kernel ] && source /etc/conf.d/kernel |
[ -f /etc/conf.d/kernel ] && source /etc/conf.d/kernel |
9 |
|
|
10 |
# get mage version |
# get mage version |
11 |
MAGEVER="$(< /etc/mageversion)" |
if [[ -f /etc/os-release ]] |
12 |
|
then |
13 |
|
MAGEVER="$(read_os_release version_id)" |
14 |
|
elif [ -f /etc/mageversion ] |
15 |
|
then |
16 |
|
MAGEVER="$(< /etc/mageversion)" |
17 |
|
else |
18 |
|
MAGEVER="unkown" |
19 |
|
fi |
20 |
|
|
21 |
# source kernel config if exists |
# source kernel config if exists |
22 |
[ -f /etc/conf.d/kernel ] && source /etc/conf.d/kernel |
[ -f /etc/conf.d/kernel ] && source /etc/conf.d/kernel |
34 |
trap "" INT QUIT TSTP |
trap "" INT QUIT TSTP |
35 |
|
|
36 |
[ "$1" != "" ] && runlevel=$1 |
[ "$1" != "" ] && runlevel=$1 |
37 |
|
# export runlevel variable to make it accessible for other rc-scripts |
38 |
|
export runlevel |
39 |
|
|
40 |
if [[ $runlevel = sysinit ]] |
if [[ $runlevel = sysinit ]] |
41 |
then |
then |
42 |
rc_echo |
rc_echo |
43 |
rc_echo -e "${COLGREEN}Starting ${COLBLUE}MAGELLAN (v${MAGEVER}) ${COLGREEN}Linux${COLDEFAULT}" |
rc_echo -e "${COLGREEN}Starting ${COLBLUE}MAGELLAN (v${MAGEVER}) ${COLGREEN}Linux${COLDEFAULT}" |
44 |
rc_echo "Copyright 2001-2011 Niels Rogalla; http://magellan-linux.net" |
rc_echo "Copyright 2001-2012 Niels Rogalla; http://magellan-linux.net" |
45 |
rc_echo |
rc_echo |
46 |
|
|
47 |
# mount proc filesystem, needed for bootsplash; |
# mount proc filesystem, needed for bootsplash; |
63 |
# mount sys file system before udev |
# mount sys file system before udev |
64 |
if [ -d /sys ] |
if [ -d /sys ] |
65 |
then |
then |
66 |
rc_print "Mounting sysfs file system ..." |
if [ ! -e /sys/kernel/notes ] |
67 |
mount -n -t sysfs sysfs /sys |
then |
68 |
evaluate_retval |
rc_print "Mounting sysfs file system ..." |
69 |
|
mount -n -t sysfs sysfs /sys |
70 |
|
evaluate_retval |
71 |
|
fi |
72 |
else |
else |
73 |
rc_echo -e ${COLORED}"Fatal: mountpoint /sys missing ..." |
rc_echo -e ${COLRED}"Fatal: mountpoint /sys missing ..." |
74 |
rc_echo -e ${COLYELLOW}"Please create the directory /sys (mkdir -p /sys)." |
rc_echo -e ${COLYELLOW}"Please create the directory /sys (mkdir -p /sys)." |
75 |
rc_echo -e ${COLYELLOW}"It's essential for a 2.6 kernel." |
rc_echo -e ${COLYELLOW}"It's essential for a 2.6 kernel." |
76 |
fi |
fi |
136 |
|
|
137 |
# if requested save devices to a device tarball before halt |
# if requested save devices to a device tarball before halt |
138 |
# only for kernels >=2.6 *and* udev |
# only for kernels >=2.6 *and* udev |
139 |
# make shure that udev is mounted but *not* devfs --> /dev/.devfsd |
# make sure that udev is mounted but *not* devfs --> /dev/.devfsd |
140 |
if [[ ${RC_DEVICE_TARBALL} = yes ]] && \ |
if [[ ${RC_DEVICE_TARBALL} = yes ]] && \ |
141 |
[ -e /dev/.udev -a ! -e /dev/.devfsd -a ! -e /.bootdev ] |
[ -e /dev/.udev -a ! -e /dev/.devfsd -a ! -e /.bootdev ] |
142 |
then |
then |
182 |
done |
done |
183 |
fi |
fi |
184 |
|
|
185 |
if [[ ${runlevel} = boot ]] |
if [[ ${runlevel} = boot ]] || [[ ${runlevel} = shutdown ]] || [[ ${runlevel} = reboot ]] |
186 |
then |
then |
187 |
# exit bootsplash |
# exit bootsplash |
188 |
splash "rc_exit" "${runlevel}" |
splash "rc_exit" "${runlevel}" |