public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vt: Add enable module parameter
@ 2026-01-26  9:21 Jocelyn Falempe
  2026-01-26  9:33 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 16+ messages in thread
From: Jocelyn Falempe @ 2026-01-26  9:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Nicolas Pitre, Calixte Pernot,
	linux-kernel, linux-serial
  Cc: Jocelyn Falempe

This allows to build the kernel with CONFIG_VT enabled, and choose
on the kernel command line to enable it or not.
Add vt.enable=1 to force enable, or vt.enable=0 to force disable.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
---
 drivers/tty/Kconfig | 13 +++++++++++++
 drivers/tty/vt/vt.c |  5 +++++
 2 files changed, 18 insertions(+)

diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index 149f3d53b7608..2b94c2710687a 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -41,6 +41,19 @@ config VT
 	  If unsure, say Y, or else you won't be able to do much with your new
 	  shiny Linux system :-)
 
+config VT_ENABLE
+	depends on VT
+	default y
+	bool "enable VT terminal" if EXPERT
+	help
+	  This allows to build the kernel with CONFIG_VT, and choose on the
+	  kernel command line to enable it or not. If set to y, VT will be
+	  enabled by default, but can be disabled with vt.enable=0 on the kernel
+	  command line. Otherwise, use vt.enable=1 to enable VT.
+	  This should help to transition to VT-less system.
+
+	  If unsure, say Y.
+
 config CONSOLE_TRANSLATIONS
 	depends on VT
 	default y
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 59b4b5e126ba1..d83613d98f594 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -164,6 +164,8 @@ EXPORT_SYMBOL(global_cursor_default);
 
 static int cur_default = CUR_UNDERLINE;
 module_param(cur_default, int, S_IRUGO | S_IWUSR);
+static bool vt_enable = IS_ENABLED(CONFIG_VT_ENABLE) ? true : false;
+module_param_named(enable, vt_enable, bool, S_IRUGO | S_IWUSR);
 
 /*
  * ignore_poke: don't unblank the screen when things are typed.  This is
@@ -3852,6 +3854,9 @@ ATTRIBUTE_GROUPS(vt_dev);
 
 int __init vty_init(const struct file_operations *console_fops)
 {
+	if (!vt_enable)
+		return 0;
+
 	cdev_init(&vc0_cdev, console_fops);
 	if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
 	    register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)

base-commit: 24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-01-26 23:00 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26  9:21 [PATCH] vt: Add enable module parameter Jocelyn Falempe
2026-01-26  9:33 ` Greg Kroah-Hartman
2026-01-26  9:43   ` Jocelyn Falempe
2026-01-26 10:20     ` Greg Kroah-Hartman
2026-01-26 10:30       ` Greg Kroah-Hartman
2026-01-26 10:49         ` Jocelyn Falempe
2026-01-26 10:57           ` Greg Kroah-Hartman
2026-01-26 10:48       ` Jocelyn Falempe
2026-01-26 10:59         ` Greg Kroah-Hartman
2026-01-26 12:26           ` Jocelyn Falempe
2026-01-26 12:46             ` Greg Kroah-Hartman
2026-01-26 13:05               ` Jocelyn Falempe
2026-01-26 14:36                 ` Greg Kroah-Hartman
2026-01-26 17:24                   ` Nicolas Pitre
2026-01-26 22:59                     ` Jocelyn Falempe
2026-01-26 23:00                   ` Jocelyn Falempe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox