Skip to contentSkip to conversation

serial console _after_ boot ? - was: Redirect kernel console

DISCUSSION [email protected] 1 participant 1 message Jan 3, 2008

lore
Share & tools
lore
#0 lore raw
Quoted 14 lines
Quoted 6 lines
Quoted 1 line

i was wondering how to make kernel messages appear on /dev/ttyS0

without a reboot, i.e. kernelparam "console=ttyS0"

The solution is simple... the following piece of code is inside opensuse-10.3/src/sysvinit-2.86-115.src.rpm#showconsole-1.08.tar.bz2#showconsole-1.08/blogd.c

Quoted 7 lines

(void)ioctl(0, TIOCCONS, NULL); /* Undo any current map if any */ if (ioctl(pts, TIOCCONS, NULL) < 0)
error("can not set console device to %s: %s\n", ptsname,
strerror(errno));

so I suppose that's it. Write up a new program that calls the ioctl on a tty, and you should be done. IOW:

Quoted 7 lines

TIOCCONS only works for pseudo terminals.

Besides, it only redirects stuff you send to /dev/console. It doesn't change what devices printk() prints to. Currently there is no way to change that on a running kernel.

Mike.

too bad, but thanks for the info.
_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30 Tage kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220