linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udev for dummies
@ 2003-12-11 22:16 J.A. Magallon
  2003-12-11 22:59 ` David T Hollis
  2003-12-12 21:31 ` Greg KH
  0 siblings, 2 replies; 7+ messages in thread
From: J.A. Magallon @ 2003-12-11 22:16 UTC (permalink / raw)
  To: Lista Linux-Kernel

Hi all...

I am starting to use 2.6, and I really would like to use udev.
But I can't find a doc about how to move from taditional heavily
populated /dev to new method.

Any pointer ?

I have installed udev and hotplug utils, and have hotplug enabled in
kernel.
As I undestand it, I should do now something like
- run udev for the first time, so it populates /udev
- check that basic dev files are there
- move /dev to /dev.old, and ln -s /udev /dev (or real-move it and
  change udev.conf to write directly on /dev)

Or just create and empty /dev, and let hotplug call hotplug scripts
on boot which in turn call udev. Is this correct ? Will hotplug call
udev for the built-in drivers ?
Could it also work without hotplugging, ie, can I use udev to just
create a minimal /dev for my system ?

After installing udev, I run /sbin/udev and nothing appears on
/udev.

What am I missing / misunderstanding ?

TIA

-- 
J.A. Magallon <jamagallon()able!es>     \                 Software is like sex:
werewolf!able!es                         \           It's better when it's free
Mandrake Linux release 10.0 (Cooker) for i586
Linux 2.6.0-test11-jam1 (gcc 3.3.1 (Mandrake Linux 9.2 3.3.1-4mdk))

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev for dummies
  2003-12-11 22:16 udev for dummies J.A. Magallon
@ 2003-12-11 22:59 ` David T Hollis
  2003-12-12  2:49   ` Chris Friesen
  2003-12-12  4:43   ` Bob
  2003-12-12 21:31 ` Greg KH
  1 sibling, 2 replies; 7+ messages in thread
From: David T Hollis @ 2003-12-11 22:59 UTC (permalink / raw)
  To: J.A. Magallon; +Cc: Lista Linux-Kernel

On Thu, 2003-12-11 at 17:16, J.A. Magallon wrote:
> Hi all...
> 
> I am starting to use 2.6, and I really would like to use udev.
> But I can't find a doc about how to move from taditional heavily
> populated /dev to new method.
> 
> Any pointer ?
> 
> I have installed udev and hotplug utils, and have hotplug enabled in
> kernel.
> As I undestand it, I should do now something like
> - run udev for the first time, so it populates /udev
> - check that basic dev files are there
> - move /dev to /dev.old, and ln -s /udev /dev (or real-move it and
>   change udev.conf to write directly on /dev)
> 
> Or just create and empty /dev, and let hotplug call hotplug scripts
> on boot which in turn call udev. Is this correct ? Will hotplug call
> udev for the built-in drivers ?
> Could it also work without hotplugging, ie, can I use udev to just
> create a minimal /dev for my system ?
> 
> After installing udev, I run /sbin/udev and nothing appears on
> /udev.
> 
> What am I missing / misunderstanding ?
> 
> TIA

You may be overthinking it a bit.  I just set up udev on my box and it's
working quite well.  It's not really intending to completely replace
/dev, rather it provides a dynamic device structure based on hotplugged
devices.  When you plug in some new device (USB thing, firewire,
whatever), hotplug is run.  hotplug winds up calling udev which is able
to use it's defined rules and permissions to create a device node in
/udev (NOTE: not /dev).  These device nodes are perfectly valid for use
by anything (/dev is really just a convention.  There isn't much/any
other real significance to it).  The big win with udev is I can create
my own rules so that certain things always have a device node that I
want.  For example, I have a San Disk Cruzer USB storage device.  I
don't want that to show up as /dev/sdX (where X can vary based on other
things I have plugged in).  I tell udev to always create it's device as
/udev/cruzer.  This way I can easily have entries in fstab to mount it,
etc etc.  Ditto for my other USB storage devices.

In short, don't start deleting your /dev directory just yet!


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev for dummies
  2003-12-11 22:59 ` David T Hollis
@ 2003-12-12  2:49   ` Chris Friesen
  2003-12-12 21:32     ` Greg KH
  2003-12-12  4:43   ` Bob
  1 sibling, 1 reply; 7+ messages in thread
