summaryrefslogtreecommitdiff
path: root/poky/meta/recipes-graphics/wayland
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/recipes-graphics/wayland')
-rw-r--r--poky/meta/recipes-graphics/wayland/libinput_1.16.3.bb (renamed from poky/meta/recipes-graphics/wayland/libinput_1.16.1.bb)2
-rw-r--r--poky/meta/recipes-graphics/wayland/wayland-utils_1.0.0.bb20
-rw-r--r--poky/meta/recipes-graphics/wayland/weston-init.bb47
-rw-r--r--poky/meta/recipes-graphics/wayland/weston-init/71-weston-drm.rules2
-rwxr-xr-xpoky/meta/recipes-graphics/wayland/weston-init/weston-start6
-rw-r--r--poky/meta/recipes-graphics/wayland/weston-init/weston.service (renamed from poky/meta/recipes-graphics/wayland/weston-init/weston@.service)14
-rw-r--r--poky/meta/recipes-graphics/wayland/weston-init/weston.socket14
-rw-r--r--poky/meta/recipes-graphics/wayland/weston-init/weston@.socket10
-rw-r--r--poky/meta/recipes-graphics/wayland/weston_9.0.0.bb5
9 files changed, 86 insertions, 34 deletions
diff --git a/poky/meta/recipes-graphics/wayland/libinput_1.16.1.bb b/poky/meta/recipes-graphics/wayland/libinput_1.16.3.bb
index 149760918..8929de6ae 100644
--- a/poky/meta/recipes-graphics/wayland/libinput_1.16.1.bb
+++ b/poky/meta/recipes-graphics/wayland/libinput_1.16.3.bb
@@ -16,7 +16,7 @@ SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BP}.tar.xz \
file://run-ptest \
file://determinism.patch \
"
-SRC_URI[sha256sum] = "7ba7d1aeedd15168bb21d17e9e628aa1c27957963a423a3fea3938a501758539"
+SRC_URI[sha256sum] = "dc5e1ae51ec1cc635ca96f61118b0f07dfea783cab0747a60f3555068bb077e4"
UPSTREAM_CHECK_REGEX = "libinput-(?P<pver>\d+\.\d+\.(?!9\d+)\d+)"
diff --git a/poky/meta/recipes-graphics/wayland/wayland-utils_1.0.0.bb b/poky/meta/recipes-graphics/wayland/wayland-utils_1.0.0.bb
new file mode 100644
index 000000000..4c51f7e8c
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/wayland-utils_1.0.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Wayland utilities"
+DESCRIPTION = "Wayland-utils contains (for now) \
+wayland-info, a utility for displaying information about the Wayland \
+protocols supported by a Wayland compositor. \
+wayland-info is basically a standalone version of weston-info as found \
+in weston repository. "
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=548a66038a77415e1df51118625e832f \
+ "
+
+SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+ "
+SRC_URI[sha256sum] = "64fecc4c58e87ae9b302901abe10c2e8af69c7503c221a96ecd0700e0aa268c0"
+
+UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
+
+inherit meson pkgconfig
+
+DEPENDS += "wayland wayland-native wayland-protocols"
diff --git a/poky/meta/recipes-graphics/wayland/weston-init.bb b/poky/meta/recipes-graphics/wayland/weston-init.bb
index b7a99be64..65d7b81dc 100644
--- a/poky/meta/recipes-graphics/wayland/weston-init.bb
+++ b/poky/meta/recipes-graphics/wayland/weston-init.bb
@@ -7,9 +7,8 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
SRC_URI = "file://init \
file://weston.env \
file://weston.ini \
- file://weston@.service \
- file://weston@.socket \
- file://71-weston-drm.rules \
+ file://weston.service \
+ file://weston.socket \
file://weston-autologin \
file://weston-start"
@@ -24,24 +23,27 @@ DEFAULTBACKEND_qemuall ?= "fbdev"
DEFAULTBACKEND_qemuarm64 = "drm"
DEFAULTBACKEND_qemux86 = "drm"
DEFAULTBACKEND_qemux86-64 = "drm"
+# gallium swrast was found to crash weston on startup in x32 qemu
+DEFAULTBACKEND_qemux86-64_x86-x32 = "fbdev"
+DEFAULTBACKEND_x86-x32 = "fbdev"
do_install() {
- install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
+ if [ "${VIRTUAL-RUNTIME_init_manager}" != "systemd" ]; then
+ install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
+ fi
install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini
install -Dm644 ${WORKDIR}/weston.env ${D}${sysconfdir}/default/weston
# Install Weston systemd service and accompanying udev rule
- install -D -p -m0644 ${WORKDIR}/weston@.service ${D}${systemd_system_unitdir}/weston@.service
- install -D -p -m0644 ${WORKDIR}/weston@.socket ${D}${systemd_system_unitdir}/weston@.socket
+ install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service
+ install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
install -D -p -m0644 ${WORKDIR}/weston-autologin ${D}${sysconfdir}/pam.d/weston-autologin
fi
sed -i -e s:/etc:${sysconfdir}:g \
-e s:/usr/bin:${bindir}:g \
-e s:/var:${localstatedir}:g \
- ${D}${systemd_unitdir}/system/weston@.service
- install -D -p -m0644 ${WORKDIR}/71-weston-drm.rules \
- ${D}${sysconfdir}/udev/rules.d/71-weston-drm.rules
+ ${D}${systemd_unitdir}/system/weston.service
# Install weston-start script
install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start
sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start
@@ -51,24 +53,39 @@ do_install() {
fi
if [ "${@bb.utils.contains('PACKAGECONFIG', 'no-idle-timeout', 'yes', 'no', d)}" = "yes" ]; then
- echo "idle-time=0" >> ${D}${sysconfdir}/xdg/weston/weston.ini
+ sed -i -e "/^\[core\]/a idle-time=0" ${D}${sysconfdir}/xdg/weston/weston.ini
fi
+
+ install -dm 755 -o weston -g weston ${D}/home/weston
}
-inherit update-rc.d features_check systemd
+INHIBIT_UPDATERCD_BBCLASS = "${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', '1', '', d)}"
+
+inherit update-rc.d features_check systemd useradd
+
+USERADD_PACKAGES = "${PN}"
# rdepends on weston which depends on virtual/egl
-REQUIRED_DISTRO_FEATURES = "opengl"
+# requires pam enabled if started via systemd
+REQUIRED_DISTRO_FEATURES = "opengl ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}"
RDEPENDS_${PN} = "weston kbd"
INITSCRIPT_NAME = "weston"
INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
-FILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${systemd_system_unitdir}/weston@.service ${systemd_system_unitdir}/weston@.socket ${sysconfdir}/default/weston ${sysconfdir}/pam.d/"
+FILES_${PN} += "\
+ ${sysconfdir}/xdg/weston/weston.ini \
+ ${systemd_system_unitdir}/weston.service \
+ ${systemd_system_unitdir}/weston.socket \
+ ${sysconfdir}/default/weston \
+ ${sysconfdir}/pam.d/ \
+ /home/weston \
+ "
CONFFILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston"
-SYSTEMD_SERVICE_${PN} = "weston@%i.service"
-SYSTEMD_AUTO_ENABLE = "disable"
+SYSTEMD_SERVICE_${PN} = "weston.service weston.socket"
+USERADD_PARAM_${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input weston"
+GROUPADD_PARAM_${PN} = "-r wayland"
diff --git a/poky/meta/recipes-graphics/wayland/weston-init/71-weston-drm.rules b/poky/meta/recipes-graphics/wayland/weston-init/71-weston-drm.rules
deleted file mode 100644
index 1a1b8bbda..000000000
--- a/poky/meta/recipes-graphics/wayland/weston-init/71-weston-drm.rules
+++ /dev/null
@@ -1,2 +0,0 @@
-ACTION=="add", SUBSYSTEM=="graphics", KERNEL=="fb0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="weston@root.service"
-ACTION=="add", SUBSYSTEM=="drm", KERNEL=="card0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="weston@root.service"
diff --git a/poky/meta/recipes-graphics/wayland/weston-init/weston-start b/poky/meta/recipes-graphics/wayland/weston-init/weston-start
index ccc709342..0b93dc964 100755
--- a/poky/meta/recipes-graphics/wayland/weston-init/weston-start
+++ b/poky/meta/recipes-graphics/wayland/weston-init/weston-start
@@ -33,6 +33,10 @@ if [ -n "$WESTON_USER" ]; then
echo "ERROR: If you have WESTON_USER variable set, you also need WESTON_TTY."
exit 1
fi
+ if [ -z "$WESTON_GROUP" ]; then
+ # no explicit WESTON_GROUP given, therefore use WESTON_USER
+ export WESTON_GROUP="${WESTON_USER}"
+ fi
weston_args_user="-u $WESTON_USER -t $WESTON_TTY"
fi
@@ -75,7 +79,7 @@ if test -z "$XDG_RUNTIME_DIR"; then
fi
if [ -n "$WESTON_USER" ]
then
- chown $WESTON_USER:$WESTON_USER $XDG_RUNTIME_DIR
+ chown $WESTON_USER:$WESTON_GROUP $XDG_RUNTIME_DIR
fi
fi
diff --git a/poky/meta/recipes-graphics/wayland/weston-init/weston@.service b/poky/meta/recipes-graphics/wayland/weston-init/weston.service
index ce8f4fb71..e09625b31 100644
--- a/poky/meta/recipes-graphics/wayland/weston-init/weston@.service
+++ b/poky/meta/recipes-graphics/wayland/weston-init/weston.service
@@ -9,6 +9,7 @@ Documentation=man:weston(1) man:weston.ini(5)
Documentation=http://wayland.freedesktop.org/
# Make sure we are started after logins are permitted.
+Requires=systemd-user-sessions.service
After=systemd-user-sessions.service
# If Plymouth is used, we want to start when it is on its way out.
@@ -18,6 +19,9 @@ After=plymouth-quit-wait.service
Wants=dbus.socket
After=dbus.socket
+# Ensure the socket is present
+Requires=weston.socket
+
# Since we are part of the graphical session, make sure we are started before
# it is complete.
Before=graphical.target
@@ -37,10 +41,11 @@ TimeoutStartSec=60
WatchdogSec=20
# The user to run Weston as.
-User=%I
+User=weston
+Group=weston
-# Make sure working directory is users home directory
-WorkingDirectory=/home/%i
+# Make sure the working directory is the users home directory
+WorkingDirectory=/home/weston
# Set up a full user session for the user, required by Weston.
PAMName=weston-autologin
@@ -61,5 +66,6 @@ UtmpIdentifier=tty7
UtmpMode=user
[Install]
+# Note: If you only want weston to start on-demand, remove this line with a
+# service drop file
WantedBy=graphical.target
-DefaultInstance=tty7
diff --git a/poky/meta/recipes-graphics/wayland/weston-init/weston.socket b/poky/meta/recipes-graphics/wayland/weston-init/weston.socket
new file mode 100644
index 000000000..c1bdc83c0
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/weston-init/weston.socket
@@ -0,0 +1,14 @@
+[Unit]
+Description=Weston socket
+RequiresMountsFor=/run
+
+[Socket]
+ListenStream=/run/wayland-0
+SocketMode=0775
+SocketUser=weston
+SocketGroup=wayland
+RemoveOnStop=yes
+
+[Install]
+WantedBy=sockets.target
+
diff --git a/poky/meta/recipes-graphics/wayland/weston-init/weston@.socket b/poky/meta/recipes-graphics/wayland/weston-init/weston@.socket
deleted file mode 100644
index f1790d74a..000000000
--- a/poky/meta/recipes-graphics/wayland/weston-init/weston@.socket
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Weston Wayland socket
-After=user-runtime-dir@1000.service
-
-[Socket]
-ListenStream=/run/user/1000/wayland-%I
-
-[Install]
-WantedBy=sockets.target
-
diff --git a/poky/meta/recipes-graphics/wayland/weston_9.0.0.bb b/poky/meta/recipes-graphics/wayland/weston_9.0.0.bb
index 75f9fb05f..8cb105c78 100644
--- a/poky/meta/recipes-graphics/wayland/weston_9.0.0.bb
+++ b/poky/meta/recipes-graphics/wayland/weston_9.0.0.bb
@@ -21,11 +21,14 @@ UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
inherit meson pkgconfig useradd features_check
# depends on virtual/egl
-REQUIRED_DISTRO_FEATURES = "opengl"
+# weston-init requires pam enabled if started via systemd
+REQUIRED_DISTRO_FEATURES = "opengl ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}"
DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0"
DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native"
+LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'lto', '-Wl,-z,undefs', '', d)}"
+
WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}"
EXTRA_OEMESON += "-Dbackend-default=auto -Dbackend-rdp=false -Dpipewire=false"