public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: nerdopolis <bluescreen_avenger@verizon.net>
To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org,
	jirislaby@kernel.org, bluescreen_avenger@verizon.net
Subject: Re: /dev/ttynull and VT-less kernels on Desktop
Date: Mon, 05 Aug 2024 21:16:21 -0400	[thread overview]
Message-ID: <24283318.ouqheUzb2q@nerdopolis2> (raw)
In-Reply-To: <2708910.X9hSmTKtgW@nerdopolis2>

On Sunday, August 4, 2024 5:45:07 PM EDT nerdopolis wrote:
> Hi
> 
> I have been doing some testing on VT-less desktops. I brought up an issue with
> how systemd was not logging to /dev/console because isatty() was failing (in a
> thread last month which I kind of bungled by accidentally sending the first
> message with rich text enabled by accident) I solved that issue though. As
> disabling the VT console causes the default console to /dev/ttyS0 and the 
> isatty() calls on it were returning false.
> 
> I have found out that this issue actually already has an existing solution in
> the ttynull driver. After enabling it, and then adding console=ttynull to the
> kernel command line, this allows isatty() to succeed on VT-less systems, and
> now systemd is able to correctly log its status messages to the kernel console
> on VT-less systems, without needing anything connected to /dev/ttyS0
> 
> However I have two questions:
> 
> 1. Is there a build option to make it prioritize /dev/ttynull over /dev/ttyS0 ?
> 
>    It would probably be neeed so that distributions don't have to worry about
>    the logistics of adding that to everyone's GRUB_CMDLINE_LINUX_DEFAULT come
>    the eventual day the decide to go VT-less during its upgrade process.
> 
> 2. Is there a good way for the userspace to know that /dev/ttynull is primary?
> 
Hi

So I think I figured this part out, while ttynull doesn't make its way into the
/sys/devices/virtual/tty/console/active file, it is reported in /proc/consoles
so I will read from there, seems like the primary console is always the first
line, so this part is solved

Thanks
>    "ttynull" doesn't seem to appear in /sys/devices/virtual/tty/console/active
>    when it is active. Which seems like it could make sense, (as in a check if
>    it is empty) however if I boot with "console=ttyS0 console=ttynull", "ttyS0"
>    appears in the file, but if I boot with say "console=tty0 console=ttyS0",
>    they both appear in the file. It would be nice if in the first case it would
>    report "ttyS0 ttynull".
> 
>    With Plymouth, when the primary console is /dev/ttyS0 instead of /dev/tty0
>    it defaults to serial logging instead of showing a graphical splash, so now
>    if you want a graphical splash on a VT-less system, you have to also specify
>    "plymouth.graphical" on the kernel command line. If it could see "ttynull"
>    in the end of the file, distributions that go VT-less can also just enable
>    "ttynull" as the default console, and Plymouth could use that to
>    differentiate between VT-less desktop systems, or systems that actually want
>    serial logging, so they don't have to change GRUB_CMDLINE_LINUX_DEFAULT.
> 
> Thanks
> 
> 
> 
> 
> 





  reply	other threads:[~2024-08-06  1:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2708910.X9hSmTKtgW.ref@nerdopolis2>
2024-08-04 21:45 ` /dev/ttynull and VT-less kernels on Desktop nerdopolis
2024-08-06  1:16   ` nerdopolis [this message]
2024-08-10 15:10     ` nerdopolis

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=24283318.ouqheUzb2q@nerdopolis2 \
    --to=bluescreen_avenger@verizon.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-serial@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