ttys - Add 'ifconsole' option to ttys entries
commitfda9d7927d5b74c2012759fea990a5cd57658131
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 26 May 2015 20:01:25 +0000 (26 13:01 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 26 May 2015 20:11:34 +0000 (26 13:11 -0700)
tree025dfcc63e9a3a02e7c57d03e8f7e10e4e7d02a8
parent0d20b83737d5944e98a5f2b56e910cf0baf901d5
ttys - Add 'ifconsole' option to ttys entries

* Add the 'ifconsole' option.  This allows you to construct a line as shown
  below to enable a getty (e.g. on a serial port) only if the tty is the
  system console.

    ttyd0   "/usr/libexec/getty std.9600"   dialup  on secure ifconsole

  The ifconsole option also silently disables any devices which do not
  exist, removing unnecessary console spam.

* Modify libc and init to handle the new flag.

* Modify the nrelease build and ttys defaults to use this option for
  ttyd0, ttyd1, ttyd2, and ttyd3.

* Avoids previously reported issues with system crashes on certain machines
  whos serial ports are not implemented properly without having to fully
  disable the default ttyd* getty feature.  If the serial port isn't the
  console, it won't be enabled.

* Add a sysctl to the kernel which init needs to test whether a tty is the
  console or not.

Suggested-by: swildner
etc/etc.i386/ttys
etc/etc.x86_64/ttys
include/ttyent.h
lib/libc/gen/getttyent.c
libexec/getty/ttys.5
nrelease/gui/etc/ttys
nrelease/root/etc/ttys
sbin/init/init.c
sys/kern/tty_cons.c