public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, greg@kroah.com
Subject: Re: [GIT PATCH] Remove devfs from 2.6.17
Date: Sun, 18 Jun 2006 16:12:04 -0700	[thread overview]
Message-ID: <20060618231204.GB2212@suse.de> (raw)
In-Reply-To: <20060618230041.GG4744@bouh.residence.ens-lyon.fr>

On Mon, Jun 19, 2006 at 01:00:41AM +0200, Samuel Thibault wrote:
> Greg KH, le Sun 18 Jun 2006 15:13:43 -0700, a ?crit :
> > Since 2.6.13 came out, I have seen no complaints about the fact that
> > devfs was not able to be enabled anymore,
> 
> There has been at least my complaint about udev not being able to
> auto-load modules on /dev entry lookup (28th March 2006):
> 
> ??Given a freshly booted linux box, hence uinput is not loaded (why
> would it be, it doesn't drive any real hardware) ; what is the right
> way(tm) for an application to have the uinput module loaded, so that it
> can open /dev/input/uinput for emulating keypresses?
> 
> - With good-old static /dev, we could just open /dev/input/uinput
>   (installed by the distribution), and thanks to a
>   alias char-major-10-223 uinput
>   line somewhere in /etc/modprobe.d, uinput gets auto-loaded.
> 
> - With devfs, it doesn't look like it works (/dev/misc/uinput is not
>   present and opening it just like if it existed doesn't work). But I
>   read in archives that it could be feasible.

But I don't think it ever worked, as you stated.

> - With udev, this just cannot work. As explained in an earlier thread,
>   even using a special filesystem that would report the opening attempt
>   to udevd wouldn't work fine since udevd takes time for creating the
>   device, and hence the original program needs to be notified ; this
>   becomes racy.
> 
> So what is the correct way to do it? I can see two approaches:

You forgot:
  - use a static /dev if you want this.
No one is forcing you to use udev :)

> Using modprobe:
> - try to use /dev/input/uinput ; if it succeeds, fine.
> - else, if errno != ENOENT, fail
> - else, (ENOENT)
>   - try to call `cat /proc/sys/kernel/modprobe` uinput
>   - try to use /dev/input/uinput again ; if it succeeds, fine
>     - else, assume that it really wasn't compiled, and hence fail.
> 
> Triggering auto-load by creating one's own node.
> - try to use /dev/input/uinput ; if it suceeds, fine.
> - else, if errno != ENOENT, fail
> - else, (ENOENT)
>   - mknod /somewhere/safe/uinput c 10 223
>   - use /somewhere/safe/uinput ; if it succeeds, fine
>     - else, assume that it really wasn't compiled, and hence fail.
> ?
> 
> Neither solution looks good to me... Just opening /dev/input/uinput
> should be sufficient, and udev doesn't let that for now.

No, just do what the distros that use udev do today, load the needed
modules at boot time, based on the hardware that is present in the
system.  This should work just fine for the uinput driver, and if not,
simply add it to the list of modules that need to be loaded every boot
(each distro has a different place to put this list), and you should be
fine.

Please realize that the method of loading a module based on the device
node number is very restrictive, and only works for a small minority of
drivers.  This is due to the wide range of hardware sharing device nodes
(do you want to load all of the possible sound drivers when you touch
the sound device node?, no, you just want it "to work automatically",
which is what happens today at boot time with udev.)

> The same situation holds for other virtual devices (loop, snd-seq-dummy,
> ...).

Yes, look at how the distros do this today for loop, they merely load it
at boot time and everyone's happy.

And this whole thing has nothing to do with devfs, as you stated above
:)

thanks,

greg k-h

  reply	other threads:[~2006-06-18 23:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-18 22:13 [GIT PATCH] Remove devfs from 2.6.17 Greg KH
2006-06-18 22:45 ` Michal Piotrowski
2006-06-18 23:06   ` Greg KH
2006-06-18 23:00 ` Samuel Thibault
2006-06-18 23:12   ` Greg KH [this message]
2006-06-18 23:35     ` Samuel Thibault
2006-06-19  0:48       ` Nick Piggin
2006-06-19  3:22       ` Greg KH
2006-06-19  8:23         ` Samuel Thibault
2006-06-19  9:30           ` Marcel Holtmann
2006-06-19  9:39             ` Samuel Thibault
2006-06-19 10:22               ` Marcel Holtmann
2006-06-19  0:54   ` H. Peter Anvin
2006-06-19  1:17     ` Joshua Hudson
2006-06-19  1:35       ` H. Peter Anvin
2006-06-19  5:55         ` Will Dyson
2006-06-19  7:14           ` Alexander E. Patrakov
2006-06-19 22:14             ` Daniel Barkalow
2006-06-19 22:17               ` H. Peter Anvin
2006-06-19  3:15     ` Greg KH
2006-06-19  8:52       ` Samuel Thibault

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=20060618231204.GB2212@suse.de \
    --to=gregkh@suse.de \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=torvalds@osdl.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