atom feed46 messages in org.kernel.vger.linux-kernelRe: tty: add 'active' sysfs attribute...
FromSent OnAttachments
Kay SieversNov 16, 2010 7:46 am 
Alan CoxNov 16, 2010 7:56 am 
Kay SieversNov 16, 2010 8:12 am 
Alan CoxNov 16, 2010 9:14 am 
Kay SieversNov 16, 2010 10:51 am 
Alan CoxNov 16, 2010 11:55 am 
Kay SieversNov 16, 2010 12:15 pm 
Alan CoxNov 16, 2010 12:48 pm 
Kay SieversNov 16, 2010 1:28 pm 
Lennart PoetteringNov 16, 2010 1:35 pm 
Lennart PoetteringNov 16, 2010 1:42 pm 
Alan CoxNov 16, 2010 2:51 pm 
Alan CoxNov 16, 2010 2:55 pm 
Lennart PoetteringNov 16, 2010 2:58 pm 
Alan CoxNov 16, 2010 3:04 pm 
Lennart PoetteringNov 16, 2010 3:10 pm 
Lennart PoetteringNov 16, 2010 3:18 pm 
Alan CoxNov 16, 2010 3:45 pm 
Etched PixelsNov 16, 2010 3:49 pm 
John StoffelNov 17, 2010 8:31 am 
Vald...@vt.eduNov 17, 2010 2:00 pm 
Kay SieversNov 17, 2010 3:39 pm 
Alan CoxNov 17, 2010 3:56 pm 
Greg KHNov 17, 2010 5:27 pm 
Lennart PoetteringNov 17, 2010 5:48 pm 
Greg KHNov 17, 2010 5:52 pm 
Lennart PoetteringNov 17, 2010 6:28 pm 
Alan CoxNov 18, 2010 2:14 am 
Dr. Werner FinkNov 18, 2010 2:59 am 
Alan CoxNov 18, 2010 3:23 am 
Kay SieversNov 18, 2010 3:54 am 
Kay SieversNov 18, 2010 4:03 am 
Dr. Werner FinkNov 18, 2010 4:12 am 
Alan CoxNov 18, 2010 4:57 am 
Alan CoxNov 18, 2010 5:00 am 
Dr. Werner FinkNov 18, 2010 5:13 am 
Alan CoxNov 18, 2010 6:41 am 
Dr. Werner FinkNov 19, 2010 5:21 am 
Alan CoxNov 19, 2010 7:46 am 
Dr. Werner FinkNov 19, 2010 9:06 am.tiocgdev
Greg KHNov 19, 2010 10:02 am 
Dr. Werner FinkNov 19, 2010 10:41 am 
Alan CoxNov 20, 2010 4:39 am 
Dr. Werner FinkDec 1, 2010 3:15 am 
Dr. Werner FinkDec 1, 2010 4:31 am.tiocgdev
Dr. Werner FinkDec 3, 2010 3:47 am.Other
Subject:Re: tty: add 'active' sysfs attribute to tty0 and console device
From:Dr. Werner Fink (wer@suse.de)
Date:Nov 18, 2010 4:12:22 am
List:org.kernel.vger.linux-kernel

On Thu, Nov 18, 2010 at 11:23:35AM +0000, Alan Cox wrote:

is the most pressing case e.g. on s390 or zSeries) and this without forcing (and maybe stealing) the controlling tty on the system console to be able to detect the primary tty/console.

What do you mean by console in this context

The console in printk context and the "console" in "active vt window" are unrelated concepts with the same name, so its a bit confusing to follow here.

Example: running a boot script on /dev/console and after fsck sulogin has to called to be able to asked the system admin. Now the question is which console device the system admin is waiting in front of (before /dev/ttyS0 or /dev/tty3270 or whatever).

facilities (having device, read, write, and unblank) are also shown in the new file /sys/class/tty/console/active ... but maybe Randy could says a few words for what this is usable.

The system console does not even need to be a tty device, and on many embedded devices is not (it may for example by a RAM buffer not wiped over reboots or it may be jtag or MIPI trace ports.

"tty0" is *currently* a shorthand for "the VT the keyboard/display are showing". That's a shorthand that in itself will make no sense in future.

I'm aware of. For using tty devices of the system console it requires to have e.g. with my patch:

bash> cat /proc/tty/consoles tty0 -WU (ECp) 4:7

the `W' flag for write and the major:minor pair, beside this the `U' flag indicates the tty can do an unblank operation, the `-' shows that there is no read operation (never seen such a console tty). On an other system here I see:

bash> cat /proc/tty/consoles ttyS0 -W- (ECp) 4:64 tty0 -WU (Ep) 4:1

which I'm using in user space with

dev_t dev = 0; FILE * fc;

if ((fc = fopen("/proc/tty/consoles", "r"))) { char fbuf[16]; int maj, min; while ((fscanf(fc, "%*s %*s (%[^)]) %d:%d", &fbuf[0], &maj, &min) == 3))
{ if (!strchr(fbuf, 'E')) continue; if (strchr(fbuf, 'C')) { dev = makedev(maj, min); break; } } fclose(fc); }

to detect the primary console device here.

Werner