From owner-freebsd-x11@freebsd.org Sat Oct 5 17:36:38 2019 Return-Path: Delivered-To: freebsd-x11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2764A138B8C for ; Sat, 5 Oct 2019 17:36:38 +0000 (UTC) (envelope-from shamaz.mazum@gmail.com) Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46lv792gFhz3xv7 for ; Sat, 5 Oct 2019 17:36:37 +0000 (UTC) (envelope-from shamaz.mazum@gmail.com) Received: by mail-ed1-x531.google.com with SMTP id h2so8813378edn.3 for ; Sat, 05 Oct 2019 10:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=z/9RdZK5MZ4yLkbS7aau6lzUx04WDIUL1CXKEo6KvbU=; b=YNWQGQNLda0RVvWXyrobcvBguMqjz3XFbSgzRoxqVhdvhqqJnXaRplpENlRuy7rioe 9/puIPnMAefpcbpfyJ1jjXEd81crDDcf7PGt+CnATICOiaq7pHP5SD88V99F8pmziMfl oC5TlHInYTjcouxgCz04T+sCT2zrAkyQ/78gVlcJdfyJJw8cCIQcFz0XX2bEss1VZswR kJpIDEcYlCOhCO/XpJR4s0O4tJiSs6Df7oYhdgZYLYUWGKliB5tn6EKLK8EJ/qVaJUi3 CleRzkAARHlwuBxy+f8UCVdfL8N3/SiqZZwX3o0EQI9Nl9htB/m5OjkCYUqWCNBMq+Ek dqRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=z/9RdZK5MZ4yLkbS7aau6lzUx04WDIUL1CXKEo6KvbU=; b=eZ7kp1VPipqQzPo+/LWV2gpej2n7iZEjXSjTByyYQ0IZIvYwfjx6BldyGleJFIhHlH XRW6MlKy5gRIvfq7PuZQZZUvGBqt8JeLCfjz/mn+wZcgYEv4uBpM4lfO1pjta0YJcF2R Tf1w876F0NohnJ1Qk8IGJLyT3Nhrxpn6iroIGvPkxgQ+V+nX4DRpv9ePn+wyWnb2QkgM uRMNw5O9bAWZA3UAkzcr50X2GjdiGKtp/gzYQ35+LIoXeJX6rWDtxX5SFV8g8WUa4A9J GWsROxttO9XtPTLPwP+XkgxIoU+RvCjxUqIh9VrgyiIPSBeB9ASWjOwm+go6v/YTniKY cx7g== X-Gm-Message-State: APjAAAV4aUdD/KgSbib+l5dhIkpTLpe5GhVsYuOP3gUM7M6Cyove06+z B15W5u+IGHFbT9lVem23auWQkfHdzbi0mTd1OAm2L0Ergz0= X-Google-Smtp-Source: APXvYqxU0v5i6PjqOVMZWrOmEKcWO9jP6Rgh8X3P0oIO7FSGduWT1egjsb048t2Ef8dDlVRzr28i4C0BxtQ/DD2TWIo= X-Received: by 2002:aa7:d9d5:: with SMTP id v21mr21152520eds.106.1570296995661; Sat, 05 Oct 2019 10:36:35 -0700 (PDT) MIME-Version: 1.0 References: <300f65b7469c608ad4cd32a9ad6c41d6@unrelenting.technology> In-Reply-To: <300f65b7469c608ad4cd32a9ad6c41d6@unrelenting.technology> From: Vasily Postnicov Date: Sat, 5 Oct 2019 20:36:24 +0300 Message-ID: Subject: Re: Xorg with evdev input devices To: greg@unrelenting.technology Cc: freebsd-x11@freebsd.org X-Rspamd-Queue-Id: 46lv792gFhz3xv7 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=YNWQGQNL; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of shamazmazum@gmail.com designates 2a00:1450:4864:20::531 as permitted sender) smtp.mailfrom=shamazmazum@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; URI_COUNT_ODD(1.00)[13]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-9.56), ipnet: 2a00:1450::/32(-2.89), asn: 15169(-2.15), country: US(-0.05)]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-x11@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[1.3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2019 17:36:38 -0000 Hello again, Greg. I have some more time to play with Wayland. I'm trying to resolve permission errors when accessing /dev/input/event* using consolekit2. I did as you said and have active consolekit session when I log in. > ck-list-sessions Session5: unix-user =3D '1001' realname =3D 'Vasily Postnicov' seat =3D 'Seat1' session-type =3D 'unspecified' session-class =3D 'user' session-state =3D 'online' active =3D FALSE x11-display =3D '' x11-display-device =3D '' display-device =3D '/dev/ttyv0' remote-host-name =3D '' is-local =3D TRUE on-since =3D '2019-10-05T15:25:27.297123Z' login-session-id =3D '' XDG_RUNTIME_DIR =3D '/var/run/user/1001' VTNr =3D '1' When I start sway I have this now: vasily@vonbraun:~ % sway 2019-10-05 19:44:54 - [backend/drm/legacy.c:15] HDMI-A-2: Failed to set CRTC: Permission denied 2019-10-05 19:44:54 - [backend/drm/legacy.c:15] DVI-D-1: Failed to set CRTC: Permission denied 2019-10-05 19:44:54 - [main.c:521] Missing a required Wayland interface Using just chmod 666 /dev/input/* without consolekit works fine. UPD: Using truss I've found what ioctl DRM_IOCTL_MODE_SETCRTC fails (see https://i.postimg.cc/cWVcb8wc/IMG-20191005-201103.jpg). I use amdgpu driver from graphics/drm-fbsd12.0-kmod-4.16.g20190814. After changing line > DRM_IOCTL_DEF(DRM_IOCTL_MODE_SETCRTC, drm_mode_setcrtc, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), to > DRM_IOCTL_DEF(DRM_IOCTL_MODE_SETCRTC, drm_mode_setcrtc, DRM_CONTROL_ALLOW|DRM_UNLOCKED), in drivers/gpu/drm/drm_ioctl.c ioctl call works fine, but sway still cannot see input devices. My verdict: before using ConsoleKit2 we must at least fix this ioctl issue. I don't know what DRM_MASTER is and if it is safe to remove it. Maybe consolekit itself and not the driver must be fixed. =D0=B2=D1=81, 22 =D1=81=D0=B5=D0=BD=D1=82. 2019 =D0=B3. =D0=B2 19:31, : > September 22, 2019 7:12 PM, "Vasily Postnicov" > wrote: > > > Thanks, it works. The purpose of my evdev kernel support testing is > eventually switch to wayland. > > For this time I have all related ports recompiled with WAYLAND option > and also have x11-wm/sway > > installed. Then I run following commands in terminal (I mean, without > xorg server running): > > > >> setenv XDG_RUNTIME_DIR /tmp > > > >> sway -d > > > > Sway fails to start with the following log: > https://pastebin.com/M3eExb0C > > > >> 2019-09-22 18:53:04 - [backend/libinput/backend.c:55] Initializing > libinput > >> 2019-09-22 18:53:04 - [backend/libinput/backend.c:84] libinput > initialization failed, no input > > devices > >> 2019-09-22 18:53:04 - [backend/libinput/backend.c:85] Set > WLR_LIBINPUT_NO_DEVICES=3D1 to suppress > > this check > >> 2019-09-22 18:53:04 - [backend/multi/backend.c:32] Failed to initializ= e > backend. > >> 2019-09-22 18:53:04 - [sway/server.c:195] Failed to start backend > > > > I've tried to run "setenv WLR_LIBINPUT_NO_DEVICES 1" as suggested and > got sway started (but without > > input devices, I suppose). What's wrong with my libinput? It seems it > works OK with Xorg > > Your sway process doesn't have permission to access /dev/input/*. > > [re: the little follow-up email: setuid does not help, because input > devices are attached after dropping root, because input devices need to b= e > hotpluggable anyway. setuid is bad, use consolekit2 as described below] > > The good (but a bit involved for now) fix: > > - run 'sysctl kern.evdev.input' to make sure you have a recent enough > kernel -- my patch for this is not in 12.0-RELEASE, but should be in > 12.1-BETA I'm pretty sure > - build libudev-devd with > https://github.com/myfreeweb/freebsd-ports-dank/blob/lite/devel/libudev-d= evd/Makefile > (i.e. update to the latest git commit) > - build consolekit2 with https://reviews.freebsd.org/D18754 > - build wlroots with CONSOLEKIT option > - enable automatic CK2 session creation on login: add 'session > optional pam_ck_connector.so' to the '# session' section of > /etc/pam.d/login > - log out, log in, just run sway > - (you can launch sway under ck-launch-session if the automatic session > gets screwed up somehow, but it works for me pretty well) > > The bad (but quick) fix: > > - chmod/chown /dev/input/* to be accessible to your account > - (there's some devfs config thing that can do this automatically) > - (this exposes input devices to any program running as your account, > which defeats the "no keyloggers allowed" advantage of wayland) >