aboutsummaryrefslogtreecommitdiffstats
path: root/meta-app-framework
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2023-06-05 10:07:24 -0400
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2023-06-12 11:10:13 +0000
commit4b4c0f15d1d2a52e636aa22e56cf864d1a8a656b (patch)
treed60da28a0e968afc33156a0a7c2a40d7cdcc93f3 /meta-app-framework
parentacbae7dc3d56800e68700b8f14515db6c34d337f (diff)
Remove systemd user session and clean up packagegroups and images
Remove the use of a systemd user session to align with how upstream runs Weston, and to allow using all systemd sandboxing features with the compositor and homescreen, launcher, etc. applications. The changes for this touched enough packagegroups and images that further rework was done to address some of the cleanup described in SPEC-4813, see below for details. Changes: - Remove agl-session and update various recipes that were manually adding dependencies to the user session it created. The compositor (be it weston or agl-compositor) and Wayland clients now run in the system session as non-root users. - Revive agl-users recipe, this time living in meta-agl-core, with the purpose of creating the agl-driver user. For simplicity, agl-compositor is always run as the agl-driver user, as opposed to trying to wrangle running it as different users depending on build configuration. This can potentially be made more configurable if a downstream user has a usecase to be able to specify another user. - Fully split agl-compositor's systemd unit with a tweaked fork of the weston-init recipe and unit which lives in meta-agl-core. This will be easier to maintain than the attempt to reuse weston-init for builds without meta-app-framework that was done previously. - Create packagegroup-agl-graphical-compositor, distinct from the weston packagegroup. This should make it more straightforward for downstreams that want agl-compositor or weston. - Rename agl-image-agl-compositor to agl-image-compositor to remove redundancy. - Tweak the logic for the inclusion of a few debug packages (e.g. agl-shell-activator) to ensure they only show up in images when agl-devel is enabled. - Split weston-terminal and the required icon resources into separate packages in our weston bbappend to avoid pulling in weston just to get the terminal for testing. - Add a agl-core-image.bbclass to use as a base for images. - Move our cross-SDK configuration to a agl-crosssdk.bbclass to ease reuse. - Remove various empty packagegroups. - Unify image .inc files with their .bb files as a simplification, and to move towards more how upstream Yocto Project does things. - Split pipewire tools into their own -devel packagegroup. - Remove rcar3 additions to packagegroup-agl-graphical-multimedia, as that packagegroup is not machine-specific. They will be added back in via a change in meta-agl-demo. If a downstream user desires a platform-specific packagegroup for such packages in meta-agl-core, this can be revisited, though a different implementation should be used. - Replace some :append usage with += to avoid creating problems for downstream users. Bug-AGL: SPEC-4714, SPEC-4813 Change-Id: I55b29bf749f0d5d50993a362c665bce62b785f67 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/28996 Tested-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org> Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'meta-app-framework')
-rw-r--r--meta-app-framework/recipes-config/agl-session/agl-session_0.1.bb49
-rw-r--r--meta-app-framework/recipes-config/agl-session/files/50-xdg-data-dirs.sh7
-rw-r--r--meta-app-framework/recipes-config/agl-session/files/agl-session.target5
-rw-r--r--meta-app-framework/recipes-config/agl-session/files/agl-session@.service24
-rw-r--r--meta-app-framework/recipes-core/applaunchd/applaunchd_git.bb11
-rw-r--r--meta-app-framework/recipes-graphics/wayland/agl-compositor-init.bbappend1
-rw-r--r--meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf11
-rw-r--r--meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in29
-rw-r--r--meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket10
-rw-r--r--meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc47
-rw-r--r--meta-app-framework/recipes-graphics/wayland/weston-ini-conf.bbappend1
-rw-r--r--meta-app-framework/recipes-graphics/wayland/weston-ini-conf_agl-app-fw.inc5
12 files changed, 9 insertions, 191 deletions
diff --git a/meta-app-framework/recipes-config/agl-session/agl-session_0.1.bb b/meta-app-framework/recipes-config/agl-session/agl-session_0.1.bb
deleted file mode 100644
index de31f999a..000000000
--- a/meta-app-framework/recipes-config/agl-session/agl-session_0.1.bb
+++ /dev/null
@@ -1,49 +0,0 @@
-SUMMARY = "AGL user session"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
-
-SRC_URI = "\
- file://agl-session@.service \
- file://agl-session.target \
- file://50-xdg-data-dirs.sh \
-"
-
-inherit systemd allarch useradd
-
-USERADD_PACKAGES = "${PN}"
-USERADDEXTENSION = "useradd-staticids"
-GROUPADD_PARAM:${PN} = "\
- --system display ; \
- --system video ; \
- --system pipewire ; \
- -g 1001 agl-driver ; \
- -g 1003 applaunchd ; \
-"
-
-USERADD_PARAM:${PN} = "\
- -g 1001 -u 1001 -G video,display,pipewire -o -d /home/agl-driver -m -K PASS_MAX_DAYS=-1 agl-driver ; \
- -g 1003 -u 1003 -o -d / -K PASS_MAX_DAYS=-1 applaunchd ; \
-"
-
-SYSTEMD_PACKAGES = "${PN}"
-# Instantiate session for the 'agl-driver' user, so we don't have to hardcode
-# the user name/ID in the service file itself
-SYSTEMD_SERVICE:${PN} = "agl-session@agl-driver.service"
-SYSTEMD_AUTO_ENABLE:${PN} = "enable"
-
-do_install() {
- install -d ${D}${systemd_system_unitdir}
- install -m 0644 ${WORKDIR}/agl-session@.service ${D}${systemd_system_unitdir}
-
- install -d ${D}${systemd_user_unitdir}
- install -m 0644 ${WORKDIR}/agl-session.target ${D}${systemd_user_unitdir}
-
- install -d ${D}${libdir}/systemd/user-environment-generators
- install -m 0755 ${WORKDIR}/50-xdg-data-dirs.sh ${D}${libdir}/systemd/user-environment-generators/
-}
-
-FILES:${PN} += " \
- ${systemd_system_unitdir} \
- ${systemd_user_unitdir} \
- ${libdir}/systemd/user-environment-generators/ \
-"
diff --git a/meta-app-framework/recipes-config/agl-session/files/50-xdg-data-dirs.sh b/meta-app-framework/recipes-config/agl-session/files/50-xdg-data-dirs.sh
deleted file mode 100644
index 15ec3744a..000000000
--- a/meta-app-framework/recipes-config/agl-session/files/50-xdg-data-dirs.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-# use a default value if not already set
-XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share/:/usr/share}"
-
-# write our output
-echo "XDG_DATA_DIRS=${XDG_DATA_DIRS}"
diff --git a/meta-app-framework/recipes-config/agl-session/files/agl-session.target b/meta-app-framework/recipes-config/agl-session/files/agl-session.target
deleted file mode 100644
index 84d9daa5b..000000000
--- a/meta-app-framework/recipes-config/agl-session/files/agl-session.target
+++ /dev/null
@@ -1,5 +0,0 @@
-[Unit]
-Description=AGL user session
-
-BindsTo=graphical-session.target
-Before=graphical-session.target
diff --git a/meta-app-framework/recipes-config/agl-session/files/agl-session@.service b/meta-app-framework/recipes-config/agl-session/files/agl-session@.service
deleted file mode 100644
index 61afa4141..000000000
--- a/meta-app-framework/recipes-config/agl-session/files/agl-session@.service
+++ /dev/null
@@ -1,24 +0,0 @@
-[Unit]
-Description=AGL user session
-After=systemd-user-sessions.service
-Wants=dbus.socket
-After=dbus.socket
-After=session-c1.scope
-Before=multi-user.target
-
-[Service]
-Environment=XDG_SESSION_TYPE=wayland
-ExecStart=/bin/systemctl --wait --user start agl-session.target
-TimeoutStartSec=30
-# This is a template service, instantiate for desired user's name or uid
-User=%i
-PAMName=login
-WorkingDirectory=~
-StandardInput=tty-fail
-StandardOutput=journal
-StandardError=journal
-Restart=always
-RestartSec=3s
-
-[Install]
-WantedBy=multi-user.target
diff --git a/meta-app-framework/recipes-core/applaunchd/applaunchd_git.bb b/meta-app-framework/recipes-core/applaunchd/applaunchd_git.bb
index 3b2265df0..767c8bcc5 100644
--- a/meta-app-framework/recipes-core/applaunchd/applaunchd_git.bb
+++ b/meta-app-framework/recipes-core/applaunchd/applaunchd_git.bb
@@ -29,7 +29,14 @@ SRCREV = "7a3e870a8349d43a4838604db2c28140c2f76c9f"
S = "${WORKDIR}/git"
-inherit meson pkgconfig systemd
+inherit meson pkgconfig systemd useradd
+
+USERADD_PACKAGES = "${PN}"
+USERADDEXTENSION = "useradd-staticids"
+GROUPADD_PARAM:${PN} = "-g 1003 applaunchd ; "
+USERADD_PARAM:${PN} = "\
+ -g 1003 -u 1003 -o -d / -K PASS_MAX_DAYS=-1 applaunchd ; \
+"
SYSTEMD_SERVICE:${PN} = "applaunchd.service"
@@ -58,7 +65,7 @@ FILES:${PN}-template-agl-app-web = "${systemd_system_unitdir}/agl-app-web@.servi
FILES:${PN}-template-agl-app-flutter = "${systemd_system_unitdir}/agl-app-flutter@.service"
RDEPENDS:${PN} += " \
- agl-session \
+ agl-users \
polkit-rule-agl-app \
"
diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init.bbappend b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init.bbappend
deleted file mode 100644
index 70cbaabe2..000000000
--- a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-require ${@bb.utils.contains('AGL_FEATURES', 'agl-app-fw', 'agl-compositor-init_agl-app-fw.inc', '', d)}
diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf
deleted file mode 100644
index 66778a91b..000000000
--- a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-ConditionPathExists=/dev/tty7
-
-[Service]
-Environment=XDG_SESSION_TYPE=wayland
-TTYPath=/dev/tty7
-TTYReset=yes
-TTYVHangup=yes
-TTYVTDisallocate=yes
-UtmpIdentifier=tty7
-UtmpMode=user
diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in
deleted file mode 100644
index fd56c7c3e..000000000
--- a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# Weston must be built with systemd support, and your weston.ini must load
-# the plugin systemd-notify.so.
-
-[Unit]
-Description=agl-compositor, a Wayland compositor, as a systemd user service
-Documentation=https://docs.automotivelinux.org/en/master/#5_Component_Documentation/1_agl-compositor/
-
-# Activate using a systemd socket
-Requires=agl-compositor.socket
-After=agl-compositor.socket
-
-# Since we are part of the agl session, make sure we are started before
-# it is complete.
-Before=agl-session.target
-
-[Service]
-Type=notify
-EnvironmentFile=-/etc/default/agl-compositor
-ExecStart=/usr/bin/agl-compositor @AGL_COMPOSITOR_ARGS@
-
-TimeoutStartSec=60
-WatchdogSec=20
-
-StandardOutput=journal
-StandardError=journal
-
-[Install]
-WantedBy=agl-session.target
diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket
deleted file mode 100644
index ef9769ff7..000000000
--- a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Weston must be built with systemd support, and your weston.ini must load
-# the plugin systemd-notify.so.
-
-[Unit]
-Description=agl-compositor, a Wayland compositor, as a systemd user service
-Documentation=https://docs.automotivelinux.org/en/master/#5_Component_Documentation/1_agl-compositor/
-
-[Socket]
-ListenStream=%t/wayland-0
diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc
deleted file mode 100644
index b97a537d5..000000000
--- a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc
+++ /dev/null
@@ -1,47 +0,0 @@
-FILESEXTRAPATHS:prepend := "${THISDIR}/agl-compositor-init:"
-
-SRC_URI = " \
- file://agl-compositor.conf \
- file://agl-compositor.service.in \
- file://agl-compositor.socket \
- "
-
-# Reset systemd services list
-SYSTEMD_SERVICE:${PN} = ""
-
-do_install() {
- # Process ".in" files
- files=agl-compositor.service.in
- for f in ${files}; do
- g=${f%.in}
- if [ "${f}" != "${g}" ]; then
- sed -e "s,@AGL_COMPOSITOR_ARGS@,${AGL_COMPOSITOR_ARGS},g" \
- ${WORKDIR}/${f} > ${WORKDIR}/${g}
- fi
- done
-
- install -d ${D}${systemd_system_unitdir}/agl-session@agl-driver.service.d
- install -m 0644 ${WORKDIR}/agl-compositor.conf \
- ${D}${systemd_system_unitdir}/agl-session@agl-driver.service.d/agl-compositor.conf
-
- install -D -p -m0644 ${WORKDIR}/agl-compositor.service ${D}${systemd_user_unitdir}/agl-compositor.service
- install -D -p -m0644 ${WORKDIR}/agl-compositor.socket ${D}${systemd_user_unitdir}/agl-compositor.socket
-
- # Enable the compositor as part of the user session
- install -d ${D}${systemd_user_unitdir}/agl-session.target.wants
- ln -s ../agl-compositor.service ${D}${systemd_user_unitdir}/agl-session.target.wants/agl-compositor.service
-}
-
-FILES:${PN} = "\
- ${systemd_system_unitdir} \
- ${systemd_user_unitdir} \
-"
-
-RDEPENDS:${PN} = " \
- agl-compositor \
- agl-shell-activator \
- agl-session \
- weston-ini \
-"
-
-RCONFLICTS:${PN} = "weston-init"
diff --git a/meta-app-framework/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-app-framework/recipes-graphics/wayland/weston-ini-conf.bbappend
deleted file mode 100644
index 699275fe8..000000000
--- a/meta-app-framework/recipes-graphics/wayland/weston-ini-conf.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-require ${@bb.utils.contains('AGL_FEATURES', 'agl-app-fw', 'weston-ini-conf_agl-app-fw.inc', '', d)}
diff --git a/meta-app-framework/recipes-graphics/wayland/weston-ini-conf_agl-app-fw.inc b/meta-app-framework/recipes-graphics/wayland/weston-ini-conf_agl-app-fw.inc
deleted file mode 100644
index 48af1968c..000000000
--- a/meta-app-framework/recipes-graphics/wayland/weston-ini-conf_agl-app-fw.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-RDEPENDS:${PN} = ""
-RDEPENDS:${PN}-landscape = ""
-RDEPENDS:${PN}-landscape-inverted = ""
-RDEPENDS:${PN}-no-activate = ""
-RDEPENDS:${PN}-landscape-no-activate = ""