From: Chris Friesen @ 2003-12-12  2:49 UTC (permalink / raw)
  To: David T Hollis; +Cc: J.A. Magallon, Lista Linux-Kernel

David T Hollis wrote:
> On Thu, 2003-12-11 at 17:16, J.A. Magallon wrote:

>>What am I missing / misunderstanding ?

> You may be overthinking it a bit.  I just set up udev on my box and it's
> working quite well.  It's not really intending to completely replace
> /dev, rather it provides a dynamic device structure based on hotplugged
> devices.

Greg can speak to this better than I, but udev is most certainly 
intended to completely replace /dev.  The thing is that not everything 
exports the required information in /sys just yet.

If you start up udev and then run the script that comes with it that 
parses all the pre-existing /sys entries, it will build a pretty decent 
set of device nodes.  Eventually it is intended that this will be 
mounted at /dev, which could be an on-disk filesystem or else a 
tmpfs-based one.

Once all the information is in /sys, then static /dev will go away 
forever.  (Which is good, since device numbers will be random in 2.7.)

Chris


-- 
Chris Friesen                    | MailStop: 043/33/F10
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev for dummies
  2003-12-11 22:59 ` David T Hollis
  2003-12-12  2:49   ` Chris Friesen
@ 2003-12-12  4:43   ` Bob
  1 sibling, 0 replies; 7+ messages in thread
From: Bob @ 2003-12-12  4:43 UTC (permalink / raw)
  To: linux-kernel

David T Hollis wrote:

>On Thu, 2003-12-11 at 17:16, J.A. Magallon wrote:
>  
>
>>Hi all...
>>
>>I am starting to use 2.6, and I really would like to use udev.
>>But I can't find a doc about how to move from taditional heavily
>>populated /dev to new method.
>>
>>Any pointer ?
>>
Do you may mean heavily **over-populated**
/dev? Learning more about devfs would make it
easier to transition to udev. I'm going through this
now for myself.

You could learn how to strip out non-existent
devices from /dev by using
 /etc/devfs/compat_symlinks
by using regular expressions there to make symlinks
for standard device names like udev uses but only
permit devfsd to make device entries for devices
you have on your system.

Here is my /etc/devfs/compat_symlinks. At the
top I don't use anything but devfs naming, then
at the bottom I add a few symlinks both to limit
naming to real devices(see md*) and to make
conventional sd* hd* to make transition to
udev simpler.

-Bob

# Enable full compatibility mode for old device names. You may comment these
# out if you don't use the old device names. Make sure you know what you're
# doing!
#########REGISTER	.*		MKOLDCOMPAT
UNREGISTER	.*		RMOLDCOMPAT

# You may comment out the above and uncomment the following if you've
# configured your system to use the original "new" devfs names or the really
# new names
#####REGISTER	^vc/.*		MKOLDCOMPAT
UNREGISTER	^vc/.*		RMOLDCOMPAT
#####REGISTER	^pty/m0  	MKOLDCOMPAT
######REGISTER	^pty/s0  	MKOLDCOMPAT
UNREGISTER	^pty/.*		RMOLDCOMPAT
######REGISTER	^misc		MKOLDCOMPAT
UNREGISTER	^misc		RMOLDCOMPAT

# You may comment these out if you don't use the original "new" names
######REGISTER	.*		MKNEWCOMPAT
UNREGISTER	.*		RMNEWCOMPAT

# Create compatibility links for broken USB serial driver
REGISTER	^usb/tts/([0-9]+) CFUNCTION GLOBAL symlink $devname ttyUSB\1
#######UNREGISTER	^usb/tts/([0-9]+) CFUNCTION GLOBAL unlink ttyUSB\1

# Create compatibility link for broken misc/net/tun driver (must uncomment the
# MKOLDCOMPAT for misc above if you want to use this)
######REGISTER	^misc/net/tun$	CFUNCTION GLOBAL unlink   net/tun
######REGISTER	^misc/net/tun$	CFUNCTION GLOBAL symlink  /dev/$devname net/tun

# Bob removes non-existent /dev/md's, adds old conventional devices
# to aid transition to udev as this percolates through /etc/init.d
# scripts for fsck and mount--
REGISTER	^md/[0-4]		             MKOLDCOMPAT
UNREGISTER	^md/[5-9][0-9]*	                     RMOLDCOMPAT
REGISTER        ^ide/host[0-2]/.*                    MKOLDCOMPAT
REGISTER        ^scsi/host[0-2]/bus0/target[0-3]/.*  MKOLDCOMPAT
REGISTER        ^snd/.*                              MKOLDCOMPAT
REGISTER        ^sound/.*                            MKOLDCOMPAT
REGISTER        ^misc/rtc                            MKOLDCOMPAT






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev for dummies
  2003-12-11 22:16 udev for dummies J.A. Magallon
  2003-12-11 22:59 ` David T Hollis
