linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vassilis Virvilis <vasvir@iit.demokritos.gr>
To: linux-hotplug@vger.kernel.org
Subject: Re: udev vs. devfs
Date: Thu, 23 Jun 2005 16:59:48 +0000	[thread overview]
Message-ID: <42BAEB62.4070906@iit.demokritos.gr> (raw)
In-Reply-To: <BAY19-F8BE196D4CCF42A9E246A6B9F50@phx.gbl>

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_id\x16492&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

  parent reply	other threads:[~2005-06-23 16:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-16 15:07 udev vs. devfs Pelle Svensson
2005-06-16 17:10 ` Vassilis Virvilis
2005-06-16 18:37 ` Greg KH
2005-06-16 19:29 ` David Brownell
2005-06-17 12:42 ` Pelle Svensson
2005-06-17 12:58 ` Kay Sievers
2005-06-17 13:15 ` Pelle Svensson
2005-06-17 16:05 ` Greg KH
2005-06-17 19:21 ` David Brownell
2005-06-17 19:26 ` David Brownell
2005-06-20 12:52 ` Pelle Svensson
2005-06-23 16:59 ` Vassilis Virvilis [this message]
2005-06-28 11:24 ` Vassilis Virvilis

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=42BAEB62.4070906@iit.demokritos.gr \
    --to=vasvir@iit.demokritos.gr \
    --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).