2004-03-03 19:27:23

by Grzegorz Kulewski

[permalink] [raw]
Subject: [QUESTION/PROPOSAL] udev (fwd)

[PLEASE CC LKML or me because I am not subscribed to LHD!]

Greg asked for it, so here it is:

Question:

If I understand well, currently, when kernel detects new device, it
creates all important files in /sys for it, excluding device file.

So, (sorry if it was asked 100000000 times...
... but) why when kernel detects new device or module is loaded, no device
file in sysfs is created? The device files in /dev would be only links to
these in /sys.

This way we could stop care about major/minor numbers and leave it to sysfs...
And it maybe could decrease the possible races related to udev because it
would only create or remove links to files in /sys.

Programs will be able to easily find, for what device and where located in
system (buses, etc.) the device file in /dev is - with readlink.

And it should make the entire process more clear.

What You think about it?



thanks and sorry for my english

Grzegorz Kulewski


2004-03-03 19:41:41

by Chris Friesen

[permalink] [raw]
Subject: Re: [QUESTION/PROPOSAL] udev (fwd)

Grzegorz Kulewski wrote:

> What You think about it?

I think you should use google before posting here.

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: [email protected]

2004-03-03 19:40:44

by Tim Hockin

[permalink] [raw]
Subject: Re: [QUESTION/PROPOSAL] udev (fwd)

On Wed, Mar 03, 2004 at 08:27:17PM +0100, Grzegorz Kulewski wrote:
> So, (sorry if it was asked 100000000 times...

it has been

> ... but) why when kernel detects new device or module is loaded, no device
> file in sysfs is created? The device files in /dev would be only links to
> these in /sys.

What mode should be applied to these files? That alone is enough to make
one stop and reconsider the idea.

2004-03-03 20:05:14

by Felipe Alfaro Solana

[permalink] [raw]
Subject: Re: [QUESTION/PROPOSAL] udev (fwd)

On Wed, 2004-03-03 at 20:27, Grzegorz Kulewski wrote:

> If I understand well, currently, when kernel detects new device, it
> creates all important files in /sys for it, excluding device file.
>
> So, (sorry if it was asked 100000000 times...
> ... but) why when kernel detects new device or module is loaded, no device
> file in sysfs is created? The device files in /dev would be only links to
> these in /sys.
>
> This way we could stop care about major/minor numbers and leave it to sysfs...
> And it maybe could decrease the possible races related to udev because it
> would only create or remove links to files in /sys.
>
> Programs will be able to easily find, for what device and where located in
> system (buses, etc.) the device file in /dev is - with readlink.
>
> And it should make the entire process more clear.

This is more or less how Solaris works... In Solaris, /dev entries are
just symlinks to entries under the /devices tree which is much like
/sys: a tree-like structure which is composed of buses, devices et all.

This is a feature I've always liked from Solaris.

2004-03-03 20:52:08

by Grzegorz Kulewski

[permalink] [raw]
Subject: Re: [QUESTION/PROPOSAL] udev (fwd)

On Wed, 3 Mar 2004, Tim Hockin wrote:

> On Wed, Mar 03, 2004 at 08:27:17PM +0100, Grzegorz Kulewski wrote:
> > So, (sorry if it was asked 100000000 times...
>
> it has been
>
> > ... but) why when kernel detects new device or module is loaded, no device
> > file in sysfs is created? The device files in /dev would be only links to
> > these in /sys.
>
> What mode should be applied to these files? That alone is enough to make
> one stop and reconsider the idea.

For example 000 - no access for nobody, udev can change it if configured
to do so.


Grzegorz

2004-03-03 21:08:38

by Greg KH

[permalink] [raw]
Subject: Re: [QUESTION/PROPOSAL] udev (fwd)

On Wed, Mar 03, 2004 at 08:27:17PM +0100, Grzegorz Kulewski wrote:
> [PLEASE CC LKML or me because I am not subscribed to LHD!]
>
> Greg asked for it, so here it is:

Hm, looks like you got my email address wrong though :(

> So, (sorry if it was asked 100000000 times...

It has been, please search the archives first.

thanks,

greg k-h

2004-03-03 22:12:07

by Tim Hockin

[permalink] [raw]
Subject: Re: [QUESTION/PROPOSAL] udev (fwd)

On Wed, Mar 03, 2004 at 09:51:59PM +0100, Grzegorz Kulewski wrote:
> > What mode should be applied to these files? That alone is enough to make
> > one stop and reconsider the idea.
>
> For example 000 - no access for nobody, udev can change it if configured
> to do so.

I don't know that sysfs has code to handle changing modes. And in the end,
what does it buy you?