1 |
#!/bin/bash |
#!/bin/bash |
2 |
# $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/rc,v 1.10 2006-10-31 09:10:45 niro Exp $ |
# $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/rc,v 1.14 2007-03-06 00:10:26 niro Exp $ |
3 |
|
|
4 |
source /etc/sysconfig/rc |
source /etc/sysconfig/rc |
5 |
source $rc_functions |
source $rc_functions |
21 |
version=${version##0} |
version=${version##0} |
22 |
# Older udev's will print nothing |
# Older udev's will print nothing |
23 |
[[ -z ${version} ]] && version=0 |
[[ -z ${version} ]] && version=0 |
24 |
|
elif [[ -x /sbin/udevd ]] |
25 |
|
then |
26 |
|
version=$(/sbin/udevd --version) |
27 |
|
version=${version##0} |
28 |
|
[[ -z ${version} ]] && version=0 |
29 |
fi |
fi |
30 |
|
|
31 |
echo "${version}" |
echo "${version}" |
35 |
{ |
{ |
36 |
local opts |
local opts |
37 |
|
|
38 |
|
# tell modprobe.sh to be verbose to $CONSOLE |
39 |
|
echo CONSOLE=${CONSOLE} > /dev/.udev_populate |
40 |
|
|
41 |
# populate /dev with devices already found by the kernel |
# populate /dev with devices already found by the kernel |
42 |
if [ "$(kernel_version | sed 's:\.::g' | cut -d_ -f1)" -gt "2614" ] |
if [ "$(kernel_version | sed 's:\.::g' | cut -d_ -f1)" -gt "2614" ] |
43 |
then |
then |
44 |
echo -e ${COLOREDSTAR}" Populating /dev with existing devices through uevents ..." |
echo -e ${COLOREDSTAR}" Populating /dev with existing devices through uevents ..." |
45 |
[[ $(udev_version) -ge "96" ]] && opts="--attr-match=dev" |
[[ $(udev_version) -ge "96" ]] && [[ ${RC_COLDPLUG} != yes ]] && opts="--attr-match=dev" |
46 |
/sbin/udevtrigger ${opts} |
/sbin/udevtrigger ${opts} |
47 |
evaluate_retval |
evaluate_retval |
48 |
else |
else |
56 |
/sbin/udevsettle --timeout=60 |
/sbin/udevsettle --timeout=60 |
57 |
evaluate_retval |
evaluate_retval |
58 |
|
|
59 |
|
rm -f /dev/.udev_populate |
60 |
return 0 |
return 0 |
61 |
} |
} |
62 |
|
|
65 |
# seed /dev with some things that we know we need |
# seed /dev with some things that we know we need |
66 |
echo -e ${COLOREDSTAR}" Seeding /dev with needed nodes ..." |
echo -e ${COLOREDSTAR}" Seeding /dev with needed nodes ..." |
67 |
( |
( |
68 |
|
[ ! -c /dev/console ] && mknod /dev/console c 5 1 |
69 |
|
[ ! -c /dev/tty1 ] && mknod /dev/tty1 c 4 1 |
70 |
|
[ ! -c /dev/null ] && mknod /dev/null c 1 3 |
71 |
|
|
72 |
# copy over any persistant things |
# copy over any persistant things |
73 |
if [[ -d /lib/udev/devices ]] |
if [[ -d /lib/udev/devices ]] |
74 |
then |
then |
75 |
cp --preserve=all --recursive --update /lib/udev/devices/* /dev |
cp --preserve=all --recursive --update /lib/udev/devices/* /dev |
76 |
fi |
fi |
77 |
|
|
78 |
# not provided by sysfs but needed |
# not provided by sysfs but needed |
79 |
ln -snf /proc/self/fd /dev/fd |
ln -snf /proc/self/fd /dev/fd |
80 |
ln -snf fd/0 /dev/stdin |
ln -snf fd/0 /dev/stdin |
96 |
then |
then |
97 |
echo |
echo |
98 |
echo -e "${COLGREEN}Starting ${COLBLUE}MAGELLAN (v${MAGEVER}) ${COLGREEN}Linux${COLDEFAULT}" |
echo -e "${COLGREEN}Starting ${COLBLUE}MAGELLAN (v${MAGEVER}) ${COLGREEN}Linux${COLDEFAULT}" |
99 |
echo -e "Copyright 2001-2006 Niels Rogalla; http://magellan-linux.net" |
echo -e "Copyright 2001-2007 Niels Rogalla; http://magellan-linux.net" |
100 |
echo |
echo |
101 |
|
|
102 |
# mount proc filesystem, needed for bootsplash; |
# mount proc filesystem, needed for bootsplash; |
164 |
# load udev only with a 2.6 kernel |
# load udev only with a 2.6 kernel |
165 |
if [[ $(kernel_major_version) = 2.6 ]] && [[ ${RC_USED_DEV} = udev ]] |
if [[ $(kernel_major_version) = 2.6 ]] && [[ ${RC_USED_DEV} = udev ]] |
166 |
then |
then |
167 |
|
# check if /dev/console exists outside tmpfs |
168 |
|
[ -c /dev/console ] ; need_redirect=$? |
169 |
|
|
170 |
# create a ramdisk for populating udev |
# create a ramdisk for populating udev |
171 |
echo -e ${COLOREDSTAR}"Mounting udev at /dev ..." |
echo -e ${COLOREDSTAR}"Mounting udev at /dev ..." |
172 |
# many video drivers needed exec access |
# many video drivers needed exec access |
173 |
fstype=ramfs |
fstype=ramfs |
174 |
# tmpfs was suggested by Greg Kroah-Hartman |
# tmpfs was suggested by Greg Kroah-Hartman |
175 |
[[ kernel_supports_fs tmpfs ]] && fstype=tmpfs |
kernel_supports_fs tmpfs && fstype=tmpfs |
176 |
mount -n -t ${fstype} udev /dev -o exec,nosuid,mode=0755 |
mount -n -t ${fstype} udev /dev -o exec,nosuid,mode=0755 |
177 |
evaluate_retval |
evaluate_retval |
178 |
|
|
206 |
fi |
fi |
207 |
|
|
208 |
echo -e ${COLOREDSTAR}" Starting udevd daemon ..." |
echo -e ${COLOREDSTAR}" Starting udevd daemon ..." |
209 |
/sbin/udevd --daemon |
if [ ${need_redirect} -eq 1 ] |
210 |
|
then |
211 |
|
# we need to open fds 0 1 2 |
212 |
|
/sbin/udevd --daemon </dev/console >/dev/console 2>/dev/console |
213 |
|
else |
214 |
|
/sbin/udevd --daemon |
215 |
|
fi |
216 |
evaluate_retval |
evaluate_retval |
217 |
|
|
218 |
populate_udev |
populate_udev |