]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/posix-tty: Remove posix-fdtab dependency
authorAndrei Tatar <andrei@unikraft.io>
Thu, 30 May 2024 13:37:54 +0000 (15:37 +0200)
committerUnikraft Bot <monkey@unikraft.io>
Tue, 4 Feb 2025 10:22:02 +0000 (10:22 +0000)
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 <andrei@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Sergiu Moga <sergiu@unikraft.io>
GitHub-Closes: #1437

lib/posix-tty/Config.uk
lib/posix-tty/Makefile.uk

index 51ff4dcbede41e87925b82ddfcf55578def1af02..7e61e3ecf157852343fe4f0ae09acc87a7f5579e 100644 (file)
@@ -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
index 14d73919608e7365cd610707245c0b54b9649cdb..8f6de06a39e3b1b0a6e30c32762b44c8c2c569e0 100644 (file)
@@ -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