meta-agl-core: fix polkit dependencies 14/29014/2
authorScott Murray <scott.murray@konsulko.com>
Tue, 13 Jun 2023 20:21:39 +0000 (16:21 -0400)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Fri, 16 Jun 2023 10:54:38 +0000 (10:54 +0000)
As part of the systemd user session removal, some changes were
made to attempt to fix pulling in polkit for core-image-weston,
agl-image-weston, and agl-image-compositor so that the compositors
would correctly start up in the resulting images.  Unfortunately,
just gating the dependency on polkit being in DISTRO_FEATURES breaks
the usecase of using poky and meta-agl-core with our poky-agl distro
configuration without also pulling in the meta-oe layer.  This
combination is used for testing meta-agl-core on the Yocto Project
autobuilder, so that broke and was reported by upstream.

To fix this usecase, the polkit dependency logic has been shifted to
weston-init and agl-compositor-init via bbappends that are only used
when meta-oe is present via our existing BBFILES_DYNAMIC set up.
Since the dependency on polkit stems from a combination of the
compositor PAM configuration from the -init packages and having
systemd, pam, and polkit in DISTRO_FEATURES, this seems more correct,
anyways.

Other changes:
- The explicit pam DISTRO_FEATURES checking that was added in the
  previous cleanup has been removed; it is actually redundant due to
  weston and weston-init having checks.  Using the .inc file for that
  from upstream has been added to the agl-compositor and
  agl-compositor-init recipes to match the weston recipes and make
  the dependency visible in our tree.
- There is no further need for our bbappend to core-image-weston, so
  it has been removed.

Bug-AGL: SPEC-4836

Change-Id: Ia3052023dfb06d1c2190a03c72606ab4b27bbdd2
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/29014
Tested-by: Jenkins Job builder account
ci-image-build: Jenkins Job builder account
ci-image-boot-test: Jenkins Job builder account
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
13 files changed:
meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init.bbappend [new file with mode: 0644]
meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init_aglcore.inc [new file with mode: 0644]
meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/common-init.inc [new file with mode: 0644]
meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init.bbappend [new file with mode: 0644]
meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init_aglcore.inc [new file with mode: 0644]
meta-agl-core/dynamic-layers/meta-oe/recipes-platform/images/agl-image-compositor.bbappend [new file with mode: 0644]
meta-agl-core/recipes-core/images/core-image-weston.bbappend [deleted file]
meta-agl-core/recipes-core/images/core-image-weston_aglcore.inc [deleted file]
meta-agl-core/recipes-graphics/wayland/agl-compositor-init.bb
meta-agl-core/recipes-graphics/wayland/agl-compositor_git.bb
meta-agl-core/recipes-platform/images/agl-image-compositor.bb
meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-graphical-compositor.bb
meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-graphical-weston.bb

