Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • W weston
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 340
    • Issues 340
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 133
    • Merge requests 133
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • waylandwayland
  • weston
  • Issues
  • #430
Closed
Open
Issue created Sep 02, 2020 by n3rdopolis@n3rdopolisReporter

Weston might not run on CONFIG_VT=0 systems

Hi

I am looking at where seat0 is hardcoded for Weston as to where VTs are enabled. While all TTYs are in seat0, not all seat0 s have TTYs.

I don't have a CONFIG_VT=0 box to test on...

while in libweston/launcher-logind.c I can do something along the lines of

diff --git a/libweston/launcher-logind.c b/libweston/launcher-logind.c
index 9b3c52fa..4811530c 100644
--- a/libweston/launcher-logind.c
+++ b/libweston/launcher-logind.c
@@ -767,7 +767,7 @@ launcher_logind_connect(struct weston_launcher **out, struct weston_compositor *
                goto err_session;
        }
 
-       r = strcmp(t, "seat0");
+       r = sd_seat_can_tty(t);
        free(t);
        if (r == 0) {
                r = weston_sd_session_get_vt(wl->sid, &wl->vtnr);

I am not sure about libweston/launcher-direct.c I am thinking something along the lines of

index c20d70f2..e994d2a2 100644
--- a/libweston/launcher-direct.c
+++ b/libweston/launcher-direct.c
@@ -289,6 +289,7 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
                        int tty, const char *seat_id, bool sync_drm)
 {
        struct launcher_direct *launcher;
+       struct stat buf;
 
        if (geteuid() != 0)
                return -EINVAL;
@@ -300,7 +301,8 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
        launcher->base.iface = &launcher_direct_iface;
        launcher->compositor = compositor;
 
-       if (strcmp("seat0", seat_id) == 0) {
+       if (strcmp("seat0", seat_id) == 0 &&
+           fstat("/dev/tty0", &buf) && major(buf.st_rdev) == TTY_MAJOR) {
                if (setup_tty(launcher, tty) == -1) {
                        free(launcher);
                        return -1;

because libweston/launcher-direct.c is more generic seeming, and I only grepped for seat0, so not sure if I can call sd_seat_can_tty from there...

Thanks

Edited Sep 03, 2020 by n3rdopolis
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking