From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vassilis Virvilis Date: Thu, 23 Jun 2005 16:59:48 +0000 Subject: Re: udev vs. devfs Message-Id: <42BAEB62.4070906@iit.demokritos.gr> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org David Brownell wrote: > On Friday 17 June 2005 12:21 pm, David Brownell wrote: > >>On Thursday 16 June 2005 10:10 am, Vassilis Virvilis wrote: >> >>>... >>>I am sure somebody will popup with a better script/procedure or something >>>but anyway here are my 2dr. >> >>It hit the spot for me, pretty much. Here are my updated versions; >> David, Sorry for the long delay and glad that worked for you. Some questions though... > > ------------------------------------------------------------------------ > > #!/bin/ash > # > # "coldplug" ensures every hardware device present has its driver loaded, > # even if its hotplug event was ignored since it was too early in system > # startup for hotplug processing to work. Loading the driver will cause > # another hotplug event that will lead to /dev node creation. > # > # Run this during system startup shortly after /dev has been initialized > # using udevstart. > > if [ ! -d /sys/devices ] > then > exit 1 > fi good. > > # "new style" kernel hotplug has module-init-tools do the thinking > cd /sys/devices > for DIR in $(find . -type d) > do > if [ -f $DIR/modalias -a ! -f $DIR/driver ] > then > modprobe -q $(cat $DIR/modalias) > fi > done this I don't like. After demorgan that reads if [ ! -f $DIR/modalias -o -f $DIR/driver ] modprobe -q $(cat $DIR/modalias) fi which seems wrong On other complain. I am using initramfs and klibc. So `find` it's out of the question for me at least. I am open to suggestions. Nop ls `is` a don't have either. If you have any ideas I am all ears... > > # FIXME will MODULE_ALIAS("name.*") work for "name.3" devices? > cd /sys/devices/platform > for DEV in * > do > if [ ! -L $DEV/driver ] > then > # some platform drivers will need a MODULE_ALIAS() > modprobe -q $DEV > fi > done Doh! so that's why the damn thing was not autoloading my mouse. It is under /sys/devices/platform/i8042/. Good catch!!! Question: Doesn't catch it through the proper directory traversing? [snip pcmcia] > ------------------------------------------------------------------------ > > #!/bin/ash > # > # "hotplug" initializes devices ... hardware drivers get modprobed and > # create class devices. then later udev handles /dev node creation and > # invokes programs that make userspace aware of the new device node. > # > # install as /sbin/hotplug > > if [ ! -d /sys ] > then > exit 1 > fi > cd /sys > > if [ "$ACTION" = "add" -a "$SUBSYSTEM" = "mmc" ] > then > # MMC doesn't support modalias yet, but mmc_block is > # the only useful option until Linux gets SDIO support. > MODALIAS=mmc_block > fi > > if [ "$ACTION" = "add" -a -n "$MODALIAS" -a ! -L $DEVPATH/driver ] > then > # REVISIT: pcmcia currently needs special cases here, > # for non-static mapped sockets and many CF memory cards. > > # most important subsystems now have $MODALIAS support: > modprobe -q $MODALIAS > fi > > if [ -n "$DEVPATH" ] > then > /sbin/udevsend $1 > fi Good grace! It never occured to me to only run modpobe only if ACTION = add. MMC is memory card? with IDE interface? Should work, no? Do you have/had problems with them? .bill ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&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