summaryrefslogtreecommitdiffstats
path: root/recipes-demo/native-shell-client
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-11-22 03:36:44 -0500
committerScott Murray <scott.murray@konsulko.com>2022-11-22 03:36:44 -0500
commit2848a3d0591c7d0c9e97f208f00899a0f254ad0a (patch)
tree5e9801707b690756ccbe05529b2c2fd162f8bf9f /recipes-demo/native-shell-client
parentb0964661d03b2958dd58275f337ce7f96fe2ae5a (diff)
native-shell-client: Add systemd unit
Add a bbappend for native-shell-client to add a systemd unit that runs in the agl-driver user session. This is required to actually get it started if it is built into an image. Bug-AGL: SPEC-4618 Change-Id: If6c1c015544ee6f126fb30ca67822a38a83df64c Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'recipes-demo/native-shell-client')
-rw-r--r--recipes-demo/native-shell-client/files/native-shell-client.service11
-rw-r--r--recipes-demo/native-shell-client/native-shell-client_agldemo.inc13
-rw-r--r--recipes-demo/native-shell-client/native-shell-client_git.bbappend1
3 files changed, 25 insertions, 0 deletions
diff --git a/recipes-demo/native-shell-client/files/native-shell-client.service b/recipes-demo/native-shell-client/files/native-shell-client.service
new file mode 100644
index 000000000..4d77513a9
--- /dev/null
+++ b/recipes-demo/native-shell-client/files/native-shell-client.service
@@ -0,0 +1,11 @@
+[Unit]
+Requires=agl-compositor.service
+After=agl-compositor.service
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/native-shell-client
+Restart=on-failure
+
+[Install]
+WantedBy=agl-session.target
diff --git a/recipes-demo/native-shell-client/native-shell-client_agldemo.inc b/recipes-demo/native-shell-client/native-shell-client_agldemo.inc
new file mode 100644
index 000000000..5e2538ee3
--- /dev/null
+++ b/recipes-demo/native-shell-client/native-shell-client_agldemo.inc
@@ -0,0 +1,13 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI += "file://native-shell-client.service"
+
+do_install:append() {
+ install -d ${D}${systemd_user_unitdir}/agl-session.target.wants
+ install -m0644 ${WORKDIR}/native-shell-client.service ${D}${systemd_user_unitdir}/native-shell-client.service
+ ln -s ../native-shell-client.service ${D}${systemd_user_unitdir}/agl-session.target.wants/native-shell-client.service
+}
+
+FILES:${PN} += " ${systemd_user_unitdir}"
+
+RCONFLICTS:${PN} = "homescreen"
diff --git a/recipes-demo/native-shell-client/native-shell-client_git.bbappend b/recipes-demo/native-shell-client/native-shell-client_git.bbappend
new file mode 100644
index 000000000..0f2cf7595
--- /dev/null
+++ b/recipes-demo/native-shell-client/native-shell-client_git.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'agldemo', 'native-shell-client_agldemo.inc', '', d)}