@ 2003-12-12 21:31 ` Greg KH
  2003-12-14 18:36   ` Martin Schlemmer
  1 sibling, 1 reply; 7+ messages in thread
From: Greg KH @ 2003-12-12 21:31 UTC (permalink / raw)
  To: J.A. Magallon; +Cc: Lista Linux-Kernel

On Thu, Dec 11, 2003 at 11:16:04PM +0100, J.A. Magallon wrote:
> Hi all...
> 
> I am starting to use 2.6, and I really would like to use udev.
> But I can't find a doc about how to move from taditional heavily
> populated /dev to new method.
> 
> Any pointer ?

Did you read the README in udev's package?

Anyway, I don't really recommend using udev for management of your /dev
at this moment in time.  In order to do this we need some more
intregration of udev into the early boot process.  People are working on
this, but it will be a bit of time before it works properly, sorry.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev for dummies
  2003-12-12  2:49   ` Chris Friesen
@ 2003-12-12 21:32     ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2003-12-12 21:32 UTC (permalink / raw)
  To: Chris Friesen; +Cc: David T Hollis, J.A. Magallon, Lista Linux-Kernel

On Thu, Dec 11, 2003 at 09:49:08PM -0500, Chris Friesen wrote:
> David T Hollis wrote:
> >On Thu, 2003-12-11 at 17:16, J.A. Magallon wrote:
> 
> >>What am I missing / misunderstanding ?
> 
> >You may be overthinking it a bit.  I just set up udev on my box and it's
> >working quite well.  It's not really intending to completely replace
> >/dev, rather it provides a dynamic device structure based on hotplugged
> >devices.
> 
> Greg can speak to this better than I, but udev is most certainly 
> intended to completely replace /dev.  The thing is that not everything 
> exports the required information in /sys just yet.

Yes, this is true.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev for dummies
  2003-12-12 21:31 ` Greg KH
@ 2003-12-14 18:36   ` Martin Schlemmer
  0 siblings, 0 replies; 7+ messages in thread
From: Martin Schlemmer @ 2003-12-14 18:36 UTC (permalink / raw)
  To: Greg KH; +Cc: J.A. Magallon, Lista Linux-Kernel

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

On Fri, 2003-12-12 at 23:31, Greg KH wrote:
> On Thu, Dec 11, 2003 at 11:16:04PM +0100, J.A. Magallon wrote:
> > Hi all...
> > 
> > I am starting to use 2.6, and I really would like to use udev.
> > But I can't find a doc about how to move from taditional heavily
> > populated /dev to new method.
> > 
> > Any pointer ?
> 
> Did you read the README in udev's package?
> 
> Anyway, I don't really recommend using udev for management of your /dev
> at this moment in time.  In order to do this we need some more
> intregration of udev into the early boot process.  People are working on
> this, but it will be a bit of time before it works properly, sorry.
> 

It does work nicely to manage /dev if /dev is well populated as you
would have for a non-devfs system (yes, it does sort of defeat the
point, but the extra functionality of udev like changing the name
of a specific usb device, etc, makes up for the current 'bloat of
this approach).


-- 
Martin Schlemmer

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-12-14 18:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-11 22:16 udev for dummies J.A. Magallon
2003-12-11 22:59 ` David T Hollis
2003-12-12  2:49   ` Chris Friesen
2003-12-12 21:32     ` Greg KH
2003-12-12  4:43   ` Bob
2003-12-12 21:31 ` Greg KH
2003-12-14 18:36   ` Martin Schlemmer

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).