Kmscon
Kmscon is a simple terminal emulator based on Linux kernel mode setting (KMS). It is an attempt to replace the in-kernel VT implementation with a userspace console. Kmscon addresses the limitations of the built-in virtual console by better support for non-Latin characters, better font rendering with anti-aliasing, more fluent DRM backed presentation and better compatibility with HiDPI.
Installation
USE flags
USE flags for sys-apps/kmscon KMS/DRM based virtual Console Emulator
+drm
|
Enable Linux DRM for backend |
+fbdev
|
Enable Linux FBDev for backend |
+gles2
|
Enable GLES 2.0 (OpenGL for Embedded Systems) support (independently of full OpenGL, see also: gles2-only) |
+pango
|
Enable pango font rendering |
debug
|
Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces |
doc
|
Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally |
elogind
|
Enable session tracking via sys-auth/elogind |
pixman
|
Enable pixman font rendering |
systemd
|
Enable multiseat support via systemd |
test
|
Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently) |
Emerge
root #emerge --ask sys-apps/kmsconConfiguration
OpenRC
The usage of kmscon on OpenRC is similar to agetty; the following script is based on /etc/init.d/agetty.
/etc/init.d/kmsconvt#!/sbin/openrc-run
description="KMS System Console"
supervisor="supervise-daemon"
port="${RC_SVCNAME#*.}"
command=/usr/bin/kmscon
command_args_foreground="--vt=${port} --seats=seat0 --no-switchvt --login -- /sbin/agetty -o '-p -- \\u' --noclear -- - $TERM"
pidfile="/run/${RC_SVCNAME}.pid"
depend() {
after local
need elogind
}
start_pre() {
if [ "$port" = "$RC_SVCNAME" ]; then
eerror "${RC_SVCNAME} cannot be started directly. You must create"
eerror "symbolic links to it for the ports you want to start"
eerror "kmscon on and add those to the appropriate runlevels."
return 1
else
export EINFO_QUIET="${quiet:-yes}"
fi
}
stop_pre() {
export EINFO_QUIET="${quiet:-yes}"
}
root #cd /etc/init.d
root #for n in $(seq 1 6); do ln -s kmsconvt kmsconvt.tty$n; rc-update add kmsconvt.tty$n default; done
systemd
root #ln -s '/usr/lib/systemd/system/[email protected]' '/etc/systemd/system/[email protected]'Usage
Currently, the kmscon(1) and kmscon-launch-gui(1) man pages will not be installed unless the package's
doc USE flag is enabled; refer to bug #917051 for details.Refer to the kmscon(1) man page for general information about usage.
GUI environments must be started via the kmscon-launch-gui script, e.g.:
user $kmscon-launch-gui startxRemoval
Prior to removing kmscon, the system must be reconfigured to return to using agetty; a LiveCD may need to be used for this. Kmscon can then safely be removed.
A VT implementation must always be set, otherwise softlock can occur after reboot. Ensure either agetty (the default) or kmscon is enabled before reboot.
OpenRC
openrc-init
If you are using openrc-init, you need:
root #cd /etc/init.d
root #for n in $(seq 1 6); do rc-update del kmsconvt.tty${n} default; cp agetty agetty.tty${n} ; rc-update add agetty.tty${n} default ; done sysvinit
TODO
systemd
root #systemctl disable autovt@
root #ln -s '/usr/lib/systemd/system/[email protected]' '/etc/systemd/system/[email protected]'
Troubleshooting
Can't start X / Wayland session on kmscon
An X / Wayland session can't be started directly on kmscon; a Display manager or kmscon-launch-gui must be used instead, e.g.:
user $kmscon-launch-gui swayUnable to switch between different TTYs
Check /etc/kmscon/kmscon.conf and verify that it includes:
/etc/kmscon/kmscon.confswitchvt
See also
- Terminal emulator — emulates a video terminal within another display architecture (e.g. in X).