Skip to contentSkip to conversation

2.5.26 broken on headless boxes

DISCUSSION Petr Vandrovec 3 participants 3 messages Jul 18, 2002 Char and misc drivers

lore
Share & tools
lore
#0 lore raw
Quoted 7 lines · Matthew Wilcox
Quoted 6 lines · Petr Vandrovec

CONFIG_VGA_CONSOLE/CONFIG_DUMMY_CONSOLE determines whether your VT can be created at all - maybe _CONSOLE suffix is misleading - without having at least one displaying device virtual terminals cannot be build. I always thought that CONFIG_DUMMY_CONSOLE cannot be unset, but apparently it can...

Quoted 5 lines
Quoted 2 lines

And BTW, when such configuration worked for you last time? It does not look to me like that it should ever work.

erm, 2.5.25 worked, and i didn't change the .config between 2.5.25 and 2.5.26 (just ran make oldconfig).

Got it. It was introduced in console.c:1.13 change from jsimmons. Before this change we did not registered tty driver:

con_init says:
const char* display_desc = NULL;
if (conswitchp) display_desc = conswitchp->con_startup();

  if (!display_desc) {
     fg_console = 0;
     return;

}
...
if (tty_register_driver(&console_driver)) ...

so we did not registered VT subsystem and panic did not happened:
instead of that you got 'cannot open initial console' or something like that...

But after change tty_register_driver is invoked (through vty_init) unconditionally from tty_io.c, where it depends only on CONFIG_VT.

So quick untested fix is

drivers/char/console.c +3 -0
@@ -2487,6 +2487,9 @@
 
 int __init vty_init(void)
 {
+	if (!conswitchp) {
+		return 0;
+	}
 	memset(&console_driver, 0, sizeof(struct tty_driver));
 	console_driver.magic = TTY_DRIVER_MAGIC;
 	console_driver.name = "vc/%d";

But I'll leave final decision at James, maybe he want to support VT without underlying console, and testing almost same condition on two places looks suspicious to me. Either we need blank timer and console, or do not. But registering one half in vty_init, and second half in con_init?
Best regards,
Petr Vandrovec

#1 lore raw

Em Fri, Jul 19, 2002 at 12:16:19AM +0200, Petr Vandrovec escreveu:

Quoted 3 lines

so we did not registered VT subsystem and panic did not happened:
instead of that you got 'cannot open initial console' or something like that...

Hummm, maybe this is what was biting me yesterday... I'll check RSN, as soon as I arrive at home 8)

- Arnaldo

#2 lore raw
In reply to Petr Vandrovec
Quoted 6 lines

But I'll leave final decision at James, maybe he want to support VT without underlying console, and testing almost same condition on two places looks suspicious to me. Either we need blank timer and console, or do not. But registering one half in vty_init, and second half in con_init?

This problem arises from the code being half way in between the final
results. The idea was to register a console if we have a displayed. All we need for printk. When we detect a keyboard to attach to a display without a keyboard then we would register a tty device then. The idea was to allow for a setup like having one keyboard and one display as your normal tty and a extra display as printk display. The code will be changing lot over the next few weeks.