tty: Add NULL TTY driver
commit3117ff13f104e98b05b61e19cc754d1377e92e15
authorVincent Whitchurch <vincent.whitchurch@axis.com>
Wed, 3 Apr 2019 11:33:27 +0000 (3 13:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Apr 2019 13:21:34 +0000 (16 15:21 +0200)
tree466a0a4bb36d0786128d170bcb43f60e40c2c918
parent89bb1e1ee529d9d06ca694ba22a35dc2a3d6ac67
tty: Add NULL TTY driver

If no console driver is enabled (or if a non-present driver is selected
with something like console=null in an attempt to disable the console),
opening /dev/console errors out, and init scripts and other userspace
code that relies on the existence of a console will fail.  Symlinking
/dev/null to /dev/console does not solve the problem since /dev/null
does not behave like a real TTY.

To just provide a dummy console to userspace when no console driver is
available or desired, add a ttynull driver which simply discards all
writes.  It can be chosen on the command line in the standard way, i.e.
with console=ttynull.

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/Kconfig
drivers/tty/Makefile
drivers/tty/ttynull.c [new file with mode: 0644]