Re: [PATCH] tty: Add NULL TTY driver

From: Greg KH
Date: Wed Apr 03 2019 - 09:31:41 EST


On Wed, Apr 03, 2019 at 01:33:27PM +0200, Vincent Whitchurch wrote:
> 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.

If they have a broken system that sets "console=null", why would they
know to fix it to be "console=ttynull"?

I'm all for adding new functionality, but to provide kernel code because
userspace just isn't configured properly, that feels really wrong to me.

Now if this were to be the "default" if nothing is set up at all, that
might make a bit more sense, but as-is, this doesn't seem very useful.

thanks,

greg k-h