patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: devel@spectrum-os.org
Cc: Demi Marie Obenour <demiobenour@gmail.com>
Subject: [PATCH v2 3/6] host/rootfs: move Wayland out of XDG_RUNTIME_DIR
Date: Tue,  9 Dec 2025 13:10:23 +0100	[thread overview]
Message-ID: <20251209121023.705026-6-hi@alyssa.is> (raw)
In-Reply-To: <20251209121023.705026-2-hi@alyssa.is>

XDG_RUNTIME_DIR doesn't play well with running the compositor as a
different user to clients.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Message-ID: <20251209085628.603316-3-hi@alyssa.is>
---
v2: no change

 host/rootfs/image/etc/s6-linux-init/env/WAYLAND_DISPLAY     | 2 +-
 .../vm-services/template/data/service/vhost-user-gpu/run    | 6 ++++--
 host/rootfs/image/etc/s6-rc/weston/run                      | 4 ++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/host/rootfs/image/etc/s6-linux-init/env/WAYLAND_DISPLAY b/host/rootfs/image/etc/s6-linux-init/env/WAYLAND_DISPLAY
index 5ff1a409..bbd390c4 100644
--- a/host/rootfs/image/etc/s6-linux-init/env/WAYLAND_DISPLAY
+++ b/host/rootfs/image/etc/s6-linux-init/env/WAYLAND_DISPLAY
@@ -1 +1 @@
-wayland-1
+/run/wayland
diff --git a/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/vhost-user-gpu/run b/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/vhost-user-gpu/run
index 73d6caed..6ee99599 100755
--- a/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/vhost-user-gpu/run
+++ b/host/rootfs/image/etc/s6-linux-init/run-image/service/vm-services/template/data/service/vhost-user-gpu/run
@@ -5,12 +5,14 @@
 
 s6-ipcserver -1a 0700 -c 1 -b 1 env/crosvm.sock
 
+importas -Si WAYLAND_DISPLAY
+
 bwrap
   --unshare-all
   # --unshare-all only implies --unshare-user-try.
   # Make this more than a "try".
   --unshare-user
-  --bind /run/user/0/wayland-1 /run/user/0/wayland-1
+  --bind $WAYLAND_DISPLAY $WAYLAND_DISPLAY
   --ro-bind /usr /usr
   --ro-bind /lib /lib
   --tmpfs /tmp
@@ -35,5 +37,5 @@ bwrap
   --
 crosvm --no-syslog device gpu
   --fd 0
-  --wayland-sock /run/user/0/wayland-1
+  --wayland-sock $WAYLAND_DISPLAY
   --params "{\"context-types\":\"cross-domain\"}"
diff --git a/host/rootfs/image/etc/s6-rc/weston/run b/host/rootfs/image/etc/s6-rc/weston/run
index 41e42e6b..16479909 100644
--- a/host/rootfs/image/etc/s6-rc/weston/run
+++ b/host/rootfs/image/etc/s6-rc/weston/run
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: EUPL-1.2+
 # SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is>
 
-unexport WAYLAND_DISPLAY
+importas -Siu WAYLAND_DISPLAY
 
 if { mkdir -p -m 0700 /run/user/0 }
 
@@ -18,4 +18,4 @@ importas -i home HOME
 cd $home
 if { udevadm wait /dev/dri/card0 }
 unshare --cgroup --ipc --net --uts
-weston
+weston -S $WAYLAND_DISPLAY
-- 
2.51.0


  parent reply	other threads:[~2025-12-09 12:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09 12:10 [PATCH v2 1/6] host/rootfs: make passwd and group links into /run Alyssa Ross
2025-12-09 12:10 ` [PATCH v2 2/6] host/rootfs: install shadow Alyssa Ross
2025-12-09 18:23   ` Alyssa Ross
2025-12-09 12:10 ` Alyssa Ross [this message]
2025-12-09 18:23   ` [PATCH v2 3/6] host/rootfs: move Wayland out of XDG_RUNTIME_DIR Alyssa Ross
2025-12-09 12:10 ` [PATCH v2 4/6] host/rootfs: weston: add XDG_RUNTIME_DIR note Alyssa Ross
2025-12-09 18:23   ` Alyssa Ross
2025-12-09 12:10 ` [PATCH v2 5/6] host/rootfs: add wayland group Alyssa Ross
2025-12-09 18:23   ` Alyssa Ross
2025-12-09 12:10 ` [PATCH v2 6/6] host/rootfs: run crosvm device gpu as non-root Alyssa Ross
2025-12-09 18:23   ` Alyssa Ross
2025-12-09 18:23 ` [PATCH v2 1/6] host/rootfs: make passwd and group links into /run Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251209121023.705026-6-hi@alyssa.is \
    --to=hi@alyssa.is \
    --cc=demiobenour@gmail.com \
    --cc=devel@spectrum-os.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).