Files
Daniel Golle 8d4551ceb2 kmscon: wait for the splash, add unifont, depend on evdev
Started while plymouth holds DRM master, kmscon retries taking it from
a timer and logs a failure on every attempt. Its built-in 8x16 font
covers the first 256 code points only, held in CP437 order while
kmscon looks glyphs up by Unicode code point, so box drawing, block and
braille characters come out wrong. The input event nodes it reads only
exist with the evdev handler, which nothing pulled in.

Do not start the instance while plymouth reports that it holds the
display, and start it on the plymouth.release event the splash hands
procd when it lets go. Build the GNU Unifont engine into a
kmscon-mod-unifont package; its generator genunifont is packaged as a
host build, and a patch lets meson use that one. The init script
passes --font-engine only when one is configured, so kmscon falls
through to unifont when the module is installed. GNU Unifont is
dual-licensed under GPL-2.0-or-later with a font embedding exception
and OFL-1.1; kmscon takes the font under OFL-1.1, so the module
package carries that licence besides MIT. Depend on kmod-input-evdev.

Fixes: 3c8ebee9b4 ("kmscon: depend on input-support for the evdev nodes")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-10-07 08:23:38 +01:00

43 lines
1.2 KiB
Bash

#!/bin/sh /etc/rc.common
USE_PROCD=1
START=96
splash_holds_display() {
[ "$(ubus -S call plymouth status 2>/dev/null | \
jsonfilter -e '@.display' 2>/dev/null)" = true ]
}
start_service() {
local term font_size font_engine hwaccel login seats
# The splash announces with plymouth.release when it lets go.
splash_holds_display && return 0
config_load kmscon
config_get term main term xterm-256color
config_get font_size main font_size 14
config_get font_engine main font_engine
config_get_bool hwaccel main hwaccel 1
config_get login main login "/bin/login -p"
config_get seats main seats
procd_open_instance
procd_set_param command /usr/bin/kmscon --drm --term "$term" \
--font-size "$font_size" --libseat
[ -n "$font_engine" ] && \
procd_append_param command --font-engine "$font_engine"
[ "$hwaccel" = 1 ] && procd_append_param command --hwaccel
[ -n "$seats" ] && procd_append_param command --seats "$seats"
procd_append_param command --login -- $login
procd_set_param respawn
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
service_triggers() {
procd_add_reload_trigger kmscon
procd_add_raw_trigger plymouth.release 0 /etc/init.d/kmscon start
}