diff --git a/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init.bbappend b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init.bbappend
new file mode 100644 (file)
index 0000000..4b6deff
--- /dev/null
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'agl-compositor-init_aglcore.inc', '', d)}
diff --git a/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init_aglcore.inc b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/agl-compositor-init_aglcore.inc
new file mode 100644 (file)
index 0000000..b7d346d
--- /dev/null
@@ -0,0 +1 @@
+require common-init.inc
diff --git a/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/common-init.inc b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/common-init.inc
new file mode 100644 (file)
index 0000000..47f7d8b
--- /dev/null
@@ -0,0 +1,6 @@
+# If weston's PACKAGECONFIG contains systemd + pam + polkit, polkit
+# ends up a hard requirement for start up due to the pam + systemd
+# configuration that is being installed.  For now, keep things simple
+# and assume that polkit should be a dependency if it is in
+# DISTRO_FEATURES.
+RDEPENDS:${PN} += "${@bb.utils.filter('DISTRO_FEATURES', 'polkit', d)}"
diff --git a/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init.bbappend b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init.bbappend
new file mode 100644 (file)
index 0000000..c09d7cc
--- /dev/null
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'weston-init_aglcore.inc', '', d)}
diff --git a/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init_aglcore.inc b/meta-agl-core/dynamic-layers/meta-oe/recipes-graphics/wayland/weston-init_aglcore.inc
new file mode 100644 (file)
index 0000000..b7d346d
--- /dev/null
@@ -0,0 +1 @@
+require common-init.inc
diff --git a/meta-agl-core/dynamic-layers/meta-oe/recipes-platform/images/agl-image-compositor.bbappend b/meta-agl-core/dynamic-layers/meta-oe/recipes-platform/images/agl-image-compositor.bbappend
new file mode 100644 (file)
index 0000000..1e0e66f
--- /dev/null
@@ -0,0 +1,3 @@
+IMAGE_INSTALL += " \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'agl-shell-activator', '', d)} \
+"
diff --git a/meta-agl-core/recipes-core/images/core-image-weston.bbappend b/meta-agl-core/recipes-core/images/core-image-weston.bbappend
deleted file mode 100644 (file)
index 082637b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'core-image-weston_aglcore.inc', '', d)}
diff --git a/meta-agl-core/recipes-core/images/core-image-weston_aglcore.inc b/meta-agl-core/recipes-core/images/core-image-weston_aglcore.inc
deleted file mode 100644 (file)
index 7f0711e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# Required for weston startup with polkit in DISTRO_FEATURES
-IMAGE_INSTALL += "${@bb.utils.filter('DISTRO_FEATURES', 'polkit', d)}"
-
-# NOTE: In hardknott or later this can be replaced by adding "weston"
-#       to IMAGE_FEATURES.
-SYSTEMD_DEFAULT_TARGET = "graphical.target"
index a3127a3..d8baf91 100644 (file)
@@ -4,6 +4,9 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384
 
 inherit systemd
 
+# Reuse include file from upstream weston since we have the same requirements
+require recipes-graphics/wayland/required-distro-features.inc
+
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 SRC_URI = "file://agl-compositor.service \
index 46ba662..f443fe8 100644 (file)
@@ -25,6 +25,9 @@ PACKAGECONFIG[grpc-proxy] = "-Dgrpc-proxy=true,-Dgrpc-proxy=false,grpc grpc-nati
 
 inherit meson pkgconfig python3native
 
+# Reuse include file from upstream weston since we have the same requirements
+require recipes-graphics/wayland/required-distro-features.inc
+
 PACKAGES =+ "agl-shell-grpc-server"
 
 FILES:${PN} = " \
@@ -41,7 +44,6 @@ FILES:agl-shell-grpc-server = " \
 RDEPENDS:${PN} += " \
     agl-compositor-init \
     xkeyboard-config \
-    ${@bb.utils.filter('DISTRO_FEATURES', 'polkit', d)} \
 "
 
 FILES:${PN}-dev += " \
index ea48f47..b78536b 100644 (file)
@@ -11,5 +11,5 @@ SYSTEMD_DEFAULT_TARGET = "graphical.target"
 
 IMAGE_INSTALL += " \
     packagegroup-agl-graphical-compositor \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'agl-shell-activator weston-examples', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'agl-devel', 'weston-examples', '', d)} \
 "
index be12492..b2c7d8e 100644 (file)
@@ -1,13 +1,9 @@
 DESCRIPTION = "The minimal set of packages required for the AGL compositor"
 LICENSE = "MIT"
 
-inherit packagegroup features_check
-
-# agl-compositor-init requires pam enabled if started via systemd
-REQUIRED_DISTRO_FEATURES = "wayland ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}"
+inherit packagegroup
 
 RDEPENDS:${PN} += " \
     agl-compositor \
     agl-compositor-init \
-    ${@bb.utils.filter('DISTRO_FEATURES', 'polkit', d)} \
 "
index af4d90c..96f09d5 100644 (file)
@@ -1,13 +1,9 @@
 DESCRIPTION = "The minimal set of packages required for the Weston compositor"
 LICENSE = "MIT"
 
-inherit packagegroup features_check
-
-# weston-init requires pam enabled if started via systemd
-REQUIRED_DISTRO_FEATURES = "wayland ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}"
+inherit packagegroup
 
 RDEPENDS:${PN} += " \
     weston \
     weston-init \
-    ${@bb.utils.filter('DISTRO_FEATURES', 'polkit', d)} \
 "