From 2c37475d89b75d382728e7b33c01892770b15a26 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 16 Nov 2026 14:07:26 +0000 Subject: pass the console's terminal type too When starting, PID 1 asks /dev/console for its terminal type (see main.c, unless TERM or systemd.tty.term.console is on the kernel command line), which costs the 333ms timeout twice, in the initrd and again after switching root: [0.161825] systemd[1]: IPE support is disabled in the kernel, ignoring: ... [0.495506] systemd[1]: Failed to query /dev/console for terminfo: Operation not supported ... [1.051161] systemd[1]: IPE support is disabled in the kernel, ignoring: ... [1.385218] systemd[1]: Failed to query /dev/console for terminfo: Operation not supported Pass systemd.tty.term.console along with systemd.tty.term.ttyS0, and fall back to "dumb" without $TERM, as then nobody would answer either. --- default.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'default.nix') diff --git a/default.nix b/default.nix index 1ff4b78..3f7c522 100644 --- a/default.nix +++ b/default.nix @@ -180,12 +180,11 @@ pkgs.writeShellScriptBin "run-firecracker-vm" /* sh */ '' fi # Tell systemd the terminal's type and size, so it doesn't query them via - # ANSI sequences (and wait up to 333ms for each answer) when starting the - # getty. - tty_args= - if test -n "''${TERM-}"; then - tty_args="systemd.tty.term.ttyS0=$TERM" - fi + # ANSI sequences (and wait up to 333ms for each answer): PID 1 asks for + # the type of /dev/console when starting (in the initrd and again after + # switching root), and both type and size of ttyS0 when starting the getty. + term=''${TERM:-dumb} + tty_args="systemd.tty.term.console=$term systemd.tty.term.ttyS0=$term" if size=$(stty size 2>/dev/null) && test "$size" != "0 0"; then read -r rows cols <<< "$size" tty_args="$tty_args systemd.tty.rows.ttyS0=$rows systemd.tty.columns.ttyS0=$cols" -- cgit v1.3.1