Hello,

In Linux there is no way to set the number of tty devices or console
to create. By default the kernel create 64 /dev/tty devices. what is
too much for embedded system with limited resources. As all these 64
devices are not necessary or mandatory for the kernel proper working,
I add a config option to set the desired tty. The lowest number you
can set is 1 and the highest is 63, any value respectively below or
above that, will cause a kconfig invalid entry pop-up.

Please keep me update.

Best Regards
From 430deaf09da90bf0da03b7ca612cd4481ad30fea Mon Sep 17 00:00:00 2001
From: Pierre Paul MINGOT <[email protected]>
Date: Thu, 22 Jan 2015 17:51:49 +0100
Subject: [PATCH] In Linux there is no way to set the number of tty devices or
 console to create. By default the kernel create 64 /dev/tty devices. what is
 too much for embedded system with limited resources. As all these 64 devices
 are not necessary or mandatory for the kernel proper working, I add a config
 option to set the desired tty. The lowest number you can set is 1 and the
 highest is 63, any value respectively below or above that, will cause a
 kconfig invalid entry pop-up.

Signed-off-by: Pierre Paul MINGOT <[email protected]>
---
 drivers/tty/Kconfig     | 14 ++++++++++++++
 include/uapi/linux/vt.h |  4 ++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index b24aa01..0ec58a2 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -75,6 +75,19 @@ config VT_CONSOLE_SLEEP
 	def_bool y
 	depends on VT_CONSOLE && PM_SLEEP
 
+config NR_TTY_DEVICES
+    int "Maximum tty device number"
+    depends on VT
+    range 1 63
+    default 1
+    ---help---
+    This is the highest numbered device created in /dev. You will actually have
+	NR_TTY_DEVICES+1 devices in /dev. The default is 63, which will result in
+	64 /dev entries. The lowest number you can set is 1 and the highest is 63,
+    anything respectively below or above that, is not possible and will cause
+    a kconfig invalid entry pop-up.
+    So the default value will be set.
+
 config HW_CONSOLE
 	bool
 	depends on VT && !UML
@@ -419,4 +432,5 @@ config DA_CONSOLE
 	help
 	  This enables a console on a Dash channel.
 
+
 endif # TTY
diff --git a/include/uapi/linux/vt.h b/include/uapi/linux/vt.h
index 978578b..2140496 100644
--- a/include/uapi/linux/vt.h
+++ b/include/uapi/linux/vt.h
@@ -7,8 +7,8 @@
  * resizing).
  */
 #define MIN_NR_CONSOLES 1       /* must be at least 1 */
-#define MAX_NR_CONSOLES	63	/* serial lines start at 64 */
-#define MAX_NR_USER_CONSOLES 63	/* must be root to allocate above this */
+/* serial lines start at 64 */
+#define MAX_NR_CONSOLES	 CONFIG_NR_TTY_DEVICES
+/* must be root to allocate above this */
+#define MAX_NR_USER_CONSOLES CONFIG_NR_TTY_DEVICES
 		/* Note: the ioctl VT_GETSTATE does not work for
 		   consoles 16 and higher (since it returns a short) */
 
-- 
1.9.1

Reply via email to