From: Vincent Whitchurch <vincent.whitchurch@axis.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: jslaby@suse.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tty: Add NULL TTY driver
Date: Wed, 3 Apr 2019 16:11:09 +0200 [thread overview]
Message-ID: <20190403141109.3mdmqbt3mjxrie6k@axis.com> (raw)
In-Reply-To: <20190403131213.GA4246@kroah.com>
On Wed, Apr 03, 2019 at 03:12:13PM +0200, Greg KH wrote:
> 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.
Especially on embedded systems, it would be convenient to have a simple
way to disable the console (both for kernel and userspace) on a system
which normally uses it, to free up the UART for other things.
In my case some early init script in userspace was actually tring to
handle the lack of a console in this way:
[ ! -w /dev/console ] || exec 2>/dev/console
but the problem is that /dev/console always exists but fails on write,
so the obvious way of handling missing devices doesn't work. AFAICS the
only way to get rid of /dev/console would be to disable the TTY layer
entirely in the kernel or have early userspace delete the file from
devtmpfs.
> 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.
Making it the default now would break users, wouldn't it? Since IIRC if
no console is selected, the first registered console will automatically
be used by default.
next prev parent reply other threads:[~2019-04-03 14:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-03 11:33 Vincent Whitchurch
2019-04-03 13:12 ` Greg KH
2019-04-03 14:11 ` Vincent Whitchurch [this message]
2019-04-05 8:39 ` Enrico Weigelt, metux IT consult
2019-04-05 9:00 ` Vincent Whitchurch
2019-04-05 12:32 ` Enrico Weigelt, metux IT consult
2019-04-11 13:05 ` Adamski, Krzysztof (Nokia - PL/Wroclaw)
2019-04-12 7:17 ` Enrico Weigelt, metux IT consult
2019-04-12 7:34 ` Adamski, Krzysztof (Nokia - PL/Wroclaw)
[not found] ` <0a50343e-6ebe-f725-82f7-5c127b5ce2e6@nokia.com>
2019-04-12 11:40 ` Enrico Weigelt, metux IT consult
2019-04-12 13:12 ` Adamski, Krzysztof (Nokia - PL/Wroclaw)
2019-04-11 15:28 ` Vincent Whitchurch
2019-04-12 11:31 ` Enrico Weigelt, metux IT consult
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190403141109.3mdmqbt3mjxrie6k@axis.com \
--to=vincent.whitchurch@axis.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®