From f3d032807bfdd49f17c15fbac4f4c486ca14647c Mon Sep 17 00:00:00 2001 From: Andrii Chepurnyi Date: Wed, 2 Oct 2024 23:24:14 +0300 Subject: [PATCH] dom0: reorganize doma/domu prerequestetives Introduce new property XT_DOMD_DISPLAY_SYSTEM, which will hint display system in DomD to chose appropriate domain dependancies for start. I.e. if weston used - we assume that prior guest start, weston should be ready and running to give possibility for gues draw into window. Signed-off-by: Andrii Chepurnyi --- .../recipes-guest/doma/doma.bbappend | 16 ++++++++++++++++ .../doma/files/virtio-env-no-weston.conf | 3 +++ .../doma/files/virtio-env-weston.conf | 3 +++ .../recipes-guest/doma/files/virtio-env.conf | 4 ---- .../recipes-guest/domu/domu.bbappend | 12 +++++++----- 5 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env-no-weston.conf create mode 100644 meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env-weston.conf diff --git a/meta-xt-control-domain-virtio/recipes-guest/doma/doma.bbappend b/meta-xt-control-domain-virtio/recipes-guest/doma/doma.bbappend index da3fc83..faf82ea 100644 --- a/meta-xt-control-domain-virtio/recipes-guest/doma/doma.bbappend +++ b/meta-xt-control-domain-virtio/recipes-guest/doma/doma.bbappend @@ -1,7 +1,14 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:" +# virtio-env-weston.conf whould be used if we have the weston compositor in domd +# the product should redefine variable. + +XT_DOMD_DISPLAY_SYSTEM ??= "weston" + SRC_URI += "\ file://virtio-env.conf \ + file://virtio-env-weston.conf \ + file://virtio-env-no-weston.conf \ " RDEPENDS:${PN} += " \ @@ -10,9 +17,18 @@ RDEPENDS:${PN} += " \ FILES:${PN} += " \ ${sysconfdir}/systemd/system/doma.service.d/virtio-env.conf \ + ${@bb.utils.contains('XT_DOMD_DISPLAY_SYSTEM', 'weston', \ + '${sysconfdir}/systemd/system/doma.service.d/virtio-env-weston.conf', \ + '${sysconfdir}/systemd/system/doma.service.d/virtio-env-no-weston.conf', d)} \ " do_install:append() { install -d ${D}${sysconfdir}/systemd/system/doma.service.d install -m 0644 ${WORKDIR}/virtio-env.conf ${D}${sysconfdir}/systemd/system/doma.service.d + + if ${@bb.utils.contains('XT_DOMD_DISPLAY_SYSTEM', 'weston', 'true', 'false', d)}; then + install -m 0644 ${WORKDIR}/virtio-env-weston.conf ${D}${sysconfdir}/systemd/system/doma.service.d + else + install -m 0644 ${WORKDIR}/virtio-env-no-weston.conf ${D}${sysconfdir}/systemd/system/doma.service.d + fi } diff --git a/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env-no-weston.conf b/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env-no-weston.conf new file mode 100644 index 0000000..bbd5822 --- /dev/null +++ b/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env-no-weston.conf @@ -0,0 +1,3 @@ +[Unit] +Requires=backend-ready@bridge.service +After=backend-ready@bridge.service diff --git a/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env-weston.conf b/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env-weston.conf new file mode 100644 index 0000000..5d0b08f --- /dev/null +++ b/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env-weston.conf @@ -0,0 +1,3 @@ +[Unit] +Requires=backend-ready@weston-up.service +After=backend-ready@weston-up.service diff --git a/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env.conf b/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env.conf index 3fd2939..98ddeb7 100644 --- a/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env.conf +++ b/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env.conf @@ -1,7 +1,3 @@ -[Unit] -Requires=backend-ready@weston-up.service -After=backend-ready@weston-up.service - [Service] Type=simple ExecStart= diff --git a/meta-xt-control-domain-virtio/recipes-guest/domu/domu.bbappend b/meta-xt-control-domain-virtio/recipes-guest/domu/domu.bbappend index bb6d6d2..c22baca 100644 --- a/meta-xt-control-domain-virtio/recipes-guest/domu/domu.bbappend +++ b/meta-xt-control-domain-virtio/recipes-guest/domu/domu.bbappend @@ -1,5 +1,10 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:" +# virtio-env-weston.conf whould be used if we have the weston compositor in domd +# the product should redefine variable. + +XT_DOMD_DISPLAY_SYSTEM ??= "weston" + SRC_URI += "\ file://virtio-env.conf \ file://virtio-env-weston.conf \ @@ -12,7 +17,7 @@ RDEPENDS:${PN} += " \ FILES:${PN} += " \ ${sysconfdir}/systemd/system/domu.service.d/virtio-env.conf \ - ${@bb.utils.contains('MACHINE_FEATURES', 'gsx', \ + ${@bb.utils.contains('XT_DOMD_DISPLAY_SYSTEM', 'weston', \ '${sysconfdir}/systemd/system/domu.service.d/virtio-env-weston.conf', \ '${sysconfdir}/systemd/system/domu.service.d/virtio-env-no-weston.conf', d)} \ " @@ -21,10 +26,7 @@ do_install:append() { install -d ${D}${sysconfdir}/systemd/system/domu.service.d install -m 0644 ${WORKDIR}/virtio-env.conf ${D}${sysconfdir}/systemd/system/domu.service.d - # this virtio-env-weston.conf whould be used if we have the 'wayland' - # distro feature inside DomU. But to avoid introducing new variable - # we can look on presence of GSX on the board. - if ${@bb.utils.contains('MACHINE_FEATURES', 'gsx', 'true', 'false', d)}; then + if ${@bb.utils.contains('XT_DOMD_DISPLAY_SYSTEM', 'weston', 'true', 'false', d)}; then install -m 0644 ${WORKDIR}/virtio-env-weston.conf ${D}${sysconfdir}/systemd/system/domu.service.d else install -m 0644 ${WORKDIR}/virtio-env-no-weston.conf ${D}${sysconfdir}/systemd/system/domu.service.d