Kmscon

From Gentoo Wiki
Jump to:navigation Jump to:search
This page contains changes which are not marked for translation.


This article is a work in progress; treat its contents with caution - Afstelnoj (talk | contribs).

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
freetype Enable freetype2 renderer
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/kmscon

Configuration

It is recommended that the ERASECHAR line in /etc/login.defs be commented out for proper backspace functionality at the kmscon login prompt. Refer to this Github issue for details.

OpenRC

The usage of kmscon on OpenRC is similar to agetty; the following script is based on /etc/init.d/agetty.

FILE /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"
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 #chmod +x ./kmsconvt
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

Note
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 startx

Removal

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.

Warning
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 sway

Unable to switch between different TTYs

Check /etc/kmscon/kmscon.conf and verify that it includes:

FILE /etc/kmscon/kmscon.conf
switchvt

See also

  • Terminal emulator — emulates a video terminal within another display architecture (e.g. in X).