From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sonic306-3.consmr.mail.bf2.yahoo.com (sonic306-3.consmr.mail.bf2.yahoo.com [74.6.132.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 973772F4A for ; Sun, 18 Aug 2024 03:01:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.6.132.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723950108; cv=none; b=uwxl27WVJa0KDPN5/DaItE+owpV6YU17tNcCTcvlx2Y/lSVKywc5VqV9rjag/Jm22xiK0523NsaUM2lIlpd4VvbCGWKkwBxitDfwDdxo7i6JqZHGNmhg2vzirMQ7WIWRSZ59QEd2I4kI3pSYDu5CnuaPUKfC9gOKdUiAAggHC+M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723950108; c=relaxed/simple; bh=pefWDtn/Qgu0dqvuBECjV9PIolo4DJVaV2tgAsabPgk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QAe9WEb55dYPfT6QgDYZ/ewPolc+YtF7YuyXXccBGg1b8xDSn00P8FuX9xd4GmY317oJKz8ScIPIzOeUk0GpQGaeyOCHM473NdzcHpzZfxL4l/xLz2ZC/WhG+QDIpNiXZnYzjkKNHkFEO9Xsh4PA1sGREdavBoeWAhSnlomQryk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=verizon.net; spf=pass smtp.mailfrom=verizon.net; dkim=pass (2048-bit key) header.d=verizon.net header.i=@verizon.net header.b=J0swKFXx; arc=none smtp.client-ip=74.6.132.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=verizon.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=verizon.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=verizon.net header.i=@verizon.net header.b="J0swKFXx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon.net; s=a2048; t=1723950104; bh=csABxt0Ml9L8oCwYoV45e724JMxOZGHrhhNFhMulxsY=; h=From:To:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=J0swKFXxBrZq/62mg2rpe41SfzPOCIxoxR/uqRNASZqAzvy2bYD5HrIex+VcFgwDxC6C3QFuOZWTjK7npD0YXxFIt+qJtkE8HOTnsyg02RDtjsgif+LPWRg0W5UB2BNJLpBKIo23TfElrycqoese4s+vOdUsLdS+ljEg42jMe2u98uHtTX2z03pp613IWIsD3SUYpo2QKAgrTcDmNmyWDpJu3ea1SuotsQ924/XruYirULSxuXJR1a2gsl//vW9mK5J0YlMkUhVIW2+KjD5HqTBbTVCOxGkF+mVuD8t6IldedaxMlnF4ReF2ZIyHtGsnbSy+v2tQBLySaZbc9nBl7A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1723950104; bh=hdLcKlBdNnm2aN9/gzZKjx9/EPM0b44/ItQwESHttuh=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=aWeDaC9lRVik/KNK1MG2fIRp7l5AS6WegXxpzbb3oIGw/DT7j0VXT54nKzZ5aJNW3s7FfdnKmZKCcM2T+8e4/nsxkaENq37h8E37er8s6FBU6x5UT6TFZJ+YE4c1HTrYfYQ488WQkPjq8ToOW4AWbNTWFWhBVjLM6MFB3kpzukY9gxCgskPgKDEbXFt0btkWG4juqyvRMbF5eQTBpcncV3lnMNyyRvXPG7cJTZKPRNdQ5+pD3ZyPfd4cdfu2kQY7SxnK0oAV9WHRQ59OldurdhU6r977cUfmWrQmQQm22U9LNlLPmfxYEfp3yXK2CktBLRBkRUYxWQeOfSmp0vUicg== X-YMail-OSG: dtsh1O4VM1ntZ2.yaarebRgIH50uht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jI8cqg_AcT1uYonDuZ _PnLi6IkvOmdXVYUvuyBi_Skdpr7SGnqKK78kiCA7g3gHQO_uXjPMmPfyIYHIuhc3wsQ2CTYYJ4m 1gPQQIqjR9SWhK_xg4RrrwKm3Ahxc5b2GsVEE0hdv.BxyQzvnuDZloSpNvKotFG_FpkY_2wmzNTa oYAJzBg-- X-Sonic-MF: X-Sonic-ID: 8c95c488-5162-4374-a68f-777d75914cae Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Sun, 18 Aug 2024 03:01:44 +0000 Received: by hermes--production-bf1-774ddfff8-6qj8v (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 05b06a6c732c06a93da2b1be5fd217cc; Sun, 18 Aug 2024 02:31:18 +0000 (UTC) From: nerdopolis To: pmladek@suse.com, rostedt@goodmis.org, john.ogness@linutronix.de, senozhatsky@chromium.org, gregkh@linuxfoundation.org, tglx@linutronix.de, tony@atomide.com, linux-kernel@vger.kernel.org, Bagas Sanjaya Subject: Re: VT-less kernels, and /dev/console on x86 Date: Sat, 17 Aug 2024 22:31:17 -0400 Message-ID: <4805768.rnE6jSC6OK@nerdopolis2> In-Reply-To: References: <2669238.7s5MMGUR32.ref@nerdopolis2> <2669238.7s5MMGUR32@nerdopolis2> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Mailer: WebService/1.1.22544 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol On Saturday, August 17, 2024 9:07:21 PM EDT Bagas Sanjaya wrote: > On Sat, Aug 17, 2024 at 08:09:20PM -0400, nerdopolis wrote: > > Hi > > > > I originally brought this up on linux-serial, but I think it makes more sense > > that it's part of how printk console device selection works. Without VTs, while > > most software is able to handle the situation, some userspace programs expect > > /dev/console to still be responsive. Namely systemd. It calls isatty() against > > /dev/console, and since /dev/console on VT-less systems currently defaults to > > /dev/ttyS0, and when /dev/ttyS0 is disconnected, the ioctl's fail, and it > > refuses to write log messages to it. > > > > There doesn't seem to be a mailing list for printk, so I had to use > > get_maintainer.pl. Hopefully this is correct > > > > > > After some grepping and guessing and testing, and playing around Something like > > diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig > > index a45d423ad10f..f94a4632aab0 100644 > > --- a/drivers/tty/Kconfig > > +++ b/drivers/tty/Kconfig > > @@ -384,9 +384,12 @@ config NULL_TTY > > > > In order to use this driver, you should redirect the console to this > > TTY, or boot the kernel with console=ttynull. > > - > > If unsure, say N. > > > > +config NULL_TTY_CONSOLE > > + bool "Supports /dev/ttynull as a console automatically" > > + depends on NULL_TTY && !VT_CONSOLE > > + > > config VCC > > tristate "Sun Virtual Console Concentrator" > > depends on SUN_LDOMS > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > > index dddb15f48d59..c1554a789de8 100644 > > --- a/kernel/printk/printk.c > > +++ b/kernel/printk/printk.c > > @@ -3712,6 +3712,11 @@ void __init console_init(void) > > initcall_t call; > > initcall_entry_t *ce; > > > > +#ifdef CONFIG_NULL_TTY_CONSOLE > > + if (!strstr(boot_command_line, "console=")) > > + add_preferred_console("ttynull", 0, NULL); > > +#endif > > + > > /* Setup the default TTY line discipline. */ > > n_tty_init(); > > > > > > > > > > seems to work, it conflicts with CONFIG_VT_CONSOLE since it is effectively > > redundant, it is optional, so that it doesn't cause any changes to > > configurations, that historically had CONFIG_VT_CONSOLE turned off in the past, > > and for bootloader configs, it won't change any behavior if the kernel command > > line has a console device specified > > > > With ttynull as the console device, isatty() no longer fails on /dev/console, > > systemd writes the log messages fine to /dev/console, and when Plymouth calls > > TIOCCONS on its PTY, it is able to get the log messages. > > Then what does /dev/ttynull do other than just to satisfy systemd? I expect > it to be like /dev/null, though. > > Confused... > > /dev/ttynull is the fake tty device that was added in ~2019, I guess it's kind of like /dev/null, but certain terminal related IOCTLs work against it too, like TCGETS, which is the probe isatty() uses. https://lore.kernel.org/all/20190403113327.3628-1-vincent.whitchurch@axis.com/ the original thread for the addition of the ttynull driver explains it better than I can. The issue came up here https://github.com/systemd/systemd/pull/33690 before I knew about the existence of this driver. I was getting the nice status messages from systemd appearing on Plymouth when the QEMU had a virtual console attached to /dev/ttyS0, but on real hardware, I was not seeing these status messages. The thought is that when distributions eventually decide to go VT-less they are not going to want to change the kernel boot options in the bootloader config to force console=ttynull, and might want this to happen automatically.