32 |
evaluate_retval |
evaluate_retval |
33 |
} |
} |
34 |
|
|
35 |
|
# This works for 2.6.15 kernels or greater |
36 |
|
trigger_uevents() |
37 |
|
{ |
38 |
|
local list="" |
39 |
|
local i |
40 |
|
local first |
41 |
|
local last |
42 |
|
local default |
43 |
|
|
44 |
|
# if you want real coldplug (with all modules being loaded for all |
45 |
|
# devices in the system), uncomment out the next line. |
46 |
|
list="${lis}t $(echo /sys/bus/*/devices/*/uevent)" |
47 |
|
list="${list} $(echo /sys/class/*/*/uevent)" |
48 |
|
list="${list} $(echo /sys/block/*/uevent /sys/block/*/*/uevent)" |
49 |
|
for i in ${list} |
50 |
|
do |
51 |
|
case "${i}" in |
52 |
|
*/device/uevent) |
53 |
|
# skip followed device symlinks |
54 |
|
continue |
55 |
|
;; |
56 |
|
*/class/mem/*|*/class/tty/*) |
57 |
|
first="${first} ${i}" |
58 |
|
;; |
59 |
|
*/block/md*) |
60 |
|
last="${last} ${i}" |
61 |
|
;; |
62 |
|
*/*) |
63 |
|
default="${default} ${i}" |
64 |
|
;; |
65 |
|
esac |
66 |
|
done |
67 |
|
|
68 |
|
# trigger the sorted events |
69 |
|
for i in ${first} ${default} ${last} |
70 |
|
do |
71 |
|
echo "add" > "${i}" |
72 |
|
done |
73 |
|
} |
74 |
|
|
75 |
# main functions |
# main functions |
76 |
start_devicemanager() |
start_devicemanager() |
77 |
{ |
{ |
78 |
# create a ramdisk for populating mdev |
# create a ramdisk for populating mdev |
79 |
rc_print "Mounting mdev at /dev ..." |
if [[ -z $(grep '[[:space:]]/dev[[:space:]]' /proc/mounts | cut -d ' ' -f2) ]] |
80 |
# many video drivers needed exec access |
then |
81 |
fstype=ramfs |
rc_print "Mounting mdev at /dev ..." |
82 |
# tmpfs was suggested by Greg Kroah-Hartman |
# many video drivers needed exec access |
83 |
kernel_supports_fs tmpfs && fstype=tmpfs |
fstype=ramfs |
84 |
# mount devtmpfs if supported |
# tmpfs was suggested by Greg Kroah-Hartman |
85 |
kernel_supports_fs devtmpfs && fstype=devtmpfs |
kernel_supports_fs tmpfs && fstype=tmpfs |
86 |
mount -n -t ${fstype} mdev /dev -o exec,nosuid,mode=0755,size=1024 |
# mount devtmpfs if supported |
87 |
evaluate_retval |
kernel_supports_fs devtmpfs && fstype=devtmpfs |
88 |
|
mount -n -t ${fstype} dev /dev -o exec,nosuid,mode=0755,size=10M |
89 |
|
evaluate_retval |
90 |
|
fi |
91 |
|
|
92 |
# other eeded device nodes with udev |
# other needed device nodes with mdev |
93 |
seed_dev |
seed_dev |
94 |
|
|
95 |
if [ -e /proc/sys/kernel/hotplug ] |
if [ -e /proc/sys/kernel/hotplug ] |
108 |
modprobe -q unix 2>/dev/null |
modprobe -q unix 2>/dev/null |
109 |
fi |
fi |
110 |
|
|
111 |
|
rc_print " Populating /dev with existing devices through uevents ..." |
112 |
|
trigger_uevents |
113 |
|
|
114 |
rc_print " Starting mdev ..." |
rc_print " Starting mdev ..." |
115 |
/sbin/mdev -s |
/sbin/mdev -s |
116 |
evaluate_retval |
evaluate_retval |