linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: linux-hotplug@vger.kernel.org
Subject: Re: udev vs. devfs
Date: Fri, 17 Jun 2005 19:26:52 +0000	[thread overview]
Message-ID: <200506171226.53160.david-b@pacbell.net> (raw)
In-Reply-To: <BAY19-F8BE196D4CCF42A9E246A6B9F50@phx.gbl>

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

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;
> 

Whoops, HERE they are.

[-- Attachment #2: coldplug --]
[-- Type: text/plain, Size: 1040 bytes --]

#!/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

# "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

# 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

# REVISIT pcmcia doesn't yet have "modalias" files
if [ -d /sys/bus/pcmcia/devices ]
then
	cd /sys/bus/pcmcia/devices
	for F in *
	do
		modprobe -q $(pcmcia-modalias $F)
	done
fi


[-- Attachment #3: hotplug --]
[-- Type: text/plain, Size: 806 bytes --]

#!/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

  parent reply	other threads:[~2005-06-17 19:26 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 [this message]
2005-06-20 12:52 ` Pelle Svensson
2005-06-23 16:59 ` Vassilis Virvilis
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=200506171226.53160.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --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).