From 896c5b33895d5aa1796ba02e8ac21396875ec39a Mon Sep 17 00:00:00 2001 From: Andrei Tatar Date: Thu, 30 May 2024 15:37:54 +0200 Subject: [PATCH] lib/posix-tty: Remove posix-fdtab dependency This change removes posix-fdtab as a hard dependency to posix-tty, allowing the use of the latter without a userspace-visible fd table. The functionality to open file descriptors 0, 1, and 2 at boot remains dependent on posix-fdtab. Signed-off-by: Andrei Tatar Reviewed-by: Sergiu Moga Approved-by: Sergiu Moga GitHub-Closes: #1437 --- lib/posix-tty/Config.uk | 7 ++++++- lib/posix-tty/Makefile.uk | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/posix-tty/Config.uk b/lib/posix-tty/Config.uk index 51ff4dcbe..7e61e3ecf 100644 --- a/lib/posix-tty/Config.uk +++ b/lib/posix-tty/Config.uk @@ -1,6 +1,5 @@ menuconfig LIBPOSIX_TTY bool "posix-tty: Support for stdin/out/err" - select LIBPOSIX_FDTAB select LIBPOSIX_FDIO if LIBPOSIX_TTY @@ -9,7 +8,12 @@ if LIBPOSIX_TTY bool "Provide file driver for the serial console" select LIBUKCONSOLE + config LIBPOSIX_TTY_STDIO + bool "Open standard I/O files at boot (fd 0, 1, 2)" + select LIBPOSIX_FDTAB + choice LIBPOSIX_TTY_STDIN + depends on LIBPOSIX_TTY_STDIO prompt "stdin:" config LIBPOSIX_TTY_STDIN_NULL @@ -25,6 +29,7 @@ if LIBPOSIX_TTY endchoice choice LIBPOSIX_TTY_STDOUT + depends on LIBPOSIX_TTY_STDIO prompt "stdout/err:" config LIBPOSIX_TTY_STDOUT_SERIAL diff --git a/lib/posix-tty/Makefile.uk b/lib/posix-tty/Makefile.uk index 14d739196..8f6de06a3 100644 --- a/lib/posix-tty/Makefile.uk +++ b/lib/posix-tty/Makefile.uk @@ -4,6 +4,6 @@ CINCLUDES-$(CONFIG_LIBPOSIX_TTY) += -I$(LIBPOSIX_TTY_BASE)/include CXXINCLUDES-$(CONFIG_LIBPOSIX_TTY) += -I$(LIBPOSIX_TTY_BASE)/include LIBPOSIX_TTY_SRCS-y += $(LIBPOSIX_TTY_BASE)/pseudo.c -LIBPOSIX_TTY_SRCS-y += $(LIBPOSIX_TTY_BASE)/tty.c +LIBPOSIX_TTY_SRCS-$(CONFIG_LIBPOSIX_TTY_STDIO) += $(LIBPOSIX_TTY_BASE)/tty.c LIBPOSIX_TTY_SRCS-$(CONFIG_LIBPOSIX_TTY_SERIAL) += $(LIBPOSIX_TTY_BASE)/serial.c -- 2.39.5