From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Fri, 13 Jan 2006 18:52:03 +0000 Subject: Re: cold plugging Message-Id: <20060113185203.GA16552@kroah.com> List-Id: References: <200601131415.30207.treeve@scarlet.be> In-Reply-To: <200601131415.30207.treeve@scarlet.be> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Fri, Jan 13, 2006 at 09:23:51PM +0500, Alexander E. Patrakov wrote: > Kay Sievers wrote: > > >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 > > > > > Why sort the events? They arrive at udevd in random order anyway. Because many things need /dev/null and the tty device nodes in their handlers and scripts, so they need to be created first. Try it and see if you don't believe us :) > >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 > > > > > USB uevents easily get past this loop. I have a check in my script that > sleeps 2 seconds after that and reports all new uevents in those 2 > seconds as possible bugs. Why does USB take longer for you? What is taking such a long time? thanks, greg k-h ------------------------------------------------------- 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 Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel