Re: [PATCH] Add possibility to set /dev/tty number

From: Greg KH
Date: Mon Jan 04 2016 - 10:43:11 EST


On Mon, Jan 04, 2016 at 04:34:56PM +0100, Pierre Paul MINGOT wrote:
> 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.

Really? How much memory does a vt device take up?

> 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.

Please don't attach patches, I can't do anything with them, you should
include them directly in your email. Also, if you look at your patch:

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

The entire changelog entry is in the Subject, which I doubt is what you
want :(

Please fix it up to have a short subject first and resend, after fixing
the errors below as well:

> 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.
> +

Odd mixture of tabs and spaces, just always use tabs please.

And the default should not be 1, keep it what it is today.

> 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 */

This doesn't make sense anymore, right?

Are you breaking the serial line minor number with this change?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/