Skip to content

Commit 9684645

Browse files
schwar3katigorpecovnik
authored andcommitted
Add board-level extension to mask Wayland desktop sessions
1 parent 7e0cd3b commit 9684645

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
# ------------------------------------------------------------------------------
3+
# Mask Wayland desktop sessions
4+
#
5+
# Some boards have limited or unstable Wayland support due to GPU or driver
6+
# constraints. This extension allows board maintainers to disable Wayland
7+
# sessions in a desktop-agnostic and upgrade-safe manner by masking session
8+
# definitions.
9+
#
10+
# Wayland sessions are masked by placing empty marker files with matching names
11+
# in /usr/local/share/wayland-sessions/, which takes precedence over
12+
# /usr/share/wayland-sessions/.
13+
#
14+
# Usage (board config):
15+
# enable_extension "wayland-sessions-mask"
16+
#
17+
# Default behavior when unset: Wayland sessions remain enabled.
18+
# ------------------------------------------------------------------------------
19+
20+
post_post_debootstrap_tweaks__wayland_sessions_mask() {
21+
22+
# Only apply to desktop images with Wayland sessions present
23+
[[ -d "${SDCARD}/usr/share/wayland-sessions" ]] || return 0
24+
25+
local src_dir dst_dir sess_file
26+
src_dir="${SDCARD}/usr/share/wayland-sessions"
27+
dst_dir="${SDCARD}/usr/local/share/wayland-sessions"
28+
29+
display_alert \
30+
"Masking Wayland desktop sessions" \
31+
"Board policy: wayland-sessions-mask" \
32+
"info"
33+
34+
mkdir -p "${dst_dir}"
35+
36+
# Mask all existing Wayland session definitions
37+
for sess_file in "${src_dir}"/*.desktop; do
38+
[[ -f "${sess_file}" ]] || continue
39+
: > "${dst_dir}/$(basename "${sess_file}")"
40+
done
41+
}

0 commit comments

Comments
 (0)