kmscon: remove cdev sessions

cdev sessions are outdated. Use libuvt instead. Remove all references to
cdev-sessions and clean up the build chain.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
David Herrmann 2013-10-23 15:22:28 +02:00
parent bcfb1d2ab5
commit 972ec107cf
9 changed files with 3 additions and 1600 deletions

View File

@ -648,7 +648,6 @@ kmscon_SOURCES = \
src/kmscon_module.c \
src/kmscon_terminal.h \
src/kmscon_dummy.h \
src/kmscon_cdev.h \
src/kmscon_seat.h \
src/kmscon_seat.c \
src/kmscon_conf.h \
@ -679,12 +678,6 @@ kmscon_SOURCES += src/kmscon_terminal.c
kmscon_LDADD += libtsm.la
endif
if BUILD_ENABLE_SESSION_CDEV
kmscon_SOURCES += src/kmscon_cdev.c
kmscon_CPPFLAGS += $(FUSE_CFLAGS)
kmscon_LDADD += $(FUSE_LIBS)
endif
#
# Tests
#

1
README
View File

@ -87,7 +87,6 @@ Released tarballs can be found at:
--with-sessions: Built in sessions. Available sessions are:
- dummy: Dummy fallback session
- terminal: Terminal-emulator sessions
- cdev: Fake VTs via CUSE (DEPRECATED! Don't use it!)
The following options select which applications are built. If
dependency-checks fail, they are disabled by default unless explicitly enabled

View File

@ -388,17 +388,14 @@ AC_ARG_WITH([sessions],
[with_sessions="default"])
enable_session_dummy="no"
enable_session_terminal="no"
enable_session_cdev="no"
if test "x$enable_all" = "xyes" ; then
enable_session_dummy="yes"
enable_session_terminal="yes"
enable_session_cdev="yes"
with_sessions="dummy,terminal,cdev (all)"
with_sessions="dummy,terminal (all)"
elif test "x$with_sessions" = "xdefault" ; then
enable_session_dummy="yes (default)"
enable_session_terminal="yes (default)"
enable_session_cdev="yes (default)"
with_sessions="dummy,terminal,cdev (default)"
with_sessions="dummy,terminal (default)"
elif test ! "x$with_sessions" = "x" ; then
SAVEIFS="$IFS"
IFS=","
@ -407,8 +404,6 @@ elif test ! "x$with_sessions" = "x" ; then
enable_session_dummy="yes"
elif test "x$i" = "xterminal" ; then
enable_session_terminal="yes"
elif test "x$i" = "xcdev" ; then
enable_session_cdev="yes"
else
IFS="$SAVEIFS"
AC_ERROR([Unknown session type $i])
@ -756,30 +751,6 @@ else
session_terminal_missing="enable-session-terminal"
fi
# session cdev
session_cdev_avail=no
session_cdev_missing=""
if test ! "x$enable_session_cdev" = "xno" ; then
session_cdev_avail=yes
if test "x$have_fuse" = "xno" ; then
session_cdev_avail=no
session_cdev_missing="libfuse,$session_cdev_missing"
fi
if test "x$tsm_avail" = "xno" ; then
session_cdev_avail=no
session_cdev_missing="$tsm_missing,$session_cdev_missing"
fi
if test "x$session_cdev_avail" = "xno" ; then
if test "x$enable_session_cdev" = "xyes" ; then
AC_ERROR([missing for session-cdev: $session_cdev_missing])
fi
fi
else
session_cdev_missing="enable-session-cdev"
fi
# kmscon
kmscon_avail=no
kmscon_missing=""
@ -827,14 +798,6 @@ if test "x$kmscon_avail" = "xyes" ; then
fi
fi
# session cdev
session_cdev_enabled=no
if test "x$session_cdev_avail" = "xyes" ; then
if test "x${enable_session_cdev% *}" = "xyes" ; then
session_cdev_enabled=yes
fi
fi
# session terminal
session_terminal_enabled=no
if test "x$session_terminal_avail" = "xyes" ; then
@ -1172,15 +1135,6 @@ fi
AM_CONDITIONAL([BUILD_ENABLE_SESSION_TERMINAL],
[test "x$session_terminal_enabled" = "xyes"])
# session cdev
if test "x$session_cdev_enabled" = "xyes" ; then
AC_DEFINE([BUILD_ENABLE_SESSION_CDEV], [1],
[Build cdev session])
fi
AM_CONDITIONAL([BUILD_ENABLE_SESSION_CDEV],
[test "x$session_cdev_enabled" = "xyes"])
# kmscon
AM_CONDITIONAL([BUILD_ENABLE_KMSCON],
[test "x$kmscon_enabled" = "xyes"])
@ -1299,6 +1253,5 @@ AC_MSG_NOTICE([Build configuration:
Session Types:
dummy: $session_dummy_enabled ($session_dummy_avail: $session_dummy_missing)
terminal: $session_terminal_enabled ($session_terminal_avail: $session_terminal_missing)
cdev: $session_cdev_enabled ($session_cdev_avail: $session_cdev_missing)
Run "${MAKE-make}" to start compilation process])

View File

@ -191,15 +191,6 @@
(default: on)</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--cdev-session</option></term>
<listitem>
<para>Start cdev-VT-emulation session after setup is done. This is
limited to
<option>--listen</option> mode. (default: off)</para>
</listitem>
</varlistentry>
</variablelist>
<para>Terminal Options:</para>
@ -607,12 +598,6 @@
<para>Terminal sessions provide a terminal emulator. They are the main
session type and provide all the terminal-emulation
functionality.</para>
<para>CDev sessions provide a way to hook-up external applications as kmscon
sessions. They provide fake virtual terminals on seats that don't have
them so you can switch between multiple graphics applications/servers
without needing VTs. See <emphasis>Virtual Terminals</emphasis>
below.</para>
</refsect1>
<refsect1>
@ -629,31 +614,6 @@
This is done via VT APIs on seat0. But note that if the kernel is
compiled without CONFIG_VT (which controls whether VTs are available),
then even seat0 does not have VTs.</para>
<para>On seats without VTs we need a replacement API. However, a new
API would require modifying every application that uses the VT API to
also support the new replacement if you want to run it on those seats.
Therefore, kmscon provides a backwards-compatible API. It uses the
linux CUSE API to create VTs for all seats that have no VTs. You need
to pass <option>--cdev-session</option> to kmscon to enable this.
kmscon will then create one cdev (<emphasis>c</emphasis>haracter
<emphasis>dev</emphasis>ice) for each seat and calls it
<filename>/dev/ttyF{seatname}</filename> ('F' for 'fake'). This
character device provides the same API as a VT so your X-Server (or
even kmscon in default-mode) can use it instead of a real VT.</para>
<para>In contrast to real VTs, each application that opens this fake VT will
get a different VT assigned. So you can use multiple X-Servers all
opening <filename>/dev/ttyF{seatname}</filename> and they will each
show up as different kmscon session. But note that not all TTY ioctls
are available on fake VTs. kmscon only emulates the API that is
currently used by most VT users. If you want to run an application
that needs more functionality, please open a bug-report.</para>
<para>Switching VTs is done by signaling the active process to go asleep and
signaling the new VT to wake up. If kmscon emulates VTs, it needs to
be able to send these signals to the processes running on fake VTs. In
most situations this means kmscon must have root privileges.</para>
</refsect1>
<refsect1>

File diff suppressed because it is too large Load Diff

View File

@ -1,52 +0,0 @@
/*
* kmscon - Character-Device Session
*
* Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* Character-Device Session
*/
#ifndef KMSCON_CDEV_H
#define KMSCON_CDEV_H
#include <errno.h>
#include <stdlib.h>
#include "kmscon_seat.h"
#ifdef BUILD_ENABLE_SESSION_CDEV
int kmscon_cdev_register(struct kmscon_session **out,
struct kmscon_seat *seat);
#else /* !BUILD_ENABLE_SESSION_CDEV */
static inline int kmscon_cdev_register(struct kmscon_session **out,
struct kmscon_seat *seat)
{
return -EOPNOTSUPP;
}
#endif /* BUILD_ENABLE_SESSION_CDEV */
#endif /* KMSCON_CDEV_H */

View File

@ -79,7 +79,6 @@ static void print_help()
"\t --session-max <max> [50] Maximum number of sessions\n"
"\t --session-control [off] Allow keyboard session-control\n"
"\t --terminal-session [on] Enable terminal session\n"
"\t --cdev-session [off] Enable kernel VT emulation session\n"
"\n"
"Terminal Options:\n"
"\t-l, --login [/bin/login -p]\n"
@ -483,17 +482,11 @@ static int aftercheck_listen(struct conf_option *opt, int argc, char **argv,
int idx)
{
struct kmscon_conf_t *conf = KMSCON_CONF_FROM_FIELD(opt->mem, listen);
int ret = -EFAULT;
if (conf->listen)
return 0;
if (conf->cdev_session)
log_error("you can use --cdev-session only in combination with --listen");
else
ret = 0;
return ret;
return 0;
}
/*
@ -569,7 +562,6 @@ int kmscon_conf_new(struct conf_ctx **out)
CONF_OPTION_UINT(0, "session-max", &conf->session_max, 50),
CONF_OPTION_BOOL(0, "session-control", &conf->session_control, false),
CONF_OPTION_BOOL(0, "terminal-session", &conf->terminal_session, true),
CONF_OPTION_BOOL(0, "cdev-session", &conf->cdev_session, false),
/* Terminal Options */
CONF_OPTION(0, 'l', "login", &conf_login, aftercheck_login, NULL, file_login, &conf->login, false),

View File

@ -78,8 +78,6 @@ struct kmscon_conf_t {
bool session_control;
/* run terminal session */
bool terminal_session;
/* cdev session */
bool cdev_session;
/* Terminal Options */
/* custom login process */

View File

@ -34,7 +34,6 @@
#include <string.h>
#include "conf.h"
#include "eloop.h"
#include "kmscon_cdev.h"
#include "kmscon_conf.h"
#include "kmscon_dummy.h"
#include "kmscon_seat.h"
@ -824,14 +823,6 @@ void kmscon_seat_startup(struct kmscon_seat *seat)
kmscon_session_enable(s);
}
if (seat->conf->cdev_session) {
ret = kmscon_cdev_register(&s, seat);
if (ret == -EOPNOTSUPP)
log_notice("cdev sessions not compiled in");
else if (ret)
log_error("cannot register cdev session");
}
if (seat->conf->switchvt ||
uterm_vt_get_type(seat->vt) == UTERM_VT_FAKE)
uterm_vt_activate(seat->vt);