From: Aras Vaichas <arasv@magellan-technology.com>
To: linux-hotplug@vger.kernel.org
Subject: 2.6.15, udev-080, init example
Date: Mon, 16 Jan 2006 04:12:17 +0000 [thread overview]
Message-ID: <43CB1D21.7000709@magellan-technology.com> (raw)
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
reply other threads:[~2006-01-16 4:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43CB1D21.7000709@magellan-technology.com \
--to=arasv@magellan-technology.com \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).