Skip to content

Commit

Permalink
dom0: reorganize doma/domu prerequestetives
Browse files Browse the repository at this point in the history
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 <andrii_chepurnyi@epam.com>
  • Loading branch information
arminn committed Oct 2, 2024
1 parent 6b2f5a7 commit f3d0328
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 9 deletions.
16 changes: 16 additions & 0 deletions meta-xt-control-domain-virtio/recipes-guest/doma/doma.bbappend
Original file line number Diff line number Diff line change
@@ -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} += " \
Expand All @@ -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
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Unit]
Requires=backend-ready@bridge.service
After=backend-ready@bridge.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Unit]
Requires=backend-ready@weston-up.service
After=backend-ready@weston-up.service
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[Unit]
Requires=backend-ready@weston-up.service
After=backend-ready@weston-up.service

[Service]
Type=simple
ExecStart=
Expand Down
12 changes: 7 additions & 5 deletions meta-xt-control-domain-virtio/recipes-guest/domu/domu.bbappend
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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)} \
"
Expand All @@ -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
Expand Down

0 comments on commit f3d0328

Please sign in to comment.