2.6.15, udev-080, init example
I have just upgraded to 2.6.15 and udev-080, and I am posting my init script as an example and for comment.
My two basics test are a) will it still boot, b) will it coldplug my USB Flash drive. So far, it passes both with no problems.
#cat /etc/init/rCS
<SNIP>
echo "mount sys and proc"
mount proc
mount sys
# disable old hotplug echo "" > /proc/sys/kernel/hotplug
# create /dev nodes echo "starting udev" echo "mounting ramfs at /dev" mount -n -t ramfs none /dev
# copy over some special nodes cp -a /lib/udev/devices/* /dev
# start the udevd daemon udevd --daemon
# coldplug any devices already inserted
echo "coldplug"
# create a dummy queue entry
mkdir -p /dev/.udev/queue
list=$(echo /sys/bus/*/devices/*/uevent)
list="$list $(echo /sys/class/*/*/uevent)"
list="$list $(echo /sys/block/*/uevent /sys/block/*/*/uevent)"
for i in $list; do
case "$i" in
*/device/uevent|*\**)
continue
;;
*/class/mem/*|*/class/tty/*)
first="$first $i"
;;
*/block/md*)
last="$last $i"
;;
*/*)
default="$default $i"
;;
esac
done# trigger the sorted events
for i in $first $default $last; do
echo "add" > "$i"
done# wait for events to finish
udevd_timeout
while [ -d /dev/.udev/queue/ ]; do
/usr/bin/sleep 1
udevd_timeout=$(($udevd_timeout - 1))
if [ $udevd_timeout -eq 0 ]; then
echo "!! coldplug timeout"
break
fi
done
echo "coldplug complete"echo "mount the rest of the filing systems"
mount -a
<UNSNIP>
# ll /lib/udev/devices/
total 16
drwxrwxr-x 4 root root 4096 Jan 16 14:04 . drwxrwxr-x 3 root root 4096 Jan 16 12:13 .. lrwxrwxrwx 1 root root 11 Jan 16 14:03 core -> /proc/kcore lrwxrwxrwx 1 root root 13 Jan 16 14:03 fd -> /proc/self/fd drwxr-xr-x 2 root root 4096 Jan 16 14:04 pts drwxrwxrwt 2 root root 4096 Jan 10 02:16 shm lrwxrwxrwx 1 root root 4 Jan 16 14:03 stderr -> fd/2 lrwxrwxrwx 1 root root 4 Jan 16 14:03 stdin -> fd/0 lrwxrwxrwx 1 root root 4 Jan 16 14:03 stdout -> fd/1
regards,
Aras Vaichas
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel