lkml.org 
[lkml]   [2005]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: An idea on devfs vs. udev
On Sunday October 30, daniele@orlandi.com wrote:
>
> So, why cannot we substitute the "dev" file within /sys with the actual device
> file?

I'd just like to say that I am 100% in favour of this idea.

The argument against it seems to be something that I have never
managed to understand about "policy not belonging in the kernel".
Now I agree that the kernel should avoid implementing policy, but I
fail to see how that relates to the current issue.

In fact, the way I see it, the current practice clearly violates the
"avoid policy" policy.

The kernel needs to export major/minor information through the
file system. The "obvious" mechanism for doing this is through a
device special file.
But instead, a text file with %d:%d is used. Why? I presume to stop
people from just opening /sys/.../dev. Stopping people from doing
such a thing is clearly implementing a "Thou shall not" policy.

But then to make matters worse, there is this "sample.sh" file. UGH!
It's a bit of shell code exported by the kernel.
#!/bin/sh
mknod /dev/hda b 3 0

This contortion would be totally unnecessary if 'dev' were an honest
device special file. Then instead of
sh $sysfspath/sample.sh
you could
cp -R $sysfspath/dev /dev/`basename $sysfspath`

Notes:
- obviously a different name would have to be chosen for back
compatibility (rdev?).
- I would *not* be in favour of then allowing chown/chmod. These
special files should stay root/root/0600.

NeilBrown



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-30 22:21    [W:0.074 / U:1.684 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site