From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Alexander E. Patrakov" Date: Fri, 13 Jan 2006 16:23:51 +0000 Subject: Re: cold plugging Message-Id: <43C7D417.3040807@ums.usu.ru> 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 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. >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. -- Alexander E. Patrakov ------------------------------------------------------- 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