aboutsummaryrefslogtreecommitdiffstats
path: root/default.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-16 14:07:26 +0000
committertv <tv@krebsco.de>2026-11-16 14:07:26 +0000
commit2c37475d89b75d382728e7b33c01892770b15a26 (patch)
tree1908279b94ac601ce7304bbac31a3a3868627adc /default.nix
parent21393c506944153084fb40bbd681c874ff24a147 (diff)
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.
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix11
1 files changed, 5 insertions, 6 deletions
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"