diff options
author | ncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371> | 2006-10-24 12:26:42 +0000 |
---|---|---|
committer | ncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371> | 2006-10-24 12:26:42 +0000 |
commit | c8b95b81b69af4a0f90340f5874dcfe6ff057a9d (patch) | |
tree | 94bc4f11d8c3466b02d5aee235ff15c4fed3c50f /init.d/coldplug | |
download | alpine-baselayout-c8b95b81b69af4a0f90340f5874dcfe6ff057a9d.tar.bz2 alpine-baselayout-c8b95b81b69af4a0f90340f5874dcfe6ff057a9d.tar.xz |
initial import based on 1.0.1
Diffstat (limited to 'init.d/coldplug')
-rwxr-xr-x | init.d/coldplug | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/init.d/coldplug b/init.d/coldplug new file mode 100755 index 0000000..a39f39f --- /dev/null +++ b/init.d/coldplug @@ -0,0 +1,66 @@ +#!/sbin/runscript + +trigger_uevents() { + local i + for i in /sys/bus/*/devices/*/uevent\ + /sys/class/*/*/uevent\ + /sys/block/*/uevent\ + /sys/block/*/*/uevent ; do + case "$i" in + */device/uevent) + continue + ;; + */class/mem/*|*/class/tty/*) + echo add > "$i" + ;; + */block/md*|*/block/dm-*) + last="$last $i" + ;; + */*) + default="$default $i" + ;; + esac + done + for i in $default $last ; do + echo add > "$i" + done +} + +# coldplug devices +start() { + unset NOCOLDPLUG + # check for boot option "nocoldplug" + for i in `cat /proc/cmdline`; do + [ "$i" = "nocoldplug" ] && NOCOLDPLUG=true + done + + if [ "$NOCOLDPLUG" ]; then + ebegin "Skipping coldplugging" + eend 0 + return + fi + +# for rc in /etc/hotplug/*.rc ; do +# name=`basename $rc .rc` +# ebegin "Coldplugging $name devices" +# $rc start 2>/tmp/coldplug.err +# eend 0 +# done + ebegin "Coldplugging devices" +# while [ -d /dev/.udev/queue ] ; do +# sleep 1 +# echo -n "." +# done +# trigger_uevents +# sleep 1 +# while [ -d /dev/.udev/queue ] ; do +# sleep 1 +# echo -n "." +# done + find /sys -name modalias | while read a ; do + modprobe `cat $a` 2>/dev/null || echo $a >> /tmp/failed + done + eend 0 +} + + |