change-the-number-of-tty-devices.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
  2. index 978db34..0c7a121 100644
  3. --- a/drivers/tty/Kconfig
  4. +++ b/drivers/tty/Kconfig
  5. @@ -75,6 +75,19 @@ config VT_CONSOLE_SLEEP
  6. def_bool y
  7. depends on VT_CONSOLE && PM_SLEEP
  8. +config NR_TTY_DEVICES
  9. + int "Maximum tty device number"
  10. + depends on VT
  11. + range 12 63
  12. + default 63
  13. + ---help---
  14. + This option is used to change the number of tty devices in /dev.
  15. + The default value is 63. The lowest number you can set is 12,
  16. + 63 is also the upper limit so we don't overrun the serial
  17. + consoles.
  18. +
  19. + If unsure, say 63.
  20. +
  21. config HW_CONSOLE
  22. bool
  23. depends on VT && !UML
  24. diff --git a/include/uapi/linux/vt.h b/include/uapi/linux/vt.h
  25. index 4b59a26..b494f6a 100644
  26. --- a/include/uapi/linux/vt.h
  27. +++ b/include/uapi/linux/vt.h
  28. @@ -3,12 +3,26 @@
  29. /*
  30. + * We will make this definition solely for the purpose of making packages
  31. + * such as splashutils build, because they can not understand that
  32. + * NR_TTY_DEVICES is defined in the kernel configuration.
  33. + */
  34. +#ifndef CONFIG_NR_TTY_DEVICES
  35. +#define CONFIG_NR_TTY_DEVICES 63
  36. +#endif
  37. +
  38. +/*
  39. * These constants are also useful for user-level apps (e.g., VC
  40. * resizing).
  41. */
  42. #define MIN_NR_CONSOLES 1 /* must be at least 1 */
  43. -#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
  44. -#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */
  45. +
  46. +/*
  47. + * NR_TTY_DEVICES:
  48. + * Value MUST be at least 11 and must never be higher then 63
  49. + */
  50. +#define MAX_NR_CONSOLES CONFIG_NR_TTY_DEVICES /* serial lines start above this */
  51. +#define MAX_NR_USER_CONSOLES CONFIG_NR_TTY_DEVICES /* must be root to allocate above this */
  52. /* Note: the ioctl VT_GETSTATE does not work for
  53. consoles 16 and higher (since it returns a short) */