linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: cold plugging
Date: Fri, 13 Jan 2006 12:32:15 +0000	[thread overview]
Message-ID: <20060113123215.GA3246@vrfy.org> (raw)
In-Reply-To: <200601131415.30207.treeve@scarlet.be>

On Fri, Jan 13, 2006 at 02:15:30PM +0100, Treeve Jelbert wrote:
> I am running kernel-2.6.15 and udev-80 in a build everything from source 
> environment.
> 
> the kernel has lots of modules.
> 
> when the system is fully up, new hardware is detected and processed correctly 
> by udev.
> 
> my problem concerns hardware which is present before udevd starts, eg usb, 
> pcmcia, 1394, ....
> 
> udev does not seem to process any UEVENTS  for these things.  I tried 
> udevstart, but this seems to have no effect.

Don't use udev, udevsend and udevstart anymore, if you don't really need
to. The 2.6.15 kernel and udevd is all you need.

> Which program should be run to detect entries in /sys , trigger a UEVENT and 
> hence the execution of the udev rules, in order to load modules and create 
> device nodes?
> 
> I assume that somebody has a script or program that does this.
> 
> With previous kernels, I used udevsend as a hotplug driver and the relevant 
> modules did get loaded.

No, this never worked with udevsend. At the time udevsend is executed and
the modules too, all early events are already lost unless you have recorded
them in initramfs.

You need to retrigger all events after you have started udevd, just
write "add" to all "uevent" files in /sys and the events will be sent to
the udev daemon, which will create the device nodes and run modprobe and
other tools to setup the devices.

I'm using this:
	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


To wait for the events to finish (if you need to), I do:
	loop00
	while test -d /dev/.udev/queue; do
	    sleep 0.1;
	    test "$loop" -gt 0 || break
	    loop=$(($loop - 1))
	done

Kay


-------------------------------------------------------
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-13 12:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-13 12:17 cold plugging Treeve Jelbert
2006-01-13 12:32 ` Kay Sievers [this message]
2006-01-13 16:23 ` Alexander E. Patrakov
2006-01-13 18:47 ` Darren Salt
2006-01-13 18:52 ` Greg KH
2006-01-13 19:13 ` Scott James Remnant
2006-01-13 19:15 ` Marco d'Itri
2006-01-13 20:08 ` Darren Salt
2006-01-13 23:29 ` Pozsar Balazs
2006-01-13 23:53 ` Greg KH
2006-01-14  5:00 ` Alexander E. Patrakov
2006-01-14  5:57 ` Alexander E. Patrakov
2006-01-14  8:45 ` Pozsar Balazs
2006-01-14 12:48 ` Kay Sievers
2006-01-14 13:08 ` Kay Sievers
2006-01-14 13:10 ` Alexander E. Patrakov
2006-01-14 13:27 ` Kay Sievers
2006-01-14 16:28 ` Alexander E. Patrakov
2006-01-15  4:13 ` Dmitry Torokhov
2006-01-15 22:44 ` Aras Vaichas
2006-01-16 12:36 ` Kay Sievers
2006-01-16 12:53 ` Kay Sievers
2006-01-16 12:59 ` Olivier Blin

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=20060113123215.GA3246@vrfy.org \
    --to=kay.sievers@vrfy.org \
    --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).