1 |
#!/bin/bash |
#!/bin/bash |
2 |
# $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/rc,v 1.6 2006-01-03 18:03:21 niro Exp $ |
# $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/rc,v 1.9 2006-05-29 21:25:45 niro Exp $ |
3 |
|
|
4 |
source /etc/sysconfig/rc |
source /etc/sysconfig/rc |
5 |
source $rc_functions |
source $rc_functions |
10 |
# source kernel config if exists |
# source kernel config if exists |
11 |
[ -f /etc/conf.d/kernel ] && source /etc/conf.d/kernel |
[ -f /etc/conf.d/kernel ] && source /etc/conf.d/kernel |
12 |
|
|
13 |
|
udev_version() |
14 |
|
{ |
15 |
|
local version=0 |
16 |
|
|
17 |
|
if [[ -x /sbin/udev ]] |
18 |
|
then |
19 |
|
version=$(/sbin/udev -V) |
20 |
|
# We need it without a leading '0', else bash do the wrong thing |
21 |
|
version=${version##0} |
22 |
|
# Older udev's will print nothing |
23 |
|
[[ -z ${version} ]] && version=0 |
24 |
|
fi |
25 |
|
|
26 |
|
echo "${version}" |
27 |
|
} |
28 |
|
|
29 |
# this works only for 2.6.15 kernels and greater |
# this works only for 2.6.15 kernels and greater |
30 |
trigger_events() |
trigger_events() |
31 |
{ |
{ |
66 |
done |
done |
67 |
} |
} |
68 |
|
|
69 |
populate_udev() { |
populate_udev() |
70 |
|
{ |
71 |
local loop |
local loop |
72 |
|
|
73 |
# populate /dev with devices already found by the kernel |
# populate /dev with devices already found by the kernel |
74 |
if [ "$(kernel_version | sed 's:\.::g')" -gt "2614" ] |
if [ "$(kernel_version | sed 's:\.::g' | cut -d_ -f1)" -gt "2614" ] |
75 |
then |
then |
76 |
echo -e ${COLOREDSTAR}" Populating /dev with existing devices through uevents ..." |
echo -e ${COLOREDSTAR}" Populating /dev with existing devices through uevents ..." |
77 |
trigger_events |
trigger_events |
97 |
return 0 |
return 0 |
98 |
} |
} |
99 |
|
|
100 |
seed_dev() { |
seed_dev() |
101 |
|
{ |
102 |
# seed /dev with some things that we know we need |
# seed /dev with some things that we know we need |
103 |
echo -e ${COLOREDSTAR}" Seeding /dev with needed nodes ..." |
echo -e ${COLOREDSTAR}" Seeding /dev with needed nodes ..." |
104 |
( |
( |
118 |
evaluate_retval |
evaluate_retval |
119 |
} |
} |
120 |
|
|
|
# # some needed functions functions |
|
|
# populate_udev() { |
|
|
# /sbin/udevstart |
|
|
# |
|
|
# # not provided by sysfs but needed |
|
|
# ln -snf /proc/self/fd /dev/fd |
|
|
# ln -snf fd/0 /dev/stdin |
|
|
# ln -snf fd/1 /dev/stdout |
|
|
# ln -snf fd/2 /dev/stderr |
|
|
# ln -snf /proc/kcore /dev/core |
|
|
# ln -snf /proc/asound/oss/sndstat /dev/sndstat |
|
|
# |
|
|
# # create problematic directories |
|
|
# mkdir -p /dev/{pts,shm} |
|
|
# |
|
|
# # same as /dev/.devfsd |
|
|
# touch /dev/.udev |
|
|
# |
|
|
# return 0 |
|
|
# } |
|
|
|
|
121 |
trap "" INT QUIT TSTP |
trap "" INT QUIT TSTP |
122 |
|
|
123 |
[ "$1" != "" ] && runlevel=$1 |
[ "$1" != "" ] && runlevel=$1 |
126 |
then |
then |
127 |
echo |
echo |
128 |
echo -e "${COLGREEN}Starting ${COLBLUE}MAGELLAN (v${MAGEVER}) ${COLGREEN}Linux${COLDEFAULT}" |
echo -e "${COLGREEN}Starting ${COLBLUE}MAGELLAN (v${MAGEVER}) ${COLGREEN}Linux${COLDEFAULT}" |
129 |
echo -e "Copyright 2001-2005 Niels Rogalla; http://magellan-linux.net" |
echo -e "Copyright 2001-2006 Niels Rogalla; http://magellan-linux.net" |
130 |
echo |
echo |
131 |
|
|
132 |
# mount proc filesystem, needed for bootsplash; |
# mount proc filesystem, needed for bootsplash; |
215 |
|
|
216 |
if [ -e /proc/sys/kernel/hotplug ] |
if [ -e /proc/sys/kernel/hotplug ] |
217 |
then |
then |
218 |
if [ "$(kernel_version | sed 's:\.::g')" -gt "2614" ] |
if [ "$(kernel_version | sed 's:\.::g' | cut -d_ -f1)" -gt "2614" ] |
219 |
then |
then |
220 |
echo -e ${COLOREDSTAR}" Using netlink for hotplug events ..." |
echo -e ${COLOREDSTAR}" Using netlink for hotplug events ..." |
221 |
echo "" > /proc/sys/kernel/hotplug |
echo "" > /proc/sys/kernel/hotplug |