public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: <rs@ti.com>
To: <alex.kanavin@gmail.com>, <Ross.Burton@arm.com>
Cc: <openembedded-core@lists.openembedded.org>
Subject: [oe-core][PATCHv2] x11-volatiles: register x11 volatile directories
Date: Thu, 30 Oct 2025 12:20:43 -0500	[thread overview]
Message-ID: <20251030172042.118131-2-rs@ti.com> (raw)

From: Randolph Sapp <rs@ti.com>

Add a volatiles entry for popular x11 and adjacent utilities. This is
designed to mimic the systemd tmpfiles.d entries and prevent any one
user from creating these directories with permissions that may
negatively impact multi-user environments.

Signed-off-by: Randolph Sapp <rs@ti.com>
---

v2:
	Drop bin_package and use allarch as requested. Manually specify 
	do_configure[noexec] = "1"
	do_compile[noexec] = "1"

	To match old behavior.

 meta/conf/distro/include/maintainers.inc      |  1 +
 .../x11-common/x11-volatiles.bb               | 23 +++++++++++++++++++
 .../x11-common/x11-volatiles/02_x11           |  6 +++++
 .../xorg-xserver/xserver-xorg_21.1.18.bb      |  2 ++
 .../xwayland/xwayland_24.1.8.bb               |  2 +-
 5 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-graphics/x11-common/x11-volatiles.bb
 create mode 100644 meta/recipes-graphics/x11-common/x11-volatiles/02_x11

diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index c4142e2b72..6902bc0c44 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -886,6 +886,7 @@ RECIPE_MAINTAINER:pn-wic-tools = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-wireless-regdb = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-wpa-supplicant = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-wpebackend-fdo = "Unassigned <unassigned@yoctoproject.org>"
+RECIPE_MAINTAINER:pn-x11-volatiles = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-x11perf = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-x264 = "Unassigned <unassigned@yoctoproject.org>"
 RECIPE_MAINTAINER:pn-xauth = "Unassigned <unassigned@yoctoproject.org>"
diff --git a/meta/recipes-graphics/x11-common/x11-volatiles.bb b/meta/recipes-graphics/x11-common/x11-volatiles.bb
new file mode 100644
index 0000000000..3eddc12152
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/x11-volatiles.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Xserver Volatile Directories"
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
+SECTION = "x11"
+
+SRC_URI = "file://02_x11"
+
+S = "${UNPACKDIR}"
+
+inherit allarch features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
+CONFLICT_DISTRO_FEATURES = "systemd"
+
+do_install() {
+	install -d ${D}${sysconfdir}/default/volatiles
+	install -m 0644 ${UNPACKDIR}/02_x11 ${D}${sysconfdir}/default/volatiles
+}
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+FILES:${PN} += "${sysconfdir}/default/volatiles"
diff --git a/meta/recipes-graphics/x11-common/x11-volatiles/02_x11 b/meta/recipes-graphics/x11-common/x11-volatiles/02_x11
new file mode 100644
index 0000000000..35c3698479
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/x11-volatiles/02_x11
@@ -0,0 +1,6 @@
+# Volatile entries to match systemd
+# https://github.com/systemd/systemd/blob/main/tmpfiles.d/x11.conf
+d root root 1777 /tmp/.X11-unix none
+d root root 1777 /tmp/.ICE-unix none
+d root root 1777 /tmp/.XIM-unix none
+d root root 1777 /tmp/.font-unix none
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.18.bb b/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.18.bb
index 14c45be432..3c8cb0173f 100644
--- a/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.18.bb
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.18.bb
@@ -26,3 +26,5 @@ RCONFLICTS:${PN} = "${PN}-extension-dri \
                     ${PN}-extension-extmod \
                     ${PN}-extension-dbe \
                    "
+
+RDEPENDS:${PN} += "${@bb.utils.contains("DISTRO_FEATURES", "systemd", "", "x11-volatiles", d)}"
diff --git a/meta/recipes-graphics/xwayland/xwayland_24.1.8.bb b/meta/recipes-graphics/xwayland/xwayland_24.1.8.bb
index 900da524b3..a621af1a7f 100644
--- a/meta/recipes-graphics/xwayland/xwayland_24.1.8.bb
+++ b/meta/recipes-graphics/xwayland/xwayland_24.1.8.bb
@@ -47,4 +47,4 @@ do_install:append() {
 
 FILES:${PN} += "${libdir}/xorg/protocol.txt"
 
-RDEPENDS:${PN} += "xkbcomp"
+RDEPENDS:${PN} += "xkbcomp ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "", "x11-volatiles", d)}"
-- 
2.51.1



                 reply	other threads:[~2025-10-30 17:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20251030172042.118131-2-rs@ti.com \
    --to=rs@ti.com \
    --cc=Ross.Burton@arm.com \
    --cc=alex.kanavin@gmail.com \
    --cc=openembedded-core@lists.openembedded.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox