From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Fri, 13 Jan 2006 12:32:15 +0000 Subject: Re: cold plugging Message-Id: <20060113123215.GA3246@vrfy.org> 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 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_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