From 91c316859d412d9a211429c5efa2567b941c9e50 Mon Sep 17 00:00:00 2001 From: Egor Ignatov Date: Thu, 8 Oct 2026 19:22:24 +0500 Subject: [PATCH] vconsole-setup: skip font setup on a KD_GRAPHICS vc instead of failing Since 7da67c3f8be ("vconsole-setup: skip setfont(8) when the console driver lacks font support") font_load_and_wait() probes the font with KDFONTOP before running setfont(8). The kernel returns EINVAL for a vc that is not in KD_TEXT, which is not treated as "no font support", so systemd-vconsole-setup now fails with Failed to check '/dev/tty1' has font support: Invalid argument when run on an explicitly specified vc that a graphical splash (e.g. plymouth) occupies, for instance from a unit ordered after getty@tty1. Previously setfont(8) silently ignored this case: verify_source_vc() accepts it with a notice that the font settings likely won't be applied, and setup_remaining_vcs() skips such vcs. Do the same here, skip the font setup and still load the keymap. (cherry picked from commit 4a3ece0b733d41eab9baad25648c8a921c590ed2) --- src/vconsole/vconsole-setup.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c index 5e0b86df50..bbf3bbcaee 100644 --- a/src/vconsole/vconsole-setup.c +++ b/src/vconsole/vconsole-setup.c @@ -444,6 +444,17 @@ static int font_load_and_wait(int fd, const char *vc, Context *c) { return 0; /* Report that we skipped this */ } + /* The kernel refuses to operate on the font of a vc in KD_GRAPHICS (e.g. an explicitly specified vc + * running a splash screen), hence skip the font setup like setup_remaining_vcs() does. + * verify_source_vc() already warned about this at notice level. */ + r = verify_vc_display_mode(fd); + if (r == -EBUSY) { + log_debug_errno(r, "Virtual console %s is not in KD_TEXT, skipping font setup.", vc); + return 0; /* Report that we skipped this */ + } + if (r < 0) + return log_error_errno(r, "Failed to check display mode of '%s': %m", vc); + /* May be called on the dummy console (e.g. during keymap setup with fbcon deferred takeover). Font * changes are not supported here and will fail. */ r = verify_vc_support_font(fd);