* [PATCH] Clean up old names in tty code to current names
@ 2006-07-10 4:11 Jon Smirl
2006-07-10 4:54 ` Andrew Morton
` (2 more replies)
0 siblings, 3 replies; 27+ messages in thread
From: Jon Smirl @ 2006-07-10 4:11 UTC (permalink / raw)
To: lkml, Alan Cox, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 2524 bytes --]
Fix various places in the tty code to make it match the current naming system.
--
Jon Smirl
jonsmirl@gmail.com
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 34dd4c3..af43f37 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -279,7 +279,7 @@ static void __init legacy_pty_init(void)
pty_slave_driver->owner = THIS_MODULE;
pty_slave_driver->driver_name = "pty_slave";
- pty_slave_driver->name = "ttyp";
+ pty_slave_driver->name = "pts";
pty_slave_driver->major = PTY_SLAVE_MAJOR;
pty_slave_driver->minor_start = 0;
pty_slave_driver->type = TTY_DRIVER_TYPE_PTY;
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index bfdb902..4a83e94 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3245,7 +3245,7 @@ #endif
#ifdef CONFIG_VT
cdev_init(&vc0_cdev, &console_fops);
if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
- register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
+ register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/tty0") < 0)
panic("Couldn't register /dev/tty0 driver\n");
class_device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, "tty0");
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index da7e66a..a627e8b 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2662,6 +2662,7 @@ int __init vty_init(void)
if (!console_driver)
panic("Couldn't allocate console driver\n");
console_driver->owner = THIS_MODULE;
+ console_driver->driver_name = "vtconsole";
console_driver->name = "tty";
console_driver->name_base = 1;
console_driver->major = TTY_MAJOR;
diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
index 15c4455..042aefe 100644
--- a/fs/proc/proc_tty.c
+++ b/fs/proc/proc_tty.c
@@ -48,7 +48,7 @@ static void show_tty_range(struct seq_fi
seq_printf(m, ":vtmaster");
break;
case TTY_DRIVER_TYPE_CONSOLE:
- seq_printf(m, "console");
+ seq_printf(m, "vt:console");
break;
case TTY_DRIVER_TYPE_SERIAL:
seq_printf(m, "serial");
@@ -84,10 +84,10 @@ static int show_tty_driver(struct seq_fi
#ifdef CONFIG_UNIX98_PTYS
seq_printf(m, "%-20s /dev/%-8s ", "/dev/ptmx", "ptmx");
seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 2);
- seq_printf(m, "system\n");
+ seq_printf(m, "system:/dev/ptmx\n");
#endif
#ifdef CONFIG_VT
- seq_printf(m, "%-20s /dev/%-8s ", "/dev/vc/0", "vc/0");
+ seq_printf(m, "%-20s /dev/%-8s ", "/dev/tty0", "tty0");
seq_printf(m, "%3d %7d ", TTY_MAJOR, 0);
seq_printf(m, "system:vtmaster\n");
#endif
[-- Attachment #2: cleanup-tty-naming.patch --]
[-- Type: text/x-patch, Size: 2365 bytes --]
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 34dd4c3..af43f37 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -279,7 +279,7 @@ static void __init legacy_pty_init(void)
pty_slave_driver->owner = THIS_MODULE;
pty_slave_driver->driver_name = "pty_slave";
- pty_slave_driver->name = "ttyp";
+ pty_slave_driver->name = "pts";
pty_slave_driver->major = PTY_SLAVE_MAJOR;
pty_slave_driver->minor_start = 0;
pty_slave_driver->type = TTY_DRIVER_TYPE_PTY;
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index bfdb902..4a83e94 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3245,7 +3245,7 @@ #endif
#ifdef CONFIG_VT
cdev_init(&vc0_cdev, &console_fops);
if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
- register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
+ register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/tty0") < 0)
panic("Couldn't register /dev/tty0 driver\n");
class_device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, "tty0");
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index da7e66a..a627e8b 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2662,6 +2662,7 @@ int __init vty_init(void)
if (!console_driver)
panic("Couldn't allocate console driver\n");
console_driver->owner = THIS_MODULE;
+ console_driver->driver_name = "vtconsole";
console_driver->name = "tty";
console_driver->name_base = 1;
console_driver->major = TTY_MAJOR;
diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
index 15c4455..042aefe 100644
--- a/fs/proc/proc_tty.c
+++ b/fs/proc/proc_tty.c
@@ -48,7 +48,7 @@ static void show_tty_range(struct seq_fi
seq_printf(m, ":vtmaster");
break;
case TTY_DRIVER_TYPE_CONSOLE:
- seq_printf(m, "console");
+ seq_printf(m, "vt:console");
break;
case TTY_DRIVER_TYPE_SERIAL:
seq_printf(m, "serial");
@@ -84,10 +84,10 @@ static int show_tty_driver(struct seq_fi
#ifdef CONFIG_UNIX98_PTYS
seq_printf(m, "%-20s /dev/%-8s ", "/dev/ptmx", "ptmx");
seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 2);
- seq_printf(m, "system\n");
+ seq_printf(m, "system:/dev/ptmx\n");
#endif
#ifdef CONFIG_VT
- seq_printf(m, "%-20s /dev/%-8s ", "/dev/vc/0", "vc/0");
+ seq_printf(m, "%-20s /dev/%-8s ", "/dev/tty0", "tty0");
seq_printf(m, "%3d %7d ", TTY_MAJOR, 0);
seq_printf(m, "system:vtmaster\n");
#endif
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 4:11 [PATCH] Clean up old names in tty code to current names Jon Smirl
@ 2006-07-10 4:54 ` Andrew Morton
2006-07-10 7:14 ` H. Peter Anvin
2006-07-10 9:44 ` Alan Cox
2 siblings, 0 replies; 27+ messages in thread
From: Andrew Morton @ 2006-07-10 4:54 UTC (permalink / raw)
To: Jon Smirl; +Cc: linux-kernel, alan
On Mon, 10 Jul 2006 00:11:11 -0400
"Jon Smirl" <jonsmirl@gmail.com> wrote:
> Fix various places in the tty code to make it match the current naming system.
>
eh?
>
> diff --git a/drivers/char/pty.c b/drivers/char/pty.c
> index 34dd4c3..af43f37 100644
> --- a/drivers/char/pty.c
> +++ b/drivers/char/pty.c
> @@ -279,7 +279,7 @@ static void __init legacy_pty_init(void)
>
> pty_slave_driver->owner = THIS_MODULE;
> pty_slave_driver->driver_name = "pty_slave";
> - pty_slave_driver->name = "ttyp";
> + pty_slave_driver->name = "pts";
> pty_slave_driver->major = PTY_SLAVE_MAJOR;
> pty_slave_driver->minor_start = 0;
> pty_slave_driver->type = TTY_DRIVER_TYPE_PTY;
> diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
> index bfdb902..4a83e94 100644
> --- a/drivers/char/tty_io.c
> +++ b/drivers/char/tty_io.c
> @@ -3245,7 +3245,7 @@ #endif
> #ifdef CONFIG_VT
> cdev_init(&vc0_cdev, &console_fops);
> if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
> - register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
> + register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/tty0") < 0)
> panic("Couldn't register /dev/tty0 driver\n");
> class_device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, "tty0");
>
> diff --git a/drivers/char/vt.c b/drivers/char/vt.c
> index da7e66a..a627e8b 100644
> --- a/drivers/char/vt.c
> +++ b/drivers/char/vt.c
> @@ -2662,6 +2662,7 @@ int __init vty_init(void)
> if (!console_driver)
> panic("Couldn't allocate console driver\n");
> console_driver->owner = THIS_MODULE;
> + console_driver->driver_name = "vtconsole";
> console_driver->name = "tty";
> console_driver->name_base = 1;
> console_driver->major = TTY_MAJOR;
> diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
> index 15c4455..042aefe 100644
> --- a/fs/proc/proc_tty.c
> +++ b/fs/proc/proc_tty.c
> @@ -48,7 +48,7 @@ static void show_tty_range(struct seq_fi
> seq_printf(m, ":vtmaster");
> break;
> case TTY_DRIVER_TYPE_CONSOLE:
> - seq_printf(m, "console");
> + seq_printf(m, "vt:console");
This seems to be changing a whole pile of userspace-visible stuff.
Tell us more. Much more.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 4:11 [PATCH] Clean up old names in tty code to current names Jon Smirl
2006-07-10 4:54 ` Andrew Morton
@ 2006-07-10 7:14 ` H. Peter Anvin
2006-07-10 9:44 ` Alan Cox
2 siblings, 0 replies; 27+ messages in thread
From: H. Peter Anvin @ 2006-07-10 7:14 UTC (permalink / raw)
To: Jon Smirl; +Cc: lkml, Alan Cox, Andrew Morton
Jon Smirl wrote:
> Fix various places in the tty code to make it match the current naming
> system.
>
> ------------------------------------------------------------------------
>
> diff --git a/drivers/char/pty.c b/drivers/char/pty.c
> index 34dd4c3..af43f37 100644
> --- a/drivers/char/pty.c
> +++ b/drivers/char/pty.c
> @@ -279,7 +279,7 @@ static void __init legacy_pty_init(void)
>
> pty_slave_driver->owner = THIS_MODULE;
> pty_slave_driver->driver_name = "pty_slave";
> - pty_slave_driver->name = "ttyp";
> + pty_slave_driver->name = "pts";
> pty_slave_driver->major = PTY_SLAVE_MAJOR;
> pty_slave_driver->minor_start = 0;
> pty_slave_driver->type = TTY_DRIVER_TYPE_PTY;
*PLONK*
*LEGACY* pty...
-hpa
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 4:11 [PATCH] Clean up old names in tty code to current names Jon Smirl
2006-07-10 4:54 ` Andrew Morton
2006-07-10 7:14 ` H. Peter Anvin
@ 2006-07-10 9:44 ` Alan Cox
2006-07-10 12:41 ` Jon Smirl
2 siblings, 1 reply; 27+ messages in thread
From: Alan Cox @ 2006-07-10 9:44 UTC (permalink / raw)
To: Jon Smirl; +Cc: lkml, Andrew Morton
Ar Llu, 2006-07-10 am 00:11 -0400, ysgrifennodd Jon Smirl:
> Fix various places in the tty code to make it match the current naming system.
> pty_slave_driver->driver_name = "pty_slave";
NAK to just about all of this. Its gratuitous breaking of existing apps,
it achieves nothing and some of it like the pty stuff is just plain
incorrect anyway.
If you want to add sysfs interfaces to the tty code great, but please
leave the existing, relied up, functional and effectively user space ABI
tty files alone.
Alan
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 9:44 ` Alan Cox
@ 2006-07-10 12:41 ` Jon Smirl
2006-07-10 13:10 ` Alan Cox
2006-07-11 21:52 ` Greg KH
0 siblings, 2 replies; 27+ messages in thread
From: Jon Smirl @ 2006-07-10 12:41 UTC (permalink / raw)
To: Alan Cox, H. Peter Anvin, Greg KH; +Cc: lkml, Andrew Morton
On 7/10/06, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> Ar Llu, 2006-07-10 am 00:11 -0400, ysgrifennodd Jon Smirl:
> > Fix various places in the tty code to make it match the current naming system.
> > pty_slave_driver->driver_name = "pty_slave";
>
>
> NAK to just about all of this. Its gratuitous breaking of existing apps,
> it achieves nothing and some of it like the pty stuff is just plain
> incorrect anyway.
The whole naming scheme encoded into the tty code is incompatible with
udev. Udev allows renames and this code isn't aware of them.
I thought the idea behind udev was to remove all of this naming code
from the kernel and handle it in user space. So if I want legacy
device names I would add a section to /etc/udev to create them. Udev
is already capable of doing this.
> If you want to add sysfs interfaces to the tty code great, but please
> leave the existing, relied up, functional and effectively user space ABI
> tty files alone.
So far I haven't identified anything that is really needed that isn't
already available in sysfs.
It does seem that we are missing a user space library call for
converting a device number into a device name using the udev database.
On 7/9/06, Albert Cahalan <acahalan@gmail.com> wrote:
> BSD just uses devname(3) in libc, which asks the kernel via
> the kern.devname sysctl. So, /proc/sys/kern/devname for us.
> This is essentially what /proc/tty/drivers is today, except
> that FreeBSD standardized on a fully functional devfs.
>
> Solaris uses _ttyname_dev(dev_t,buf,bufsize), also in libc.
> This is horribly slow, involving a recursive search of
> directories listed in the /etc/ttysrch file. The interface
> is nice though. You get: ttyname, ttyname_r, _ttyname_dev.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 13:10 ` Alan Cox
@ 2006-07-10 13:03 ` Jon Smirl
2006-07-10 13:12 ` CaT
2006-07-10 13:43 ` Alan Cox
0 siblings, 2 replies; 27+ messages in thread
From: Jon Smirl @ 2006-07-10 13:03 UTC (permalink / raw)
To: Alan Cox; +Cc: H. Peter Anvin, Greg KH, lkml, Andrew Morton
On 7/10/06, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> Ar Llu, 2006-07-10 am 08:41 -0400, ysgrifennodd Jon Smirl:
> > The whole naming scheme encoded into the tty code is incompatible with
> > udev. Udev allows renames and this code isn't aware of them.
>
> The idea is not to break stuff.
I agree with this. I made a mistake with the pts vs pty, why not just
help me fix the mistake instead of rejecting everything? Some the of
the info being reported in /proc/tty/drivers is wrong (vc./0 - from
the devfs attempt?). or missing.
> > It does seem that we are missing a user space library call for
> > converting a device number into a device name using the udev database.
>
> A very large number of users don't bother with udev. Relying on udev is
> not a wise thing to assume, especially in the embedded space.
I'm not going to solve this problem but it is something that needs to
be discussed. Are we really going to maintain parallel naming schemes,
one in-kernel and one out of kernel? I'm not even sure if USB will
work without udev anymore.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 12:41 ` Jon Smirl
@ 2006-07-10 13:10 ` Alan Cox
2006-07-10 13:03 ` Jon Smirl
2006-07-11 21:52 ` Greg KH
1 sibling, 1 reply; 27+ messages in thread
From: Alan Cox @ 2006-07-10 13:10 UTC (permalink / raw)
To: Jon Smirl; +Cc: H. Peter Anvin, Greg KH, lkml, Andrew Morton
Ar Llu, 2006-07-10 am 08:41 -0400, ysgrifennodd Jon Smirl:
> The whole naming scheme encoded into the tty code is incompatible with
> udev. Udev allows renames and this code isn't aware of them.
The idea is not to break stuff.
> It does seem that we are missing a user space library call for
> converting a device number into a device name using the udev database.
A very large number of users don't bother with udev. Relying on udev is
not a wise thing to assume, especially in the embedded space.
Alan
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 13:03 ` Jon Smirl
@ 2006-07-10 13:12 ` CaT
2006-07-10 13:18 ` Jon Smirl
2006-07-10 13:43 ` Alan Cox
1 sibling, 1 reply; 27+ messages in thread
From: CaT @ 2006-07-10 13:12 UTC (permalink / raw)
To: Jon Smirl; +Cc: Alan Cox, H. Peter Anvin, Greg KH, lkml, Andrew Morton
On Mon, Jul 10, 2006 at 09:03:49AM -0400, Jon Smirl wrote:
> one in-kernel and one out of kernel? I'm not even sure if USB will
> work without udev anymore.
*blink* I use USB every other day, on recent kernels without problems
and without udev. What should I expect not to work for me?
--
"To the extent that we overreact, we proffer the terrorists the
greatest tribute."
- High Court Judge Michael Kirby
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 13:12 ` CaT
@ 2006-07-10 13:18 ` Jon Smirl
0 siblings, 0 replies; 27+ messages in thread
From: Jon Smirl @ 2006-07-10 13:18 UTC (permalink / raw)
To: CaT; +Cc: Alan Cox, H. Peter Anvin, Greg KH, lkml, Andrew Morton
On 7/10/06, CaT <cat@zip.com.au> wrote:
> On Mon, Jul 10, 2006 at 09:03:49AM -0400, Jon Smirl wrote:
> > one in-kernel and one out of kernel? I'm not even sure if USB will
> > work without udev anymore.
>
> *blink* I use USB every other day, on recent kernels without problems
> and without udev. What should I expect not to work for me?
The hotplug handlers need udev. For example plugging in a new storage
device and expecting kernel support to get autoloaded for it.
If you have a fixed set of devices and have compiled in support for
all of them and made static device nodes, then you don't need it. But
in this case you don't need in-kernel naming support either.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 13:03 ` Jon Smirl
2006-07-10 13:12 ` CaT
@ 2006-07-10 13:43 ` Alan Cox
2006-07-10 14:07 ` Jon Smirl
1 sibling, 1 reply; 27+ messages in thread
From: Alan Cox @ 2006-07-10 13:43 UTC (permalink / raw)
To: Jon Smirl; +Cc: H. Peter Anvin, Greg KH, lkml, Andrew Morton
Ar Llu, 2006-07-10 am 09:03 -0400, ysgrifennodd Jon Smirl:
> I agree with this. I made a mistake with the pts vs pty, why not just
> help me fix the mistake instead of rejecting everything? Some the of
> the info being reported in /proc/tty/drivers is wrong (vc./0 - from
> the devfs attempt?). or missing.
What are you trying to achieve and where are you trying to get. If you
want better info for the tty layer then get the new info working in
sysfs first. Then when people are generally using sysfs you can worry
about cleaning up/removing/breaking the old stuff.
> I'm not going to solve this problem but it is something that needs to
> be discussed. Are we really going to maintain parallel naming schemes,
> one in-kernel and one out of kernel? I'm not even sure if USB will
> work without udev anymore.
It works fine, it would not suprise me if udev users were still the
minority case in fact.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 13:43 ` Alan Cox
@ 2006-07-10 14:07 ` Jon Smirl
2006-07-10 14:17 ` Jan Engelhardt
` (3 more replies)
0 siblings, 4 replies; 27+ messages in thread
From: Jon Smirl @ 2006-07-10 14:07 UTC (permalink / raw)
To: Alan Cox; +Cc: H. Peter Anvin, Greg KH, lkml, Andrew Morton
On 7/10/06, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> Ar Llu, 2006-07-10 am 09:03 -0400, ysgrifennodd Jon Smirl:
> > I agree with this. I made a mistake with the pts vs pty, why not just
> > help me fix the mistake instead of rejecting everything? Some the of
> > the info being reported in /proc/tty/drivers is wrong (vc./0 - from
> > the devfs attempt?). or missing.
>
> What are you trying to achieve and where are you trying to get. If you
> want better info for the tty layer then get the new info working in
> sysfs first. Then when people are generally using sysfs you can worry
> about cleaning up/removing/breaking the old stuff.
>
Before the change /proc/tty/drivers shows this:
[jonsmirl@jonsmirl ~]$ cat /proc/tty/drivers
/dev/tty /dev/tty 5 0 system:/dev/tty
/dev/console /dev/console 5 1 system:console
/dev/ptmx /dev/ptmx 5 2 system
/dev/vc/0 /dev/vc/0 4 0 system:vtmaster
serial /dev/ttyS 4 64-67 serial
pty_slave /dev/pts 136 0-1048575 pty:slave
pty_master /dev/ptm 128 0-1048575 pty:master
unknown /dev/tty 4 1-63 console
I changed it to this which better reflects my system.
[jonsmirl@jonsmirl ~]$ cat /proc/tty/drivers
/dev/tty /dev/tty 5 0 system:/dev/tty
/dev/console /dev/console 5 1 system:console
/dev/ptmx /dev/ptmx 5 2 system:/dev/ptmx
/dev/tty0 /dev/tty0 4 0 system:vtmaster
serial /dev/ttyS 4 64-67 serial
pty_slave /dev/pts 136 0-1048575 pty:slave
pty_master /dev/ptm 128 0-1048575 pty:master
vtconsole /dev/tty 4 1-63 vt:console
Nothing in that patch has anything to do with udev support. It is just
trying to make things match my current devices. When we got rid of
devfs /dev/vc/0 became /dev/tty0.
The ttyp change was a mistake. The patch below removes that error. Is
there anything else wrong with it? That's why we have patch reviews,
to catch dumb errors like that.
> > I'm not going to solve this problem but it is something that needs to
> > be discussed. Are we really going to maintain parallel naming schemes,
> > one in-kernel and one out of kernel? I'm not even sure if USB will
> > work without udev anymore.
>
> It works fine, it would not suprise me if udev users were still the
> minority case in fact.
If I use udev to rename my devices, the names aren't going to match
/proc/tty and what ps shows. The idea behind udev is that the kernel
only deals in device numbers and all naming happens in user space.
--
Jon Smirl
jonsmirl@gmail.com
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index bfdb902..4a83e94 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3245,7 +3245,7 @@ #endif
#ifdef CONFIG_VT
cdev_init(&vc0_cdev, &console_fops);
if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
- register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
+ register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/tty0") < 0)
panic("Couldn't register /dev/tty0 driver\n");
class_device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, "tty0");
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index da7e66a..a627e8b 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2662,6 +2662,7 @@ int __init vty_init(void)
if (!console_driver)
panic("Couldn't allocate console driver\n");
console_driver->owner = THIS_MODULE;
+ console_driver->driver_name = "vtconsole";
console_driver->name = "tty";
console_driver->name_base = 1;
console_driver->major = TTY_MAJOR;
diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
index 15c4455..042aefe 100644
--- a/fs/proc/proc_tty.c
+++ b/fs/proc/proc_tty.c
@@ -48,7 +48,7 @@ static void show_tty_range(struct seq_fi
seq_printf(m, ":vtmaster");
break;
case TTY_DRIVER_TYPE_CONSOLE:
- seq_printf(m, "console");
+ seq_printf(m, "vt:console");
break;
case TTY_DRIVER_TYPE_SERIAL:
seq_printf(m, "serial");
@@ -84,10 +84,10 @@ static int show_tty_driver(struct seq_fi
#ifdef CONFIG_UNIX98_PTYS
seq_printf(m, "%-20s /dev/%-8s ", "/dev/ptmx", "ptmx");
seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 2);
- seq_printf(m, "system\n");
+ seq_printf(m, "system:/dev/ptmx\n");
#endif
#ifdef CONFIG_VT
- seq_printf(m, "%-20s /dev/%-8s ", "/dev/vc/0", "vc/0");
+ seq_printf(m, "%-20s /dev/%-8s ", "/dev/tty0", "tty0");
seq_printf(m, "%3d %7d ", TTY_MAJOR, 0);
seq_printf(m, "system:vtmaster\n");
#endif
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 14:07 ` Jon Smirl
@ 2006-07-10 14:17 ` Jan Engelhardt
2006-07-10 14:37 ` Alan Cox
` (2 subsequent siblings)
3 siblings, 0 replies; 27+ messages in thread
From: Jan Engelhardt @ 2006-07-10 14:17 UTC (permalink / raw)
To: Jon Smirl; +Cc: Alan Cox, H. Peter Anvin, Greg KH, lkml, Andrew Morton
>
> Before the change /proc/tty/drivers shows this:
>
> [jonsmirl@jonsmirl ~]$ cat /proc/tty/drivers
> /dev/tty /dev/tty 5 0 system:/dev/tty
> /dev/console /dev/console 5 1 system:console
> /dev/ptmx /dev/ptmx 5 2 system
> /dev/vc/0 /dev/vc/0 4 0 system:vtmaster
> serial /dev/ttyS 4 64-67 serial
> pty_slave /dev/pts 136 0-1048575 pty:slave
> pty_master /dev/ptm 128 0-1048575 pty:master
> unknown /dev/tty 4 1-63 console
>
My word here too :)
I doubt that userspace can do something useful with the "/dev/vc/0"
line when there is no devfs around at all.
Like below.
> Nothing in that patch has anything to do with udev support. It is just
> trying to make things match my current devices. When we got rid of
> devfs /dev/vc/0 became /dev/tty0.
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 14:07 ` Jon Smirl
2006-07-10 14:17 ` Jan Engelhardt
@ 2006-07-10 14:37 ` Alan Cox
2006-07-10 14:42 ` Antonino A. Daplas
2006-07-11 21:54 ` Greg KH
3 siblings, 0 replies; 27+ messages in thread
From: Alan Cox @ 2006-07-10 14:37 UTC (permalink / raw)
To: Jon Smirl; +Cc: H. Peter Anvin, Greg KH, lkml, Andrew Morton
Ar Llu, 2006-07-10 am 10:07 -0400, ysgrifennodd Jon Smirl:
> The ttyp change was a mistake. The patch below removes that error. Is
> there anything else wrong with it? That's why we have patch reviews,
> to catch dumb errors like that.
Its change for no purpose. It doesn't "fix" anything and it might well
break stuff like installers. Put the new "correct" data in the new sysfs
stuff you talk about.
Alan
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 14:07 ` Jon Smirl
2006-07-10 14:17 ` Jan Engelhardt
2006-07-10 14:37 ` Alan Cox
@ 2006-07-10 14:42 ` Antonino A. Daplas
2006-07-10 14:57 ` Jon Smirl
2006-07-10 18:13 ` Alistair John Strachan
2006-07-11 21:54 ` Greg KH
3 siblings, 2 replies; 27+ messages in thread
From: Antonino A. Daplas @ 2006-07-10 14:42 UTC (permalink / raw)
To: Jon Smirl; +Cc: Alan Cox, H. Peter Anvin, Greg KH, lkml, Andrew Morton
Jon Smirl wrote:
> On 7/10/06, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>> Ar Llu, 2006-07-10 am 09:03 -0400, ysgrifennodd Jon Smirl:
>> > I agree with this. I made a mistake with the pts vs pty, why not just
>> > help me fix the mistake instead of rejecting everything? Some the of
>> > the info being reported in /proc/tty/drivers is wrong (vc./0 - from
>> > the devfs attempt?). or missing.
>>
>> What are you trying to achieve and where are you trying to get. If you
>> want better info for the tty layer then get the new info working in
>> sysfs first. Then when people are generally using sysfs you can worry
>> about cleaning up/removing/breaking the old stuff.
>>
>
> Before the change /proc/tty/drivers shows this:
>
> [jonsmirl@jonsmirl ~]$ cat /proc/tty/drivers
> /dev/tty /dev/tty 5 0 system:/dev/tty
> /dev/console /dev/console 5 1 system:console
> /dev/ptmx /dev/ptmx 5 2 system
> /dev/vc/0 /dev/vc/0 4 0 system:vtmaster
vtmaster was /dev/tty0 in 2.2.x, changed to /dev/vc/0 probably
because of devfs. I would tend to agree with the change of at least
this part.
A few apps do rely on /proc/tty/drivers for the major-minor
to device name mapping. /dev/vc/0 does not exist (unless
created manually) without devfs.
Tony
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 14:42 ` Antonino A. Daplas
@ 2006-07-10 14:57 ` Jon Smirl
2006-07-10 15:19 ` Alan Cox
2006-07-10 18:13 ` Alistair John Strachan
1 sibling, 1 reply; 27+ messages in thread
From: Jon Smirl @ 2006-07-10 14:57 UTC (permalink / raw)
To: Antonino A. Daplas; +Cc: Alan Cox, H. Peter Anvin, Greg KH, lkml, Andrew Morton
On 7/10/06, Antonino A. Daplas <adaplas@gmail.com> wrote:
> > Before the change /proc/tty/drivers shows this:
> >
> > [jonsmirl@jonsmirl ~]$ cat /proc/tty/drivers
> > /dev/tty /dev/tty 5 0 system:/dev/tty
> > /dev/console /dev/console 5 1 system:console
> > /dev/ptmx /dev/ptmx 5 2 system
> > /dev/vc/0 /dev/vc/0 4 0 system:vtmaster
>
> vtmaster was /dev/tty0 in 2.2.x, changed to /dev/vc/0 probably
> because of devfs. I would tend to agree with the change of at least
> this part.
>
> A few apps do rely on /proc/tty/drivers for the major-minor
> to device name mapping. /dev/vc/0 does not exist (unless
> created manually) without devfs.
This is why I questioned if /proc/tty was really in use, it contains
an entry that is obviously wrong for my system.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 15:19 ` Alan Cox
@ 2006-07-10 15:10 ` Valdis.Kletnieks
2006-07-10 15:21 ` Russell King
2006-07-10 15:35 ` Antonino A. Daplas
1 sibling, 1 reply; 27+ messages in thread
From: Valdis.Kletnieks @ 2006-07-10 15:10 UTC (permalink / raw)
To: Alan Cox
Cc: Jon Smirl, Antonino A. Daplas, H. Peter Anvin, Greg KH, lkml,
Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 935 bytes --]
On Mon, 10 Jul 2006 16:19:06 BST, Alan Cox said:
> Ar Llu, 2006-07-10 am 10:57 -0400, ysgrifennodd Jon Smirl:
> > > A few apps do rely on /proc/tty/drivers for the major-minor
> > > to device name mapping. /dev/vc/0 does not exist (unless
> > > created manually) without devfs.
> >
> > This is why I questioned if /proc/tty was really in use, it contains
> > an entry that is obviously wrong for my system.
>
> Which tools already know about. What is so hard to understand about the
> idea that pointless random changes break stuff and don't fix things.
On the other hand, a case can be made that if userspace already knows about
the fact the thing is totally broken, fixing it won't break anything. The only
case is that some *already* terminally broken stuff may break further.
Having said that, you're of course correct that we need it done correctly
in /sys, give the tools a chance to catch up, then do the /proc/tty cleanup.
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 14:57 ` Jon Smirl
@ 2006-07-10 15:19 ` Alan Cox
2006-07-10 15:10 ` Valdis.Kletnieks
2006-07-10 15:35 ` Antonino A. Daplas
0 siblings, 2 replies; 27+ messages in thread
From: Alan Cox @ 2006-07-10 15:19 UTC (permalink / raw)
To: Jon Smirl
Cc: Antonino A. Daplas, H. Peter Anvin, Greg KH, lkml, Andrew Morton
Ar Llu, 2006-07-10 am 10:57 -0400, ysgrifennodd Jon Smirl:
> > A few apps do rely on /proc/tty/drivers for the major-minor
> > to device name mapping. /dev/vc/0 does not exist (unless
> > created manually) without devfs.
>
> This is why I questioned if /proc/tty was really in use, it contains
> an entry that is obviously wrong for my system.
Which tools already know about. What is so hard to understand about the
idea that pointless random changes break stuff and don't fix things.
As I've now said three times, put the new stuff in your sysfs work you
are going to submit, and get it right there, then come back and
revisit /proc/tty.
Alan
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 15:10 ` Valdis.Kletnieks
@ 2006-07-10 15:21 ` Russell King
2006-07-10 15:38 ` Valdis.Kletnieks
0 siblings, 1 reply; 27+ messages in thread
From: Russell King @ 2006-07-10 15:21 UTC (permalink / raw)
To: Valdis.Kletnieks
Cc: Alan Cox, Jon Smirl, Antonino A. Daplas, H. Peter Anvin, Greg KH,
lkml, Andrew Morton
On Mon, Jul 10, 2006 at 11:10:32AM -0400, Valdis.Kletnieks@vt.edu wrote:
> On Mon, 10 Jul 2006 16:19:06 BST, Alan Cox said:
> > Ar Llu, 2006-07-10 am 10:57 -0400, ysgrifennodd Jon Smirl:
> > > > A few apps do rely on /proc/tty/drivers for the major-minor
> > > > to device name mapping. /dev/vc/0 does not exist (unless
> > > > created manually) without devfs.
> > >
> > > This is why I questioned if /proc/tty was really in use, it contains
> > > an entry that is obviously wrong for my system.
> >
> > Which tools already know about. What is so hard to understand about the
> > idea that pointless random changes break stuff and don't fix things.
>
> On the other hand, a case can be made that if userspace already knows about
> the fact the thing is totally broken
Maybe - what if userspace is looking up /dev/tty0 in /proc/tty/drivers
and happens to know that it's called /dev/vc/0, because it's working
around this known idiosyncrasy of the kernel ? If you change tty/drivers
to be the more correct /dev/tty0, such a program would needlessly break.
> fixing it won't break anything.
How can you be certain - I think that's Alan's point (if it isn't,
that's my point.) The answer is you can't, so in order to maintain
ABI compatibility (and yes, this *IS* part of the kernel ABI) it
must be left exactly as-is.
> The only case is that some *already* terminally broken stuff may break
> further.
That "terminally broken stuff" might just happen to work with today's
kernels. Even so, that's no reason to pile in additional user-visible
changes which could potentially have adverse effects.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 15:19 ` Alan Cox
2006-07-10 15:10 ` Valdis.Kletnieks
@ 2006-07-10 15:35 ` Antonino A. Daplas
2006-07-10 15:54 ` Jon Smirl
1 sibling, 1 reply; 27+ messages in thread
From: Antonino A. Daplas @ 2006-07-10 15:35 UTC (permalink / raw)
To: Alan Cox; +Cc: Jon Smirl, H. Peter Anvin, Greg KH, lkml, Andrew Morton
Alan Cox wrote:
> Ar Llu, 2006-07-10 am 10:57 -0400, ysgrifennodd Jon Smirl:
>>> A few apps do rely on /proc/tty/drivers for the major-minor
>>> to device name mapping. /dev/vc/0 does not exist (unless
>>> created manually) without devfs.
>> This is why I questioned if /proc/tty was really in use, it contains
>> an entry that is obviously wrong for my system.
>
> Which tools already know about.
True. I see this code snippet many times:
fd = open("/dev/vc/0", FLAGS);
if (fd == -1)
fd = open("/dev/tty0", FLAGS);
> What is so hard to understand about the
> idea that pointless random changes break stuff and don't fix things.
But since we're killing devfs, changing /dev/vc/0 to /dev/tty0 will be one
of the nails in devfs' coffin :-)
Tony
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 15:21 ` Russell King
@ 2006-07-10 15:38 ` Valdis.Kletnieks
0 siblings, 0 replies; 27+ messages in thread
From: Valdis.Kletnieks @ 2006-07-10 15:38 UTC (permalink / raw)
To: Russell King
Cc: Alan Cox, Jon Smirl, Antonino A. Daplas, H. Peter Anvin, Greg KH,
lkml, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 1313 bytes --]
On Mon, 10 Jul 2006 16:21:47 BST, Russell King said:
> Maybe - what if userspace is looking up /dev/tty0 in /proc/tty/drivers
> and happens to know that it's called /dev/vc/0, because it's working
> around this known idiosyncrasy of the kernel ?
It only breaks if it's being totally brain-dead and doing this:
if (!strcmp(inputdev,"/dev/tty0") inputdev = "/dev/vc/0";
and not bothering to check that /dev/tty0 could *possibly* actually
appear in the /proc/tty entry. In fact, it would have to be actively
asserting that it can't appear.
Code that does this sort of thing:
if (!strcmp(procentry,"/dev/vc/0") procentry = "/dev/tty0";
if (!strcmp(procentry, inputdev)) { whatever to to do when found }
will still work.
> That "terminally broken stuff" might just happen to work with today's
> kernels. Even so, that's no reason to pile in additional user-visible
> changes which could potentially have adverse effects.
Oddly enough, "This PoS code only happened to work" is considered a good
and sufficient reason to fix kernel code. :)
Also, please note that I *did* agree with Alan - this needs to be done right
in /sys first, and then tools updated. However, having provided a *correct*
way to do it, we should not *then* use "old crap might break further" as
a reason to not finish the cleanup.
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 15:35 ` Antonino A. Daplas
@ 2006-07-10 15:54 ` Jon Smirl
2006-07-10 16:04 ` H. Peter Anvin
2006-07-10 22:14 ` Jan Engelhardt
0 siblings, 2 replies; 27+ messages in thread
From: Jon Smirl @ 2006-07-10 15:54 UTC (permalink / raw)
To: Antonino A. Daplas; +Cc: Alan Cox, H. Peter Anvin, Greg KH, lkml, Andrew Morton
On 7/10/06, Antonino A. Daplas <adaplas@gmail.com> wrote:
> Alan Cox wrote:
> > Ar Llu, 2006-07-10 am 10:57 -0400, ysgrifennodd Jon Smirl:
> >>> A few apps do rely on /proc/tty/drivers for the major-minor
> >>> to device name mapping. /dev/vc/0 does not exist (unless
> >>> created manually) without devfs.
> >> This is why I questioned if /proc/tty was really in use, it contains
> >> an entry that is obviously wrong for my system.
> >
> > Which tools already know about.
>
> True. I see this code snippet many times:
BSD has /dev/vc/0 right? I suspect that code is there to support BSD
and make the app portable.
As far as I know the only time Linux has ever had /dev/vc/0 was during
the brief excursion into devfs land. At that time /proc/tty/drivers
was modified to support devfs. But now devfs has been removed and the
device has reverted back to tty0. But /proc/tty/drivers wasn't
adjusted for devfs removal.
> fd = open("/dev/vc/0", FLAGS);
> if (fd == -1)
> fd = open("/dev/tty0", FLAGS);
>
> > What is so hard to understand about the
> > idea that pointless random changes break stuff and don't fix things.
>
> But since we're killing devfs, changing /dev/vc/0 to /dev/tty0 will be one
> of the nails in devfs' coffin :-)
>
> Tony
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 15:54 ` Jon Smirl
@ 2006-07-10 16:04 ` H. Peter Anvin
2006-07-10 22:14 ` Jan Engelhardt
1 sibling, 0 replies; 27+ messages in thread
From: H. Peter Anvin @ 2006-07-10 16:04 UTC (permalink / raw)
To: Jon Smirl; +Cc: Antonino A. Daplas, Alan Cox, Greg KH, lkml, Andrew Morton
Jon Smirl wrote:
>
> BSD has /dev/vc/0 right? I suspect that code is there to support BSD
> and make the app portable.
>
I think it was there to support devfs.
> As far as I know the only time Linux has ever had /dev/vc/0 was during
> the brief excursion into devfs land. At that time /proc/tty/drivers
> was modified to support devfs. But now devfs has been removed and the
> device has reverted back to tty0. But /proc/tty/drivers wasn't
> adjusted for devfs removal.
>
Agreed.
-hpa
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 14:42 ` Antonino A. Daplas
2006-07-10 14:57 ` Jon Smirl
@ 2006-07-10 18:13 ` Alistair John Strachan
1 sibling, 0 replies; 27+ messages in thread
From: Alistair John Strachan @ 2006-07-10 18:13 UTC (permalink / raw)
To: Antonino A. Daplas
Cc: Jon Smirl, Alan Cox, H. Peter Anvin, Greg KH, lkml, Andrew Morton
On Monday 10 July 2006 15:42, Antonino A. Daplas wrote:
> Jon Smirl wrote:
> > On 7/10/06, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> >> Ar Llu, 2006-07-10 am 09:03 -0400, ysgrifennodd Jon Smirl:
> >> > I agree with this. I made a mistake with the pts vs pty, why not just
> >> > help me fix the mistake instead of rejecting everything? Some the of
> >> > the info being reported in /proc/tty/drivers is wrong (vc./0 - from
> >> > the devfs attempt?). or missing.
> >>
> >> What are you trying to achieve and where are you trying to get. If you
> >> want better info for the tty layer then get the new info working in
> >> sysfs first. Then when people are generally using sysfs you can worry
> >> about cleaning up/removing/breaking the old stuff.
> >
> > Before the change /proc/tty/drivers shows this:
> >
> > [jonsmirl@jonsmirl ~]$ cat /proc/tty/drivers
> > /dev/tty /dev/tty 5 0 system:/dev/tty
> > /dev/console /dev/console 5 1 system:console
> > /dev/ptmx /dev/ptmx 5 2 system
> > /dev/vc/0 /dev/vc/0 4 0 system:vtmaster
>
> vtmaster was /dev/tty0 in 2.2.x, changed to /dev/vc/0 probably
> because of devfs. I would tend to agree with the change of at least
> this part.
>
> A few apps do rely on /proc/tty/drivers for the major-minor
> to device name mapping. /dev/vc/0 does not exist (unless
> created manually) without devfs.
Create a file in /etc/udev/rules.d. Add to it the following.
# devfs-ify vt devices
KERNEL="tty[0-9]*", NAME="vc/%n"
Now John's names are broken.
As Alan's wisely pointed out, it's utterly insane to try to "fix" a legacy
file when it a) can never match all possible, legal, current configurations
and b) shouldn't be used for anything important anyway.
It'd be better to CONFIG out this directory and see what breaks. Then we can
decide if we should (or provide distributors the option to) remove it.
--
Cheers,
Alistair.
Final year Computer Science undergraduate.
1F2 55 South Clerk Street, Edinburgh, UK.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 15:54 ` Jon Smirl
2006-07-10 16:04 ` H. Peter Anvin
@ 2006-07-10 22:14 ` Jan Engelhardt
1 sibling, 0 replies; 27+ messages in thread
From: Jan Engelhardt @ 2006-07-10 22:14 UTC (permalink / raw)
To: Jon Smirl
Cc: Antonino A. Daplas, Alan Cox, H. Peter Anvin, Greg KH, lkml,
Andrew Morton
>> True. I see this code snippet many times:
>
> BSD has /dev/vc/0 right? I suspect that code is there to support BSD
> and make the app portable.
$ cd /dev; echo v* z*
v* zero
/dev/vc? Not in FreeBSD 6.1. FreeBSD has ttyv%d, OpenBSD ttyC%d, NetBSD uh I
forgot. In fact, I fail to see an equivalent of tty0 for any BSD. THe next best
thing is /dev/ctty (linux: /dev/tty), but which is something different than
tty0.
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
@ 2006-07-11 2:18 Albert Cahalan
0 siblings, 0 replies; 27+ messages in thread
From: Albert Cahalan @ 2006-07-11 2:18 UTC (permalink / raw)
To: jonsmirl, alan, hpa, greg, linux-kernel, akpm
Jon Smirl writes:
> If I use udev to rename my devices, the names aren't going
> to match /proc/tty and what ps shows.
It's not as if ps will mislead you. You get "?" if you
redirected stderr or if you lack permission to examine
the /proc/*/fd/* links.
Of course, failing to follow Documentation/devices.txt is
complete foolishness. We have standards you know. The names
are pretty much part of the ABI. Feel free to swap /dev/zero
with /dev/random if you believe otherwise.
> The idea behind udev is that the kernel only deals in device
> numbers and all naming happens in user space.
For many things, the kernel knows:
$ cat /proc/*/maps | egrep '000[ ].*/dev'
3001e000-30020000 rw-s 90000000 03:0d 2989877 /dev/fb0
3002a000-3004a000 rw-s f0000000 03:0d 2990830 /dev/mem
3004a000-3104a000 rw-s 94000000 03:0d 2989877 /dev/fb0
The kernel only needs to remember, by keeping a dentry around.
Not that a devices.txt-compliant devfs wouldn't kick ass...
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 12:41 ` Jon Smirl
2006-07-10 13:10 ` Alan Cox
@ 2006-07-11 21:52 ` Greg KH
1 sibling, 0 replies; 27+ messages in thread
From: Greg KH @ 2006-07-11 21:52 UTC (permalink / raw)
To: Jon Smirl; +Cc: Alan Cox, H. Peter Anvin, lkml, Andrew Morton
On Mon, Jul 10, 2006 at 08:41:50AM -0400, Jon Smirl wrote:
> On 7/10/06, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> >Ar Llu, 2006-07-10 am 00:11 -0400, ysgrifennodd Jon Smirl:
> >> Fix various places in the tty code to make it match the current naming
> >system.
> >> pty_slave_driver->driver_name = "pty_slave";
> >
> >
> >NAK to just about all of this. Its gratuitous breaking of existing apps,
> >it achieves nothing and some of it like the pty stuff is just plain
> >incorrect anyway.
>
> The whole naming scheme encoded into the tty code is incompatible with
> udev. Udev allows renames and this code isn't aware of them.
No, it's not incompatible at all.
Sure udev lets you rename things stupidly, but you can do the same thing
with a simple 'rm' and 'mknod' too.
A good udev setup will follow the LSB naming scheme, and also provide a
persistent device naming scheme for some classes of devices. If your
distro does not do this, then file bugs and complain to them.
In short, this is not a kernel problem.
> I thought the idea behind udev was to remove all of this naming code
> from the kernel and handle it in user space.
No, that was never the idea behind udev. udev was created to allow
persistent device naming to be possible, that's all. It was not
intended to rip all naming out of the kernel, only the non-LSB compliant
names.
Although some people at times have proposed that the in-kernel names be
removed entirely, saner minds have always prevailed.
> So if I want legacy device names I would add a section to /etc/udev to
> create them. Udev is already capable of doing this.
udev should already do this. If not, then blame your distro for setting
it up improperly.
> >If you want to add sysfs interfaces to the tty code great, but please
> >leave the existing, relied up, functional and effectively user space ABI
> >tty files alone.
>
> So far I haven't identified anything that is really needed that isn't
> already available in sysfs.
>
> It does seem that we are missing a user space library call for
> converting a device number into a device name using the udev database.
Again, if you really want this, add the option to udevinfo. Don't keep
complaining about it...
And no, I would never expect the ps tools to rely on the udev package,
that would be insane.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] Clean up old names in tty code to current names
2006-07-10 14:07 ` Jon Smirl
` (2 preceding siblings ...)
2006-07-10 14:42 ` Antonino A. Daplas
@ 2006-07-11 21:54 ` Greg KH
3 siblings, 0 replies; 27+ messages in thread
From: Greg KH @ 2006-07-11 21:54 UTC (permalink / raw)
To: Jon Smirl; +Cc: Alan Cox, H. Peter Anvin, lkml, Andrew Morton
On Mon, Jul 10, 2006 at 10:07:41AM -0400, Jon Smirl wrote:
> >> I'm not going to solve this problem but it is something that needs to
> >> be discussed. Are we really going to maintain parallel naming schemes,
> >> one in-kernel and one out of kernel? I'm not even sure if USB will
> >> work without udev anymore.
> >
> >It works fine, it would not suprise me if udev users were still the
> >minority case in fact.
Well, as more modern distros spread, the number of users is getting
bigger..
> If I use udev to rename my devices, the names aren't going to match
> /proc/tty and what ps shows.
Same problem happens if you use 'mv'. Are you going to blame the kernel
on that problem too?
> The idea behind udev is that the kernel only deals in device numbers
> and all naming happens in user space.
Please stop saying this, it is just not true at all, and never has been.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2006-07-11 21:58 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-10 4:11 [PATCH] Clean up old names in tty code to current names Jon Smirl
2006-07-10 4:54 ` Andrew Morton
2006-07-10 7:14 ` H. Peter Anvin
2006-07-10 9:44 ` Alan Cox
2006-07-10 12:41 ` Jon Smirl
2006-07-10 13:10 ` Alan Cox
2006-07-10 13:03 ` Jon Smirl
2006-07-10 13:12 ` CaT
2006-07-10 13:18 ` Jon Smirl
2006-07-10 13:43 ` Alan Cox
2006-07-10 14:07 ` Jon Smirl
2006-07-10 14:17 ` Jan Engelhardt
2006-07-10 14:37 ` Alan Cox
2006-07-10 14:42 ` Antonino A. Daplas
2006-07-10 14:57 ` Jon Smirl
2006-07-10 15:19 ` Alan Cox
2006-07-10 15:10 ` Valdis.Kletnieks
2006-07-10 15:21 ` Russell King
2006-07-10 15:38 ` Valdis.Kletnieks
2006-07-10 15:35 ` Antonino A. Daplas
2006-07-10 15:54 ` Jon Smirl
2006-07-10 16:04 ` H. Peter Anvin
2006-07-10 22:14 ` Jan Engelhardt
2006-07-10 18:13 ` Alistair John Strachan
2006-07-11 21:54 ` Greg KH
2006-07-11 21:52 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2006-07-11 2:18 Albert Cahalan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox