All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add possibility to set /dev/tty number
@ 2016-01-04 15:34 Pierre Paul MINGOT
  2016-01-04 15:43 ` Greg KH
  2016-01-06 13:39 ` Austin S. Hemmelgarn
  0 siblings, 2 replies; 22+ messages in thread
From: Pierre Paul MINGOT @ 2016-01-04 15:34 UTC (permalink / raw)
  To: gregkh, jslaby, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

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

[-- Attachment #2: 0001-In-Linux-there-is-no-way-to-set-the-number-of-tty-de.patch --]
[-- Type: text/x-patch, Size: 2434 bytes --]

From 430deaf09da90bf0da03b7ca612cd4481ad30fea Mon Sep 17 00:00:00 2001
From: Pierre Paul MINGOT <mingot.pierre@gmail.com>
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 <mingot.pierre@gmail.com>
---
 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


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

end of thread, other threads:[~2016-01-06 14:07 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-04 15:34 [PATCH] Add possibility to set /dev/tty number Pierre Paul MINGOT
2016-01-04 15:43 ` Greg KH
2016-01-04 16:57   ` Austin S. Hemmelgarn
2016-01-04 17:11     ` Greg KH
2016-01-04 18:41       ` Austin S. Hemmelgarn
2016-01-04 22:55         ` One Thousand Gnomes
2016-01-05 13:16           ` Austin S. Hemmelgarn
2016-01-05 15:24             ` Greg KH
2016-01-05 15:33               ` Austin S. Hemmelgarn
2016-01-05 16:11             ` Theodore Ts'o
2016-01-05 16:22               ` Austin S. Hemmelgarn
2016-01-05  8:51         ` Pierre Paul MINGOT
2016-01-05 13:02           ` Austin S. Hemmelgarn
2016-01-05 15:25           ` Greg KH
2016-01-05 15:43             ` Austin S. Hemmelgarn
2016-01-05 16:03               ` Greg KH
2016-01-05 18:38         ` Austin S. Hemmelgarn
2016-01-05 20:47           ` One Thousand Gnomes
2016-01-06 12:42             ` Austin S. Hemmelgarn
2016-01-06 13:54               ` One Thousand Gnomes
2016-01-06 14:07                 ` Austin S. Hemmelgarn
2016-01-06 13:39 ` Austin S. Hemmelgarn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.