linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.15, udev-080, init example
@ 2006-01-16  4:12 Aras Vaichas
  0 siblings, 0 replies; only message in thread
From: Aras Vaichas @ 2006-01-16  4:12 UTC (permalink / raw)
  To: linux-hotplug

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\x10
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_id\x16865&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-01-16  4:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-16  4:12 2.6.15, udev-080, init example Aras Vaichas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).